@pluno/product-agent-web 0.1.302 → 0.1.303
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-runtime.cjs +1 -1
- package/dist/product-agent-runtime.js +1 -1
- package/dist/product-agent-sdk.js +528 -527
- package/dist/product-agent-widget.js +175 -174
- package/package.json +1 -1
|
@@ -76,7 +76,7 @@ function ih(t, e, n, i) {
|
|
|
76
76
|
function sh(t) {
|
|
77
77
|
return Vr(t) > 0.5 ? [24, 24, 27] : [250, 250, 249];
|
|
78
78
|
}
|
|
79
|
-
const oh = "0.1.
|
|
79
|
+
const oh = "0.1.303", ci = {
|
|
80
80
|
version: oh
|
|
81
81
|
}, fe = (t) => typeof t == "string" && /^[a-zA-Z0-9:_.-]{1,160}$/.test(t) ? t : null;
|
|
82
82
|
function Ld(t) {
|
|
@@ -262,7 +262,7 @@ function hh(t) {
|
|
|
262
262
|
...t.details === void 0 ? {} : { details: t.details }
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Xt(t, e = "runtime_error", n = "runtime") {
|
|
266
266
|
const i = t !== null && typeof t == "object" ? t : null, s = typeof t == "string" ? t : i && "message" in i && typeof i.message == "string" ? i.message : "", o = i && "code" in i && typeof i.code == "string" && i.code.trim() ? i.code : e, a = i && "details" in i ? i.details : null, r = a && typeof a == "object" ? a : {}, c = {
|
|
267
267
|
...typeof r.httpStatus == "number" && Number.isInteger(r.httpStatus) && r.httpStatus >= 100 && r.httpStatus <= 599 ? { httpStatus: r.httpStatus } : {},
|
|
268
268
|
// Preserve the first boundary's shape after normalization replaces the original message/prototype.
|
|
@@ -292,7 +292,7 @@ function Hn(t) {
|
|
|
292
292
|
return e.length > sl ? `${e.slice(0, sl - 1)}…` : e;
|
|
293
293
|
}
|
|
294
294
|
function Ln(t, e = "runtime") {
|
|
295
|
-
const n =
|
|
295
|
+
const n = Xt(t, "runtime_error", e), i = t !== null && typeof t == "object" && "stack" in t && typeof t.stack == "string" ? Hn(t.stack.slice(0, 4e3).split(`
|
|
296
296
|
`).slice(0, 6).join(`
|
|
297
297
|
`).replace(/\n\s*at\s/g, `
|
|
298
298
|
frame `)) : void 0;
|
|
@@ -604,7 +604,7 @@ function Gt(t) {
|
|
|
604
604
|
function Ys(t) {
|
|
605
605
|
return "revision" in t.data ? t.data.revision : null;
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function Zt(t) {
|
|
608
608
|
return {
|
|
609
609
|
key: t,
|
|
610
610
|
status: "not_requested",
|
|
@@ -662,7 +662,7 @@ function ta(t) {
|
|
|
662
662
|
executionByUserMessage: {},
|
|
663
663
|
followUps: [],
|
|
664
664
|
followUpsVersion: -1,
|
|
665
|
-
queries: { current:
|
|
665
|
+
queries: { current: Zt(`${t}:current`), history: Zt(`${t}:history`) }
|
|
666
666
|
};
|
|
667
667
|
}
|
|
668
668
|
function Wd(t) {
|
|
@@ -673,7 +673,7 @@ function Eh(t, e) {
|
|
|
673
673
|
const n = t?.executionByUserMessage[e]?.responseMessageIds, i = n?.indexOf(e) ?? -1;
|
|
674
674
|
return n && i >= 0 ? n.slice(0, i + 1) : [e];
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Jt(t, e, n) {
|
|
677
677
|
const i = t.submissionOrder.map((C) => t.submissions[C]).filter((C) => C.conversationScopeId === n), s = e.selections[n]?.sessionId ?? i.find((C) => !C.cancelled && C.sessionId !== null)?.sessionId ?? null, o = s ? t.sessions[s] : void 0, a = t.submissionOrder.map((C) => t.submissions[C]).filter((C) => s ? C.sessionId === s || C.sessionId === null && C.conversationScopeId === n : C.conversationScopeId === n), r = Object.values(o?.items ?? {}).sort((C, U) => {
|
|
678
678
|
const te = Gt(C.created_at), ne = Gt(U.created_at);
|
|
679
679
|
return te < ne ? -1 : te > ne ? 1 : C.id < U.id ? -1 : C.id > U.id ? 1 : 0;
|
|
@@ -754,7 +754,7 @@ function Vd(t, e) {
|
|
|
754
754
|
return t.sessionId && a ? { type: "execution", userMessageId: a, sessionId: t.sessionId } : null;
|
|
755
755
|
}
|
|
756
756
|
function Ch(t, e) {
|
|
757
|
-
return Ve({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((n) => [n,
|
|
757
|
+
return Ve({ scopes: Object.fromEntries([...new Set(Object.values(e.clients))].map((n) => [n, Jt(t, e, n)])) });
|
|
758
758
|
}
|
|
759
759
|
function Ah(t, e) {
|
|
760
760
|
if (!e) return !1;
|
|
@@ -1055,7 +1055,7 @@ function Ph(t, e, n, i) {
|
|
|
1055
1055
|
if (y && y.fingerprint !== JSON.stringify(d)) throw new Error("Query request ID changed payload.");
|
|
1056
1056
|
a({
|
|
1057
1057
|
appearanceQueries: { ...s.appearanceQueries, [p]: d },
|
|
1058
|
-
queries: { ...s.queries, [p]: ni(s.queries[p] ??
|
|
1058
|
+
queries: { ...s.queries, [p]: ni(s.queries[p] ?? Zt(p), { key: p, requestId: Ct(n.requestId), mode: "replace" }) },
|
|
1059
1059
|
pending: { ...s.pending, [f]: {
|
|
1060
1060
|
requestId: n.requestId,
|
|
1061
1061
|
effectId: f,
|
|
@@ -1123,7 +1123,7 @@ function Ph(t, e, n, i) {
|
|
|
1123
1123
|
return { state: s, effects: o };
|
|
1124
1124
|
}
|
|
1125
1125
|
function na(t = null) {
|
|
1126
|
-
return { authority: t, refusal: null, paidFallbackBySession: {}, query:
|
|
1126
|
+
return { authority: t, refusal: null, paidFallbackBySession: {}, query: Zt("account"), preferences: null };
|
|
1127
1127
|
}
|
|
1128
1128
|
function qh(t, e) {
|
|
1129
1129
|
return t.preferences && e.preferencesVersion <= t.preferences.preferencesVersion ? t : { ...t, preferences: e };
|
|
@@ -1314,7 +1314,7 @@ function oa(t, e, n) {
|
|
|
1314
1314
|
const k = i.features.pending[T];
|
|
1315
1315
|
if (k && k.fingerprint !== JSON.stringify(m)) throw new Error("Query request ID changed payload.");
|
|
1316
1316
|
if (k?.status === "pending" || Object.values(i.features.pending).some((z) => z.mode === "query" && z.key === E && z.status === "pending")) return;
|
|
1317
|
-
const M = i.features.queries[E] ??
|
|
1317
|
+
const M = i.features.queries[E] ?? Zt(E), q = ni(M, { key: E, requestId: Ct(w), mode: "replace" });
|
|
1318
1318
|
o({ queries: { ...i.features.queries, [E]: q }, pending: { ...i.features.pending, [T]: {
|
|
1319
1319
|
requestId: w,
|
|
1320
1320
|
effectId: T,
|
|
@@ -1357,7 +1357,7 @@ function oa(t, e, n) {
|
|
|
1357
1357
|
return;
|
|
1358
1358
|
}
|
|
1359
1359
|
if (m.kind === "generatePrompts") {
|
|
1360
|
-
const M = { kind: "starterPrompts", ...m.page, includeUserSuggestions: m.includeUserSuggestions ?? !1 }, q = yt(r, M), z = i.features.queries[q] ??
|
|
1360
|
+
const M = { kind: "starterPrompts", ...m.page, includeUserSuggestions: m.includeUserSuggestions ?? !1 }, q = yt(r, M), z = i.features.queries[q] ?? Zt(q);
|
|
1361
1361
|
o({ queries: { ...i.features.queries, [q]: ni(z, { key: q, requestId: Ct(w), mode: "replace" }) } });
|
|
1362
1362
|
}
|
|
1363
1363
|
o({ pending: { ...i.features.pending, [E]: { requestId: w, effectId: E, fingerprint: T, key: pl(m), generation: r.generation, operation: m, mode: "mutation", status: "pending", error: null, result: null } } }), s.push({ kind: "stage7.mutate", id: E, input: { authority: r, requestId: w, mutation: m } });
|
|
@@ -2017,7 +2017,7 @@ function zh(t) {
|
|
|
2017
2017
|
case "originContext": {
|
|
2018
2018
|
const l = { requestId: o, origin: s.origin, trigger: s.trigger ?? "page" };
|
|
2019
2019
|
t.onContextStatusRead?.({ ...l, phase: "started" }), c = await r("/context/status", { origin: s.origin, community_id: i.communityId }).then((u) => Di("originContext", u)).then((u) => (t.onContextStatusRead?.({ ...l, phase: "ready" }), u), (u) => {
|
|
2020
|
-
const d =
|
|
2020
|
+
const d = Xt(u);
|
|
2021
2021
|
throw t.onContextStatusRead?.({ ...l, phase: "failed", code: d.code, retryable: d.retryable }), u;
|
|
2022
2022
|
});
|
|
2023
2023
|
break;
|
|
@@ -2590,7 +2590,7 @@ function Qh(t, e, n, i) {
|
|
|
2590
2590
|
const p = l[d.lane];
|
|
2591
2591
|
l[d.lane] = { ...p, requestId: null, status: p.data === null ? "not_requested" : "ready" };
|
|
2592
2592
|
}
|
|
2593
|
-
l.history =
|
|
2593
|
+
l.history = Zt(l.history.key), s = { ...t, requests: c, sessions: { ...t.sessions, [e.sessionId]: { ...r, queries: l } } };
|
|
2594
2594
|
break;
|
|
2595
2595
|
}
|
|
2596
2596
|
case "conversation.snapshot": {
|
|
@@ -2640,37 +2640,38 @@ const gl = (t, e) => ({
|
|
|
2640
2640
|
command: null
|
|
2641
2641
|
});
|
|
2642
2642
|
function Na(t, e) {
|
|
2643
|
-
const n = new Set(Object.values(e.clients)), i = Object.values(t.operations).filter((
|
|
2644
|
-
const
|
|
2645
|
-
if (
|
|
2646
|
-
if (
|
|
2647
|
-
if (
|
|
2648
|
-
const
|
|
2649
|
-
return
|
|
2650
|
-
}
|
|
2651
|
-
return !
|
|
2652
|
-
}).map(([
|
|
2653
|
-
if (
|
|
2654
|
-
if (!
|
|
2655
|
-
const
|
|
2656
|
-
return n.has(
|
|
2657
|
-
}))),
|
|
2658
|
-
if (!["done", "failed"].includes(
|
|
2659
|
-
if (
|
|
2660
|
-
if (
|
|
2661
|
-
if (
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2643
|
+
const n = new Set(Object.values(e.clients)), i = new Set(Object.values(t.pendingRestoration)), s = Object.values(t.operations).filter((d) => d.command.type === "run.stop"), o = (d) => s.some((p) => p.command.payload.expectedUserMessageId === d && p.phase === "done"), a = Object.fromEntries(Object.entries(t.submissions).filter(([d, p]) => {
|
|
2644
|
+
const f = p.sessionId ? t.sessions[p.sessionId] : void 0;
|
|
2645
|
+
if (p.cancelled && n.has(p.conversationScopeId) && t.stops[p.conversationScopeId]?.userMessageIds.includes(d) && !f?.items[d] && !f?.removedItems[d]) return !0;
|
|
2646
|
+
if (p.delivery === "accepted") {
|
|
2647
|
+
if (p.cancelled) return !o(d);
|
|
2648
|
+
const y = p.sessionId ? t.sessions[p.sessionId] : void 0;
|
|
2649
|
+
return p.executionVersion === null || !(y?.items[d] || y?.removedItems[d]);
|
|
2650
|
+
}
|
|
2651
|
+
return !p.cancelled || mn(t, d) || t.deliveries[d]?.phase === "running";
|
|
2652
|
+
}).map(([d, p]) => [d, p.delivery === "accepted" || p.cancelled ? { ...p, context: {}, contextPreparation: { pageContent: "", sessionTabs: [] } } : p])), r = Object.fromEntries(Object.entries(t.deliveries).filter(([d]) => d in a).map(([d, p]) => [d, a[d].delivery === "accepted" ? { ...p, phase: "done", effectId: null, command: null, uploads: [], completedUploads: 0 } : a[d].cancelled ? { ...p, command: null } : p])), c = Object.fromEntries(Object.entries(t.stops).filter(([d, p]) => p.userMessageIds.some((f) => {
|
|
2653
|
+
if (a[f]) return !0;
|
|
2654
|
+
if (!o(f)) return s.some((g) => g.command.payload.expectedUserMessageId === f && g.phase !== "done");
|
|
2655
|
+
const y = Object.values(t.sessions).find((g) => g.executionByUserMessage[f])?.executionByUserMessage[f];
|
|
2656
|
+
return n.has(d) && (!y || y.version <= p.executionVersion || !["completed", "failed", "stopped"].includes(y.phase));
|
|
2657
|
+
}))), l = new Set(Object.values(c).flatMap((d) => d.userMessageIds)), u = Object.fromEntries(Object.entries(t.operations).filter(([, d]) => {
|
|
2658
|
+
if (!["done", "failed"].includes(d.phase)) return !0;
|
|
2659
|
+
if (d.command.type === "run.stop") return l.has(String(d.command.payload.expectedUserMessageId)) || Object.values(a).some((f) => f.cancelled && f.userMessageId === d.command.payload.expectedUserMessageId);
|
|
2660
|
+
if (d.phase !== "done" || !d.conversationScopeId || !n.has(d.conversationScopeId) && !(d.command.type === "runtime.warmup" && i.has(d.conversationScopeId))) return !1;
|
|
2661
|
+
if (d.command.type === "runtime.warmup")
|
|
2662
|
+
return e.selections[d.conversationScopeId]?.sessionId !== d.result?.sessionId || Jt(t, e, d.conversationScopeId).isDraftSession;
|
|
2663
|
+
if (d.command.type !== "attachment.prepare") return !1;
|
|
2664
|
+
const p = d.command.payload.source;
|
|
2665
|
+
return !Object.values(t.submissions).some((f) => f.conversationScopeId === d.conversationScopeId && f.delivery === "accepted" && f.attachments.some((y) => y.sourceId === p.sourceId));
|
|
2665
2666
|
}));
|
|
2666
2667
|
return Ve({
|
|
2667
2668
|
schema: 1,
|
|
2668
2669
|
authorityId: t.authorityId,
|
|
2669
|
-
submissions:
|
|
2670
|
-
submissionOrder: t.submissionOrder.filter((
|
|
2671
|
-
deliveries:
|
|
2672
|
-
operations:
|
|
2673
|
-
stops:
|
|
2670
|
+
submissions: a,
|
|
2671
|
+
submissionOrder: t.submissionOrder.filter((d) => d in a),
|
|
2672
|
+
deliveries: r,
|
|
2673
|
+
operations: u,
|
|
2674
|
+
stops: c,
|
|
2674
2675
|
requestSequence: t.requestSequence
|
|
2675
2676
|
});
|
|
2676
2677
|
}
|
|
@@ -6089,7 +6090,7 @@ class pf {
|
|
|
6089
6090
|
this.ready = n, await this.synchronize(!0), e === this.generation && this.ready && (this.options.bootstrapRequired || this.markReady(), this.options.onReady(n));
|
|
6090
6091
|
} catch (s) {
|
|
6091
6092
|
if (e === this.generation) {
|
|
6092
|
-
const o =
|
|
6093
|
+
const o = Xt(s, "activation_error", "web_transport"), a = s instanceof N ? s : new N(
|
|
6093
6094
|
o.message,
|
|
6094
6095
|
o.code,
|
|
6095
6096
|
!1,
|
|
@@ -6227,7 +6228,7 @@ function rt(t, e) {
|
|
|
6227
6228
|
throw Object.assign(new Error("Conversation authority was retired."), { code: "authority_retired", retryable: !0 });
|
|
6228
6229
|
}
|
|
6229
6230
|
function On(t, e) {
|
|
6230
|
-
const n =
|
|
6231
|
+
const n = Xt(t, "connection_interrupted", "web_transport"), { code: i, message: s } = n, o = t instanceof Error && "detail" in t ? t.detail : t instanceof Error && "details" in t ? t.details : void 0, a = o && typeof o == "object" && "httpRequest" in o ? o.httpRequest : o, r = a && typeof a == "object" ? a : {}, c = r.category ?? r.transportCode, l = r.elapsedMs ?? r.durationMs, u = o && typeof o == "object" && "successfulRequests" in o && typeof o.successfulRequests == "number" ? o.successfulRequests : 0, d = o && typeof o == "object" && "securitySettingsUrl" in o && typeof o.securitySettingsUrl == "string" ? o.securitySettingsUrl : void 0, p = o && typeof o == "object" && "httpRequest" in o && wn(o.httpRequest) ? o.httpRequest : void 0;
|
|
6231
6232
|
return Object.assign(new Error(s), {
|
|
6232
6233
|
code: i,
|
|
6233
6234
|
// Keep the actionable public URL without copying arbitrary transport internals into durable errors.
|
|
@@ -7750,7 +7751,7 @@ class Ee extends EventTarget {
|
|
|
7750
7751
|
e.push(n);
|
|
7751
7752
|
}
|
|
7752
7753
|
fail(e, n, i = !1) {
|
|
7753
|
-
const s =
|
|
7754
|
+
const s = Xt(e, "request_failed", "web_transport"), o = e instanceof N ? e : new N(
|
|
7754
7755
|
s.message,
|
|
7755
7756
|
s.code,
|
|
7756
7757
|
!1,
|
|
@@ -7935,7 +7936,7 @@ function Lf(t, e, n, i, s, o, a, r, c = null, l = !1) {
|
|
|
7935
7936
|
}
|
|
7936
7937
|
const Nf = 1e4, Uf = 3e3;
|
|
7937
7938
|
function Iu() {
|
|
7938
|
-
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query:
|
|
7939
|
+
return { authenticated: !1, generation: 0, sequence: 0, displaySequence: 0, backendCount: null, query: Zt("activeUsers") };
|
|
7939
7940
|
}
|
|
7940
7941
|
function zf(t, e) {
|
|
7941
7942
|
if (e.type === "activeUsers.authenticate") {
|
|
@@ -8136,7 +8137,7 @@ function Ff(t, e, n) {
|
|
|
8136
8137
|
}
|
|
8137
8138
|
function $f(t, e, n, i) {
|
|
8138
8139
|
const s = t.clients[e];
|
|
8139
|
-
return s === void 0 || t.selections[s].sessionId === n ? !0 : !i || Object.values(i.pendingRestoration).includes(s) || Object.values(i.submissions).some((o) => o.conversationScopeId === s && !o.cancelled) ? !1 : t.selections[s].sessionId === null ||
|
|
8140
|
+
return s === void 0 || t.selections[s].sessionId === n ? !0 : !i || Object.values(i.pendingRestoration).includes(s) || Object.values(i.submissions).some((o) => o.conversationScopeId === s && !o.cancelled) ? !1 : t.selections[s].sessionId === null || Jt(i, t, s).isDraftSession;
|
|
8140
8141
|
}
|
|
8141
8142
|
function _a(t) {
|
|
8142
8143
|
return {
|
|
@@ -8267,7 +8268,7 @@ function Fn(t, e, n) {
|
|
|
8267
8268
|
query: u,
|
|
8268
8269
|
cursor: e.cursor !== void 0 ? e.cursor : e.mode === "append" ? l?.cursor ?? null : null
|
|
8269
8270
|
} }, i = { ...t, queries: { ...t.queries, [c]: {
|
|
8270
|
-
...ni(l ??
|
|
8271
|
+
...ni(l ?? Zt(c), { key: c, requestId: e.requestId, mode: e.mode }),
|
|
8271
8272
|
query: u,
|
|
8272
8273
|
requestSequence: t.requestSequence + 1,
|
|
8273
8274
|
mode: e.mode,
|
|
@@ -8584,7 +8585,7 @@ function Ul(t, e, n) {
|
|
|
8584
8585
|
for (const [a, r] of Object.entries(n.memberships)) {
|
|
8585
8586
|
const c = n.clients[r.members[0]];
|
|
8586
8587
|
if (!c) continue;
|
|
8587
|
-
const l =
|
|
8588
|
+
const l = Jt(e, n, c), u = Jt(t, n, c);
|
|
8588
8589
|
if (l.activity.phase === u.activity.phase) continue;
|
|
8589
8590
|
const d = ["submitting", "awaiting_execution", "thinking", "steering", "queued", "stopping"].includes(l.activity.phase);
|
|
8590
8591
|
i = Fn(i, { ...s, type: "directory.activity_set", sessionId: a, active: d }).state;
|
|
@@ -8718,7 +8719,7 @@ class Xf {
|
|
|
8718
8719
|
})
|
|
8719
8720
|
},
|
|
8720
8721
|
errorAdapter: (o) => {
|
|
8721
|
-
const a =
|
|
8722
|
+
const a = Xt(o), r = o !== null && typeof o == "object" ? "details" in o ? o.details : "detail" in o ? o.detail : void 0 : void 0, c = r && typeof r == "object" && "httpRequest" in r ? r.httpRequest : void 0;
|
|
8722
8723
|
return { ...a, ...wn(c) ? { details: { ...a.details, httpRequest: c } } : {} };
|
|
8723
8724
|
}
|
|
8724
8725
|
});
|
|
@@ -9399,12 +9400,12 @@ function Pr(t) {
|
|
|
9399
9400
|
return !0;
|
|
9400
9401
|
}
|
|
9401
9402
|
function Bi(t) {
|
|
9402
|
-
const e =
|
|
9403
|
+
const e = Xt(t, "connection_failed", "web_transport");
|
|
9403
9404
|
if (t instanceof Error && t.message === e.message) return t;
|
|
9404
9405
|
if (t && typeof t == "object" && !("message" in t)) {
|
|
9405
9406
|
const n = t, i = n.data && typeof n.data == "object" ? n.data.detail : null, s = typeof i == "string" ? i : n.error;
|
|
9406
9407
|
if (typeof s == "string")
|
|
9407
|
-
return Object.assign(new Error(
|
|
9408
|
+
return Object.assign(new Error(Xt(s).message), { code: e.code });
|
|
9408
9409
|
}
|
|
9409
9410
|
return Object.assign(new Error(e.message), e);
|
|
9410
9411
|
}
|
|
@@ -9811,7 +9812,7 @@ class Qa {
|
|
|
9811
9812
|
}
|
|
9812
9813
|
for (const [x, m] of Object.entries(g.directory.clients)) {
|
|
9813
9814
|
if (!x.startsWith(`background:${this.modelClientScopeId}:`)) continue;
|
|
9814
|
-
const w =
|
|
9815
|
+
const w = Jt(g.conversation, g.directory, m), I = w.sessionId ? g.conversation.sessions[w.sessionId] : void 0;
|
|
9815
9816
|
if (this.firstResponseTimersByClientMessageId.size && (u(br(w, I?.queries.current, this.options.backendUrl).messages, w.sessionId), ["failed", "stopped"].includes(w.activity.phase)))
|
|
9816
9817
|
for (const T of Pt(I?.execution)) this.clearFirstResponseTimer(T);
|
|
9817
9818
|
const E = w.activity.phase === "completed" && Pt(I?.execution).some((T) => this.firstResponseTimersByClientMessageId.has(T));
|
|
@@ -9878,7 +9879,7 @@ class Qa {
|
|
|
9878
9879
|
return i.add(n), this.listeners[e] = i, () => i.delete(n);
|
|
9879
9880
|
}
|
|
9880
9881
|
getState() {
|
|
9881
|
-
const e = this.clientRuntime.engine.getState().slices, n = e.directory.clients[this.modelClientScopeId] ?? this.directoryConversationScopeId, i =
|
|
9882
|
+
const e = this.clientRuntime.engine.getState().slices, n = e.directory.clients[this.modelClientScopeId] ?? this.directoryConversationScopeId, i = Jt(e.conversation, e.directory, n), s = br(
|
|
9882
9883
|
i,
|
|
9883
9884
|
i.sessionId ? e.conversation.sessions[i.sessionId]?.queries.current : void 0,
|
|
9884
9885
|
this.options.backendUrl,
|
|
@@ -10290,7 +10291,7 @@ class Qa {
|
|
|
10290
10291
|
this.draftModelExplicit = !0, this.draftModel !== n && (this.draftModel = n, this.emit("state", this.getState()));
|
|
10291
10292
|
}
|
|
10292
10293
|
retryLastMessage(e) {
|
|
10293
|
-
const n = this.clientRuntime.engine.getState().slices, i = n.directory.clients[this.modelClientScopeId], s =
|
|
10294
|
+
const n = this.clientRuntime.engine.getState().slices, i = n.directory.clients[this.modelClientScopeId], s = Jt(n.conversation, n.directory, i), o = Vd(s, e);
|
|
10294
10295
|
if (!o) return !1;
|
|
10295
10296
|
if (o.type === "preparation") {
|
|
10296
10297
|
const a = Me(), r = Sf(o.submission);
|
|
@@ -10792,7 +10793,7 @@ class Qa {
|
|
|
10792
10793
|
if (e === "first_response_slow" && n.sessionId && n.sessionId !== i.sessionId) {
|
|
10793
10794
|
const { conversation: y, directory: g } = this.clientRuntime.engine.getState().slices, b = Object.values(g.clients).find((_) => g.selections[_]?.sessionId === n.sessionId);
|
|
10794
10795
|
b && (i = { ...i, ...br(
|
|
10795
|
-
|
|
10796
|
+
Jt(y, g, b),
|
|
10796
10797
|
y.sessions[n.sessionId]?.queries.current,
|
|
10797
10798
|
this.options.backendUrl
|
|
10798
10799
|
) });
|
|
@@ -11169,7 +11170,7 @@ class Qa {
|
|
|
11169
11170
|
if (e.type === "tool.call")
|
|
11170
11171
|
return e.sessionId !== this.state.sessionId && this.clientRuntime.engine.getState().slices.conversation.sessions[String(e.sessionId)] && !this.options.keepRunsActiveOnSessionNavigation ? void 0 : (this.executeToolCall(e), !0);
|
|
11171
11172
|
if (e.type === "error") {
|
|
11172
|
-
if (e = { ...e, message:
|
|
11173
|
+
if (e = { ...e, message: Xt(e, "connection_failed", "web_transport").message }, e.code === "connection_failed") {
|
|
11173
11174
|
this.setState({ status: "reconnecting", lastError: String(e.message), lastErrorCode: e.code });
|
|
11174
11175
|
return;
|
|
11175
11176
|
}
|
|
@@ -11589,7 +11590,7 @@ function cy() {
|
|
|
11589
11590
|
if (!Zn(S, x, y?.body)) {
|
|
11590
11591
|
const w = {
|
|
11591
11592
|
requestId: Dr("fetch"),
|
|
11592
|
-
url:
|
|
11593
|
+
url: Qt(S, Tr),
|
|
11593
11594
|
method: (y?.method ?? _?.method ?? "GET").toUpperCase(),
|
|
11594
11595
|
requestHeaders: x,
|
|
11595
11596
|
requestBody: ed(y?.body),
|
|
@@ -11609,7 +11610,7 @@ function cy() {
|
|
|
11609
11610
|
(I) => {
|
|
11610
11611
|
e({
|
|
11611
11612
|
...w,
|
|
11612
|
-
errorText:
|
|
11613
|
+
errorText: Qt(I instanceof Error ? I.message : String(I)),
|
|
11613
11614
|
durationMs: Date.now() - g
|
|
11614
11615
|
});
|
|
11615
11616
|
}
|
|
@@ -11623,7 +11624,7 @@ function cy() {
|
|
|
11623
11624
|
return Mr.set(this, {
|
|
11624
11625
|
requestId: Dr("xhr"),
|
|
11625
11626
|
method: String(f ?? "GET").toUpperCase(),
|
|
11626
|
-
url:
|
|
11627
|
+
url: Qt(x, Tr),
|
|
11627
11628
|
requestHeaders: {},
|
|
11628
11629
|
startedAtMs: Date.now(),
|
|
11629
11630
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -11692,7 +11693,7 @@ function cy() {
|
|
|
11692
11693
|
const g = performance.timeOrigin + y.startTime;
|
|
11693
11694
|
e({
|
|
11694
11695
|
requestId: Dr("resource"),
|
|
11695
|
-
url:
|
|
11696
|
+
url: Qt(y.name, Tr),
|
|
11696
11697
|
method: "GET",
|
|
11697
11698
|
resourceType: "resource",
|
|
11698
11699
|
responseStatus: y.responseStatus,
|
|
@@ -12437,7 +12438,7 @@ function $y(t, e) {
|
|
|
12437
12438
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12438
12439
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12439
12440
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12440
|
-
respondsToUserMessageId:
|
|
12441
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12441
12442
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12442
12443
|
dataType: "assistant_draft",
|
|
12443
12444
|
...s.steered === !0 ? { steered: !0 } : {}
|
|
@@ -12454,7 +12455,7 @@ function $y(t, e) {
|
|
|
12454
12455
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12455
12456
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12456
12457
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12457
|
-
respondsToUserMessageId:
|
|
12458
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12458
12459
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12459
12460
|
attachments: Du(s.attachments, e),
|
|
12460
12461
|
...s.steered === !0 ? { steered: !0 } : {}
|
|
@@ -12479,7 +12480,7 @@ function $y(t, e) {
|
|
|
12479
12480
|
content: "",
|
|
12480
12481
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12481
12482
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12482
|
-
respondsToUserMessageId:
|
|
12483
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12483
12484
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12484
12485
|
dataType: "function_call_output",
|
|
12485
12486
|
toolName: Va,
|
|
@@ -12494,7 +12495,7 @@ function $y(t, e) {
|
|
|
12494
12495
|
content: "",
|
|
12495
12496
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12496
12497
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12497
|
-
respondsToUserMessageId:
|
|
12498
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12498
12499
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12499
12500
|
dataType: "scheduled_check_in",
|
|
12500
12501
|
toolName: Cu,
|
|
@@ -12510,7 +12511,7 @@ function $y(t, e) {
|
|
|
12510
12511
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12511
12512
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12512
12513
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12513
|
-
respondsToUserMessageId:
|
|
12514
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12514
12515
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12515
12516
|
dataType: "function_call_output",
|
|
12516
12517
|
toolName: "authenticate_pipedream_app",
|
|
@@ -12523,7 +12524,7 @@ function $y(t, e) {
|
|
|
12523
12524
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12524
12525
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12525
12526
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12526
|
-
respondsToUserMessageId:
|
|
12527
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12527
12528
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12528
12529
|
dataType: "function_call_output",
|
|
12529
12530
|
toolName: "request_personal_channel_connection",
|
|
@@ -12538,7 +12539,7 @@ function $y(t, e) {
|
|
|
12538
12539
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12539
12540
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12540
12541
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12541
|
-
respondsToUserMessageId:
|
|
12542
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12542
12543
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12543
12544
|
dataType: String(s.type),
|
|
12544
12545
|
toolName: s.type === "tab_lifecycle_decision" ? "tab_lifecycle_decision" : typeof s.name == "string" ? s.name : void 0,
|
|
@@ -12552,7 +12553,7 @@ function $y(t, e) {
|
|
|
12552
12553
|
createdAt: typeof n.createdAt == "string" ? n.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
12553
12554
|
...je(s) !== null ? { displaySequence: je(s) } : {},
|
|
12554
12555
|
...ft(s) !== null ? { causalSequence: ft(s) } : {},
|
|
12555
|
-
respondsToUserMessageId:
|
|
12556
|
+
respondsToUserMessageId: pn(s) ?? void 0,
|
|
12556
12557
|
...Fe(s) ? { runId: Fe(s) } : {},
|
|
12557
12558
|
dataType: String(s.type),
|
|
12558
12559
|
loading: s.steered !== !0 && s.type === "run_status" && (s.status === "running" || s.status === "retrying"),
|
|
@@ -12861,7 +12862,7 @@ function rb(t) {
|
|
|
12861
12862
|
} = t;
|
|
12862
12863
|
return o;
|
|
12863
12864
|
}
|
|
12864
|
-
function
|
|
12865
|
+
function pn(t) {
|
|
12865
12866
|
const e = t.respondsToUserMessageId;
|
|
12866
12867
|
return typeof e == "string" && e ? e : null;
|
|
12867
12868
|
}
|
|
@@ -12885,7 +12886,7 @@ function Bu(t) {
|
|
|
12885
12886
|
return e;
|
|
12886
12887
|
}
|
|
12887
12888
|
function Za(t, e) {
|
|
12888
|
-
return Vu(t) ? bo :
|
|
12889
|
+
return Vu(t) ? bo : Qt(so(e), ty);
|
|
12889
12890
|
}
|
|
12890
12891
|
function cb(t, e) {
|
|
12891
12892
|
return typeof t == "string" ? t : t instanceof URL ? t.toString() : e?.url ?? "";
|
|
@@ -12919,10 +12920,10 @@ async function db(t) {
|
|
|
12919
12920
|
return;
|
|
12920
12921
|
const { done: c, value: l } = r;
|
|
12921
12922
|
if (c)
|
|
12922
|
-
return
|
|
12923
|
+
return Qt(o + s.decode());
|
|
12923
12924
|
const u = Ga - a;
|
|
12924
12925
|
if (l.byteLength > u)
|
|
12925
|
-
return o += s.decode(l.subarray(0, Math.max(u, 0)), { stream: !0 }), e.cancel(), `${
|
|
12926
|
+
return o += s.decode(l.subarray(0, Math.max(u, 0)), { stream: !0 }), e.cancel(), `${Qt(o)}... [truncated]`;
|
|
12926
12927
|
a += l.byteLength, o += s.decode(l, { stream: !0 });
|
|
12927
12928
|
}
|
|
12928
12929
|
} catch {
|
|
@@ -12935,14 +12936,14 @@ async function db(t) {
|
|
|
12935
12936
|
function ub(t, e) {
|
|
12936
12937
|
if (ju(new Headers(e)))
|
|
12937
12938
|
try {
|
|
12938
|
-
return t.responseType === "" || t.responseType === "text" ?
|
|
12939
|
+
return t.responseType === "" || t.responseType === "text" ? Qt(t.responseText ?? "") : void 0;
|
|
12939
12940
|
} catch {
|
|
12940
12941
|
return;
|
|
12941
12942
|
}
|
|
12942
12943
|
}
|
|
12943
12944
|
function ed(t) {
|
|
12944
12945
|
if (typeof t == "string")
|
|
12945
|
-
return
|
|
12946
|
+
return Qt(t);
|
|
12946
12947
|
}
|
|
12947
12948
|
function pb(t) {
|
|
12948
12949
|
return mt({
|
|
@@ -13011,7 +13012,7 @@ function fb(t) {
|
|
|
13011
13012
|
}
|
|
13012
13013
|
return e;
|
|
13013
13014
|
}
|
|
13014
|
-
function
|
|
13015
|
+
function Qt(t, e = Ga) {
|
|
13015
13016
|
return t.length <= e ? t : `${t.slice(0, e)}... [truncated ${t.length - e} chars]`;
|
|
13016
13017
|
}
|
|
13017
13018
|
function Dr(t) {
|
|
@@ -13050,7 +13051,7 @@ function wb(t) {
|
|
|
13050
13051
|
function _b(t) {
|
|
13051
13052
|
return t === 401 || t === 403;
|
|
13052
13053
|
}
|
|
13053
|
-
const bo = "[REDACTED_SECRET]",
|
|
13054
|
+
const bo = "[REDACTED_SECRET]", Yt = "[REDACTED_TOKEN]", vb = "[REDACTED_SIGNED_URL]", Ib = 20, Sb = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, $u = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Hu = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, Ku = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, Wu = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, kb = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, xb = /\bhttps?:\/\/[^\s"'<>]+/gi, Eb = /[),.;\]]+$/;
|
|
13054
13055
|
function mt(t) {
|
|
13055
13056
|
return io(t, 0, /* @__PURE__ */ new WeakSet());
|
|
13056
13057
|
}
|
|
@@ -13081,17 +13082,17 @@ function Gu(t) {
|
|
|
13081
13082
|
try {
|
|
13082
13083
|
const e = new URL(t, location.href);
|
|
13083
13084
|
for (const n of Array.from(e.searchParams.keys()))
|
|
13084
|
-
Sb.test(n) && e.searchParams.set(n,
|
|
13085
|
-
return e.username && (e.username =
|
|
13085
|
+
Sb.test(n) && e.searchParams.set(n, Yt);
|
|
13086
|
+
return e.username && (e.username = Yt), e.password && (e.password = Yt), e.toString();
|
|
13086
13087
|
} catch {
|
|
13087
13088
|
return Ab(t);
|
|
13088
13089
|
}
|
|
13089
13090
|
}
|
|
13090
13091
|
function so(t) {
|
|
13091
|
-
return t.replace(kb, vb).replace(xb, Rb).replace($u, `Bearer ${
|
|
13092
|
+
return t.replace(kb, vb).replace(xb, Rb).replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${bo}`);
|
|
13092
13093
|
}
|
|
13093
13094
|
function Ab(t) {
|
|
13094
|
-
return t.replace($u, `Bearer ${
|
|
13095
|
+
return t.replace($u, `Bearer ${Yt}`).replace(Hu, `Basic ${Yt}`).replace(Ku, Yt).replace(Wu, (e, n) => `${n}: ${bo}`);
|
|
13095
13096
|
}
|
|
13096
13097
|
function Rb(t) {
|
|
13097
13098
|
const e = t.match(Eb)?.[0] ?? "", n = e ? t.slice(0, -e.length) : t;
|
|
@@ -13693,7 +13694,7 @@ async function Cw(t = {}) {
|
|
|
13693
13694
|
l.style.setProperty(
|
|
13694
13695
|
"--pluno-pa-mobile-panel-top-offset",
|
|
13695
13696
|
`${e.mobilePanelTopOffset}px`
|
|
13696
|
-
), l.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && l.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (l.classList.add("pluno-pa-widget--minimized"),
|
|
13697
|
+
), l.classList.add(`pluno-pa-widget--${e.colorScheme}`), e.scribbleStyle && l.classList.add("pluno-pa-widget--scribble"), p === "minimized" && (l.classList.add("pluno-pa-widget--minimized"), hn(
|
|
13697
13698
|
l,
|
|
13698
13699
|
Br(
|
|
13699
13700
|
l,
|
|
@@ -13879,9 +13880,9 @@ async function Cw(t = {}) {
|
|
|
13879
13880
|
for (const h of di.values()) URL.revokeObjectURL?.(h);
|
|
13880
13881
|
di.clear();
|
|
13881
13882
|
};
|
|
13882
|
-
let St = 0,
|
|
13883
|
+
let St = 0, en = 0, uc = 0;
|
|
13883
13884
|
const qt = /* @__PURE__ */ new Map();
|
|
13884
|
-
let
|
|
13885
|
+
let tn = null, Bt = null;
|
|
13885
13886
|
const ko = (h) => h === F ? "widget_composer" : h === I ? "widget_launcher" : h && c.contains(h) ? "widget_control" : h === x.body ? "body" : h === x.documentElement ? "document" : h ? "host_page" : "none", _n = (h, v, A = {}) => {
|
|
13886
13887
|
const R = qs(x), j = A.skipIfAlreadyFocused === !0 && R === h;
|
|
13887
13888
|
j || (A.preventScroll ? h.focus({ preventScroll: !0 }) : h.focus());
|
|
@@ -13907,7 +13908,7 @@ async function Cw(t = {}) {
|
|
|
13907
13908
|
isThinking: O.getState().isThinking
|
|
13908
13909
|
}
|
|
13909
13910
|
), !j && ee === h;
|
|
13910
|
-
},
|
|
13911
|
+
}, nn = (h) => !F.isConnected || F.disabled || F.readOnly || !l.classList.contains("pluno-pa-widget--open") || e.loginRequired || e.signupRequired || $i(e.billingStatus) ? !1 : _n(F, h, {
|
|
13911
13912
|
preventScroll: !0,
|
|
13912
13913
|
skipIfAlreadyFocused: !0
|
|
13913
13914
|
}), ui = () => {
|
|
@@ -13915,9 +13916,9 @@ async function Cw(t = {}) {
|
|
|
13915
13916
|
we,
|
|
13916
13917
|
ut,
|
|
13917
13918
|
(h) => {
|
|
13918
|
-
|
|
13919
|
+
en++, ut = ut.filter(
|
|
13919
13920
|
(v, A) => A !== h
|
|
13920
|
-
), ui(), xe(O.getState()), Le(),
|
|
13921
|
+
), ui(), xe(O.getState()), Le(), nn("remove_attachment");
|
|
13921
13922
|
}
|
|
13922
13923
|
);
|
|
13923
13924
|
}, pc = e.loginRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (e.tokenEndpoint ? async (h) => cv(
|
|
@@ -14039,9 +14040,9 @@ async function Cw(t = {}) {
|
|
|
14039
14040
|
}
|
|
14040
14041
|
);
|
|
14041
14042
|
const Ro = new Set(d.openToolGroupKeys);
|
|
14042
|
-
let kt = null,
|
|
14043
|
+
let kt = null, sn = null, Ue = !1, on = !1, jt = {
|
|
14043
14044
|
enabled: !0
|
|
14044
|
-
},
|
|
14045
|
+
}, rn = 0, To = null, In = null, Sn = null, rs = null, fi = !1, be = null, mc = "local";
|
|
14045
14046
|
const yc = (h) => pi !== null && pi !== h.sessionId || vn !== null && vn !== (h.user?.id ?? null) || hi !== void 0 && hi !== h.selectionKey, bc = (h) => dh(G, h, {
|
|
14046
14047
|
renderSource: mc,
|
|
14047
14048
|
guardCreatedAt: be?.createdAt ?? null,
|
|
@@ -14068,9 +14069,9 @@ async function Cw(t = {}) {
|
|
|
14068
14069
|
current: be.observedWelcome
|
|
14069
14070
|
}), be = null);
|
|
14070
14071
|
}, Ap = (h = "jump") => {
|
|
14071
|
-
ht(!0, h), xt(), ei(G, () => jt.enabled),
|
|
14072
|
+
ht(!0, h), xt(), ei(G, () => jt.enabled), rn = G.scrollTop;
|
|
14072
14073
|
}, cs = (h) => {
|
|
14073
|
-
To = h, h === "up" && G.scrollTop <
|
|
14074
|
+
To = h, h === "up" && G.scrollTop < rn - 1 && (fi = !0, ht(!1, "userScroll")), In !== null && window.clearTimeout(In), In = window.setTimeout(() => {
|
|
14074
14075
|
To = null, In = null;
|
|
14075
14076
|
}, 500);
|
|
14076
14077
|
};
|
|
@@ -14108,7 +14109,7 @@ async function Cw(t = {}) {
|
|
|
14108
14109
|
);
|
|
14109
14110
|
const gt = document.createElement("small");
|
|
14110
14111
|
gt.className = "pluno-pa-widget__history-path", gt.textContent = Ww(R), j.append(he, Ie, gt), j.addEventListener("click", () => {
|
|
14111
|
-
He = !1, Ft(), be = null, fi = !1, as.clear(), ht(!0, "newSession"), xt(), O.loadSession(R.id), vi = null, xe(O.getState()),
|
|
14112
|
+
He = !1, Ft(), be = null, fi = !1, as.clear(), ht(!0, "newSession"), xt(), O.loadSession(R.id), vi = null, xe(O.getState()), nn("history_session_selected");
|
|
14112
14113
|
}), V.appendChild(j);
|
|
14113
14114
|
}
|
|
14114
14115
|
if (v && h.length > 0) {
|
|
@@ -14171,7 +14172,7 @@ async function Cw(t = {}) {
|
|
|
14171
14172
|
l.classList.remove("pluno-pa-widget--minimized"), m.removeAttribute("tabindex"), m.removeAttribute("role"), m.removeAttribute("aria-label"), !l.classList.contains("pluno-pa-widget--open") && !l.classList.contains("pluno-pa-widget--closing") && wi(!1), v && ls("shown", A);
|
|
14172
14173
|
return;
|
|
14173
14174
|
}
|
|
14174
|
-
kt !== null && (window.clearTimeout(kt), kt = null), l.classList.remove("pluno-pa-widget--open"), l.classList.remove("pluno-pa-widget--closing"), l.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), k.hidden = !0, B.hidden = !0, m.tabIndex = 0, F.value = "", dt(),
|
|
14175
|
+
kt !== null && (window.clearTimeout(kt), kt = null), l.classList.remove("pluno-pa-widget--open"), l.classList.remove("pluno-pa-widget--closing"), l.classList.add("pluno-pa-widget--minimized"), m.hidden = !1, m.setAttribute("role", "button"), m.setAttribute("aria-label", "Open Pluno"), k.hidden = !0, B.hidden = !0, m.tabIndex = 0, F.value = "", dt(), hn(
|
|
14175
14176
|
l,
|
|
14176
14177
|
Br(
|
|
14177
14178
|
l,
|
|
@@ -14200,12 +14201,12 @@ async function Cw(t = {}) {
|
|
|
14200
14201
|
});
|
|
14201
14202
|
}, wi = (h = !0) => {
|
|
14202
14203
|
if (!f) {
|
|
14203
|
-
|
|
14204
|
+
hn(l, null);
|
|
14204
14205
|
const A = yi(h);
|
|
14205
14206
|
return ss(), A;
|
|
14206
14207
|
}
|
|
14207
14208
|
const v = yi(h);
|
|
14208
|
-
return
|
|
14209
|
+
return hn(l, v), ss(), kn("Applied stored closed launcher position", {
|
|
14209
14210
|
visibleLauncherPosition: v
|
|
14210
14211
|
}), v;
|
|
14211
14212
|
}, ds = (h, v) => {
|
|
@@ -14222,7 +14223,7 @@ async function Cw(t = {}) {
|
|
|
14222
14223
|
return k.getBoundingClientRect().width || h;
|
|
14223
14224
|
}, xc = () => {
|
|
14224
14225
|
if (l.classList.contains("pluno-pa-widget--minimized")) {
|
|
14225
|
-
|
|
14226
|
+
hn(
|
|
14226
14227
|
l,
|
|
14227
14228
|
Br(
|
|
14228
14229
|
l,
|
|
@@ -14274,14 +14275,14 @@ async function Cw(t = {}) {
|
|
|
14274
14275
|
f = jr(
|
|
14275
14276
|
R,
|
|
14276
14277
|
A
|
|
14277
|
-
), b = null,
|
|
14278
|
+
), b = null, hn(l, R), ss(), kn("Dragging closed launcher", {
|
|
14278
14279
|
requestedPosition: v
|
|
14279
14280
|
});
|
|
14280
14281
|
},
|
|
14281
14282
|
persist: () => {
|
|
14282
14283
|
y = !0, Ye(), kn("Persisted closed launcher drag position");
|
|
14283
14284
|
}
|
|
14284
|
-
})) :
|
|
14285
|
+
})) : hn(l, null), zr(l, g);
|
|
14285
14286
|
const Cc = () => {
|
|
14286
14287
|
const h = zn(g), v = yi();
|
|
14287
14288
|
return {
|
|
@@ -14328,7 +14329,7 @@ async function Cw(t = {}) {
|
|
|
14328
14329
|
f = jr(
|
|
14329
14330
|
j,
|
|
14330
14331
|
R
|
|
14331
|
-
), y = !0, b = null,
|
|
14332
|
+
), y = !0, b = null, hn(l, j), ds(A, j);
|
|
14332
14333
|
}, qp = e.movableLauncher && M ? qw({
|
|
14333
14334
|
root: l,
|
|
14334
14335
|
handle: M,
|
|
@@ -14402,15 +14403,15 @@ async function Cw(t = {}) {
|
|
|
14402
14403
|
openPanelPosition: Ie,
|
|
14403
14404
|
visibleLauncherPosition: he
|
|
14404
14405
|
}), ht(!0, "open"), xt(), !ee && e.layout === "floating" && O.recordWidgetLifecycle("opened", j), !v) {
|
|
14405
|
-
l.classList.add("pluno-pa-widget--open"), ee || Lo(), m.hidden = !0, h && (F.value = h, Fi(F)), ei(G, () => jt.enabled),
|
|
14406
|
+
l.classList.add("pluno-pa-widget--open"), ee || Lo(), m.hidden = !0, h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_immediate"), F.setSelectionRange(F.value.length, F.value.length)), Ye(), ls("shown", j), e.onPanelOpenChange?.(!0, j);
|
|
14406
14407
|
return;
|
|
14407
14408
|
}
|
|
14408
14409
|
const gt = Date.now();
|
|
14409
14410
|
window.requestAnimationFrame(() => {
|
|
14410
|
-
l.classList.add("pluno-pa-widget--open"), ee || Lo(), h && (F.value = h, Fi(F)), ei(G, () => jt.enabled),
|
|
14411
|
+
l.classList.add("pluno-pa-widget--open"), ee || Lo(), h && (F.value = h, Fi(F)), ei(G, () => jt.enabled), rn = G.scrollTop, A && (_n(F, "panel_open_animation", {
|
|
14411
14412
|
scheduledAt: gt
|
|
14412
14413
|
}), F.setSelectionRange(F.value.length, F.value.length)), Ye(), ls("shown", j), e.onPanelOpenChange?.(!0, j), kt = window.setTimeout(() => {
|
|
14413
|
-
m.hidden = !0, ei(G, () => jt.enabled),
|
|
14414
|
+
m.hidden = !0, ei(G, () => jt.enabled), rn = G.scrollTop;
|
|
14414
14415
|
}, 220);
|
|
14415
14416
|
});
|
|
14416
14417
|
}, jo = (h = "external_request") => {
|
|
@@ -14435,7 +14436,7 @@ async function Cw(t = {}) {
|
|
|
14435
14436
|
const h = I.value;
|
|
14436
14437
|
Mt(h, !0, !0, !0, "launcher_input"), I.value = "";
|
|
14437
14438
|
});
|
|
14438
|
-
let Ii = null,
|
|
14439
|
+
let Ii = null, an = null, us = null, An = null, Ot = null, ze = null;
|
|
14439
14440
|
const ps = (h) => h === I || h === F, qc = (h) => h.composedPath().find(ps) ?? null, Op = (h) => {
|
|
14440
14441
|
let v = h;
|
|
14441
14442
|
for (; v; ) {
|
|
@@ -14503,14 +14504,14 @@ async function Cw(t = {}) {
|
|
|
14503
14504
|
if (!v)
|
|
14504
14505
|
return;
|
|
14505
14506
|
const A = Date.now();
|
|
14506
|
-
|
|
14507
|
+
an = A, Ii = A, ze !== null && window.clearTimeout(ze);
|
|
14507
14508
|
const R = $t ?? Fo($o());
|
|
14508
14509
|
R && (Si(R, v), h.stopImmediatePropagation()), ze = window.setTimeout(() => {
|
|
14509
|
-
if (ze = null,
|
|
14510
|
+
if (ze = null, an !== A)
|
|
14510
14511
|
return;
|
|
14511
14512
|
const j = $o();
|
|
14512
14513
|
if (j === v) {
|
|
14513
|
-
|
|
14514
|
+
an = null;
|
|
14514
14515
|
return;
|
|
14515
14516
|
}
|
|
14516
14517
|
const ee = Fo(j);
|
|
@@ -14518,7 +14519,7 @@ async function Cw(t = {}) {
|
|
|
14518
14519
|
}, 0);
|
|
14519
14520
|
}, hs = (h) => {
|
|
14520
14521
|
const v = qc(h);
|
|
14521
|
-
v && (Ii = Date.now(), $t !== null && (h.stopImmediatePropagation(),
|
|
14522
|
+
v && (Ii = Date.now(), $t !== null && (h.stopImmediatePropagation(), an = null, ze !== null && (window.clearTimeout(ze), ze = null), Ye(), h.type === "focus" && v === I && Pc()));
|
|
14522
14523
|
};
|
|
14523
14524
|
x.defaultView?.addEventListener(
|
|
14524
14525
|
"pointerdown",
|
|
@@ -14535,15 +14536,15 @@ async function Cw(t = {}) {
|
|
|
14535
14536
|
), l.addEventListener("pointerdown", (h) => {
|
|
14536
14537
|
ps(h.target) && h.stopPropagation();
|
|
14537
14538
|
}), l.addEventListener("focusin", (h) => {
|
|
14538
|
-
ps(h.target) && (h.stopPropagation(), Ii = Date.now(),
|
|
14539
|
+
ps(h.target) && (h.stopPropagation(), Ii = Date.now(), an = null, ze !== null && (window.clearTimeout(ze), ze = null), Ye());
|
|
14539
14540
|
}), l.addEventListener("focusout", (h) => {
|
|
14540
14541
|
if (!ps(h.target) || $t !== null)
|
|
14541
14542
|
return;
|
|
14542
14543
|
const v = Ii;
|
|
14543
14544
|
if (Ii = null, v === null || Date.now() - v > ld)
|
|
14544
14545
|
return;
|
|
14545
|
-
const A = h.target, R =
|
|
14546
|
-
|
|
14546
|
+
const A = h.target, R = an !== null && Date.now() - an <= ld;
|
|
14547
|
+
an = null, ze !== null && (window.clearTimeout(ze), ze = null);
|
|
14547
14548
|
const j = (ee) => {
|
|
14548
14549
|
const he = Fo(ee);
|
|
14549
14550
|
if (!he)
|
|
@@ -14580,7 +14581,7 @@ async function Cw(t = {}) {
|
|
|
14580
14581
|
}), G.addEventListener("keydown", (h) => {
|
|
14581
14582
|
(h.key === "ArrowUp" || h.key === "PageUp" || h.key === "Home") && cs("up");
|
|
14582
14583
|
}), G.addEventListener("scroll", () => {
|
|
14583
|
-
G.scrollTop <
|
|
14584
|
+
G.scrollTop < rn - 1 && To === "up" && (fi = !0, ht(!1, "userScroll")), rn = G.scrollTop, Mo();
|
|
14584
14585
|
}), ie.addEventListener("click", () => {
|
|
14585
14586
|
Ap();
|
|
14586
14587
|
});
|
|
@@ -14612,7 +14613,7 @@ async function Cw(t = {}) {
|
|
|
14612
14613
|
}, Jn = () => {
|
|
14613
14614
|
const h = i(), v = O.getState(), A = !v.isThinking && !v.pendingMessageStatus && !!v.lastError;
|
|
14614
14615
|
I.readOnly = !1, F.readOnly = !1, I.placeholder = h ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : A ? "Needs attention" : ki ? "New update" : e.launcherLabel, F.placeholder = h ? e.signupRequired ? e.signupButtonLabel : e.loginButtonLabel : Wt.launcherLabel, C.hidden = h;
|
|
14615
|
-
}, fs = () => [...qt.values()].some((h) => h.revision ===
|
|
14616
|
+
}, fs = () => [...qt.values()].some((h) => h.revision === en && h.generation === St), Uc = () => {
|
|
14616
14617
|
const h = O.getState(), v = e.billingStatus;
|
|
14617
14618
|
return {
|
|
14618
14619
|
submissionAllowed: v?.submissionGate?.allowed === !0,
|
|
@@ -14626,7 +14627,7 @@ async function Cw(t = {}) {
|
|
|
14626
14627
|
hasPendingMessage: !1
|
|
14627
14628
|
};
|
|
14628
14629
|
}, Tn = () => !O.getState().isLoadingSession && (e.productVariant === "personal" ? xi() && !i() && !fs() && e.billingStatus?.submissionGate?.allowed === !0 || ol(Uc()) : !Up() && !$i(e.billingStatus) && !fs()), zc = () => {
|
|
14629
|
-
const h = O.getState(), v = !xi() && [...qt.values()].some((A) => A.revision ===
|
|
14630
|
+
const h = O.getState(), v = !xi() && [...qt.values()].some((A) => A.revision === en && A.generation === St);
|
|
14630
14631
|
return mh({
|
|
14631
14632
|
hasRunningAssistantTurn: v || h.isThinking || h.turnPhase !== null || h.pendingMessageStatus !== null,
|
|
14632
14633
|
// Retained text already submitted by this revision must not hide Stop behind a disabled Send.
|
|
@@ -14671,7 +14672,7 @@ async function Cw(t = {}) {
|
|
|
14671
14672
|
}, 3e3);
|
|
14672
14673
|
}, Vo = (h, v) => {
|
|
14673
14674
|
const A = qt.get(h);
|
|
14674
|
-
if (!A || v !== void 0 && A.submittedAt !== v || (qt.delete(h), A.generation !== St || A.revision !==
|
|
14675
|
+
if (!A || v !== void 0 && A.submittedAt !== v || (qt.delete(h), A.generation !== St || A.revision !== en)) return;
|
|
14675
14676
|
const R = new Set(A.attachments);
|
|
14676
14677
|
ut = ut.filter((j) => !R.has(j)), F.value = "", F.dispatchEvent(new Event("input", { bubbles: !0 })), ui(), Le();
|
|
14677
14678
|
}, Bc = (h) => {
|
|
@@ -14696,17 +14697,17 @@ async function Cw(t = {}) {
|
|
|
14696
14697
|
v === St && Le();
|
|
14697
14698
|
});
|
|
14698
14699
|
}, jc = () => {
|
|
14699
|
-
if (Ue || !
|
|
14700
|
+
if (Ue || !tn || e.productVariant === "personal" && !ol({ ...Uc(), isSubmitting: !1 }) || O.getState().status !== "connected" || i() || $i(e.billingStatus))
|
|
14700
14701
|
return;
|
|
14701
|
-
const h =
|
|
14702
|
-
|
|
14702
|
+
const h = tn;
|
|
14703
|
+
tn = null, Bc(h);
|
|
14703
14704
|
}, Go = () => {
|
|
14704
14705
|
const h = F.value, v = h.trim(), A = [...ut];
|
|
14705
|
-
if (
|
|
14706
|
+
if (tn !== null || fs() || !Tn() || !v && A.length === 0)
|
|
14706
14707
|
return;
|
|
14707
14708
|
for (const j of A)
|
|
14708
14709
|
j.id && j.previewUrl && di.set(j.id, j.previewUrl);
|
|
14709
|
-
if ([...qt.values()].some((j) => j.revision ===
|
|
14710
|
+
if ([...qt.values()].some((j) => j.revision === en && j.generation === St)) return;
|
|
14710
14711
|
const R = {
|
|
14711
14712
|
inputValue: h,
|
|
14712
14713
|
requestedModel: ot,
|
|
@@ -14715,14 +14716,14 @@ async function Cw(t = {}) {
|
|
|
14715
14716
|
clientMessageId: crypto.randomUUID(),
|
|
14716
14717
|
submittedAt: Math.max(Date.now(), uc + 1)
|
|
14717
14718
|
};
|
|
14718
|
-
if (uc = R.submittedAt, qt.set(R.clientMessageId, { ...R, revision:
|
|
14719
|
+
if (uc = R.submittedAt, qt.set(R.clientMessageId, { ...R, revision: en, generation: St }), Le(), be = {
|
|
14719
14720
|
createdAt: Date.now(),
|
|
14720
14721
|
clientMessageId: R.clientMessageId,
|
|
14721
14722
|
observedConversation: null,
|
|
14722
14723
|
observedWelcome: null,
|
|
14723
14724
|
pendingSubmission: !0
|
|
14724
14725
|
}, xi() && !e.runtimeClient) {
|
|
14725
|
-
|
|
14726
|
+
tn = R;
|
|
14726
14727
|
return;
|
|
14727
14728
|
}
|
|
14728
14729
|
Bc(R);
|
|
@@ -14736,10 +14737,10 @@ async function Cw(t = {}) {
|
|
|
14736
14737
|
e.onSignupClick?.();
|
|
14737
14738
|
return;
|
|
14738
14739
|
}
|
|
14739
|
-
Tn() && (
|
|
14740
|
+
Tn() && (on = !0, ht(!0, "send"), xt(), Go());
|
|
14740
14741
|
});
|
|
14741
14742
|
let Ei = 0;
|
|
14742
|
-
const
|
|
14743
|
+
const cn = () => {
|
|
14743
14744
|
Ei = 0, l.classList.remove("pluno-pa-widget--drag-over");
|
|
14744
14745
|
}, zp = () => {
|
|
14745
14746
|
Bt !== null && (window.clearTimeout(Bt), Bt = null), U.textContent = "", U.hidden = !0;
|
|
@@ -14751,11 +14752,11 @@ async function Cw(t = {}) {
|
|
|
14751
14752
|
h,
|
|
14752
14753
|
e.productVariant === "customer_embedded"
|
|
14753
14754
|
);
|
|
14754
|
-
if (
|
|
14755
|
+
if (en++, ut = [...ut, ...v], ui(), zp(), Le(), xe(O.getState()), !l.classList.contains("pluno-pa-widget--open")) {
|
|
14755
14756
|
Mt("", !0, !0, !0, "attachment_drop");
|
|
14756
14757
|
return;
|
|
14757
14758
|
}
|
|
14758
|
-
|
|
14759
|
+
nn("attachment_added");
|
|
14759
14760
|
}, Bp = async (h) => {
|
|
14760
14761
|
await Jo(h), !(h.length === 0 || $t !== null) && _n(F, "attachment_picker_completed");
|
|
14761
14762
|
};
|
|
@@ -14779,15 +14780,15 @@ async function Cw(t = {}) {
|
|
|
14779
14780
|
Ms(h.dataTransfer) && (h.stopPropagation(), Ei = Math.max(0, Ei - 1), Ei === 0 && l.classList.remove("pluno-pa-widget--drag-over"));
|
|
14780
14781
|
});
|
|
14781
14782
|
const Fc = (h) => {
|
|
14782
|
-
l.classList.contains("pluno-pa-widget--drag-over") && !h.composedPath().includes(l) &&
|
|
14783
|
+
l.classList.contains("pluno-pa-widget--drag-over") && !h.composedPath().includes(l) && cn();
|
|
14783
14784
|
};
|
|
14784
14785
|
x.addEventListener(
|
|
14785
14786
|
"dragover",
|
|
14786
14787
|
Fc,
|
|
14787
14788
|
!0
|
|
14788
|
-
), x.addEventListener("drop",
|
|
14789
|
+
), x.addEventListener("drop", cn, !0), x.addEventListener("dragend", cn, !0), x.defaultView?.addEventListener("blur", cn), l.addEventListener("drop", (h) => {
|
|
14789
14790
|
const v = h.dataTransfer;
|
|
14790
|
-
!e.attachmentsEnabled || !Ms(v) || e.loginRequired || Rn() || (h.preventDefault(), h.stopPropagation(),
|
|
14791
|
+
!e.attachmentsEnabled || !Ms(v) || e.loginRequired || Rn() || (h.preventDefault(), h.stopPropagation(), cn(), Jo(v.files).catch((A) => {
|
|
14791
14792
|
ms(
|
|
14792
14793
|
A instanceof Error ? A.message : "Failed to attach file"
|
|
14793
14794
|
), at("web-sdk.widget", "Attachment failed", {
|
|
@@ -14813,30 +14814,30 @@ async function Cw(t = {}) {
|
|
|
14813
14814
|
if (h.disabled)
|
|
14814
14815
|
return;
|
|
14815
14816
|
if (h.action === "stop") {
|
|
14816
|
-
qt.clear(),
|
|
14817
|
+
qt.clear(), tn = null, be = null, O.stop(), Le();
|
|
14817
14818
|
return;
|
|
14818
14819
|
}
|
|
14819
14820
|
const v = F.value.trim().length > 0 || ut.length > 0;
|
|
14820
|
-
|
|
14821
|
+
on = !0, ht(!0, "send"), xt(), Go(), xe(O.getState()), Le(), v && nn("send_button_submit");
|
|
14821
14822
|
}), ve.addEventListener("click", () => {
|
|
14822
|
-
He = !He, Ft(), He && (Qe.data === null || Qe.status === "error") && Qe.status !== "loading" && Do(), He ||
|
|
14823
|
+
He = !He, Ft(), He && (Qe.data === null || Qe.status === "error") && Qe.status !== "loading" && Do(), He || nn("history_closed");
|
|
14823
14824
|
}), pe.addEventListener("click", () => {
|
|
14824
|
-
He = !1, Ft(),
|
|
14825
|
+
He = !1, Ft(), nn("history_closed");
|
|
14825
14826
|
}), V.addEventListener("scroll", Rp), F.addEventListener("input", () => {
|
|
14826
|
-
|
|
14827
|
+
en++, F.value.trim() && Tc("composer_input"), Fi(F), Ye(), Le(), Gc();
|
|
14827
14828
|
}), F.addEventListener("keydown", (h) => {
|
|
14828
14829
|
if (!(h.key !== "Enter" || h.shiftKey || h.isComposing || h.keyCode === 229)) {
|
|
14829
14830
|
if (h.preventDefault(), e.loginRequired) {
|
|
14830
14831
|
e.onLoginClick?.();
|
|
14831
14832
|
return;
|
|
14832
14833
|
}
|
|
14833
|
-
Tn() && (
|
|
14834
|
+
Tn() && (on = !0, ht(!0, "send"), xt(), Go(), xe(O.getState()), Le());
|
|
14834
14835
|
}
|
|
14835
14836
|
}), l.addEventListener("click", (h) => {
|
|
14836
14837
|
const v = h.target instanceof Element ? h.target : null;
|
|
14837
14838
|
v?.closest("a[href]") && Ye(), He && zb(v, it, ve) && (He = !1, Ft());
|
|
14838
14839
|
const R = window.getSelection(), j = !!(R && !R.isCollapsed && R.anchorNode && l.contains(R.anchorNode));
|
|
14839
|
-
Nb(h.target, h.detail, j) &&
|
|
14840
|
+
Nb(h.target, h.detail, j) && nn("passive_surface_click");
|
|
14840
14841
|
});
|
|
14841
14842
|
let $c = !1;
|
|
14842
14843
|
const Hc = (h) => {
|
|
@@ -14887,7 +14888,7 @@ async function Cw(t = {}) {
|
|
|
14887
14888
|
gp(h), h.stopPropagation();
|
|
14888
14889
|
return;
|
|
14889
14890
|
}
|
|
14890
|
-
h.key !== "Escape" || !He || (He = !1, Ft(),
|
|
14891
|
+
h.key !== "Escape" || !He || (He = !1, Ft(), nn("history_escape"));
|
|
14891
14892
|
}), d.composerValue && (F.value = d.composerValue, Fi(F)), e.layout === "page" ? Mt(F.value, !1, !0, !1, "external_request") : p === "minimized" ? bi("minimized", !1) : e.initialDisplayState === void 0 && d.isOpen && Mt(F.value, !1, !1, !1, "restored_state");
|
|
14892
14893
|
const Ci = () => u;
|
|
14893
14894
|
let Qo = O.getState().appearance !== null, Ai = O.getInteractions();
|
|
@@ -14922,7 +14923,7 @@ async function Cw(t = {}) {
|
|
|
14922
14923
|
for (const W of A.allowedActions) {
|
|
14923
14924
|
const Pe = document.createElement("button");
|
|
14924
14925
|
Pe.type = "button", Pe.className = W === "enable" || W === "allow" ? "pluno-pa-widget__notify-suggestion-enable" : "pluno-pa-widget__notify-suggestion-later", Pe.textContent = he && (ee?.action ? ee.action === W : W === "enable") ? W === "enable" || W === "allow" ? "Turning on…" : "Saving…" : A.presentation.actionLabels[W] ?? W, Pe.disabled = he, Pe.onclick = () => {
|
|
14925
|
-
ys.run(j, W, () =>
|
|
14926
|
+
ys.run(j, W, () => ln(A, W));
|
|
14926
14927
|
}, Yn.append(Pe);
|
|
14927
14928
|
}
|
|
14928
14929
|
v.append(gt, Yn);
|
|
@@ -14932,7 +14933,7 @@ async function Cw(t = {}) {
|
|
|
14932
14933
|
W.setAttribute("role", "alert"), W.textContent = qi, v.append(W);
|
|
14933
14934
|
}
|
|
14934
14935
|
}
|
|
14935
|
-
},
|
|
14936
|
+
}, ln = (h, v, A) => h ? O.actOnInteraction(
|
|
14936
14937
|
h.id,
|
|
14937
14938
|
v,
|
|
14938
14939
|
h.revision,
|
|
@@ -14968,12 +14969,12 @@ async function Cw(t = {}) {
|
|
|
14968
14969
|
let Qn = null;
|
|
14969
14970
|
const Zo = (h = {}) => {
|
|
14970
14971
|
e.productVariant === "personal" && O.refreshSessionHistory().catch(() => {
|
|
14971
|
-
}), St++, qt.clear(), dc(),
|
|
14972
|
+
}), St++, qt.clear(), dc(), tn = null, be = null, fi = !1, as.clear(), on = !0, ht(!0, "newSession"), xt(), He = !1, Ft();
|
|
14972
14973
|
const v = Promise.resolve(O.startNewSession(h));
|
|
14973
14974
|
return vi = null, Ro.clear(), F.value = "", ut = [], ui(), Fi(F), Ye(), Le(), _n(F, "new_chat"), xe(O.getState()), v;
|
|
14974
14975
|
};
|
|
14975
14976
|
ce?.addEventListener("click", () => {
|
|
14976
|
-
|
|
14977
|
+
ln(Xe("proactive_suggestion"), "run").catch(() => {
|
|
14977
14978
|
});
|
|
14978
14979
|
});
|
|
14979
14980
|
const Jc = () => {
|
|
@@ -14981,15 +14982,15 @@ async function Cw(t = {}) {
|
|
|
14981
14982
|
Je = null, dt();
|
|
14982
14983
|
return;
|
|
14983
14984
|
}
|
|
14984
|
-
|
|
14985
|
+
ln(Xe("proactive_suggestion"), "not_now").catch(() => {
|
|
14985
14986
|
});
|
|
14986
14987
|
};
|
|
14987
14988
|
X?.addEventListener("click", Jc), D?.addEventListener("click", Jc), Y?.addEventListener("click", () => {
|
|
14988
|
-
|
|
14989
|
+
ln(Xe("proactive_suggestion"), "edit").catch(() => {
|
|
14989
14990
|
});
|
|
14990
14991
|
}), $?.addEventListener("click", async () => {
|
|
14991
14992
|
const h = e.proactiveSuggestion, v = Xe("proactive_suggestion");
|
|
14992
|
-
!h || !v || (await
|
|
14993
|
+
!h || !v || (await ln(v, "never"), Je = h, st = "idle", de && (de.value = ""), dt());
|
|
14993
14994
|
}), de?.addEventListener("input", () => {
|
|
14994
14995
|
st === "error" && (st = "idle"), dt();
|
|
14995
14996
|
}), se?.addEventListener("click", async () => {
|
|
@@ -15019,16 +15020,16 @@ async function Cw(t = {}) {
|
|
|
15019
15020
|
Ht.className = "pluno-pa-widget__error";
|
|
15020
15021
|
const er = document.createTextNode("");
|
|
15021
15022
|
Ht.appendChild(er);
|
|
15022
|
-
const
|
|
15023
|
-
|
|
15023
|
+
const dn = document.createElement("a");
|
|
15024
|
+
dn.className = "pluno-pa-widget__error-retry", dn.target = "_blank", dn.rel = "noreferrer", dn.textContent = "Security settings";
|
|
15024
15025
|
const Et = document.createElement("button");
|
|
15025
15026
|
Et.type = "button", Et.className = "pluno-pa-widget__error-retry";
|
|
15026
15027
|
const Qc = bn(), Yc = document.createTextNode("Try again");
|
|
15027
15028
|
Et.append(Qc, Yc);
|
|
15028
|
-
let Xc = "",
|
|
15029
|
+
let Xc = "", un = !1;
|
|
15029
15030
|
const Hp = async () => {
|
|
15030
|
-
if (
|
|
15031
|
-
|
|
15031
|
+
if (un) return;
|
|
15032
|
+
un = !0, xe(O.getState());
|
|
15032
15033
|
let h;
|
|
15033
15034
|
try {
|
|
15034
15035
|
await Promise.race([
|
|
@@ -15038,7 +15039,7 @@ async function Cw(t = {}) {
|
|
|
15038
15039
|
})
|
|
15039
15040
|
]);
|
|
15040
15041
|
} finally {
|
|
15041
|
-
clearTimeout(h),
|
|
15042
|
+
clearTimeout(h), un = !1, Ue || xe(O.getState());
|
|
15042
15043
|
}
|
|
15043
15044
|
};
|
|
15044
15045
|
Et.addEventListener("click", () => {
|
|
@@ -15061,18 +15062,18 @@ async function Cw(t = {}) {
|
|
|
15061
15062
|
...Object.getOwnPropertyDescriptors(W),
|
|
15062
15063
|
attachments: { value: Pe, enumerable: !0, configurable: !0 }
|
|
15063
15064
|
});
|
|
15064
|
-
}) }, gi(),
|
|
15065
|
+
}) }, gi(), sn !== null && (window.clearTimeout(sn), sn = null), Ft(), dt(), So(), ne.hidden = !i(), ne.hidden && ne.replaceChildren();
|
|
15065
15066
|
const R = JSON.stringify([
|
|
15066
15067
|
i(),
|
|
15067
15068
|
h.lastError,
|
|
15068
15069
|
h.lastErrorCode,
|
|
15069
15070
|
h.lastErrorSecuritySettingsUrl,
|
|
15070
|
-
|
|
15071
|
+
un
|
|
15071
15072
|
]);
|
|
15072
15073
|
if (Xc !== R) {
|
|
15073
15074
|
Xc = R, Oe.hidden = i() || !h.lastError || Ji(h.lastErrorCode) !== "bottom_notice";
|
|
15074
15075
|
const W = Oe.hidden ? "" : h.lastError ?? "";
|
|
15075
|
-
er.data !== W && (er.data = W), Oe.hidden ? Ht.remove() : Ht.parentElement !== Oe && Oe.appendChild(Ht), h.lastErrorSecuritySettingsUrl ? (
|
|
15076
|
+
er.data !== W && (er.data = W), Oe.hidden ? Ht.remove() : Ht.parentElement !== Oe && Oe.appendChild(Ht), h.lastErrorSecuritySettingsUrl ? (dn.href = h.lastErrorSecuritySettingsUrl, dn.parentElement !== Ht && Ht.insertBefore(dn, Et.parentElement ? Et : null)) : dn.remove(), h.lastErrorCode === "connection_failed" || h.lastErrorCode === "auth_reconnecting" || h.lastErrorCode === "submission_checkpoint_pending" ? (Et.disabled = un, Et.setAttribute("aria-busy", String(un)), Qc.hidden = !un, Yc.data = un ? "Trying" : "Try again", Et.parentElement !== Ht && Ht.appendChild(Et)) : Et.remove();
|
|
15076
15077
|
}
|
|
15077
15078
|
if (A) {
|
|
15078
15079
|
mi = "", Ri.clear(), ws.clear(), _s.clear(), G.replaceChildren(), Os(
|
|
@@ -15150,8 +15151,8 @@ async function Cw(t = {}) {
|
|
|
15150
15151
|
xi()
|
|
15151
15152
|
]), ee = j !== mi;
|
|
15152
15153
|
mi = j;
|
|
15153
|
-
const he =
|
|
15154
|
-
|
|
15154
|
+
const he = on || jt.enabled;
|
|
15155
|
+
on = !1, (ee || v.skipUnchangedTimeline !== !0) && E_(
|
|
15155
15156
|
G,
|
|
15156
15157
|
Te,
|
|
15157
15158
|
ue,
|
|
@@ -15171,16 +15172,16 @@ async function Cw(t = {}) {
|
|
|
15171
15172
|
(W, Pe) => {
|
|
15172
15173
|
if (!Tn())
|
|
15173
15174
|
return;
|
|
15174
|
-
|
|
15175
|
+
on = !0, ht(!0, "send"), xt();
|
|
15175
15176
|
const qe = Xe("morning_report");
|
|
15176
|
-
qe ?
|
|
15177
|
+
qe ? ln(qe, "run", { taskIndex: Pe }).catch(() => {
|
|
15177
15178
|
}) : O.sendMessage(W, { requestedModel: ot });
|
|
15178
15179
|
},
|
|
15179
|
-
(W) => (
|
|
15180
|
+
(W) => (on = !0, ht(!0, "send"), xt(), O.retryLastMessage(W)),
|
|
15180
15181
|
e.morningReport,
|
|
15181
15182
|
() => {
|
|
15182
15183
|
const W = Xe("morning_report");
|
|
15183
|
-
W &&
|
|
15184
|
+
W && ln(W, "snooze").then(() => {
|
|
15184
15185
|
jo("morning_report_snooze"), xe(O.getState());
|
|
15185
15186
|
}).catch(() => xe(O.getState()));
|
|
15186
15187
|
},
|
|
@@ -15195,7 +15196,7 @@ async function Cw(t = {}) {
|
|
|
15195
15196
|
cards: Ai.filter((W) => W.placement === "turn"),
|
|
15196
15197
|
morning: Xe("morning_report"),
|
|
15197
15198
|
act: (W, Pe, qe) => {
|
|
15198
|
-
|
|
15199
|
+
ln(W, Pe, { sharePlatform: qe }).catch(() => {
|
|
15199
15200
|
});
|
|
15200
15201
|
},
|
|
15201
15202
|
socialPostRewardsUrl: e.socialPostRewardsUrl
|
|
@@ -15206,12 +15207,12 @@ async function Cw(t = {}) {
|
|
|
15206
15207
|
);
|
|
15207
15208
|
be && !be.observedWelcome && !Ie && wd(h) && (be.observedConversation = bc(h)), Ic(), Le(), dt();
|
|
15208
15209
|
const gt = Array.isArray(h.activeScheduledFollowUps) ? h.activeScheduledFollowUps : null, Yn = (gt !== null ? gt.map((W) => W.dueAt) : h.messages.map((W) => W.scheduledCheckInAt)).filter((W) => !!W).filter((W) => ri(W) !== null).sort((W, Pe) => Date.parse(W) - Date.parse(Pe))[0] ?? null, qi = Yn ? Im(Yn) : null;
|
|
15209
|
-
qi !== null && (
|
|
15210
|
+
qi !== null && (sn = window.setTimeout(
|
|
15210
15211
|
() => {
|
|
15211
|
-
|
|
15212
|
+
sn = null, Ue || xe(O.getState());
|
|
15212
15213
|
},
|
|
15213
15214
|
Math.min(qi, 2147483647)
|
|
15214
|
-
)), he ? (
|
|
15215
|
+
)), he ? (rn = G.scrollTop, xt()) : ee && wd(h) && Cp();
|
|
15215
15216
|
}, Zc = () => {
|
|
15216
15217
|
x.getSelection()?.isCollapsed !== !1 && O_(Ri) && xe(O.getState());
|
|
15217
15218
|
};
|
|
@@ -15243,7 +15244,7 @@ async function Cw(t = {}) {
|
|
|
15243
15244
|
Ie.role === "user" && Vo(Ie.id);
|
|
15244
15245
|
for (const Ie of h.receipts ?? []) Vo(Ie.userMessageId, Ie.acceptedRendererRevision);
|
|
15245
15246
|
e.extensionRuntime && (tr += 1, Pi = null), nr(h), el(h), h.status === "connected" && (e.productVariant === "personal" && !gc && e.layout === "page" && !hc && (hc = !0, O.refreshSessionHistory().catch(() => {
|
|
15246
|
-
})), gs = !0,
|
|
15247
|
+
})), gs = !0, tn && queueMicrotask(() => {
|
|
15247
15248
|
jc();
|
|
15248
15249
|
})), jp();
|
|
15249
15250
|
const A = Xo && !h.isThinking, R = wc !== location.origin || _c !== h.sessionId || vc !== (h.user?.id ?? null), j = Xo !== h.isThinking, ee = Po !== "connected" && h.status === "connected", he = Po === "connected" && h.status !== "connected";
|
|
@@ -15321,10 +15322,10 @@ async function Cw(t = {}) {
|
|
|
15321
15322
|
"dragover",
|
|
15322
15323
|
Fc,
|
|
15323
15324
|
!0
|
|
15324
|
-
), x.removeEventListener("drop",
|
|
15325
|
+
), x.removeEventListener("drop", cn, !0), x.removeEventListener("dragend", cn, !0), x.defaultView?.removeEventListener(
|
|
15325
15326
|
"blur",
|
|
15326
|
-
|
|
15327
|
-
), window.removeEventListener("resize", xc), Ec(), qp(), Mp(), Bt !== null && window.clearTimeout(Bt), pt !== null && (window.clearTimeout(pt), pt = null), Ep(), In !== null && (window.clearTimeout(In), In = null),
|
|
15327
|
+
cn
|
|
15328
|
+
), window.removeEventListener("resize", xc), Ec(), qp(), Mp(), Bt !== null && window.clearTimeout(Bt), pt !== null && (window.clearTimeout(pt), pt = null), Ep(), In !== null && (window.clearTimeout(In), In = null), sn !== null && (window.clearTimeout(sn), sn = null), os?.clear(), xo && O.destroy(), Eo?.release(), r.remove());
|
|
15328
15329
|
}
|
|
15329
15330
|
};
|
|
15330
15331
|
async function Qp(h) {
|
|
@@ -15798,7 +15799,7 @@ function Gi(t, e) {
|
|
|
15798
15799
|
)
|
|
15799
15800
|
};
|
|
15800
15801
|
}
|
|
15801
|
-
function
|
|
15802
|
+
function hn(t, e) {
|
|
15802
15803
|
if (t.classList.toggle("pluno-pa-widget--custom-position", e !== null), t.classList.toggle(
|
|
15803
15804
|
"pluno-pa-widget--proactive-suggestion-left-aligned",
|
|
15804
15805
|
e !== null && e.x < tt().width / 2
|
|
@@ -16033,21 +16034,21 @@ function Jw(t, e) {
|
|
|
16033
16034
|
)
|
|
16034
16035
|
), s.appendChild(f), s.appendChild(e_()), n.appendChild(s);
|
|
16035
16036
|
const y = document.createElement("div");
|
|
16036
|
-
return y.className = "pluno-pa-widget__proactive-suggestion-slot", n.appendChild(y), n.appendChild(Zw()), n.appendChild(
|
|
16037
|
-
|
|
16038
|
-
), n.appendChild(
|
|
16039
|
-
|
|
16037
|
+
return y.className = "pluno-pa-widget__proactive-suggestion-slot", n.appendChild(y), n.appendChild(Zw()), n.appendChild(gn("left", "Resize Pluno from left")), n.appendChild(
|
|
16038
|
+
gn("right", "Resize Pluno from right")
|
|
16039
|
+
), n.appendChild(gn("top", "Resize Pluno from top")), n.appendChild(
|
|
16040
|
+
gn("bottom", "Resize Pluno from bottom")
|
|
16040
16041
|
), n.appendChild(
|
|
16041
|
-
|
|
16042
|
+
gn("top-left", "Resize Pluno from top left")
|
|
16042
16043
|
), n.appendChild(
|
|
16043
|
-
|
|
16044
|
+
gn("top-right", "Resize Pluno from top right")
|
|
16044
16045
|
), n.appendChild(
|
|
16045
|
-
|
|
16046
|
+
gn("bottom-left", "Resize Pluno from bottom left")
|
|
16046
16047
|
), n.appendChild(
|
|
16047
|
-
|
|
16048
|
+
gn("bottom-right", "Resize Pluno from bottom right")
|
|
16048
16049
|
), n;
|
|
16049
16050
|
}
|
|
16050
|
-
function
|
|
16051
|
+
function gn(t, e) {
|
|
16051
16052
|
const n = document.createElement("button");
|
|
16052
16053
|
return n.type = "button", n.className = [
|
|
16053
16054
|
"pluno-pa-widget__resize-handle",
|