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