@pluno/product-agent-web 0.1.160 → 0.1.161
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 +2 -0
- package/dist/product-agent-sdk.js +35 -34
- package/dist/product-agent-widget.js +152 -149
- package/dist/widget.d.ts +1 -0
- package/package.json +1 -1
|
@@ -193,9 +193,9 @@ function nl(t, e, n, i) {
|
|
|
193
193
|
return !s.isActivity || !s.isTransient ? !0 : e !== null && s.respondsToUserMessageId !== void 0 ? s.respondsToUserMessageId !== e : n === null || s.runId !== n;
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
|
-
const Di = "pluno.productAgent.transportId", il = "pluno.productAgent.transportIdentity",
|
|
196
|
+
const Di = "pluno.productAgent.transportId", il = "pluno.productAgent.transportIdentity", Ni = "pluno.productAgent.transportIdentity.event", ol = 50, sl = globalThis.setTimeout.bind(globalThis);
|
|
197
197
|
let en = null;
|
|
198
|
-
const Gn = /* @__PURE__ */ new Set(),
|
|
198
|
+
const Gn = /* @__PURE__ */ new Set(), Ui = /* @__PURE__ */ new Map();
|
|
199
199
|
async function rl(t = mr()) {
|
|
200
200
|
const e = t.randomUUID(), n = t.storage.getItem(Di);
|
|
201
201
|
let i = n ?? t.randomUUID(), o = !1, s = !1;
|
|
@@ -268,13 +268,13 @@ function pl() {
|
|
|
268
268
|
return {
|
|
269
269
|
getItem: (t) => {
|
|
270
270
|
try {
|
|
271
|
-
return window.sessionStorage?.getItem(t) ??
|
|
271
|
+
return window.sessionStorage?.getItem(t) ?? Ui.get(t) ?? null;
|
|
272
272
|
} catch {
|
|
273
|
-
return
|
|
273
|
+
return Ui.get(t) ?? null;
|
|
274
274
|
}
|
|
275
275
|
},
|
|
276
276
|
setItem: (t, e) => {
|
|
277
|
-
|
|
277
|
+
Ui.set(t, e);
|
|
278
278
|
try {
|
|
279
279
|
window.sessionStorage?.setItem(t, e);
|
|
280
280
|
} catch {
|
|
@@ -298,7 +298,7 @@ function cl() {
|
|
|
298
298
|
}
|
|
299
299
|
function dl() {
|
|
300
300
|
const t = /* @__PURE__ */ new Set(), e = (n) => {
|
|
301
|
-
if (n.key !==
|
|
301
|
+
if (n.key !== Ni || !n.newValue)
|
|
302
302
|
return;
|
|
303
303
|
const i = JSON.parse(n.newValue);
|
|
304
304
|
for (const o of t)
|
|
@@ -307,9 +307,9 @@ function dl() {
|
|
|
307
307
|
return window.addEventListener("storage", e), {
|
|
308
308
|
postMessage: (n) => {
|
|
309
309
|
window.localStorage.setItem(
|
|
310
|
-
|
|
310
|
+
Ni,
|
|
311
311
|
JSON.stringify({ ...n, eventId: crypto.randomUUID() })
|
|
312
|
-
), window.localStorage.removeItem(
|
|
312
|
+
), window.localStorage.removeItem(Ni);
|
|
313
313
|
},
|
|
314
314
|
subscribe: (n) => (t.add(n), () => t.delete(n)),
|
|
315
315
|
close: () => {
|
|
@@ -445,7 +445,7 @@ function Oi(t, e, n) {
|
|
|
445
445
|
};
|
|
446
446
|
window.dispatchEvent(new CustomEvent("product-agent:trace", { detail: o }));
|
|
447
447
|
}
|
|
448
|
-
const xl = "https://app.pluno.ai", vl = "gpt-5.6-terra", Sl = 2e4, Il = 1e4, Tl = 1e4, El = 1e4, Cl = 1e4, kl = 1e3, bs = 3e4, ys = 0.2, _s = 6e4, Al = 15e3, tn = 8, Ml = "Pluno could not finish this message. Try it again.", Rl = "Browser connection was interrupted.", xs = 15e3, Pl = "Pluno could not send this message. Try it again.", vs = 2e3, Ll = 1e3, Dl = 100, Ss = 8e3, Is = 3,
|
|
448
|
+
const xl = "https://app.pluno.ai", vl = "gpt-5.6-terra", Sl = 2e4, Il = 1e4, Tl = 1e4, El = 1e4, Cl = 1e4, kl = 1e3, bs = 3e4, ys = 0.2, _s = 6e4, Al = 15e3, tn = 8, Ml = "Pluno could not finish this message. Try it again.", Rl = "Browser connection was interrupted.", xs = 15e3, Pl = "Pluno could not send this message. Try it again.", vs = 2e3, Ll = 1e3, Dl = 100, Ss = 8e3, Is = 3, Nl = [300, 1e3], br = 50 * 1024 * 1024, Ul = /* @__PURE__ */ new Set([
|
|
449
449
|
".jpeg:image/jpeg",
|
|
450
450
|
".jpg:image/jpeg",
|
|
451
451
|
".pdf:application/pdf",
|
|
@@ -591,6 +591,7 @@ class ko {
|
|
|
591
591
|
backendUrl: lp(e.backendUrl ?? xl),
|
|
592
592
|
clientId: e.clientId ?? Cp(),
|
|
593
593
|
model: e.model ?? vl,
|
|
594
|
+
productVariant: e.productVariant ?? "customer_embedded",
|
|
594
595
|
entrySurface: pp(e.entrySurface)
|
|
595
596
|
}, n);
|
|
596
597
|
try {
|
|
@@ -702,7 +703,7 @@ class ko {
|
|
|
702
703
|
}
|
|
703
704
|
async sendMessage(e, n = {}) {
|
|
704
705
|
const i = e.trim(), o = n.attachments ?? [];
|
|
705
|
-
if (
|
|
706
|
+
if (this.options.productVariant === "customer_embedded" && (o.forEach(Ur), o.reduce(
|
|
706
707
|
(b, I) => b + I.sizeBytes,
|
|
707
708
|
0
|
|
708
709
|
) > br))
|
|
@@ -793,7 +794,7 @@ class ko {
|
|
|
793
794
|
return e ? (this.retryAttemptsByClientMessageId[n] = 0, this.retryableClientMessageId = null, this.activeClientMessageId = n, this.browserConnectionInterruptedClientMessageIds.delete(n), this.latestRecoverableClientMessageId = n, this.setState({ status: "connected", isThinking: !0, isRetrying: !0, lastError: null, lastErrorCode: null }), this.markThinkingProgress(), this.send({ type: "chat.retry_last_user_message", sessionId: e, clientMessageId: n, automatic: !1 }), !0) : !1;
|
|
794
795
|
}
|
|
795
796
|
createLocalAttachment(e) {
|
|
796
|
-
this.options.
|
|
797
|
+
this.options.productVariant === "customer_embedded" && Nr(e);
|
|
797
798
|
const n = on(), i = {
|
|
798
799
|
id: n,
|
|
799
800
|
name: e.name || "attachment",
|
|
@@ -1167,7 +1168,7 @@ class ko {
|
|
|
1167
1168
|
if (e.type === "conversation.state") {
|
|
1168
1169
|
const n = Array.isArray(e.items) ? e.items : [], i = e.pendingMessageStatus === "sending" ? "sending" : e.pendingMessageStatus === "queued" ? "reconnecting" : null, o = typeof e.pendingClientMessageId == "string" ? e.pendingClientMessageId : null, s = e.isRetrying === !0;
|
|
1169
1170
|
i && o && (this.pendingClientMessageId = o);
|
|
1170
|
-
const r =
|
|
1171
|
+
const r = Up(
|
|
1171
1172
|
e.assistantDraft
|
|
1172
1173
|
), l = r !== void 0;
|
|
1173
1174
|
this.rememberUserMessageClientMessageIds(n);
|
|
@@ -1180,14 +1181,14 @@ class ko {
|
|
|
1180
1181
|
);
|
|
1181
1182
|
}
|
|
1182
1183
|
const d = n.filter((I) => {
|
|
1183
|
-
const P =
|
|
1184
|
+
const P = Ut(I);
|
|
1184
1185
|
return Ms(P) ? !1 : !P || !p || !ro(P) ? !0 : lo(n, P) !== p;
|
|
1185
1186
|
}), g = jp(
|
|
1186
1187
|
this.state.messages,
|
|
1187
1188
|
Ap(d, this.options.backendUrl)
|
|
1188
1189
|
), c = As(g), h = !l && n.some(
|
|
1189
1190
|
(I) => Rs(
|
|
1190
|
-
|
|
1191
|
+
Ut(I),
|
|
1191
1192
|
this.state.assistantDraft,
|
|
1192
1193
|
this.state.assistantDraftItemId,
|
|
1193
1194
|
this.state.assistantDraftRespondsToUserMessageId,
|
|
@@ -1269,7 +1270,7 @@ class ko {
|
|
|
1269
1270
|
}
|
|
1270
1271
|
if (e.type === "session.item") {
|
|
1271
1272
|
this.rememberUserMessageClientMessageIds([e.item]);
|
|
1272
|
-
const n =
|
|
1273
|
+
const n = Ut(e.item);
|
|
1273
1274
|
if (ro(n)) {
|
|
1274
1275
|
typeof n?.runId == "string" && this.retryableFailureRunIdsAwaitingDone.add(n.runId);
|
|
1275
1276
|
const o = se(e.item, "sessionId") ?? this.state.sessionId, s = n ? pt(n) : null, r = s ? this.clientMessageIdsByUserMessageItemId.get(s) : null, l = typeof n?.clientMessageId == "string" ? n.clientMessageId : r ?? (s ? null : this.activeClientMessageId ?? this.latestRecoverableClientMessageId);
|
|
@@ -1540,7 +1541,7 @@ class ko {
|
|
|
1540
1541
|
}
|
|
1541
1542
|
rememberUserMessageClientMessageIds(e) {
|
|
1542
1543
|
for (const n of e) {
|
|
1543
|
-
const i = se(n, "id"), o =
|
|
1544
|
+
const i = se(n, "id"), o = Ut(n);
|
|
1544
1545
|
i && o?.type === "message" && o.role === "user" && o.optimistic !== !0 && !i.startsWith("optimistic-user-message:") && typeof o.clientMessageId == "string" && (this.clientMessageIdsByUserMessageItemId.set(i, o.clientMessageId), o.clientMessageId === this.pendingClientMessageId && this.promotePendingDelivery(
|
|
1545
1546
|
o.clientMessageId,
|
|
1546
1547
|
se(n, "sessionId") ?? this.state.sessionId,
|
|
@@ -1775,7 +1776,7 @@ class ko {
|
|
|
1775
1776
|
}) : (!this.socket || this.socket.readyState !== WebSocket.OPEN) && (this.setReconnectingState(), this.scheduleReconnect());
|
|
1776
1777
|
}
|
|
1777
1778
|
async executeToolCall(e) {
|
|
1778
|
-
const n = typeof e.sessionId == "string" ? e.sessionId : null, i = typeof e.callId == "string" ? e.callId : null, o = typeof e.toolName == "string" ? e.toolName : null, s =
|
|
1779
|
+
const n = typeof e.sessionId == "string" ? e.sessionId : null, i = typeof e.callId == "string" ? e.callId : null, o = typeof e.toolName == "string" ? e.toolName : null, s = Nt(
|
|
1779
1780
|
typeof e.summary == "string" ? e.summary : "Running browser tool"
|
|
1780
1781
|
), r = e.rawInput;
|
|
1781
1782
|
if (!n || !i || !o)
|
|
@@ -2576,11 +2577,11 @@ function mp(t, e) {
|
|
|
2576
2577
|
return `${I.tagName.toLowerCase()}|${w(I)}|${P}`;
|
|
2577
2578
|
}, m = (I, P, O) => {
|
|
2578
2579
|
const L = (B, Q) => {
|
|
2579
|
-
const
|
|
2580
|
-
if (_ >= 1e3 && !K || O.has(B) || s.has(
|
|
2580
|
+
const N = B.tagName.toLowerCase(), ge = window.getComputedStyle(B), K = g.has(B);
|
|
2581
|
+
if (_ >= 1e3 && !K || O.has(B) || s.has(N) || B.matches(".pluno-pa-widget-host, [data-pluno-product-agent-widget]") || ge.display === "none" || ge.visibility === "hidden")
|
|
2581
2582
|
return { lines: [], hasUsefulContent: !1, textPreview: "", containsTextElement: !1 };
|
|
2582
2583
|
_ += 1;
|
|
2583
|
-
const Qe = w(B), Pe = Ir(B), q = l.has(Qe) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(
|
|
2584
|
+
const Qe = w(B), Pe = Ir(B), q = l.has(Qe) || ["button", "input", "textarea", "select", "iframe", "canvas"].includes(N) || N === "a" && B.hasAttribute("href"), Le = Array.from(B.children).filter((T) => T instanceof HTMLElement), x = /* @__PURE__ */ new Map();
|
|
2584
2585
|
for (const T of Le) {
|
|
2585
2586
|
const A = f(T);
|
|
2586
2587
|
x.set(A, (x.get(A) ?? 0) + 1);
|
|
@@ -2592,8 +2593,8 @@ function mp(t, e) {
|
|
|
2592
2593
|
}
|
|
2593
2594
|
const ce = /* @__PURE__ */ new Map(), et = /* @__PURE__ */ new Set(), ee = [], De = [];
|
|
2594
2595
|
for (const T of Le) {
|
|
2595
|
-
const A = f(T), W = x.get(A) ?? 0,
|
|
2596
|
-
if (ce.set(A,
|
|
2596
|
+
const A = f(T), W = x.get(A) ?? 0, Ue = ce.get(A) ?? 0;
|
|
2597
|
+
if (ce.set(A, Ue + 1), W > 8 && Ue >= 6 && !g.has(T)) {
|
|
2597
2598
|
et.has(A) || (ee.push([`… ${H.get(A) ?? 0} similar siblings omitted`]), et.add(A));
|
|
2598
2599
|
continue;
|
|
2599
2600
|
}
|
|
@@ -2604,11 +2605,11 @@ function mp(t, e) {
|
|
|
2604
2605
|
if (B.shadowRoot)
|
|
2605
2606
|
for (const T of Array.from(B.shadowRoot.children))
|
|
2606
2607
|
T instanceof HTMLElement && ne.push(L(T, Q + 1));
|
|
2607
|
-
const re = [...De, ...ne],
|
|
2608
|
+
const re = [...De, ...ne], Ne = Pe.length > 0 || q || re.some((T) => T.hasUsefulContent), z = zt(
|
|
2608
2609
|
[Pe, ...re.map((T) => T.textPreview)].filter(Boolean).join(" ")
|
|
2609
|
-
).slice(0, 180), ve = B.hasAttribute("contenteditable") && (Pe.length > 0 || !B.querySelector("[contenteditable]")), C = d.some((T) => B.hasAttribute(T)) || !!Qe || ve, k = (B.getClientRects().length > 0 || ge.display === "contents") && (n.has(
|
|
2610
|
+
).slice(0, 180), ve = B.hasAttribute("contenteditable") && (Pe.length > 0 || !B.querySelector("[contenteditable]")), C = d.some((T) => B.hasAttribute(T)) || !!Qe || ve, k = (B.getClientRects().length > 0 || ge.display === "contents") && (n.has(N) || C || K) && (Ne || K) && (!o.has(N) || Ne || C || K), ae = k ? 1 : 0, F = [];
|
|
2610
2611
|
if (k) {
|
|
2611
|
-
const T = re.some((W) => W.containsTextElement), A = i.has(
|
|
2612
|
+
const T = re.some((W) => W.containsTextElement), A = i.has(N) && !T ? z : Pe;
|
|
2612
2613
|
F.push(Sr(B, p, r, A.slice(0, 180)));
|
|
2613
2614
|
}
|
|
2614
2615
|
for (const T of ee)
|
|
@@ -2617,18 +2618,18 @@ function mp(t, e) {
|
|
|
2617
2618
|
if (V.length > 0) {
|
|
2618
2619
|
const T = V.slice(0, 20);
|
|
2619
2620
|
V.length > T.length && T.push("… shadow DOM omitted");
|
|
2620
|
-
const A =
|
|
2621
|
+
const A = N.includes("tooltip") || N.includes("popper") || N.includes("loader");
|
|
2621
2622
|
if (Q < 2 && !A) {
|
|
2622
|
-
const W = k ? "#shadow-root" : `${
|
|
2623
|
+
const W = k ? "#shadow-root" : `${N} #shadow-root`;
|
|
2623
2624
|
F.push(...qn([W, ...qn(T, 1)], ae));
|
|
2624
2625
|
} else
|
|
2625
2626
|
F.push(...qn(T, ae));
|
|
2626
2627
|
}
|
|
2627
2628
|
return {
|
|
2628
2629
|
lines: F,
|
|
2629
|
-
hasUsefulContent:
|
|
2630
|
+
hasUsefulContent: Ne,
|
|
2630
2631
|
textPreview: z,
|
|
2631
|
-
containsTextElement: i.has(
|
|
2632
|
+
containsTextElement: i.has(N) || re.some((T) => T.containsTextElement)
|
|
2632
2633
|
};
|
|
2633
2634
|
};
|
|
2634
2635
|
return [`--- ${P} ---`, ...L(I, 0).lines].join(`
|
|
@@ -3009,26 +3010,26 @@ function Dp(t) {
|
|
|
3009
3010
|
}
|
|
3010
3011
|
return "🔎 Searching the web";
|
|
3011
3012
|
}
|
|
3012
|
-
return
|
|
3013
|
+
return Np(t);
|
|
3013
3014
|
}
|
|
3014
|
-
function
|
|
3015
|
+
function Np(t) {
|
|
3015
3016
|
if (typeof t.summary == "string" && t.summary.trim().length > 0)
|
|
3016
|
-
return
|
|
3017
|
+
return Nt(t.summary);
|
|
3017
3018
|
if (typeof t.arguments == "string")
|
|
3018
3019
|
try {
|
|
3019
3020
|
const e = JSON.parse(t.arguments);
|
|
3020
3021
|
if (typeof e.summary == "string" && e.summary.trim().length > 0)
|
|
3021
|
-
return
|
|
3022
|
+
return Nt(e.summary);
|
|
3022
3023
|
} catch {
|
|
3023
|
-
return typeof t.name == "string" && t.name.trim().length > 0 ?
|
|
3024
|
+
return typeof t.name == "string" && t.name.trim().length > 0 ? Nt(t.name) : "🛠️ Run tool";
|
|
3024
3025
|
}
|
|
3025
|
-
return typeof t.name == "string" && t.name.trim().length > 0 ?
|
|
3026
|
+
return typeof t.name == "string" && t.name.trim().length > 0 ? Nt(t.name) : "🛠️ Run tool";
|
|
3026
3027
|
}
|
|
3027
|
-
function
|
|
3028
|
+
function Nt(t) {
|
|
3028
3029
|
const e = t.trim() || "Run tool", n = e.codePointAt(0) ?? 0;
|
|
3029
3030
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? e : `🛠️ ${e}`;
|
|
3030
3031
|
}
|
|
3031
|
-
function
|
|
3032
|
+
function Up(t) {
|
|
3032
3033
|
if (t == null)
|
|
3033
3034
|
return t;
|
|
3034
3035
|
if (typeof t != "object")
|
|
@@ -3128,7 +3129,7 @@ function Hp(t) {
|
|
|
3128
3129
|
return !e || !n ? null : {
|
|
3129
3130
|
id: `transient-activity:${e}`,
|
|
3130
3131
|
role: "tool",
|
|
3131
|
-
content:
|
|
3132
|
+
content: Nt(
|
|
3132
3133
|
typeof t.summary == "string" ? t.summary : "Running browser tool"
|
|
3133
3134
|
),
|
|
3134
3135
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -3283,13 +3284,13 @@ function Xp(t) {
|
|
|
3283
3284
|
const e = gn(t);
|
|
3284
3285
|
if (e === null)
|
|
3285
3286
|
return null;
|
|
3286
|
-
const i =
|
|
3287
|
+
const i = Ut(t[e])?.page;
|
|
3287
3288
|
if (!i || typeof i != "object")
|
|
3288
3289
|
return null;
|
|
3289
3290
|
const o = i.url;
|
|
3290
3291
|
return typeof o == "string" ? o : null;
|
|
3291
3292
|
}
|
|
3292
|
-
function
|
|
3293
|
+
function Ut(t) {
|
|
3293
3294
|
if (!t || typeof t != "object")
|
|
3294
3295
|
return null;
|
|
3295
3296
|
const e = t.data;
|
|
@@ -3353,7 +3354,7 @@ function lo(t, e) {
|
|
|
3353
3354
|
const n = pt(e);
|
|
3354
3355
|
if (!n)
|
|
3355
3356
|
return null;
|
|
3356
|
-
const i = t.find((s) => se(s, "id") === n), o =
|
|
3357
|
+
const i = t.find((s) => se(s, "id") === n), o = Ut(i);
|
|
3357
3358
|
return o?.type === "message" && o.role === "user" && typeof o.clientMessageId == "string" ? o.clientMessageId : null;
|
|
3358
3359
|
}
|
|
3359
3360
|
function Qp(t, e) {
|
|
@@ -3674,16 +3675,16 @@ function Dr(t, e) {
|
|
|
3674
3675
|
function co(t) {
|
|
3675
3676
|
return t.type || vc(t.name) || "application/octet-stream";
|
|
3676
3677
|
}
|
|
3677
|
-
function
|
|
3678
|
-
|
|
3678
|
+
function Nr(t) {
|
|
3679
|
+
Ur({
|
|
3679
3680
|
name: t.name,
|
|
3680
3681
|
mimeType: co(t),
|
|
3681
3682
|
sizeBytes: t.size
|
|
3682
3683
|
});
|
|
3683
3684
|
}
|
|
3684
|
-
function
|
|
3685
|
+
function Ur(t) {
|
|
3685
3686
|
const e = xc(t.name), n = t.mimeType.trim().toLowerCase();
|
|
3686
|
-
if (!
|
|
3687
|
+
if (!Ul.has(`${e}:${n}`))
|
|
3687
3688
|
throw new Error("This attachment type is not supported by the embedded model provider");
|
|
3688
3689
|
if (t.sizeBytes <= 0 || t.sizeBytes >= br)
|
|
3689
3690
|
throw new Error("Embedded attachments must be between 1 byte and less than 50 MB");
|
|
@@ -3818,11 +3819,11 @@ function Ds(t) {
|
|
|
3818
3819
|
function Mc(t) {
|
|
3819
3820
|
return Me({
|
|
3820
3821
|
...t,
|
|
3821
|
-
requestBody:
|
|
3822
|
-
responseBody:
|
|
3822
|
+
requestBody: Ns(t.requestBody),
|
|
3823
|
+
responseBody: Ns(t.responseBody)
|
|
3823
3824
|
});
|
|
3824
3825
|
}
|
|
3825
|
-
function
|
|
3826
|
+
function Ns(t) {
|
|
3826
3827
|
if (typeof t != "string")
|
|
3827
3828
|
return t;
|
|
3828
3829
|
const e = t.trim();
|
|
@@ -3900,7 +3901,7 @@ async function Wn(t, e) {
|
|
|
3900
3901
|
try {
|
|
3901
3902
|
return await t();
|
|
3902
3903
|
} catch (o) {
|
|
3903
|
-
if (n = o, i >= Is - 1 || !
|
|
3904
|
+
if (n = o, i >= Is - 1 || !Nc(o))
|
|
3904
3905
|
throw o;
|
|
3905
3906
|
await Dc(i);
|
|
3906
3907
|
}
|
|
@@ -3908,13 +3909,13 @@ async function Wn(t, e) {
|
|
|
3908
3909
|
}
|
|
3909
3910
|
function Dc(t) {
|
|
3910
3911
|
return new Promise((e) => {
|
|
3911
|
-
window.setTimeout(e,
|
|
3912
|
+
window.setTimeout(e, Nl[t] ?? 0);
|
|
3912
3913
|
});
|
|
3913
3914
|
}
|
|
3914
|
-
function Uc(t) {
|
|
3915
|
-
return t instanceof Vn ? Nc(t.status) : t instanceof TypeError;
|
|
3916
|
-
}
|
|
3917
3915
|
function Nc(t) {
|
|
3916
|
+
return t instanceof Vn ? Uc(t.status) : t instanceof TypeError;
|
|
3917
|
+
}
|
|
3918
|
+
function Uc(t) {
|
|
3918
3919
|
return t === 408 || t === 409 || t === 429 || t >= 500;
|
|
3919
3920
|
}
|
|
3920
3921
|
function Oc(t) {
|
|
@@ -3967,15 +3968,15 @@ function Gc(t) {
|
|
|
3967
3968
|
const e = t.match(Hc)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
|
|
3968
3969
|
return `${$r(n)}${e}`;
|
|
3969
3970
|
}
|
|
3970
|
-
const Kc = "#7c3aed", ei = "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", ti = "#2c2a1e",
|
|
3971
|
+
const Kc = "#7c3aed", ei = "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", ti = "#2c2a1e", Us = [253, 250, 241], Os = 3.5;
|
|
3971
3972
|
function jr(t) {
|
|
3972
3973
|
const e = Gr(t);
|
|
3973
|
-
if (zs(pn(e),
|
|
3974
|
+
if (zs(pn(e), Us) >= Os)
|
|
3974
3975
|
return e;
|
|
3975
3976
|
let i = pn(e);
|
|
3976
3977
|
const o = pn(ti);
|
|
3977
3978
|
for (let s = 0; s < 6; s += 1)
|
|
3978
|
-
if (i = Xc(i, o, 0.22), zs(i,
|
|
3979
|
+
if (i = Xc(i, o, 0.22), zs(i, Us) >= Os)
|
|
3979
3980
|
return uo(i);
|
|
3980
3981
|
return uo(i);
|
|
3981
3982
|
}
|
|
@@ -4247,7 +4248,7 @@ function wd(t, e = Date.now(), n) {
|
|
|
4247
4248
|
}
|
|
4248
4249
|
const bd = 6e4, Vr = 100, yd = 1e4, _d = 5e3;
|
|
4249
4250
|
let xd = 0;
|
|
4250
|
-
const vd = "product-agent:sdk-preview-socket-connect", Sd = "product-agent:sdk-preview-socket-send", Id = "product-agent:sdk-preview-socket-close", Td = "product-agent:sdk-preview-socket-open", Ed = "product-agent:sdk-preview-socket-message", Cd = "product-agent:sdk-preview-socket-error", kd = "product-agent:sdk-preview-socket-closed", Ws = "product-agent:sdk-preview-socket-id", Ad = "data-pluno-sdk-preview-channel", Yr = "data-pluno-auto-mounted", Ke = "__plunoProductAgentAutoMountOwner", Md = 1e4, Rd = "Failed to load Pluno widget token", Hs = "Timed out loading Pluno widget token", Pd = "pluno.productAgent.widgetClientId.", ji = /* @__PURE__ */ new Set(), Ld = "product-agent:preview-diagnostic", Xr = "pluno.productAgent.sharePromptsDisabled", Dd = 3, $s = 'dialog[open], [aria-modal="true"], [role="dialog"]', js = 1500,
|
|
4251
|
+
const vd = "product-agent:sdk-preview-socket-connect", Sd = "product-agent:sdk-preview-socket-send", Id = "product-agent:sdk-preview-socket-close", Td = "product-agent:sdk-preview-socket-open", Ed = "product-agent:sdk-preview-socket-message", Cd = "product-agent:sdk-preview-socket-error", kd = "product-agent:sdk-preview-socket-closed", Ws = "product-agent:sdk-preview-socket-id", Ad = "data-pluno-sdk-preview-channel", Yr = "data-pluno-auto-mounted", Ke = "__plunoProductAgentAutoMountOwner", Md = 1e4, Rd = "Failed to load Pluno widget token", Hs = "Timed out loading Pluno widget token", Pd = "pluno.productAgent.widgetClientId.", ji = /* @__PURE__ */ new Set(), Ld = "product-agent:preview-diagnostic", Xr = "pluno.productAgent.sharePromptsDisabled", Dd = 3, $s = 'dialog[open], [aria-modal="true"], [role="dialog"]', js = 1500, Nd = 5e3, Ud = 500, Od = "No recent chats for this page yet.", Ve = {
|
|
4251
4252
|
launcherLabel: "Ask for anything...",
|
|
4252
4253
|
accentColor: "#7c3aed",
|
|
4253
4254
|
colorScheme: "light",
|
|
@@ -4292,7 +4293,7 @@ const vd = "product-agent:sdk-preview-socket-connect", Sd = "product-agent:sdk-p
|
|
|
4292
4293
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
4293
4294
|
pathStrokeWidth: "2.45"
|
|
4294
4295
|
}
|
|
4295
|
-
], Yd = 11, Xd = 13, ni = 4,
|
|
4296
|
+
], Yd = 11, Xd = 13, ni = 4, No = 10, Uo = 40, Jd = "movable-launcher-position-v2", ea = "pluno-pa-widget-styles", ta = "data-pluno-pa-widget-styles";
|
|
4296
4297
|
let Vs = 0;
|
|
4297
4298
|
function Zd(t) {
|
|
4298
4299
|
return (e) => new Ye(e, t);
|
|
@@ -4314,6 +4315,7 @@ async function Qd(t = {}) {
|
|
|
4314
4315
|
tokenEndpoint: t.tokenEndpoint,
|
|
4315
4316
|
backendUrl: t.backendUrl,
|
|
4316
4317
|
metadata: t.metadata,
|
|
4318
|
+
productVariant: t.productVariant ?? "customer_embedded",
|
|
4317
4319
|
entrySurface: t.entrySurface,
|
|
4318
4320
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
4319
4321
|
clientId: t.clientId,
|
|
@@ -4394,7 +4396,7 @@ async function Qd(t = {}) {
|
|
|
4394
4396
|
e.movableLauncher,
|
|
4395
4397
|
e.showLauncherMinimizeButton
|
|
4396
4398
|
), s.appendChild(r);
|
|
4397
|
-
const p = Og(e), d = e.layout === "floating" ? e.initialDisplayState ??
|
|
4399
|
+
const p = Og(e), d = e.layout === "floating" ? e.initialDisplayState ?? Ng(e) : "shown";
|
|
4398
4400
|
dr(e, d);
|
|
4399
4401
|
let g = e.movableLauncher ? p.launcherPosition : null, c = g !== null, h = p.panelSize, _ = null;
|
|
4400
4402
|
r.style.setProperty(
|
|
@@ -4429,7 +4431,7 @@ async function Qd(t = {}) {
|
|
|
4429
4431
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
4430
4432
|
), Q = Array.from(
|
|
4431
4433
|
r.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
4432
|
-
),
|
|
4434
|
+
), N = r.querySelector(
|
|
4433
4435
|
".pluno-pa-widget__close"
|
|
4434
4436
|
), ge = r.querySelector(
|
|
4435
4437
|
".pluno-pa-widget__composer"
|
|
@@ -4461,7 +4463,7 @@ async function Qd(t = {}) {
|
|
|
4461
4463
|
".pluno-pa-widget__history-status"
|
|
4462
4464
|
), re = r.querySelector(
|
|
4463
4465
|
".pluno-pa-widget__timeline-jump"
|
|
4464
|
-
),
|
|
4466
|
+
), Ne = r.querySelector(
|
|
4465
4467
|
".pluno-pa-widget__active-users-counter"
|
|
4466
4468
|
), z = r.querySelector(
|
|
4467
4469
|
".pluno-pa-widget__timeline"
|
|
@@ -4483,7 +4485,7 @@ async function Qd(t = {}) {
|
|
|
4483
4485
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
4484
4486
|
), W = r.querySelector(
|
|
4485
4487
|
".pluno-pa-widget__proactive-suggestion"
|
|
4486
|
-
),
|
|
4488
|
+
), Ue = r.querySelector(
|
|
4487
4489
|
".pluno-pa-widget__proactive-suggestion-query"
|
|
4488
4490
|
), Se = r.querySelector(
|
|
4489
4491
|
".pluno-pa-widget__proactive-suggestion-run"
|
|
@@ -4504,7 +4506,7 @@ async function Qd(t = {}) {
|
|
|
4504
4506
|
), fn = r.querySelector(
|
|
4505
4507
|
".pluno-pa-widget__proactive-suggestion-feedback-status"
|
|
4506
4508
|
);
|
|
4507
|
-
if (!m || !b || !O || !
|
|
4509
|
+
if (!m || !b || !O || !N || !ge || !K || !Qe || !Pe || !q || !Le || !x || !H || !pe || !ce || !et || !ee || !De || !ne || !re || !Ne || !z || !ve)
|
|
4508
4510
|
throw new Error("Failed to mount Pluno widget");
|
|
4509
4511
|
if (e.movableLauncher && !v)
|
|
4510
4512
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
@@ -4512,10 +4514,10 @@ async function Qd(t = {}) {
|
|
|
4512
4514
|
throw new Error("Failed to mount Pluno widget panel drag handle");
|
|
4513
4515
|
let Fe = null, ie = "idle";
|
|
4514
4516
|
const tt = () => {
|
|
4515
|
-
if (!W || !
|
|
4517
|
+
if (!W || !Ue || !Fo || !Wo || !he || !qt || !fn)
|
|
4516
4518
|
return;
|
|
4517
4519
|
const a = e.proactiveSuggestion ?? Fe;
|
|
4518
|
-
W.hidden = a === null || E.getState().isThinking,
|
|
4520
|
+
W.hidden = a === null || E.getState().isThinking, Ue.textContent = a?.suggestedQuery ?? "", Fo.hidden = e.proactiveSuggestion === null, Wo.hidden = Fe === null;
|
|
4519
4521
|
const u = ie === "success";
|
|
4520
4522
|
he.hidden = u, qt.hidden = u, qt.disabled = ie === "submitting" || he.value.trim().length === 0, qt.textContent = ie === "submitting" ? "Sending…" : "Send feedback", fn.textContent = ie === "success" ? "Thanks — this helps improve your suggestions." : ie === "error" ? "Couldn’t send feedback. Please try again." : "Tell Pluno what made this suggestion miss the mark.", fn.classList.toggle(
|
|
4521
4523
|
"pluno-pa-widget__proactive-suggestion-feedback-status--success",
|
|
@@ -4537,7 +4539,7 @@ async function Qd(t = {}) {
|
|
|
4537
4539
|
}
|
|
4538
4540
|
);
|
|
4539
4541
|
};
|
|
4540
|
-
Le.hidden = !e.attachmentsEnabled, q.disabled = !e.attachmentsEnabled, q.accept = e.
|
|
4542
|
+
Le.hidden = !e.attachmentsEnabled, q.disabled = !e.attachmentsEnabled, q.accept = e.productVariant === "personal" ? "" : Ol, ir(b), ir(x);
|
|
4541
4543
|
let oe = [], wn = !1, We = null;
|
|
4542
4544
|
const di = (a) => a === x ? "widget_composer" : a === b ? "widget_launcher" : a && s.contains(a) ? "widget_control" : a === f.body ? "body" : a === f.documentElement ? "document" : a ? "host_page" : "none", He = (a, u, y = {}) => {
|
|
4543
4545
|
const S = Hn(f), R = y.skipIfAlreadyFocused === !0 && S === a;
|
|
@@ -4581,13 +4583,14 @@ async function Qd(t = {}) {
|
|
|
4581
4583
|
}, Ho = e.loginRequired || e.signupRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async () => ma(e.tokenEndpoint) : void 0);
|
|
4582
4584
|
if (!e.loginRequired && !e.signupRequired && !e.token && !Ho && !e.webSocketFactory)
|
|
4583
4585
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
4584
|
-
const xa = window.fetch.bind(window), ui =
|
|
4586
|
+
const xa = window.fetch.bind(window), ui = Ug(e.clientId);
|
|
4585
4587
|
let E;
|
|
4586
4588
|
try {
|
|
4587
4589
|
const a = {
|
|
4588
4590
|
token: e.token,
|
|
4589
4591
|
tokenProvider: Ho,
|
|
4590
4592
|
backendUrl: e.backendUrl,
|
|
4593
|
+
productVariant: e.productVariant,
|
|
4591
4594
|
metadata: () => ({
|
|
4592
4595
|
...typeof e.metadata == "function" ? e.metadata() : e.metadata ?? {},
|
|
4593
4596
|
...!E.getState().sessionId && e.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
@@ -4743,7 +4746,7 @@ async function Qd(t = {}) {
|
|
|
4743
4746
|
r.classList.remove("pluno-pa-widget--minimized"), m.removeAttribute("tabindex"), m.removeAttribute("role"), m.removeAttribute("aria-label"), !r.classList.contains("pluno-pa-widget--open") && !r.classList.contains("pluno-pa-widget--closing") && Gt(!1), u && Sn("shown");
|
|
4744
4747
|
return;
|
|
4745
4748
|
}
|
|
4746
|
-
Ie !== null && (window.clearTimeout(Ie), Ie = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), O.hidden = !0,
|
|
4749
|
+
Ie !== null && (window.clearTimeout(Ie), Ie = null), r.classList.remove("pluno-pa-widget--open"), r.classList.remove("pluno-pa-widget--closing"), r.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), O.hidden = !0, N.hidden = !0, m.tabIndex = 0, x.value = "", at(
|
|
4747
4750
|
r,
|
|
4748
4751
|
Ki(
|
|
4749
4752
|
r,
|
|
@@ -4767,7 +4770,7 @@ async function Qd(t = {}) {
|
|
|
4767
4770
|
panelRect: Xi(O),
|
|
4768
4771
|
viewport: _e(),
|
|
4769
4772
|
panelHidden: O.hidden,
|
|
4770
|
-
closeHidden:
|
|
4773
|
+
closeHidden: N.hidden,
|
|
4771
4774
|
...u
|
|
4772
4775
|
});
|
|
4773
4776
|
}, Gt = (a = !0) => {
|
|
@@ -4943,7 +4946,7 @@ async function Qd(t = {}) {
|
|
|
4943
4946
|
a === "composer_input" && yi?.scope === y && u - yi.requestedAt < bd || (a === "composer_input" && (yi = { scope: y, requestedAt: u }), E.warmup(a));
|
|
4944
4947
|
}, $e = (a = "", u = !0, y = !0, S = !0) => {
|
|
4945
4948
|
const R = r.classList.contains("pluno-pa-widget--open");
|
|
4946
|
-
!R && S && ns("panel_open"), ts(), Xt && (Xt = !1, Ii()), r.classList.contains("pluno-pa-widget--open") || (_ = null), Ie !== null && (window.clearTimeout(Ie), Ie = null), jt("shown", !1), O.hidden = !1,
|
|
4949
|
+
!R && S && ns("panel_open"), ts(), Xt && (Xt = !1, Ii()), r.classList.contains("pluno-pa-widget--open") || (_ = null), Ie !== null && (window.clearTimeout(Ie), Ie = null), jt("shown", !1), O.hidden = !1, N.hidden = !1, Ji(
|
|
4947
4950
|
B,
|
|
4948
4951
|
wi()
|
|
4949
4952
|
), r.classList.remove("pluno-pa-widget--closing");
|
|
@@ -4970,7 +4973,7 @@ async function Qd(t = {}) {
|
|
|
4970
4973
|
});
|
|
4971
4974
|
}, _i = () => {
|
|
4972
4975
|
Ie !== null && (window.clearTimeout(Ie), Ie = null), m.hidden = !1, g && (Gt(!1), _t("Closing launcher at stored position")), r.classList.remove("pluno-pa-widget--open"), r.classList.add("pluno-pa-widget--closing"), Y(), e.onPanelOpenChange?.(!1), Ie = window.setTimeout(() => {
|
|
4973
|
-
O.hidden = !0,
|
|
4976
|
+
O.hidden = !0, N.hidden = !0, _ = null, r.classList.remove("pluno-pa-widget--closing");
|
|
4974
4977
|
}, 220);
|
|
4975
4978
|
};
|
|
4976
4979
|
m.addEventListener("submit", (a) => {
|
|
@@ -5049,7 +5052,7 @@ async function Qd(t = {}) {
|
|
|
5049
5052
|
return;
|
|
5050
5053
|
}
|
|
5051
5054
|
Si(y, null);
|
|
5052
|
-
},
|
|
5055
|
+
}, Ud)) : (xt !== null && (window.clearInterval(xt), xt = null), ze !== null && (window.clearTimeout(ze), ze = null), Tn = null);
|
|
5053
5056
|
}, Ra = () => {
|
|
5054
5057
|
xt !== null && (window.clearInterval(xt), xt = null), ze !== null && (window.clearTimeout(ze), ze = null), te !== null && (window.clearTimeout(te), te = null);
|
|
5055
5058
|
}, ss = (a) => {
|
|
@@ -5105,7 +5108,7 @@ async function Qd(t = {}) {
|
|
|
5105
5108
|
if (S)
|
|
5106
5109
|
return Vt(D, y), !0;
|
|
5107
5110
|
const Pt = Date.now();
|
|
5108
|
-
return Tn !== null && Pt - Tn <=
|
|
5111
|
+
return Tn !== null && Pt - Tn <= Nd ? (Vt(D, y), !0) : (Tn = Pt, !0);
|
|
5109
5112
|
};
|
|
5110
5113
|
R(a.relatedTarget) || window.setTimeout(() => {
|
|
5111
5114
|
je === null && y.isConnected && R(vi());
|
|
@@ -5116,7 +5119,7 @@ async function Qd(t = {}) {
|
|
|
5116
5119
|
a.stopPropagation();
|
|
5117
5120
|
}), P?.addEventListener("click", (a) => {
|
|
5118
5121
|
a.preventDefault(), a.stopPropagation(), jt("minimized");
|
|
5119
|
-
}),
|
|
5122
|
+
}), N.addEventListener("click", _i), z.addEventListener("wheel", (a) => {
|
|
5120
5123
|
xn(a.deltaY < 0 ? "up" : null);
|
|
5121
5124
|
}), z.addEventListener("pointerdown", (a) => {
|
|
5122
5125
|
wt = a.target === z ? a.clientY : null;
|
|
@@ -5229,7 +5232,7 @@ async function Qd(t = {}) {
|
|
|
5229
5232
|
const u = Yu(
|
|
5230
5233
|
E,
|
|
5231
5234
|
a,
|
|
5232
|
-
|
|
5235
|
+
e.productVariant === "customer_embedded"
|
|
5233
5236
|
);
|
|
5234
5237
|
if (oe = [...oe, ...u], Ft(), La(), le(), G(E.getState()), !r.classList.contains("pluno-pa-widget--open")) {
|
|
5235
5238
|
$e();
|
|
@@ -5350,7 +5353,7 @@ async function Qd(t = {}) {
|
|
|
5350
5353
|
}, Pn = () => {
|
|
5351
5354
|
const a = E.getState();
|
|
5352
5355
|
return a.assistantDraft.trim().length > 0 && a.assistantDraftPhase !== "commentary";
|
|
5353
|
-
},
|
|
5356
|
+
}, Na = async () => {
|
|
5354
5357
|
if (!Qt || !C || kt || J || !E.getState().isThinking || Pn())
|
|
5355
5358
|
return;
|
|
5356
5359
|
let a;
|
|
@@ -5391,12 +5394,12 @@ async function Qd(t = {}) {
|
|
|
5391
5394
|
}), Dn();
|
|
5392
5395
|
let Mt = null, ls = () => {
|
|
5393
5396
|
};
|
|
5394
|
-
const
|
|
5397
|
+
const Ua = !!(e.sdkPreviewChannelId && e.referralLinkLoader), Nn = /* @__PURE__ */ new Map(), Mi = /* @__PURE__ */ new Map(), Ri = () => x.value.trim().length > 0 || oe.length > 0, Oa = () => {
|
|
5395
5398
|
const a = Mt !== null && Qi(E.getState(), Ri());
|
|
5396
|
-
|
|
5399
|
+
Ne.hidden = !a, a && Mt !== null && ia(Ne, Mt);
|
|
5397
5400
|
};
|
|
5398
5401
|
let Rt = null;
|
|
5399
|
-
const Ge = /* @__PURE__ */ new Map(),
|
|
5402
|
+
const Ge = /* @__PURE__ */ new Map(), Un = /* @__PURE__ */ new Set(), za = async (a) => {
|
|
5400
5403
|
if (e.integrationAuthHandler) {
|
|
5401
5404
|
Ge.set(a.authRequestId, { status: "connecting" }), G(E.getState());
|
|
5402
5405
|
try {
|
|
@@ -5410,7 +5413,7 @@ async function Qd(t = {}) {
|
|
|
5410
5413
|
G(E.getState());
|
|
5411
5414
|
}
|
|
5412
5415
|
}, On = (a = {}) => {
|
|
5413
|
-
ot = !0, Te(!0, "newSession"), Ee(), de = !1, Ce(), E.startNewSession(a), gi.clear(), Ge.clear(),
|
|
5416
|
+
ot = !0, Te(!0, "newSession"), Ee(), de = !1, Ce(), E.startNewSession(a), gi.clear(), Ge.clear(), Un.clear(), x.value = "", oe = [], Ft(), sn(x), Y(), le(), He(x, "new_chat"), G(E.getState());
|
|
5414
5417
|
};
|
|
5415
5418
|
Se?.addEventListener("click", () => {
|
|
5416
5419
|
const a = e.proactiveSuggestion;
|
|
@@ -5460,7 +5463,7 @@ async function Qd(t = {}) {
|
|
|
5460
5463
|
), Rt.addEventListener("click", () => On()), pe.insertBefore(Rt, ce));
|
|
5461
5464
|
}, G = (a) => {
|
|
5462
5465
|
if (it !== null && (window.clearTimeout(it), it = null), Ce(), tt(), Bo(a.lastErrorCode) ? Et = a.lastErrorCode : e.billingStatus?.creditsUsed !== null && !Re(e.billingStatus) && (Et = null), mn(Et), e.loginRequired) {
|
|
5463
|
-
|
|
5466
|
+
Nn.clear(), Mi.clear(), lr(
|
|
5464
5467
|
z,
|
|
5465
5468
|
H,
|
|
5466
5469
|
Pi,
|
|
@@ -5473,7 +5476,7 @@ async function Qd(t = {}) {
|
|
|
5473
5476
|
return;
|
|
5474
5477
|
}
|
|
5475
5478
|
if (e.signupRequired) {
|
|
5476
|
-
|
|
5479
|
+
Nn.clear(), Mi.clear(), lr(
|
|
5477
5480
|
z,
|
|
5478
5481
|
H,
|
|
5479
5482
|
Pi,
|
|
@@ -5493,14 +5496,14 @@ async function Qd(t = {}) {
|
|
|
5493
5496
|
ve,
|
|
5494
5497
|
H,
|
|
5495
5498
|
Pi,
|
|
5496
|
-
|
|
5499
|
+
Ne,
|
|
5497
5500
|
a,
|
|
5498
5501
|
Mt,
|
|
5499
5502
|
Mt !== null && Qi(a, Ri()),
|
|
5500
5503
|
S,
|
|
5501
5504
|
() => ht.enabled,
|
|
5502
5505
|
gi,
|
|
5503
|
-
|
|
5506
|
+
Nn,
|
|
5504
5507
|
Mi,
|
|
5505
5508
|
Y,
|
|
5506
5509
|
An,
|
|
@@ -5523,7 +5526,7 @@ async function Qd(t = {}) {
|
|
|
5523
5526
|
za(D);
|
|
5524
5527
|
}
|
|
5525
5528
|
} : void 0,
|
|
5526
|
-
|
|
5529
|
+
Ua && !hi ? {
|
|
5527
5530
|
dismissedCandidateIds: Wt,
|
|
5528
5531
|
actionCandidate: Mn,
|
|
5529
5532
|
error: Zt,
|
|
@@ -5554,7 +5557,7 @@ async function Qd(t = {}) {
|
|
|
5554
5557
|
Math.min(j, 2147483647)
|
|
5555
5558
|
)), S ? (ft = z.scrollTop, Ee()) : y && _u(a) && va();
|
|
5556
5559
|
}, cs = () => {
|
|
5557
|
-
f.getSelection()?.isCollapsed !== !1 && pg(
|
|
5560
|
+
f.getSelection()?.isCollapsed !== !1 && pg(Nn) && G(E.getState());
|
|
5558
5561
|
};
|
|
5559
5562
|
f.addEventListener(
|
|
5560
5563
|
"selectionchange",
|
|
@@ -5568,8 +5571,8 @@ async function Qd(t = {}) {
|
|
|
5568
5571
|
);
|
|
5569
5572
|
await Promise.all(
|
|
5570
5573
|
u.map(async (y) => {
|
|
5571
|
-
if (!(Ge.has(y.authRequestId) ||
|
|
5572
|
-
|
|
5574
|
+
if (!(Ge.has(y.authRequestId) || Un.has(y.authRequestId))) {
|
|
5575
|
+
Un.add(y.authRequestId), Ge.set(y.authRequestId, {
|
|
5573
5576
|
status: "checking"
|
|
5574
5577
|
}), G(E.getState());
|
|
5575
5578
|
try {
|
|
@@ -5581,7 +5584,7 @@ async function Qd(t = {}) {
|
|
|
5581
5584
|
error: S instanceof Error ? S.message : `Could not load ${y.appName} connection status.`
|
|
5582
5585
|
});
|
|
5583
5586
|
} finally {
|
|
5584
|
-
|
|
5587
|
+
Un.delete(y.authRequestId);
|
|
5585
5588
|
}
|
|
5586
5589
|
J || G(E.getState());
|
|
5587
5590
|
}
|
|
@@ -5601,7 +5604,7 @@ async function Qd(t = {}) {
|
|
|
5601
5604
|
Dn();
|
|
5602
5605
|
const u = Ai && !a.isThinking, y = jo !== location.origin || Go !== a.sessionId || Ko !== (a.user?.id ?? null), S = Ai !== a.isThinking, R = mi !== "connected" && a.status === "connected", j = mi === "connected" && a.status !== "connected";
|
|
5603
5606
|
jo = location.origin, Go = a.sessionId, Ko = a.user?.id ?? null, mi = a.status, Ai = a.isThinking, j && (me !== null && (window.clearTimeout(me), me = null), yt += 1, fe = !1, Oe = [], Ht = null, bt = null, _n = !1, Ce()), r.classList.contains("pluno-pa-widget--open") && a.status === "connected" && (y || S || R) && vn(), a.isThinking && !Pn() && Qt && !kt && Ct === null && C?.hidden !== !1 && (Ct = window.setTimeout(() => {
|
|
5604
|
-
Ct = null,
|
|
5607
|
+
Ct = null, Na();
|
|
5605
5608
|
}, yd)), (!a.isThinking || Pn()) && (as(), Rn()), u && !r.classList.contains("pluno-pa-widget--open") && (Xt = !0), Ii(), a.appearance ? (ki = !0, ue(
|
|
5606
5609
|
"web-sdk.widget",
|
|
5607
5610
|
"Agent state supplied appearance",
|
|
@@ -5825,7 +5828,7 @@ function ou({
|
|
|
5825
5828
|
}, v = (b) => {
|
|
5826
5829
|
if (t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing"))
|
|
5827
5830
|
return;
|
|
5828
|
-
const I = b.shiftKey ?
|
|
5831
|
+
const I = b.shiftKey ? Uo : No, P = i();
|
|
5829
5832
|
let O = null;
|
|
5830
5833
|
b.key === "ArrowUp" ? O = { x: P.x, y: P.y - I } : b.key === "ArrowDown" ? O = { x: P.x, y: P.y + I } : b.key === "ArrowLeft" ? O = { x: P.x - I, y: P.y } : b.key === "ArrowRight" && (O = { x: P.x + I, y: P.y }), O && (b.preventDefault(), b.stopPropagation(), o(O), s());
|
|
5831
5834
|
};
|
|
@@ -5856,7 +5859,7 @@ function su({
|
|
|
5856
5859
|
}, _ = (f) => {
|
|
5857
5860
|
s === f.pointerId && (f.preventDefault(), d());
|
|
5858
5861
|
}, w = (f) => {
|
|
5859
|
-
const m = f.shiftKey ?
|
|
5862
|
+
const m = f.shiftKey ? Uo : No, v = n();
|
|
5860
5863
|
let b = null;
|
|
5861
5864
|
f.key === "ArrowUp" ? b = { x: v.x, y: v.y - m } : f.key === "ArrowDown" ? b = { x: v.x, y: v.y + m } : f.key === "ArrowLeft" ? b = { x: v.x - m, y: v.y } : f.key === "ArrowRight" && (b = { x: v.x + m, y: v.y }), b && (f.preventDefault(), f.stopPropagation(), i(b), o());
|
|
5862
5865
|
};
|
|
@@ -5890,7 +5893,7 @@ function ru({
|
|
|
5890
5893
|
}, w = (m) => {
|
|
5891
5894
|
s === m.pointerId && (m.preventDefault(), g());
|
|
5892
5895
|
}, f = (m) => {
|
|
5893
|
-
const b = m.currentTarget.dataset.resizeDirection, I = m.shiftKey ?
|
|
5896
|
+
const b = m.currentTarget.dataset.resizeDirection, I = m.shiftKey ? Uo : No, P = n();
|
|
5894
5897
|
let O = 0, L = 0;
|
|
5895
5898
|
Js(b) && (m.key === "ArrowLeft" ? O = -I : m.key === "ArrowRight" ? O = I : m.key === "ArrowUp" ? L = -I : m.key === "ArrowDown" && (L = I), !(O === 0 && L === 0) && (m.preventDefault(), m.stopPropagation(), i(Zs(P, b, O, L)), o()));
|
|
5896
5899
|
};
|
|
@@ -6289,7 +6292,7 @@ function Su(t, e) {
|
|
|
6289
6292
|
return "now";
|
|
6290
6293
|
}
|
|
6291
6294
|
function Iu(t, e, n, i, o) {
|
|
6292
|
-
t.appendChild(
|
|
6295
|
+
t.appendChild(Nu()), t.appendChild(
|
|
6293
6296
|
Tu(
|
|
6294
6297
|
e,
|
|
6295
6298
|
n,
|
|
@@ -6300,7 +6303,7 @@ function Iu(t, e, n, i, o) {
|
|
|
6300
6303
|
pi(
|
|
6301
6304
|
"pluno-pa-widget__close",
|
|
6302
6305
|
"Close",
|
|
6303
|
-
|
|
6306
|
+
Uu(16),
|
|
6304
6307
|
!0
|
|
6305
6308
|
)
|
|
6306
6309
|
), t.appendChild(Eu(n, i));
|
|
@@ -6780,7 +6783,7 @@ function Du(t, e) {
|
|
|
6780
6783
|
), o;
|
|
6781
6784
|
}
|
|
6782
6785
|
function oa() {
|
|
6783
|
-
return
|
|
6786
|
+
return U("svg", {
|
|
6784
6787
|
xmlns: Qr,
|
|
6785
6788
|
viewBox: "0 0 1254 1254"
|
|
6786
6789
|
});
|
|
@@ -6831,7 +6834,7 @@ function nr(t, e, n, i, o, s, r, l) {
|
|
|
6831
6834
|
});
|
|
6832
6835
|
}
|
|
6833
6836
|
function M(t, e, n = {}) {
|
|
6834
|
-
const i =
|
|
6837
|
+
const i = U(e, n);
|
|
6835
6838
|
return t.appendChild(i), i;
|
|
6836
6839
|
}
|
|
6837
6840
|
function Z(t, e, n, i) {
|
|
@@ -6845,14 +6848,14 @@ function pi(t, e, n, i) {
|
|
|
6845
6848
|
const o = document.createElement("button");
|
|
6846
6849
|
return o.type = "button", o.className = t, o.setAttribute("aria-label", e), o.title = e, o.hidden = i, o.appendChild(n), o;
|
|
6847
6850
|
}
|
|
6848
|
-
function
|
|
6849
|
-
const t =
|
|
6851
|
+
function Nu() {
|
|
6852
|
+
const t = U("svg", {
|
|
6850
6853
|
class: "pluno-pa-widget__scribble-defs",
|
|
6851
6854
|
"aria-hidden": "true",
|
|
6852
6855
|
focusable: "false",
|
|
6853
6856
|
width: "0",
|
|
6854
6857
|
height: "0"
|
|
6855
|
-
}), e =
|
|
6858
|
+
}), e = U("defs");
|
|
6856
6859
|
return e.appendChild(Zi("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(
|
|
6857
6860
|
Zi("pluno-pa-scribble-wobble-2", "5", "15")
|
|
6858
6861
|
), e.appendChild(
|
|
@@ -6860,7 +6863,7 @@ function Uu() {
|
|
|
6860
6863
|
), t.appendChild(e), t;
|
|
6861
6864
|
}
|
|
6862
6865
|
function sa(t, e) {
|
|
6863
|
-
const n =
|
|
6866
|
+
const n = U("svg", {
|
|
6864
6867
|
class: `pluno-pa-widget__scribble-spirals ${t}`,
|
|
6865
6868
|
preserveAspectRatio: "xMidYMid meet",
|
|
6866
6869
|
"aria-hidden": "true",
|
|
@@ -6891,11 +6894,11 @@ function ra(t, e) {
|
|
|
6891
6894
|
`0 0 ${n} ${Kd}`
|
|
6892
6895
|
), t.replaceChildren();
|
|
6893
6896
|
for (let i = 0; i < e; i += 1) {
|
|
6894
|
-
const o = Ks[i % Ks.length], s =
|
|
6897
|
+
const o = Ks[i % Ks.length], s = U("g", {
|
|
6895
6898
|
transform: `translate(${mo + i * fo} 0)`
|
|
6896
6899
|
});
|
|
6897
6900
|
s.appendChild(
|
|
6898
|
-
|
|
6901
|
+
U("ellipse", {
|
|
6899
6902
|
cx: o.ellipseCx,
|
|
6900
6903
|
cy: o.ellipseCy,
|
|
6901
6904
|
rx: o.ellipseRx,
|
|
@@ -6906,7 +6909,7 @@ function ra(t, e) {
|
|
|
6906
6909
|
opacity: "0.8"
|
|
6907
6910
|
})
|
|
6908
6911
|
), s.appendChild(
|
|
6909
|
-
|
|
6912
|
+
U("path", {
|
|
6910
6913
|
d: o.path,
|
|
6911
6914
|
fill: "none",
|
|
6912
6915
|
stroke: "#2c2a1e",
|
|
@@ -6917,7 +6920,7 @@ function ra(t, e) {
|
|
|
6917
6920
|
}
|
|
6918
6921
|
}
|
|
6919
6922
|
function Zi(t, e, n) {
|
|
6920
|
-
const i =
|
|
6923
|
+
const i = U("filter", {
|
|
6921
6924
|
id: t,
|
|
6922
6925
|
x: "-8%",
|
|
6923
6926
|
y: "-8%",
|
|
@@ -6925,7 +6928,7 @@ function Zi(t, e, n) {
|
|
|
6925
6928
|
height: "116%"
|
|
6926
6929
|
});
|
|
6927
6930
|
return i.appendChild(
|
|
6928
|
-
|
|
6931
|
+
U("feTurbulence", {
|
|
6929
6932
|
type: "fractalNoise",
|
|
6930
6933
|
baseFrequency: "0.012 0.028",
|
|
6931
6934
|
numOctaves: "3",
|
|
@@ -6933,7 +6936,7 @@ function Zi(t, e, n) {
|
|
|
6933
6936
|
result: "stroke-noise"
|
|
6934
6937
|
})
|
|
6935
6938
|
), i.appendChild(
|
|
6936
|
-
|
|
6939
|
+
U("feDisplacementMap", {
|
|
6937
6940
|
in: "SourceGraphic",
|
|
6938
6941
|
in2: "stroke-noise",
|
|
6939
6942
|
scale: "3.5",
|
|
@@ -6942,7 +6945,7 @@ function Zi(t, e, n) {
|
|
|
6942
6945
|
result: "warped"
|
|
6943
6946
|
})
|
|
6944
6947
|
), i.appendChild(
|
|
6945
|
-
|
|
6948
|
+
U("feTurbulence", {
|
|
6946
6949
|
type: "fractalNoise",
|
|
6947
6950
|
baseFrequency: "0.7",
|
|
6948
6951
|
numOctaves: "1",
|
|
@@ -6950,7 +6953,7 @@ function Zi(t, e, n) {
|
|
|
6950
6953
|
result: "ink-noise"
|
|
6951
6954
|
})
|
|
6952
6955
|
), i.appendChild(
|
|
6953
|
-
|
|
6956
|
+
U("feDisplacementMap", {
|
|
6954
6957
|
in: "warped",
|
|
6955
6958
|
in2: "ink-noise",
|
|
6956
6959
|
scale: "0.9",
|
|
@@ -6959,7 +6962,7 @@ function Zi(t, e, n) {
|
|
|
6959
6962
|
})
|
|
6960
6963
|
), i;
|
|
6961
6964
|
}
|
|
6962
|
-
function
|
|
6965
|
+
function Uu(t) {
|
|
6963
6966
|
const e = xe(
|
|
6964
6967
|
"0 0 24 24",
|
|
6965
6968
|
t,
|
|
@@ -6968,7 +6971,7 @@ function Nu(t) {
|
|
|
6968
6971
|
"currentColor",
|
|
6969
6972
|
"2.25"
|
|
6970
6973
|
);
|
|
6971
|
-
return e.appendChild(
|
|
6974
|
+
return e.appendChild(U("path", { d: "m6 9 6 6 6-6" })), e;
|
|
6972
6975
|
}
|
|
6973
6976
|
function Ou() {
|
|
6974
6977
|
const t = xe(
|
|
@@ -6980,11 +6983,11 @@ function Ou() {
|
|
|
6980
6983
|
"2.25"
|
|
6981
6984
|
);
|
|
6982
6985
|
return t.appendChild(
|
|
6983
|
-
|
|
6986
|
+
U("path", {
|
|
6984
6987
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
6985
6988
|
})
|
|
6986
6989
|
), t.appendChild(
|
|
6987
|
-
|
|
6990
|
+
U("path", {
|
|
6988
6991
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
6989
6992
|
})
|
|
6990
6993
|
), t;
|
|
@@ -6999,10 +7002,10 @@ function zu() {
|
|
|
6999
7002
|
"2.25"
|
|
7000
7003
|
);
|
|
7001
7004
|
return t.appendChild(
|
|
7002
|
-
|
|
7005
|
+
U("path", {
|
|
7003
7006
|
d: "M17 3a2.85 2.85 0 0 1 4 4L7.5 20.5 2 22l1.5-5.5Z"
|
|
7004
7007
|
})
|
|
7005
|
-
), t.appendChild(
|
|
7008
|
+
), t.appendChild(U("path", { d: "m15 5 4 4" })), t;
|
|
7006
7009
|
}
|
|
7007
7010
|
function Bu() {
|
|
7008
7011
|
const t = xe(
|
|
@@ -7013,7 +7016,7 @@ function Bu() {
|
|
|
7013
7016
|
"currentColor",
|
|
7014
7017
|
"2.25"
|
|
7015
7018
|
);
|
|
7016
|
-
return t.appendChild(
|
|
7019
|
+
return t.appendChild(U("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), t.appendChild(U("path", { d: "M3 4v5h5" })), t.appendChild(U("path", { d: "M12 7v5l3 2" })), t;
|
|
7017
7020
|
}
|
|
7018
7021
|
function qu(t) {
|
|
7019
7022
|
const e = xe(
|
|
@@ -7029,7 +7032,7 @@ function qu(t) {
|
|
|
7029
7032
|
...ul,
|
|
7030
7033
|
...gl(t)
|
|
7031
7034
|
])
|
|
7032
|
-
e.appendChild(
|
|
7035
|
+
e.appendChild(U("path", { d: n }));
|
|
7033
7036
|
return e;
|
|
7034
7037
|
}
|
|
7035
7038
|
function Oo() {
|
|
@@ -7041,7 +7044,7 @@ function Oo() {
|
|
|
7041
7044
|
"currentColor",
|
|
7042
7045
|
"2.4"
|
|
7043
7046
|
);
|
|
7044
|
-
return t.appendChild(
|
|
7047
|
+
return t.appendChild(U("path", { d: "M18 6 6 18" })), t.appendChild(U("path", { d: "m6 6 12 12" })), t;
|
|
7045
7048
|
}
|
|
7046
7049
|
function aa() {
|
|
7047
7050
|
const t = xe(
|
|
@@ -7053,8 +7056,8 @@ function aa() {
|
|
|
7053
7056
|
"2.75"
|
|
7054
7057
|
);
|
|
7055
7058
|
return t.appendChild(
|
|
7056
|
-
|
|
7057
|
-
), t.appendChild(
|
|
7059
|
+
U("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
7060
|
+
), t.appendChild(U("polyline", { points: "5 12 12 5 19 12" })), t;
|
|
7058
7061
|
}
|
|
7059
7062
|
function Fu() {
|
|
7060
7063
|
const t = xe(
|
|
@@ -7069,7 +7072,7 @@ function Fu() {
|
|
|
7069
7072
|
"class",
|
|
7070
7073
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
7071
7074
|
), t.appendChild(
|
|
7072
|
-
|
|
7075
|
+
U("path", {
|
|
7073
7076
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
7074
7077
|
})
|
|
7075
7078
|
), t;
|
|
@@ -7080,7 +7083,7 @@ function Wu() {
|
|
|
7080
7083
|
"class",
|
|
7081
7084
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
7082
7085
|
), t.appendChild(
|
|
7083
|
-
|
|
7086
|
+
U("path", {
|
|
7084
7087
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
7085
7088
|
stroke: "currentColor",
|
|
7086
7089
|
"stroke-width": "2",
|
|
@@ -7092,7 +7095,7 @@ function Wu() {
|
|
|
7092
7095
|
function Hu() {
|
|
7093
7096
|
const t = xe("0 0 24 24", 18, 18, "currentColor");
|
|
7094
7097
|
return t.appendChild(
|
|
7095
|
-
|
|
7098
|
+
U("rect", {
|
|
7096
7099
|
x: "6",
|
|
7097
7100
|
y: "6",
|
|
7098
7101
|
width: "12",
|
|
@@ -7110,7 +7113,7 @@ function $u() {
|
|
|
7110
7113
|
"currentColor",
|
|
7111
7114
|
"2.4"
|
|
7112
7115
|
);
|
|
7113
|
-
return t.appendChild(
|
|
7116
|
+
return t.appendChild(U("path", { d: "M18 6 6 18" })), t.appendChild(U("path", { d: "m6 6 12 12" })), t;
|
|
7114
7117
|
}
|
|
7115
7118
|
function ju() {
|
|
7116
7119
|
const t = xe(
|
|
@@ -7122,7 +7125,7 @@ function ju() {
|
|
|
7122
7125
|
"2.25"
|
|
7123
7126
|
);
|
|
7124
7127
|
return t.appendChild(
|
|
7125
|
-
|
|
7128
|
+
U("rect", {
|
|
7126
7129
|
width: "14",
|
|
7127
7130
|
height: "14",
|
|
7128
7131
|
x: "8",
|
|
@@ -7131,7 +7134,7 @@ function ju() {
|
|
|
7131
7134
|
ry: "2"
|
|
7132
7135
|
})
|
|
7133
7136
|
), t.appendChild(
|
|
7134
|
-
|
|
7137
|
+
U("path", {
|
|
7135
7138
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
7136
7139
|
})
|
|
7137
7140
|
), t;
|
|
@@ -7144,9 +7147,9 @@ function xe(t, e, n, i, o, s) {
|
|
|
7144
7147
|
fill: i,
|
|
7145
7148
|
"aria-hidden": "true"
|
|
7146
7149
|
};
|
|
7147
|
-
return o && (r.stroke = o, r["stroke-linecap"] = "round", r["stroke-linejoin"] = "round"), s && (r["stroke-width"] = s),
|
|
7150
|
+
return o && (r.stroke = o, r["stroke-linecap"] = "round", r["stroke-linejoin"] = "round"), s && (r["stroke-width"] = s), U("svg", r);
|
|
7148
7151
|
}
|
|
7149
|
-
function
|
|
7152
|
+
function U(t, e = {}) {
|
|
7150
7153
|
const n = document.createElementNS(Qr, t);
|
|
7151
7154
|
for (const [i, o] of Object.entries(e))
|
|
7152
7155
|
n.setAttribute(i, o);
|
|
@@ -7256,7 +7259,7 @@ function Yu(t, e, n) {
|
|
|
7256
7259
|
if (!e)
|
|
7257
7260
|
return [];
|
|
7258
7261
|
const i = Array.from(e);
|
|
7259
|
-
return n && i.forEach(
|
|
7262
|
+
return n && i.forEach(Nr), i.map((o) => ({
|
|
7260
7263
|
...t.createLocalAttachment(o),
|
|
7261
7264
|
previewUrl: Xu(o)
|
|
7262
7265
|
}));
|
|
@@ -7371,7 +7374,7 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7371
7374
|
const B = ug(s), Q = s.isThinking ? null : B.flatMap((C) => {
|
|
7372
7375
|
const k = C.scheduledCheckInAt ? Jn(C.scheduledCheckInAt) : null;
|
|
7373
7376
|
return k && C.scheduledCheckInAt ? [{ message: C, dueAt: C.scheduledCheckInAt, label: k }] : [];
|
|
7374
|
-
}).sort((C, k) => Date.parse(C.dueAt) - Date.parse(k.dueAt))[0] ?? null,
|
|
7377
|
+
}).sort((C, k) => Date.parse(C.dueAt) - Date.parse(k.dueAt))[0] ?? null, N = gg(
|
|
7375
7378
|
B.filter(
|
|
7376
7379
|
(C) => !ca(C) && !C.scheduledCheckInAt
|
|
7377
7380
|
)
|
|
@@ -7379,8 +7382,8 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7379
7382
|
K.push(C);
|
|
7380
7383
|
};
|
|
7381
7384
|
ga(n, s.isThinking), n.disabled = s.pendingMessageStatus !== null, o.hidden = !l, l && r !== null && ia(o, r);
|
|
7382
|
-
const Le =
|
|
7383
|
-
if (i(Le), v ||
|
|
7385
|
+
const Le = N.length > 0 || !!s.assistantDraft || s.pendingMessageStatus !== null || s.isThinking;
|
|
7386
|
+
if (i(Le), v || N.length === 0 && !s.assistantDraft && !s.lastError && !s.pendingMessageStatus && !s.isThinking) {
|
|
7384
7387
|
const C = document.createElement("div");
|
|
7385
7388
|
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (v ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
7386
7389
|
const k = document.createElement("div");
|
|
@@ -7418,15 +7421,15 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7418
7421
|
return;
|
|
7419
7422
|
}
|
|
7420
7423
|
let x = null, H = null, pe = [], ce = [];
|
|
7421
|
-
const et =
|
|
7422
|
-
(C) => C.role === "tool" && ar(C,
|
|
7424
|
+
const et = N.some(vo), ee = N.some(
|
|
7425
|
+
(C) => C.role === "tool" && ar(C, N)
|
|
7423
7426
|
);
|
|
7424
7427
|
let De = !1;
|
|
7425
7428
|
const ne = () => {
|
|
7426
7429
|
if (pe.length === 0)
|
|
7427
7430
|
return De = !1, !1;
|
|
7428
7431
|
const C = pe.some(
|
|
7429
|
-
(ae) => ar(ae,
|
|
7432
|
+
(ae) => ar(ae, N)
|
|
7430
7433
|
), k = vg(
|
|
7431
7434
|
pe,
|
|
7432
7435
|
C,
|
|
@@ -7442,8 +7445,8 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7442
7445
|
q(C), x = null, H = C;
|
|
7443
7446
|
ce = [];
|
|
7444
7447
|
};
|
|
7445
|
-
for (let C = 0; C <
|
|
7446
|
-
const k =
|
|
7448
|
+
for (let C = 0; C < N.length; C += 1) {
|
|
7449
|
+
const k = N[C];
|
|
7447
7450
|
if (k.role === "tool" && k.integrationAuthRequest && O) {
|
|
7448
7451
|
const A = og(
|
|
7449
7452
|
k.integrationAuthRequest,
|
|
@@ -7488,19 +7491,19 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7488
7491
|
ne();
|
|
7489
7492
|
const A = dn(w());
|
|
7490
7493
|
A.classList.add("pluno-pa-widget__terminal-marker"), q(A);
|
|
7491
|
-
const W = document.createElement("div"),
|
|
7492
|
-
if (W.className =
|
|
7494
|
+
const W = document.createElement("div"), Ue = k.dataType === "run_error";
|
|
7495
|
+
if (W.className = Ue ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", W.textContent = oi(
|
|
7493
7496
|
k.content
|
|
7494
|
-
),
|
|
7497
|
+
), Ue && k.securitySettingsUrl) {
|
|
7495
7498
|
const Se = document.createElement("a");
|
|
7496
7499
|
Se.className = "pluno-pa-widget__error-retry", Se.href = k.securitySettingsUrl, Se.target = "_blank", Se.rel = "noreferrer", Se.textContent = "Security settings", W.appendChild(Se);
|
|
7497
7500
|
}
|
|
7498
|
-
q(W), x =
|
|
7501
|
+
q(W), x = Ue ? W : null, H = Ue ? null : W, re();
|
|
7499
7502
|
}
|
|
7500
7503
|
continue;
|
|
7501
7504
|
}
|
|
7502
7505
|
k.role === "user" && re();
|
|
7503
|
-
const ae = ne(), F = oi(k.content), V = k.role === "assistant" &&
|
|
7506
|
+
const ae = ne(), F = oi(k.content), V = k.role === "assistant" && N.some(
|
|
7504
7507
|
(A) => A.role === "tool" && ut(A, k)
|
|
7505
7508
|
);
|
|
7506
7509
|
if (k.role === "assistant" && !ae && !V) {
|
|
@@ -7523,7 +7526,7 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7523
7526
|
}
|
|
7524
7527
|
k.role === "assistant" && re();
|
|
7525
7528
|
}
|
|
7526
|
-
const
|
|
7529
|
+
const Ne = ne(), z = N[N.length - 1]?.role === "assistant";
|
|
7527
7530
|
if (s.pendingMessageStatus && !s.isThinking) {
|
|
7528
7531
|
const C = Ot(
|
|
7529
7532
|
s.pendingMessageStatus === "reconnecting" ? "Reconnecting..." : "Sending..."
|
|
@@ -7531,7 +7534,7 @@ function ig(t, e, n, i, o, s, r, l, p, d, g, c, h, _, w, f, m, v, b, I, P, O, L)
|
|
|
7531
7534
|
q(C), x = null, H = C;
|
|
7532
7535
|
}
|
|
7533
7536
|
if (s.isThinking && !s.assistantDraft && !ee && !z && !et)
|
|
7534
|
-
if (
|
|
7537
|
+
if (Ne) {
|
|
7535
7538
|
if (!De) {
|
|
7536
7539
|
const C = Ot(s.isRetrying ? "Retrying..." : "Thinking...");
|
|
7537
7540
|
q(C), x = null, H = C;
|
|
@@ -7963,8 +7966,8 @@ function vg(t, e, n, i, o, s, r) {
|
|
|
7963
7966
|
O.className = "pluno-pa-widget__tool-active-content";
|
|
7964
7967
|
const L = Ot(), B = document.createElement("details"), Q = document.createElement("summary");
|
|
7965
7968
|
Q.className = "pluno-pa-widget__tool-summary";
|
|
7966
|
-
const
|
|
7967
|
-
|
|
7969
|
+
const N = document.createElement("span");
|
|
7970
|
+
N.className = "pluno-pa-widget__tool-summary-title", Q.appendChild(N), B.appendChild(Q);
|
|
7968
7971
|
const ge = document.createElement("div");
|
|
7969
7972
|
ge.className = "pluno-pa-widget__tool-lines", B.addEventListener("toggle", () => {
|
|
7970
7973
|
const K = b.dataset.responseGroupKey ?? p;
|
|
@@ -7977,7 +7980,7 @@ function vg(t, e, n, i, o, s, r) {
|
|
|
7977
7980
|
thinkingStatus: L,
|
|
7978
7981
|
details: B,
|
|
7979
7982
|
summary: Q,
|
|
7980
|
-
summaryTitle:
|
|
7983
|
+
summaryTitle: N,
|
|
7981
7984
|
lines: ge,
|
|
7982
7985
|
lineNodes: /* @__PURE__ */ new Map()
|
|
7983
7986
|
}, i.set(p, d);
|
|
@@ -11121,7 +11124,7 @@ function qo(t) {
|
|
|
11121
11124
|
function fa(t) {
|
|
11122
11125
|
return `${qo(t)}.displayState`;
|
|
11123
11126
|
}
|
|
11124
|
-
function
|
|
11127
|
+
function Ng(t) {
|
|
11125
11128
|
try {
|
|
11126
11129
|
return window.sessionStorage.getItem(
|
|
11127
11130
|
fa(t)
|
|
@@ -11143,7 +11146,7 @@ function dr(t, e) {
|
|
|
11143
11146
|
return;
|
|
11144
11147
|
}
|
|
11145
11148
|
}
|
|
11146
|
-
function
|
|
11149
|
+
function Ug(t) {
|
|
11147
11150
|
if (t)
|
|
11148
11151
|
return { clientId: t, release: () => {
|
|
11149
11152
|
} };
|