@pluno/product-agent-web 0.1.21 → 0.1.23
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/index.d.ts +3 -0
- package/dist/product-agent-sdk.js +55 -42
- package/dist/product-agent-widget.js +1356 -954
- package/dist/widget.d.ts +18 -0
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { PlunoProductAgent as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const
|
|
1
|
+
import { PlunoProductAgent as Ot } from "./product-agent-sdk.js";
|
|
2
|
+
const Bt = "#7c3aed";
|
|
3
|
+
function Ft(e) {
|
|
4
|
+
const t = Wt(e);
|
|
5
5
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
|
|
6
6
|
<defs>
|
|
7
7
|
<linearGradient id="boltFill" x1="420" y1="180" x2="790" y2="1040" gradientUnits="userSpaceOnUse">
|
|
8
|
-
<stop offset="0" stop-color="${
|
|
9
|
-
<stop offset="0.36" stop-color="${
|
|
10
|
-
<stop offset="0.72" stop-color="${
|
|
11
|
-
<stop offset="1" stop-color="${
|
|
8
|
+
<stop offset="0" stop-color="${t.top}"/>
|
|
9
|
+
<stop offset="0.36" stop-color="${t.middle}"/>
|
|
10
|
+
<stop offset="0.72" stop-color="${t.bottom}"/>
|
|
11
|
+
<stop offset="1" stop-color="${t.bottom}"/>
|
|
12
12
|
</linearGradient>
|
|
13
13
|
<linearGradient id="boltEdge" x1="470" y1="145" x2="900" y2="980" gradientUnits="userSpaceOnUse">
|
|
14
|
-
<stop offset="0" stop-color="${
|
|
15
|
-
<stop offset="0.32" stop-color="${
|
|
16
|
-
<stop offset="0.78" stop-color="${
|
|
17
|
-
<stop offset="1" stop-color="${
|
|
14
|
+
<stop offset="0" stop-color="${t.edgeStart}"/>
|
|
15
|
+
<stop offset="0.32" stop-color="${t.edgeMiddle}"/>
|
|
16
|
+
<stop offset="0.78" stop-color="${t.edgeEnd}"/>
|
|
17
|
+
<stop offset="1" stop-color="${t.edgeEnd}"/>
|
|
18
18
|
</linearGradient>
|
|
19
19
|
<radialGradient id="boltGlow" cx="50%" cy="22%" r="82%">
|
|
20
|
-
<stop offset="0" stop-color="${
|
|
21
|
-
<stop offset="0.5" stop-color="${
|
|
22
|
-
<stop offset="1" stop-color="${
|
|
20
|
+
<stop offset="0" stop-color="${t.glow}" stop-opacity="0.72"/>
|
|
21
|
+
<stop offset="0.5" stop-color="${t.middle}" stop-opacity="0.44"/>
|
|
22
|
+
<stop offset="1" stop-color="${t.bottom}" stop-opacity="0"/>
|
|
23
23
|
</radialGradient>
|
|
24
24
|
<radialGradient id="eyeWhite" cx="35%" cy="25%" r="70%">
|
|
25
25
|
<stop offset="0" stop-color="#ffffff"/>
|
|
@@ -32,7 +32,7 @@ function Ct(t) {
|
|
|
32
32
|
<stop offset="1" stop-color="#000000"/>
|
|
33
33
|
</radialGradient>
|
|
34
34
|
<filter id="softDropShadow" x="-18%" y="-12%" width="136%" height="136%" color-interpolation-filters="sRGB">
|
|
35
|
-
<feDropShadow dx="0" dy="12" stdDeviation="18" flood-color="${
|
|
35
|
+
<feDropShadow dx="0" dy="12" stdDeviation="18" flood-color="${t.shadow}" flood-opacity="0.24"/>
|
|
36
36
|
</filter>
|
|
37
37
|
<filter id="innerDepth" x="-8%" y="-8%" width="116%" height="116%" color-interpolation-filters="sRGB">
|
|
38
38
|
<feGaussianBlur in="SourceAlpha" stdDeviation="8" result="blur"/>
|
|
@@ -42,7 +42,7 @@ function Ct(t) {
|
|
|
42
42
|
<feBlend in="SourceGraphic" in2="innerLight" mode="screen"/>
|
|
43
43
|
</filter>
|
|
44
44
|
<filter id="eyeShadow" x="-24%" y="-20%" width="148%" height="148%" color-interpolation-filters="sRGB">
|
|
45
|
-
<feDropShadow dx="0" dy="8" stdDeviation="5" flood-color="${
|
|
45
|
+
<feDropShadow dx="0" dy="8" stdDeviation="5" flood-color="${t.shadow}" flood-opacity="0.3"/>
|
|
46
46
|
</filter>
|
|
47
47
|
<filter id="pupilGloss" x="-15%" y="-15%" width="130%" height="130%" color-interpolation-filters="sRGB">
|
|
48
48
|
<feDropShadow dx="0" dy="3" stdDeviation="3" flood-color="#000000" flood-opacity="0.22"/>
|
|
@@ -56,9 +56,9 @@ function Ct(t) {
|
|
|
56
56
|
<path d="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" fill="url(#boltFill)" filter="url(#innerDepth)"/>
|
|
57
57
|
<path d="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" fill="url(#boltGlow)" opacity="0.74"/>
|
|
58
58
|
<g clip-path="url(#boltClip)" opacity="0.42">
|
|
59
|
-
<path d="M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626" fill="none" stroke="${
|
|
60
|
-
<path d="M556 685 L501 994" fill="none" stroke="${
|
|
61
|
-
<path d="M858 160 C882 166 893 181 883 204" fill="none" stroke="${
|
|
59
|
+
<path d="M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626" fill="none" stroke="${t.highlight}" stroke-width="22" stroke-linecap="round" opacity="0.65"/>
|
|
60
|
+
<path d="M556 685 L501 994" fill="none" stroke="${t.highlight}" stroke-width="20" stroke-linecap="round" opacity="0.55"/>
|
|
61
|
+
<path d="M858 160 C882 166 893 181 883 204" fill="none" stroke="${t.inner}" stroke-width="18" stroke-linecap="round" opacity="0.48"/>
|
|
62
62
|
</g>
|
|
63
63
|
</g>
|
|
64
64
|
<g filter="url(#eyeShadow)">
|
|
@@ -75,23 +75,23 @@ function Ct(t) {
|
|
|
75
75
|
</g>
|
|
76
76
|
</svg>`;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return `data:image/svg+xml,${encodeURIComponent(
|
|
78
|
+
function zt(e) {
|
|
79
|
+
return `data:image/svg+xml,${encodeURIComponent(Ft(e))}`;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
return
|
|
86
|
-
let o =
|
|
87
|
-
const a =
|
|
81
|
+
const j = "#2c2a1e", Ge = [253, 250, 241], Ue = 3.5;
|
|
82
|
+
function ct(e) {
|
|
83
|
+
const t = ut(e);
|
|
84
|
+
if ($e(te(t), Ge) >= Ue)
|
|
85
|
+
return t;
|
|
86
|
+
let o = te(t);
|
|
87
|
+
const a = te(j);
|
|
88
88
|
for (let i = 0; i < 6; i += 1)
|
|
89
|
-
if (o =
|
|
90
|
-
return
|
|
91
|
-
return
|
|
89
|
+
if (o = Ht(o, a, 0.22), $e(o, Ge) >= Ue)
|
|
90
|
+
return Ce(o);
|
|
91
|
+
return Ce(o);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
93
|
+
function Gt(e) {
|
|
94
|
+
const t = ct(e), n = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z";
|
|
95
95
|
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
|
|
96
96
|
<defs>
|
|
97
97
|
<clipPath id="scribbleBoltClip">
|
|
@@ -104,26 +104,26 @@ function kt(t) {
|
|
|
104
104
|
</defs>
|
|
105
105
|
<g filter="url(#scribbleBoltWobble)">
|
|
106
106
|
<g clip-path="url(#scribbleBoltClip)">
|
|
107
|
-
<path d="${
|
|
107
|
+
<path d="${$t()}" fill="none" stroke="${t}" stroke-width="56" stroke-linecap="round" stroke-linejoin="round" opacity="0.9" transform="rotate(-14 627 600)"/>
|
|
108
108
|
</g>
|
|
109
|
-
<path d="${n}" fill="none" stroke="${
|
|
109
|
+
<path d="${n}" fill="none" stroke="${j}" stroke-width="18" stroke-linejoin="round"/>
|
|
110
110
|
<g transform="rotate(-2 528 463)">
|
|
111
|
-
<ellipse cx="528" cy="463" rx="73" ry="80" fill="#ffffff" stroke="${
|
|
112
|
-
<ellipse cx="533" cy="473" rx="45" ry="53" fill="${
|
|
111
|
+
<ellipse cx="528" cy="463" rx="73" ry="80" fill="#ffffff" stroke="${j}" stroke-width="13"/>
|
|
112
|
+
<ellipse cx="533" cy="473" rx="45" ry="53" fill="${j}"/>
|
|
113
113
|
<circle cx="557" cy="447" r="16" fill="#ffffff"/>
|
|
114
114
|
</g>
|
|
115
115
|
<g transform="rotate(2 717 462)">
|
|
116
|
-
<ellipse cx="717" cy="462" rx="73" ry="80" fill="#ffffff" stroke="${
|
|
117
|
-
<ellipse cx="712" cy="473" rx="45" ry="53" fill="${
|
|
116
|
+
<ellipse cx="717" cy="462" rx="73" ry="80" fill="#ffffff" stroke="${j}" stroke-width="13"/>
|
|
117
|
+
<ellipse cx="712" cy="473" rx="45" ry="53" fill="${j}"/>
|
|
118
118
|
<circle cx="728" cy="447" r="16" fill="#ffffff"/>
|
|
119
119
|
</g>
|
|
120
120
|
</g>
|
|
121
121
|
</svg>`;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
return `data:image/svg+xml,${encodeURIComponent(
|
|
123
|
+
function Ut(e) {
|
|
124
|
+
return `data:image/svg+xml,${encodeURIComponent(Gt(e))}`;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function $t() {
|
|
127
127
|
let n = "M 280 120", o = !1, a = 0;
|
|
128
128
|
for (let i = 150; i <= 1170; i += 62) {
|
|
129
129
|
const l = (a % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
@@ -131,8 +131,8 @@ function Lt() {
|
|
|
131
131
|
}
|
|
132
132
|
return n;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const
|
|
134
|
+
function Wt(e) {
|
|
135
|
+
const t = ut(e), n = Ee(te(t));
|
|
136
136
|
return n > 0.86 ? {
|
|
137
137
|
top: "#ffffff",
|
|
138
138
|
middle: "#f6f6f6",
|
|
@@ -156,90 +156,90 @@ function Pt(t) {
|
|
|
156
156
|
inner: "#4b4b4b",
|
|
157
157
|
shadow: "#000000"
|
|
158
158
|
} : {
|
|
159
|
-
top:
|
|
160
|
-
middle:
|
|
161
|
-
bottom:
|
|
162
|
-
edgeStart:
|
|
163
|
-
edgeMiddle:
|
|
164
|
-
edgeEnd:
|
|
165
|
-
glow:
|
|
166
|
-
highlight:
|
|
167
|
-
inner:
|
|
168
|
-
shadow:
|
|
159
|
+
top: I(t, 0.28, -0.03),
|
|
160
|
+
middle: I(t, 0.08, 0.04),
|
|
161
|
+
bottom: I(t, -0.1, 0.02),
|
|
162
|
+
edgeStart: I(t, 0.08, 0.08),
|
|
163
|
+
edgeMiddle: I(t, -0.08, 0.08),
|
|
164
|
+
edgeEnd: I(t, -0.18, 0.05),
|
|
165
|
+
glow: I(t, 0.32, -0.12),
|
|
166
|
+
highlight: I(t, 0.38, -0.18),
|
|
167
|
+
inner: I(t, 0.24, -0.1),
|
|
168
|
+
shadow: I(t, -0.25, -0.08)
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
return /^#[0-9a-f]{6}$/i.test(
|
|
171
|
+
function ut(e) {
|
|
172
|
+
const t = e.trim();
|
|
173
|
+
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()}` : Bt;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function te(e) {
|
|
176
176
|
return [
|
|
177
|
-
Number.parseInt(
|
|
178
|
-
Number.parseInt(
|
|
179
|
-
Number.parseInt(
|
|
177
|
+
Number.parseInt(e.slice(1, 3), 16),
|
|
178
|
+
Number.parseInt(e.slice(3, 5), 16),
|
|
179
|
+
Number.parseInt(e.slice(5, 7), 16)
|
|
180
180
|
];
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ce([e, t, n]) {
|
|
183
183
|
const o = (a) => Math.max(0, Math.min(255, Math.round(a))).toString(16).padStart(2, "0");
|
|
184
|
-
return `#${o(
|
|
184
|
+
return `#${o(e)}${o(t)}${o(n)}`;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Ee([e, t, n]) {
|
|
187
187
|
const o = (a) => {
|
|
188
188
|
const i = a / 255;
|
|
189
189
|
return i <= 0.04045 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
|
|
190
190
|
};
|
|
191
|
-
return 0.2126 * o(
|
|
191
|
+
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
const n =
|
|
193
|
+
function $e(e, t) {
|
|
194
|
+
const n = Ee(e), o = Ee(t), [a, i] = n > o ? [n, o] : [o, n];
|
|
195
195
|
return (a + 0.05) / (i + 0.05);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
const o =
|
|
197
|
+
function Ht(e, t, n) {
|
|
198
|
+
const o = ke(n);
|
|
199
199
|
return [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
200
|
+
e[0] + (t[0] - e[0]) * o,
|
|
201
|
+
e[1] + (t[1] - e[1]) * o,
|
|
202
|
+
e[2] + (t[2] - e[2]) * o
|
|
203
203
|
];
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const [o, a, i] =
|
|
207
|
-
return
|
|
205
|
+
function I(e, t, n) {
|
|
206
|
+
const [o, a, i] = Vt(te(e));
|
|
207
|
+
return Ce(qt(o, ke(a + n), ke(i + t)));
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
const o =
|
|
209
|
+
function Vt([e, t, n]) {
|
|
210
|
+
const o = e / 255, a = t / 255, i = n / 255, l = Math.max(o, a, i), p = Math.min(o, a, i), s = (l + p) / 2;
|
|
211
211
|
if (l === p)
|
|
212
212
|
return [0, 0, s];
|
|
213
|
-
const
|
|
214
|
-
return [(l === o ? (a - i) /
|
|
213
|
+
const g = l - p, c = s > 0.5 ? g / (2 - l - p) : g / (l + p);
|
|
214
|
+
return [(l === o ? (a - i) / g + (a < i ? 6 : 0) : l === a ? (i - o) / g + 2 : (o - a) / g + 4) / 6, c, s];
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
if (
|
|
216
|
+
function qt(e, t, n) {
|
|
217
|
+
if (t === 0)
|
|
218
218
|
return [n * 255, n * 255, n * 255];
|
|
219
|
-
const o = n < 0.5 ? n * (1 +
|
|
219
|
+
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, a = 2 * n - o;
|
|
220
220
|
return [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
we(a, o, e + 1 / 3) * 255,
|
|
222
|
+
we(a, o, e) * 255,
|
|
223
|
+
we(a, o, e - 1 / 3) * 255
|
|
224
224
|
];
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function we(e, t, n) {
|
|
227
227
|
let o = n;
|
|
228
|
-
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ?
|
|
228
|
+
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;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
return Math.max(0, Math.min(1,
|
|
230
|
+
function ke(e) {
|
|
231
|
+
return Math.max(0, Math.min(1, e));
|
|
232
232
|
}
|
|
233
|
-
const
|
|
234
|
-
function
|
|
235
|
-
for (let
|
|
236
|
-
const n = t
|
|
237
|
-
if (n.role !== "tool" || n.toolName !==
|
|
233
|
+
const gt = "suggest_share_on_socials";
|
|
234
|
+
function jt(e) {
|
|
235
|
+
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
236
|
+
const n = e[t];
|
|
237
|
+
if (n.role !== "tool" || n.toolName !== gt)
|
|
238
238
|
continue;
|
|
239
|
-
const o =
|
|
239
|
+
const o = We(e, t, "assistant");
|
|
240
240
|
if (!o)
|
|
241
241
|
return null;
|
|
242
|
-
const a =
|
|
242
|
+
const a = We(e, o.index, "user");
|
|
243
243
|
return a ? {
|
|
244
244
|
id: `share:${n.callId ?? n.id}`,
|
|
245
245
|
userPrompt: a.content,
|
|
@@ -248,15 +248,24 @@ function Dt(t) {
|
|
|
248
248
|
}
|
|
249
249
|
return null;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
async function Kt(e) {
|
|
252
|
+
const t = await Yt(e);
|
|
253
|
+
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
254
|
+
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
255
|
+
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
256
|
+
}
|
|
257
|
+
function We(e, t, n) {
|
|
258
|
+
for (let o = t - 1; o >= 0; o -= 1) {
|
|
259
|
+
const a = e[o];
|
|
254
260
|
if (a.role === n && a.content.trim())
|
|
255
261
|
return { index: o, content: a.content.trim() };
|
|
256
262
|
}
|
|
257
263
|
return null;
|
|
258
264
|
}
|
|
259
|
-
|
|
265
|
+
async function Yt(e) {
|
|
266
|
+
return await (await fetch(e)).blob();
|
|
267
|
+
}
|
|
268
|
+
const ht = 100, Xt = "product-agent:sdk-preview-socket-connect", Zt = "product-agent:sdk-preview-socket-send", Jt = "product-agent:sdk-preview-socket-close", Qt = "product-agent:sdk-preview-socket-open", en = "product-agent:sdk-preview-socket-message", tn = "product-agent:sdk-preview-socket-error", nn = "product-agent:sdk-preview-socket-closed", He = "product-agent:sdk-preview-socket-id", on = "product-agent:preview-diagnostic", mt = "pluno.productAgent.sharePromptsDisabled", de = 10, an = 10 * 1024 * 1024, rn = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "application/pdf"]), M = {
|
|
260
269
|
launcherLabel: "Ask for anything...",
|
|
261
270
|
accentColor: "#7c3aed",
|
|
262
271
|
colorScheme: "light",
|
|
@@ -264,75 +273,83 @@ const nt = 100, It = "product-agent:sdk-preview-socket-connect", Rt = "product-a
|
|
|
264
273
|
scribbleStyle: !1,
|
|
265
274
|
position: "bottom-right",
|
|
266
275
|
movableLauncher: !1
|
|
267
|
-
},
|
|
268
|
-
function
|
|
269
|
-
return (
|
|
270
|
-
}
|
|
271
|
-
async function
|
|
272
|
-
const
|
|
273
|
-
launcherLabel:
|
|
274
|
-
accentColor:
|
|
275
|
-
colorScheme:
|
|
276
|
-
fontFamily:
|
|
277
|
-
scribbleStyle:
|
|
278
|
-
position:
|
|
279
|
-
movableLauncher:
|
|
280
|
-
token:
|
|
281
|
-
tokenProvider:
|
|
282
|
-
tokenEndpoint:
|
|
283
|
-
backendUrl: t.backendUrl,
|
|
284
|
-
metadata: t.metadata,
|
|
285
|
-
initialStarterPrompts: t.initialStarterPrompts,
|
|
286
|
-
webSocketFactory: t.webSocketFactory,
|
|
287
|
-
loginRequired: t.loginRequired === !0,
|
|
288
|
-
loginButtonLabel: t.loginButtonLabel ?? "Log in to Pluno",
|
|
289
|
-
onLoginClick: t.onLoginClick,
|
|
290
|
-
socialPostDraftHandler: t.socialPostDraftHandler
|
|
291
|
-
};
|
|
292
|
-
F("web-sdk.widget", "Mounting widget with merged options", {
|
|
293
|
-
accentColor: e.accentColor,
|
|
294
|
-
colorScheme: e.colorScheme,
|
|
295
|
-
fontFamily: e.fontFamily,
|
|
276
|
+
}, Ve = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 36"><g><ellipse cx="17.5" cy="24.5" rx="2.4" ry="3" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.5 27 C20.5 12, 7.5 2.5, 6 18.5" fill="none" stroke="%232c2a1e" stroke-width="2.5" stroke-linecap="round"/></g><g transform="translate(26 0)"><ellipse cx="17.9" cy="24.1" rx="2.5" ry="2.8" fill="none" stroke="%232c2a1e" stroke-width="1.5" opacity="0.8"/><path d="M18.9 26.4 C21.2 13, 8.6 3.6, 6.9 17.4" fill="none" stroke="%232c2a1e" stroke-width="2.35" stroke-linecap="round"/></g><g transform="translate(52 0)"><ellipse cx="17.1" cy="24.9" rx="2.2" ry="3.1" fill="none" stroke="%232c2a1e" stroke-width="1.7" opacity="0.8"/><path d="M18.1 27.5 C19.9 10.4, 6.4 2, 5.6 19.2" fill="none" stroke="%232c2a1e" stroke-width="2.6" stroke-linecap="round"/></g><g transform="translate(78 0)"><ellipse cx="17.6" cy="24.4" rx="2.4" ry="2.9" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1" fill="none" stroke="%232c2a1e" stroke-width="2.45" stroke-linecap="round"/></g></svg>', ln = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', qe = "pluno-pa-scribble-font", ft = 190, bt = 41, pn = 48, sn = 420, dn = 520, cn = 0.24, un = 680, gn = 800, hn = 0.76, D = 8, je = 50, mn = "http://www.w3.org/2000/svg", fn = 11, bn = 13, wn = 4, _n = 10, xn = 40, vn = "movable-launcher-position-v2";
|
|
277
|
+
function yn(e) {
|
|
278
|
+
return (t) => new O(t, e);
|
|
279
|
+
}
|
|
280
|
+
async function Cn(e = {}) {
|
|
281
|
+
const t = {
|
|
282
|
+
launcherLabel: e.launcherLabel ?? M.launcherLabel,
|
|
283
|
+
accentColor: e.accentColor ?? M.accentColor,
|
|
284
|
+
colorScheme: e.colorScheme ?? M.colorScheme,
|
|
285
|
+
fontFamily: e.fontFamily ?? M.fontFamily,
|
|
286
|
+
scribbleStyle: e.scribbleStyle ?? M.scribbleStyle,
|
|
287
|
+
position: e.position ?? M.position,
|
|
288
|
+
movableLauncher: e.movableLauncher ?? M.movableLauncher,
|
|
289
|
+
token: e.token,
|
|
290
|
+
tokenProvider: e.tokenProvider,
|
|
291
|
+
tokenEndpoint: e.tokenEndpoint,
|
|
296
292
|
backendUrl: e.backendUrl,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
293
|
+
metadata: e.metadata,
|
|
294
|
+
initialStarterPrompts: e.initialStarterPrompts,
|
|
295
|
+
clientId: e.clientId,
|
|
296
|
+
restorePersistedState: e.restorePersistedState,
|
|
297
|
+
expectedPersistedSessionId: e.expectedPersistedSessionId,
|
|
298
|
+
webSocketFactory: e.webSocketFactory,
|
|
299
|
+
loginRequired: e.loginRequired === !0,
|
|
300
|
+
loginButtonLabel: e.loginButtonLabel ?? "Log in to Pluno",
|
|
301
|
+
onLoginClick: e.onLoginClick,
|
|
302
|
+
socialPostDraftHandler: e.socialPostDraftHandler,
|
|
303
|
+
billingStatus: e.billingStatus ?? null,
|
|
304
|
+
billingStatusLoader: e.billingStatusLoader,
|
|
305
|
+
socialPostRewardsUrl: e.socialPostRewardsUrl,
|
|
306
|
+
loadSharePromptsDisabled: e.loadSharePromptsDisabled,
|
|
307
|
+
persistSharePromptsDisabled: e.persistSharePromptsDisabled
|
|
308
|
+
};
|
|
309
|
+
U("web-sdk.widget", "Mounting widget with merged options", {
|
|
310
|
+
accentColor: t.accentColor,
|
|
311
|
+
colorScheme: t.colorScheme,
|
|
312
|
+
fontFamily: t.fontFamily,
|
|
313
|
+
backendUrl: t.backendUrl,
|
|
314
|
+
hasToken: !!t.token,
|
|
315
|
+
hasTokenProvider: !!t.tokenProvider,
|
|
316
|
+
hasTokenEndpoint: !!t.tokenEndpoint,
|
|
317
|
+
hasWebSocketFactory: !!t.webSocketFactory,
|
|
318
|
+
initialStarterPromptCount: t.initialStarterPrompts?.length ?? 0
|
|
302
319
|
});
|
|
303
320
|
const n = document.createElement("div");
|
|
304
321
|
n.className = "pluno-pa-widget-host";
|
|
305
322
|
const o = n.attachShadow({ mode: "open" }), a = document.createElement("div");
|
|
306
|
-
a.className = `pluno-pa-widget pluno-pa-widget--${
|
|
307
|
-
let i =
|
|
308
|
-
|
|
309
|
-
const l = await
|
|
310
|
-
l.appendChild(n), a.classList.add(`pluno-pa-widget--${
|
|
311
|
-
accentColor:
|
|
312
|
-
colorScheme:
|
|
313
|
-
fontFamily:
|
|
314
|
-
scribbleStyle:
|
|
315
|
-
}),
|
|
316
|
-
accentColor:
|
|
317
|
-
colorScheme:
|
|
318
|
-
fontFamily:
|
|
323
|
+
a.className = `pluno-pa-widget pluno-pa-widget--${t.position}`;
|
|
324
|
+
let i = Ke(t.accentColor, t.scribbleStyle);
|
|
325
|
+
Dn(a, t.launcherLabel, i, t.movableLauncher), o.appendChild(a);
|
|
326
|
+
const l = await _o(), p = l.ownerDocument;
|
|
327
|
+
l.appendChild(n), a.classList.add(`pluno-pa-widget--${t.colorScheme}`), lt(o, t.accentColor), Ye(a, i, {
|
|
328
|
+
accentColor: t.accentColor,
|
|
329
|
+
colorScheme: t.colorScheme,
|
|
330
|
+
fontFamily: t.fontFamily,
|
|
331
|
+
scribbleStyle: t.scribbleStyle
|
|
332
|
+
}), U("web-sdk.widget", "Applied initial widget appearance", {
|
|
333
|
+
accentColor: t.accentColor,
|
|
334
|
+
colorScheme: t.colorScheme,
|
|
335
|
+
fontFamily: t.fontFamily,
|
|
319
336
|
cssAccent: a.style.getPropertyValue("--pluno-pa-accent")
|
|
320
337
|
});
|
|
321
|
-
const s = a.querySelector(".pluno-pa-widget__launcher"),
|
|
322
|
-
if (!s || !
|
|
338
|
+
const s = a.querySelector(".pluno-pa-widget__launcher"), g = a.querySelector(".pluno-pa-widget__launcher-drag-handle"), c = a.querySelector(".pluno-pa-widget__launcher-input"), b = a.querySelector(".pluno-pa-widget__panel"), w = a.querySelector(".pluno-pa-widget__close"), x = a.querySelector(".pluno-pa-widget__composer"), C = a.querySelector(".pluno-pa-widget__attachment-error"), h = a.querySelector(".pluno-pa-widget__billing-status"), f = a.querySelector(".pluno-pa-widget__attachments"), u = a.querySelector(".pluno-pa-widget__input"), m = a.querySelector(".pluno-pa-widget__send"), _ = a.querySelector(".pluno-pa-widget__new-chat"), k = a.querySelector(".pluno-pa-widget__timeline");
|
|
339
|
+
if (!s || !c || !b || !w || !x || !C || !h || !f || !u || !m || !_ || !k)
|
|
323
340
|
throw new Error("Failed to mount Pluno widget");
|
|
324
|
-
if (
|
|
341
|
+
if (t.movableLauncher && !g)
|
|
325
342
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
326
|
-
|
|
327
|
-
let
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
343
|
+
et(c), et(u);
|
|
344
|
+
let v = [], y = null;
|
|
345
|
+
const T = () => {
|
|
346
|
+
$n(f, v, (r) => {
|
|
347
|
+
v = v.filter((d, L) => L !== r), T(), N();
|
|
331
348
|
});
|
|
332
|
-
},
|
|
333
|
-
if (!
|
|
349
|
+
}, ne = t.loginRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
350
|
+
if (!t.tokenEndpoint)
|
|
334
351
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
335
|
-
const r = await fetch(
|
|
352
|
+
const r = await fetch(t.tokenEndpoint, {
|
|
336
353
|
method: "POST",
|
|
337
354
|
credentials: "include",
|
|
338
355
|
headers: { "content-type": "application/json" },
|
|
@@ -340,49 +357,53 @@ async function tn(t = {}) {
|
|
|
340
357
|
});
|
|
341
358
|
if (!r.ok)
|
|
342
359
|
throw new Error("Failed to load Pluno token");
|
|
343
|
-
const
|
|
344
|
-
if (!
|
|
360
|
+
const d = await r.json();
|
|
361
|
+
if (!d.token)
|
|
345
362
|
throw new Error("Pluno token endpoint did not return a token");
|
|
346
|
-
return
|
|
363
|
+
return d.token;
|
|
347
364
|
});
|
|
348
|
-
let
|
|
349
|
-
|
|
350
|
-
token:
|
|
351
|
-
tokenProvider:
|
|
352
|
-
backendUrl:
|
|
365
|
+
let E;
|
|
366
|
+
E = await Ot.init({
|
|
367
|
+
token: t.token,
|
|
368
|
+
tokenProvider: ne,
|
|
369
|
+
backendUrl: t.backendUrl,
|
|
353
370
|
metadata: () => ({
|
|
354
|
-
...
|
|
355
|
-
...!
|
|
371
|
+
...t.metadata ?? {},
|
|
372
|
+
...!E.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
356
373
|
}),
|
|
357
|
-
initialStarterPrompts:
|
|
358
|
-
|
|
359
|
-
|
|
374
|
+
initialStarterPrompts: t.initialStarterPrompts,
|
|
375
|
+
clientId: t.clientId,
|
|
376
|
+
restorePersistedState: t.restorePersistedState,
|
|
377
|
+
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
378
|
+
webSocketFactory: t.webSocketFactory,
|
|
379
|
+
autoConnect: t.loginRequired ? !1 : void 0
|
|
360
380
|
});
|
|
361
|
-
const z =
|
|
362
|
-
let
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
-
return
|
|
381
|
+
const z = xo(t), ce = new Set(z.openToolGroupKeys), $ = new Set(z.seenShareCandidateIds), oe = new Set($);
|
|
382
|
+
let ue = z.sharePromptsDisabled || await vo(t), R = t.movableLauncher ? z.launcherPosition : null, Ne = R !== null, B = null, De = !1;
|
|
383
|
+
const Pt = () => {
|
|
384
|
+
De || typeof document > "u" || (lt(o, t.accentColor), n.isConnected || p.body?.appendChild(n));
|
|
385
|
+
}, Te = new MutationObserver(Pt);
|
|
386
|
+
Te.observe(p.documentElement, { childList: !0, subtree: !0 });
|
|
387
|
+
const ge = (r = !0) => {
|
|
388
|
+
const d = Xe(a, r);
|
|
389
|
+
return Ze(
|
|
370
390
|
a,
|
|
371
|
-
|
|
372
|
-
|
|
391
|
+
R ?? Ln(a, t.position, d),
|
|
392
|
+
d
|
|
373
393
|
);
|
|
374
|
-
},
|
|
375
|
-
|
|
394
|
+
}, A = () => {
|
|
395
|
+
Co(t, {
|
|
376
396
|
isOpen: a.classList.contains("pluno-pa-widget--open"),
|
|
377
|
-
composerValue:
|
|
378
|
-
openToolGroupKeys: [...
|
|
379
|
-
launcherPosition:
|
|
380
|
-
seenShareCandidateIds: [
|
|
397
|
+
composerValue: u.value,
|
|
398
|
+
openToolGroupKeys: [...ce],
|
|
399
|
+
launcherPosition: Ne ? R : null,
|
|
400
|
+
seenShareCandidateIds: [...$].slice(-ht),
|
|
401
|
+
sharePromptsDisabled: ue
|
|
381
402
|
});
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
debugVersion:
|
|
385
|
-
launcherPosition:
|
|
403
|
+
}, G = (r, d = {}) => {
|
|
404
|
+
Nn(r, {
|
|
405
|
+
debugVersion: vn,
|
|
406
|
+
launcherPosition: R,
|
|
386
407
|
rootClasses: a.className,
|
|
387
408
|
rootStyle: {
|
|
388
409
|
left: a.style.left,
|
|
@@ -390,477 +411,507 @@ async function tn(t = {}) {
|
|
|
390
411
|
right: a.style.right,
|
|
391
412
|
bottom: a.style.bottom
|
|
392
413
|
},
|
|
393
|
-
rootRect:
|
|
394
|
-
launcherRect:
|
|
395
|
-
panelRect:
|
|
396
|
-
viewport:
|
|
397
|
-
panelHidden:
|
|
414
|
+
rootRect: _e(a),
|
|
415
|
+
launcherRect: _e(s),
|
|
416
|
+
panelRect: _e(b),
|
|
417
|
+
viewport: Y(),
|
|
418
|
+
panelHidden: b.hidden,
|
|
398
419
|
closeHidden: w.hidden,
|
|
399
|
-
...
|
|
420
|
+
...d
|
|
400
421
|
});
|
|
401
|
-
},
|
|
402
|
-
if (!
|
|
403
|
-
return
|
|
404
|
-
const
|
|
405
|
-
return
|
|
406
|
-
},
|
|
407
|
-
if (!r || !
|
|
408
|
-
|
|
422
|
+
}, ae = (r = !0) => {
|
|
423
|
+
if (!R)
|
|
424
|
+
return re(a, null), ge(r);
|
|
425
|
+
const d = ge(r);
|
|
426
|
+
return re(a, d), G("Applied stored closed launcher position", { visibleLauncherPosition: d }), d;
|
|
427
|
+
}, Ie = (r, d) => {
|
|
428
|
+
if (!r || !d) {
|
|
429
|
+
Qe(a);
|
|
409
430
|
return;
|
|
410
431
|
}
|
|
411
|
-
|
|
412
|
-
x: r.x -
|
|
413
|
-
y: r.y -
|
|
432
|
+
An(a, {
|
|
433
|
+
x: r.x - d.x,
|
|
434
|
+
y: r.y - d.y
|
|
414
435
|
});
|
|
415
|
-
},
|
|
416
|
-
const r =
|
|
436
|
+
}, Re = () => {
|
|
437
|
+
const r = ae();
|
|
417
438
|
if (a.classList.contains("pluno-pa-widget--open") || a.classList.contains("pluno-pa-widget--closing")) {
|
|
418
|
-
const
|
|
419
|
-
|
|
420
|
-
} else
|
|
439
|
+
const d = Je(r);
|
|
440
|
+
Ie(d, r), G("Applied open panel position after viewport resize", { openPanelPosition: d });
|
|
441
|
+
} else R && G("Applied visible launcher position after viewport resize", { visibleLauncherPosition: r });
|
|
421
442
|
};
|
|
422
|
-
let
|
|
443
|
+
let Me = () => {
|
|
423
444
|
};
|
|
424
|
-
|
|
445
|
+
t.movableLauncher && g ? (ae(), window.addEventListener("resize", Re), Me = kn({
|
|
425
446
|
root: a,
|
|
426
|
-
launcherDragHandle:
|
|
427
|
-
getPosition: () =>
|
|
447
|
+
launcherDragHandle: g,
|
|
448
|
+
getPosition: () => ge(),
|
|
428
449
|
setPosition: (r) => {
|
|
429
|
-
const
|
|
430
|
-
|
|
450
|
+
const d = r;
|
|
451
|
+
R = Ze(a, r, Xe(a)), re(a, R), G("Dragging closed launcher", { requestedPosition: d });
|
|
431
452
|
},
|
|
432
453
|
persist: () => {
|
|
433
|
-
|
|
454
|
+
Ne = !0, A(), G("Persisted closed launcher drag position");
|
|
455
|
+
}
|
|
456
|
+
})) : re(a, null);
|
|
457
|
+
let he = !1;
|
|
458
|
+
const Oe = async () => {
|
|
459
|
+
if (!(!t.billingStatusLoader || he)) {
|
|
460
|
+
he = !0;
|
|
461
|
+
try {
|
|
462
|
+
const r = await t.billingStatusLoader();
|
|
463
|
+
nt(t.billingStatus, r, E.getState().lastErrorCode) && (t.billingStatus = r, ye(h, t.billingStatus, E.getState().lastErrorCode), N());
|
|
464
|
+
} finally {
|
|
465
|
+
he = !1;
|
|
466
|
+
}
|
|
434
467
|
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
Ee(K, L), O("Opening launcher at clamped open panel position", { openPanelPosition: K, visibleLauncherPosition: L });
|
|
468
|
+
}, W = (r = "", d = !0) => {
|
|
469
|
+
if (Oe(), B !== null && (window.clearTimeout(B), B = null), b.hidden = !1, w.hidden = !1, a.classList.remove("pluno-pa-widget--closing"), t.movableLauncher) {
|
|
470
|
+
const L = ae(), Q = Je(L);
|
|
471
|
+
Ie(Q, L), G("Opening launcher at clamped open panel position", { openPanelPosition: Q, visibleLauncherPosition: L });
|
|
440
472
|
} else
|
|
441
|
-
|
|
442
|
-
if (!
|
|
443
|
-
a.classList.add("pluno-pa-widget--open"), s.hidden = !0, r && (
|
|
473
|
+
Qe(a);
|
|
474
|
+
if (!d) {
|
|
475
|
+
a.classList.add("pluno-pa-widget--open"), s.hidden = !0, r && (u.value = r, ee(u)), k.scrollTop = k.scrollHeight, u.focus(), u.setSelectionRange(u.value.length, u.value.length), A();
|
|
444
476
|
return;
|
|
445
477
|
}
|
|
446
478
|
window.requestAnimationFrame(() => {
|
|
447
|
-
a.classList.add("pluno-pa-widget--open"), r && (
|
|
448
|
-
s.hidden = !0,
|
|
479
|
+
a.classList.add("pluno-pa-widget--open"), r && (u.value = r, ee(u)), k.scrollTop = k.scrollHeight, u.focus(), u.setSelectionRange(u.value.length, u.value.length), A(), B = window.setTimeout(() => {
|
|
480
|
+
s.hidden = !0, k.scrollTop = k.scrollHeight;
|
|
449
481
|
}, 220);
|
|
450
482
|
});
|
|
451
|
-
},
|
|
452
|
-
|
|
453
|
-
|
|
483
|
+
}, At = () => {
|
|
484
|
+
B !== null && (window.clearTimeout(B), B = null), s.hidden = !1, R && (ae(!1), G("Closing launcher at stored position")), a.classList.remove("pluno-pa-widget--open"), a.classList.add("pluno-pa-widget--closing"), A(), B = window.setTimeout(() => {
|
|
485
|
+
b.hidden = !0, w.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
|
|
454
486
|
}, 220);
|
|
455
487
|
};
|
|
456
488
|
s.addEventListener("submit", (r) => {
|
|
457
|
-
r.preventDefault(),
|
|
458
|
-
}),
|
|
489
|
+
r.preventDefault(), W(c.value), c.value = "";
|
|
490
|
+
}), g?.addEventListener("click", (r) => {
|
|
459
491
|
r.preventDefault(), r.stopPropagation();
|
|
460
492
|
}), s.addEventListener("click", (r) => {
|
|
461
|
-
r.target !==
|
|
462
|
-
}),
|
|
463
|
-
|
|
464
|
-
}),
|
|
465
|
-
if (!
|
|
493
|
+
r.target !== c && (W(c.value), c.value = "");
|
|
494
|
+
}), c.addEventListener("focus", () => {
|
|
495
|
+
W(c.value), c.value = "";
|
|
496
|
+
}), c.addEventListener("input", () => {
|
|
497
|
+
if (!c.value)
|
|
466
498
|
return;
|
|
467
|
-
const r =
|
|
468
|
-
|
|
469
|
-
}), w.addEventListener("click",
|
|
470
|
-
const
|
|
471
|
-
|
|
499
|
+
const r = c.value;
|
|
500
|
+
W(r), c.value = "";
|
|
501
|
+
}), w.addEventListener("click", At);
|
|
502
|
+
const N = () => {
|
|
503
|
+
m.disabled = F(t.billingStatus) || !E.getState().isThinking && u.value.trim().length === 0 && v.length === 0;
|
|
472
504
|
};
|
|
473
|
-
|
|
474
|
-
if (r.preventDefault(),
|
|
475
|
-
|
|
505
|
+
t.loginRequired && (c.readOnly = !0, c.placeholder = t.loginButtonLabel, u.placeholder = t.loginButtonLabel, x.hidden = !0), x.addEventListener("submit", (r) => {
|
|
506
|
+
if (r.preventDefault(), t.loginRequired) {
|
|
507
|
+
t.onLoginClick?.();
|
|
476
508
|
return;
|
|
477
509
|
}
|
|
478
|
-
|
|
510
|
+
F(t.billingStatus) || (v = xe(E, u, v), T(), N());
|
|
479
511
|
});
|
|
480
|
-
let
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
},
|
|
484
|
-
|
|
485
|
-
|
|
512
|
+
let Z = 0;
|
|
513
|
+
const Nt = () => {
|
|
514
|
+
Z = 0, a.classList.remove("pluno-pa-widget--drag-over");
|
|
515
|
+
}, Dt = (r) => {
|
|
516
|
+
y !== null && window.clearTimeout(y), C.textContent = r, C.hidden = !1, y = window.setTimeout(() => {
|
|
517
|
+
C.textContent = "", C.hidden = !0, y = null;
|
|
486
518
|
}, 3e3);
|
|
487
|
-
},
|
|
488
|
-
|
|
489
|
-
},
|
|
519
|
+
}, Tt = () => {
|
|
520
|
+
y !== null && (window.clearTimeout(y), y = null), C.textContent = "", C.hidden = !0;
|
|
521
|
+
}, It = async (r) => {
|
|
490
522
|
if (r.length === 0)
|
|
491
523
|
return;
|
|
492
|
-
const
|
|
493
|
-
if (
|
|
494
|
-
throw new Error(`Attach up to ${
|
|
495
|
-
|
|
524
|
+
const d = await qn(r);
|
|
525
|
+
if (v.length + d.length > de)
|
|
526
|
+
throw new Error(`Attach up to ${de} files per message.`);
|
|
527
|
+
v = [...v, ...d], T(), Tt(), N();
|
|
496
528
|
};
|
|
497
529
|
a.addEventListener("dragenter", (r) => {
|
|
498
|
-
!
|
|
530
|
+
!le(r.dataTransfer) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Z += 1, a.classList.add("pluno-pa-widget--drag-over"));
|
|
499
531
|
}), a.addEventListener("dragover", (r) => {
|
|
500
|
-
const
|
|
501
|
-
!
|
|
532
|
+
const d = r.dataTransfer;
|
|
533
|
+
!le(d) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), d.dropEffect = "copy");
|
|
502
534
|
}), a.addEventListener("dragleave", (r) => {
|
|
503
|
-
|
|
535
|
+
le(r.dataTransfer) && (r.stopPropagation(), Z = Math.max(0, Z - 1), Z === 0 && a.classList.remove("pluno-pa-widget--drag-over"));
|
|
504
536
|
}), a.addEventListener("drop", (r) => {
|
|
505
|
-
const
|
|
506
|
-
!
|
|
507
|
-
|
|
537
|
+
const d = r.dataTransfer;
|
|
538
|
+
!le(d) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), Nt(), It(d.files).catch((L) => {
|
|
539
|
+
Dt(L instanceof Error ? L.message : "Failed to attach file"), U("web-sdk.widget", "Attachment failed", {
|
|
508
540
|
message: L instanceof Error ? L.message : String(L)
|
|
509
541
|
});
|
|
510
542
|
}));
|
|
511
|
-
}),
|
|
512
|
-
if (
|
|
513
|
-
|
|
543
|
+
}), m.addEventListener("click", () => {
|
|
544
|
+
if (t.loginRequired) {
|
|
545
|
+
t.onLoginClick?.();
|
|
514
546
|
return;
|
|
515
547
|
}
|
|
516
|
-
if (
|
|
517
|
-
|
|
548
|
+
if (E.getState().isThinking) {
|
|
549
|
+
E.stop();
|
|
518
550
|
return;
|
|
519
551
|
}
|
|
520
|
-
|
|
521
|
-
}),
|
|
522
|
-
|
|
523
|
-
}),
|
|
524
|
-
|
|
525
|
-
}),
|
|
552
|
+
v = xe(E, u, v), T(), N();
|
|
553
|
+
}), _.addEventListener("click", () => {
|
|
554
|
+
E.startNewSession(), ce.clear(), u.value = "", v = [], T(), ee(u), A(), N(), u.focus();
|
|
555
|
+
}), u.addEventListener("input", () => {
|
|
556
|
+
ee(u), A(), N();
|
|
557
|
+
}), u.addEventListener("keydown", (r) => {
|
|
526
558
|
if (!(r.key !== "Enter" || r.shiftKey)) {
|
|
527
|
-
if (r.preventDefault(),
|
|
528
|
-
|
|
559
|
+
if (r.preventDefault(), t.loginRequired) {
|
|
560
|
+
t.onLoginClick?.();
|
|
529
561
|
return;
|
|
530
562
|
}
|
|
531
|
-
|
|
563
|
+
v = xe(E, u, v), T(), N();
|
|
532
564
|
}
|
|
533
565
|
}), a.addEventListener("click", (r) => {
|
|
534
|
-
(r.target instanceof Element ? r.target : null)?.closest("a[href]") &&
|
|
535
|
-
}), z.composerValue && (
|
|
536
|
-
const
|
|
537
|
-
let
|
|
538
|
-
const
|
|
539
|
-
if (
|
|
540
|
-
|
|
566
|
+
(r.target instanceof Element ? r.target : null)?.closest("a[href]") && A();
|
|
567
|
+
}), z.composerValue && (u.value = z.composerValue, ee(u)), z.isOpen && W(u.value, !1);
|
|
568
|
+
const Be = () => i;
|
|
569
|
+
let me = E.getState().appearance !== null, ie = null, J = null, H = null, Fe = E.getState().isThinking, V = null;
|
|
570
|
+
const Rt = !!t.socialPostDraftHandler, q = (r) => {
|
|
571
|
+
if (Ae(r.lastErrorCode) ? V = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !F(t.billingStatus) && (V = null), ye(h, t.billingStatus, V), t.loginRequired) {
|
|
572
|
+
io(k, m, _, Be, t.loginButtonLabel, t.onLoginClick);
|
|
541
573
|
return;
|
|
542
574
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
575
|
+
ao(
|
|
576
|
+
k,
|
|
577
|
+
m,
|
|
578
|
+
_,
|
|
547
579
|
r,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
(
|
|
552
|
-
|
|
580
|
+
ce,
|
|
581
|
+
A,
|
|
582
|
+
Be,
|
|
583
|
+
(d) => {
|
|
584
|
+
E.sendMessage(d);
|
|
553
585
|
},
|
|
554
|
-
|
|
555
|
-
dismissedCandidateIds:
|
|
556
|
-
draftingCandidateId:
|
|
557
|
-
error:
|
|
558
|
-
onSeen: (
|
|
559
|
-
|
|
586
|
+
Rt && !ue ? {
|
|
587
|
+
dismissedCandidateIds: oe,
|
|
588
|
+
draftingCandidateId: ie,
|
|
589
|
+
error: J,
|
|
590
|
+
onSeen: (d) => {
|
|
591
|
+
$.add(d.id), A();
|
|
592
|
+
},
|
|
593
|
+
onDraft: (d) => {
|
|
594
|
+
Mt(d);
|
|
560
595
|
},
|
|
561
|
-
|
|
562
|
-
|
|
596
|
+
onDismiss: (d) => {
|
|
597
|
+
$.add(d.id), oe.add(d.id), A(), J = null, q(E.getState());
|
|
563
598
|
},
|
|
564
|
-
|
|
565
|
-
|
|
599
|
+
onDisable: (d) => {
|
|
600
|
+
ue = !0, $.add(d.id), oe.add(d.id), A(), yo(t, !0), J = null, q(E.getState());
|
|
566
601
|
}
|
|
567
602
|
} : void 0
|
|
568
603
|
);
|
|
569
604
|
};
|
|
570
|
-
return
|
|
571
|
-
|
|
605
|
+
return E.on("state", (r) => {
|
|
606
|
+
const d = Fe && !r.isThinking;
|
|
607
|
+
Fe = r.isThinking, r.appearance ? (me = !0, U("web-sdk.widget", "Agent state supplied appearance", {
|
|
572
608
|
appearance: r.appearance
|
|
573
|
-
}),
|
|
574
|
-
fallbackAccentColor:
|
|
575
|
-
fallbackColorScheme:
|
|
576
|
-
fallbackFontFamily:
|
|
577
|
-
}),
|
|
578
|
-
}),
|
|
579
|
-
agent:
|
|
609
|
+
}), fe(r.appearance, "agent.state.appearance")) : me && (me = !1, U("web-sdk.widget", "Agent state cleared appearance; reverting to configured widget options", {
|
|
610
|
+
fallbackAccentColor: t.accentColor,
|
|
611
|
+
fallbackColorScheme: t.colorScheme,
|
|
612
|
+
fallbackFontFamily: t.fontFamily
|
|
613
|
+
}), fe({}, "agent.state.appearance-cleared")), q(r), N(), d && Oe();
|
|
614
|
+
}), q(E.getState()), N(), {
|
|
615
|
+
agent: E,
|
|
580
616
|
updateAppearance: (r) => {
|
|
581
|
-
r.scribbleStyle !== void 0 && (
|
|
617
|
+
r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), fe(r, "widgetHandle.updateAppearance");
|
|
618
|
+
},
|
|
619
|
+
updateBillingStatus: (r) => {
|
|
620
|
+
const d = r ?? null;
|
|
621
|
+
nt(t.billingStatus, d, V) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !F(t.billingStatus) && (V = null), ye(
|
|
622
|
+
a.querySelector(".pluno-pa-widget__billing-status"),
|
|
623
|
+
t.billingStatus,
|
|
624
|
+
V
|
|
625
|
+
), N());
|
|
582
626
|
},
|
|
583
627
|
openPanel: () => {
|
|
584
|
-
|
|
628
|
+
W(u.value, !1);
|
|
585
629
|
},
|
|
586
630
|
destroy: () => {
|
|
587
|
-
|
|
631
|
+
De = !0, Te.disconnect(), t.movableLauncher && window.removeEventListener("resize", Re), Me(), y !== null && window.clearTimeout(y), H?.remove(), E.destroy(), n.remove();
|
|
588
632
|
}
|
|
589
633
|
};
|
|
590
|
-
async function
|
|
591
|
-
if (!
|
|
592
|
-
|
|
634
|
+
async function Mt(r) {
|
|
635
|
+
if (!ie) {
|
|
636
|
+
ie = r.id, J = null, q(E.getState());
|
|
593
637
|
try {
|
|
594
|
-
if (!
|
|
638
|
+
if (!t.socialPostDraftHandler)
|
|
595
639
|
throw new Error("Social post drafting is not available here.");
|
|
596
|
-
const
|
|
597
|
-
if (!
|
|
640
|
+
const d = await t.socialPostDraftHandler(r);
|
|
641
|
+
if (!d.linkedinPost || !d.xPost)
|
|
598
642
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
599
|
-
|
|
643
|
+
$.add(r.id), oe.add(r.id), A(), H?.remove(), H = po(d, {
|
|
644
|
+
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
600
645
|
onClose: () => {
|
|
601
|
-
|
|
646
|
+
H?.remove(), H = null;
|
|
602
647
|
}
|
|
603
|
-
}), a.appendChild(
|
|
604
|
-
} catch (
|
|
605
|
-
|
|
648
|
+
}), a.appendChild(H);
|
|
649
|
+
} catch (d) {
|
|
650
|
+
J = d instanceof Error ? d.message : "Could not draft social post.";
|
|
606
651
|
} finally {
|
|
607
|
-
|
|
652
|
+
ie = null, q(E.getState());
|
|
608
653
|
}
|
|
609
654
|
}
|
|
610
655
|
}
|
|
611
|
-
function
|
|
612
|
-
const L = r.accentColor ??
|
|
613
|
-
i =
|
|
656
|
+
function fe(r, d) {
|
|
657
|
+
const L = r.accentColor ?? t.accentColor, Q = r.colorScheme ?? t.colorScheme, ze = r.fontFamily ?? t.fontFamily, be = r.scribbleStyle ?? t.scribbleStyle;
|
|
658
|
+
i = Ke(L, be), Ye(a, i, {
|
|
614
659
|
accentColor: L,
|
|
615
|
-
colorScheme:
|
|
616
|
-
fontFamily:
|
|
617
|
-
scribbleStyle:
|
|
618
|
-
}),
|
|
619
|
-
source:
|
|
660
|
+
colorScheme: Q,
|
|
661
|
+
fontFamily: ze,
|
|
662
|
+
scribbleStyle: be
|
|
663
|
+
}), U("web-sdk.widget", "Updated widget appearance", {
|
|
664
|
+
source: d,
|
|
620
665
|
inputAppearance: r,
|
|
621
666
|
appliedAccentColor: L,
|
|
622
|
-
appliedColorScheme:
|
|
623
|
-
appliedFontFamily:
|
|
624
|
-
appliedScribbleStyle:
|
|
667
|
+
appliedColorScheme: Q,
|
|
668
|
+
appliedFontFamily: ze,
|
|
669
|
+
appliedScribbleStyle: be,
|
|
625
670
|
cssAccent: a.style.getPropertyValue("--pluno-pa-accent")
|
|
626
671
|
});
|
|
627
672
|
}
|
|
628
673
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
674
|
+
function Ke(e, t) {
|
|
675
|
+
return t ? Ut(e) : zt(e);
|
|
631
676
|
}
|
|
632
|
-
function
|
|
633
|
-
|
|
634
|
-
const o = n.scribbleStyle ?
|
|
635
|
-
|
|
636
|
-
const a = Array.from(
|
|
677
|
+
function Ye(e, t, n) {
|
|
678
|
+
e.classList.toggle("pluno-pa-widget--dark", n.colorScheme === "dark"), e.classList.toggle("pluno-pa-widget--light", n.colorScheme !== "dark"), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
679
|
+
const o = n.scribbleStyle ? ct(n.accentColor) : n.accentColor;
|
|
680
|
+
e.style.setProperty("--pluno-pa-accent", o), e.style.fontFamily = n.scribbleStyle ? ln : n.fontFamily, n.scribbleStyle && En(e.ownerDocument);
|
|
681
|
+
const a = Array.from(e.querySelectorAll(".pluno-pa-widget__character"));
|
|
637
682
|
for (const i of a)
|
|
638
|
-
i.src =
|
|
683
|
+
i.src = t;
|
|
639
684
|
}
|
|
640
|
-
function
|
|
641
|
-
if (
|
|
685
|
+
function En(e) {
|
|
686
|
+
if (e.getElementById(qe))
|
|
642
687
|
return;
|
|
643
|
-
const
|
|
644
|
-
|
|
688
|
+
const t = e.createElement("style");
|
|
689
|
+
t.id = qe, t.textContent = `@font-face {
|
|
645
690
|
font-family: "Architects Daughter";
|
|
646
691
|
font-style: normal;
|
|
647
692
|
font-weight: 400;
|
|
648
693
|
font-display: swap;
|
|
649
694
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
650
|
-
}`,
|
|
695
|
+
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
651
696
|
}
|
|
652
|
-
function
|
|
653
|
-
root:
|
|
654
|
-
launcherDragHandle:
|
|
697
|
+
function kn({
|
|
698
|
+
root: e,
|
|
699
|
+
launcherDragHandle: t,
|
|
655
700
|
getPosition: n,
|
|
656
701
|
setPosition: o,
|
|
657
702
|
persist: a
|
|
658
703
|
}) {
|
|
659
704
|
let i = null, l = null, p = null, s = !1;
|
|
660
|
-
const
|
|
661
|
-
i = null, l = null, p = null, s = !1,
|
|
662
|
-
},
|
|
663
|
-
|
|
664
|
-
},
|
|
665
|
-
if (i !==
|
|
705
|
+
const g = () => {
|
|
706
|
+
i = null, l = null, p = null, s = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
707
|
+
}, c = (h) => {
|
|
708
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), i = h.pointerId, l = { x: h.clientX, y: h.clientY }, p = n(), s = !1, t.setPointerCapture?.(h.pointerId));
|
|
709
|
+
}, b = (h) => {
|
|
710
|
+
if (i !== h.pointerId || !l || !p)
|
|
666
711
|
return;
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
!s && Math.hypot(
|
|
670
|
-
}, w = (
|
|
671
|
-
i ===
|
|
672
|
-
},
|
|
673
|
-
i ===
|
|
674
|
-
},
|
|
675
|
-
if (
|
|
712
|
+
h.preventDefault();
|
|
713
|
+
const f = h.clientX - l.x, u = h.clientY - l.y;
|
|
714
|
+
!s && Math.hypot(f, u) < wn || (s = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + f, y: p.y + u }));
|
|
715
|
+
}, w = (h) => {
|
|
716
|
+
i === h.pointerId && (h.preventDefault(), h.stopPropagation(), s && a(), g());
|
|
717
|
+
}, x = (h) => {
|
|
718
|
+
i === h.pointerId && (h.preventDefault(), g());
|
|
719
|
+
}, C = (h) => {
|
|
720
|
+
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
676
721
|
return;
|
|
677
|
-
const
|
|
678
|
-
let
|
|
679
|
-
|
|
722
|
+
const f = h.shiftKey ? xn : _n, u = n();
|
|
723
|
+
let m = null;
|
|
724
|
+
h.key === "ArrowUp" ? m = { x: u.x, y: u.y - f } : h.key === "ArrowDown" ? m = { x: u.x, y: u.y + f } : h.key === "ArrowLeft" ? m = { x: u.x - f, y: u.y } : h.key === "ArrowRight" && (m = { x: u.x + f, y: u.y }), m && (h.preventDefault(), h.stopPropagation(), o(m), a());
|
|
680
725
|
};
|
|
681
|
-
return
|
|
682
|
-
|
|
726
|
+
return t.addEventListener("pointerdown", c), t.addEventListener("pointermove", b), t.addEventListener("pointerup", w), t.addEventListener("pointercancel", x), t.addEventListener("keydown", C), () => {
|
|
727
|
+
t.removeEventListener("pointerdown", c), t.removeEventListener("pointermove", b), t.removeEventListener("pointerup", w), t.removeEventListener("pointercancel", x), t.removeEventListener("keydown", C);
|
|
683
728
|
};
|
|
684
729
|
}
|
|
685
|
-
function
|
|
686
|
-
const n =
|
|
730
|
+
function Xe(e, t = !0) {
|
|
731
|
+
const n = Y(), o = e.getBoundingClientRect(), a = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
687
732
|
return {
|
|
688
|
-
width:
|
|
689
|
-
height:
|
|
733
|
+
width: t && a && o.width > 0 ? o.width : Math.min(ft, n.width - 36),
|
|
734
|
+
height: t && a && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? pn : bt
|
|
690
735
|
};
|
|
691
736
|
}
|
|
692
|
-
function
|
|
693
|
-
const
|
|
737
|
+
function Sn() {
|
|
738
|
+
const e = Y();
|
|
694
739
|
return {
|
|
695
|
-
width: Math.min(
|
|
696
|
-
|
|
740
|
+
width: Math.min(
|
|
741
|
+
K(e.width * cn, sn, dn),
|
|
742
|
+
e.width - 28
|
|
743
|
+
),
|
|
744
|
+
height: Math.min(
|
|
745
|
+
K(e.height * hn, un, gn),
|
|
746
|
+
e.height - 28
|
|
747
|
+
)
|
|
697
748
|
};
|
|
698
749
|
}
|
|
699
|
-
function
|
|
700
|
-
const o = Number.parseFloat(
|
|
750
|
+
function Ln(e, t, n) {
|
|
751
|
+
const o = Number.parseFloat(e.style.left), a = Number.parseFloat(e.style.top);
|
|
701
752
|
if (Number.isFinite(o) && Number.isFinite(a))
|
|
702
753
|
return { x: o, y: a };
|
|
703
|
-
const i =
|
|
754
|
+
const i = e.getBoundingClientRect();
|
|
704
755
|
if (i.width > 0 || i.height > 0)
|
|
705
756
|
return { x: i.left, y: i.top };
|
|
706
|
-
const l =
|
|
757
|
+
const l = Y();
|
|
707
758
|
return {
|
|
708
|
-
x:
|
|
759
|
+
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
709
760
|
y: l.height - 24 - n.height
|
|
710
761
|
};
|
|
711
762
|
}
|
|
712
|
-
function
|
|
713
|
-
const o =
|
|
763
|
+
function Ze(e, t, n) {
|
|
764
|
+
const o = Y(), a = D + Pn(e);
|
|
714
765
|
return {
|
|
715
|
-
x:
|
|
716
|
-
y:
|
|
766
|
+
x: K(t.x, D, Math.max(D, o.width - n.width - D)),
|
|
767
|
+
y: K(t.y, a, Math.max(a, o.height - n.height - D))
|
|
717
768
|
};
|
|
718
769
|
}
|
|
719
|
-
function
|
|
720
|
-
return
|
|
770
|
+
function Pn(e) {
|
|
771
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? bn : fn;
|
|
721
772
|
}
|
|
722
|
-
function
|
|
723
|
-
const
|
|
773
|
+
function Je(e) {
|
|
774
|
+
const t = Y(), n = Sn();
|
|
724
775
|
return {
|
|
725
|
-
x:
|
|
726
|
-
y:
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
Math.max(
|
|
776
|
+
x: K(e.x, D, Math.max(D, t.width - n.width - D)),
|
|
777
|
+
y: K(
|
|
778
|
+
e.y,
|
|
779
|
+
je,
|
|
780
|
+
Math.max(je, t.height - n.height - D)
|
|
730
781
|
)
|
|
731
782
|
};
|
|
732
783
|
}
|
|
733
|
-
function
|
|
734
|
-
if (
|
|
735
|
-
|
|
784
|
+
function re(e, t) {
|
|
785
|
+
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
786
|
+
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
736
787
|
return;
|
|
737
788
|
}
|
|
738
|
-
|
|
789
|
+
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
739
790
|
}
|
|
740
|
-
function
|
|
741
|
-
|
|
791
|
+
function An(e, t) {
|
|
792
|
+
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
742
793
|
}
|
|
743
|
-
function
|
|
744
|
-
|
|
794
|
+
function Qe(e) {
|
|
795
|
+
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
745
796
|
}
|
|
746
|
-
function
|
|
797
|
+
function Y() {
|
|
747
798
|
return {
|
|
748
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
749
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
799
|
+
width: window.innerWidth || document.documentElement.clientWidth || ft + D * 2,
|
|
800
|
+
height: window.innerHeight || document.documentElement.clientHeight || bt + D * 2
|
|
750
801
|
};
|
|
751
802
|
}
|
|
752
|
-
function
|
|
753
|
-
const
|
|
803
|
+
function _e(e) {
|
|
804
|
+
const t = e.getBoundingClientRect();
|
|
754
805
|
return {
|
|
755
|
-
x: Math.round(
|
|
756
|
-
y: Math.round(
|
|
757
|
-
width: Math.round(
|
|
758
|
-
height: Math.round(
|
|
806
|
+
x: Math.round(t.x),
|
|
807
|
+
y: Math.round(t.y),
|
|
808
|
+
width: Math.round(t.width),
|
|
809
|
+
height: Math.round(t.height)
|
|
759
810
|
};
|
|
760
811
|
}
|
|
761
|
-
function
|
|
762
|
-
return Math.min(Math.max(
|
|
812
|
+
function K(e, t, n) {
|
|
813
|
+
return Math.min(Math.max(e, t), n);
|
|
763
814
|
}
|
|
764
|
-
function
|
|
815
|
+
function U(e, t, n) {
|
|
765
816
|
if (typeof window > "u")
|
|
766
817
|
return;
|
|
767
818
|
const o = window, a = {
|
|
768
819
|
at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
769
|
-
source:
|
|
770
|
-
message:
|
|
820
|
+
source: e,
|
|
821
|
+
message: t,
|
|
771
822
|
details: n
|
|
772
823
|
}, i = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
773
|
-
i.push(a), i.length > 120 && i.splice(0, i.length - 120), o.__plunoProductAgentDiagnostics__ = i, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...i], window.dispatchEvent(new CustomEvent(
|
|
824
|
+
i.push(a), i.length > 120 && i.splice(0, i.length - 120), o.__plunoProductAgentDiagnostics__ = i, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...i], window.dispatchEvent(new CustomEvent(on, { detail: a }));
|
|
774
825
|
}
|
|
775
|
-
function
|
|
776
|
-
|
|
826
|
+
function Nn(e, t) {
|
|
827
|
+
U("web-sdk.widget.position", e, t);
|
|
777
828
|
}
|
|
778
|
-
function
|
|
779
|
-
const o =
|
|
780
|
-
return !o && n.length === 0 ? n : (
|
|
829
|
+
function xe(e, t, n) {
|
|
830
|
+
const o = t.value.trim();
|
|
831
|
+
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, { attachments: n.length > 0 ? n : void 0 }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
781
832
|
}
|
|
782
|
-
function
|
|
783
|
-
|
|
784
|
-
const
|
|
785
|
-
|
|
833
|
+
function ee(e) {
|
|
834
|
+
e.style.height = "0px";
|
|
835
|
+
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
836
|
+
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
786
837
|
}
|
|
787
|
-
function
|
|
788
|
-
|
|
838
|
+
function Dn(e, t, n, o) {
|
|
839
|
+
e.appendChild(On()), e.appendChild(Tn(t, n, o)), e.appendChild(xt("pluno-pa-widget__close", "Close", Bn(16), !0)), e.appendChild(In(n));
|
|
789
840
|
}
|
|
790
|
-
function
|
|
841
|
+
function Tn(e, t, n) {
|
|
791
842
|
const o = document.createElement("form");
|
|
792
843
|
if (o.className = "pluno-pa-widget__launcher", n) {
|
|
793
844
|
const i = document.createElement("button");
|
|
794
845
|
i.type = "button", i.className = "pluno-pa-widget__launcher-drag-handle", i.setAttribute("aria-label", "Move Pluno launcher"), i.title = "Move Pluno launcher", o.appendChild(i);
|
|
795
846
|
}
|
|
796
|
-
o.appendChild(
|
|
847
|
+
o.appendChild(_t("pluno-pa-widget__character--launcher", t));
|
|
797
848
|
const a = document.createElement("input");
|
|
798
|
-
return a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder =
|
|
849
|
+
return a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = e, a.setAttribute("aria-label", e), o.appendChild(a), o;
|
|
799
850
|
}
|
|
800
|
-
function
|
|
801
|
-
const
|
|
802
|
-
|
|
851
|
+
function In(e) {
|
|
852
|
+
const t = document.createElement("section");
|
|
853
|
+
t.className = "pluno-pa-widget__panel", t.hidden = !0;
|
|
803
854
|
const n = document.createElement("div");
|
|
804
855
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
805
856
|
const o = document.createElement("main");
|
|
806
|
-
return o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
857
|
+
return o.className = "pluno-pa-widget__timeline", o.appendChild(Mn(e)), n.appendChild(o), n.appendChild(xt("pluno-pa-widget__new-chat", "New chat", Fn(), !0)), t.appendChild(n), t.appendChild(Rn()), t;
|
|
807
858
|
}
|
|
808
|
-
function
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
const
|
|
812
|
-
|
|
859
|
+
function Rn() {
|
|
860
|
+
const e = document.createElement("form");
|
|
861
|
+
e.className = "pluno-pa-widget__composer";
|
|
862
|
+
const t = document.createElement("div");
|
|
863
|
+
t.className = "pluno-pa-widget__billing-status", t.hidden = !0, e.appendChild(t);
|
|
813
864
|
const n = document.createElement("div");
|
|
814
|
-
n.className = "pluno-pa-
|
|
865
|
+
n.className = "pluno-pa-widget__attachment-error", n.hidden = !0, e.appendChild(n);
|
|
815
866
|
const o = document.createElement("div");
|
|
816
|
-
o.className = "pluno-pa-
|
|
817
|
-
const a = document.createElement("
|
|
818
|
-
a.className = "pluno-pa-
|
|
819
|
-
const i = document.createElement("
|
|
820
|
-
i.
|
|
821
|
-
const l = document.createElement("
|
|
822
|
-
l.className = "pluno-pa-
|
|
823
|
-
const p = document.createElement("
|
|
824
|
-
p.className = "pluno-pa-
|
|
825
|
-
const s = document.createElement("
|
|
826
|
-
s.className = "pluno-pa-
|
|
827
|
-
const
|
|
828
|
-
return
|
|
829
|
-
}
|
|
830
|
-
function hn(t) {
|
|
831
|
-
const e = document.createElement("div");
|
|
832
|
-
return e.className = "pluno-pa-widget__empty-state", e.appendChild(rt("pluno-pa-widget__character--empty", t)), e.appendChild(it()), e;
|
|
867
|
+
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
868
|
+
const a = document.createElement("div");
|
|
869
|
+
a.className = "pluno-pa-widget__composer-inner";
|
|
870
|
+
const i = document.createElement("textarea");
|
|
871
|
+
i.className = "pluno-pa-widget__input", i.rows = 1, i.placeholder = "Ask for anything...", a.appendChild(i);
|
|
872
|
+
const l = document.createElement("button");
|
|
873
|
+
l.type = "button", l.className = "pluno-pa-widget__send", l.setAttribute("aria-label", "Send"), l.appendChild(vt()), a.appendChild(l), e.appendChild(a);
|
|
874
|
+
const p = document.createElement("div");
|
|
875
|
+
p.className = "pluno-pa-widget__composer-meta";
|
|
876
|
+
const s = document.createElement("a");
|
|
877
|
+
s.className = "pluno-pa-widget__powered-by", s.href = "https://pluno.ai", s.target = "_blank", s.rel = "noopener noreferrer", s.textContent = "Powered by Pluno.ai.", p.appendChild(s);
|
|
878
|
+
const g = document.createElement("span");
|
|
879
|
+
return g.className = "pluno-pa-widget__ai-disclaimer", g.textContent = "AI can make mistakes. Verify outputs.", p.appendChild(g), e.appendChild(p), e;
|
|
833
880
|
}
|
|
834
|
-
function
|
|
881
|
+
function Mn(e) {
|
|
835
882
|
const t = document.createElement("div");
|
|
836
|
-
return t.className = "pluno-pa-widget__empty", t.appendChild(
|
|
883
|
+
return t.className = "pluno-pa-widget__empty-state", t.appendChild(_t("pluno-pa-widget__character--empty", e)), t.appendChild(wt()), t;
|
|
837
884
|
}
|
|
838
|
-
function
|
|
885
|
+
function wt() {
|
|
886
|
+
const e = document.createElement("div");
|
|
887
|
+
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;
|
|
888
|
+
}
|
|
889
|
+
function _t(e, t) {
|
|
839
890
|
const n = document.createElement("img");
|
|
840
|
-
return n.className = `pluno-pa-widget__character ${
|
|
891
|
+
return n.className = `pluno-pa-widget__character ${e}`, n.src = t, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
|
|
841
892
|
}
|
|
842
|
-
function
|
|
893
|
+
function xt(e, t, n, o) {
|
|
843
894
|
const a = document.createElement("button");
|
|
844
|
-
return a.type = "button", a.className =
|
|
895
|
+
return a.type = "button", a.className = e, a.setAttribute("aria-label", t), a.title = t, a.hidden = o, a.appendChild(n), a;
|
|
845
896
|
}
|
|
846
|
-
function
|
|
847
|
-
const
|
|
897
|
+
function On() {
|
|
898
|
+
const e = S("svg", {
|
|
848
899
|
class: "pluno-pa-widget__scribble-defs",
|
|
849
900
|
"aria-hidden": "true",
|
|
850
901
|
focusable: "false",
|
|
851
902
|
width: "0",
|
|
852
903
|
height: "0"
|
|
853
|
-
}),
|
|
854
|
-
return
|
|
904
|
+
}), t = S("defs");
|
|
905
|
+
return t.appendChild(ve("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(ve("pluno-pa-scribble-wobble-2", "5", "15")), t.appendChild(ve("pluno-pa-scribble-wobble-3", "9", "19")), e.appendChild(t), e;
|
|
855
906
|
}
|
|
856
|
-
function
|
|
857
|
-
const o = S("filter", { id:
|
|
907
|
+
function ve(e, t, n) {
|
|
908
|
+
const o = S("filter", { id: e, x: "-8%", y: "-8%", width: "116%", height: "116%" });
|
|
858
909
|
return o.appendChild(
|
|
859
910
|
S("feTurbulence", {
|
|
860
911
|
type: "fractalNoise",
|
|
861
912
|
baseFrequency: "0.012 0.028",
|
|
862
913
|
numOctaves: "3",
|
|
863
|
-
seed:
|
|
914
|
+
seed: t,
|
|
864
915
|
result: "stroke-noise"
|
|
865
916
|
})
|
|
866
917
|
), o.appendChild(
|
|
@@ -890,302 +941,362 @@ function me(t, e, n) {
|
|
|
890
941
|
})
|
|
891
942
|
), o;
|
|
892
943
|
}
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
return
|
|
944
|
+
function Bn(e) {
|
|
945
|
+
const t = X("0 0 24 24", e, e, "none", "currentColor", "2.25");
|
|
946
|
+
return t.appendChild(S("path", { d: "m6 9 6 6 6-6" })), t;
|
|
896
947
|
}
|
|
897
|
-
function
|
|
898
|
-
const
|
|
899
|
-
return
|
|
948
|
+
function Fn() {
|
|
949
|
+
const e = X("0 0 24 24", 17, 17, "none", "currentColor", "2.25");
|
|
950
|
+
return e.appendChild(S("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" })), e.appendChild(S("path", { d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z" })), e;
|
|
900
951
|
}
|
|
901
|
-
function
|
|
902
|
-
const
|
|
903
|
-
return
|
|
952
|
+
function vt() {
|
|
953
|
+
const e = X("0 0 24 24", 14, 14, "none", "currentColor", "2.75");
|
|
954
|
+
return e.appendChild(S("line", { x1: "12", y1: "19", x2: "12", y2: "5" })), e.appendChild(S("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
904
955
|
}
|
|
905
|
-
function
|
|
906
|
-
const
|
|
907
|
-
return
|
|
956
|
+
function zn() {
|
|
957
|
+
const e = X("0 0 24 24", 18, 18, "currentColor");
|
|
958
|
+
return e.appendChild(S("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" })), e;
|
|
908
959
|
}
|
|
909
|
-
function
|
|
910
|
-
const
|
|
911
|
-
return
|
|
960
|
+
function Gn() {
|
|
961
|
+
const e = X("0 0 24 24", 12, 12, "none", "currentColor", "2.4");
|
|
962
|
+
return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
|
|
912
963
|
}
|
|
913
|
-
function
|
|
914
|
-
const
|
|
915
|
-
return
|
|
964
|
+
function Un() {
|
|
965
|
+
const e = X("0 0 24 24", 13, 13, "none", "currentColor", "2.25");
|
|
966
|
+
return e.appendChild(S("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" })), e.appendChild(S("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), e;
|
|
916
967
|
}
|
|
917
|
-
function
|
|
968
|
+
function X(e, t, n, o, a, i) {
|
|
918
969
|
const l = {
|
|
919
|
-
viewBox:
|
|
920
|
-
width: String(
|
|
970
|
+
viewBox: e,
|
|
971
|
+
width: String(t),
|
|
921
972
|
height: String(n),
|
|
922
973
|
fill: o,
|
|
923
974
|
"aria-hidden": "true"
|
|
924
975
|
};
|
|
925
976
|
return a && (l.stroke = a, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), i && (l["stroke-width"] = i), S("svg", l);
|
|
926
977
|
}
|
|
927
|
-
function S(
|
|
928
|
-
const n = document.createElementNS(
|
|
929
|
-
for (const [o, a] of Object.entries(
|
|
978
|
+
function S(e, t = {}) {
|
|
979
|
+
const n = document.createElementNS(mn, e);
|
|
980
|
+
for (const [o, a] of Object.entries(t))
|
|
930
981
|
n.setAttribute(o, a);
|
|
931
982
|
return n;
|
|
932
983
|
}
|
|
933
|
-
function
|
|
934
|
-
for (const
|
|
935
|
-
|
|
984
|
+
function et(e) {
|
|
985
|
+
for (const t of ["keydown", "keypress", "keyup"])
|
|
986
|
+
e.addEventListener(t, (n) => {
|
|
936
987
|
n.stopPropagation();
|
|
937
988
|
});
|
|
938
989
|
}
|
|
939
|
-
function
|
|
940
|
-
|
|
941
|
-
for (const [o, a] of
|
|
990
|
+
function $n(e, t, n) {
|
|
991
|
+
e.replaceChildren(), e.hidden = t.length === 0;
|
|
992
|
+
for (const [o, a] of t.entries()) {
|
|
942
993
|
const i = document.createElement("div");
|
|
943
|
-
i.className = "pluno-pa-widget__attachment", i.appendChild(
|
|
994
|
+
i.className = "pluno-pa-widget__attachment", i.appendChild(Wn(a));
|
|
944
995
|
const l = document.createElement("span");
|
|
945
996
|
l.textContent = a.name, i.appendChild(l);
|
|
946
997
|
const p = document.createElement("button");
|
|
947
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${a.name}`), p.appendChild(
|
|
998
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${a.name}`), p.appendChild(Gn()), p.addEventListener("click", () => n(o)), i.appendChild(p), e.appendChild(i);
|
|
948
999
|
}
|
|
949
1000
|
}
|
|
950
|
-
function
|
|
951
|
-
if (
|
|
1001
|
+
function Wn(e) {
|
|
1002
|
+
if (yt(e)) {
|
|
952
1003
|
const n = document.createElement("img");
|
|
953
|
-
return n.src =
|
|
1004
|
+
return n.src = e.dataUrl, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
|
|
954
1005
|
}
|
|
955
|
-
const
|
|
956
|
-
return
|
|
1006
|
+
const t = document.createElement("span");
|
|
1007
|
+
return t.className = "pluno-pa-widget__attachment-file", t.textContent = "PDF", t;
|
|
957
1008
|
}
|
|
958
|
-
function
|
|
959
|
-
if (
|
|
1009
|
+
function Hn(e) {
|
|
1010
|
+
if (yt(e)) {
|
|
960
1011
|
const a = document.createElement("img");
|
|
961
|
-
return a.src =
|
|
1012
|
+
return a.src = e.dataUrl, a.alt = e.name, a;
|
|
962
1013
|
}
|
|
963
|
-
const
|
|
964
|
-
|
|
1014
|
+
const t = document.createElement("div");
|
|
1015
|
+
t.className = "pluno-pa-widget__message-attachment-file";
|
|
965
1016
|
const n = document.createElement("span");
|
|
966
1017
|
n.textContent = "PDF";
|
|
967
1018
|
const o = document.createElement("strong");
|
|
968
|
-
return o.textContent =
|
|
1019
|
+
return o.textContent = e.name, t.append(n, o), t;
|
|
969
1020
|
}
|
|
970
|
-
function
|
|
971
|
-
return
|
|
1021
|
+
function yt(e) {
|
|
1022
|
+
return e.mimeType.startsWith("image/");
|
|
972
1023
|
}
|
|
973
|
-
function
|
|
974
|
-
return
|
|
1024
|
+
function Vn(e) {
|
|
1025
|
+
return e === "application/pdf" ? "document.pdf" : "image";
|
|
975
1026
|
}
|
|
976
|
-
async function
|
|
977
|
-
if (!
|
|
1027
|
+
async function qn(e) {
|
|
1028
|
+
if (!e)
|
|
978
1029
|
return [];
|
|
979
|
-
const
|
|
980
|
-
if (
|
|
981
|
-
throw new Error(`Attach up to ${
|
|
1030
|
+
const t = Array.from(e);
|
|
1031
|
+
if (t.length > de)
|
|
1032
|
+
throw new Error(`Attach up to ${de} files per message.`);
|
|
982
1033
|
return Promise.all(
|
|
983
|
-
|
|
984
|
-
const o =
|
|
1034
|
+
t.map(async (n) => {
|
|
1035
|
+
const o = jn(n);
|
|
985
1036
|
if (!o)
|
|
986
1037
|
throw new Error("Pluno supports PNG, JPEG, WebP, non-animated GIF, and PDF files.");
|
|
987
|
-
if (n.size >
|
|
1038
|
+
if (n.size > an)
|
|
988
1039
|
throw new Error("Each Pluno attachment can be up to 10 MB.");
|
|
989
1040
|
if (o === "image/gif") {
|
|
990
|
-
const a = new Uint8Array(await
|
|
991
|
-
if (
|
|
1041
|
+
const a = new Uint8Array(await no(n));
|
|
1042
|
+
if (Yn(a))
|
|
992
1043
|
throw new Error("Pluno supports non-animated GIF images.");
|
|
993
1044
|
}
|
|
994
1045
|
return {
|
|
995
|
-
name: n.name ||
|
|
1046
|
+
name: n.name || Vn(o),
|
|
996
1047
|
mimeType: o,
|
|
997
1048
|
sizeBytes: n.size,
|
|
998
|
-
dataUrl:
|
|
1049
|
+
dataUrl: Kn(await oo(n), o)
|
|
999
1050
|
};
|
|
1000
1051
|
})
|
|
1001
1052
|
);
|
|
1002
1053
|
}
|
|
1003
|
-
function
|
|
1004
|
-
if (
|
|
1005
|
-
return
|
|
1006
|
-
const
|
|
1007
|
-
return
|
|
1054
|
+
function jn(e) {
|
|
1055
|
+
if (rn.has(e.type))
|
|
1056
|
+
return e.type;
|
|
1057
|
+
const t = e.name.toLowerCase();
|
|
1058
|
+
return t.endsWith(".png") ? "image/png" : t.endsWith(".jpg") || t.endsWith(".jpeg") ? "image/jpeg" : t.endsWith(".webp") ? "image/webp" : t.endsWith(".gif") ? "image/gif" : t.endsWith(".pdf") ? "application/pdf" : null;
|
|
1008
1059
|
}
|
|
1009
|
-
function
|
|
1010
|
-
const n = `data:${
|
|
1011
|
-
return
|
|
1060
|
+
function Kn(e, t) {
|
|
1061
|
+
const n = `data:${t};base64,`;
|
|
1062
|
+
return e.startsWith(n) ? e : e.replace(/^data:[^;]*;base64,/, n);
|
|
1012
1063
|
}
|
|
1013
|
-
function
|
|
1014
|
-
if (
|
|
1064
|
+
function Yn(e) {
|
|
1065
|
+
if (e.length < 14 || !Xn(e))
|
|
1015
1066
|
return !1;
|
|
1016
|
-
const
|
|
1067
|
+
const t = e[10];
|
|
1017
1068
|
let n = 13;
|
|
1018
|
-
|
|
1069
|
+
t & 128 && (n += 3 * 2 ** ((t & 7) + 1));
|
|
1019
1070
|
let o = 0;
|
|
1020
|
-
for (; n <
|
|
1021
|
-
const a =
|
|
1071
|
+
for (; n < e.length; ) {
|
|
1072
|
+
const a = e[n];
|
|
1022
1073
|
if (n += 1, a === 59)
|
|
1023
1074
|
return !1;
|
|
1024
1075
|
if (a === 33) {
|
|
1025
|
-
n += 1, n =
|
|
1076
|
+
n += 1, n = tt(e, n);
|
|
1026
1077
|
continue;
|
|
1027
1078
|
}
|
|
1028
1079
|
if (a !== 44)
|
|
1029
1080
|
return !1;
|
|
1030
1081
|
if (o += 1, o > 1)
|
|
1031
1082
|
return !0;
|
|
1032
|
-
if (n + 9 >=
|
|
1083
|
+
if (n + 9 >= e.length)
|
|
1033
1084
|
return !1;
|
|
1034
|
-
const i =
|
|
1035
|
-
if (n += 9, i & 128 && (n += 3 * 2 ** ((i & 7) + 1)), n >=
|
|
1085
|
+
const i = e[n + 8];
|
|
1086
|
+
if (n += 9, i & 128 && (n += 3 * 2 ** ((i & 7) + 1)), n >= e.length)
|
|
1036
1087
|
return !1;
|
|
1037
|
-
n += 1, n =
|
|
1088
|
+
n += 1, n = tt(e, n);
|
|
1038
1089
|
}
|
|
1039
1090
|
return !1;
|
|
1040
1091
|
}
|
|
1041
|
-
function
|
|
1042
|
-
return
|
|
1092
|
+
function Xn(e) {
|
|
1093
|
+
return e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97;
|
|
1043
1094
|
}
|
|
1044
|
-
function
|
|
1045
|
-
for (;
|
|
1046
|
-
const n = t
|
|
1047
|
-
if (
|
|
1048
|
-
return
|
|
1049
|
-
|
|
1095
|
+
function tt(e, t) {
|
|
1096
|
+
for (; t < e.length; ) {
|
|
1097
|
+
const n = e[t];
|
|
1098
|
+
if (t += 1, n === 0)
|
|
1099
|
+
return t;
|
|
1100
|
+
t += n;
|
|
1050
1101
|
}
|
|
1051
|
-
return
|
|
1102
|
+
return t;
|
|
1103
|
+
}
|
|
1104
|
+
function le(e) {
|
|
1105
|
+
return !!(e && Array.from(e.types).includes("Files"));
|
|
1106
|
+
}
|
|
1107
|
+
function ye(e, t, n = null) {
|
|
1108
|
+
if (!e || !Se(t, n)) {
|
|
1109
|
+
e && (e.hidden = !0, e.replaceChildren());
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", F(t) || Ae(n) ? e.appendChild(Zn(t, n)) : Ct(t) && e.appendChild(Jn(t));
|
|
1113
|
+
}
|
|
1114
|
+
function Zn(e, t) {
|
|
1115
|
+
const n = document.createElement("div");
|
|
1116
|
+
n.className = "pluno-pa-widget__billing-action-card";
|
|
1117
|
+
const o = e.limitExceeded || t === "limit_exceeded", a = document.createElement("strong");
|
|
1118
|
+
a.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(a);
|
|
1119
|
+
const i = document.createElement("span");
|
|
1120
|
+
return i.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(i), n.appendChild(Et(e, "Upgrade plan", "pluno-pa-widget__billing-action-card-actions")), n;
|
|
1121
|
+
}
|
|
1122
|
+
function Jn(e) {
|
|
1123
|
+
const t = document.createElement("div");
|
|
1124
|
+
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
1125
|
+
const n = document.createElement("strong");
|
|
1126
|
+
n.textContent = "Credits running low", t.appendChild(n);
|
|
1127
|
+
const o = document.createElement("span");
|
|
1128
|
+
return o.textContent = eo(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(Et(e, "Upgrade", "pluno-pa-widget__billing-action-card-actions")), t;
|
|
1129
|
+
}
|
|
1130
|
+
function Se(e, t) {
|
|
1131
|
+
return e !== null && (F(e) || Ct(e) || Ae(t));
|
|
1132
|
+
}
|
|
1133
|
+
function nt(e, t, n) {
|
|
1134
|
+
return Se(t, n) || Qn(t) ? !0 : !Se(e, n);
|
|
1135
|
+
}
|
|
1136
|
+
function Qn(e) {
|
|
1137
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || F(e));
|
|
1052
1138
|
}
|
|
1053
|
-
function
|
|
1054
|
-
return
|
|
1139
|
+
function F(e) {
|
|
1140
|
+
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
1055
1141
|
}
|
|
1056
|
-
function
|
|
1057
|
-
return
|
|
1142
|
+
function Ae(e) {
|
|
1143
|
+
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
1144
|
+
}
|
|
1145
|
+
function Ct(e) {
|
|
1146
|
+
return !F(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
1147
|
+
}
|
|
1148
|
+
function eo(e) {
|
|
1149
|
+
return e.creditsRemaining === null ? null : `${to(e.creditsRemaining)} credits left`;
|
|
1150
|
+
}
|
|
1151
|
+
function to(e) {
|
|
1152
|
+
return new Intl.NumberFormat("en-US", {
|
|
1153
|
+
maximumFractionDigits: 0
|
|
1154
|
+
}).format(Math.ceil(e));
|
|
1155
|
+
}
|
|
1156
|
+
function Et(e, t, n) {
|
|
1157
|
+
const o = document.createElement("div");
|
|
1158
|
+
return o.className = n, o.appendChild(ot(t, e.pricingUrl)), o.appendChild(ot("Earn credits", e.earnCreditsUrl)), o;
|
|
1159
|
+
}
|
|
1160
|
+
function ot(e, t) {
|
|
1161
|
+
const n = document.createElement("button");
|
|
1162
|
+
return n.type = "button", n.textContent = e, n.disabled = t.trim().length === 0, n.addEventListener("click", () => {
|
|
1163
|
+
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
1164
|
+
}), n;
|
|
1165
|
+
}
|
|
1166
|
+
function no(e) {
|
|
1167
|
+
return new Promise((t, n) => {
|
|
1058
1168
|
const o = new FileReader();
|
|
1059
1169
|
o.addEventListener("load", () => {
|
|
1060
1170
|
if (o.result instanceof ArrayBuffer) {
|
|
1061
|
-
|
|
1171
|
+
t(o.result);
|
|
1062
1172
|
return;
|
|
1063
1173
|
}
|
|
1064
1174
|
n(new Error("Failed to read file"));
|
|
1065
1175
|
}), o.addEventListener("error", () => {
|
|
1066
1176
|
n(o.error ?? new Error("Failed to read file"));
|
|
1067
|
-
}), o.readAsArrayBuffer(
|
|
1177
|
+
}), o.readAsArrayBuffer(e);
|
|
1068
1178
|
});
|
|
1069
1179
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return new Promise((
|
|
1180
|
+
function oo(e) {
|
|
1181
|
+
return new Promise((t, n) => {
|
|
1072
1182
|
const o = new FileReader();
|
|
1073
1183
|
o.addEventListener("load", () => {
|
|
1074
1184
|
if (typeof o.result == "string") {
|
|
1075
|
-
|
|
1185
|
+
t(o.result);
|
|
1076
1186
|
return;
|
|
1077
1187
|
}
|
|
1078
1188
|
n(new Error("Failed to read file"));
|
|
1079
1189
|
}), o.addEventListener("error", () => {
|
|
1080
1190
|
n(o.error ?? new Error("Failed to read file"));
|
|
1081
|
-
}), o.readAsDataURL(
|
|
1191
|
+
}), o.readAsDataURL(e);
|
|
1082
1192
|
});
|
|
1083
1193
|
}
|
|
1084
|
-
function
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
if (n.hidden = !
|
|
1089
|
-
const
|
|
1090
|
-
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
for (const
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
p(
|
|
1099
|
-
}),
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1194
|
+
function ao(e, t, n, o, a, i, l, p, s) {
|
|
1195
|
+
const g = [...o.messages], c = g.filter((m) => !ho(m));
|
|
1196
|
+
e.replaceChildren(), St(t, o.isThinking);
|
|
1197
|
+
const b = c.length > 0 || !!o.assistantDraft || o.isThinking;
|
|
1198
|
+
if (n.hidden = !b, c.length === 0 && !o.assistantDraft && !o.lastError && !o.isThinking) {
|
|
1199
|
+
const m = document.createElement("div");
|
|
1200
|
+
m.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
1201
|
+
const _ = document.createElement("img");
|
|
1202
|
+
_.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", _.src = l(), _.alt = "", _.setAttribute("aria-hidden", "true"), m.appendChild(_), m.appendChild(wt());
|
|
1203
|
+
const k = document.createElement("div");
|
|
1204
|
+
k.className = o.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", o.starterPrompts.length === 0 && k.setAttribute("aria-hidden", "true");
|
|
1205
|
+
for (const v of o.starterPrompts) {
|
|
1206
|
+
const y = document.createElement("button");
|
|
1207
|
+
y.type = "button", y.className = "pluno-pa-widget__starter-prompt", y.textContent = `"${v}"`, y.addEventListener("click", () => {
|
|
1208
|
+
p(v);
|
|
1209
|
+
}), k.appendChild(y);
|
|
1210
|
+
}
|
|
1211
|
+
m.appendChild(k), e.appendChild(m);
|
|
1102
1212
|
return;
|
|
1103
1213
|
}
|
|
1104
|
-
let w = null,
|
|
1105
|
-
const
|
|
1106
|
-
if (
|
|
1214
|
+
let w = null, x = null, C = [];
|
|
1215
|
+
const h = () => {
|
|
1216
|
+
if (C.length === 0)
|
|
1107
1217
|
return !1;
|
|
1108
|
-
const
|
|
1109
|
-
return
|
|
1218
|
+
const m = mo(C, a, i, l());
|
|
1219
|
+
return e.appendChild(m), w = null, x = m, C = [], !0;
|
|
1110
1220
|
};
|
|
1111
|
-
for (let
|
|
1112
|
-
const
|
|
1113
|
-
if (
|
|
1114
|
-
|
|
1221
|
+
for (let m = 0; m < c.length; m += 1) {
|
|
1222
|
+
const _ = c[m];
|
|
1223
|
+
if (_.role === "tool") {
|
|
1224
|
+
C.push(_);
|
|
1115
1225
|
continue;
|
|
1116
1226
|
}
|
|
1117
|
-
if (
|
|
1227
|
+
if (_.role === "system")
|
|
1118
1228
|
continue;
|
|
1119
|
-
const
|
|
1120
|
-
if (
|
|
1121
|
-
const
|
|
1122
|
-
|
|
1123
|
-
}
|
|
1124
|
-
const
|
|
1125
|
-
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1229
|
+
const k = h(), v = it(_.content);
|
|
1230
|
+
if (_.role === "assistant" && !k) {
|
|
1231
|
+
const ne = Le(l());
|
|
1232
|
+
e.appendChild(ne), w = null, x = ne;
|
|
1233
|
+
}
|
|
1234
|
+
const y = document.createElement("div");
|
|
1235
|
+
y.className = `pluno-pa-widget__message pluno-pa-widget__message--${_.role}`, _.role === "assistant" ? rt(y, v) : y.textContent = v, _.role === "user" && _.attachments?.length && y.appendChild(ro(_.attachments));
|
|
1236
|
+
const T = document.createElement("div");
|
|
1237
|
+
T.className = "pluno-pa-widget__message-actions", T.appendChild(at(v)), y.appendChild(T), e.appendChild(y), w = y, x = null;
|
|
1128
1238
|
}
|
|
1129
|
-
const
|
|
1239
|
+
const f = h();
|
|
1130
1240
|
if (o.assistantDraft) {
|
|
1131
|
-
if (!
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1134
|
-
}
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1137
|
-
const
|
|
1138
|
-
|
|
1241
|
+
if (!f) {
|
|
1242
|
+
const v = Le(l());
|
|
1243
|
+
e.appendChild(v), w = null, x = v;
|
|
1244
|
+
}
|
|
1245
|
+
const m = it(o.assistantDraft), _ = document.createElement("div");
|
|
1246
|
+
_.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", rt(_, m);
|
|
1247
|
+
const k = document.createElement("div");
|
|
1248
|
+
k.className = "pluno-pa-widget__message-actions", k.appendChild(at(m)), _.appendChild(k), e.appendChild(_), w = _, x = null;
|
|
1139
1249
|
}
|
|
1140
1250
|
if (o.isThinking && !o.assistantDraft)
|
|
1141
|
-
if (
|
|
1142
|
-
const
|
|
1143
|
-
|
|
1251
|
+
if (f) {
|
|
1252
|
+
const m = kt();
|
|
1253
|
+
e.appendChild(m), w = null, x = m;
|
|
1144
1254
|
} else {
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1255
|
+
const m = fo(l());
|
|
1256
|
+
e.appendChild(m), w = null, x = m;
|
|
1147
1257
|
}
|
|
1148
1258
|
if (o.lastError) {
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1259
|
+
const m = document.createElement("div");
|
|
1260
|
+
m.className = "pluno-pa-widget__error", m.textContent = o.lastError, e.appendChild(m), w = m, x = null;
|
|
1151
1261
|
}
|
|
1152
|
-
const
|
|
1153
|
-
if (s &&
|
|
1154
|
-
const
|
|
1155
|
-
isDrafting: s.draftingCandidateId ===
|
|
1262
|
+
const u = s && !o.isThinking ? jt(g) : null;
|
|
1263
|
+
if (s && u && !s.dismissedCandidateIds.has(u.id)) {
|
|
1264
|
+
const m = lo(u, {
|
|
1265
|
+
isDrafting: s.draftingCandidateId === u.id,
|
|
1156
1266
|
error: s.error,
|
|
1157
1267
|
onDraft: s.onDraft,
|
|
1158
|
-
onDismiss: s.onDismiss
|
|
1268
|
+
onDismiss: s.onDismiss,
|
|
1269
|
+
onDisable: s.onDisable
|
|
1159
1270
|
});
|
|
1160
|
-
|
|
1271
|
+
e.appendChild(m), s.onSeen(u), w = null, x = m;
|
|
1161
1272
|
}
|
|
1162
|
-
w?.classList.add("pluno-pa-widget__message--bottom-reserve"),
|
|
1273
|
+
w?.classList.add("pluno-pa-widget__message--bottom-reserve"), x?.classList.add("pluno-pa-widget__bottom-reserve-compact"), e.scrollTop = e.scrollHeight;
|
|
1163
1274
|
}
|
|
1164
|
-
function
|
|
1165
|
-
|
|
1275
|
+
function io(e, t, n, o, a, i) {
|
|
1276
|
+
e.replaceChildren(), St(t, !1), t.disabled = !0, n.hidden = !0;
|
|
1166
1277
|
const l = document.createElement("div");
|
|
1167
1278
|
l.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
1168
1279
|
const p = document.createElement("img");
|
|
1169
1280
|
p.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", p.src = o(), p.alt = "", p.setAttribute("aria-hidden", "true"), l.appendChild(p);
|
|
1170
1281
|
const s = document.createElement("div");
|
|
1171
1282
|
s.className = "pluno-pa-widget__empty", s.textContent = "Log in to use Pluno on this page.", l.appendChild(s);
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1283
|
+
const g = document.createElement("button");
|
|
1284
|
+
g.type = "button", g.className = "pluno-pa-widget__login", g.textContent = a, g.addEventListener("click", () => i?.()), l.appendChild(g), e.appendChild(l);
|
|
1174
1285
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
for (const n of
|
|
1179
|
-
|
|
1180
|
-
return
|
|
1181
|
-
}
|
|
1182
|
-
function
|
|
1183
|
-
const
|
|
1184
|
-
return
|
|
1185
|
-
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(
|
|
1186
|
-
}),
|
|
1187
|
-
}
|
|
1188
|
-
function
|
|
1286
|
+
function ro(e) {
|
|
1287
|
+
const t = document.createElement("div");
|
|
1288
|
+
t.className = "pluno-pa-widget__message-attachments";
|
|
1289
|
+
for (const n of e)
|
|
1290
|
+
t.appendChild(Hn(n));
|
|
1291
|
+
return t;
|
|
1292
|
+
}
|
|
1293
|
+
function at(e) {
|
|
1294
|
+
const t = document.createElement("button");
|
|
1295
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Un()), t.addEventListener("click", (n) => {
|
|
1296
|
+
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
1297
|
+
}), t;
|
|
1298
|
+
}
|
|
1299
|
+
function lo(e, t) {
|
|
1189
1300
|
const n = document.createElement("article");
|
|
1190
1301
|
n.className = "pluno-pa-widget__share-prompt";
|
|
1191
1302
|
const o = document.createElement("div");
|
|
@@ -1195,131 +1306,184 @@ function Mn(t, e) {
|
|
|
1195
1306
|
const i = document.createElement("strong");
|
|
1196
1307
|
i.textContent = "Share this win?", a.appendChild(i);
|
|
1197
1308
|
const l = document.createElement("span");
|
|
1198
|
-
if (l.textContent =
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1309
|
+
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", a.appendChild(l), t.error) {
|
|
1310
|
+
const c = document.createElement("span");
|
|
1311
|
+
c.className = "pluno-pa-widget__share-prompt-error", c.textContent = t.error, a.appendChild(c);
|
|
1201
1312
|
}
|
|
1202
1313
|
o.appendChild(a);
|
|
1203
1314
|
const p = document.createElement("div");
|
|
1204
1315
|
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
1205
|
-
const s = document.createElement("
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1316
|
+
const s = document.createElement("div");
|
|
1317
|
+
s.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
1318
|
+
const g = document.createElement("button");
|
|
1319
|
+
if (g.type = "button", g.disabled = t.isDrafting, g.addEventListener("click", () => {
|
|
1320
|
+
t.onDraft(e);
|
|
1321
|
+
}), t.isDrafting ? (g.appendChild(Pe()), g.appendChild(document.createTextNode("Drafting..."))) : g.textContent = "Draft a social post", s.appendChild(g), t.isDrafting)
|
|
1322
|
+
p.appendChild(s);
|
|
1323
|
+
else {
|
|
1324
|
+
const c = document.createElement("button");
|
|
1325
|
+
c.type = "button", c.className = "pluno-pa-widget__share-prompt-dismiss", c.setAttribute("aria-label", "Dismiss share prompt"), c.title = "Dismiss", c.textContent = "Dismiss", c.addEventListener("click", () => {
|
|
1326
|
+
t.onDismiss(e);
|
|
1327
|
+
}), s.appendChild(c), p.appendChild(s);
|
|
1328
|
+
const b = document.createElement("button");
|
|
1329
|
+
b.type = "button", b.className = "pluno-pa-widget__share-prompt-disable", b.textContent = "Don't ask again", b.addEventListener("click", () => {
|
|
1330
|
+
t.onDisable(e);
|
|
1331
|
+
}), p.appendChild(b);
|
|
1213
1332
|
}
|
|
1214
1333
|
return o.appendChild(p), n.appendChild(o), n;
|
|
1215
1334
|
}
|
|
1216
|
-
function
|
|
1335
|
+
function po(e, t) {
|
|
1217
1336
|
const n = document.createElement("div");
|
|
1218
|
-
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (
|
|
1219
|
-
|
|
1337
|
+
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (h) => {
|
|
1338
|
+
h.target === n && t.onClose();
|
|
1220
1339
|
});
|
|
1221
1340
|
const o = document.createElement("section");
|
|
1222
|
-
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft social post");
|
|
1341
|
+
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
1223
1342
|
const a = document.createElement("header"), i = document.createElement("strong");
|
|
1224
|
-
i.textContent = "
|
|
1343
|
+
i.textContent = "Share this win", a.appendChild(i);
|
|
1225
1344
|
const l = document.createElement("button");
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1345
|
+
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), a.appendChild(l), o.appendChild(a);
|
|
1346
|
+
const p = document.createElement("p");
|
|
1347
|
+
p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
|
|
1348
|
+
const s = document.createElement("div");
|
|
1349
|
+
s.className = "pluno-pa-widget__share-dialog-step";
|
|
1350
|
+
const g = document.createElement("div");
|
|
1351
|
+
g.className = "pluno-pa-widget__share-dialog-step-header";
|
|
1352
|
+
const c = document.createElement("strong");
|
|
1353
|
+
c.textContent = "1) Copy Screenshot", g.appendChild(c);
|
|
1354
|
+
const b = so("Copy Screenshot", async () => {
|
|
1355
|
+
try {
|
|
1356
|
+
return await Kt(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
|
|
1357
|
+
} catch {
|
|
1358
|
+
return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
if (g.appendChild(b), s.appendChild(g), e.screenshotDataUrl) {
|
|
1362
|
+
const h = document.createElement("div");
|
|
1363
|
+
h.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
1364
|
+
const f = document.createElement("img");
|
|
1365
|
+
f.src = e.screenshotDataUrl, f.alt = "Product page with Pluno open", h.appendChild(f), s.appendChild(h);
|
|
1229
1366
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
const o = document.createElement("button");
|
|
1251
|
-
return o.type = "button", o.textContent = t, o.addEventListener("click", () => {
|
|
1252
|
-
navigator.clipboard.writeText(e.value).then(
|
|
1253
|
-
() => {
|
|
1254
|
-
n.textContent = `${t.replace("Copy ", "")} copied.`, n.hidden = !1;
|
|
1255
|
-
},
|
|
1256
|
-
() => {
|
|
1257
|
-
n.textContent = "Copy failed.", n.hidden = !1;
|
|
1258
|
-
}
|
|
1259
|
-
);
|
|
1260
|
-
}), o;
|
|
1367
|
+
o.appendChild(s), o.appendChild(p);
|
|
1368
|
+
const w = document.createElement("div");
|
|
1369
|
+
w.className = "pluno-pa-widget__share-dialog-step";
|
|
1370
|
+
const x = document.createElement("strong");
|
|
1371
|
+
x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "2) Share on", w.appendChild(x);
|
|
1372
|
+
const C = document.createElement("footer");
|
|
1373
|
+
C.className = "pluno-pa-widget__share-dialog-platforms";
|
|
1374
|
+
for (const h of co(e)) {
|
|
1375
|
+
const f = document.createElement("a");
|
|
1376
|
+
f.href = h.href, f.target = "_blank", f.rel = "noopener noreferrer", f.title = h.label, f.setAttribute("aria-label", `Open ${h.label}`), f.appendChild(uo(h.id)), C.appendChild(f);
|
|
1377
|
+
}
|
|
1378
|
+
if (w.appendChild(C), o.appendChild(w), t.socialPostRewardsUrl) {
|
|
1379
|
+
const h = document.createElement("div");
|
|
1380
|
+
h.className = "pluno-pa-widget__share-dialog-step";
|
|
1381
|
+
const f = document.createElement("strong");
|
|
1382
|
+
f.className = "pluno-pa-widget__share-dialog-step-title", f.textContent = "3) Submit post to get 2000 free credits!", h.appendChild(f);
|
|
1383
|
+
const u = document.createElement("a");
|
|
1384
|
+
u.className = "pluno-pa-widget__share-dialog-reward-link", u.href = t.socialPostRewardsUrl, u.target = "_blank", u.rel = "noopener noreferrer", u.appendChild(document.createTextNode("Submit post URL")), u.appendChild(go()), h.appendChild(u), o.appendChild(h);
|
|
1385
|
+
}
|
|
1386
|
+
return n.appendChild(o), n;
|
|
1261
1387
|
}
|
|
1262
|
-
function
|
|
1263
|
-
|
|
1388
|
+
function so(e, t) {
|
|
1389
|
+
const n = document.createElement("button");
|
|
1390
|
+
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
1391
|
+
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
1392
|
+
}), n;
|
|
1264
1393
|
}
|
|
1265
|
-
function
|
|
1266
|
-
|
|
1394
|
+
function co(e) {
|
|
1395
|
+
const t = e.linkedinPost.trim(), n = e.xPost.trim();
|
|
1396
|
+
return [
|
|
1397
|
+
{
|
|
1398
|
+
id: "linkedin",
|
|
1399
|
+
label: "LinkedIn",
|
|
1400
|
+
href: `https://www.linkedin.com/feed/?shareActive=true&text=${encodeURIComponent(t)}`
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
id: "x",
|
|
1404
|
+
label: "X",
|
|
1405
|
+
href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(n)}`
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
id: "instagram",
|
|
1409
|
+
label: "Instagram Story",
|
|
1410
|
+
href: "https://www.instagram.com/create/story/"
|
|
1411
|
+
}
|
|
1412
|
+
];
|
|
1413
|
+
}
|
|
1414
|
+
function uo(e) {
|
|
1415
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1416
|
+
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" ? (P(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), P(t, "M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"), P(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), P(t, "M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"), P(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (P(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), P(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), P(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (P(t, "M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"), P(t, "M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1", "0.48"), P(t, "M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"), P(t, "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"), t);
|
|
1417
|
+
}
|
|
1418
|
+
function P(e, t, n) {
|
|
1419
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1420
|
+
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
1421
|
+
}
|
|
1422
|
+
function go() {
|
|
1423
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1424
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), P(e, "M14 5h5v5"), P(e, "M19 5l-8 8"), P(e, "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"), e;
|
|
1267
1425
|
}
|
|
1268
|
-
function
|
|
1426
|
+
function ho(e) {
|
|
1427
|
+
return e.role === "tool" && e.toolName === gt;
|
|
1428
|
+
}
|
|
1429
|
+
function it(e) {
|
|
1430
|
+
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
1431
|
+
}
|
|
1432
|
+
function mo(e, t, n, o) {
|
|
1269
1433
|
const a = document.createElement("article");
|
|
1270
|
-
a.className = "pluno-pa-widget__tool-group", a.title = new Date(
|
|
1434
|
+
a.className = "pluno-pa-widget__tool-group", a.title = new Date(e[e.length - 1].createdAt).toLocaleString();
|
|
1271
1435
|
const i = document.createElement("img");
|
|
1272
1436
|
i.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", i.src = o, i.alt = "", i.setAttribute("aria-hidden", "true"), a.appendChild(i);
|
|
1273
|
-
const l = document.createElement("details"), p =
|
|
1274
|
-
l.open =
|
|
1275
|
-
l.open ?
|
|
1437
|
+
const l = document.createElement("details"), p = bo(e);
|
|
1438
|
+
l.open = t.has(p), l.addEventListener("toggle", () => {
|
|
1439
|
+
l.open ? t.add(p) : t.delete(p), n();
|
|
1276
1440
|
});
|
|
1277
1441
|
const s = document.createElement("summary");
|
|
1278
|
-
s.className = "pluno-pa-widget__tool-summary",
|
|
1279
|
-
const
|
|
1280
|
-
if (
|
|
1281
|
-
const
|
|
1282
|
-
|
|
1283
|
-
for (const w of
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
}
|
|
1289
|
-
l.appendChild(
|
|
1442
|
+
s.className = "pluno-pa-widget__tool-summary", e.some((b) => b.loading) && s.appendChild(Pe());
|
|
1443
|
+
const c = document.createElement("span");
|
|
1444
|
+
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", s.appendChild(c), l.appendChild(s), e.length > 0) {
|
|
1445
|
+
const b = document.createElement("div");
|
|
1446
|
+
b.className = "pluno-pa-widget__tool-lines";
|
|
1447
|
+
for (const w of e) {
|
|
1448
|
+
const x = document.createElement("div");
|
|
1449
|
+
x.className = "pluno-pa-widget__tool-line", w.loading && x.appendChild(Pe());
|
|
1450
|
+
const C = document.createElement("span");
|
|
1451
|
+
C.textContent = w.content || "Run tool", x.appendChild(C), b.appendChild(x);
|
|
1452
|
+
}
|
|
1453
|
+
l.appendChild(b);
|
|
1290
1454
|
}
|
|
1291
1455
|
return a.appendChild(l), a;
|
|
1292
1456
|
}
|
|
1293
|
-
function
|
|
1294
|
-
const
|
|
1295
|
-
|
|
1457
|
+
function Le(e) {
|
|
1458
|
+
const t = document.createElement("article");
|
|
1459
|
+
t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker";
|
|
1296
1460
|
const n = document.createElement("img");
|
|
1297
|
-
return n.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", n.src =
|
|
1461
|
+
return n.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", n.src = e, n.alt = "", n.setAttribute("aria-hidden", "true"), t.appendChild(n), t;
|
|
1298
1462
|
}
|
|
1299
|
-
function
|
|
1300
|
-
const
|
|
1301
|
-
return
|
|
1463
|
+
function fo(e) {
|
|
1464
|
+
const t = Le(e);
|
|
1465
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(kt()), t;
|
|
1302
1466
|
}
|
|
1303
|
-
function
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
const
|
|
1307
|
-
|
|
1467
|
+
function kt() {
|
|
1468
|
+
const e = document.createElement("div");
|
|
1469
|
+
e.className = "pluno-pa-widget__status";
|
|
1470
|
+
const t = document.createElement("span");
|
|
1471
|
+
t.className = "pluno-pa-widget__thinking-dot", t.setAttribute("aria-hidden", "true"), e.appendChild(t);
|
|
1308
1472
|
const n = document.createElement("span");
|
|
1309
|
-
return n.textContent = "Thinking...",
|
|
1473
|
+
return n.textContent = "Thinking...", e.appendChild(n), e;
|
|
1310
1474
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return `tools:${
|
|
1475
|
+
function bo(e) {
|
|
1476
|
+
return `tools:${e.map((t) => t.id).join("|")}`;
|
|
1313
1477
|
}
|
|
1314
|
-
function
|
|
1315
|
-
const
|
|
1316
|
-
return
|
|
1478
|
+
function Pe() {
|
|
1479
|
+
const e = document.createElement("span");
|
|
1480
|
+
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
1317
1481
|
}
|
|
1318
|
-
function
|
|
1319
|
-
|
|
1482
|
+
function St(e, t) {
|
|
1483
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? zn() : vt());
|
|
1320
1484
|
}
|
|
1321
|
-
function
|
|
1322
|
-
const n =
|
|
1485
|
+
function rt(e, t) {
|
|
1486
|
+
const n = t.replace(/\r\n/g, `
|
|
1323
1487
|
`).split(`
|
|
1324
1488
|
`);
|
|
1325
1489
|
let o = 0;
|
|
@@ -1330,90 +1494,90 @@ function Ye(t, e) {
|
|
|
1330
1494
|
continue;
|
|
1331
1495
|
}
|
|
1332
1496
|
if (a.match(/^```(\w+)?\s*$/)) {
|
|
1333
|
-
const
|
|
1497
|
+
const g = [];
|
|
1334
1498
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
1335
|
-
|
|
1499
|
+
g.push(n[o]), o += 1;
|
|
1336
1500
|
o += o < n.length ? 1 : 0;
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1339
|
-
`),
|
|
1501
|
+
const c = document.createElement("pre"), b = document.createElement("code");
|
|
1502
|
+
b.textContent = g.join(`
|
|
1503
|
+
`), c.appendChild(b), e.appendChild(c);
|
|
1340
1504
|
continue;
|
|
1341
1505
|
}
|
|
1342
1506
|
const l = a.match(/^(#{1,3})\s+(.+)$/);
|
|
1343
1507
|
if (l) {
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1508
|
+
const g = document.createElement(`h${l[1].length + 2}`);
|
|
1509
|
+
pe(g, l[2]), e.appendChild(g), o += 1;
|
|
1346
1510
|
continue;
|
|
1347
1511
|
}
|
|
1348
1512
|
if (/^\s*[-*+]\s+/.test(a)) {
|
|
1349
|
-
const
|
|
1513
|
+
const g = document.createElement("ul");
|
|
1350
1514
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1515
|
+
const c = document.createElement("li");
|
|
1516
|
+
pe(c, n[o].replace(/^\s*[-*+]\s+/, "")), g.appendChild(c), o += 1;
|
|
1353
1517
|
}
|
|
1354
|
-
|
|
1518
|
+
e.appendChild(g);
|
|
1355
1519
|
continue;
|
|
1356
1520
|
}
|
|
1357
1521
|
if (/^\s*\d+\.\s+/.test(a)) {
|
|
1358
|
-
const
|
|
1522
|
+
const g = document.createElement("ol");
|
|
1359
1523
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1524
|
+
const c = document.createElement("li");
|
|
1525
|
+
pe(c, n[o].replace(/^\s*\d+\.\s+/, "")), g.appendChild(c), o += 1;
|
|
1362
1526
|
}
|
|
1363
|
-
|
|
1527
|
+
e.appendChild(g);
|
|
1364
1528
|
continue;
|
|
1365
1529
|
}
|
|
1366
1530
|
const p = [a];
|
|
1367
1531
|
for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
|
|
1368
1532
|
p.push(n[o]), o += 1;
|
|
1369
1533
|
const s = document.createElement("p");
|
|
1370
|
-
p.forEach((
|
|
1371
|
-
|
|
1372
|
-
}),
|
|
1534
|
+
p.forEach((g, c) => {
|
|
1535
|
+
c > 0 && s.appendChild(document.createElement("br")), pe(s, g);
|
|
1536
|
+
}), e.appendChild(s);
|
|
1373
1537
|
}
|
|
1374
1538
|
}
|
|
1375
|
-
function
|
|
1539
|
+
function pe(e, t) {
|
|
1376
1540
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
1377
1541
|
let o = 0;
|
|
1378
|
-
for (const a of
|
|
1542
|
+
for (const a of t.matchAll(n)) {
|
|
1379
1543
|
const i = a.index ?? 0;
|
|
1380
|
-
i > o &&
|
|
1544
|
+
i > o && e.appendChild(document.createTextNode(t.slice(o, i)));
|
|
1381
1545
|
const l = a[0];
|
|
1382
1546
|
if (l.startsWith("`")) {
|
|
1383
1547
|
const p = document.createElement("code");
|
|
1384
|
-
p.textContent = l.slice(1, -1),
|
|
1548
|
+
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
1385
1549
|
} else if (l.startsWith("**")) {
|
|
1386
1550
|
const p = document.createElement("strong");
|
|
1387
|
-
p.textContent = l.slice(2, -2),
|
|
1551
|
+
p.textContent = l.slice(2, -2), e.appendChild(p);
|
|
1388
1552
|
} else if (l.startsWith("*")) {
|
|
1389
1553
|
const p = document.createElement("em");
|
|
1390
|
-
p.textContent = l.slice(1, -1),
|
|
1554
|
+
p.textContent = l.slice(1, -1), e.appendChild(p);
|
|
1391
1555
|
} else {
|
|
1392
1556
|
const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
1393
|
-
if (p &&
|
|
1557
|
+
if (p && wo(p[2])) {
|
|
1394
1558
|
const s = document.createElement("a");
|
|
1395
|
-
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1],
|
|
1559
|
+
s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
|
|
1396
1560
|
} else
|
|
1397
|
-
|
|
1561
|
+
e.appendChild(document.createTextNode(l));
|
|
1398
1562
|
}
|
|
1399
1563
|
o = i + l.length;
|
|
1400
1564
|
}
|
|
1401
|
-
o <
|
|
1565
|
+
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
1402
1566
|
}
|
|
1403
|
-
function
|
|
1404
|
-
if (
|
|
1567
|
+
function wo(e) {
|
|
1568
|
+
if (e.startsWith("/") || e.startsWith("#"))
|
|
1405
1569
|
return !0;
|
|
1406
1570
|
try {
|
|
1407
|
-
const
|
|
1408
|
-
return ["http:", "https:", "mailto:"].includes(
|
|
1571
|
+
const t = new URL(e);
|
|
1572
|
+
return ["http:", "https:", "mailto:"].includes(t.protocol);
|
|
1409
1573
|
} catch {
|
|
1410
1574
|
return !1;
|
|
1411
1575
|
}
|
|
1412
1576
|
}
|
|
1413
|
-
function
|
|
1414
|
-
if (
|
|
1577
|
+
function lt(e, t) {
|
|
1578
|
+
if (e.getElementById("pluno-pa-widget-styles"))
|
|
1415
1579
|
return;
|
|
1416
|
-
const n =
|
|
1580
|
+
const n = e.ownerDocument.createElement("style");
|
|
1417
1581
|
n.id = "pluno-pa-widget-styles", n.textContent = `
|
|
1418
1582
|
:host {
|
|
1419
1583
|
all: initial;
|
|
@@ -1446,7 +1610,7 @@ function Xe(t, e) {
|
|
|
1446
1610
|
flex: 0 0 auto;
|
|
1447
1611
|
}
|
|
1448
1612
|
.pluno-pa-widget {
|
|
1449
|
-
--pluno-pa-accent: ${
|
|
1613
|
+
--pluno-pa-accent: ${t};
|
|
1450
1614
|
--pluno-pa-bg: #fafaf9;
|
|
1451
1615
|
--pluno-pa-surface: #f4f4f2;
|
|
1452
1616
|
--pluno-pa-bubble: #eeeded;
|
|
@@ -1457,15 +1621,15 @@ function Xe(t, e) {
|
|
|
1457
1621
|
--pluno-pa-launcher-hairline: rgba(24, 24, 27, 0.06);
|
|
1458
1622
|
--pluno-pa-launcher-width: min(190px, calc(100vw - 36px));
|
|
1459
1623
|
--pluno-pa-launcher-height: 41px;
|
|
1460
|
-
--pluno-pa-panel-width: min(420px, calc(100vw - 28px));
|
|
1461
|
-
--pluno-pa-panel-height: min(680px, calc(100vh - 28px));
|
|
1624
|
+
--pluno-pa-panel-width: min(clamp(420px, 24vw, 520px), calc(100vw - 28px));
|
|
1625
|
+
--pluno-pa-panel-height: min(clamp(680px, 76vh, 800px), calc(100vh - 28px));
|
|
1462
1626
|
--pluno-pa-panel-offset-x: calc(var(--pluno-pa-launcher-width) - var(--pluno-pa-panel-width));
|
|
1463
1627
|
--pluno-pa-panel-offset-y: calc(var(--pluno-pa-launcher-height) - var(--pluno-pa-panel-height));
|
|
1464
1628
|
--pluno-pa-accent-soft: rgba(24, 24, 27, 0.12);
|
|
1465
1629
|
--pluno-pa-accent-contrast: #fafafa;
|
|
1466
1630
|
position: fixed;
|
|
1467
1631
|
z-index: 2147483645;
|
|
1468
|
-
font-family: ${
|
|
1632
|
+
font-family: ${M.fontFamily};
|
|
1469
1633
|
font-size: 14px;
|
|
1470
1634
|
color: var(--pluno-pa-text);
|
|
1471
1635
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -2104,7 +2268,13 @@ function Xe(t, e) {
|
|
|
2104
2268
|
.pluno-pa-widget__share-prompt-actions {
|
|
2105
2269
|
display: flex;
|
|
2106
2270
|
align-items: center;
|
|
2107
|
-
justify-content:
|
|
2271
|
+
justify-content: space-between;
|
|
2272
|
+
gap: 6px;
|
|
2273
|
+
}
|
|
2274
|
+
.pluno-pa-widget__share-prompt-primary-actions {
|
|
2275
|
+
min-width: 0;
|
|
2276
|
+
display: flex;
|
|
2277
|
+
align-items: center;
|
|
2108
2278
|
gap: 6px;
|
|
2109
2279
|
}
|
|
2110
2280
|
.pluno-pa-widget__share-prompt-actions button {
|
|
@@ -2137,6 +2307,22 @@ function Xe(t, e) {
|
|
|
2137
2307
|
background: var(--pluno-pa-surface);
|
|
2138
2308
|
color: var(--pluno-pa-muted);
|
|
2139
2309
|
}
|
|
2310
|
+
.pluno-pa-widget__share-prompt-disable {
|
|
2311
|
+
border: 0;
|
|
2312
|
+
background: transparent;
|
|
2313
|
+
color: color-mix(in srgb, var(--pluno-pa-muted) 72%, transparent);
|
|
2314
|
+
padding: 0;
|
|
2315
|
+
font: inherit;
|
|
2316
|
+
font-size: 10px;
|
|
2317
|
+
font-weight: 500;
|
|
2318
|
+
line-height: 1.2;
|
|
2319
|
+
cursor: pointer;
|
|
2320
|
+
}
|
|
2321
|
+
.pluno-pa-widget__share-prompt-disable:hover,
|
|
2322
|
+
.pluno-pa-widget__share-prompt-disable:focus-visible {
|
|
2323
|
+
color: var(--pluno-pa-muted);
|
|
2324
|
+
text-decoration: underline;
|
|
2325
|
+
}
|
|
2140
2326
|
.pluno-pa-widget__share-dialog-backdrop {
|
|
2141
2327
|
position: fixed;
|
|
2142
2328
|
inset: 0;
|
|
@@ -2145,21 +2331,52 @@ function Xe(t, e) {
|
|
|
2145
2331
|
place-items: center;
|
|
2146
2332
|
padding: 18px;
|
|
2147
2333
|
background: rgba(24, 24, 27, 0.28);
|
|
2148
|
-
font-family: var(--pluno-pa-font, ${
|
|
2334
|
+
font-family: var(--pluno-pa-font, ${M.fontFamily});
|
|
2149
2335
|
color: var(--pluno-pa-text);
|
|
2150
2336
|
}
|
|
2151
2337
|
.pluno-pa-widget__share-dialog {
|
|
2338
|
+
--pluno-pa-share-paper: #fff9df;
|
|
2339
|
+
--pluno-pa-share-ink: #2c2a1e;
|
|
2340
|
+
--pluno-pa-share-muted: rgba(44, 42, 30, 0.66);
|
|
2341
|
+
--pluno-pa-share-rule: rgba(44, 42, 30, 0.24);
|
|
2342
|
+
--pluno-pa-share-highlight: color-mix(in srgb, var(--pluno-pa-accent) 22%, #fff9df);
|
|
2343
|
+
position: relative;
|
|
2344
|
+
isolation: isolate;
|
|
2152
2345
|
width: min(390px, calc(100vw - 36px));
|
|
2153
2346
|
max-height: min(650px, calc(100vh - 36px));
|
|
2154
2347
|
display: flex;
|
|
2155
2348
|
flex-direction: column;
|
|
2156
2349
|
gap: 12px;
|
|
2157
|
-
border:
|
|
2158
|
-
border-radius:
|
|
2159
|
-
background:
|
|
2160
|
-
|
|
2350
|
+
border: 2px solid transparent;
|
|
2351
|
+
border-radius: 31px 25px 29px 23px / 23px 33px 22px 31px;
|
|
2352
|
+
background:
|
|
2353
|
+
linear-gradient(rgba(44, 42, 30, 0.045) 1px, transparent 1px),
|
|
2354
|
+
linear-gradient(90deg, rgba(44, 42, 30, 0.035) 1px, transparent 1px),
|
|
2355
|
+
var(--pluno-pa-share-paper);
|
|
2356
|
+
background-size: 26px 26px, 26px 26px, auto;
|
|
2357
|
+
color: var(--pluno-pa-share-ink);
|
|
2358
|
+
font-family: "Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Segoe Print", cursive;
|
|
2359
|
+
transform: rotate(-0.25deg);
|
|
2360
|
+
box-shadow: 0 24px 58px rgba(44, 42, 30, 0.22);
|
|
2161
2361
|
padding: 14px;
|
|
2162
2362
|
}
|
|
2363
|
+
.pluno-pa-widget__share-dialog::before,
|
|
2364
|
+
.pluno-pa-widget__share-dialog::after {
|
|
2365
|
+
content: "";
|
|
2366
|
+
position: absolute;
|
|
2367
|
+
inset: -3px;
|
|
2368
|
+
z-index: -1;
|
|
2369
|
+
border: 2px solid var(--pluno-pa-share-ink);
|
|
2370
|
+
border-radius: inherit;
|
|
2371
|
+
filter: url(#pluno-pa-scribble-wobble);
|
|
2372
|
+
pointer-events: none;
|
|
2373
|
+
}
|
|
2374
|
+
.pluno-pa-widget__share-dialog::after {
|
|
2375
|
+
inset: -7px -5px -4px -6px;
|
|
2376
|
+
opacity: 0.42;
|
|
2377
|
+
transform: rotate(1.6deg);
|
|
2378
|
+
filter: url(#pluno-pa-scribble-wobble-2);
|
|
2379
|
+
}
|
|
2163
2380
|
.pluno-pa-widget__share-dialog header,
|
|
2164
2381
|
.pluno-pa-widget__share-dialog footer {
|
|
2165
2382
|
display: flex;
|
|
@@ -2168,84 +2385,156 @@ function Xe(t, e) {
|
|
|
2168
2385
|
gap: 10px;
|
|
2169
2386
|
}
|
|
2170
2387
|
.pluno-pa-widget__share-dialog header strong {
|
|
2171
|
-
color: var(--pluno-pa-
|
|
2172
|
-
font-size:
|
|
2173
|
-
line-height: 1.
|
|
2388
|
+
color: var(--pluno-pa-share-ink);
|
|
2389
|
+
font-size: 18px;
|
|
2390
|
+
line-height: 1.1;
|
|
2174
2391
|
}
|
|
2175
2392
|
.pluno-pa-widget__share-dialog header button {
|
|
2176
2393
|
width: 30px;
|
|
2177
2394
|
height: 30px;
|
|
2178
|
-
border:
|
|
2179
|
-
border-radius:
|
|
2180
|
-
background: var(--pluno-pa-
|
|
2181
|
-
color: var(--pluno-pa-
|
|
2395
|
+
border: 2px solid var(--pluno-pa-share-ink);
|
|
2396
|
+
border-radius: 43% 57% 39% 61% / 59% 41% 58% 42%;
|
|
2397
|
+
background: var(--pluno-pa-share-paper);
|
|
2398
|
+
color: var(--pluno-pa-share-ink);
|
|
2182
2399
|
cursor: pointer;
|
|
2183
2400
|
}
|
|
2184
2401
|
.pluno-pa-widget__share-dialog-screenshot {
|
|
2402
|
+
position: relative;
|
|
2403
|
+
overflow: hidden;
|
|
2185
2404
|
width: 100%;
|
|
2405
|
+
aspect-ratio: 16 / 10;
|
|
2186
2406
|
max-height: 180px;
|
|
2187
|
-
|
|
2188
|
-
border:
|
|
2189
|
-
border-radius: 8px;
|
|
2407
|
+
border: 2px solid var(--pluno-pa-share-rule);
|
|
2408
|
+
border-radius: 18px 15px 17px 13px / 14px 18px 13px 17px;
|
|
2190
2409
|
background: var(--pluno-pa-surface);
|
|
2191
2410
|
}
|
|
2192
|
-
.pluno-pa-widget__share-dialog-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
display: grid;
|
|
2200
|
-
gap: 6px;
|
|
2201
|
-
min-width: 0;
|
|
2411
|
+
.pluno-pa-widget__share-dialog-screenshot img {
|
|
2412
|
+
width: 100%;
|
|
2413
|
+
height: 100%;
|
|
2414
|
+
display: block;
|
|
2415
|
+
object-fit: contain;
|
|
2416
|
+
filter: saturate(0.94) contrast(1.02);
|
|
2417
|
+
background: #0f0f10;
|
|
2202
2418
|
}
|
|
2203
|
-
.pluno-pa-widget__share-dialog-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
line-height: 1.2;
|
|
2419
|
+
.pluno-pa-widget__share-dialog-step {
|
|
2420
|
+
display: flex;
|
|
2421
|
+
flex-direction: column;
|
|
2422
|
+
gap: 8px;
|
|
2208
2423
|
}
|
|
2209
|
-
.pluno-pa-widget__share-dialog-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
border: 1px solid var(--pluno-pa-divider);
|
|
2215
|
-
border-radius: 8px;
|
|
2216
|
-
background: var(--pluno-pa-surface);
|
|
2217
|
-
color: var(--pluno-pa-text);
|
|
2218
|
-
padding: 9px 10px;
|
|
2219
|
-
font-size: 13px;
|
|
2220
|
-
line-height: 1.45;
|
|
2221
|
-
outline: none;
|
|
2424
|
+
.pluno-pa-widget__share-dialog-step-header {
|
|
2425
|
+
display: flex;
|
|
2426
|
+
align-items: center;
|
|
2427
|
+
justify-content: space-between;
|
|
2428
|
+
gap: 10px;
|
|
2222
2429
|
}
|
|
2223
|
-
.pluno-pa-widget__share-dialog-
|
|
2224
|
-
|
|
2430
|
+
.pluno-pa-widget__share-dialog-step-header strong,
|
|
2431
|
+
.pluno-pa-widget__share-dialog-step-title {
|
|
2432
|
+
color: var(--pluno-pa-share-ink);
|
|
2433
|
+
font-size: 15px;
|
|
2434
|
+
font-weight: 750;
|
|
2435
|
+
line-height: 1.2;
|
|
2225
2436
|
}
|
|
2226
2437
|
.pluno-pa-widget__share-dialog-status {
|
|
2227
2438
|
min-height: 16px;
|
|
2228
2439
|
margin: -2px 0 0;
|
|
2229
|
-
color: var(--pluno-pa-muted);
|
|
2440
|
+
color: var(--pluno-pa-share-muted);
|
|
2230
2441
|
font-size: 12px;
|
|
2231
2442
|
line-height: 1.3;
|
|
2232
2443
|
}
|
|
2233
2444
|
.pluno-pa-widget__share-dialog-status[hidden] {
|
|
2234
2445
|
display: none;
|
|
2235
2446
|
}
|
|
2236
|
-
.pluno-pa-widget__share-dialog
|
|
2237
|
-
|
|
2447
|
+
.pluno-pa-widget__share-dialog-copy {
|
|
2448
|
+
display: inline-flex;
|
|
2449
|
+
align-items: center;
|
|
2450
|
+
justify-content: center;
|
|
2451
|
+
min-height: 31px;
|
|
2452
|
+
border: 2px solid var(--pluno-pa-share-ink);
|
|
2453
|
+
border-radius: 41% 59% 44% 56% / 57% 43% 58% 42%;
|
|
2454
|
+
background: var(--pluno-pa-share-paper);
|
|
2455
|
+
color: var(--pluno-pa-share-ink);
|
|
2456
|
+
padding: 5px 10px;
|
|
2457
|
+
font-size: 13px;
|
|
2458
|
+
font-weight: 700;
|
|
2459
|
+
line-height: 1;
|
|
2460
|
+
transform: rotate(1deg);
|
|
2461
|
+
transition: opacity 120ms ease, transform 120ms ease;
|
|
2462
|
+
cursor: pointer;
|
|
2463
|
+
}
|
|
2464
|
+
.pluno-pa-widget__share-dialog-copy:hover {
|
|
2465
|
+
transform: translateY(0) rotate(-1deg);
|
|
2466
|
+
}
|
|
2467
|
+
.pluno-pa-widget__share-dialog-platforms {
|
|
2468
|
+
display: grid;
|
|
2469
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
2470
|
+
gap: 10px;
|
|
2471
|
+
padding-inline: 10px;
|
|
2238
2472
|
}
|
|
2239
|
-
.pluno-pa-widget__share-dialog
|
|
2473
|
+
.pluno-pa-widget__share-dialog-platforms a {
|
|
2474
|
+
display: inline-flex;
|
|
2475
|
+
align-items: center;
|
|
2476
|
+
justify-content: center;
|
|
2477
|
+
width: 100%;
|
|
2478
|
+
min-height: 44px;
|
|
2479
|
+
border: 2px solid var(--pluno-pa-share-ink);
|
|
2480
|
+
border-radius: 47% 53% 45% 55% / 55% 45% 54% 46%;
|
|
2481
|
+
background: var(--pluno-pa-share-highlight);
|
|
2482
|
+
color: var(--pluno-pa-share-ink);
|
|
2483
|
+
font-size: 16px;
|
|
2484
|
+
font-weight: 800;
|
|
2485
|
+
text-decoration: none;
|
|
2486
|
+
transform: rotate(-1.5deg);
|
|
2487
|
+
}
|
|
2488
|
+
.pluno-pa-widget__share-dialog-platform-logo {
|
|
2489
|
+
width: 24px;
|
|
2490
|
+
height: 24px;
|
|
2491
|
+
display: block;
|
|
2492
|
+
overflow: visible;
|
|
2493
|
+
fill: none;
|
|
2494
|
+
stroke: currentColor;
|
|
2495
|
+
stroke-linecap: round;
|
|
2496
|
+
stroke-linejoin: round;
|
|
2497
|
+
stroke-width: 2.2;
|
|
2498
|
+
}
|
|
2499
|
+
.pluno-pa-widget__share-dialog-platforms a:nth-child(even) {
|
|
2500
|
+
transform: rotate(1.5deg);
|
|
2501
|
+
}
|
|
2502
|
+
.pluno-pa-widget__share-dialog-platforms a:hover {
|
|
2503
|
+
background: var(--pluno-pa-share-paper);
|
|
2504
|
+
color: var(--pluno-pa-accent);
|
|
2505
|
+
}
|
|
2506
|
+
.pluno-pa-widget__share-dialog-reward-link {
|
|
2507
|
+
display: inline-flex;
|
|
2508
|
+
align-self: flex-start;
|
|
2509
|
+
align-items: center;
|
|
2510
|
+
justify-content: center;
|
|
2511
|
+
gap: 5px;
|
|
2240
2512
|
min-height: 34px;
|
|
2241
|
-
border:
|
|
2242
|
-
border-radius:
|
|
2243
|
-
background: var(--pluno-pa-
|
|
2244
|
-
color: var(--pluno-pa-
|
|
2245
|
-
padding:
|
|
2246
|
-
font-size:
|
|
2247
|
-
font-weight:
|
|
2248
|
-
|
|
2513
|
+
border: 2px solid var(--pluno-pa-share-ink);
|
|
2514
|
+
border-radius: 43% 57% 45% 55% / 56% 44% 57% 43%;
|
|
2515
|
+
background: var(--pluno-pa-share-highlight);
|
|
2516
|
+
color: var(--pluno-pa-share-ink);
|
|
2517
|
+
padding: 6px 12px;
|
|
2518
|
+
font-size: 13px;
|
|
2519
|
+
font-weight: 800;
|
|
2520
|
+
line-height: 1;
|
|
2521
|
+
text-decoration: none;
|
|
2522
|
+
transform: rotate(0.8deg);
|
|
2523
|
+
}
|
|
2524
|
+
.pluno-pa-widget__share-dialog-external-icon {
|
|
2525
|
+
width: 13px;
|
|
2526
|
+
height: 13px;
|
|
2527
|
+
display: block;
|
|
2528
|
+
fill: none;
|
|
2529
|
+
stroke: currentColor;
|
|
2530
|
+
stroke-linecap: round;
|
|
2531
|
+
stroke-linejoin: round;
|
|
2532
|
+
stroke-width: 2.25;
|
|
2533
|
+
}
|
|
2534
|
+
.pluno-pa-widget__share-dialog-reward-link:hover {
|
|
2535
|
+
background: var(--pluno-pa-share-paper);
|
|
2536
|
+
color: var(--pluno-pa-accent);
|
|
2537
|
+
transform: rotate(-0.8deg);
|
|
2249
2538
|
}
|
|
2250
2539
|
.pluno-pa-widget__composer {
|
|
2251
2540
|
flex: 0 0 auto;
|
|
@@ -2254,6 +2543,65 @@ function Xe(t, e) {
|
|
|
2254
2543
|
background: var(--pluno-pa-bg);
|
|
2255
2544
|
border-top: 1px solid var(--pluno-pa-divider);
|
|
2256
2545
|
}
|
|
2546
|
+
.pluno-pa-widget__billing-status {
|
|
2547
|
+
display: grid;
|
|
2548
|
+
gap: 8px;
|
|
2549
|
+
margin: 0 0 8px;
|
|
2550
|
+
}
|
|
2551
|
+
.pluno-pa-widget__billing-status[hidden] {
|
|
2552
|
+
display: none;
|
|
2553
|
+
}
|
|
2554
|
+
.pluno-pa-widget__billing-action-card {
|
|
2555
|
+
display: grid;
|
|
2556
|
+
gap: 8px;
|
|
2557
|
+
padding: 10px;
|
|
2558
|
+
border: 1px solid color-mix(in srgb, var(--pluno-pa-accent) 24%, var(--pluno-pa-divider));
|
|
2559
|
+
border-radius: 8px;
|
|
2560
|
+
background: color-mix(in srgb, var(--pluno-pa-accent-soft) 60%, var(--pluno-pa-surface));
|
|
2561
|
+
color: var(--pluno-pa-text);
|
|
2562
|
+
font-size: 12px;
|
|
2563
|
+
line-height: 1.4;
|
|
2564
|
+
}
|
|
2565
|
+
.pluno-pa-widget__billing-action-card strong {
|
|
2566
|
+
color: var(--pluno-pa-text);
|
|
2567
|
+
font-size: 13px;
|
|
2568
|
+
line-height: 1.25;
|
|
2569
|
+
font-weight: 700;
|
|
2570
|
+
}
|
|
2571
|
+
.pluno-pa-widget__billing-action-card span {
|
|
2572
|
+
color: var(--pluno-pa-muted);
|
|
2573
|
+
}
|
|
2574
|
+
.pluno-pa-widget__billing-action-card-actions {
|
|
2575
|
+
display: flex;
|
|
2576
|
+
flex-wrap: wrap;
|
|
2577
|
+
gap: 7px;
|
|
2578
|
+
}
|
|
2579
|
+
.pluno-pa-widget__billing-action-card-actions button {
|
|
2580
|
+
min-height: 29px;
|
|
2581
|
+
display: inline-flex;
|
|
2582
|
+
align-items: center;
|
|
2583
|
+
gap: 6px;
|
|
2584
|
+
border: 1px solid var(--pluno-pa-divider);
|
|
2585
|
+
border-radius: 8px;
|
|
2586
|
+
background: var(--pluno-pa-bg);
|
|
2587
|
+
color: var(--pluno-pa-text);
|
|
2588
|
+
padding: 0 9px;
|
|
2589
|
+
font-size: 12px;
|
|
2590
|
+
font-weight: 650;
|
|
2591
|
+
line-height: 1;
|
|
2592
|
+
cursor: pointer;
|
|
2593
|
+
white-space: nowrap;
|
|
2594
|
+
}
|
|
2595
|
+
.pluno-pa-widget__billing-action-card-actions button:first-child {
|
|
2596
|
+
border-color: var(--pluno-pa-text);
|
|
2597
|
+
background: var(--pluno-pa-text);
|
|
2598
|
+
color: var(--pluno-pa-bg);
|
|
2599
|
+
}
|
|
2600
|
+
.pluno-pa-widget__billing-action-card-actions button:disabled,
|
|
2601
|
+
.pluno-pa-widget__billing-action-card-actions button:disabled {
|
|
2602
|
+
cursor: not-allowed;
|
|
2603
|
+
opacity: 0.55;
|
|
2604
|
+
}
|
|
2257
2605
|
.pluno-pa-widget__attachment-error {
|
|
2258
2606
|
margin: 0 0 8px;
|
|
2259
2607
|
padding: 6px 9px;
|
|
@@ -2411,6 +2759,7 @@ function Xe(t, e) {
|
|
|
2411
2759
|
display: flex;
|
|
2412
2760
|
align-items: center;
|
|
2413
2761
|
justify-content: center;
|
|
2762
|
+
column-gap: 0.35em;
|
|
2414
2763
|
margin-top: 8px;
|
|
2415
2764
|
color: var(--pluno-pa-faint);
|
|
2416
2765
|
font: inherit;
|
|
@@ -2427,10 +2776,6 @@ function Xe(t, e) {
|
|
|
2427
2776
|
.pluno-pa-widget__powered-by:hover {
|
|
2428
2777
|
color: var(--pluno-pa-muted);
|
|
2429
2778
|
}
|
|
2430
|
-
.pluno-pa-widget__composer-separator {
|
|
2431
|
-
margin: 0 5px;
|
|
2432
|
-
color: inherit;
|
|
2433
|
-
}
|
|
2434
2779
|
.pluno-pa-widget__ai-disclaimer {
|
|
2435
2780
|
color: inherit;
|
|
2436
2781
|
}
|
|
@@ -2616,7 +2961,7 @@ function Xe(t, e) {
|
|
|
2616
2961
|
right: 16px;
|
|
2617
2962
|
height: 36px;
|
|
2618
2963
|
z-index: 3;
|
|
2619
|
-
background-image: url('${
|
|
2964
|
+
background-image: url('${Ve}');
|
|
2620
2965
|
background-repeat: repeat-x;
|
|
2621
2966
|
background-size: 104px 36px;
|
|
2622
2967
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -2688,6 +3033,13 @@ function Xe(t, e) {
|
|
|
2688
3033
|
.pluno-pa-widget--scribble .pluno-pa-widget__composer-inner {
|
|
2689
3034
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
2690
3035
|
}
|
|
3036
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card {
|
|
3037
|
+
position: relative;
|
|
3038
|
+
border-radius: var(--pluno-pa-scribble-wobble);
|
|
3039
|
+
}
|
|
3040
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button {
|
|
3041
|
+
position: relative;
|
|
3042
|
+
}
|
|
2691
3043
|
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-body {
|
|
2692
3044
|
position: relative;
|
|
2693
3045
|
border-radius: var(--pluno-pa-scribble-wobble);
|
|
@@ -2702,6 +3054,8 @@ function Xe(t, e) {
|
|
|
2702
3054
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat,
|
|
2703
3055
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy,
|
|
2704
3056
|
.pluno-pa-widget--scribble .pluno-pa-widget__close,
|
|
3057
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card,
|
|
3058
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button,
|
|
2705
3059
|
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-body,
|
|
2706
3060
|
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button {
|
|
2707
3061
|
isolation: isolate;
|
|
@@ -2716,8 +3070,10 @@ function Xe(t, e) {
|
|
|
2716
3070
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::before,
|
|
2717
3071
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy::before,
|
|
2718
3072
|
.pluno-pa-widget--scribble .pluno-pa-widget__close::before,
|
|
3073
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card::before,
|
|
3074
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button::before,
|
|
2719
3075
|
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-body::before,
|
|
2720
|
-
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button::before {
|
|
3076
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::before {
|
|
2721
3077
|
content: "";
|
|
2722
3078
|
position: absolute;
|
|
2723
3079
|
inset: -2px;
|
|
@@ -2741,9 +3097,21 @@ function Xe(t, e) {
|
|
|
2741
3097
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::before,
|
|
2742
3098
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy::before,
|
|
2743
3099
|
.pluno-pa-widget--scribble .pluno-pa-widget__close::before,
|
|
2744
|
-
.pluno-pa-widget--scribble .pluno-pa-
|
|
3100
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button::before,
|
|
3101
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::before {
|
|
2745
3102
|
background: var(--pluno-pa-bg);
|
|
2746
3103
|
}
|
|
3104
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card::before {
|
|
3105
|
+
background: color-mix(in srgb, var(--pluno-pa-accent-soft) 60%, var(--pluno-pa-surface));
|
|
3106
|
+
filter: url(#pluno-pa-scribble-wobble);
|
|
3107
|
+
}
|
|
3108
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button:first-child {
|
|
3109
|
+
color: var(--pluno-pa-bg);
|
|
3110
|
+
}
|
|
3111
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button:first-child::before {
|
|
3112
|
+
background: var(--pluno-pa-text);
|
|
3113
|
+
border-color: var(--pluno-pa-text);
|
|
3114
|
+
}
|
|
2747
3115
|
.pluno-pa-widget--scribble .pluno-pa-widget__composer-inner:focus-within {
|
|
2748
3116
|
border-color: transparent;
|
|
2749
3117
|
}
|
|
@@ -2754,14 +3122,16 @@ function Xe(t, e) {
|
|
|
2754
3122
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat,
|
|
2755
3123
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy,
|
|
2756
3124
|
.pluno-pa-widget--scribble .pluno-pa-widget__close,
|
|
2757
|
-
.pluno-pa-widget--scribble .pluno-pa-
|
|
3125
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button,
|
|
3126
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable) {
|
|
2758
3127
|
border-radius: 43% 57% 39% 61% / 59% 41% 58% 42%;
|
|
2759
3128
|
}
|
|
2760
3129
|
.pluno-pa-widget--scribble .pluno-pa-widget__send::after,
|
|
2761
3130
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::after,
|
|
2762
3131
|
.pluno-pa-widget--scribble .pluno-pa-widget__message-copy::after,
|
|
2763
3132
|
.pluno-pa-widget--scribble .pluno-pa-widget__close::after,
|
|
2764
|
-
.pluno-pa-widget--scribble .pluno-pa-
|
|
3133
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__billing-action-card-actions button::after,
|
|
3134
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::after {
|
|
2765
3135
|
content: "";
|
|
2766
3136
|
position: absolute;
|
|
2767
3137
|
inset: -3px;
|
|
@@ -2771,7 +3141,7 @@ function Xe(t, e) {
|
|
|
2771
3141
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
2772
3142
|
pointer-events: none;
|
|
2773
3143
|
opacity: 0.6;
|
|
2774
|
-
transform: rotate(
|
|
3144
|
+
transform: rotate(5deg);
|
|
2775
3145
|
}
|
|
2776
3146
|
.pluno-pa-widget--scribble .pluno-pa-widget__new-chat::after {
|
|
2777
3147
|
transform: rotate(-10deg);
|
|
@@ -2838,7 +3208,7 @@ function Xe(t, e) {
|
|
|
2838
3208
|
right: 12px;
|
|
2839
3209
|
height: 22px;
|
|
2840
3210
|
z-index: 1;
|
|
2841
|
-
background-image: url('${
|
|
3211
|
+
background-image: url('${Ve}');
|
|
2842
3212
|
background-repeat: repeat-x;
|
|
2843
3213
|
background-size: 62px 21.5px;
|
|
2844
3214
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -2850,73 +3220,105 @@ function Xe(t, e) {
|
|
|
2850
3220
|
.pluno-pa-widget--scribble .pluno-pa-widget__close svg {
|
|
2851
3221
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
2852
3222
|
}
|
|
2853
|
-
`,
|
|
3223
|
+
`, e.appendChild(n);
|
|
2854
3224
|
}
|
|
2855
|
-
async function
|
|
2856
|
-
return document.body ? document.body : await new Promise((
|
|
2857
|
-
const
|
|
2858
|
-
document.body && (
|
|
3225
|
+
async function _o() {
|
|
3226
|
+
return document.body ? document.body : await new Promise((e) => {
|
|
3227
|
+
const t = new MutationObserver(() => {
|
|
3228
|
+
document.body && (t.disconnect(), e(document.body));
|
|
2859
3229
|
});
|
|
2860
|
-
|
|
3230
|
+
t.observe(document.documentElement, { childList: !0 });
|
|
2861
3231
|
});
|
|
2862
3232
|
}
|
|
2863
|
-
function
|
|
2864
|
-
return `pluno.productAgent.widgetState.${location.origin}.${
|
|
3233
|
+
function Lt(e) {
|
|
3234
|
+
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
2865
3235
|
}
|
|
2866
|
-
function
|
|
3236
|
+
function xo(e) {
|
|
2867
3237
|
try {
|
|
2868
|
-
const
|
|
2869
|
-
if (!
|
|
2870
|
-
return
|
|
2871
|
-
const n = JSON.parse(
|
|
3238
|
+
const t = window.localStorage.getItem(Lt(e));
|
|
3239
|
+
if (!t)
|
|
3240
|
+
return pt();
|
|
3241
|
+
const n = JSON.parse(t);
|
|
2872
3242
|
return {
|
|
2873
3243
|
isOpen: n.isOpen === !0,
|
|
2874
3244
|
composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
|
|
2875
3245
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter((o) => typeof o == "string") : [],
|
|
2876
|
-
launcherPosition:
|
|
2877
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
3246
|
+
launcherPosition: Eo(n.launcherPosition) ? n.launcherPosition : null,
|
|
3247
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ht) : [],
|
|
3248
|
+
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
2878
3249
|
};
|
|
2879
3250
|
} catch {
|
|
2880
|
-
return
|
|
3251
|
+
return pt();
|
|
2881
3252
|
}
|
|
2882
3253
|
}
|
|
2883
|
-
function
|
|
3254
|
+
async function vo(e) {
|
|
3255
|
+
if (e.loadSharePromptsDisabled)
|
|
3256
|
+
return e.loadSharePromptsDisabled();
|
|
2884
3257
|
try {
|
|
2885
|
-
window.localStorage.
|
|
3258
|
+
return window.localStorage.getItem(mt) === "true";
|
|
3259
|
+
} catch {
|
|
3260
|
+
return !1;
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
function yo(e, t) {
|
|
3264
|
+
if (e.persistSharePromptsDisabled) {
|
|
3265
|
+
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(() => {
|
|
3266
|
+
});
|
|
3267
|
+
return;
|
|
3268
|
+
}
|
|
3269
|
+
try {
|
|
3270
|
+
t && window.localStorage.setItem(mt, "true");
|
|
3271
|
+
} catch {
|
|
3272
|
+
return;
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
function pt() {
|
|
3276
|
+
return {
|
|
3277
|
+
isOpen: !1,
|
|
3278
|
+
composerValue: "",
|
|
3279
|
+
openToolGroupKeys: [],
|
|
3280
|
+
launcherPosition: null,
|
|
3281
|
+
seenShareCandidateIds: [],
|
|
3282
|
+
sharePromptsDisabled: !1
|
|
3283
|
+
};
|
|
3284
|
+
}
|
|
3285
|
+
function Co(e, t) {
|
|
3286
|
+
try {
|
|
3287
|
+
window.localStorage.setItem(Lt(e), JSON.stringify(t));
|
|
2886
3288
|
} catch {
|
|
2887
3289
|
return;
|
|
2888
3290
|
}
|
|
2889
3291
|
}
|
|
2890
|
-
function
|
|
2891
|
-
if (!
|
|
3292
|
+
function Eo(e) {
|
|
3293
|
+
if (!e || typeof e != "object")
|
|
2892
3294
|
return !1;
|
|
2893
|
-
const
|
|
2894
|
-
return Number.isFinite(
|
|
2895
|
-
}
|
|
2896
|
-
const
|
|
2897
|
-
function
|
|
2898
|
-
return Object.keys(
|
|
2899
|
-
}
|
|
2900
|
-
function
|
|
2901
|
-
const
|
|
2902
|
-
return
|
|
2903
|
-
}
|
|
2904
|
-
function
|
|
2905
|
-
const n = new URL(
|
|
2906
|
-
return n.href ===
|
|
2907
|
-
}
|
|
2908
|
-
class
|
|
2909
|
-
constructor(
|
|
2910
|
-
super(), this.channelId = n, this.url =
|
|
2911
|
-
this.readyState =
|
|
2912
|
-
}), this.addPreviewListener(
|
|
3295
|
+
const t = e;
|
|
3296
|
+
return Number.isFinite(t.x) && Number.isFinite(t.y);
|
|
3297
|
+
}
|
|
3298
|
+
const st = /* @__PURE__ */ new WeakSet();
|
|
3299
|
+
function ko(e) {
|
|
3300
|
+
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
3301
|
+
}
|
|
3302
|
+
function dt(e) {
|
|
3303
|
+
const t = e.pathname.split("/");
|
|
3304
|
+
return t[t.length - 1] ?? "";
|
|
3305
|
+
}
|
|
3306
|
+
function So(e, t) {
|
|
3307
|
+
const n = new URL(e.src, document.baseURI);
|
|
3308
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : dt(n) === dt(t);
|
|
3309
|
+
}
|
|
3310
|
+
class O extends EventTarget {
|
|
3311
|
+
constructor(t, n) {
|
|
3312
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(Qt, () => {
|
|
3313
|
+
this.readyState = O.OPEN, this.dispatchEvent(new Event("open"));
|
|
3314
|
+
}), this.addPreviewListener(en, (o) => {
|
|
2913
3315
|
const a = o;
|
|
2914
3316
|
this.dispatchEvent(new MessageEvent("message", { data: a.detail?.data ?? "" }));
|
|
2915
|
-
}), this.addPreviewListener(
|
|
2916
|
-
this.readyState =
|
|
2917
|
-
}), this.addPreviewListener(
|
|
3317
|
+
}), this.addPreviewListener(tn, () => {
|
|
3318
|
+
this.readyState = O.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
3319
|
+
}), this.addPreviewListener(nn, (o) => {
|
|
2918
3320
|
const a = o;
|
|
2919
|
-
this.readyState =
|
|
3321
|
+
this.readyState = O.CLOSED, this.dispatchEvent(
|
|
2920
3322
|
new CloseEvent("close", {
|
|
2921
3323
|
code: a.detail?.code ?? 1e3,
|
|
2922
3324
|
reason: a.detail?.reason ?? "",
|
|
@@ -2924,8 +3326,8 @@ class R extends EventTarget {
|
|
|
2924
3326
|
})
|
|
2925
3327
|
), this.cleanup();
|
|
2926
3328
|
}), window.dispatchEvent(
|
|
2927
|
-
new CustomEvent(
|
|
2928
|
-
detail: { socketId: this.socketId, url:
|
|
3329
|
+
new CustomEvent(se(Xt, this.channelId), {
|
|
3330
|
+
detail: { socketId: this.socketId, url: t }
|
|
2929
3331
|
})
|
|
2930
3332
|
);
|
|
2931
3333
|
}
|
|
@@ -2939,80 +3341,80 @@ class R extends EventTarget {
|
|
|
2939
3341
|
extensions = "";
|
|
2940
3342
|
binaryType = "blob";
|
|
2941
3343
|
bufferedAmount = 0;
|
|
2942
|
-
readyState =
|
|
2943
|
-
socketId =
|
|
3344
|
+
readyState = O.CONNECTING;
|
|
3345
|
+
socketId = Lo();
|
|
2944
3346
|
listeners = /* @__PURE__ */ new Map();
|
|
2945
|
-
send(
|
|
2946
|
-
if (this.readyState !==
|
|
3347
|
+
send(t) {
|
|
3348
|
+
if (this.readyState !== O.OPEN)
|
|
2947
3349
|
throw new DOMException("Pluno preview websocket is not open", "InvalidStateError");
|
|
2948
3350
|
window.dispatchEvent(
|
|
2949
|
-
new CustomEvent(
|
|
2950
|
-
detail: { socketId: this.socketId, data: typeof
|
|
3351
|
+
new CustomEvent(se(Zt, this.channelId), {
|
|
3352
|
+
detail: { socketId: this.socketId, data: typeof t == "string" ? t : String(t) }
|
|
2951
3353
|
})
|
|
2952
3354
|
);
|
|
2953
3355
|
}
|
|
2954
|
-
close(
|
|
2955
|
-
this.readyState !==
|
|
2956
|
-
new CustomEvent(
|
|
2957
|
-
detail: { socketId: this.socketId, code:
|
|
3356
|
+
close(t, n) {
|
|
3357
|
+
this.readyState !== O.CLOSED && (this.readyState = O.CLOSING, window.dispatchEvent(
|
|
3358
|
+
new CustomEvent(se(Jt, this.channelId), {
|
|
3359
|
+
detail: { socketId: this.socketId, code: t, reason: n }
|
|
2958
3360
|
})
|
|
2959
3361
|
), this.cleanup());
|
|
2960
3362
|
}
|
|
2961
|
-
addPreviewListener(
|
|
2962
|
-
const o =
|
|
3363
|
+
addPreviewListener(t, n) {
|
|
3364
|
+
const o = se(t, this.channelId), a = (i) => {
|
|
2963
3365
|
i.detail?.socketId === this.socketId && n(i);
|
|
2964
3366
|
};
|
|
2965
3367
|
this.listeners.set(o, a), window.addEventListener(o, a);
|
|
2966
3368
|
}
|
|
2967
3369
|
cleanup() {
|
|
2968
|
-
for (const [
|
|
2969
|
-
window.removeEventListener(
|
|
3370
|
+
for (const [t, n] of this.listeners.entries())
|
|
3371
|
+
window.removeEventListener(t, n);
|
|
2970
3372
|
this.listeners.clear();
|
|
2971
3373
|
}
|
|
2972
3374
|
}
|
|
2973
|
-
function
|
|
2974
|
-
const
|
|
2975
|
-
if (
|
|
2976
|
-
return
|
|
2977
|
-
const
|
|
2978
|
-
return window.sessionStorage.setItem(
|
|
3375
|
+
function Lo() {
|
|
3376
|
+
const e = window.sessionStorage.getItem(He);
|
|
3377
|
+
if (e)
|
|
3378
|
+
return e;
|
|
3379
|
+
const t = crypto.randomUUID();
|
|
3380
|
+
return window.sessionStorage.setItem(He, t), t;
|
|
2979
3381
|
}
|
|
2980
|
-
function
|
|
2981
|
-
return `${
|
|
3382
|
+
function se(e, t) {
|
|
3383
|
+
return `${e}:${t}`;
|
|
2982
3384
|
}
|
|
2983
|
-
function
|
|
2984
|
-
const
|
|
2985
|
-
if (
|
|
2986
|
-
return [
|
|
2987
|
-
const n = new URL(
|
|
3385
|
+
function Po(e) {
|
|
3386
|
+
const t = document.currentScript;
|
|
3387
|
+
if (t instanceof HTMLScriptElement)
|
|
3388
|
+
return [t];
|
|
3389
|
+
const n = new URL(e, document.baseURI).href, o = new URL(n);
|
|
2988
3390
|
return Array.from(document.querySelectorAll("script[type='module'][src]")).filter(
|
|
2989
|
-
(a) => a instanceof HTMLScriptElement &&
|
|
3391
|
+
(a) => a instanceof HTMLScriptElement && ko(a) && So(a, o)
|
|
2990
3392
|
);
|
|
2991
3393
|
}
|
|
2992
|
-
function
|
|
2993
|
-
for (const
|
|
2994
|
-
if (
|
|
3394
|
+
function Ao(e) {
|
|
3395
|
+
for (const t of Po(e)) {
|
|
3396
|
+
if (st.has(t) || t.dataset.plunoAutoMount === "false")
|
|
2995
3397
|
continue;
|
|
2996
|
-
|
|
2997
|
-
const n =
|
|
2998
|
-
|
|
2999
|
-
token:
|
|
3000
|
-
tokenEndpoint:
|
|
3001
|
-
backendUrl:
|
|
3002
|
-
webSocketFactory: n ?
|
|
3003
|
-
launcherLabel:
|
|
3004
|
-
accentColor:
|
|
3005
|
-
colorScheme:
|
|
3006
|
-
fontFamily:
|
|
3007
|
-
scribbleStyle:
|
|
3008
|
-
position:
|
|
3398
|
+
st.add(t);
|
|
3399
|
+
const n = t.dataset.plunoPreviewChannel;
|
|
3400
|
+
Cn({
|
|
3401
|
+
token: t.dataset.plunoToken,
|
|
3402
|
+
tokenEndpoint: t.dataset.plunoTokenEndpoint,
|
|
3403
|
+
backendUrl: t.dataset.plunoBackendUrl,
|
|
3404
|
+
webSocketFactory: n ? yn(n) : void 0,
|
|
3405
|
+
launcherLabel: t.dataset.plunoLauncherLabel,
|
|
3406
|
+
accentColor: t.dataset.plunoAccentColor,
|
|
3407
|
+
colorScheme: t.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
3408
|
+
fontFamily: t.dataset.plunoFontFamily,
|
|
3409
|
+
scribbleStyle: t.dataset.plunoScribbleStyle === "true",
|
|
3410
|
+
position: t.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
3009
3411
|
}).catch((o) => {
|
|
3010
3412
|
console.error("Failed to mount Pluno widget", o);
|
|
3011
3413
|
});
|
|
3012
3414
|
}
|
|
3013
3415
|
}
|
|
3014
|
-
|
|
3416
|
+
Ao(import.meta.url);
|
|
3015
3417
|
export {
|
|
3016
|
-
|
|
3017
|
-
|
|
3418
|
+
yn as createProductAgentPreviewBridgeWebSocketFactory,
|
|
3419
|
+
Cn as mountPlunoProductAgentWidget
|
|
3018
3420
|
};
|