@pluno/product-agent-web 0.1.63 → 0.1.65
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 +1750 -1419
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as qo } from "./product-agent-sdk.js";
|
|
2
|
+
const jo = "#7c3aed", pt = "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", st = "#2c2a1e", fn = [253, 250, 241], wn = 3.5;
|
|
3
|
+
function Kn(e) {
|
|
4
|
+
const t = Yn(e);
|
|
5
|
+
if (bn(Ke(t), fn) >= wn)
|
|
6
6
|
return t;
|
|
7
|
-
let
|
|
8
|
-
const i =
|
|
7
|
+
let o = Ke(t);
|
|
8
|
+
const i = Ke(st);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = Yo(o, i, 0.22), bn(o, fn) >= wn)
|
|
11
|
+
return Ft(o);
|
|
12
|
+
return Ft(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
let
|
|
14
|
+
function Vo() {
|
|
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, p =
|
|
18
|
-
|
|
17
|
+
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${p} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
24
|
-
return
|
|
22
|
+
function Ko(e) {
|
|
23
|
+
const t = Yn(e), n = Ht(Ke(t));
|
|
24
|
+
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
27
27
|
bottom: "#e7e7e7",
|
|
@@ -32,7 +32,7 @@ function Lo(e) {
|
|
|
32
32
|
highlight: "#ffffff",
|
|
33
33
|
inner: "#f4f4f4",
|
|
34
34
|
shadow: "#9d9d9d"
|
|
35
|
-
} :
|
|
35
|
+
} : n < 0.05 ? {
|
|
36
36
|
top: "#3d3d3d",
|
|
37
37
|
middle: "#171717",
|
|
38
38
|
bottom: "#030303",
|
|
@@ -44,179 +44,179 @@ function Lo(e) {
|
|
|
44
44
|
inner: "#4b4b4b",
|
|
45
45
|
shadow: "#000000"
|
|
46
46
|
} : {
|
|
47
|
-
top:
|
|
48
|
-
middle:
|
|
49
|
-
bottom:
|
|
50
|
-
edgeStart:
|
|
51
|
-
edgeMiddle:
|
|
52
|
-
edgeEnd:
|
|
53
|
-
glow:
|
|
54
|
-
highlight:
|
|
55
|
-
inner:
|
|
56
|
-
shadow:
|
|
47
|
+
top: ne(t, 0.28, -0.03),
|
|
48
|
+
middle: ne(t, 0.08, 0.04),
|
|
49
|
+
bottom: ne(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: ne(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: ne(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: ne(t, -0.18, 0.05),
|
|
53
|
+
glow: ne(t, 0.32, -0.12),
|
|
54
|
+
highlight: ne(t, 0.38, -0.18),
|
|
55
|
+
inner: ne(t, 0.24, -0.1),
|
|
56
|
+
shadow: ne(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Yn(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((
|
|
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()}` : jo;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ke(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
return `#${
|
|
70
|
+
function Ft([e, t, n]) {
|
|
71
|
+
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
|
+
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
74
|
+
function Ht([e, t, n]) {
|
|
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
|
-
return 0.2126 *
|
|
79
|
+
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const
|
|
81
|
+
function bn(e, t) {
|
|
82
|
+
const n = Ht(e), o = Ht(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const
|
|
85
|
+
function Yo(e, t, n) {
|
|
86
|
+
const o = Wt(n);
|
|
87
87
|
return [
|
|
88
|
-
e[0] + (t[0] - e[0]) *
|
|
89
|
-
e[1] + (t[1] - e[1]) *
|
|
90
|
-
e[2] + (t[2] - e[2]) *
|
|
88
|
+
e[0] + (t[0] - e[0]) * o,
|
|
89
|
+
e[1] + (t[1] - e[1]) * o,
|
|
90
|
+
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [
|
|
95
|
-
return
|
|
93
|
+
function ne(e, t, n) {
|
|
94
|
+
const [o, i, r] = Xo(Ke(e));
|
|
95
|
+
return Ft(Zo(o, Wt(i + n), Wt(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const
|
|
97
|
+
function Xo([e, t, n]) {
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
|
-
const
|
|
102
|
-
return [(l ===
|
|
101
|
+
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
|
+
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Zo(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
|
-
return [
|
|
107
|
-
const
|
|
106
|
+
return [n * 255, n * 255, n * 255];
|
|
107
|
+
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
At(i, o, e + 1 / 3) * 255,
|
|
110
|
+
At(i, o, e) * 255,
|
|
111
|
+
At(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
let
|
|
116
|
-
return
|
|
114
|
+
function At(e, t, n) {
|
|
115
|
+
let o = n;
|
|
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 Wt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Xn = "suggest_share_on_socials";
|
|
122
|
+
function Jo(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
124
|
+
const n = e[t];
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== Xn)
|
|
126
126
|
continue;
|
|
127
|
-
const
|
|
128
|
-
if (!
|
|
127
|
+
const o = _n(e, t, "assistant");
|
|
128
|
+
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = _n(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
|
-
id: `share:${
|
|
132
|
+
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
134
|
-
assistantAnswer:
|
|
134
|
+
assistantAnswer: o.content
|
|
135
135
|
} : null;
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function Qo(e) {
|
|
140
|
+
const t = await ei(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
|
|
146
|
-
for (let
|
|
147
|
-
const i = e[
|
|
148
|
-
if (i.role ===
|
|
149
|
-
return { index:
|
|
145
|
+
function _n(e, t, n) {
|
|
146
|
+
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
|
+
const i = e[o];
|
|
148
|
+
if (i.role === n && i.content.trim())
|
|
149
|
+
return { index: o, content: i.content.trim() };
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function ei(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
158
|
-
let
|
|
156
|
+
const ti = "https://app.pluno.ai", ni = "/api/product-agent/embed/active-users", oi = 1800, ii = 15e3, ai = 250, ri = 1e3, li = 3e4;
|
|
157
|
+
function pi(e, t = {}) {
|
|
158
|
+
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
|
-
}, p = (
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
}, d = (
|
|
166
|
-
if (l(),
|
|
167
|
-
|
|
161
|
+
}, p = (u) => {
|
|
162
|
+
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
+
c();
|
|
164
|
+
}, ci(u)));
|
|
165
|
+
}, d = (u) => {
|
|
166
|
+
if (l(), o === null) {
|
|
167
|
+
o = u, e(u);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const m = o, E = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
|
-
if (
|
|
172
|
+
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - E) / oi);
|
|
177
|
+
o = Math.round(m + (u - m) * ui(v)), e(o), v >= 1 && (o = u, e(u), l());
|
|
178
|
+
}, ai);
|
|
179
|
+
}, c = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
181
|
+
const u = await si(t);
|
|
182
|
+
if (n)
|
|
183
183
|
return;
|
|
184
|
-
d(
|
|
184
|
+
d(u.count), p(u.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
p(
|
|
186
|
+
p(ii);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
190
|
-
|
|
189
|
+
return c(), () => {
|
|
190
|
+
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function si(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(ni, di(e.backendUrl ?? ti)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
200
|
-
if (!
|
|
200
|
+
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const
|
|
202
|
+
const o = await n.json(), i = xn(o.count), r = xn(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
203
|
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
205
|
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function xn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function di(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
return Math.min(
|
|
213
|
+
function ci(e) {
|
|
214
|
+
return Math.min(li, Math.max(ri, e));
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function ui(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 Zn = 100, gi = 1e4, hi = 5e3, mi = "product-agent:sdk-preview-socket-connect", fi = "product-agent:sdk-preview-socket-send", wi = "product-agent:sdk-preview-socket-close", bi = "product-agent:sdk-preview-socket-open", _i = "product-agent:sdk-preview-socket-message", xi = "product-agent:sdk-preview-socket-error", yi = "product-agent:sdk-preview-socket-closed", yn = "product-agent:sdk-preview-socket-id", vi = "data-pluno-sdk-preview-channel", Ci = "product-agent:preview-diagnostic", Jn = "pluno.productAgent.sharePromptsDisabled", Si = 3, vn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Ei = 400, ki = 5e3, Li = 500, Cn = "Close the page's popup to chat", Pi = "No recent chats for this page yet.", oe = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const On = 100, jo = 1e4, Vo = 5e3, Ko = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !1,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
},
|
|
227
|
+
}, Ii = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Sn = "pluno-pa-scribble-font", Qn = 190, eo = 41, En = 22, Ai = 16, Ni = 24, Ti = 1, Di = 48, Jt = 420, Ri = 520, zi = 0.24, Qt = 680, Mi = 800, Oi = 0.76, I = 8, Ce = 50, to = "http://www.w3.org/2000/svg", Gt = 26, $t = 8, Bi = 36, qt = 16, Ui = 4, kn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,20 +261,20 @@ const On = 100, jo = 1e4, Vo = 5e3, Ko = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
],
|
|
265
|
-
let
|
|
266
|
-
function
|
|
267
|
-
return (t) => new
|
|
264
|
+
], Fi = 11, Hi = 13, jt = 4, no = 10, oo = 40, Wi = "movable-launcher-position-v2", io = "pluno-pa-widget-styles", ao = "data-pluno-pa-widget-styles";
|
|
265
|
+
let Ln = 0;
|
|
266
|
+
function Gi(e) {
|
|
267
|
+
return (t) => new se(t, e);
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function $i(e = {}) {
|
|
270
270
|
const t = {
|
|
271
|
-
launcherLabel: e.launcherLabel ??
|
|
272
|
-
accentColor: e.accentColor ??
|
|
273
|
-
colorScheme: e.colorScheme ??
|
|
274
|
-
fontFamily: e.fontFamily ??
|
|
275
|
-
scribbleStyle: e.scribbleStyle ??
|
|
276
|
-
position: e.position ??
|
|
277
|
-
movableLauncher: e.movableLauncher ??
|
|
271
|
+
launcherLabel: e.launcherLabel ?? oe.launcherLabel,
|
|
272
|
+
accentColor: e.accentColor ?? oe.accentColor,
|
|
273
|
+
colorScheme: e.colorScheme ?? oe.colorScheme,
|
|
274
|
+
fontFamily: e.fontFamily ?? oe.fontFamily,
|
|
275
|
+
scribbleStyle: e.scribbleStyle ?? oe.scribbleStyle,
|
|
276
|
+
position: e.position ?? oe.position,
|
|
277
|
+
movableLauncher: e.movableLauncher ?? oe.movableLauncher,
|
|
278
278
|
token: e.token,
|
|
279
279
|
tokenProvider: e.tokenProvider,
|
|
280
280
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -308,7 +308,7 @@ async function ki(e = {}) {
|
|
|
308
308
|
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
|
|
309
309
|
taskNotifications: e.taskNotifications
|
|
310
310
|
};
|
|
311
|
-
|
|
311
|
+
J(
|
|
312
312
|
"web-sdk.widget",
|
|
313
313
|
"Mounting widget with merged options",
|
|
314
314
|
{
|
|
@@ -323,41 +323,41 @@ async function ki(e = {}) {
|
|
|
323
323
|
initialStarterPromptCount: t.initialStarterPrompts?.length ?? 0
|
|
324
324
|
}
|
|
325
325
|
);
|
|
326
|
-
const
|
|
327
|
-
|
|
328
|
-
|
|
326
|
+
const n = document.createElement("div");
|
|
327
|
+
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
|
|
328
|
+
vi,
|
|
329
329
|
t.sdkPreviewChannelId
|
|
330
330
|
);
|
|
331
|
-
const
|
|
331
|
+
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
332
332
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
333
|
-
let r =
|
|
333
|
+
let r = Pn(
|
|
334
334
|
t.accentColor,
|
|
335
335
|
t.scribbleStyle
|
|
336
336
|
);
|
|
337
|
-
|
|
337
|
+
ga(
|
|
338
338
|
i,
|
|
339
339
|
t.launcherLabel,
|
|
340
340
|
r,
|
|
341
341
|
t.movableLauncher,
|
|
342
342
|
t.showLauncherMinimizeButton
|
|
343
|
-
),
|
|
344
|
-
const l =
|
|
345
|
-
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null;
|
|
346
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"),
|
|
343
|
+
), o.appendChild(i);
|
|
344
|
+
const l = sr(t);
|
|
345
|
+
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ve(
|
|
347
347
|
i,
|
|
348
|
-
|
|
348
|
+
Tt(
|
|
349
349
|
i,
|
|
350
350
|
p,
|
|
351
351
|
t.position
|
|
352
352
|
)
|
|
353
|
-
)),
|
|
353
|
+
)), $n(o, t.accentColor), In(i, r, {
|
|
354
354
|
accentColor: t.accentColor,
|
|
355
355
|
colorScheme: t.colorScheme,
|
|
356
356
|
fontFamily: t.fontFamily,
|
|
357
357
|
scribbleStyle: t.scribbleStyle
|
|
358
358
|
});
|
|
359
|
-
const
|
|
360
|
-
|
|
359
|
+
const m = await pr(), E = m.ownerDocument;
|
|
360
|
+
m.appendChild(n), J(
|
|
361
361
|
"web-sdk.widget",
|
|
362
362
|
"Applied initial widget appearance",
|
|
363
363
|
{
|
|
@@ -367,78 +367,82 @@ async function ki(e = {}) {
|
|
|
367
367
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
368
368
|
}
|
|
369
369
|
);
|
|
370
|
-
const
|
|
370
|
+
const v = i.querySelector(
|
|
371
371
|
".pluno-pa-widget__launcher"
|
|
372
|
-
),
|
|
372
|
+
), z = i.querySelector(
|
|
373
373
|
".pluno-pa-widget__launcher-drag-handle"
|
|
374
374
|
), b = i.querySelector(
|
|
375
375
|
".pluno-pa-widget__launcher-input"
|
|
376
|
-
),
|
|
376
|
+
), g = i.querySelector(
|
|
377
377
|
".pluno-pa-widget__launcher-minimize"
|
|
378
|
-
),
|
|
378
|
+
), w = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
379
|
+
".pluno-pa-widget__scribble-spirals--panel"
|
|
380
|
+
), P = Array.from(
|
|
381
|
+
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
382
|
+
), A = i.querySelector(
|
|
379
383
|
".pluno-pa-widget__close"
|
|
380
|
-
),
|
|
384
|
+
), k = i.querySelector(
|
|
381
385
|
".pluno-pa-widget__composer"
|
|
382
|
-
),
|
|
386
|
+
), F = i.querySelector(
|
|
383
387
|
".pluno-pa-widget__attachment-error"
|
|
384
|
-
),
|
|
388
|
+
), H = i.querySelector(
|
|
385
389
|
".pluno-pa-widget__billing-status"
|
|
386
|
-
),
|
|
390
|
+
), $ = i.querySelector(
|
|
387
391
|
".pluno-pa-widget__attachments"
|
|
388
|
-
),
|
|
392
|
+
), Q = i.querySelector(
|
|
389
393
|
".pluno-pa-widget__attachment-input"
|
|
390
|
-
),
|
|
394
|
+
), ze = i.querySelector(
|
|
391
395
|
".pluno-pa-widget__attach"
|
|
392
|
-
),
|
|
396
|
+
), x = i.querySelector(
|
|
393
397
|
".pluno-pa-widget__input"
|
|
394
|
-
),
|
|
398
|
+
), de = i.querySelector(
|
|
395
399
|
".pluno-pa-widget__send"
|
|
396
|
-
),
|
|
400
|
+
), Ye = i.querySelector(
|
|
397
401
|
".pluno-pa-widget__top-actions"
|
|
398
|
-
),
|
|
402
|
+
), X = i.querySelector(
|
|
399
403
|
".pluno-pa-widget__history"
|
|
400
|
-
),
|
|
404
|
+
), C = i.querySelector(
|
|
401
405
|
".pluno-pa-widget__history-panel"
|
|
402
|
-
),
|
|
406
|
+
), T = i.querySelector(
|
|
403
407
|
".pluno-pa-widget__history-list"
|
|
404
|
-
),
|
|
408
|
+
), Se = i.querySelector(
|
|
405
409
|
".pluno-pa-widget__history-close"
|
|
406
|
-
),
|
|
410
|
+
), q = i.querySelector(
|
|
407
411
|
".pluno-pa-widget__history-status"
|
|
408
|
-
),
|
|
412
|
+
), R = i.querySelector(
|
|
409
413
|
".pluno-pa-widget__timeline-jump"
|
|
410
|
-
),
|
|
414
|
+
), D = i.querySelector(
|
|
411
415
|
".pluno-pa-widget__active-users-counter"
|
|
412
|
-
),
|
|
416
|
+
), N = i.querySelector(
|
|
413
417
|
".pluno-pa-widget__timeline"
|
|
414
|
-
),
|
|
418
|
+
), ht = i.querySelector(
|
|
415
419
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
416
|
-
),
|
|
420
|
+
), Me = i.querySelector(
|
|
417
421
|
".pluno-pa-widget__notify-suggestion"
|
|
418
|
-
),
|
|
422
|
+
), vo = i.querySelector(
|
|
419
423
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
420
|
-
),
|
|
424
|
+
), Co = i.querySelector(
|
|
421
425
|
".pluno-pa-widget__notify-suggestion-later"
|
|
422
|
-
),
|
|
426
|
+
), So = i.querySelector(
|
|
423
427
|
".pluno-pa-widget__notify-suggestion-never"
|
|
424
428
|
);
|
|
425
|
-
if (!
|
|
429
|
+
if (!v || !b || !w || !A || !k || !F || !H || !$ || !Q || !ze || !x || !de || !Ye || !X || !C || !T || !Se || !q || !R || !D || !N || !ht)
|
|
426
430
|
throw new Error("Failed to mount Pluno widget");
|
|
427
|
-
if (t.movableLauncher && !
|
|
431
|
+
if (t.movableLauncher && !z)
|
|
428
432
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
429
|
-
|
|
430
|
-
let
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
Mn(b), Mn(x);
|
|
434
|
+
let W = [], le = null;
|
|
435
|
+
const Ee = () => {
|
|
436
|
+
Ta(
|
|
437
|
+
$,
|
|
438
|
+
W,
|
|
435
439
|
(a) => {
|
|
436
|
-
|
|
440
|
+
W = W.filter(
|
|
437
441
|
(s, _) => _ !== a
|
|
438
|
-
),
|
|
442
|
+
), Ee(), G(y.getState()), j();
|
|
439
443
|
}
|
|
440
444
|
);
|
|
441
|
-
},
|
|
445
|
+
}, Eo = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
442
446
|
if (!t.tokenEndpoint)
|
|
443
447
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
444
448
|
const a = await fetch(t.tokenEndpoint, {
|
|
@@ -456,15 +460,15 @@ async function ki(e = {}) {
|
|
|
456
460
|
if (!s.token)
|
|
457
461
|
throw new Error("Pluno token endpoint did not return a token");
|
|
458
462
|
return s.token;
|
|
459
|
-
}),
|
|
460
|
-
let
|
|
461
|
-
|
|
463
|
+
}), ko = window.fetch.bind(window);
|
|
464
|
+
let y;
|
|
465
|
+
y = await qo.init({
|
|
462
466
|
token: t.token,
|
|
463
|
-
tokenProvider:
|
|
467
|
+
tokenProvider: Eo,
|
|
464
468
|
backendUrl: t.backendUrl,
|
|
465
469
|
metadata: () => ({
|
|
466
470
|
...t.metadata ?? {},
|
|
467
|
-
...!
|
|
471
|
+
...!y.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
468
472
|
}),
|
|
469
473
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
470
474
|
clientId: t.clientId,
|
|
@@ -474,118 +478,119 @@ async function ki(e = {}) {
|
|
|
474
478
|
prepareAttachmentUpload: t.prepareAttachmentUpload,
|
|
475
479
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0
|
|
476
480
|
});
|
|
477
|
-
const
|
|
481
|
+
const mt = new Set(l.openToolGroupKeys), ke = new Set(
|
|
478
482
|
l.seenShareCandidateIds
|
|
479
|
-
),
|
|
480
|
-
let
|
|
483
|
+
), Xe = new Set(ke);
|
|
484
|
+
let ft = l.sharePromptsDisabled || await dr(t), Z = null, Le = !1, fe = !1, we = {
|
|
481
485
|
enabled: !0
|
|
482
|
-
},
|
|
483
|
-
const
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
490
|
-
|
|
491
|
-
},
|
|
492
|
-
if (
|
|
486
|
+
}, be = 0, nn = "", ce = !1, pe = !1, ue = [], wt = null, Oe = null;
|
|
487
|
+
const ee = (a, s) => {
|
|
488
|
+
we = { enabled: a, reason: s };
|
|
489
|
+
}, te = () => {
|
|
490
|
+
R.hidden = !0;
|
|
491
|
+
}, Lo = () => {
|
|
492
|
+
R.hidden = !1;
|
|
493
|
+
}, Po = (a = "jump") => {
|
|
494
|
+
ee(!0, a), te(), Ve(N, () => we.enabled), be = N.scrollTop;
|
|
495
|
+
}, _e = () => {
|
|
496
|
+
if (X.hidden = t.loginRequired, C.hidden = !ce, X.setAttribute("aria-expanded", String(ce)), T.classList.toggle(
|
|
493
497
|
"pluno-pa-widget__history-list--center",
|
|
494
|
-
|
|
495
|
-
),
|
|
498
|
+
pe && ue.length === 0
|
|
499
|
+
), T.replaceChildren(), pe && ue.length === 0) {
|
|
496
500
|
const a = document.createElement("p");
|
|
497
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
501
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", T.appendChild(a);
|
|
498
502
|
}
|
|
499
|
-
for (const a of
|
|
503
|
+
for (const a of ue) {
|
|
500
504
|
const s = document.createElement("button");
|
|
501
|
-
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled =
|
|
505
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = pe;
|
|
502
506
|
const _ = document.createElement("span");
|
|
503
|
-
_.className = "pluno-pa-widget__history-item-title", _.textContent =
|
|
504
|
-
const
|
|
505
|
-
|
|
507
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = da(a);
|
|
508
|
+
const L = document.createElement("time");
|
|
509
|
+
L.className = "pluno-pa-widget__history-time", L.dateTime = a.lastActiveAt, L.textContent = ua(
|
|
506
510
|
a.lastActiveAt,
|
|
507
511
|
Date.now()
|
|
508
512
|
);
|
|
509
|
-
const
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
}),
|
|
513
|
+
const M = document.createElement("small");
|
|
514
|
+
M.className = "pluno-pa-widget__history-path", M.textContent = ca(a), s.append(_, L, M), s.addEventListener("click", () => {
|
|
515
|
+
ce = !1, Oe = null, _e(), ee(!0, "newSession"), te(), y.loadSession(a.id), G(y.getState());
|
|
516
|
+
}), T.appendChild(s);
|
|
513
517
|
}
|
|
514
|
-
if (
|
|
518
|
+
if (pe && ue.length > 0) {
|
|
515
519
|
const a = document.createElement("p");
|
|
516
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
520
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", T.appendChild(a);
|
|
517
521
|
}
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
if (!
|
|
521
|
-
|
|
522
|
+
q.textContent = Oe ?? (!pe && ue.length === 0 ? "No recent chats for this page yet." : ""), q.hidden = q.textContent.length === 0;
|
|
523
|
+
}, on = async (a) => {
|
|
524
|
+
if (!pe) {
|
|
525
|
+
pe = !0, Oe = null, _e();
|
|
522
526
|
try {
|
|
523
|
-
const s = await
|
|
524
|
-
|
|
527
|
+
const s = await y.listSessions({ cursor: a, limit: 20 });
|
|
528
|
+
ue = a ? [...ue, ...s.sessions] : s.sessions, wt = s.nextCursor;
|
|
525
529
|
} catch (s) {
|
|
526
|
-
|
|
530
|
+
J(
|
|
527
531
|
"web-sdk.widget",
|
|
528
532
|
"Failed to load session history",
|
|
529
533
|
{
|
|
530
534
|
message: s instanceof Error ? s.message : String(s)
|
|
531
535
|
}
|
|
532
|
-
),
|
|
536
|
+
), Oe = Pi;
|
|
533
537
|
} finally {
|
|
534
|
-
|
|
538
|
+
pe = !1, _e();
|
|
535
539
|
}
|
|
536
540
|
}
|
|
537
|
-
},
|
|
538
|
-
!
|
|
539
|
-
},
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
-
|
|
541
|
+
}, Io = () => {
|
|
542
|
+
!wt || pe || T.scrollHeight - T.scrollTop - T.clientHeight <= 24 && on(wt);
|
|
543
|
+
}, Ao = () => {
|
|
544
|
+
Le || typeof document > "u" || ($n(o, t.accentColor), n.isConnected || E.body?.appendChild(n));
|
|
545
|
+
}, an = new MutationObserver(Ao);
|
|
546
|
+
an.observe(E.documentElement, {
|
|
543
547
|
childList: !0,
|
|
544
548
|
subtree: !0
|
|
545
549
|
});
|
|
546
|
-
const
|
|
547
|
-
const s =
|
|
548
|
-
return
|
|
550
|
+
const Be = (a = !0) => {
|
|
551
|
+
const s = dt(i, a);
|
|
552
|
+
return Vt(
|
|
549
553
|
i,
|
|
550
|
-
p ?
|
|
554
|
+
p ? ro(p, s) : Ji(
|
|
551
555
|
i,
|
|
552
556
|
t.position,
|
|
553
557
|
s
|
|
554
558
|
),
|
|
555
559
|
s
|
|
556
560
|
);
|
|
557
|
-
},
|
|
558
|
-
const a =
|
|
559
|
-
|
|
561
|
+
}, B = () => {
|
|
562
|
+
const a = aa(o, b, x);
|
|
563
|
+
ur(t, {
|
|
560
564
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
561
|
-
composerValue:
|
|
565
|
+
composerValue: x.value,
|
|
562
566
|
focusedInput: a,
|
|
563
567
|
focusedInputAt: a ? Date.now() : null,
|
|
564
|
-
openToolGroupKeys: [...
|
|
568
|
+
openToolGroupKeys: [...mt],
|
|
565
569
|
launcherPosition: d ? p : null,
|
|
566
|
-
|
|
567
|
-
|
|
570
|
+
panelSize: c,
|
|
571
|
+
seenShareCandidateIds: [...ke].slice(
|
|
572
|
+
-Zn
|
|
568
573
|
),
|
|
569
|
-
sharePromptsDisabled:
|
|
574
|
+
sharePromptsDisabled: ft
|
|
570
575
|
});
|
|
571
|
-
},
|
|
576
|
+
}, Ze = (a) => {
|
|
572
577
|
t.onDisplayStateChange?.(a);
|
|
573
|
-
},
|
|
578
|
+
}, Ue = (a, s = !0) => {
|
|
574
579
|
if (a === "shown") {
|
|
575
|
-
i.classList.remove("pluno-pa-widget--minimized"),
|
|
580
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && Fe(!1), s && Ze("shown");
|
|
576
581
|
return;
|
|
577
582
|
}
|
|
578
|
-
|
|
583
|
+
Z !== null && (window.clearTimeout(Z), Z = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, w.hidden = !0, A.hidden = !0, v.tabIndex = 0, x.value = "", ve(
|
|
579
584
|
i,
|
|
580
|
-
|
|
585
|
+
Tt(
|
|
581
586
|
i,
|
|
582
587
|
p,
|
|
583
588
|
t.position
|
|
584
589
|
)
|
|
585
|
-
),
|
|
586
|
-
},
|
|
587
|
-
|
|
588
|
-
debugVersion:
|
|
590
|
+
), Dn(i), B(), s && Ze("minimized");
|
|
591
|
+
}, xe = (a, s = {}) => {
|
|
592
|
+
ia(a, {
|
|
593
|
+
debugVersion: Wi,
|
|
589
594
|
launcherPosition: p,
|
|
590
595
|
rootClasses: i.className,
|
|
591
596
|
rootStyle: {
|
|
@@ -594,35 +599,35 @@ async function ki(e = {}) {
|
|
|
594
599
|
right: i.style.right,
|
|
595
600
|
bottom: i.style.bottom
|
|
596
601
|
},
|
|
597
|
-
rootRect:
|
|
598
|
-
launcherRect:
|
|
599
|
-
panelRect:
|
|
600
|
-
viewport:
|
|
601
|
-
panelHidden:
|
|
602
|
-
closeHidden:
|
|
602
|
+
rootRect: Rt(i),
|
|
603
|
+
launcherRect: Rt(v),
|
|
604
|
+
panelRect: Rt(w),
|
|
605
|
+
viewport: Y(),
|
|
606
|
+
panelHidden: w.hidden,
|
|
607
|
+
closeHidden: A.hidden,
|
|
603
608
|
...s
|
|
604
609
|
});
|
|
605
|
-
},
|
|
610
|
+
}, Fe = (a = !0) => {
|
|
606
611
|
if (!p)
|
|
607
|
-
return
|
|
608
|
-
const s =
|
|
609
|
-
return
|
|
612
|
+
return ve(i, null), Be(a);
|
|
613
|
+
const s = Be(a);
|
|
614
|
+
return ve(i, s), xe("Applied stored closed launcher position", {
|
|
610
615
|
visibleLauncherPosition: s
|
|
611
616
|
}), s;
|
|
612
|
-
},
|
|
617
|
+
}, bt = (a, s) => {
|
|
613
618
|
if (!a || !s) {
|
|
614
|
-
|
|
619
|
+
Dn(i);
|
|
615
620
|
return;
|
|
616
621
|
}
|
|
617
|
-
|
|
622
|
+
oa(i, {
|
|
618
623
|
x: a.x - s.x,
|
|
619
624
|
y: a.y - s.y
|
|
620
625
|
});
|
|
621
|
-
},
|
|
626
|
+
}, rn = () => {
|
|
622
627
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
623
|
-
|
|
628
|
+
ve(
|
|
624
629
|
i,
|
|
625
|
-
|
|
630
|
+
Tt(
|
|
626
631
|
i,
|
|
627
632
|
p,
|
|
628
633
|
t.position
|
|
@@ -630,118 +635,164 @@ async function ki(e = {}) {
|
|
|
630
635
|
);
|
|
631
636
|
return;
|
|
632
637
|
}
|
|
633
|
-
const a =
|
|
638
|
+
const a = Fe();
|
|
634
639
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
640
|
+
Nt(i, c);
|
|
641
|
+
const s = Re(c);
|
|
642
|
+
Mt(
|
|
643
|
+
h,
|
|
644
|
+
s.width
|
|
639
645
|
);
|
|
640
|
-
|
|
646
|
+
const _ = lt(
|
|
647
|
+
u ?? Dt(
|
|
648
|
+
i,
|
|
649
|
+
a,
|
|
650
|
+
t.position,
|
|
651
|
+
c
|
|
652
|
+
),
|
|
653
|
+
s
|
|
654
|
+
);
|
|
655
|
+
u && (u = _), bt(_, a), xe(
|
|
641
656
|
"Applied open panel position after viewport resize",
|
|
642
|
-
{ openPanelPosition:
|
|
657
|
+
{ openPanelPosition: _ }
|
|
643
658
|
);
|
|
644
|
-
} else p &&
|
|
659
|
+
} else p && xe(
|
|
645
660
|
"Applied visible launcher position after viewport resize",
|
|
646
661
|
{ visibleLauncherPosition: a }
|
|
647
662
|
);
|
|
648
663
|
};
|
|
649
|
-
let
|
|
664
|
+
let ln = () => {
|
|
650
665
|
};
|
|
651
|
-
window.addEventListener("resize",
|
|
666
|
+
window.addEventListener("resize", rn), t.movableLauncher && z ? (Fe(), ln = Yi({
|
|
652
667
|
root: i,
|
|
653
|
-
launcher:
|
|
654
|
-
launcherDragHandle:
|
|
655
|
-
getPosition: () =>
|
|
668
|
+
launcher: v,
|
|
669
|
+
launcherDragHandle: z,
|
|
670
|
+
getPosition: () => Be(),
|
|
656
671
|
setPosition: (a) => {
|
|
657
|
-
const s = a, _ =
|
|
672
|
+
const s = a, _ = dt(i), L = Vt(
|
|
658
673
|
i,
|
|
659
674
|
a,
|
|
660
675
|
_
|
|
661
676
|
);
|
|
662
|
-
p =
|
|
663
|
-
|
|
677
|
+
p = ea(
|
|
678
|
+
L,
|
|
664
679
|
_
|
|
665
|
-
),
|
|
680
|
+
), ve(i, L), xe("Dragging closed launcher", {
|
|
666
681
|
requestedPosition: s
|
|
667
682
|
});
|
|
668
683
|
},
|
|
669
684
|
persist: () => {
|
|
670
|
-
d = !0,
|
|
685
|
+
d = !0, B(), xe("Persisted closed launcher drag position");
|
|
671
686
|
}
|
|
672
|
-
})) :
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
687
|
+
})) : ve(i, null), Nt(i, c);
|
|
688
|
+
const No = () => {
|
|
689
|
+
const a = Re(c), s = Be();
|
|
690
|
+
return {
|
|
691
|
+
position: lt(
|
|
692
|
+
u ?? Dt(
|
|
693
|
+
i,
|
|
694
|
+
s,
|
|
695
|
+
t.position,
|
|
696
|
+
c
|
|
697
|
+
),
|
|
698
|
+
a
|
|
699
|
+
),
|
|
700
|
+
size: a
|
|
701
|
+
};
|
|
702
|
+
}, To = (a) => {
|
|
703
|
+
c = ut(a.size), Nt(i, c), Mt(
|
|
704
|
+
h,
|
|
705
|
+
Re(c).width
|
|
706
|
+
), u = lt(
|
|
707
|
+
a.position,
|
|
708
|
+
Re(c)
|
|
709
|
+
);
|
|
710
|
+
const s = Be();
|
|
711
|
+
bt(u, s);
|
|
712
|
+
}, Do = P.length > 0 ? Xi({
|
|
713
|
+
root: i,
|
|
714
|
+
handles: P,
|
|
715
|
+
getBounds: No,
|
|
716
|
+
setBounds: To,
|
|
717
|
+
persist: B
|
|
718
|
+
}) : () => {
|
|
719
|
+
};
|
|
720
|
+
let _t = !1;
|
|
721
|
+
const pn = async () => {
|
|
722
|
+
if (!(!t.billingStatusLoader || _t)) {
|
|
723
|
+
_t = !0;
|
|
677
724
|
try {
|
|
678
725
|
const a = await t.billingStatusLoader();
|
|
679
|
-
|
|
726
|
+
Bn(
|
|
680
727
|
t.billingStatus,
|
|
681
728
|
a,
|
|
682
|
-
|
|
683
|
-
) && (t.billingStatus = a,
|
|
684
|
-
|
|
729
|
+
y.getState().lastErrorCode
|
|
730
|
+
) && (t.billingStatus = a, Bt(
|
|
731
|
+
H,
|
|
685
732
|
t.billingStatus,
|
|
686
|
-
|
|
687
|
-
),
|
|
733
|
+
y.getState().lastErrorCode
|
|
734
|
+
), j());
|
|
688
735
|
} finally {
|
|
689
|
-
|
|
736
|
+
_t = !1;
|
|
690
737
|
}
|
|
691
738
|
}
|
|
692
|
-
},
|
|
693
|
-
|
|
694
|
-
|
|
739
|
+
}, ge = (a = "", s = !0) => {
|
|
740
|
+
pn(), We && (We = !1, yt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Z !== null && (window.clearTimeout(Z), Z = null), Ue("shown", !1), w.hidden = !1, A.hidden = !1, Mt(
|
|
741
|
+
h,
|
|
742
|
+
Re(c).width
|
|
743
|
+
), i.classList.remove("pluno-pa-widget--closing");
|
|
744
|
+
const _ = Fe(), L = Dt(
|
|
695
745
|
i,
|
|
696
746
|
_,
|
|
697
|
-
t.position
|
|
747
|
+
t.position,
|
|
748
|
+
c
|
|
698
749
|
);
|
|
699
|
-
if (
|
|
700
|
-
openPanelPosition:
|
|
750
|
+
if (bt(L, _), xe("Opening launcher at clamped open panel position", {
|
|
751
|
+
openPanelPosition: L,
|
|
701
752
|
visibleLauncherPosition: _
|
|
702
|
-
}),
|
|
703
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
753
|
+
}), ee(!0, "open"), te(), !s) {
|
|
754
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0);
|
|
704
755
|
return;
|
|
705
756
|
}
|
|
706
757
|
window.requestAnimationFrame(() => {
|
|
707
|
-
i.classList.add("pluno-pa-widget--open"), a && (
|
|
708
|
-
|
|
758
|
+
i.classList.add("pluno-pa-widget--open"), a && (x.value = a, je(x)), Ve(N, () => we.enabled), be = N.scrollTop, x.focus(), x.setSelectionRange(x.value.length, x.value.length), B(), Ze("shown"), t.onPanelOpenChange?.(!0), Z = window.setTimeout(() => {
|
|
759
|
+
v.hidden = !0, Ve(N, () => we.enabled), be = N.scrollTop;
|
|
709
760
|
}, 220);
|
|
710
761
|
});
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
|
|
762
|
+
}, Ro = () => {
|
|
763
|
+
Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (Fe(!1), xe("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
|
|
764
|
+
w.hidden = !0, A.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
714
765
|
}, 220);
|
|
715
766
|
};
|
|
716
|
-
|
|
717
|
-
a.preventDefault(),
|
|
718
|
-
}),
|
|
767
|
+
v.addEventListener("submit", (a) => {
|
|
768
|
+
a.preventDefault(), ge(b.value), b.value = "";
|
|
769
|
+
}), z?.addEventListener("click", (a) => {
|
|
719
770
|
a.preventDefault(), a.stopPropagation();
|
|
720
|
-
}),
|
|
721
|
-
a.target === b && !
|
|
771
|
+
}), v.addEventListener("click", (a) => {
|
|
772
|
+
a.target === b && !z || (ge(b.value), b.value = "");
|
|
722
773
|
}), b.addEventListener("focus", () => {
|
|
723
|
-
|
|
774
|
+
ge(b.value), b.value = "";
|
|
724
775
|
}), b.addEventListener("input", () => {
|
|
725
776
|
if (!b.value)
|
|
726
777
|
return;
|
|
727
778
|
const a = b.value;
|
|
728
|
-
|
|
779
|
+
ge(a), b.value = "";
|
|
729
780
|
});
|
|
730
|
-
let
|
|
731
|
-
const
|
|
781
|
+
let xt = null, Je = null, ye = null;
|
|
782
|
+
const sn = (a) => a === b || a === x, zo = (a) => {
|
|
732
783
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
733
784
|
return null;
|
|
734
785
|
let s = a;
|
|
735
786
|
for (; s; ) {
|
|
736
|
-
const _ = s.closest(
|
|
787
|
+
const _ = s.closest(vn);
|
|
737
788
|
if (_)
|
|
738
789
|
return _;
|
|
739
|
-
const
|
|
740
|
-
s =
|
|
790
|
+
const L = s.getRootNode();
|
|
791
|
+
s = L instanceof ShadowRoot ? L.host : null;
|
|
741
792
|
}
|
|
742
793
|
return null;
|
|
743
|
-
},
|
|
744
|
-
if (!a.isConnected || !a.matches(
|
|
794
|
+
}, Mo = (a) => {
|
|
795
|
+
if (!a.isConnected || !a.matches(vn))
|
|
745
796
|
return !1;
|
|
746
797
|
if (!(a instanceof HTMLElement))
|
|
747
798
|
return !0;
|
|
@@ -751,66 +802,66 @@ async function ki(e = {}) {
|
|
|
751
802
|
return a.checkVisibility();
|
|
752
803
|
const s = window.getComputedStyle(a);
|
|
753
804
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
754
|
-
},
|
|
755
|
-
|
|
756
|
-
const s =
|
|
757
|
-
(!s || !
|
|
758
|
-
},
|
|
759
|
-
},
|
|
760
|
-
|
|
805
|
+
}, dn = (a) => {
|
|
806
|
+
He !== a && (He = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), et(), a !== null ? ye = window.setInterval(() => {
|
|
807
|
+
const s = He;
|
|
808
|
+
(!s || !Mo(s)) && dn(null);
|
|
809
|
+
}, Li) : ye !== null && (window.clearInterval(ye), ye = null, Je = null));
|
|
810
|
+
}, Oo = () => {
|
|
811
|
+
ye !== null && (window.clearInterval(ye), ye = null);
|
|
761
812
|
};
|
|
762
813
|
i.addEventListener("focusin", (a) => {
|
|
763
|
-
|
|
814
|
+
sn(a.target) && (xt = Date.now(), B());
|
|
764
815
|
}), i.addEventListener("focusout", (a) => {
|
|
765
|
-
if (!
|
|
816
|
+
if (!sn(a.target) || He !== null)
|
|
766
817
|
return;
|
|
767
|
-
const s =
|
|
768
|
-
if (
|
|
818
|
+
const s = xt;
|
|
819
|
+
if (xt = null, s === null || Date.now() - s > Ei)
|
|
769
820
|
return;
|
|
770
|
-
const _ =
|
|
821
|
+
const _ = zo(a.relatedTarget);
|
|
771
822
|
if (!_)
|
|
772
823
|
return;
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
|
|
824
|
+
const L = Date.now();
|
|
825
|
+
if (Je !== null && L - Je <= ki) {
|
|
826
|
+
dn(_);
|
|
776
827
|
return;
|
|
777
828
|
}
|
|
778
|
-
|
|
779
|
-
}),
|
|
780
|
-
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(),
|
|
781
|
-
}),
|
|
829
|
+
Je = L;
|
|
830
|
+
}), v.addEventListener("keydown", (a) => {
|
|
831
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), ge());
|
|
832
|
+
}), g?.addEventListener("pointerdown", (a) => {
|
|
782
833
|
a.stopPropagation();
|
|
783
|
-
}),
|
|
784
|
-
a.preventDefault(), a.stopPropagation(),
|
|
785
|
-
}),
|
|
786
|
-
|
|
787
|
-
}),
|
|
788
|
-
|
|
834
|
+
}), g?.addEventListener("click", (a) => {
|
|
835
|
+
a.preventDefault(), a.stopPropagation(), Ue("minimized");
|
|
836
|
+
}), A.addEventListener("click", Ro), N.addEventListener("scroll", () => {
|
|
837
|
+
N.scrollTop < be - 1 && ee(!1, "userScroll"), be = N.scrollTop;
|
|
838
|
+
}), R.addEventListener("click", () => {
|
|
839
|
+
Po();
|
|
789
840
|
});
|
|
790
|
-
const
|
|
841
|
+
const cn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
791
842
|
([a]) => {
|
|
792
|
-
a?.isIntersecting && (
|
|
843
|
+
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
793
844
|
},
|
|
794
|
-
{ root:
|
|
845
|
+
{ root: N, threshold: 0 }
|
|
795
846
|
);
|
|
796
|
-
|
|
797
|
-
const
|
|
798
|
-
let
|
|
799
|
-
const
|
|
800
|
-
const a =
|
|
801
|
-
b.readOnly = a || s,
|
|
802
|
-
},
|
|
803
|
-
|
|
847
|
+
cn?.observe(ht);
|
|
848
|
+
const Qe = () => t.loginRequired || t.signupRequired;
|
|
849
|
+
let He = null, We = !1;
|
|
850
|
+
const et = () => {
|
|
851
|
+
const a = Qe(), s = He !== null;
|
|
852
|
+
b.readOnly = a || s, x.readOnly = s, b.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : We ? "New update" : t.launcherLabel, x.placeholder = s ? Cn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, k.hidden = a;
|
|
853
|
+
}, j = () => {
|
|
854
|
+
de.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, ze.disabled = Qe() || ae(t.billingStatus);
|
|
804
855
|
};
|
|
805
|
-
|
|
806
|
-
const
|
|
807
|
-
const a =
|
|
856
|
+
et();
|
|
857
|
+
const yt = () => {
|
|
858
|
+
const a = y.getState().isThinking;
|
|
808
859
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
809
860
|
"pluno-pa-widget--unread",
|
|
810
|
-
!a &&
|
|
811
|
-
),
|
|
861
|
+
!a && We
|
|
862
|
+
), et();
|
|
812
863
|
};
|
|
813
|
-
|
|
864
|
+
yt(), k.addEventListener("submit", (a) => {
|
|
814
865
|
if (a.preventDefault(), t.loginRequired) {
|
|
815
866
|
t.onLoginClick?.();
|
|
816
867
|
return;
|
|
@@ -819,157 +870,157 @@ async function ki(e = {}) {
|
|
|
819
870
|
t.onSignupClick?.();
|
|
820
871
|
return;
|
|
821
872
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
),
|
|
873
|
+
ae(t.billingStatus) || (fe = !0, ee(!0, "send"), te(), W = zt(
|
|
874
|
+
y,
|
|
875
|
+
x,
|
|
876
|
+
W
|
|
877
|
+
), Ee(), j());
|
|
827
878
|
});
|
|
828
|
-
let
|
|
829
|
-
const
|
|
830
|
-
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
|
|
879
|
+
let Ge = 0;
|
|
880
|
+
const Bo = () => {
|
|
881
|
+
Ge = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
882
|
+
}, vt = (a) => {
|
|
883
|
+
le !== null && window.clearTimeout(le), F.textContent = a, F.hidden = !1, le = window.setTimeout(() => {
|
|
884
|
+
F.textContent = "", F.hidden = !0, le = null;
|
|
834
885
|
}, 3e3);
|
|
835
|
-
},
|
|
836
|
-
|
|
837
|
-
},
|
|
886
|
+
}, Uo = () => {
|
|
887
|
+
le !== null && (window.clearTimeout(le), le = null), F.textContent = "", F.hidden = !0;
|
|
888
|
+
}, Ct = async (a) => {
|
|
838
889
|
if (a.length === 0)
|
|
839
890
|
return;
|
|
840
|
-
const s =
|
|
841
|
-
|
|
891
|
+
const s = za(y, a);
|
|
892
|
+
W = [...W, ...s], Ee(), Uo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
|
|
842
893
|
};
|
|
843
|
-
|
|
844
|
-
t.loginRequired ||
|
|
845
|
-
}),
|
|
846
|
-
const a = Array.from(
|
|
847
|
-
|
|
848
|
-
|
|
894
|
+
ze.addEventListener("click", () => {
|
|
895
|
+
t.loginRequired || ae(t.billingStatus) || Q.click();
|
|
896
|
+
}), Q.addEventListener("change", () => {
|
|
897
|
+
const a = Array.from(Q.files ?? []);
|
|
898
|
+
Q.value = "", Ct(a).catch((s) => {
|
|
899
|
+
vt(
|
|
849
900
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
850
|
-
),
|
|
901
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
851
902
|
message: s instanceof Error ? s.message : String(s)
|
|
852
903
|
});
|
|
853
904
|
});
|
|
854
905
|
}), i.addEventListener("dragenter", (a) => {
|
|
855
|
-
!
|
|
906
|
+
!it(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ge += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
856
907
|
}), i.addEventListener("dragover", (a) => {
|
|
857
908
|
const s = a.dataTransfer;
|
|
858
|
-
!
|
|
909
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
859
910
|
}), i.addEventListener("dragleave", (a) => {
|
|
860
|
-
|
|
911
|
+
it(a.dataTransfer) && (a.stopPropagation(), Ge = Math.max(0, Ge - 1), Ge === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
861
912
|
}), i.addEventListener("drop", (a) => {
|
|
862
913
|
const s = a.dataTransfer;
|
|
863
|
-
!
|
|
864
|
-
|
|
914
|
+
!it(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Bo(), Ct(s.files).catch((_) => {
|
|
915
|
+
vt(
|
|
865
916
|
_ instanceof Error ? _.message : "Failed to attach file"
|
|
866
|
-
),
|
|
917
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
867
918
|
message: _ instanceof Error ? _.message : String(_)
|
|
868
919
|
});
|
|
869
920
|
}));
|
|
870
921
|
}), i.addEventListener("paste", (a) => {
|
|
871
922
|
const s = a.clipboardData, _ = Array.from(s?.files ?? []);
|
|
872
|
-
_.length === 0 || t.loginRequired || (a.preventDefault(), a.stopPropagation(),
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
),
|
|
876
|
-
message:
|
|
923
|
+
_.length === 0 || t.loginRequired || (a.preventDefault(), a.stopPropagation(), Ct(_).catch((L) => {
|
|
924
|
+
vt(
|
|
925
|
+
L instanceof Error ? L.message : "Failed to attach file"
|
|
926
|
+
), J("web-sdk.widget", "Attachment failed", {
|
|
927
|
+
message: L instanceof Error ? L.message : String(L)
|
|
877
928
|
});
|
|
878
929
|
}));
|
|
879
|
-
}),
|
|
930
|
+
}), de.addEventListener("click", () => {
|
|
880
931
|
if (t.loginRequired) {
|
|
881
932
|
t.onLoginClick?.();
|
|
882
933
|
return;
|
|
883
934
|
}
|
|
884
|
-
if (
|
|
885
|
-
|
|
935
|
+
if (y.getState().isThinking) {
|
|
936
|
+
y.stop();
|
|
886
937
|
return;
|
|
887
938
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
),
|
|
893
|
-
}),
|
|
894
|
-
|
|
895
|
-
}),
|
|
896
|
-
|
|
897
|
-
}),
|
|
898
|
-
|
|
899
|
-
}),
|
|
939
|
+
fe = !0, ee(!0, "send"), te(), W = zt(
|
|
940
|
+
y,
|
|
941
|
+
x,
|
|
942
|
+
W
|
|
943
|
+
), Ee(), j(), G(y.getState());
|
|
944
|
+
}), X.addEventListener("click", () => {
|
|
945
|
+
ce = !ce, Oe = null, _e(), ce && ue.length === 0 && on(null);
|
|
946
|
+
}), Se.addEventListener("click", () => {
|
|
947
|
+
ce = !1, _e();
|
|
948
|
+
}), T.addEventListener("scroll", Io), x.addEventListener("input", () => {
|
|
949
|
+
je(x), B(), j(), Wo();
|
|
950
|
+
}), x.addEventListener("keydown", (a) => {
|
|
900
951
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
901
952
|
if (a.preventDefault(), t.loginRequired) {
|
|
902
953
|
t.onLoginClick?.();
|
|
903
954
|
return;
|
|
904
955
|
}
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
),
|
|
956
|
+
fe = !0, ee(!0, "send"), te(), W = zt(
|
|
957
|
+
y,
|
|
958
|
+
x,
|
|
959
|
+
W
|
|
960
|
+
), Ee(), j(), G(y.getState());
|
|
910
961
|
}
|
|
911
962
|
}), i.addEventListener("click", (a) => {
|
|
912
|
-
(a.target instanceof Element ? a.target : null)?.closest("a[href]") &&
|
|
913
|
-
}), l.composerValue && (
|
|
914
|
-
const
|
|
915
|
-
let
|
|
916
|
-
const
|
|
917
|
-
let
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
},
|
|
921
|
-
|
|
922
|
-
},
|
|
923
|
-
if (!
|
|
963
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
964
|
+
}), l.composerValue && (x.value = l.composerValue, je(x)), t.initialDisplayState === "minimized" ? Ue("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(x.value, !1), ra(l, i, b, x);
|
|
965
|
+
const tt = () => r;
|
|
966
|
+
let St = y.getState().appearance !== null, nt = null, $e = null, Pe = null, un = y.getState().isThinking, Ie = null;
|
|
967
|
+
const qe = t.taskNotifications;
|
|
968
|
+
let Ae = null, Ne = !1;
|
|
969
|
+
const gn = () => {
|
|
970
|
+
Ae !== null && (window.clearTimeout(Ae), Ae = null);
|
|
971
|
+
}, ot = () => {
|
|
972
|
+
Me && (Me.hidden = !0);
|
|
973
|
+
}, hn = () => y.getState().assistantDraft.trim().length > 0, Fo = async () => {
|
|
974
|
+
if (!qe || !Me || Ne || Le || !y.getState().isThinking || hn())
|
|
924
975
|
return;
|
|
925
976
|
let a;
|
|
926
977
|
try {
|
|
927
|
-
a = await
|
|
978
|
+
a = await qe.getState();
|
|
928
979
|
} catch {
|
|
929
980
|
return;
|
|
930
981
|
}
|
|
931
|
-
a.enabled || a.neverSuggest || !
|
|
982
|
+
a.enabled || a.neverSuggest || !y.getState().isThinking || hn() || Ne || Le || (Me.hidden = !1);
|
|
932
983
|
};
|
|
933
|
-
|
|
934
|
-
|
|
984
|
+
vo?.addEventListener("click", () => {
|
|
985
|
+
Ne = !0, ot(), qe?.enable().catch(() => {
|
|
935
986
|
});
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
}),
|
|
939
|
-
|
|
987
|
+
}), Co?.addEventListener("click", () => {
|
|
988
|
+
Ne = !0, ot();
|
|
989
|
+
}), So?.addEventListener("click", () => {
|
|
990
|
+
Ne = !0, ot(), qe?.dismissForever().catch(() => {
|
|
940
991
|
});
|
|
941
992
|
});
|
|
942
|
-
let
|
|
993
|
+
let Te = null, mn = () => {
|
|
943
994
|
};
|
|
944
|
-
const
|
|
945
|
-
const a =
|
|
946
|
-
|
|
995
|
+
const Ho = !!t.socialPostDraftHandler, Et = /* @__PURE__ */ new Map(), kt = () => x.value.trim().length > 0 || W.length > 0, Wo = () => {
|
|
996
|
+
const a = Te !== null && Ut(y.getState(), kt());
|
|
997
|
+
D.hidden = !a, a && Te !== null && po(D, Te);
|
|
947
998
|
};
|
|
948
|
-
let
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
},
|
|
999
|
+
let De = null;
|
|
1000
|
+
const Go = () => {
|
|
1001
|
+
fe = !0, ee(!0, "newSession"), te(), ce = !1, _e(), y.startNewSession(), mt.clear(), x.value = "", W = [], Ee(), je(x), B(), j(), x.focus(), G(y.getState());
|
|
1002
|
+
}, Lt = (a) => {
|
|
952
1003
|
if (!a) {
|
|
953
|
-
|
|
1004
|
+
De?.remove(), De = null;
|
|
954
1005
|
return;
|
|
955
1006
|
}
|
|
956
|
-
|
|
1007
|
+
De || (De = gt(
|
|
957
1008
|
"pluno-pa-widget__new-chat",
|
|
958
1009
|
"New chat",
|
|
959
|
-
|
|
1010
|
+
Sa(),
|
|
960
1011
|
!1
|
|
961
|
-
),
|
|
962
|
-
},
|
|
963
|
-
if (
|
|
964
|
-
|
|
1012
|
+
), De.addEventListener("click", Go), Ye.insertBefore(De, X));
|
|
1013
|
+
}, G = (a) => {
|
|
1014
|
+
if (_e(), tn(a.lastErrorCode) ? Ie = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Ie = null), Bt(
|
|
1015
|
+
H,
|
|
965
1016
|
t.billingStatus,
|
|
966
|
-
|
|
1017
|
+
Ie
|
|
967
1018
|
), t.loginRequired) {
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1019
|
+
Et.clear(), Wn(
|
|
1020
|
+
N,
|
|
1021
|
+
de,
|
|
1022
|
+
Lt,
|
|
1023
|
+
tt,
|
|
973
1024
|
"Log in to use Pluno on this page.",
|
|
974
1025
|
t.loginButtonLabel,
|
|
975
1026
|
t.loginUrl,
|
|
@@ -978,11 +1029,11 @@ async function ki(e = {}) {
|
|
|
978
1029
|
return;
|
|
979
1030
|
}
|
|
980
1031
|
if (t.signupRequired) {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1032
|
+
Et.clear(), Wn(
|
|
1033
|
+
N,
|
|
1034
|
+
de,
|
|
1035
|
+
Lt,
|
|
1036
|
+
tt,
|
|
986
1037
|
"Complete signup to unlock your free trial credits.",
|
|
987
1038
|
t.signupButtonLabel,
|
|
988
1039
|
t.signupUrl,
|
|
@@ -990,67 +1041,67 @@ async function ki(e = {}) {
|
|
|
990
1041
|
);
|
|
991
1042
|
return;
|
|
992
1043
|
}
|
|
993
|
-
const s =
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1044
|
+
const s = pa(a), _ = s !== nn;
|
|
1045
|
+
nn = s;
|
|
1046
|
+
const L = fe || we.enabled;
|
|
1047
|
+
fe = !1, Wa(
|
|
1048
|
+
N,
|
|
1049
|
+
ht,
|
|
1050
|
+
de,
|
|
1051
|
+
Lt,
|
|
1052
|
+
D,
|
|
1002
1053
|
a,
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
() =>
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
(
|
|
1012
|
-
|
|
1054
|
+
Te,
|
|
1055
|
+
Te !== null && Ut(a, kt()),
|
|
1056
|
+
L,
|
|
1057
|
+
() => we.enabled,
|
|
1058
|
+
mt,
|
|
1059
|
+
Et,
|
|
1060
|
+
B,
|
|
1061
|
+
tt,
|
|
1062
|
+
(M) => {
|
|
1063
|
+
fe = !0, ee(!0, "send"), te(), y.sendMessage(M);
|
|
1013
1064
|
},
|
|
1014
|
-
|
|
1015
|
-
dismissedCandidateIds:
|
|
1016
|
-
draftingCandidateId:
|
|
1017
|
-
error:
|
|
1018
|
-
characterIconOptions:
|
|
1019
|
-
onSeen: (
|
|
1020
|
-
|
|
1065
|
+
Ho && !ft ? {
|
|
1066
|
+
dismissedCandidateIds: Xe,
|
|
1067
|
+
draftingCandidateId: nt,
|
|
1068
|
+
error: $e,
|
|
1069
|
+
characterIconOptions: tt(),
|
|
1070
|
+
onSeen: (M) => {
|
|
1071
|
+
ke.add(M.id), B();
|
|
1021
1072
|
},
|
|
1022
|
-
onDraft: (
|
|
1023
|
-
|
|
1073
|
+
onDraft: (M) => {
|
|
1074
|
+
$o(M);
|
|
1024
1075
|
},
|
|
1025
|
-
onDismiss: (
|
|
1026
|
-
|
|
1076
|
+
onDismiss: (M) => {
|
|
1077
|
+
ke.add(M.id), Xe.add(M.id), B(), $e = null, G(y.getState());
|
|
1027
1078
|
},
|
|
1028
|
-
onDisable: (
|
|
1029
|
-
|
|
1079
|
+
onDisable: (M) => {
|
|
1080
|
+
ft = !0, ke.add(M.id), Xe.add(M.id), B(), cr(t, !0), $e = null, G(y.getState());
|
|
1030
1081
|
}
|
|
1031
1082
|
} : void 0
|
|
1032
|
-
),
|
|
1083
|
+
), L ? (be = N.scrollTop, te()) : _ && sa(a) && Lo();
|
|
1033
1084
|
};
|
|
1034
|
-
return
|
|
1085
|
+
return mn = pi(
|
|
1035
1086
|
(a) => {
|
|
1036
|
-
|
|
1087
|
+
Te = a, !Le && Ut(y.getState(), kt()) && G(y.getState());
|
|
1037
1088
|
},
|
|
1038
1089
|
{
|
|
1039
1090
|
backendUrl: t.backendUrl,
|
|
1040
|
-
fetcher:
|
|
1091
|
+
fetcher: ko,
|
|
1041
1092
|
loader: t.activeUsersLoader
|
|
1042
1093
|
}
|
|
1043
|
-
),
|
|
1044
|
-
const s =
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
},
|
|
1094
|
+
), y.on("state", (a) => {
|
|
1095
|
+
const s = un && !a.isThinking;
|
|
1096
|
+
un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && qe && !Ne && Ae === null && Me?.hidden !== !1 && (Ae = window.setTimeout(() => {
|
|
1097
|
+
Ae = null, Fo();
|
|
1098
|
+
}, gi)), (!a.isThinking || a.assistantDraft.trim()) && (gn(), ot()), s && !i.classList.contains("pluno-pa-widget--open") && (We = !0), yt(), a.appearance ? (St = !0, J(
|
|
1048
1099
|
"web-sdk.widget",
|
|
1049
1100
|
"Agent state supplied appearance",
|
|
1050
1101
|
{
|
|
1051
1102
|
appearance: a.appearance
|
|
1052
1103
|
}
|
|
1053
|
-
),
|
|
1104
|
+
), Pt(a.appearance, "agent.state.appearance")) : St && (St = !1, J(
|
|
1054
1105
|
"web-sdk.widget",
|
|
1055
1106
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1056
1107
|
{
|
|
@@ -1058,28 +1109,28 @@ async function ki(e = {}) {
|
|
|
1058
1109
|
fallbackColorScheme: t.colorScheme,
|
|
1059
1110
|
fallbackFontFamily: t.fontFamily
|
|
1060
1111
|
}
|
|
1061
|
-
),
|
|
1062
|
-
}),
|
|
1063
|
-
agent:
|
|
1112
|
+
), Pt({}, "agent.state.appearance-cleared")), G(a), j(), s && pn();
|
|
1113
|
+
}), G(y.getState()), j(), {
|
|
1114
|
+
agent: y,
|
|
1064
1115
|
updateAppearance: (a) => {
|
|
1065
|
-
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle),
|
|
1116
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Pt(a, "widgetHandle.updateAppearance");
|
|
1066
1117
|
},
|
|
1067
1118
|
updateBillingStatus: (a) => {
|
|
1068
1119
|
const s = a ?? null;
|
|
1069
|
-
|
|
1120
|
+
Bn(
|
|
1070
1121
|
t.billingStatus,
|
|
1071
1122
|
s,
|
|
1072
|
-
|
|
1073
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !
|
|
1123
|
+
Ie
|
|
1124
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Ie = null), Bt(
|
|
1074
1125
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1075
1126
|
t.billingStatus,
|
|
1076
|
-
|
|
1077
|
-
),
|
|
1127
|
+
Ie
|
|
1128
|
+
), j());
|
|
1078
1129
|
},
|
|
1079
1130
|
updateAuthGate: (a) => {
|
|
1080
|
-
const s =
|
|
1081
|
-
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),
|
|
1082
|
-
|
|
1131
|
+
const s = Qe();
|
|
1132
|
+
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), et(), G(y.getState()), j(), s && !Qe() && y.connect().catch((_) => {
|
|
1133
|
+
J(
|
|
1083
1134
|
"web-sdk.widget",
|
|
1084
1135
|
"Failed to connect after auth gate cleared",
|
|
1085
1136
|
{
|
|
@@ -1089,70 +1140,70 @@ async function ki(e = {}) {
|
|
|
1089
1140
|
});
|
|
1090
1141
|
},
|
|
1091
1142
|
openPanel: () => {
|
|
1092
|
-
|
|
1143
|
+
ge(x.value, !1);
|
|
1093
1144
|
},
|
|
1094
1145
|
updateDisplayState: (a) => {
|
|
1095
1146
|
if (a === "shown") {
|
|
1096
|
-
|
|
1147
|
+
Ue("shown", !1);
|
|
1097
1148
|
return;
|
|
1098
1149
|
}
|
|
1099
|
-
|
|
1150
|
+
Ue("minimized", !1);
|
|
1100
1151
|
},
|
|
1101
1152
|
destroy: () => {
|
|
1102
|
-
|
|
1153
|
+
Le || (B(), Le = !0, an.disconnect(), cn?.disconnect(), Oo(), window.removeEventListener("resize", rn), ln(), Do(), le !== null && window.clearTimeout(le), gn(), mn(), Pe?.remove(), y.destroy(), n.remove());
|
|
1103
1154
|
}
|
|
1104
1155
|
};
|
|
1105
|
-
async function
|
|
1106
|
-
if (!
|
|
1107
|
-
|
|
1156
|
+
async function $o(a) {
|
|
1157
|
+
if (!nt) {
|
|
1158
|
+
nt = a.id, $e = null, G(y.getState());
|
|
1108
1159
|
try {
|
|
1109
1160
|
if (!t.socialPostDraftHandler)
|
|
1110
1161
|
throw new Error("Social post drafting is not available here.");
|
|
1111
1162
|
const s = await t.socialPostDraftHandler(a);
|
|
1112
1163
|
if (!s.linkedinPost || !s.xPost)
|
|
1113
1164
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1114
|
-
|
|
1165
|
+
ke.add(a.id), Xe.add(a.id), B(), Pe?.remove(), Pe = Xa(s, {
|
|
1115
1166
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1116
1167
|
onClose: () => {
|
|
1117
|
-
|
|
1168
|
+
Pe?.remove(), Pe = null;
|
|
1118
1169
|
}
|
|
1119
|
-
}), i.appendChild(
|
|
1170
|
+
}), i.appendChild(Pe);
|
|
1120
1171
|
} catch (s) {
|
|
1121
|
-
|
|
1172
|
+
$e = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1122
1173
|
} finally {
|
|
1123
|
-
|
|
1174
|
+
nt = null, G(y.getState());
|
|
1124
1175
|
}
|
|
1125
1176
|
}
|
|
1126
1177
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const _ = a.accentColor ?? t.accentColor,
|
|
1129
|
-
r =
|
|
1178
|
+
function Pt(a, s) {
|
|
1179
|
+
const _ = a.accentColor ?? t.accentColor, L = a.colorScheme ?? t.colorScheme, M = a.fontFamily ?? t.fontFamily, It = a.scribbleStyle ?? t.scribbleStyle;
|
|
1180
|
+
r = Pn(
|
|
1130
1181
|
_,
|
|
1131
|
-
|
|
1132
|
-
),
|
|
1182
|
+
It
|
|
1183
|
+
), In(i, r, {
|
|
1133
1184
|
accentColor: _,
|
|
1134
|
-
colorScheme:
|
|
1135
|
-
fontFamily:
|
|
1136
|
-
scribbleStyle:
|
|
1137
|
-
}),
|
|
1185
|
+
colorScheme: L,
|
|
1186
|
+
fontFamily: M,
|
|
1187
|
+
scribbleStyle: It
|
|
1188
|
+
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1138
1189
|
source: s,
|
|
1139
1190
|
inputAppearance: a,
|
|
1140
1191
|
appliedAccentColor: _,
|
|
1141
|
-
appliedColorScheme:
|
|
1142
|
-
appliedFontFamily:
|
|
1143
|
-
appliedScribbleStyle:
|
|
1192
|
+
appliedColorScheme: L,
|
|
1193
|
+
appliedFontFamily: M,
|
|
1194
|
+
appliedScribbleStyle: It,
|
|
1144
1195
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1145
1196
|
});
|
|
1146
1197
|
}
|
|
1147
1198
|
}
|
|
1148
|
-
function
|
|
1199
|
+
function Pn(e, t) {
|
|
1149
1200
|
return { accentColor: e, scribbleStyle: t };
|
|
1150
1201
|
}
|
|
1151
|
-
function
|
|
1152
|
-
const t =
|
|
1153
|
-
return t === null ? "#fafafa" :
|
|
1202
|
+
function qi(e) {
|
|
1203
|
+
const t = ji(e);
|
|
1204
|
+
return t === null ? "#fafafa" : Vi(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1154
1205
|
}
|
|
1155
|
-
function
|
|
1206
|
+
function ji(e) {
|
|
1156
1207
|
const t = e.trim();
|
|
1157
1208
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1158
1209
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1164,42 +1215,42 @@ function Ii(e) {
|
|
|
1164
1215
|
Number.parseInt(t[3] + t[3], 16)
|
|
1165
1216
|
] : null;
|
|
1166
1217
|
}
|
|
1167
|
-
function
|
|
1168
|
-
const
|
|
1218
|
+
function Vi([e, t, n]) {
|
|
1219
|
+
const o = (i) => {
|
|
1169
1220
|
const r = i / 255;
|
|
1170
1221
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1171
1222
|
};
|
|
1172
|
-
return 0.2126 *
|
|
1223
|
+
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1173
1224
|
}
|
|
1174
|
-
function
|
|
1225
|
+
function In(e, t, n) {
|
|
1175
1226
|
e.classList.toggle(
|
|
1176
1227
|
"pluno-pa-widget--dark",
|
|
1177
|
-
|
|
1228
|
+
n.colorScheme === "dark"
|
|
1178
1229
|
), e.classList.toggle(
|
|
1179
1230
|
"pluno-pa-widget--light",
|
|
1180
|
-
|
|
1181
|
-
), e.classList.toggle("pluno-pa-widget--scribble",
|
|
1182
|
-
const
|
|
1183
|
-
e.style.setProperty("--pluno-pa-accent",
|
|
1231
|
+
n.colorScheme !== "dark"
|
|
1232
|
+
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1233
|
+
const o = n.scribbleStyle ? Kn(n.accentColor) : n.accentColor;
|
|
1234
|
+
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1184
1235
|
"--pluno-pa-accent-contrast",
|
|
1185
|
-
|
|
1186
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily =
|
|
1236
|
+
qi(o)
|
|
1237
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Ii : n.fontFamily, n.scribbleStyle && Ki(e.ownerDocument);
|
|
1187
1238
|
const i = Array.from(
|
|
1188
1239
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1189
1240
|
);
|
|
1190
1241
|
for (const r of i)
|
|
1191
1242
|
r.replaceWith(
|
|
1192
|
-
|
|
1243
|
+
me(
|
|
1193
1244
|
Array.from(r.classList).join(" "),
|
|
1194
1245
|
t
|
|
1195
1246
|
)
|
|
1196
1247
|
);
|
|
1197
1248
|
}
|
|
1198
|
-
function
|
|
1199
|
-
if (e.getElementById(
|
|
1249
|
+
function Ki(e) {
|
|
1250
|
+
if (e.getElementById(Sn))
|
|
1200
1251
|
return;
|
|
1201
1252
|
const t = e.createElement("style");
|
|
1202
|
-
t.id =
|
|
1253
|
+
t.id = Sn, t.textContent = `@font-face {
|
|
1203
1254
|
font-family: "Architects Daughter";
|
|
1204
1255
|
font-style: normal;
|
|
1205
1256
|
font-weight: 400;
|
|
@@ -1207,201 +1258,353 @@ function Ni(e) {
|
|
|
1207
1258
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1208
1259
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1209
1260
|
}
|
|
1210
|
-
function
|
|
1261
|
+
function Yi({
|
|
1211
1262
|
root: e,
|
|
1212
1263
|
launcher: t,
|
|
1213
|
-
launcherDragHandle:
|
|
1214
|
-
getPosition:
|
|
1264
|
+
launcherDragHandle: n,
|
|
1265
|
+
getPosition: o,
|
|
1215
1266
|
setPosition: i,
|
|
1216
1267
|
persist: r
|
|
1217
1268
|
}) {
|
|
1218
|
-
let l = null, p = null, d = null,
|
|
1219
|
-
const
|
|
1220
|
-
l = null, p = null, d = null,
|
|
1221
|
-
},
|
|
1222
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d =
|
|
1223
|
-
},
|
|
1269
|
+
let l = null, p = null, d = null, c = !1, u = null;
|
|
1270
|
+
const m = () => {
|
|
1271
|
+
l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1272
|
+
}, E = (h) => {
|
|
1273
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, d = o(), c = !1, t.setPointerCapture?.(h.pointerId));
|
|
1274
|
+
}, v = (h) => {
|
|
1224
1275
|
if (l !== h.pointerId || !p || !d)
|
|
1225
1276
|
return;
|
|
1226
1277
|
h.preventDefault();
|
|
1227
|
-
const
|
|
1228
|
-
!
|
|
1229
|
-
},
|
|
1230
|
-
l === h.pointerId && (h.preventDefault(), h.stopPropagation(),
|
|
1231
|
-
},
|
|
1232
|
-
l === h.pointerId && (h.preventDefault(),
|
|
1233
|
-
},
|
|
1234
|
-
if (!
|
|
1278
|
+
const P = h.clientX - p.x, A = h.clientY - p.y;
|
|
1279
|
+
!c && Math.hypot(P, A) < jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + P, y: d.y + A }));
|
|
1280
|
+
}, z = (h) => {
|
|
1281
|
+
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1282
|
+
}, b = (h) => {
|
|
1283
|
+
l === h.pointerId && (h.preventDefault(), m());
|
|
1284
|
+
}, g = (h) => {
|
|
1285
|
+
if (!u)
|
|
1235
1286
|
return;
|
|
1236
|
-
const
|
|
1237
|
-
h.clientX -
|
|
1238
|
-
h.clientY -
|
|
1239
|
-
) <=
|
|
1240
|
-
|
|
1241
|
-
},
|
|
1287
|
+
const P = Math.hypot(
|
|
1288
|
+
h.clientX - u.x,
|
|
1289
|
+
h.clientY - u.y
|
|
1290
|
+
) <= jt;
|
|
1291
|
+
u = null, P && (h.preventDefault(), h.stopPropagation());
|
|
1292
|
+
}, w = (h) => {
|
|
1242
1293
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1243
1294
|
return;
|
|
1244
|
-
const
|
|
1245
|
-
let
|
|
1246
|
-
h.key === "ArrowUp" ?
|
|
1295
|
+
const P = h.shiftKey ? oo : no, A = o();
|
|
1296
|
+
let k = null;
|
|
1297
|
+
h.key === "ArrowUp" ? k = { x: A.x, y: A.y - P } : h.key === "ArrowDown" ? k = { x: A.x, y: A.y + P } : h.key === "ArrowLeft" ? k = { x: A.x - P, y: A.y } : h.key === "ArrowRight" && (k = { x: A.x + P, y: A.y }), k && (h.preventDefault(), h.stopPropagation(), i(k), r());
|
|
1247
1298
|
};
|
|
1248
|
-
return t.addEventListener("pointerdown",
|
|
1249
|
-
t.removeEventListener("pointerdown",
|
|
1299
|
+
return t.addEventListener("pointerdown", E), t.addEventListener("pointermove", v), t.addEventListener("pointerup", z), t.addEventListener("pointercancel", b), t.addEventListener("click", g, !0), n.addEventListener("keydown", w), () => {
|
|
1300
|
+
t.removeEventListener("pointerdown", E), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", z), t.removeEventListener("pointercancel", b), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", w);
|
|
1250
1301
|
};
|
|
1251
1302
|
}
|
|
1252
|
-
function
|
|
1253
|
-
|
|
1303
|
+
function Xi({
|
|
1304
|
+
root: e,
|
|
1305
|
+
handles: t,
|
|
1306
|
+
getBounds: n,
|
|
1307
|
+
setBounds: o,
|
|
1308
|
+
persist: i
|
|
1309
|
+
}) {
|
|
1310
|
+
let r = null, l = null, p = null, d = null, c = !1;
|
|
1311
|
+
const u = () => {
|
|
1312
|
+
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1313
|
+
}, m = (g) => {
|
|
1314
|
+
const w = g.currentTarget, h = w.dataset.resizeDirection;
|
|
1315
|
+
!e.classList.contains("pluno-pa-widget--open") || !An(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, w.setPointerCapture?.(g.pointerId));
|
|
1316
|
+
}, E = (g) => {
|
|
1317
|
+
if (r !== g.pointerId || !l || !p || !d)
|
|
1318
|
+
return;
|
|
1319
|
+
g.preventDefault(), g.stopPropagation();
|
|
1320
|
+
const w = g.clientX - p.x, h = g.clientY - p.y;
|
|
1321
|
+
!c && Math.hypot(w, h) < jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1322
|
+
Nn(d, l, w, h)
|
|
1323
|
+
));
|
|
1324
|
+
}, v = (g) => {
|
|
1325
|
+
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1326
|
+
}, z = (g) => {
|
|
1327
|
+
r === g.pointerId && (g.preventDefault(), u());
|
|
1328
|
+
}, b = (g) => {
|
|
1329
|
+
const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? oo : no, A = n();
|
|
1330
|
+
let k = 0, F = 0;
|
|
1331
|
+
An(h) && (g.key === "ArrowLeft" ? k = -P : g.key === "ArrowRight" ? k = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(k === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Nn(A, h, k, F)), i()));
|
|
1332
|
+
};
|
|
1333
|
+
for (const g of t)
|
|
1334
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", E), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", b);
|
|
1335
|
+
return () => {
|
|
1336
|
+
for (const g of t)
|
|
1337
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", E), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", b);
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
function An(e) {
|
|
1341
|
+
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1342
|
+
}
|
|
1343
|
+
function Nn(e, t, n, o) {
|
|
1344
|
+
const i = Y(), r = Tn({
|
|
1345
|
+
leading: e.position.x,
|
|
1346
|
+
length: e.size.width,
|
|
1347
|
+
delta: n,
|
|
1348
|
+
resizeLeading: t.endsWith("left") || t === "left",
|
|
1349
|
+
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1350
|
+
minLeading: I,
|
|
1351
|
+
maxTrailing: i.width - I,
|
|
1352
|
+
minLength: Math.min(
|
|
1353
|
+
Jt,
|
|
1354
|
+
i.width - I * 2
|
|
1355
|
+
)
|
|
1356
|
+
}), l = Tn({
|
|
1357
|
+
leading: e.position.y,
|
|
1358
|
+
length: e.size.height,
|
|
1359
|
+
delta: o,
|
|
1360
|
+
resizeLeading: t.startsWith("top") || t === "top",
|
|
1361
|
+
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1362
|
+
minLeading: Ce,
|
|
1363
|
+
maxTrailing: i.height - I,
|
|
1364
|
+
minLength: Math.min(
|
|
1365
|
+
Qt,
|
|
1366
|
+
i.height - Ce - I
|
|
1367
|
+
)
|
|
1368
|
+
});
|
|
1369
|
+
return {
|
|
1370
|
+
position: { x: r.leading, y: l.leading },
|
|
1371
|
+
size: { width: r.length, height: l.length }
|
|
1372
|
+
};
|
|
1373
|
+
}
|
|
1374
|
+
function Tn({
|
|
1375
|
+
leading: e,
|
|
1376
|
+
length: t,
|
|
1377
|
+
delta: n,
|
|
1378
|
+
resizeLeading: o,
|
|
1379
|
+
resizeTrailing: i,
|
|
1380
|
+
minLeading: r,
|
|
1381
|
+
maxTrailing: l,
|
|
1382
|
+
minLength: p
|
|
1383
|
+
}) {
|
|
1384
|
+
const d = e + t;
|
|
1385
|
+
if (o) {
|
|
1386
|
+
const c = e + n;
|
|
1387
|
+
if (c >= r) {
|
|
1388
|
+
const m = K(c, r, d - p);
|
|
1389
|
+
return { leading: m, length: d - m };
|
|
1390
|
+
}
|
|
1391
|
+
const u = K(
|
|
1392
|
+
d + r - c,
|
|
1393
|
+
d,
|
|
1394
|
+
l
|
|
1395
|
+
);
|
|
1396
|
+
return { leading: r, length: u - r };
|
|
1397
|
+
}
|
|
1398
|
+
if (i) {
|
|
1399
|
+
const c = d + n;
|
|
1400
|
+
if (c <= l) {
|
|
1401
|
+
const m = K(
|
|
1402
|
+
c,
|
|
1403
|
+
e + p,
|
|
1404
|
+
l
|
|
1405
|
+
);
|
|
1406
|
+
return { leading: e, length: m - e };
|
|
1407
|
+
}
|
|
1408
|
+
const u = K(
|
|
1409
|
+
e - (c - l),
|
|
1410
|
+
r,
|
|
1411
|
+
e
|
|
1412
|
+
);
|
|
1413
|
+
return { leading: u, length: l - u };
|
|
1414
|
+
}
|
|
1415
|
+
return { leading: e, length: t };
|
|
1416
|
+
}
|
|
1417
|
+
function dt(e, t = !0) {
|
|
1418
|
+
const n = Y();
|
|
1254
1419
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1255
1420
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1256
|
-
width:
|
|
1257
|
-
height:
|
|
1258
|
-
} : { width:
|
|
1259
|
-
const
|
|
1421
|
+
width: Ai,
|
|
1422
|
+
height: Ni
|
|
1423
|
+
} : { width: En, height: En };
|
|
1424
|
+
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1260
1425
|
return {
|
|
1261
|
-
width: t && i &&
|
|
1262
|
-
height: t && i &&
|
|
1426
|
+
width: t && i && o.width > 0 ? o.width : Math.min(Qn, n.width - 36),
|
|
1427
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Di : eo
|
|
1263
1428
|
};
|
|
1264
1429
|
}
|
|
1265
|
-
function
|
|
1266
|
-
const e =
|
|
1430
|
+
function Zi() {
|
|
1431
|
+
const e = Y();
|
|
1267
1432
|
return {
|
|
1268
1433
|
width: Math.min(
|
|
1269
|
-
|
|
1270
|
-
e.width *
|
|
1271
|
-
|
|
1272
|
-
|
|
1434
|
+
K(
|
|
1435
|
+
e.width * zi,
|
|
1436
|
+
Jt,
|
|
1437
|
+
Ri
|
|
1273
1438
|
),
|
|
1274
|
-
e.width -
|
|
1439
|
+
e.width - I * 2
|
|
1275
1440
|
),
|
|
1276
1441
|
height: Math.min(
|
|
1277
|
-
|
|
1278
|
-
e.height *
|
|
1279
|
-
|
|
1280
|
-
|
|
1442
|
+
K(
|
|
1443
|
+
e.height * Oi,
|
|
1444
|
+
Qt,
|
|
1445
|
+
Mi
|
|
1446
|
+
),
|
|
1447
|
+
e.height - Ce - I
|
|
1448
|
+
)
|
|
1449
|
+
};
|
|
1450
|
+
}
|
|
1451
|
+
function Re(e = null) {
|
|
1452
|
+
return e ? ut(e) : Zi();
|
|
1453
|
+
}
|
|
1454
|
+
function ut(e) {
|
|
1455
|
+
const t = Y();
|
|
1456
|
+
return {
|
|
1457
|
+
width: K(
|
|
1458
|
+
e.width,
|
|
1459
|
+
Math.min(
|
|
1460
|
+
Jt,
|
|
1461
|
+
t.width - I * 2
|
|
1462
|
+
),
|
|
1463
|
+
Math.max(
|
|
1464
|
+
I,
|
|
1465
|
+
t.width - I * 2
|
|
1466
|
+
)
|
|
1467
|
+
),
|
|
1468
|
+
height: K(
|
|
1469
|
+
e.height,
|
|
1470
|
+
Math.min(
|
|
1471
|
+
Qt,
|
|
1472
|
+
t.height - Ce - I
|
|
1281
1473
|
),
|
|
1282
|
-
|
|
1474
|
+
Math.max(
|
|
1475
|
+
I,
|
|
1476
|
+
t.height - Ce - I
|
|
1477
|
+
)
|
|
1283
1478
|
)
|
|
1284
1479
|
};
|
|
1285
1480
|
}
|
|
1286
|
-
function
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
return
|
|
1481
|
+
function Nt(e, t) {
|
|
1482
|
+
if (!t) {
|
|
1483
|
+
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1484
|
+
return;
|
|
1485
|
+
}
|
|
1486
|
+
const n = ut(t);
|
|
1487
|
+
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1488
|
+
}
|
|
1489
|
+
function Ji(e, t, n) {
|
|
1490
|
+
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1491
|
+
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1492
|
+
return { x: o, y: i };
|
|
1290
1493
|
const r = e.getBoundingClientRect();
|
|
1291
1494
|
if (r.width > 0 || r.height > 0)
|
|
1292
1495
|
return { x: r.left, y: r.top };
|
|
1293
|
-
const l =
|
|
1496
|
+
const l = Y();
|
|
1294
1497
|
return {
|
|
1295
|
-
x: t === "bottom-left" ? 26 : l.width - 26 -
|
|
1296
|
-
y: l.height - 24 -
|
|
1498
|
+
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1499
|
+
y: l.height - 24 - n.height
|
|
1297
1500
|
};
|
|
1298
1501
|
}
|
|
1299
|
-
function
|
|
1300
|
-
const
|
|
1301
|
-
return t ?
|
|
1502
|
+
function Tt(e, t, n) {
|
|
1503
|
+
const o = dt(e, !1);
|
|
1504
|
+
return t ? Vt(
|
|
1302
1505
|
e,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
) :
|
|
1506
|
+
ro(t, o),
|
|
1507
|
+
o
|
|
1508
|
+
) : Qi(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Ti);
|
|
1306
1509
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const
|
|
1510
|
+
function Qi(e, t, n) {
|
|
1511
|
+
const o = Y();
|
|
1309
1512
|
return {
|
|
1310
|
-
x: e.endsWith("right") ? Math.max(0,
|
|
1311
|
-
y: e.startsWith("bottom") ? Math.max(0,
|
|
1513
|
+
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1514
|
+
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1312
1515
|
};
|
|
1313
1516
|
}
|
|
1314
|
-
function
|
|
1315
|
-
const
|
|
1517
|
+
function Vt(e, t, n) {
|
|
1518
|
+
const o = Y(), i = I + na(e);
|
|
1316
1519
|
return {
|
|
1317
|
-
x:
|
|
1520
|
+
x: K(
|
|
1318
1521
|
t.x,
|
|
1319
|
-
|
|
1522
|
+
I,
|
|
1320
1523
|
Math.max(
|
|
1321
|
-
|
|
1322
|
-
|
|
1524
|
+
I,
|
|
1525
|
+
o.width - n.width - I
|
|
1323
1526
|
)
|
|
1324
1527
|
),
|
|
1325
|
-
y:
|
|
1528
|
+
y: K(
|
|
1326
1529
|
t.y,
|
|
1327
1530
|
i,
|
|
1328
1531
|
Math.max(
|
|
1329
1532
|
i,
|
|
1330
|
-
|
|
1533
|
+
o.height - n.height - I
|
|
1331
1534
|
)
|
|
1332
1535
|
)
|
|
1333
1536
|
};
|
|
1334
1537
|
}
|
|
1335
|
-
function
|
|
1336
|
-
const
|
|
1538
|
+
function ro(e, t) {
|
|
1539
|
+
const n = Y();
|
|
1337
1540
|
return {
|
|
1338
|
-
x: e.anchor.endsWith("right") ?
|
|
1339
|
-
y: e.anchor.startsWith("bottom") ?
|
|
1541
|
+
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1542
|
+
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1340
1543
|
};
|
|
1341
1544
|
}
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1545
|
+
function ea(e, t) {
|
|
1546
|
+
const n = ta(e, t), o = Y();
|
|
1344
1547
|
return {
|
|
1345
|
-
anchor:
|
|
1346
|
-
x:
|
|
1347
|
-
y:
|
|
1548
|
+
anchor: n,
|
|
1549
|
+
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1550
|
+
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1348
1551
|
};
|
|
1349
1552
|
}
|
|
1350
|
-
function
|
|
1351
|
-
const
|
|
1553
|
+
function ta(e, t) {
|
|
1554
|
+
const n = Y(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1352
1555
|
return `${r}-${l}`;
|
|
1353
1556
|
}
|
|
1354
|
-
function
|
|
1355
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1557
|
+
function na(e) {
|
|
1558
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Hi : Fi;
|
|
1356
1559
|
}
|
|
1357
|
-
function
|
|
1358
|
-
const
|
|
1359
|
-
x:
|
|
1360
|
-
y: t.y +
|
|
1560
|
+
function Dt(e, t, n, o = null) {
|
|
1561
|
+
const i = dt(e), r = Re(o), l = {
|
|
1562
|
+
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1563
|
+
y: t.y + i.height - r.height
|
|
1361
1564
|
};
|
|
1362
|
-
return
|
|
1565
|
+
return lt(l, r);
|
|
1363
1566
|
}
|
|
1364
|
-
function
|
|
1365
|
-
const
|
|
1567
|
+
function lt(e, t) {
|
|
1568
|
+
const n = Y();
|
|
1366
1569
|
return {
|
|
1367
|
-
x:
|
|
1570
|
+
x: K(
|
|
1368
1571
|
e.x,
|
|
1369
|
-
|
|
1572
|
+
I,
|
|
1370
1573
|
Math.max(
|
|
1371
|
-
|
|
1372
|
-
|
|
1574
|
+
I,
|
|
1575
|
+
n.width - t.width - I
|
|
1373
1576
|
)
|
|
1374
1577
|
),
|
|
1375
|
-
y:
|
|
1578
|
+
y: K(
|
|
1376
1579
|
e.y,
|
|
1377
|
-
|
|
1580
|
+
Ce,
|
|
1378
1581
|
Math.max(
|
|
1379
|
-
|
|
1380
|
-
|
|
1582
|
+
Ce,
|
|
1583
|
+
n.height - t.height - I
|
|
1381
1584
|
)
|
|
1382
1585
|
)
|
|
1383
1586
|
};
|
|
1384
1587
|
}
|
|
1385
|
-
function
|
|
1588
|
+
function ve(e, t) {
|
|
1386
1589
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1387
1590
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1388
1591
|
return;
|
|
1389
1592
|
}
|
|
1390
1593
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1391
1594
|
}
|
|
1392
|
-
function
|
|
1595
|
+
function oa(e, t) {
|
|
1393
1596
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1394
1597
|
}
|
|
1395
|
-
function
|
|
1598
|
+
function Dn(e) {
|
|
1396
1599
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1397
1600
|
}
|
|
1398
|
-
function
|
|
1601
|
+
function Y() {
|
|
1399
1602
|
return {
|
|
1400
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1401
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1603
|
+
width: window.innerWidth || document.documentElement.clientWidth || Qn + I * 2,
|
|
1604
|
+
height: window.innerHeight || document.documentElement.clientHeight || eo + I * 2
|
|
1402
1605
|
};
|
|
1403
1606
|
}
|
|
1404
|
-
function
|
|
1607
|
+
function Rt(e) {
|
|
1405
1608
|
const t = e.getBoundingClientRect();
|
|
1406
1609
|
return {
|
|
1407
1610
|
x: Math.round(t.x),
|
|
@@ -1410,57 +1613,57 @@ function St(e) {
|
|
|
1410
1613
|
height: Math.round(t.height)
|
|
1411
1614
|
};
|
|
1412
1615
|
}
|
|
1413
|
-
function
|
|
1414
|
-
return Math.min(Math.max(e, t),
|
|
1616
|
+
function K(e, t, n) {
|
|
1617
|
+
return Math.min(Math.max(e, t), n);
|
|
1415
1618
|
}
|
|
1416
|
-
function
|
|
1619
|
+
function J(e, t, n) {
|
|
1417
1620
|
if (typeof window > "u")
|
|
1418
1621
|
return;
|
|
1419
|
-
const
|
|
1622
|
+
const o = window, i = {
|
|
1420
1623
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1421
1624
|
source: e,
|
|
1422
1625
|
message: t,
|
|
1423
|
-
details:
|
|
1424
|
-
}, r =
|
|
1425
|
-
r.push(i), r.length > 120 && r.splice(0, r.length - 120),
|
|
1426
|
-
new CustomEvent(
|
|
1626
|
+
details: n
|
|
1627
|
+
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1628
|
+
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1629
|
+
new CustomEvent(Ci, { detail: i })
|
|
1427
1630
|
);
|
|
1428
1631
|
}
|
|
1429
|
-
function
|
|
1430
|
-
|
|
1632
|
+
function ia(e, t) {
|
|
1633
|
+
J("web-sdk.widget.position", e, t);
|
|
1431
1634
|
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
return !
|
|
1435
|
-
attachments:
|
|
1635
|
+
function zt(e, t, n) {
|
|
1636
|
+
const o = t.value.trim();
|
|
1637
|
+
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1638
|
+
attachments: n.length > 0 ? n.map(la) : void 0
|
|
1436
1639
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1437
1640
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1440
|
-
return
|
|
1641
|
+
function aa(e, t, n) {
|
|
1642
|
+
const o = e.activeElement;
|
|
1643
|
+
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1441
1644
|
}
|
|
1442
|
-
function
|
|
1443
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1645
|
+
function ra(e, t, n, o) {
|
|
1646
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > hi)
|
|
1444
1647
|
return;
|
|
1445
|
-
const i = e.focusedInput === "composer" ?
|
|
1446
|
-
i ===
|
|
1648
|
+
const i = e.focusedInput === "composer" ? o : n;
|
|
1649
|
+
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1447
1650
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1448
1651
|
});
|
|
1449
1652
|
}
|
|
1450
|
-
function
|
|
1653
|
+
function la(e) {
|
|
1451
1654
|
return e;
|
|
1452
1655
|
}
|
|
1453
|
-
function
|
|
1656
|
+
function je(e) {
|
|
1454
1657
|
e.style.height = "0px";
|
|
1455
1658
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1456
1659
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1457
1660
|
}
|
|
1458
|
-
function
|
|
1661
|
+
function Ve(e, t = () => !0) {
|
|
1459
1662
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1460
1663
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1461
1664
|
});
|
|
1462
1665
|
}
|
|
1463
|
-
function
|
|
1666
|
+
function pa(e) {
|
|
1464
1667
|
const t = e.messages[e.messages.length - 1];
|
|
1465
1668
|
return [
|
|
1466
1669
|
e.messages.length,
|
|
@@ -1471,69 +1674,69 @@ function Gi(e) {
|
|
|
1471
1674
|
e.lastError ?? ""
|
|
1472
1675
|
].join(":");
|
|
1473
1676
|
}
|
|
1474
|
-
function
|
|
1677
|
+
function sa(e) {
|
|
1475
1678
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1476
1679
|
}
|
|
1477
|
-
function
|
|
1680
|
+
function da(e) {
|
|
1478
1681
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1479
1682
|
}
|
|
1480
|
-
function
|
|
1683
|
+
function ca(e) {
|
|
1481
1684
|
const t = e.currentPage;
|
|
1482
1685
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1483
1686
|
try {
|
|
1484
|
-
const
|
|
1485
|
-
return `${
|
|
1687
|
+
const n = new URL(t.url);
|
|
1688
|
+
return `${n.pathname || "/"}${n.search}`;
|
|
1486
1689
|
} catch {
|
|
1487
1690
|
return t.url;
|
|
1488
1691
|
}
|
|
1489
1692
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1490
1693
|
}
|
|
1491
|
-
function
|
|
1492
|
-
const
|
|
1493
|
-
if (!Number.isFinite(
|
|
1694
|
+
function ua(e, t) {
|
|
1695
|
+
const n = new Date(e).getTime();
|
|
1696
|
+
if (!Number.isFinite(n))
|
|
1494
1697
|
return "now";
|
|
1495
|
-
const
|
|
1698
|
+
const o = Math.max(0, t - n), i = [
|
|
1496
1699
|
["day", 864e5],
|
|
1497
1700
|
["hour", 36e5],
|
|
1498
1701
|
["min", 6e4]
|
|
1499
1702
|
];
|
|
1500
1703
|
for (const [r, l] of i)
|
|
1501
|
-
if (
|
|
1502
|
-
const p = Math.max(1, Math.floor(
|
|
1704
|
+
if (o >= l) {
|
|
1705
|
+
const p = Math.max(1, Math.floor(o / l));
|
|
1503
1706
|
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1504
1707
|
}
|
|
1505
1708
|
return "now";
|
|
1506
1709
|
}
|
|
1507
|
-
function
|
|
1508
|
-
e.appendChild(
|
|
1509
|
-
|
|
1710
|
+
function ga(e, t, n, o, i) {
|
|
1711
|
+
e.appendChild(va()), e.appendChild(
|
|
1712
|
+
ha(
|
|
1510
1713
|
t,
|
|
1511
|
-
o,
|
|
1512
1714
|
n,
|
|
1715
|
+
o,
|
|
1513
1716
|
i
|
|
1514
1717
|
)
|
|
1515
1718
|
), e.appendChild(
|
|
1516
|
-
|
|
1719
|
+
gt(
|
|
1517
1720
|
"pluno-pa-widget__close",
|
|
1518
1721
|
"Close",
|
|
1519
|
-
|
|
1722
|
+
Ca(16),
|
|
1520
1723
|
!0
|
|
1521
1724
|
)
|
|
1522
|
-
), e.appendChild(
|
|
1725
|
+
), e.appendChild(ma(n));
|
|
1523
1726
|
}
|
|
1524
|
-
function
|
|
1727
|
+
function ha(e, t, n, o) {
|
|
1525
1728
|
const i = document.createElement("form");
|
|
1526
|
-
if (i.className = "pluno-pa-widget__launcher",
|
|
1729
|
+
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1527
1730
|
const d = document.createElement("button");
|
|
1528
1731
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
|
|
1529
1732
|
}
|
|
1530
1733
|
i.appendChild(
|
|
1531
|
-
|
|
1734
|
+
co(
|
|
1532
1735
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1533
1736
|
10
|
|
1534
1737
|
)
|
|
1535
1738
|
), i.appendChild(
|
|
1536
|
-
|
|
1739
|
+
me(
|
|
1537
1740
|
"pluno-pa-widget__character--launcher",
|
|
1538
1741
|
t
|
|
1539
1742
|
)
|
|
@@ -1542,136 +1745,155 @@ function Yi(e, t, o, n) {
|
|
|
1542
1745
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1543
1746
|
const l = document.createElement("input");
|
|
1544
1747
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1545
|
-
const p =
|
|
1546
|
-
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p),
|
|
1748
|
+
const p = ct("Working...");
|
|
1749
|
+
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1547
1750
|
const d = document.createElement("button");
|
|
1548
1751
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
|
|
1549
1752
|
}
|
|
1550
1753
|
return i;
|
|
1551
1754
|
}
|
|
1552
|
-
function
|
|
1755
|
+
function ma(e) {
|
|
1553
1756
|
const t = document.createElement("section");
|
|
1554
1757
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1555
|
-
|
|
1758
|
+
co("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1556
1759
|
);
|
|
1557
|
-
const
|
|
1558
|
-
|
|
1559
|
-
const
|
|
1560
|
-
|
|
1760
|
+
const n = document.createElement("div");
|
|
1761
|
+
n.className = "pluno-pa-widget__timeline-wrap";
|
|
1762
|
+
const o = document.createElement("main");
|
|
1763
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(_a(e));
|
|
1561
1764
|
const i = document.createElement("div");
|
|
1562
|
-
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"),
|
|
1765
|
+
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1563
1766
|
const r = document.createElement("div");
|
|
1564
|
-
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0,
|
|
1767
|
+
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
1565
1768
|
const l = document.createElement("button");
|
|
1566
|
-
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0,
|
|
1769
|
+
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1567
1770
|
const p = document.createElement("div");
|
|
1568
1771
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1569
|
-
|
|
1772
|
+
gt(
|
|
1570
1773
|
"pluno-pa-widget__history",
|
|
1571
|
-
|
|
1572
|
-
|
|
1774
|
+
Kt(),
|
|
1775
|
+
Ea(),
|
|
1573
1776
|
!0
|
|
1574
1777
|
)
|
|
1575
|
-
),
|
|
1778
|
+
), n.appendChild(p), n.appendChild(ba()), t.appendChild(n), t.appendChild(fa()), t.appendChild(wa()), t.appendChild(he("left", "Resize Pluno from left")), t.appendChild(
|
|
1779
|
+
he("right", "Resize Pluno from right")
|
|
1780
|
+
), t.appendChild(he("top", "Resize Pluno from top")), t.appendChild(
|
|
1781
|
+
he("bottom", "Resize Pluno from bottom")
|
|
1782
|
+
), t.appendChild(
|
|
1783
|
+
he("top-left", "Resize Pluno from top left")
|
|
1784
|
+
), t.appendChild(
|
|
1785
|
+
he("top-right", "Resize Pluno from top right")
|
|
1786
|
+
), t.appendChild(
|
|
1787
|
+
he("bottom-left", "Resize Pluno from bottom left")
|
|
1788
|
+
), t.appendChild(
|
|
1789
|
+
he("bottom-right", "Resize Pluno from bottom right")
|
|
1790
|
+
), t;
|
|
1576
1791
|
}
|
|
1577
|
-
function
|
|
1792
|
+
function he(e, t) {
|
|
1793
|
+
const n = document.createElement("button");
|
|
1794
|
+
return n.type = "button", n.className = [
|
|
1795
|
+
"pluno-pa-widget__resize-handle",
|
|
1796
|
+
`pluno-pa-widget__resize-handle--${e}`
|
|
1797
|
+
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
1798
|
+
}
|
|
1799
|
+
function fa() {
|
|
1578
1800
|
const e = document.createElement("div");
|
|
1579
1801
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
1580
1802
|
const t = document.createElement("span");
|
|
1581
1803
|
t.className = "pluno-pa-widget__notify-suggestion-label", t.textContent = "This may take a moment. Get notified when it's done?";
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1584
|
-
const
|
|
1585
|
-
|
|
1804
|
+
const n = document.createElement("div");
|
|
1805
|
+
n.className = "pluno-pa-widget__notify-suggestion-actions";
|
|
1806
|
+
const o = document.createElement("button");
|
|
1807
|
+
o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable", o.textContent = "Notify me";
|
|
1586
1808
|
const i = document.createElement("button");
|
|
1587
1809
|
i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later", i.textContent = "Later";
|
|
1588
1810
|
const r = document.createElement("button");
|
|
1589
|
-
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never",
|
|
1811
|
+
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;
|
|
1590
1812
|
}
|
|
1591
|
-
function
|
|
1813
|
+
function wa() {
|
|
1592
1814
|
const e = document.createElement("form");
|
|
1593
1815
|
e.className = "pluno-pa-widget__composer";
|
|
1594
1816
|
const t = document.createElement("div");
|
|
1595
1817
|
t.className = "pluno-pa-widget__billing-status", t.hidden = !0, e.appendChild(t);
|
|
1596
|
-
const o = document.createElement("div");
|
|
1597
|
-
o.className = "pluno-pa-widget__attachment-error", o.hidden = !0, e.appendChild(o);
|
|
1598
1818
|
const n = document.createElement("div");
|
|
1599
|
-
n.className = "pluno-pa-
|
|
1819
|
+
n.className = "pluno-pa-widget__attachment-error", n.hidden = !0, e.appendChild(n);
|
|
1820
|
+
const o = document.createElement("div");
|
|
1821
|
+
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
1600
1822
|
const i = document.createElement("div");
|
|
1601
1823
|
i.className = "pluno-pa-widget__composer-inner";
|
|
1602
1824
|
const r = document.createElement("input");
|
|
1603
1825
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1604
1826
|
const l = document.createElement("button");
|
|
1605
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
1827
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(La()), l.appendChild(Pa()), i.appendChild(l);
|
|
1606
1828
|
const p = document.createElement("textarea");
|
|
1607
1829
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1608
1830
|
const d = document.createElement("button");
|
|
1609
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
return
|
|
1831
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(go()), i.appendChild(d), e.appendChild(i);
|
|
1832
|
+
const c = document.createElement("div");
|
|
1833
|
+
c.className = "pluno-pa-widget__composer-meta";
|
|
1834
|
+
const u = document.createElement("a");
|
|
1835
|
+
u.className = "pluno-pa-widget__powered-by", u.href = "https://pluno.ai", u.target = "_blank", u.rel = "noopener noreferrer", u.textContent = "Powered by Pluno.ai.", c.appendChild(u);
|
|
1836
|
+
const m = document.createElement("span");
|
|
1837
|
+
return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
|
|
1616
1838
|
}
|
|
1617
|
-
function
|
|
1839
|
+
function Kt() {
|
|
1618
1840
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1619
1841
|
}
|
|
1620
|
-
function
|
|
1842
|
+
function ba() {
|
|
1621
1843
|
const e = document.createElement("section");
|
|
1622
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1844
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", Kt());
|
|
1623
1845
|
const t = document.createElement("div");
|
|
1624
1846
|
t.className = "pluno-pa-widget__history-header";
|
|
1625
|
-
const
|
|
1626
|
-
|
|
1627
|
-
const
|
|
1847
|
+
const n = document.createElement("strong");
|
|
1848
|
+
n.textContent = Kt();
|
|
1849
|
+
const o = gt(
|
|
1628
1850
|
"pluno-pa-widget__history-close",
|
|
1629
1851
|
"Close recent chats",
|
|
1630
|
-
|
|
1852
|
+
ka(),
|
|
1631
1853
|
!1
|
|
1632
1854
|
);
|
|
1633
|
-
t.append(
|
|
1855
|
+
t.append(n, o);
|
|
1634
1856
|
const i = document.createElement("div");
|
|
1635
1857
|
i.className = "pluno-pa-widget__history-list";
|
|
1636
1858
|
const r = document.createElement("p");
|
|
1637
1859
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1638
1860
|
}
|
|
1639
|
-
function
|
|
1861
|
+
function _a(e) {
|
|
1640
1862
|
const t = document.createElement("div");
|
|
1641
1863
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1642
|
-
|
|
1864
|
+
me(
|
|
1643
1865
|
"pluno-pa-widget__character--empty",
|
|
1644
1866
|
e
|
|
1645
1867
|
)
|
|
1646
|
-
), t.appendChild(
|
|
1868
|
+
), t.appendChild(lo()), t;
|
|
1647
1869
|
}
|
|
1648
|
-
function
|
|
1870
|
+
function lo() {
|
|
1649
1871
|
const e = document.createElement("div");
|
|
1650
1872
|
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;
|
|
1651
1873
|
}
|
|
1652
|
-
function
|
|
1874
|
+
function po(e, t) {
|
|
1653
1875
|
e.replaceChildren(), e.setAttribute(
|
|
1654
1876
|
"aria-label",
|
|
1655
1877
|
`${t.toLocaleString("en-US")} users currently active`
|
|
1656
1878
|
);
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1879
|
+
const n = document.createElement("span");
|
|
1880
|
+
n.className = "pluno-pa-widget__active-users-counter-dot", n.setAttribute("aria-hidden", "true"), e.appendChild(n), e.appendChild(
|
|
1659
1881
|
document.createTextNode(
|
|
1660
1882
|
`${t.toLocaleString("en-US")} users currently active`
|
|
1661
1883
|
)
|
|
1662
1884
|
);
|
|
1663
1885
|
}
|
|
1664
|
-
function
|
|
1665
|
-
const
|
|
1666
|
-
|
|
1667
|
-
const
|
|
1668
|
-
return
|
|
1886
|
+
function me(e, t) {
|
|
1887
|
+
const n = `pluno-pa-character-${Ln}`;
|
|
1888
|
+
Ln += 1;
|
|
1889
|
+
const o = t.scribbleStyle ? ya(t.accentColor, n) : xa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1890
|
+
return o.setAttribute(
|
|
1669
1891
|
"class",
|
|
1670
1892
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
1671
|
-
),
|
|
1893
|
+
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
1672
1894
|
}
|
|
1673
|
-
function
|
|
1674
|
-
const
|
|
1895
|
+
function xa(e, t) {
|
|
1896
|
+
const n = Ko(e), o = {
|
|
1675
1897
|
boltFill: `${t}-boltFill`,
|
|
1676
1898
|
boltEdge: `${t}-boltEdge`,
|
|
1677
1899
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -1682,171 +1904,171 @@ function ta(e, t) {
|
|
|
1682
1904
|
eyeShadow: `${t}-eyeShadow`,
|
|
1683
1905
|
pupilGloss: `${t}-pupilGloss`,
|
|
1684
1906
|
boltClip: `${t}-boltClip`
|
|
1685
|
-
}, i =
|
|
1686
|
-
id:
|
|
1907
|
+
}, i = so(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1908
|
+
id: o.boltFill,
|
|
1687
1909
|
x1: "420",
|
|
1688
1910
|
y1: "180",
|
|
1689
1911
|
x2: "790",
|
|
1690
1912
|
y2: "1040",
|
|
1691
1913
|
gradientUnits: "userSpaceOnUse"
|
|
1692
1914
|
});
|
|
1693
|
-
|
|
1694
|
-
const p =
|
|
1695
|
-
id:
|
|
1915
|
+
O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
|
|
1916
|
+
const p = f(r, "linearGradient", {
|
|
1917
|
+
id: o.boltEdge,
|
|
1696
1918
|
x1: "470",
|
|
1697
1919
|
y1: "145",
|
|
1698
1920
|
x2: "900",
|
|
1699
1921
|
y2: "980",
|
|
1700
1922
|
gradientUnits: "userSpaceOnUse"
|
|
1701
1923
|
});
|
|
1702
|
-
|
|
1703
|
-
const d =
|
|
1704
|
-
id:
|
|
1924
|
+
O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
|
|
1925
|
+
const d = f(r, "radialGradient", {
|
|
1926
|
+
id: o.boltGlow,
|
|
1705
1927
|
cx: "50%",
|
|
1706
1928
|
cy: "22%",
|
|
1707
1929
|
r: "82%"
|
|
1708
1930
|
});
|
|
1709
|
-
|
|
1710
|
-
const
|
|
1711
|
-
id:
|
|
1931
|
+
O(d, "0", n.glow, "0.72"), O(d, "0.5", n.middle, "0.44"), O(d, "1", n.bottom, "0");
|
|
1932
|
+
const c = f(r, "radialGradient", {
|
|
1933
|
+
id: o.eyeWhite,
|
|
1712
1934
|
cx: "35%",
|
|
1713
1935
|
cy: "25%",
|
|
1714
1936
|
r: "70%"
|
|
1715
1937
|
});
|
|
1716
|
-
|
|
1717
|
-
const
|
|
1718
|
-
id:
|
|
1938
|
+
O(c, "0", "#ffffff"), O(c, "0.72", "#ffffff"), O(c, "1", "#e5e5e5");
|
|
1939
|
+
const u = f(r, "radialGradient", {
|
|
1940
|
+
id: o.pupil,
|
|
1719
1941
|
cx: "42%",
|
|
1720
1942
|
cy: "38%",
|
|
1721
1943
|
r: "65%"
|
|
1722
1944
|
});
|
|
1723
|
-
|
|
1724
|
-
const
|
|
1725
|
-
id:
|
|
1945
|
+
O(u, "0", "#2a1f10"), O(u, "0.52", "#080604"), O(u, "1", "#000000");
|
|
1946
|
+
const m = f(r, "filter", {
|
|
1947
|
+
id: o.softDropShadow,
|
|
1726
1948
|
x: "-18%",
|
|
1727
1949
|
y: "-12%",
|
|
1728
1950
|
width: "136%",
|
|
1729
1951
|
height: "136%",
|
|
1730
1952
|
"color-interpolation-filters": "sRGB"
|
|
1731
1953
|
});
|
|
1732
|
-
m
|
|
1954
|
+
f(m, "feDropShadow", {
|
|
1733
1955
|
dx: "0",
|
|
1734
1956
|
dy: "12",
|
|
1735
1957
|
stdDeviation: "18",
|
|
1736
|
-
"flood-color":
|
|
1958
|
+
"flood-color": n.shadow,
|
|
1737
1959
|
"flood-opacity": "0.24"
|
|
1738
1960
|
});
|
|
1739
|
-
const
|
|
1740
|
-
id:
|
|
1961
|
+
const E = f(r, "filter", {
|
|
1962
|
+
id: o.innerDepth,
|
|
1741
1963
|
x: "-8%",
|
|
1742
1964
|
y: "-8%",
|
|
1743
1965
|
width: "116%",
|
|
1744
1966
|
height: "116%",
|
|
1745
1967
|
"color-interpolation-filters": "sRGB"
|
|
1746
1968
|
});
|
|
1747
|
-
|
|
1969
|
+
f(E, "feGaussianBlur", {
|
|
1748
1970
|
in: "SourceAlpha",
|
|
1749
1971
|
stdDeviation: "8",
|
|
1750
1972
|
result: "blur"
|
|
1751
|
-
}),
|
|
1973
|
+
}), f(E, "feOffset", {
|
|
1752
1974
|
dx: "-7",
|
|
1753
1975
|
dy: "-9",
|
|
1754
1976
|
result: "topLeft"
|
|
1755
|
-
}),
|
|
1977
|
+
}), f(E, "feComposite", {
|
|
1756
1978
|
in: "topLeft",
|
|
1757
1979
|
in2: "SourceAlpha",
|
|
1758
1980
|
operator: "arithmetic",
|
|
1759
1981
|
k2: "-1",
|
|
1760
1982
|
k3: "1",
|
|
1761
1983
|
result: "innerShadow"
|
|
1762
|
-
}),
|
|
1984
|
+
}), f(E, "feColorMatrix", {
|
|
1763
1985
|
in: "innerShadow",
|
|
1764
1986
|
type: "matrix",
|
|
1765
1987
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
1766
1988
|
result: "innerLight"
|
|
1767
|
-
}),
|
|
1989
|
+
}), f(E, "feBlend", {
|
|
1768
1990
|
in: "SourceGraphic",
|
|
1769
1991
|
in2: "innerLight",
|
|
1770
1992
|
mode: "screen"
|
|
1771
1993
|
});
|
|
1772
|
-
const
|
|
1773
|
-
id:
|
|
1994
|
+
const v = f(r, "filter", {
|
|
1995
|
+
id: o.eyeShadow,
|
|
1774
1996
|
x: "-24%",
|
|
1775
1997
|
y: "-20%",
|
|
1776
1998
|
width: "148%",
|
|
1777
1999
|
height: "148%",
|
|
1778
2000
|
"color-interpolation-filters": "sRGB"
|
|
1779
2001
|
});
|
|
1780
|
-
|
|
2002
|
+
f(v, "feDropShadow", {
|
|
1781
2003
|
dx: "0",
|
|
1782
2004
|
dy: "8",
|
|
1783
2005
|
stdDeviation: "5",
|
|
1784
|
-
"flood-color":
|
|
2006
|
+
"flood-color": n.shadow,
|
|
1785
2007
|
"flood-opacity": "0.3"
|
|
1786
2008
|
});
|
|
1787
|
-
const
|
|
1788
|
-
id:
|
|
2009
|
+
const z = f(r, "filter", {
|
|
2010
|
+
id: o.pupilGloss,
|
|
1789
2011
|
x: "-15%",
|
|
1790
2012
|
y: "-15%",
|
|
1791
2013
|
width: "130%",
|
|
1792
2014
|
height: "130%",
|
|
1793
2015
|
"color-interpolation-filters": "sRGB"
|
|
1794
2016
|
});
|
|
1795
|
-
|
|
2017
|
+
f(z, "feDropShadow", {
|
|
1796
2018
|
dx: "0",
|
|
1797
2019
|
dy: "3",
|
|
1798
2020
|
stdDeviation: "3",
|
|
1799
2021
|
"flood-color": "#000000",
|
|
1800
2022
|
"flood-opacity": "0.22"
|
|
1801
2023
|
});
|
|
1802
|
-
const
|
|
1803
|
-
|
|
1804
|
-
const
|
|
1805
|
-
filter:
|
|
2024
|
+
const b = f(r, "clipPath", { id: o.boltClip });
|
|
2025
|
+
f(b, "path", { d: pt });
|
|
2026
|
+
const g = f(i, "g", {
|
|
2027
|
+
filter: V(o.softDropShadow)
|
|
1806
2028
|
});
|
|
1807
|
-
|
|
1808
|
-
d:
|
|
1809
|
-
fill:
|
|
2029
|
+
f(g, "path", {
|
|
2030
|
+
d: pt,
|
|
2031
|
+
fill: V(o.boltEdge)
|
|
1810
2032
|
});
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
d:
|
|
1814
|
-
fill:
|
|
1815
|
-
filter:
|
|
1816
|
-
}),
|
|
1817
|
-
d:
|
|
1818
|
-
fill:
|
|
2033
|
+
const w = "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";
|
|
2034
|
+
f(g, "path", {
|
|
2035
|
+
d: w,
|
|
2036
|
+
fill: V(o.boltFill),
|
|
2037
|
+
filter: V(o.innerDepth)
|
|
2038
|
+
}), f(g, "path", {
|
|
2039
|
+
d: w,
|
|
2040
|
+
fill: V(o.boltGlow),
|
|
1819
2041
|
opacity: "0.74"
|
|
1820
2042
|
});
|
|
1821
|
-
const h =
|
|
1822
|
-
"clip-path":
|
|
2043
|
+
const h = f(g, "g", {
|
|
2044
|
+
"clip-path": V(o.boltClip),
|
|
1823
2045
|
opacity: "0.42"
|
|
1824
2046
|
});
|
|
1825
|
-
|
|
2047
|
+
f(h, "path", {
|
|
1826
2048
|
d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
|
|
1827
2049
|
fill: "none",
|
|
1828
|
-
stroke:
|
|
2050
|
+
stroke: n.highlight,
|
|
1829
2051
|
"stroke-width": "22",
|
|
1830
2052
|
"stroke-linecap": "round",
|
|
1831
2053
|
opacity: "0.65"
|
|
1832
|
-
}),
|
|
2054
|
+
}), f(h, "path", {
|
|
1833
2055
|
d: "M556 685 L501 994",
|
|
1834
2056
|
fill: "none",
|
|
1835
|
-
stroke:
|
|
2057
|
+
stroke: n.highlight,
|
|
1836
2058
|
"stroke-width": "20",
|
|
1837
2059
|
"stroke-linecap": "round",
|
|
1838
2060
|
opacity: "0.55"
|
|
1839
|
-
}),
|
|
2061
|
+
}), f(h, "path", {
|
|
1840
2062
|
d: "M858 160 C882 166 893 181 883 204",
|
|
1841
2063
|
fill: "none",
|
|
1842
|
-
stroke:
|
|
2064
|
+
stroke: n.inner,
|
|
1843
2065
|
"stroke-width": "18",
|
|
1844
2066
|
"stroke-linecap": "round",
|
|
1845
2067
|
opacity: "0.48"
|
|
1846
2068
|
});
|
|
1847
|
-
const
|
|
1848
|
-
return
|
|
1849
|
-
|
|
2069
|
+
const P = f(i, "g", { filter: V(o.eyeShadow) });
|
|
2070
|
+
return Rn(
|
|
2071
|
+
P,
|
|
1850
2072
|
"rotate(-2 528 463)",
|
|
1851
2073
|
"528",
|
|
1852
2074
|
"463",
|
|
@@ -1854,9 +2076,9 @@ function ta(e, t) {
|
|
|
1854
2076
|
"473",
|
|
1855
2077
|
"557",
|
|
1856
2078
|
"447",
|
|
1857
|
-
|
|
1858
|
-
),
|
|
1859
|
-
|
|
2079
|
+
o
|
|
2080
|
+
), Rn(
|
|
2081
|
+
P,
|
|
1860
2082
|
"rotate(2 717 462)",
|
|
1861
2083
|
"717",
|
|
1862
2084
|
"462",
|
|
@@ -1864,55 +2086,55 @@ function ta(e, t) {
|
|
|
1864
2086
|
"473",
|
|
1865
2087
|
"728",
|
|
1866
2088
|
"447",
|
|
1867
|
-
|
|
2089
|
+
o
|
|
1868
2090
|
), i;
|
|
1869
2091
|
}
|
|
1870
|
-
function
|
|
1871
|
-
const
|
|
2092
|
+
function ya(e, t) {
|
|
2093
|
+
const n = Kn(e), o = {
|
|
1872
2094
|
clip: `${t}-scribbleBoltClip`,
|
|
1873
2095
|
wobble: `${t}-scribbleBoltWobble`
|
|
1874
|
-
}, i =
|
|
1875
|
-
|
|
1876
|
-
const p =
|
|
1877
|
-
id:
|
|
2096
|
+
}, i = so(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2097
|
+
f(l, "path", { d: pt });
|
|
2098
|
+
const p = f(r, "filter", {
|
|
2099
|
+
id: o.wobble,
|
|
1878
2100
|
x: "-10%",
|
|
1879
2101
|
y: "-10%",
|
|
1880
2102
|
width: "120%",
|
|
1881
2103
|
height: "120%",
|
|
1882
2104
|
"color-interpolation-filters": "sRGB"
|
|
1883
2105
|
});
|
|
1884
|
-
|
|
2106
|
+
f(p, "feTurbulence", {
|
|
1885
2107
|
type: "fractalNoise",
|
|
1886
2108
|
baseFrequency: "0.011",
|
|
1887
2109
|
numOctaves: "3",
|
|
1888
2110
|
seed: "7",
|
|
1889
2111
|
result: "noise"
|
|
1890
|
-
}),
|
|
2112
|
+
}), f(p, "feDisplacementMap", {
|
|
1891
2113
|
in: "SourceGraphic",
|
|
1892
2114
|
in2: "noise",
|
|
1893
2115
|
scale: "16",
|
|
1894
2116
|
xChannelSelector: "R",
|
|
1895
2117
|
yChannelSelector: "G"
|
|
1896
2118
|
});
|
|
1897
|
-
const d =
|
|
1898
|
-
"clip-path":
|
|
2119
|
+
const d = f(i, "g", { filter: V(o.wobble) }), c = f(d, "g", {
|
|
2120
|
+
"clip-path": V(o.clip)
|
|
1899
2121
|
});
|
|
1900
|
-
return
|
|
1901
|
-
d:
|
|
2122
|
+
return f(c, "path", {
|
|
2123
|
+
d: Vo(),
|
|
1902
2124
|
fill: "none",
|
|
1903
|
-
stroke:
|
|
2125
|
+
stroke: n,
|
|
1904
2126
|
"stroke-width": "56",
|
|
1905
2127
|
"stroke-linecap": "round",
|
|
1906
2128
|
"stroke-linejoin": "round",
|
|
1907
2129
|
opacity: "0.9",
|
|
1908
2130
|
transform: "rotate(-14 627 600)"
|
|
1909
|
-
}),
|
|
1910
|
-
d:
|
|
2131
|
+
}), f(d, "path", {
|
|
2132
|
+
d: pt,
|
|
1911
2133
|
fill: "none",
|
|
1912
|
-
stroke:
|
|
2134
|
+
stroke: st,
|
|
1913
2135
|
"stroke-width": "18",
|
|
1914
2136
|
"stroke-linejoin": "round"
|
|
1915
|
-
}),
|
|
2137
|
+
}), zn(
|
|
1916
2138
|
d,
|
|
1917
2139
|
"rotate(-2 528 463)",
|
|
1918
2140
|
"528",
|
|
@@ -1921,7 +2143,7 @@ function na(e, t) {
|
|
|
1921
2143
|
"473",
|
|
1922
2144
|
"557",
|
|
1923
2145
|
"447"
|
|
1924
|
-
),
|
|
2146
|
+
), zn(
|
|
1925
2147
|
d,
|
|
1926
2148
|
"rotate(2 717 462)",
|
|
1927
2149
|
"717",
|
|
@@ -1932,139 +2154,161 @@ function na(e, t) {
|
|
|
1932
2154
|
"447"
|
|
1933
2155
|
), i;
|
|
1934
2156
|
}
|
|
1935
|
-
function
|
|
1936
|
-
return
|
|
1937
|
-
xmlns:
|
|
2157
|
+
function so() {
|
|
2158
|
+
return S("svg", {
|
|
2159
|
+
xmlns: to,
|
|
1938
2160
|
viewBox: "0 0 1254 1254"
|
|
1939
2161
|
});
|
|
1940
2162
|
}
|
|
1941
|
-
function
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
cx:
|
|
1945
|
-
cy:
|
|
2163
|
+
function Rn(e, t, n, o, i, r, l, p, d) {
|
|
2164
|
+
const c = f(e, "g", { transform: t });
|
|
2165
|
+
f(c, "ellipse", {
|
|
2166
|
+
cx: n,
|
|
2167
|
+
cy: o,
|
|
1946
2168
|
rx: "73",
|
|
1947
2169
|
ry: "80",
|
|
1948
|
-
fill:
|
|
1949
|
-
}),
|
|
2170
|
+
fill: V(d.eyeWhite)
|
|
2171
|
+
}), f(c, "ellipse", {
|
|
1950
2172
|
cx: i,
|
|
1951
2173
|
cy: r,
|
|
1952
2174
|
rx: "49",
|
|
1953
2175
|
ry: "57",
|
|
1954
|
-
fill:
|
|
1955
|
-
filter:
|
|
1956
|
-
}),
|
|
2176
|
+
fill: V(d.pupil),
|
|
2177
|
+
filter: V(d.pupilGloss)
|
|
2178
|
+
}), f(c, "circle", {
|
|
1957
2179
|
cx: l,
|
|
1958
2180
|
cy: p,
|
|
1959
2181
|
r: "18",
|
|
1960
2182
|
fill: "#ffffff"
|
|
1961
2183
|
});
|
|
1962
2184
|
}
|
|
1963
|
-
function
|
|
1964
|
-
const d =
|
|
1965
|
-
|
|
1966
|
-
cx:
|
|
1967
|
-
cy:
|
|
2185
|
+
function zn(e, t, n, o, i, r, l, p) {
|
|
2186
|
+
const d = f(e, "g", { transform: t });
|
|
2187
|
+
f(d, "ellipse", {
|
|
2188
|
+
cx: n,
|
|
2189
|
+
cy: o,
|
|
1968
2190
|
rx: "73",
|
|
1969
2191
|
ry: "80",
|
|
1970
2192
|
fill: "#ffffff",
|
|
1971
|
-
stroke:
|
|
2193
|
+
stroke: st,
|
|
1972
2194
|
"stroke-width": "13"
|
|
1973
|
-
}),
|
|
2195
|
+
}), f(d, "ellipse", {
|
|
1974
2196
|
cx: i,
|
|
1975
2197
|
cy: r,
|
|
1976
2198
|
rx: "45",
|
|
1977
2199
|
ry: "53",
|
|
1978
|
-
fill:
|
|
1979
|
-
}),
|
|
2200
|
+
fill: st
|
|
2201
|
+
}), f(d, "circle", {
|
|
1980
2202
|
cx: l,
|
|
1981
2203
|
cy: p,
|
|
1982
2204
|
r: "16",
|
|
1983
2205
|
fill: "#ffffff"
|
|
1984
2206
|
});
|
|
1985
2207
|
}
|
|
1986
|
-
function
|
|
1987
|
-
const
|
|
1988
|
-
return e.appendChild(
|
|
2208
|
+
function f(e, t, n = {}) {
|
|
2209
|
+
const o = S(t, n);
|
|
2210
|
+
return e.appendChild(o), o;
|
|
1989
2211
|
}
|
|
1990
|
-
function
|
|
1991
|
-
const i = { offset: t, "stop-color":
|
|
1992
|
-
|
|
2212
|
+
function O(e, t, n, o) {
|
|
2213
|
+
const i = { offset: t, "stop-color": n };
|
|
2214
|
+
o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
|
|
1993
2215
|
}
|
|
1994
|
-
function
|
|
2216
|
+
function V(e) {
|
|
1995
2217
|
return `url(#${e})`;
|
|
1996
2218
|
}
|
|
1997
|
-
function
|
|
2219
|
+
function gt(e, t, n, o) {
|
|
1998
2220
|
const i = document.createElement("button");
|
|
1999
|
-
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden =
|
|
2221
|
+
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2000
2222
|
}
|
|
2001
|
-
function
|
|
2002
|
-
const e =
|
|
2223
|
+
function va() {
|
|
2224
|
+
const e = S("svg", {
|
|
2003
2225
|
class: "pluno-pa-widget__scribble-defs",
|
|
2004
2226
|
"aria-hidden": "true",
|
|
2005
2227
|
focusable: "false",
|
|
2006
2228
|
width: "0",
|
|
2007
2229
|
height: "0"
|
|
2008
|
-
}), t =
|
|
2009
|
-
return t.appendChild(
|
|
2010
|
-
|
|
2230
|
+
}), t = S("defs");
|
|
2231
|
+
return t.appendChild(Ot("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2232
|
+
Ot("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2011
2233
|
), t.appendChild(
|
|
2012
|
-
|
|
2234
|
+
Ot("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2013
2235
|
), e.appendChild(t), e;
|
|
2014
2236
|
}
|
|
2015
|
-
function
|
|
2016
|
-
const
|
|
2237
|
+
function co(e, t) {
|
|
2238
|
+
const n = S("svg", {
|
|
2017
2239
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2018
|
-
viewBox: `0 0 ${o} ${_i}`,
|
|
2019
2240
|
preserveAspectRatio: "xMidYMid meet",
|
|
2020
2241
|
"aria-hidden": "true",
|
|
2021
2242
|
focusable: "false"
|
|
2022
2243
|
});
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2244
|
+
return uo(n, t), n;
|
|
2245
|
+
}
|
|
2246
|
+
function Mt(e, t) {
|
|
2247
|
+
if (!e)
|
|
2248
|
+
return;
|
|
2249
|
+
const n = Math.max(
|
|
2250
|
+
0,
|
|
2251
|
+
t - qt * 2
|
|
2252
|
+
), o = Math.max(
|
|
2253
|
+
Ui,
|
|
2254
|
+
Math.floor(
|
|
2255
|
+
(n - $t * 2) / Gt
|
|
2256
|
+
)
|
|
2257
|
+
);
|
|
2258
|
+
uo(e, o);
|
|
2259
|
+
}
|
|
2260
|
+
function uo(e, t) {
|
|
2261
|
+
if (e.dataset.spiralCount === `${t}`)
|
|
2262
|
+
return;
|
|
2263
|
+
const n = t * Gt + $t * 2;
|
|
2264
|
+
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2265
|
+
"viewBox",
|
|
2266
|
+
`0 0 ${n} ${Bi}`
|
|
2267
|
+
), e.replaceChildren();
|
|
2268
|
+
for (let o = 0; o < t; o += 1) {
|
|
2269
|
+
const i = kn[o % kn.length], r = S("g", {
|
|
2270
|
+
transform: `translate(${$t + o * Gt} 0)`
|
|
2026
2271
|
});
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
cx:
|
|
2030
|
-
cy:
|
|
2031
|
-
rx:
|
|
2032
|
-
ry:
|
|
2272
|
+
r.appendChild(
|
|
2273
|
+
S("ellipse", {
|
|
2274
|
+
cx: i.ellipseCx,
|
|
2275
|
+
cy: i.ellipseCy,
|
|
2276
|
+
rx: i.ellipseRx,
|
|
2277
|
+
ry: i.ellipseRy,
|
|
2033
2278
|
fill: "none",
|
|
2034
2279
|
stroke: "#2c2a1e",
|
|
2035
|
-
"stroke-width":
|
|
2280
|
+
"stroke-width": i.strokeWidth,
|
|
2036
2281
|
opacity: "0.8"
|
|
2037
2282
|
})
|
|
2038
|
-
),
|
|
2039
|
-
|
|
2040
|
-
d:
|
|
2283
|
+
), r.appendChild(
|
|
2284
|
+
S("path", {
|
|
2285
|
+
d: i.path,
|
|
2041
2286
|
fill: "none",
|
|
2042
2287
|
stroke: "#2c2a1e",
|
|
2043
|
-
"stroke-width":
|
|
2288
|
+
"stroke-width": i.pathStrokeWidth,
|
|
2044
2289
|
"stroke-linecap": "round"
|
|
2045
2290
|
})
|
|
2046
|
-
),
|
|
2291
|
+
), e.appendChild(r);
|
|
2047
2292
|
}
|
|
2048
|
-
return n;
|
|
2049
2293
|
}
|
|
2050
|
-
function
|
|
2051
|
-
const
|
|
2294
|
+
function Ot(e, t, n) {
|
|
2295
|
+
const o = S("filter", {
|
|
2052
2296
|
id: e,
|
|
2053
2297
|
x: "-8%",
|
|
2054
2298
|
y: "-8%",
|
|
2055
2299
|
width: "116%",
|
|
2056
2300
|
height: "116%"
|
|
2057
2301
|
});
|
|
2058
|
-
return
|
|
2059
|
-
|
|
2302
|
+
return o.appendChild(
|
|
2303
|
+
S("feTurbulence", {
|
|
2060
2304
|
type: "fractalNoise",
|
|
2061
2305
|
baseFrequency: "0.012 0.028",
|
|
2062
2306
|
numOctaves: "3",
|
|
2063
2307
|
seed: t,
|
|
2064
2308
|
result: "stroke-noise"
|
|
2065
2309
|
})
|
|
2066
|
-
),
|
|
2067
|
-
|
|
2310
|
+
), o.appendChild(
|
|
2311
|
+
S("feDisplacementMap", {
|
|
2068
2312
|
in: "SourceGraphic",
|
|
2069
2313
|
in2: "stroke-noise",
|
|
2070
2314
|
scale: "3.5",
|
|
@@ -2072,26 +2316,26 @@ function kt(e, t, o) {
|
|
|
2072
2316
|
yChannelSelector: "G",
|
|
2073
2317
|
result: "warped"
|
|
2074
2318
|
})
|
|
2075
|
-
),
|
|
2076
|
-
|
|
2319
|
+
), o.appendChild(
|
|
2320
|
+
S("feTurbulence", {
|
|
2077
2321
|
type: "fractalNoise",
|
|
2078
2322
|
baseFrequency: "0.7",
|
|
2079
2323
|
numOctaves: "1",
|
|
2080
|
-
seed:
|
|
2324
|
+
seed: n,
|
|
2081
2325
|
result: "ink-noise"
|
|
2082
2326
|
})
|
|
2083
|
-
),
|
|
2084
|
-
|
|
2327
|
+
), o.appendChild(
|
|
2328
|
+
S("feDisplacementMap", {
|
|
2085
2329
|
in: "warped",
|
|
2086
2330
|
in2: "ink-noise",
|
|
2087
2331
|
scale: "0.9",
|
|
2088
2332
|
xChannelSelector: "R",
|
|
2089
2333
|
yChannelSelector: "G"
|
|
2090
2334
|
})
|
|
2091
|
-
),
|
|
2335
|
+
), o;
|
|
2092
2336
|
}
|
|
2093
|
-
function
|
|
2094
|
-
const t =
|
|
2337
|
+
function Ca(e) {
|
|
2338
|
+
const t = re(
|
|
2095
2339
|
"0 0 24 24",
|
|
2096
2340
|
e,
|
|
2097
2341
|
e,
|
|
@@ -2099,10 +2343,10 @@ function ia(e) {
|
|
|
2099
2343
|
"currentColor",
|
|
2100
2344
|
"2.25"
|
|
2101
2345
|
);
|
|
2102
|
-
return t.appendChild(
|
|
2346
|
+
return t.appendChild(S("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2103
2347
|
}
|
|
2104
|
-
function
|
|
2105
|
-
const e =
|
|
2348
|
+
function Sa() {
|
|
2349
|
+
const e = re(
|
|
2106
2350
|
"0 0 24 24",
|
|
2107
2351
|
17,
|
|
2108
2352
|
17,
|
|
@@ -2111,17 +2355,17 @@ function aa() {
|
|
|
2111
2355
|
"2.25"
|
|
2112
2356
|
);
|
|
2113
2357
|
return e.appendChild(
|
|
2114
|
-
|
|
2358
|
+
S("path", {
|
|
2115
2359
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2116
2360
|
})
|
|
2117
2361
|
), e.appendChild(
|
|
2118
|
-
|
|
2362
|
+
S("path", {
|
|
2119
2363
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2120
2364
|
})
|
|
2121
2365
|
), e;
|
|
2122
2366
|
}
|
|
2123
|
-
function
|
|
2124
|
-
const e =
|
|
2367
|
+
function Ea() {
|
|
2368
|
+
const e = re(
|
|
2125
2369
|
"0 0 24 24",
|
|
2126
2370
|
17,
|
|
2127
2371
|
17,
|
|
@@ -2129,10 +2373,10 @@ function ra() {
|
|
|
2129
2373
|
"currentColor",
|
|
2130
2374
|
"2.25"
|
|
2131
2375
|
);
|
|
2132
|
-
return e.appendChild(
|
|
2376
|
+
return e.appendChild(S("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(S("path", { d: "M3 4v5h5" })), e.appendChild(S("path", { d: "M12 7v5l3 2" })), e;
|
|
2133
2377
|
}
|
|
2134
|
-
function
|
|
2135
|
-
const e =
|
|
2378
|
+
function ka() {
|
|
2379
|
+
const e = re(
|
|
2136
2380
|
"0 0 24 24",
|
|
2137
2381
|
15,
|
|
2138
2382
|
15,
|
|
@@ -2140,10 +2384,10 @@ function la() {
|
|
|
2140
2384
|
"currentColor",
|
|
2141
2385
|
"2.4"
|
|
2142
2386
|
);
|
|
2143
|
-
return e.appendChild(
|
|
2387
|
+
return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
|
|
2144
2388
|
}
|
|
2145
|
-
function
|
|
2146
|
-
const e =
|
|
2389
|
+
function go() {
|
|
2390
|
+
const e = re(
|
|
2147
2391
|
"0 0 24 24",
|
|
2148
2392
|
14,
|
|
2149
2393
|
14,
|
|
@@ -2152,11 +2396,11 @@ function Xn() {
|
|
|
2152
2396
|
"2.75"
|
|
2153
2397
|
);
|
|
2154
2398
|
return e.appendChild(
|
|
2155
|
-
|
|
2156
|
-
), e.appendChild(
|
|
2399
|
+
S("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2400
|
+
), e.appendChild(S("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2157
2401
|
}
|
|
2158
|
-
function
|
|
2159
|
-
const e =
|
|
2402
|
+
function La() {
|
|
2403
|
+
const e = re(
|
|
2160
2404
|
"0 0 24 24",
|
|
2161
2405
|
16,
|
|
2162
2406
|
16,
|
|
@@ -2168,18 +2412,18 @@ function pa() {
|
|
|
2168
2412
|
"class",
|
|
2169
2413
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2170
2414
|
), e.appendChild(
|
|
2171
|
-
|
|
2415
|
+
S("path", {
|
|
2172
2416
|
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"
|
|
2173
2417
|
})
|
|
2174
2418
|
), e;
|
|
2175
2419
|
}
|
|
2176
|
-
function
|
|
2177
|
-
const e =
|
|
2420
|
+
function Pa() {
|
|
2421
|
+
const e = re("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2178
2422
|
return e.setAttribute(
|
|
2179
2423
|
"class",
|
|
2180
2424
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2181
2425
|
), e.appendChild(
|
|
2182
|
-
|
|
2426
|
+
S("path", {
|
|
2183
2427
|
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",
|
|
2184
2428
|
stroke: "currentColor",
|
|
2185
2429
|
"stroke-width": "2",
|
|
@@ -2188,10 +2432,10 @@ function sa() {
|
|
|
2188
2432
|
})
|
|
2189
2433
|
), e;
|
|
2190
2434
|
}
|
|
2191
|
-
function
|
|
2192
|
-
const e =
|
|
2435
|
+
function Ia() {
|
|
2436
|
+
const e = re("0 0 24 24", 18, 18, "currentColor");
|
|
2193
2437
|
return e.appendChild(
|
|
2194
|
-
|
|
2438
|
+
S("rect", {
|
|
2195
2439
|
x: "6",
|
|
2196
2440
|
y: "6",
|
|
2197
2441
|
width: "12",
|
|
@@ -2200,8 +2444,8 @@ function da() {
|
|
|
2200
2444
|
})
|
|
2201
2445
|
), e;
|
|
2202
2446
|
}
|
|
2203
|
-
function
|
|
2204
|
-
const e =
|
|
2447
|
+
function Aa() {
|
|
2448
|
+
const e = re(
|
|
2205
2449
|
"0 0 24 24",
|
|
2206
2450
|
12,
|
|
2207
2451
|
12,
|
|
@@ -2209,10 +2453,10 @@ function ca() {
|
|
|
2209
2453
|
"currentColor",
|
|
2210
2454
|
"2.4"
|
|
2211
2455
|
);
|
|
2212
|
-
return e.appendChild(
|
|
2456
|
+
return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
|
|
2213
2457
|
}
|
|
2214
|
-
function
|
|
2215
|
-
const e =
|
|
2458
|
+
function Na() {
|
|
2459
|
+
const e = re(
|
|
2216
2460
|
"0 0 24 24",
|
|
2217
2461
|
13,
|
|
2218
2462
|
13,
|
|
@@ -2221,7 +2465,7 @@ function ua() {
|
|
|
2221
2465
|
"2.25"
|
|
2222
2466
|
);
|
|
2223
2467
|
return e.appendChild(
|
|
2224
|
-
|
|
2468
|
+
S("rect", {
|
|
2225
2469
|
width: "14",
|
|
2226
2470
|
height: "14",
|
|
2227
2471
|
x: "8",
|
|
@@ -2230,341 +2474,341 @@ function ua() {
|
|
|
2230
2474
|
ry: "2"
|
|
2231
2475
|
})
|
|
2232
2476
|
), e.appendChild(
|
|
2233
|
-
|
|
2477
|
+
S("path", {
|
|
2234
2478
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2235
2479
|
})
|
|
2236
2480
|
), e;
|
|
2237
2481
|
}
|
|
2238
|
-
function
|
|
2482
|
+
function re(e, t, n, o, i, r) {
|
|
2239
2483
|
const l = {
|
|
2240
2484
|
viewBox: e,
|
|
2241
2485
|
width: String(t),
|
|
2242
|
-
height: String(
|
|
2243
|
-
fill:
|
|
2486
|
+
height: String(n),
|
|
2487
|
+
fill: o,
|
|
2244
2488
|
"aria-hidden": "true"
|
|
2245
2489
|
};
|
|
2246
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2490
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), S("svg", l);
|
|
2247
2491
|
}
|
|
2248
|
-
function
|
|
2249
|
-
const
|
|
2250
|
-
for (const [
|
|
2251
|
-
|
|
2252
|
-
return
|
|
2492
|
+
function S(e, t = {}) {
|
|
2493
|
+
const n = document.createElementNS(to, e);
|
|
2494
|
+
for (const [o, i] of Object.entries(t))
|
|
2495
|
+
n.setAttribute(o, i);
|
|
2496
|
+
return n;
|
|
2253
2497
|
}
|
|
2254
|
-
function
|
|
2498
|
+
function Mn(e) {
|
|
2255
2499
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2256
|
-
e.addEventListener(t, (
|
|
2257
|
-
|
|
2500
|
+
e.addEventListener(t, (n) => {
|
|
2501
|
+
n.stopPropagation();
|
|
2258
2502
|
});
|
|
2259
2503
|
}
|
|
2260
|
-
function
|
|
2504
|
+
function Ta(e, t, n) {
|
|
2261
2505
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2262
|
-
for (const [
|
|
2506
|
+
for (const [o, i] of t.entries()) {
|
|
2263
2507
|
const r = document.createElement("div");
|
|
2264
|
-
r.className = "pluno-pa-widget__attachment", r.appendChild(
|
|
2508
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild(Da(i));
|
|
2265
2509
|
const l = document.createElement("span");
|
|
2266
2510
|
l.textContent = i.name, r.appendChild(l);
|
|
2267
2511
|
const p = document.createElement("button");
|
|
2268
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(
|
|
2512
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Aa()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2269
2513
|
}
|
|
2270
2514
|
}
|
|
2271
|
-
function
|
|
2272
|
-
const t =
|
|
2273
|
-
if (t === "image" &&
|
|
2274
|
-
const
|
|
2275
|
-
return
|
|
2515
|
+
function Da(e) {
|
|
2516
|
+
const t = en(e), n = ho(e);
|
|
2517
|
+
if (t === "image" && n) {
|
|
2518
|
+
const o = document.createElement("img");
|
|
2519
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o;
|
|
2276
2520
|
}
|
|
2277
|
-
if (t === "video" &&
|
|
2278
|
-
const
|
|
2279
|
-
return
|
|
2521
|
+
if (t === "video" && n) {
|
|
2522
|
+
const o = document.createElement("video");
|
|
2523
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o.addEventListener("stalled", () => o.replaceWith(ie(e))), o;
|
|
2280
2524
|
}
|
|
2281
|
-
return
|
|
2525
|
+
return ie(e);
|
|
2282
2526
|
}
|
|
2283
|
-
function
|
|
2284
|
-
const t =
|
|
2285
|
-
if (t === "image" &&
|
|
2286
|
-
const
|
|
2287
|
-
return
|
|
2527
|
+
function Ra(e) {
|
|
2528
|
+
const t = en(e), n = ho(e);
|
|
2529
|
+
if (t === "image" && n) {
|
|
2530
|
+
const o = document.createElement("img");
|
|
2531
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o;
|
|
2288
2532
|
}
|
|
2289
|
-
if (t === "pdf" &&
|
|
2290
|
-
const
|
|
2291
|
-
return
|
|
2533
|
+
if (t === "pdf" && n) {
|
|
2534
|
+
const o = document.createElement("object");
|
|
2535
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.appendChild(ie(e, "message")), o;
|
|
2292
2536
|
}
|
|
2293
|
-
if (t === "video" &&
|
|
2294
|
-
const
|
|
2295
|
-
return
|
|
2537
|
+
if (t === "video" && n) {
|
|
2538
|
+
const o = document.createElement("video");
|
|
2539
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ie(e, "message"))), o;
|
|
2296
2540
|
}
|
|
2297
|
-
return
|
|
2541
|
+
return ie(e, "message");
|
|
2298
2542
|
}
|
|
2299
|
-
function
|
|
2543
|
+
function ie(e, t = "composer") {
|
|
2300
2544
|
if (t === "composer") {
|
|
2301
2545
|
const r = document.createElement("span");
|
|
2302
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2546
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = On(e), r;
|
|
2303
2547
|
}
|
|
2304
|
-
const
|
|
2305
|
-
|
|
2306
|
-
const
|
|
2307
|
-
|
|
2548
|
+
const n = document.createElement("div");
|
|
2549
|
+
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2550
|
+
const o = document.createElement("span");
|
|
2551
|
+
o.textContent = On(e);
|
|
2308
2552
|
const i = document.createElement("strong");
|
|
2309
|
-
return i.textContent = e.name,
|
|
2553
|
+
return i.textContent = e.name, n.append(o, i), n;
|
|
2310
2554
|
}
|
|
2311
|
-
function
|
|
2555
|
+
function en(e) {
|
|
2312
2556
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2313
2557
|
}
|
|
2314
|
-
function
|
|
2558
|
+
function ho(e) {
|
|
2315
2559
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2316
2560
|
}
|
|
2317
|
-
function
|
|
2318
|
-
const t =
|
|
2561
|
+
function On(e) {
|
|
2562
|
+
const t = en(e);
|
|
2319
2563
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2320
2564
|
}
|
|
2321
|
-
function
|
|
2322
|
-
return t ? Array.from(t).map((
|
|
2323
|
-
...e.createLocalAttachment(
|
|
2324
|
-
previewUrl:
|
|
2565
|
+
function za(e, t) {
|
|
2566
|
+
return t ? Array.from(t).map((o) => ({
|
|
2567
|
+
...e.createLocalAttachment(o),
|
|
2568
|
+
previewUrl: Ma(o)
|
|
2325
2569
|
})) : [];
|
|
2326
2570
|
}
|
|
2327
|
-
function
|
|
2571
|
+
function Ma(e) {
|
|
2328
2572
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2329
2573
|
}
|
|
2330
|
-
function
|
|
2574
|
+
function it(e) {
|
|
2331
2575
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2332
2576
|
}
|
|
2333
|
-
function
|
|
2334
|
-
if (!e || !
|
|
2577
|
+
function Bt(e, t, n = null) {
|
|
2578
|
+
if (!e || !Yt(t, n)) {
|
|
2335
2579
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2336
2580
|
return;
|
|
2337
2581
|
}
|
|
2338
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2339
|
-
|
|
2340
|
-
) :
|
|
2582
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || tn(n) ? e.appendChild(
|
|
2583
|
+
Oa(t, n)
|
|
2584
|
+
) : mo(t) && e.appendChild(Ba(t));
|
|
2341
2585
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
const
|
|
2346
|
-
i.textContent =
|
|
2586
|
+
function Oa(e, t) {
|
|
2587
|
+
const n = document.createElement("div");
|
|
2588
|
+
n.className = "pluno-pa-widget__billing-action-card";
|
|
2589
|
+
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2590
|
+
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2347
2591
|
const r = document.createElement("span");
|
|
2348
|
-
return r.textContent =
|
|
2349
|
-
|
|
2592
|
+
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(
|
|
2593
|
+
fo(
|
|
2350
2594
|
e,
|
|
2351
2595
|
"Upgrade plan",
|
|
2352
2596
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2353
2597
|
)
|
|
2354
|
-
),
|
|
2598
|
+
), n;
|
|
2355
2599
|
}
|
|
2356
|
-
function
|
|
2600
|
+
function Ba(e) {
|
|
2357
2601
|
const t = document.createElement("div");
|
|
2358
2602
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2361
|
-
const
|
|
2362
|
-
return
|
|
2363
|
-
|
|
2603
|
+
const n = document.createElement("strong");
|
|
2604
|
+
n.textContent = "Credits running low", t.appendChild(n);
|
|
2605
|
+
const o = document.createElement("span");
|
|
2606
|
+
return o.textContent = Fa(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2607
|
+
fo(
|
|
2364
2608
|
e,
|
|
2365
2609
|
"Upgrade",
|
|
2366
2610
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2367
2611
|
)
|
|
2368
2612
|
), t;
|
|
2369
2613
|
}
|
|
2370
|
-
function
|
|
2371
|
-
return e !== null && (
|
|
2614
|
+
function Yt(e, t) {
|
|
2615
|
+
return e !== null && (ae(e) || mo(e) || tn(t));
|
|
2372
2616
|
}
|
|
2373
|
-
function
|
|
2374
|
-
return
|
|
2617
|
+
function Bn(e, t, n) {
|
|
2618
|
+
return Yt(t, n) || Ua(t) ? !0 : !Yt(e, n);
|
|
2375
2619
|
}
|
|
2376
|
-
function
|
|
2377
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2620
|
+
function Ua(e) {
|
|
2621
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || ae(e));
|
|
2378
2622
|
}
|
|
2379
|
-
function
|
|
2623
|
+
function ae(e) {
|
|
2380
2624
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2381
2625
|
}
|
|
2382
|
-
function
|
|
2626
|
+
function tn(e) {
|
|
2383
2627
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2384
2628
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return !
|
|
2629
|
+
function mo(e) {
|
|
2630
|
+
return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2387
2631
|
}
|
|
2388
|
-
function
|
|
2389
|
-
return e.creditsRemaining === null ? null : `${
|
|
2632
|
+
function Fa(e) {
|
|
2633
|
+
return e.creditsRemaining === null ? null : `${Ha(e.creditsRemaining)} credits left`;
|
|
2390
2634
|
}
|
|
2391
|
-
function
|
|
2635
|
+
function Ha(e) {
|
|
2392
2636
|
return new Intl.NumberFormat("en-US", {
|
|
2393
2637
|
maximumFractionDigits: 0
|
|
2394
2638
|
}).format(Math.ceil(e));
|
|
2395
2639
|
}
|
|
2396
|
-
function
|
|
2397
|
-
const
|
|
2398
|
-
return
|
|
2399
|
-
|
|
2400
|
-
),
|
|
2401
|
-
|
|
2402
|
-
),
|
|
2640
|
+
function fo(e, t, n) {
|
|
2641
|
+
const o = document.createElement("div");
|
|
2642
|
+
return o.className = n, o.appendChild(
|
|
2643
|
+
Un(t, e.pricingUrl)
|
|
2644
|
+
), o.appendChild(
|
|
2645
|
+
Un("Earn credits", e.earnCreditsUrl)
|
|
2646
|
+
), o;
|
|
2403
2647
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const
|
|
2406
|
-
if (
|
|
2407
|
-
const
|
|
2408
|
-
|
|
2648
|
+
function Un(e, t) {
|
|
2649
|
+
const n = document.createElement("button");
|
|
2650
|
+
if (n.type = "button", e === "Earn credits") {
|
|
2651
|
+
const o = document.createElement("span");
|
|
2652
|
+
o.className = "pluno-pa-widget__billing-action-card-earn-credits-label", o.textContent = e, n.appendChild(o);
|
|
2409
2653
|
} else
|
|
2410
|
-
|
|
2411
|
-
return
|
|
2654
|
+
n.textContent = e;
|
|
2655
|
+
return n.disabled = t.trim().length === 0, n.addEventListener("click", () => {
|
|
2412
2656
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2413
|
-
}),
|
|
2657
|
+
}), n;
|
|
2414
2658
|
}
|
|
2415
|
-
function
|
|
2659
|
+
function Ut(e, t) {
|
|
2416
2660
|
return e.messages.filter(
|
|
2417
|
-
(
|
|
2661
|
+
(o) => !wo(o)
|
|
2418
2662
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2419
2663
|
}
|
|
2420
|
-
function
|
|
2421
|
-
const
|
|
2422
|
-
(
|
|
2423
|
-
), h = e.scrollTop,
|
|
2424
|
-
|
|
2664
|
+
function Wa(e, t, n, o, i, r, l, p, d, c, u, m, E, v, z, b) {
|
|
2665
|
+
const g = ja(r), w = g.filter(
|
|
2666
|
+
(C) => !wo(C)
|
|
2667
|
+
), h = e.scrollTop, P = [], A = /* @__PURE__ */ new Set(), k = (C) => {
|
|
2668
|
+
P.push(C);
|
|
2425
2669
|
};
|
|
2426
|
-
|
|
2427
|
-
const
|
|
2428
|
-
if (
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2433
|
-
const
|
|
2670
|
+
_o(n, r.isThinking), i.hidden = !p, p && l !== null && po(i, l);
|
|
2671
|
+
const F = w.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2672
|
+
if (o(F), w.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2673
|
+
const C = document.createElement("div");
|
|
2674
|
+
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2675
|
+
const T = document.createElement("div");
|
|
2676
|
+
T.className = "pluno-pa-widget__empty-hero";
|
|
2677
|
+
const Se = me(
|
|
2434
2678
|
"pluno-pa-widget__character--empty",
|
|
2435
|
-
|
|
2679
|
+
v()
|
|
2436
2680
|
);
|
|
2437
|
-
|
|
2438
|
-
const
|
|
2439
|
-
if (
|
|
2440
|
-
for (const
|
|
2441
|
-
const
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
}),
|
|
2681
|
+
T.appendChild(Se), C.appendChild(T), C.appendChild(lo());
|
|
2682
|
+
const q = document.createElement("div");
|
|
2683
|
+
if (q.className = r.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", r.starterPrompts.length === 0 && !r.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), r.starterPrompts.length > 0)
|
|
2684
|
+
for (const R of r.starterPrompts) {
|
|
2685
|
+
const D = document.createElement("button");
|
|
2686
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${R}"`, D.addEventListener("click", () => {
|
|
2687
|
+
z(R);
|
|
2688
|
+
}), q.appendChild(D);
|
|
2445
2689
|
}
|
|
2446
2690
|
else if (r.starterPromptsLoading) {
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2691
|
+
const R = document.createElement("button");
|
|
2692
|
+
R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", R.disabled = !0, R.tabIndex = -1, R.textContent = "Generating example tasks...", q.appendChild(R);
|
|
2449
2693
|
} else
|
|
2450
|
-
for (let
|
|
2451
|
-
const
|
|
2452
|
-
|
|
2694
|
+
for (let R = 0; R < Si; R += 1) {
|
|
2695
|
+
const D = document.createElement("button");
|
|
2696
|
+
D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
|
|
2453
2697
|
}
|
|
2454
|
-
|
|
2698
|
+
C.appendChild(q), m.clear(), k(C), k(t), Fn(e, P);
|
|
2455
2699
|
return;
|
|
2456
2700
|
}
|
|
2457
|
-
let
|
|
2458
|
-
const
|
|
2459
|
-
if (
|
|
2701
|
+
let H = null, $ = null, Q = [];
|
|
2702
|
+
const ze = w.some(Xt), x = () => {
|
|
2703
|
+
if (Q.length === 0)
|
|
2460
2704
|
return !1;
|
|
2461
|
-
const
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2705
|
+
const C = nr(
|
|
2706
|
+
Q,
|
|
2707
|
+
u,
|
|
2708
|
+
E,
|
|
2709
|
+
v()
|
|
2466
2710
|
);
|
|
2467
|
-
return
|
|
2711
|
+
return k(C), H = null, $ = C, Q = [], !0;
|
|
2468
2712
|
};
|
|
2469
|
-
for (let
|
|
2470
|
-
const
|
|
2471
|
-
if (
|
|
2472
|
-
|
|
2713
|
+
for (let C = 0; C < w.length; C += 1) {
|
|
2714
|
+
const T = w[C];
|
|
2715
|
+
if (T.role === "tool") {
|
|
2716
|
+
Q.push(T);
|
|
2473
2717
|
continue;
|
|
2474
2718
|
}
|
|
2475
|
-
if (
|
|
2476
|
-
if (
|
|
2477
|
-
const
|
|
2478
|
-
|
|
2719
|
+
if (Xt(T)) {
|
|
2720
|
+
if (x()) {
|
|
2721
|
+
const N = ct();
|
|
2722
|
+
k(N), H = null, $ = N;
|
|
2479
2723
|
} else {
|
|
2480
|
-
const
|
|
2481
|
-
|
|
2724
|
+
const N = Gn(v());
|
|
2725
|
+
k(N), H = null, $ = N;
|
|
2482
2726
|
}
|
|
2483
2727
|
continue;
|
|
2484
2728
|
}
|
|
2485
|
-
if (
|
|
2729
|
+
if (T.role === "system")
|
|
2486
2730
|
continue;
|
|
2487
|
-
const
|
|
2488
|
-
if (
|
|
2489
|
-
const
|
|
2490
|
-
|
|
2731
|
+
const Se = x(), q = tr(T.content);
|
|
2732
|
+
if (T.role === "assistant" && !Se) {
|
|
2733
|
+
const D = bo(v());
|
|
2734
|
+
k(D), H = null, $ = D;
|
|
2491
2735
|
}
|
|
2492
|
-
const
|
|
2493
|
-
|
|
2736
|
+
const R = Ga(T, q, m, A);
|
|
2737
|
+
k(R), H = R, $ = null;
|
|
2494
2738
|
}
|
|
2495
|
-
const
|
|
2496
|
-
if (r.isThinking &&
|
|
2497
|
-
if (
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2739
|
+
const de = x(), Ye = w[w.length - 1]?.id === "assistant-draft";
|
|
2740
|
+
if (r.isThinking && !Ye && !ze)
|
|
2741
|
+
if (de) {
|
|
2742
|
+
const C = ct();
|
|
2743
|
+
k(C), H = null, $ = C;
|
|
2500
2744
|
} else {
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2745
|
+
const C = Gn(v());
|
|
2746
|
+
k(C), H = null, $ = C;
|
|
2503
2747
|
}
|
|
2504
2748
|
if (r.lastError) {
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2749
|
+
const C = document.createElement("div");
|
|
2750
|
+
C.className = "pluno-pa-widget__error", C.textContent = r.lastError, k(C), H = C, $ = null;
|
|
2507
2751
|
}
|
|
2508
|
-
const
|
|
2509
|
-
if (
|
|
2510
|
-
const
|
|
2511
|
-
isDrafting:
|
|
2512
|
-
error:
|
|
2513
|
-
characterIconOptions:
|
|
2514
|
-
onDraft:
|
|
2515
|
-
onDismiss:
|
|
2516
|
-
onDisable:
|
|
2752
|
+
const X = b && !r.isThinking ? Jo(g) : null;
|
|
2753
|
+
if (b && X && !b.dismissedCandidateIds.has(X.id)) {
|
|
2754
|
+
const C = Ya(X, {
|
|
2755
|
+
isDrafting: b.draftingCandidateId === X.id,
|
|
2756
|
+
error: b.error,
|
|
2757
|
+
characterIconOptions: b.characterIconOptions,
|
|
2758
|
+
onDraft: b.onDraft,
|
|
2759
|
+
onDismiss: b.onDismiss,
|
|
2760
|
+
onDisable: b.onDisable
|
|
2517
2761
|
});
|
|
2518
|
-
|
|
2762
|
+
k(C), b.onSeen(X), H = null, $ = C;
|
|
2519
2763
|
}
|
|
2520
|
-
|
|
2764
|
+
H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), k(t), qa(m, A), Fn(e, P), d ? Ve(e, c) : e.scrollTop = h;
|
|
2521
2765
|
}
|
|
2522
|
-
function
|
|
2523
|
-
const i =
|
|
2766
|
+
function Ga(e, t, n, o) {
|
|
2767
|
+
const i = $a(e, t), r = i ? n.get(i) : void 0;
|
|
2524
2768
|
if (i && r)
|
|
2525
|
-
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"),
|
|
2769
|
+
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2526
2770
|
const l = document.createElement("div");
|
|
2527
|
-
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ?
|
|
2771
|
+
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? ir(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(Va(e.attachments));
|
|
2528
2772
|
const p = document.createElement("div");
|
|
2529
|
-
return p.className = "pluno-pa-widget__message-actions", p.appendChild(
|
|
2773
|
+
return p.className = "pluno-pa-widget__message-actions", p.appendChild(Ka(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
|
|
2530
2774
|
}
|
|
2531
|
-
function
|
|
2775
|
+
function $a(e, t) {
|
|
2532
2776
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
2533
2777
|
id: e.id,
|
|
2534
2778
|
content: t,
|
|
2535
|
-
attachments: e.attachments.map((
|
|
2536
|
-
const { previewUrl:
|
|
2779
|
+
attachments: e.attachments.map((n) => {
|
|
2780
|
+
const { previewUrl: o } = n;
|
|
2537
2781
|
return {
|
|
2538
|
-
id:
|
|
2539
|
-
name:
|
|
2540
|
-
mimeType:
|
|
2541
|
-
sizeBytes:
|
|
2542
|
-
previewUrl:
|
|
2543
|
-
fileUrl:
|
|
2544
|
-
gcsPath:
|
|
2782
|
+
id: n.id ?? null,
|
|
2783
|
+
name: n.name,
|
|
2784
|
+
mimeType: n.mimeType,
|
|
2785
|
+
sizeBytes: n.sizeBytes,
|
|
2786
|
+
previewUrl: o ?? null,
|
|
2787
|
+
fileUrl: n.fileUrl ?? null,
|
|
2788
|
+
gcsPath: n.gcsPath ?? null
|
|
2545
2789
|
};
|
|
2546
2790
|
})
|
|
2547
2791
|
});
|
|
2548
2792
|
}
|
|
2549
|
-
function
|
|
2550
|
-
for (const
|
|
2551
|
-
t.has(
|
|
2793
|
+
function qa(e, t) {
|
|
2794
|
+
for (const n of e.keys())
|
|
2795
|
+
t.has(n) || e.delete(n);
|
|
2552
2796
|
}
|
|
2553
|
-
function
|
|
2554
|
-
let
|
|
2555
|
-
for (const
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2797
|
+
function Fn(e, t) {
|
|
2798
|
+
let n = e.firstChild;
|
|
2799
|
+
for (const o of t) {
|
|
2800
|
+
if (o === n) {
|
|
2801
|
+
n = n.nextSibling;
|
|
2558
2802
|
continue;
|
|
2559
2803
|
}
|
|
2560
|
-
e.insertBefore(
|
|
2804
|
+
e.insertBefore(o, n);
|
|
2561
2805
|
}
|
|
2562
|
-
for (;
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2806
|
+
for (; n; ) {
|
|
2807
|
+
const o = n;
|
|
2808
|
+
n = n.nextSibling, e.removeChild(o);
|
|
2565
2809
|
}
|
|
2566
2810
|
}
|
|
2567
|
-
function
|
|
2811
|
+
function ja(e) {
|
|
2568
2812
|
if (!e.assistantDraft)
|
|
2569
2813
|
return [...e.messages];
|
|
2570
2814
|
const t = {
|
|
@@ -2578,22 +2822,22 @@ function La(e) {
|
|
|
2578
2822
|
};
|
|
2579
2823
|
if (!t.respondsToUserMessageId)
|
|
2580
2824
|
return [...e.messages, t];
|
|
2581
|
-
const
|
|
2825
|
+
const n = e.messages.findIndex(
|
|
2582
2826
|
(r) => r.role === "user" && r.id === t.respondsToUserMessageId
|
|
2583
2827
|
);
|
|
2584
|
-
if (
|
|
2828
|
+
if (n === -1)
|
|
2585
2829
|
return [...e.messages, t];
|
|
2586
|
-
const
|
|
2587
|
-
(r, l) => l >
|
|
2830
|
+
const o = e.messages.findIndex(
|
|
2831
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Hn(r, t) && Xt(r)
|
|
2588
2832
|
);
|
|
2589
|
-
if (
|
|
2833
|
+
if (o !== -1)
|
|
2590
2834
|
return [
|
|
2591
|
-
...e.messages.slice(0,
|
|
2835
|
+
...e.messages.slice(0, o),
|
|
2592
2836
|
t,
|
|
2593
|
-
...e.messages.slice(
|
|
2837
|
+
...e.messages.slice(o + 1)
|
|
2594
2838
|
];
|
|
2595
|
-
let i =
|
|
2596
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2839
|
+
let i = n + 1;
|
|
2840
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Hn(e.messages[i], t); )
|
|
2597
2841
|
i += 1;
|
|
2598
2842
|
return [
|
|
2599
2843
|
...e.messages.slice(0, i),
|
|
@@ -2601,50 +2845,50 @@ function La(e) {
|
|
|
2601
2845
|
...e.messages.slice(i)
|
|
2602
2846
|
];
|
|
2603
2847
|
}
|
|
2604
|
-
function
|
|
2848
|
+
function Xt(e) {
|
|
2605
2849
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2606
2850
|
}
|
|
2607
|
-
function
|
|
2851
|
+
function Hn(e, t) {
|
|
2608
2852
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2609
2853
|
}
|
|
2610
|
-
function
|
|
2611
|
-
e.replaceChildren(),
|
|
2854
|
+
function Wn(e, t, n, o, i, r, l, p) {
|
|
2855
|
+
e.replaceChildren(), _o(t, !1), t.disabled = !0, n(!1);
|
|
2612
2856
|
const d = document.createElement("div");
|
|
2613
2857
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2614
|
-
const
|
|
2858
|
+
const c = me(
|
|
2615
2859
|
"pluno-pa-widget__character--empty",
|
|
2616
|
-
|
|
2860
|
+
o()
|
|
2617
2861
|
);
|
|
2618
|
-
d.appendChild(
|
|
2619
|
-
const
|
|
2620
|
-
if (
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2862
|
+
d.appendChild(c);
|
|
2863
|
+
const u = document.createElement("div");
|
|
2864
|
+
if (u.className = "pluno-pa-widget__empty", u.textContent = i, d.appendChild(u), l) {
|
|
2865
|
+
const m = document.createElement("a");
|
|
2866
|
+
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, d.appendChild(m);
|
|
2623
2867
|
} else {
|
|
2624
|
-
const
|
|
2625
|
-
|
|
2868
|
+
const m = document.createElement("button");
|
|
2869
|
+
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), d.appendChild(m);
|
|
2626
2870
|
}
|
|
2627
2871
|
e.appendChild(d);
|
|
2628
2872
|
}
|
|
2629
|
-
function
|
|
2873
|
+
function Va(e) {
|
|
2630
2874
|
const t = document.createElement("div");
|
|
2631
2875
|
t.className = "pluno-pa-widget__message-attachments";
|
|
2632
|
-
for (const
|
|
2633
|
-
t.appendChild(
|
|
2876
|
+
for (const n of e)
|
|
2877
|
+
t.appendChild(Ra(n));
|
|
2634
2878
|
return t;
|
|
2635
2879
|
}
|
|
2636
|
-
function
|
|
2880
|
+
function Ka(e) {
|
|
2637
2881
|
const t = document.createElement("button");
|
|
2638
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
2639
|
-
|
|
2882
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Na()), t.addEventListener("click", (n) => {
|
|
2883
|
+
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
2640
2884
|
}), t;
|
|
2641
2885
|
}
|
|
2642
|
-
function
|
|
2643
|
-
const
|
|
2644
|
-
|
|
2645
|
-
const
|
|
2646
|
-
|
|
2647
|
-
|
|
2886
|
+
function Ya(e, t) {
|
|
2887
|
+
const n = document.createElement("article");
|
|
2888
|
+
n.className = "pluno-pa-widget__share-prompt";
|
|
2889
|
+
const o = document.createElement("div");
|
|
2890
|
+
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2891
|
+
me(
|
|
2648
2892
|
"pluno-pa-widget__share-prompt-icon",
|
|
2649
2893
|
t.characterIconOptions
|
|
2650
2894
|
)
|
|
@@ -2655,97 +2899,97 @@ function Na(e, t) {
|
|
|
2655
2899
|
r.textContent = "Share this win?", i.appendChild(r);
|
|
2656
2900
|
const l = document.createElement("span");
|
|
2657
2901
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2658
|
-
const
|
|
2659
|
-
|
|
2902
|
+
const u = document.createElement("span");
|
|
2903
|
+
u.className = "pluno-pa-widget__share-prompt-error", u.textContent = t.error, i.appendChild(u);
|
|
2660
2904
|
}
|
|
2661
|
-
|
|
2905
|
+
o.appendChild(i);
|
|
2662
2906
|
const p = document.createElement("div");
|
|
2663
2907
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
2664
2908
|
const d = document.createElement("div");
|
|
2665
2909
|
d.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
2666
|
-
const
|
|
2667
|
-
if (
|
|
2910
|
+
const c = document.createElement("button");
|
|
2911
|
+
if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
|
|
2668
2912
|
t.onDraft(e);
|
|
2669
|
-
}), t.isDrafting ? (
|
|
2913
|
+
}), t.isDrafting ? (c.appendChild(Zt()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
|
|
2670
2914
|
p.appendChild(d);
|
|
2671
2915
|
else {
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2916
|
+
const u = document.createElement("button");
|
|
2917
|
+
u.type = "button", u.className = "pluno-pa-widget__share-prompt-dismiss", u.setAttribute("aria-label", "Dismiss share prompt"), u.title = "Dismiss", u.textContent = "Dismiss", u.addEventListener("click", () => {
|
|
2674
2918
|
t.onDismiss(e);
|
|
2675
|
-
}), d.appendChild(
|
|
2676
|
-
const
|
|
2677
|
-
|
|
2919
|
+
}), d.appendChild(u), p.appendChild(d);
|
|
2920
|
+
const m = document.createElement("button");
|
|
2921
|
+
m.type = "button", m.className = "pluno-pa-widget__share-prompt-disable", m.textContent = "Don't ask again", m.addEventListener("click", () => {
|
|
2678
2922
|
t.onDisable(e);
|
|
2679
|
-
}), p.appendChild(
|
|
2923
|
+
}), p.appendChild(m);
|
|
2680
2924
|
}
|
|
2681
|
-
return
|
|
2925
|
+
return o.appendChild(p), n.appendChild(o), n;
|
|
2682
2926
|
}
|
|
2683
|
-
function
|
|
2684
|
-
const
|
|
2685
|
-
|
|
2686
|
-
|
|
2927
|
+
function Xa(e, t) {
|
|
2928
|
+
const n = document.createElement("div");
|
|
2929
|
+
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
|
|
2930
|
+
g.target === n && t.onClose();
|
|
2687
2931
|
});
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2932
|
+
const o = document.createElement("section");
|
|
2933
|
+
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
2690
2934
|
const i = document.createElement("header"), r = document.createElement("strong");
|
|
2691
2935
|
r.textContent = "Share this win", i.appendChild(r);
|
|
2692
2936
|
const l = document.createElement("button");
|
|
2693
|
-
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l),
|
|
2937
|
+
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
2694
2938
|
const p = document.createElement("p");
|
|
2695
2939
|
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
2696
2940
|
const d = document.createElement("div");
|
|
2697
2941
|
d.className = "pluno-pa-widget__share-dialog-step";
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2700
|
-
const
|
|
2701
|
-
|
|
2702
|
-
const
|
|
2942
|
+
const c = document.createElement("div");
|
|
2943
|
+
c.className = "pluno-pa-widget__share-dialog-step-header";
|
|
2944
|
+
const u = document.createElement("strong");
|
|
2945
|
+
u.textContent = "1) Copy Screenshot", c.appendChild(u);
|
|
2946
|
+
const m = Za(
|
|
2703
2947
|
"Copy Screenshot",
|
|
2704
2948
|
async () => {
|
|
2705
2949
|
try {
|
|
2706
|
-
return await
|
|
2950
|
+
return await Qo(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
2707
2951
|
} catch {
|
|
2708
2952
|
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
2709
2953
|
}
|
|
2710
2954
|
}
|
|
2711
2955
|
);
|
|
2712
|
-
if (
|
|
2713
|
-
const
|
|
2714
|
-
|
|
2715
|
-
const
|
|
2716
|
-
|
|
2956
|
+
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2957
|
+
const g = document.createElement("div");
|
|
2958
|
+
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2959
|
+
const w = document.createElement("img");
|
|
2960
|
+
w.src = e.screenshotDataUrl, w.alt = "Product page with Pluno open", g.appendChild(w), d.appendChild(g);
|
|
2717
2961
|
}
|
|
2718
|
-
|
|
2719
|
-
const
|
|
2720
|
-
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
const
|
|
2726
|
-
|
|
2727
|
-
for (const
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2962
|
+
o.appendChild(d), o.appendChild(p);
|
|
2963
|
+
const E = document.createElement("div");
|
|
2964
|
+
E.className = "pluno-pa-widget__share-dialog-step";
|
|
2965
|
+
const v = document.createElement("strong");
|
|
2966
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", E.appendChild(v);
|
|
2967
|
+
const z = document.createElement("p");
|
|
2968
|
+
z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.", E.appendChild(z);
|
|
2969
|
+
const b = document.createElement("footer");
|
|
2970
|
+
b.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2971
|
+
for (const g of Ja(e)) {
|
|
2972
|
+
const w = document.createElement("a");
|
|
2973
|
+
w.href = g.href, w.target = "_blank", w.rel = "noopener noreferrer", w.title = g.label, w.setAttribute("aria-label", `Open ${g.label}`), w.appendChild(Qa(g.id)), b.appendChild(w);
|
|
2730
2974
|
}
|
|
2731
|
-
if (
|
|
2732
|
-
const
|
|
2733
|
-
|
|
2734
|
-
const
|
|
2735
|
-
|
|
2975
|
+
if (E.appendChild(b), o.appendChild(E), t.socialPostRewardsUrl) {
|
|
2976
|
+
const g = document.createElement("div");
|
|
2977
|
+
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2978
|
+
const w = document.createElement("strong");
|
|
2979
|
+
w.className = "pluno-pa-widget__share-dialog-step-title", w.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(w);
|
|
2736
2980
|
const h = document.createElement("a");
|
|
2737
|
-
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(
|
|
2981
|
+
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(er()), g.appendChild(h), o.appendChild(g);
|
|
2738
2982
|
}
|
|
2739
|
-
return
|
|
2983
|
+
return n.appendChild(o), n;
|
|
2740
2984
|
}
|
|
2741
|
-
function
|
|
2742
|
-
const
|
|
2743
|
-
return
|
|
2744
|
-
|
|
2745
|
-
}),
|
|
2985
|
+
function Za(e, t) {
|
|
2986
|
+
const n = document.createElement("button");
|
|
2987
|
+
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
2988
|
+
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
2989
|
+
}), n;
|
|
2746
2990
|
}
|
|
2747
|
-
function
|
|
2748
|
-
const t = e.linkedinPost.trim(),
|
|
2991
|
+
function Ja(e) {
|
|
2992
|
+
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
2749
2993
|
return [
|
|
2750
2994
|
{
|
|
2751
2995
|
id: "linkedin",
|
|
@@ -2755,7 +2999,7 @@ function Da(e) {
|
|
|
2755
2999
|
{
|
|
2756
3000
|
id: "x",
|
|
2757
3001
|
label: "X",
|
|
2758
|
-
href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(
|
|
3002
|
+
href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(n)}`
|
|
2759
3003
|
},
|
|
2760
3004
|
{
|
|
2761
3005
|
id: "instagram",
|
|
@@ -2764,7 +3008,7 @@ function Da(e) {
|
|
|
2764
3008
|
}
|
|
2765
3009
|
];
|
|
2766
3010
|
}
|
|
2767
|
-
function
|
|
3011
|
+
function Qa(e) {
|
|
2768
3012
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2769
3013
|
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" ? (U(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), U(
|
|
2770
3014
|
t,
|
|
@@ -2787,145 +3031,145 @@ function Ra(e) {
|
|
|
2787
3031
|
"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"
|
|
2788
3032
|
), t);
|
|
2789
3033
|
}
|
|
2790
|
-
function U(e, t,
|
|
2791
|
-
const
|
|
2792
|
-
|
|
3034
|
+
function U(e, t, n) {
|
|
3035
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3036
|
+
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
2793
3037
|
}
|
|
2794
|
-
function
|
|
3038
|
+
function er() {
|
|
2795
3039
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2796
3040
|
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), U(e, "M14 5h5v5"), U(e, "M19 5l-8 8"), U(
|
|
2797
3041
|
e,
|
|
2798
3042
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
2799
3043
|
), e;
|
|
2800
3044
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return e.role === "tool" && e.toolName ===
|
|
3045
|
+
function wo(e) {
|
|
3046
|
+
return e.role === "tool" && e.toolName === Xn;
|
|
2803
3047
|
}
|
|
2804
|
-
function
|
|
3048
|
+
function tr(e) {
|
|
2805
3049
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
2806
3050
|
}
|
|
2807
|
-
function
|
|
3051
|
+
function nr(e, t, n, o) {
|
|
2808
3052
|
const i = document.createElement("article");
|
|
2809
3053
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
2810
3054
|
e[e.length - 1].createdAt
|
|
2811
3055
|
).toLocaleString(), i.appendChild(
|
|
2812
|
-
|
|
3056
|
+
me(
|
|
2813
3057
|
"pluno-pa-widget__character--tool-group",
|
|
2814
|
-
|
|
3058
|
+
o
|
|
2815
3059
|
)
|
|
2816
3060
|
);
|
|
2817
|
-
const r = document.createElement("details"), l =
|
|
3061
|
+
const r = document.createElement("details"), l = or(e);
|
|
2818
3062
|
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
2819
|
-
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l),
|
|
3063
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
2820
3064
|
});
|
|
2821
3065
|
const p = document.createElement("summary");
|
|
2822
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((
|
|
2823
|
-
const
|
|
2824
|
-
if (
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2827
|
-
for (const
|
|
2828
|
-
const
|
|
2829
|
-
|
|
2830
|
-
const
|
|
2831
|
-
|
|
2832
|
-
}
|
|
2833
|
-
r.appendChild(
|
|
3066
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(Zt());
|
|
3067
|
+
const c = document.createElement("span");
|
|
3068
|
+
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
|
|
3069
|
+
const u = document.createElement("div");
|
|
3070
|
+
u.className = "pluno-pa-widget__tool-lines";
|
|
3071
|
+
for (const m of e) {
|
|
3072
|
+
const E = document.createElement("div");
|
|
3073
|
+
E.className = "pluno-pa-widget__tool-line", m.loading && E.appendChild(Zt());
|
|
3074
|
+
const v = document.createElement("span");
|
|
3075
|
+
v.textContent = m.content || "Run tool", E.appendChild(v), u.appendChild(E);
|
|
3076
|
+
}
|
|
3077
|
+
r.appendChild(u);
|
|
2834
3078
|
}
|
|
2835
3079
|
return i.appendChild(r), i;
|
|
2836
3080
|
}
|
|
2837
|
-
function
|
|
3081
|
+
function bo(e) {
|
|
2838
3082
|
const t = document.createElement("article");
|
|
2839
3083
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
2840
|
-
|
|
3084
|
+
me(
|
|
2841
3085
|
"pluno-pa-widget__character--tool-group",
|
|
2842
3086
|
e
|
|
2843
3087
|
)
|
|
2844
3088
|
), t;
|
|
2845
3089
|
}
|
|
2846
|
-
function
|
|
2847
|
-
const t =
|
|
2848
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3090
|
+
function Gn(e) {
|
|
3091
|
+
const t = bo(e);
|
|
3092
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ct()), t;
|
|
2849
3093
|
}
|
|
2850
|
-
function
|
|
3094
|
+
function ct(e = "Thinking...") {
|
|
2851
3095
|
const t = document.createElement("div");
|
|
2852
3096
|
t.className = "pluno-pa-widget__status";
|
|
2853
|
-
const o = document.createElement("span");
|
|
2854
|
-
o.className = "pluno-pa-widget__thinking-dot", o.setAttribute("aria-hidden", "true"), t.appendChild(o);
|
|
2855
3097
|
const n = document.createElement("span");
|
|
2856
|
-
|
|
3098
|
+
n.className = "pluno-pa-widget__thinking-dot", n.setAttribute("aria-hidden", "true"), t.appendChild(n);
|
|
3099
|
+
const o = document.createElement("span");
|
|
3100
|
+
return o.textContent = e, t.appendChild(o), t;
|
|
2857
3101
|
}
|
|
2858
|
-
function
|
|
3102
|
+
function or(e) {
|
|
2859
3103
|
return `tools:${e[0]?.id ?? ""}`;
|
|
2860
3104
|
}
|
|
2861
|
-
function
|
|
3105
|
+
function Zt() {
|
|
2862
3106
|
const e = document.createElement("span");
|
|
2863
3107
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
2864
3108
|
}
|
|
2865
|
-
function
|
|
2866
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3109
|
+
function _o(e, t) {
|
|
3110
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ia() : go());
|
|
2867
3111
|
}
|
|
2868
|
-
function
|
|
2869
|
-
const
|
|
3112
|
+
function ir(e, t) {
|
|
3113
|
+
const n = t.replace(/\r\n/g, `
|
|
2870
3114
|
`).split(`
|
|
2871
3115
|
`);
|
|
2872
|
-
let
|
|
2873
|
-
for (;
|
|
2874
|
-
const i = o
|
|
3116
|
+
let o = 0;
|
|
3117
|
+
for (; o < n.length; ) {
|
|
3118
|
+
const i = n[o];
|
|
2875
3119
|
if (!i.trim()) {
|
|
2876
|
-
|
|
3120
|
+
o += 1;
|
|
2877
3121
|
continue;
|
|
2878
3122
|
}
|
|
2879
3123
|
if (i.match(/^```(\w+)?\s*$/)) {
|
|
2880
|
-
const
|
|
2881
|
-
for (
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2886
|
-
`),
|
|
3124
|
+
const c = [];
|
|
3125
|
+
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3126
|
+
c.push(n[o]), o += 1;
|
|
3127
|
+
o += o < n.length ? 1 : 0;
|
|
3128
|
+
const u = document.createElement("pre"), m = document.createElement("code");
|
|
3129
|
+
m.textContent = c.join(`
|
|
3130
|
+
`), u.appendChild(m), e.appendChild(u);
|
|
2887
3131
|
continue;
|
|
2888
3132
|
}
|
|
2889
3133
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
2890
3134
|
if (l) {
|
|
2891
|
-
const
|
|
2892
|
-
|
|
3135
|
+
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3136
|
+
at(c, l[2]), e.appendChild(c), o += 1;
|
|
2893
3137
|
continue;
|
|
2894
3138
|
}
|
|
2895
3139
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
2896
|
-
const
|
|
2897
|
-
for (;
|
|
2898
|
-
const
|
|
2899
|
-
|
|
3140
|
+
const c = document.createElement("ul");
|
|
3141
|
+
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3142
|
+
const u = document.createElement("li");
|
|
3143
|
+
at(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
2900
3144
|
}
|
|
2901
|
-
e.appendChild(
|
|
3145
|
+
e.appendChild(c);
|
|
2902
3146
|
continue;
|
|
2903
3147
|
}
|
|
2904
3148
|
if (/^\s*\d+\.\s+/.test(i)) {
|
|
2905
|
-
const
|
|
2906
|
-
for (;
|
|
2907
|
-
const
|
|
2908
|
-
|
|
3149
|
+
const c = document.createElement("ol");
|
|
3150
|
+
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3151
|
+
const u = document.createElement("li");
|
|
3152
|
+
at(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
2909
3153
|
}
|
|
2910
|
-
e.appendChild(
|
|
3154
|
+
e.appendChild(c);
|
|
2911
3155
|
continue;
|
|
2912
3156
|
}
|
|
2913
3157
|
const p = [i];
|
|
2914
|
-
for (
|
|
2915
|
-
p.push(o
|
|
3158
|
+
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]); )
|
|
3159
|
+
p.push(n[o]), o += 1;
|
|
2916
3160
|
const d = document.createElement("p");
|
|
2917
|
-
p.forEach((
|
|
2918
|
-
|
|
3161
|
+
p.forEach((c, u) => {
|
|
3162
|
+
u > 0 && d.appendChild(document.createElement("br")), at(d, c);
|
|
2919
3163
|
}), e.appendChild(d);
|
|
2920
3164
|
}
|
|
2921
3165
|
}
|
|
2922
|
-
function
|
|
2923
|
-
const
|
|
2924
|
-
let
|
|
2925
|
-
for (const i of t.matchAll(
|
|
3166
|
+
function at(e, t) {
|
|
3167
|
+
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3168
|
+
let o = 0;
|
|
3169
|
+
for (const i of t.matchAll(n)) {
|
|
2926
3170
|
const r = i.index ?? 0;
|
|
2927
|
-
r >
|
|
2928
|
-
document.createTextNode(t.slice(
|
|
3171
|
+
r > o && e.appendChild(
|
|
3172
|
+
document.createTextNode(t.slice(o, r))
|
|
2929
3173
|
);
|
|
2930
3174
|
const l = i[0];
|
|
2931
3175
|
if (l.startsWith("`")) {
|
|
@@ -2939,17 +3183,17 @@ function et(e, t) {
|
|
|
2939
3183
|
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
2940
3184
|
} else {
|
|
2941
3185
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
2942
|
-
if (p &&
|
|
3186
|
+
if (p && ar(p[2])) {
|
|
2943
3187
|
const d = document.createElement("a");
|
|
2944
3188
|
d.href = p[2], d.target = "_top", d.rel = "noreferrer", d.textContent = p[1], e.appendChild(d);
|
|
2945
3189
|
} else
|
|
2946
3190
|
e.appendChild(document.createTextNode(l));
|
|
2947
3191
|
}
|
|
2948
|
-
|
|
3192
|
+
o = r + l.length;
|
|
2949
3193
|
}
|
|
2950
|
-
|
|
3194
|
+
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
2951
3195
|
}
|
|
2952
|
-
function
|
|
3196
|
+
function ar(e) {
|
|
2953
3197
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
2954
3198
|
return !0;
|
|
2955
3199
|
try {
|
|
@@ -2959,10 +3203,10 @@ function Fa(e) {
|
|
|
2959
3203
|
return !1;
|
|
2960
3204
|
}
|
|
2961
3205
|
}
|
|
2962
|
-
function
|
|
2963
|
-
if (
|
|
3206
|
+
function $n(e, t) {
|
|
3207
|
+
if (rr(e))
|
|
2964
3208
|
return;
|
|
2965
|
-
const
|
|
3209
|
+
const n = `
|
|
2966
3210
|
:host {
|
|
2967
3211
|
all: initial;
|
|
2968
3212
|
color-scheme: light;
|
|
@@ -3013,7 +3257,7 @@ function Nn(e, t) {
|
|
|
3013
3257
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3014
3258
|
position: fixed;
|
|
3015
3259
|
z-index: 2147483645;
|
|
3016
|
-
font-family: ${
|
|
3260
|
+
font-family: ${oe.fontFamily};
|
|
3017
3261
|
font-size: 14px;
|
|
3018
3262
|
color: var(--pluno-pa-text);
|
|
3019
3263
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -3307,6 +3551,82 @@ function Nn(e, t) {
|
|
|
3307
3551
|
opacity: 1;
|
|
3308
3552
|
transform: translateY(0) scale(1);
|
|
3309
3553
|
}
|
|
3554
|
+
.pluno-pa-widget__resize-handle {
|
|
3555
|
+
position: absolute;
|
|
3556
|
+
z-index: 3;
|
|
3557
|
+
border: 0;
|
|
3558
|
+
background: transparent;
|
|
3559
|
+
padding: 0;
|
|
3560
|
+
opacity: 0;
|
|
3561
|
+
touch-action: none;
|
|
3562
|
+
}
|
|
3563
|
+
.pluno-pa-widget__resize-handle:focus-visible {
|
|
3564
|
+
opacity: 1;
|
|
3565
|
+
outline: 2px solid var(--pluno-pa-accent);
|
|
3566
|
+
outline-offset: 2px;
|
|
3567
|
+
}
|
|
3568
|
+
.pluno-pa-widget__resize-handle--left,
|
|
3569
|
+
.pluno-pa-widget__resize-handle--right {
|
|
3570
|
+
top: 14px;
|
|
3571
|
+
bottom: 14px;
|
|
3572
|
+
width: 12px;
|
|
3573
|
+
cursor: ew-resize;
|
|
3574
|
+
}
|
|
3575
|
+
.pluno-pa-widget__resize-handle--left {
|
|
3576
|
+
left: -6px;
|
|
3577
|
+
}
|
|
3578
|
+
.pluno-pa-widget__resize-handle--right {
|
|
3579
|
+
right: -6px;
|
|
3580
|
+
}
|
|
3581
|
+
.pluno-pa-widget__resize-handle--top,
|
|
3582
|
+
.pluno-pa-widget__resize-handle--bottom {
|
|
3583
|
+
left: 14px;
|
|
3584
|
+
right: 14px;
|
|
3585
|
+
height: 12px;
|
|
3586
|
+
cursor: ns-resize;
|
|
3587
|
+
}
|
|
3588
|
+
.pluno-pa-widget__resize-handle--top {
|
|
3589
|
+
top: -6px;
|
|
3590
|
+
}
|
|
3591
|
+
.pluno-pa-widget__resize-handle--bottom {
|
|
3592
|
+
bottom: -6px;
|
|
3593
|
+
}
|
|
3594
|
+
.pluno-pa-widget__resize-handle--top-left,
|
|
3595
|
+
.pluno-pa-widget__resize-handle--top-right,
|
|
3596
|
+
.pluno-pa-widget__resize-handle--bottom-left,
|
|
3597
|
+
.pluno-pa-widget__resize-handle--bottom-right {
|
|
3598
|
+
width: 18px;
|
|
3599
|
+
height: 18px;
|
|
3600
|
+
}
|
|
3601
|
+
.pluno-pa-widget__resize-handle--top-left {
|
|
3602
|
+
top: -7px;
|
|
3603
|
+
left: -7px;
|
|
3604
|
+
cursor: nwse-resize;
|
|
3605
|
+
}
|
|
3606
|
+
.pluno-pa-widget__resize-handle--top-right {
|
|
3607
|
+
top: -7px;
|
|
3608
|
+
right: -7px;
|
|
3609
|
+
cursor: nesw-resize;
|
|
3610
|
+
}
|
|
3611
|
+
.pluno-pa-widget__resize-handle--bottom-left {
|
|
3612
|
+
bottom: -7px;
|
|
3613
|
+
left: -7px;
|
|
3614
|
+
cursor: nesw-resize;
|
|
3615
|
+
}
|
|
3616
|
+
.pluno-pa-widget__resize-handle--bottom-right {
|
|
3617
|
+
bottom: -7px;
|
|
3618
|
+
right: -7px;
|
|
3619
|
+
cursor: nwse-resize;
|
|
3620
|
+
}
|
|
3621
|
+
.pluno-pa-widget--resizing,
|
|
3622
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__panel,
|
|
3623
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__timeline,
|
|
3624
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__input {
|
|
3625
|
+
user-select: none;
|
|
3626
|
+
}
|
|
3627
|
+
.pluno-pa-widget--resizing .pluno-pa-widget__panel {
|
|
3628
|
+
transition: none;
|
|
3629
|
+
}
|
|
3310
3630
|
.pluno-pa-widget__close {
|
|
3311
3631
|
position: absolute;
|
|
3312
3632
|
left: calc(var(--pluno-pa-panel-offset-x) + var(--pluno-pa-panel-width) - 32px);
|
|
@@ -4016,7 +4336,7 @@ function Nn(e, t) {
|
|
|
4016
4336
|
place-items: center;
|
|
4017
4337
|
padding: 18px;
|
|
4018
4338
|
background: rgba(24, 24, 27, 0.28);
|
|
4019
|
-
font-family: var(--pluno-pa-font, ${
|
|
4339
|
+
font-family: var(--pluno-pa-font, ${oe.fontFamily});
|
|
4020
4340
|
color: var(--pluno-pa-text);
|
|
4021
4341
|
}
|
|
4022
4342
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4710,6 +5030,9 @@ function Nn(e, t) {
|
|
|
4710
5030
|
padding: 2px 0;
|
|
4711
5031
|
text-align: left;
|
|
4712
5032
|
}
|
|
5033
|
+
.pluno-pa-widget__thinking-marker .pluno-pa-widget__status {
|
|
5034
|
+
align-self: center;
|
|
5035
|
+
}
|
|
4713
5036
|
.pluno-pa-widget__thinking-dot {
|
|
4714
5037
|
flex: 0 0 auto;
|
|
4715
5038
|
width: 6px;
|
|
@@ -4801,8 +5124,8 @@ function Nn(e, t) {
|
|
|
4801
5124
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
4802
5125
|
position: absolute;
|
|
4803
5126
|
top: -16px;
|
|
4804
|
-
left:
|
|
4805
|
-
width:
|
|
5127
|
+
left: ${qt}px;
|
|
5128
|
+
width: calc(100% - ${qt * 2}px);
|
|
4806
5129
|
height: 36px;
|
|
4807
5130
|
z-index: 3;
|
|
4808
5131
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5150,28 +5473,28 @@ function Nn(e, t) {
|
|
|
5150
5473
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5151
5474
|
}
|
|
5152
5475
|
`;
|
|
5153
|
-
if (
|
|
5476
|
+
if (lr(e, n))
|
|
5154
5477
|
return;
|
|
5155
|
-
const
|
|
5156
|
-
|
|
5478
|
+
const o = e.ownerDocument.createElement("style");
|
|
5479
|
+
o.id = io, o.textContent = n, e.appendChild(o), xo(e);
|
|
5157
5480
|
}
|
|
5158
|
-
function
|
|
5159
|
-
return e.getElementById(
|
|
5481
|
+
function rr(e) {
|
|
5482
|
+
return e.getElementById(io) !== null || e.host instanceof HTMLElement && e.host.getAttribute(ao) === "true";
|
|
5160
5483
|
}
|
|
5161
|
-
function
|
|
5162
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5484
|
+
function xo(e) {
|
|
5485
|
+
e.host instanceof HTMLElement && e.host.setAttribute(ao, "true");
|
|
5163
5486
|
}
|
|
5164
|
-
function
|
|
5487
|
+
function lr(e, t) {
|
|
5165
5488
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5166
5489
|
return !1;
|
|
5167
5490
|
try {
|
|
5168
|
-
const
|
|
5169
|
-
return
|
|
5491
|
+
const n = new CSSStyleSheet();
|
|
5492
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], xo(e), !0;
|
|
5170
5493
|
} catch {
|
|
5171
5494
|
return !1;
|
|
5172
5495
|
}
|
|
5173
5496
|
}
|
|
5174
|
-
async function
|
|
5497
|
+
async function pr() {
|
|
5175
5498
|
return document.body ? document.body : await new Promise((e) => {
|
|
5176
5499
|
const t = new MutationObserver(() => {
|
|
5177
5500
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -5179,41 +5502,42 @@ async function Ga() {
|
|
|
5179
5502
|
t.observe(document.documentElement, { childList: !0 });
|
|
5180
5503
|
});
|
|
5181
5504
|
}
|
|
5182
|
-
function
|
|
5505
|
+
function yo(e) {
|
|
5183
5506
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5184
5507
|
}
|
|
5185
|
-
function
|
|
5508
|
+
function sr(e) {
|
|
5186
5509
|
try {
|
|
5187
|
-
const t = window.localStorage.getItem(
|
|
5510
|
+
const t = window.localStorage.getItem(yo(e));
|
|
5188
5511
|
if (!t)
|
|
5189
|
-
return
|
|
5190
|
-
const
|
|
5512
|
+
return qn();
|
|
5513
|
+
const n = JSON.parse(t);
|
|
5191
5514
|
return {
|
|
5192
|
-
isOpen:
|
|
5193
|
-
composerValue: typeof
|
|
5194
|
-
focusedInput:
|
|
5195
|
-
focusedInputAt: typeof
|
|
5196
|
-
openToolGroupKeys: Array.isArray(
|
|
5197
|
-
(
|
|
5515
|
+
isOpen: n.isOpen === !0,
|
|
5516
|
+
composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
|
|
5517
|
+
focusedInput: n.focusedInput === "composer" || n.focusedInput === "launcher" ? n.focusedInput : null,
|
|
5518
|
+
focusedInputAt: typeof n.focusedInputAt == "number" ? n.focusedInputAt : null,
|
|
5519
|
+
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
5520
|
+
(o) => typeof o == "string"
|
|
5198
5521
|
) : [],
|
|
5199
|
-
launcherPosition:
|
|
5200
|
-
|
|
5201
|
-
|
|
5522
|
+
launcherPosition: gr(n.launcherPosition) ? n.launcherPosition : null,
|
|
5523
|
+
panelSize: hr(n.panelSize) ? ut(n.panelSize) : null,
|
|
5524
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Zn) : [],
|
|
5525
|
+
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5202
5526
|
};
|
|
5203
5527
|
} catch {
|
|
5204
|
-
return
|
|
5528
|
+
return qn();
|
|
5205
5529
|
}
|
|
5206
5530
|
}
|
|
5207
|
-
async function
|
|
5531
|
+
async function dr(e) {
|
|
5208
5532
|
if (e.loadSharePromptsDisabled)
|
|
5209
5533
|
return e.loadSharePromptsDisabled();
|
|
5210
5534
|
try {
|
|
5211
|
-
return window.localStorage.getItem(
|
|
5535
|
+
return window.localStorage.getItem(Jn) === "true";
|
|
5212
5536
|
} catch {
|
|
5213
5537
|
return !1;
|
|
5214
5538
|
}
|
|
5215
5539
|
}
|
|
5216
|
-
function
|
|
5540
|
+
function cr(e, t) {
|
|
5217
5541
|
if (e.persistSharePromptsDisabled) {
|
|
5218
5542
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
5219
5543
|
() => {
|
|
@@ -5222,12 +5546,12 @@ function ja(e, t) {
|
|
|
5222
5546
|
return;
|
|
5223
5547
|
}
|
|
5224
5548
|
try {
|
|
5225
|
-
t && window.localStorage.setItem(
|
|
5549
|
+
t && window.localStorage.setItem(Jn, "true");
|
|
5226
5550
|
} catch {
|
|
5227
5551
|
return;
|
|
5228
5552
|
}
|
|
5229
5553
|
}
|
|
5230
|
-
function
|
|
5554
|
+
function qn() {
|
|
5231
5555
|
return {
|
|
5232
5556
|
isOpen: !1,
|
|
5233
5557
|
composerValue: "",
|
|
@@ -5235,52 +5559,59 @@ function Tn() {
|
|
|
5235
5559
|
focusedInputAt: null,
|
|
5236
5560
|
openToolGroupKeys: [],
|
|
5237
5561
|
launcherPosition: null,
|
|
5562
|
+
panelSize: null,
|
|
5238
5563
|
seenShareCandidateIds: [],
|
|
5239
5564
|
sharePromptsDisabled: !1
|
|
5240
5565
|
};
|
|
5241
5566
|
}
|
|
5242
|
-
function
|
|
5567
|
+
function ur(e, t) {
|
|
5243
5568
|
try {
|
|
5244
5569
|
window.localStorage.setItem(
|
|
5245
|
-
|
|
5570
|
+
yo(e),
|
|
5246
5571
|
JSON.stringify(t)
|
|
5247
5572
|
);
|
|
5248
5573
|
} catch {
|
|
5249
5574
|
return;
|
|
5250
5575
|
}
|
|
5251
5576
|
}
|
|
5252
|
-
function
|
|
5577
|
+
function gr(e) {
|
|
5253
5578
|
if (!e || typeof e != "object")
|
|
5254
5579
|
return !1;
|
|
5255
5580
|
const t = e;
|
|
5256
5581
|
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");
|
|
5257
5582
|
}
|
|
5258
|
-
|
|
5259
|
-
|
|
5583
|
+
function hr(e) {
|
|
5584
|
+
if (!e || typeof e != "object")
|
|
5585
|
+
return !1;
|
|
5586
|
+
const t = e;
|
|
5587
|
+
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5588
|
+
}
|
|
5589
|
+
const jn = /* @__PURE__ */ new WeakSet();
|
|
5590
|
+
function mr(e) {
|
|
5260
5591
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5261
5592
|
}
|
|
5262
|
-
function
|
|
5593
|
+
function Vn(e) {
|
|
5263
5594
|
const t = e.pathname.split("/");
|
|
5264
5595
|
return t[t.length - 1] ?? "";
|
|
5265
5596
|
}
|
|
5266
|
-
function
|
|
5267
|
-
const
|
|
5268
|
-
return
|
|
5269
|
-
}
|
|
5270
|
-
class
|
|
5271
|
-
constructor(t,
|
|
5272
|
-
super(), this.channelId =
|
|
5273
|
-
this.readyState =
|
|
5274
|
-
}), this.addPreviewListener(
|
|
5275
|
-
const i =
|
|
5597
|
+
function fr(e, t) {
|
|
5598
|
+
const n = new URL(e.src, document.baseURI);
|
|
5599
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : Vn(n) === Vn(t);
|
|
5600
|
+
}
|
|
5601
|
+
class se extends EventTarget {
|
|
5602
|
+
constructor(t, n) {
|
|
5603
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(bi, () => {
|
|
5604
|
+
this.readyState = se.OPEN, this.dispatchEvent(new Event("open"));
|
|
5605
|
+
}), this.addPreviewListener(_i, (o) => {
|
|
5606
|
+
const i = o;
|
|
5276
5607
|
this.dispatchEvent(
|
|
5277
5608
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5278
5609
|
);
|
|
5279
|
-
}), this.addPreviewListener(
|
|
5280
|
-
this.readyState =
|
|
5281
|
-
}), this.addPreviewListener(
|
|
5282
|
-
const i =
|
|
5283
|
-
this.readyState =
|
|
5610
|
+
}), this.addPreviewListener(xi, () => {
|
|
5611
|
+
this.readyState = se.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5612
|
+
}), this.addPreviewListener(yi, (o) => {
|
|
5613
|
+
const i = o;
|
|
5614
|
+
this.readyState = se.CLOSED, this.dispatchEvent(
|
|
5284
5615
|
new CloseEvent("close", {
|
|
5285
5616
|
code: i.detail?.code ?? 1e3,
|
|
5286
5617
|
reason: i.detail?.reason ?? "",
|
|
@@ -5289,8 +5620,8 @@ class re extends EventTarget {
|
|
|
5289
5620
|
), this.cleanup();
|
|
5290
5621
|
}), window.dispatchEvent(
|
|
5291
5622
|
new CustomEvent(
|
|
5292
|
-
|
|
5293
|
-
|
|
5623
|
+
rt(
|
|
5624
|
+
mi,
|
|
5294
5625
|
this.channelId
|
|
5295
5626
|
),
|
|
5296
5627
|
{
|
|
@@ -5309,18 +5640,18 @@ class re extends EventTarget {
|
|
|
5309
5640
|
extensions = "";
|
|
5310
5641
|
binaryType = "blob";
|
|
5311
5642
|
bufferedAmount = 0;
|
|
5312
|
-
readyState =
|
|
5313
|
-
socketId =
|
|
5643
|
+
readyState = se.CONNECTING;
|
|
5644
|
+
socketId = wr();
|
|
5314
5645
|
listeners = /* @__PURE__ */ new Map();
|
|
5315
5646
|
send(t) {
|
|
5316
|
-
if (this.readyState !==
|
|
5647
|
+
if (this.readyState !== se.OPEN)
|
|
5317
5648
|
throw new DOMException(
|
|
5318
5649
|
"Pluno preview websocket is not open",
|
|
5319
5650
|
"InvalidStateError"
|
|
5320
5651
|
);
|
|
5321
5652
|
window.dispatchEvent(
|
|
5322
5653
|
new CustomEvent(
|
|
5323
|
-
|
|
5654
|
+
rt(fi, this.channelId),
|
|
5324
5655
|
{
|
|
5325
5656
|
detail: {
|
|
5326
5657
|
socketId: this.socketId,
|
|
@@ -5330,78 +5661,78 @@ class re extends EventTarget {
|
|
|
5330
5661
|
)
|
|
5331
5662
|
);
|
|
5332
5663
|
}
|
|
5333
|
-
close(t,
|
|
5334
|
-
this.readyState !==
|
|
5664
|
+
close(t, n) {
|
|
5665
|
+
this.readyState !== se.CLOSED && (this.readyState = se.CLOSING, window.dispatchEvent(
|
|
5335
5666
|
new CustomEvent(
|
|
5336
|
-
|
|
5667
|
+
rt(wi, this.channelId),
|
|
5337
5668
|
{
|
|
5338
|
-
detail: { socketId: this.socketId, code: t, reason:
|
|
5669
|
+
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5339
5670
|
}
|
|
5340
5671
|
)
|
|
5341
5672
|
), this.cleanup());
|
|
5342
5673
|
}
|
|
5343
|
-
addPreviewListener(t,
|
|
5344
|
-
const
|
|
5674
|
+
addPreviewListener(t, n) {
|
|
5675
|
+
const o = rt(
|
|
5345
5676
|
t,
|
|
5346
5677
|
this.channelId
|
|
5347
5678
|
), i = (r) => {
|
|
5348
|
-
r.detail?.socketId === this.socketId &&
|
|
5679
|
+
r.detail?.socketId === this.socketId && n(r);
|
|
5349
5680
|
};
|
|
5350
|
-
this.listeners.set(
|
|
5681
|
+
this.listeners.set(o, i), window.addEventListener(o, i);
|
|
5351
5682
|
}
|
|
5352
5683
|
cleanup() {
|
|
5353
|
-
for (const [t,
|
|
5354
|
-
window.removeEventListener(t,
|
|
5684
|
+
for (const [t, n] of this.listeners.entries())
|
|
5685
|
+
window.removeEventListener(t, n);
|
|
5355
5686
|
this.listeners.clear();
|
|
5356
5687
|
}
|
|
5357
5688
|
}
|
|
5358
|
-
function
|
|
5689
|
+
function wr() {
|
|
5359
5690
|
const e = window.sessionStorage.getItem(
|
|
5360
|
-
|
|
5691
|
+
yn
|
|
5361
5692
|
);
|
|
5362
5693
|
if (e)
|
|
5363
5694
|
return e;
|
|
5364
5695
|
const t = crypto.randomUUID();
|
|
5365
|
-
return window.sessionStorage.setItem(
|
|
5696
|
+
return window.sessionStorage.setItem(yn, t), t;
|
|
5366
5697
|
}
|
|
5367
|
-
function
|
|
5698
|
+
function rt(e, t) {
|
|
5368
5699
|
return `${e}:${t}`;
|
|
5369
5700
|
}
|
|
5370
|
-
function
|
|
5701
|
+
function br(e) {
|
|
5371
5702
|
const t = document.currentScript;
|
|
5372
5703
|
if (t instanceof HTMLScriptElement)
|
|
5373
5704
|
return [t];
|
|
5374
|
-
const
|
|
5705
|
+
const n = new URL(e, document.baseURI).href, o = new URL(n);
|
|
5375
5706
|
return Array.from(
|
|
5376
5707
|
document.querySelectorAll("script[type='module'][src]")
|
|
5377
5708
|
).filter(
|
|
5378
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5709
|
+
(i) => i instanceof HTMLScriptElement && mr(i) && fr(i, o)
|
|
5379
5710
|
);
|
|
5380
5711
|
}
|
|
5381
|
-
function
|
|
5382
|
-
for (const t of
|
|
5383
|
-
if (
|
|
5712
|
+
function _r(e) {
|
|
5713
|
+
for (const t of br(e)) {
|
|
5714
|
+
if (jn.has(t) || t.dataset.plunoAutoMount === "false")
|
|
5384
5715
|
continue;
|
|
5385
|
-
|
|
5386
|
-
const
|
|
5387
|
-
|
|
5716
|
+
jn.add(t);
|
|
5717
|
+
const n = t.dataset.plunoPreviewChannel;
|
|
5718
|
+
$i({
|
|
5388
5719
|
token: t.dataset.plunoToken,
|
|
5389
5720
|
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
5390
5721
|
backendUrl: t.dataset.plunoBackendUrl,
|
|
5391
|
-
webSocketFactory:
|
|
5722
|
+
webSocketFactory: n ? Gi(n) : void 0,
|
|
5392
5723
|
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
5393
5724
|
accentColor: t.dataset.plunoAccentColor,
|
|
5394
5725
|
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
5395
5726
|
fontFamily: t.dataset.plunoFontFamily,
|
|
5396
5727
|
scribbleStyle: t.dataset.plunoScribbleStyle === "true",
|
|
5397
5728
|
position: t.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5398
|
-
}).catch((
|
|
5399
|
-
console.error("Failed to mount Pluno widget",
|
|
5729
|
+
}).catch((o) => {
|
|
5730
|
+
console.error("Failed to mount Pluno widget", o);
|
|
5400
5731
|
});
|
|
5401
5732
|
}
|
|
5402
5733
|
}
|
|
5403
|
-
|
|
5734
|
+
_r(import.meta.url);
|
|
5404
5735
|
export {
|
|
5405
|
-
|
|
5406
|
-
|
|
5736
|
+
Gi as createProductAgentPreviewBridgeWebSocketFactory,
|
|
5737
|
+
$i as mountPlunoProductAgentWidget
|
|
5407
5738
|
};
|