@pluno/product-agent-web 0.1.85 → 0.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-widget.js +167 -167
- package/package.json +1 -1
|
@@ -161,7 +161,7 @@ function ki(e, t = {}) {
|
|
|
161
161
|
}, p = (c) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
g();
|
|
164
|
-
},
|
|
164
|
+
}, Pi(c)));
|
|
165
165
|
}, s = (c) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
167
|
o = c, e(c);
|
|
@@ -173,8 +173,8 @@ function ki(e, t = {}) {
|
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
o = Math.round(h + (c - h) * Ii(
|
|
176
|
+
const P = Math.min(1, (performance.now() - C) / yi);
|
|
177
|
+
o = Math.round(h + (c - h) * Ii(P)), e(o), P >= 1 && (o = c, e(c), l());
|
|
178
178
|
}, Ci);
|
|
179
179
|
}, g = async () => {
|
|
180
180
|
try {
|
|
@@ -193,7 +193,7 @@ function ki(e, t = {}) {
|
|
|
193
193
|
async function Li(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(xi,
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(xi, Ti(e.backendUrl ?? _i)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
@@ -207,10 +207,10 @@ async function Li(e) {
|
|
|
207
207
|
function zn(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ti(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Pi(e) {
|
|
214
214
|
return Math.min(Ei, Math.max(Si, e));
|
|
215
215
|
}
|
|
216
216
|
function Ii(e) {
|
|
@@ -277,7 +277,7 @@ const bo = 100, zi = 1e4, Mi = 5e3, Oi = "product-agent:sdk-preview-socket-conne
|
|
|
277
277
|
scribbleStyle: !0,
|
|
278
278
|
position: "bottom-right",
|
|
279
279
|
movableLauncher: !0
|
|
280
|
-
}, ea = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Hn = "pluno-pa-scribble-font", yo = 190, vo = 41, $n = 22, ta = 1, na = 48, cn = 420, oa = 520, ia = 0.24, un = 680, aa = 800, ra = 0.76,
|
|
280
|
+
}, ea = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Hn = "pluno-pa-scribble-font", yo = 190, vo = 41, $n = 22, ta = 1, na = 48, cn = 420, oa = 520, ia = 0.24, un = 680, aa = 800, ra = 0.76, N = 8, Ne = 50, Co = "http://www.w3.org/2000/svg", tn = 26, nn = 8, la = 36, on = 16, pa = 4, Gn = [
|
|
281
281
|
{
|
|
282
282
|
ellipseCx: "17.5",
|
|
283
283
|
ellipseCy: "24.5",
|
|
@@ -419,13 +419,13 @@ async function ga(e = {}) {
|
|
|
419
419
|
fontFamily: t.fontFamily,
|
|
420
420
|
scribbleStyle: t.scribbleStyle
|
|
421
421
|
});
|
|
422
|
-
const C = t.mountTarget ?? await Ir(),
|
|
422
|
+
const C = t.mountTarget ?? await Ir(), P = C.ownerDocument, I = i.querySelector(
|
|
423
423
|
".pluno-pa-widget__launcher"
|
|
424
424
|
), D = i.querySelector(
|
|
425
425
|
".pluno-pa-widget__launcher-drag-handle"
|
|
426
426
|
), u = i.querySelector(
|
|
427
427
|
".pluno-pa-widget__launcher-input"
|
|
428
|
-
),
|
|
428
|
+
), v = i.querySelector(
|
|
429
429
|
".pluno-pa-widget__launcher-minimize"
|
|
430
430
|
), m = i.querySelector(".pluno-pa-widget__panel"), S = i.querySelector(
|
|
431
431
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
@@ -463,22 +463,22 @@ async function ga(e = {}) {
|
|
|
463
463
|
".pluno-pa-widget__history-status"
|
|
464
464
|
), x = i.querySelector(
|
|
465
465
|
".pluno-pa-widget__timeline-jump"
|
|
466
|
-
),
|
|
466
|
+
), R = i.querySelector(
|
|
467
467
|
".pluno-pa-widget__active-users-counter"
|
|
468
|
-
),
|
|
468
|
+
), T = i.querySelector(
|
|
469
469
|
".pluno-pa-widget__timeline"
|
|
470
470
|
), ae = i.querySelector(
|
|
471
471
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
472
472
|
), H = i.querySelector(
|
|
473
473
|
".pluno-pa-widget__notify-suggestion"
|
|
474
|
-
),
|
|
474
|
+
), y = i.querySelector(
|
|
475
475
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
476
|
-
),
|
|
476
|
+
), A = i.querySelector(
|
|
477
477
|
".pluno-pa-widget__notify-suggestion-later"
|
|
478
478
|
), qo = i.querySelector(
|
|
479
479
|
".pluno-pa-widget__notify-suggestion-never"
|
|
480
480
|
);
|
|
481
|
-
if (!I || !u || !m || !L || !oe || !J || !Re || !U || !we || !B || !f || !Q || !De || !Ce || !Se || !j || !it || !ie || !x || !
|
|
481
|
+
if (!I || !u || !m || !L || !oe || !J || !Re || !U || !we || !B || !f || !Q || !De || !Ce || !Se || !j || !it || !ie || !x || !R || !T || !ae)
|
|
482
482
|
throw new Error("Failed to mount Pluno widget");
|
|
483
483
|
if (t.movableLauncher && !D)
|
|
484
484
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
@@ -547,7 +547,7 @@ async function ga(e = {}) {
|
|
|
547
547
|
}, Vo = () => {
|
|
548
548
|
x.hidden = !1;
|
|
549
549
|
}, Ko = (a = "jump") => {
|
|
550
|
-
te(!0, a), ne(), nt(
|
|
550
|
+
te(!0, a), ne(), nt(T, () => Ee.enabled), ke = T.scrollTop;
|
|
551
551
|
}, Le = () => {
|
|
552
552
|
if (Ce.hidden = t.layout === "page" || t.loginRequired, Se.hidden = !_e, Ce.setAttribute("aria-expanded", String(_e)), j.classList.toggle(
|
|
553
553
|
"pluno-pa-widget__history-list--center",
|
|
@@ -597,9 +597,9 @@ async function ga(e = {}) {
|
|
|
597
597
|
}, Yo = () => {
|
|
598
598
|
!Et || ge || j.scrollHeight - j.scrollTop - j.clientHeight <= 24 && bn(Et);
|
|
599
599
|
}, _n = () => {
|
|
600
|
-
re || typeof document > "u" || (so(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget ||
|
|
600
|
+
re || typeof document > "u" || (so(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || P.body?.appendChild(n)));
|
|
601
601
|
}, xn = new MutationObserver(_n);
|
|
602
|
-
xn.observe(
|
|
602
|
+
xn.observe(P.documentElement, {
|
|
603
603
|
childList: !0,
|
|
604
604
|
subtree: !0
|
|
605
605
|
}), _n();
|
|
@@ -607,7 +607,7 @@ async function ga(e = {}) {
|
|
|
607
607
|
const d = bt(i, a);
|
|
608
608
|
return rn(
|
|
609
609
|
i,
|
|
610
|
-
s ?
|
|
610
|
+
s ? To(s, d) : ya(
|
|
611
611
|
i,
|
|
612
612
|
t.position,
|
|
613
613
|
d
|
|
@@ -615,7 +615,7 @@ async function ga(e = {}) {
|
|
|
615
615
|
d
|
|
616
616
|
);
|
|
617
617
|
}, F = () => {
|
|
618
|
-
const a =
|
|
618
|
+
const a = Ta(o, u, f);
|
|
619
619
|
Mr(t, {
|
|
620
620
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
621
621
|
composerValue: f.value,
|
|
@@ -644,7 +644,7 @@ async function ga(e = {}) {
|
|
|
644
644
|
t.position
|
|
645
645
|
)
|
|
646
646
|
), Zn(i), F(), d && lt("minimized");
|
|
647
|
-
},
|
|
647
|
+
}, Te = (a, d = {}) => {
|
|
648
648
|
La(a, {
|
|
649
649
|
debugVersion: ca,
|
|
650
650
|
launcherPosition: s,
|
|
@@ -667,7 +667,7 @@ async function ga(e = {}) {
|
|
|
667
667
|
if (!s)
|
|
668
668
|
return Ae(i, null), Ge(a);
|
|
669
669
|
const d = Ge(a);
|
|
670
|
-
return Ae(i, d),
|
|
670
|
+
return Ae(i, d), Te("Applied stored closed launcher position", {
|
|
671
671
|
visibleLauncherPosition: d
|
|
672
672
|
}), d;
|
|
673
673
|
}, kt = (a, d) => {
|
|
@@ -711,11 +711,11 @@ async function ga(e = {}) {
|
|
|
711
711
|
),
|
|
712
712
|
d
|
|
713
713
|
);
|
|
714
|
-
h && (h = _), kt(_, a),
|
|
714
|
+
h && (h = _), kt(_, a), Te(
|
|
715
715
|
"Applied open panel position after viewport resize",
|
|
716
716
|
{ openPanelPosition: _ }
|
|
717
717
|
);
|
|
718
|
-
} else s &&
|
|
718
|
+
} else s && Te(
|
|
719
719
|
"Applied visible launcher position after viewport resize",
|
|
720
720
|
{ visibleLauncherPosition: a }
|
|
721
721
|
);
|
|
@@ -736,12 +736,12 @@ async function ga(e = {}) {
|
|
|
736
736
|
s = Ca(
|
|
737
737
|
k,
|
|
738
738
|
_
|
|
739
|
-
), Ae(i, k),
|
|
739
|
+
), Ae(i, k), Te("Dragging closed launcher", {
|
|
740
740
|
requestedPosition: d
|
|
741
741
|
});
|
|
742
742
|
},
|
|
743
743
|
persist: () => {
|
|
744
|
-
g = !0, F(),
|
|
744
|
+
g = !0, F(), Te("Persisted closed launcher drag position");
|
|
745
745
|
}
|
|
746
746
|
})) : Ae(i, null), $t(i, c);
|
|
747
747
|
const Xo = () => {
|
|
@@ -776,10 +776,10 @@ async function ga(e = {}) {
|
|
|
776
776
|
persist: F
|
|
777
777
|
}) : () => {
|
|
778
778
|
};
|
|
779
|
-
let
|
|
779
|
+
let Tt = !1;
|
|
780
780
|
const Cn = async () => {
|
|
781
|
-
if (!(!t.billingStatusLoader ||
|
|
782
|
-
|
|
781
|
+
if (!(!t.billingStatusLoader || Tt)) {
|
|
782
|
+
Tt = !0;
|
|
783
783
|
try {
|
|
784
784
|
const a = await t.billingStatusLoader();
|
|
785
785
|
if (re)
|
|
@@ -800,7 +800,7 @@ async function ga(e = {}) {
|
|
|
800
800
|
{ message: a instanceof Error ? a.message : String(a) }
|
|
801
801
|
);
|
|
802
802
|
} finally {
|
|
803
|
-
|
|
803
|
+
Tt = !1;
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
}, he = (a = "", d = !0) => {
|
|
@@ -814,20 +814,20 @@ async function ga(e = {}) {
|
|
|
814
814
|
t.position,
|
|
815
815
|
c
|
|
816
816
|
);
|
|
817
|
-
if (kt(k, _),
|
|
817
|
+
if (kt(k, _), Te("Opening launcher at clamped open panel position", {
|
|
818
818
|
openPanelPosition: k,
|
|
819
819
|
visibleLauncherPosition: _
|
|
820
820
|
}), te(!0, "open"), ne(), !d) {
|
|
821
|
-
i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a, et(f)), nt(
|
|
821
|
+
i.classList.add("pluno-pa-widget--open"), I.hidden = !0, a && (f.value = a, et(f)), nt(T, () => Ee.enabled), ke = T.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0);
|
|
822
822
|
return;
|
|
823
823
|
}
|
|
824
824
|
window.requestAnimationFrame(() => {
|
|
825
|
-
i.classList.add("pluno-pa-widget--open"), a && (f.value = a, et(f)), nt(
|
|
826
|
-
I.hidden = !0, nt(
|
|
825
|
+
i.classList.add("pluno-pa-widget--open"), a && (f.value = a, et(f)), nt(T, () => Ee.enabled), ke = T.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), F(), lt("shown"), t.onPanelOpenChange?.(!0), ee = window.setTimeout(() => {
|
|
826
|
+
I.hidden = !0, nt(T, () => Ee.enabled), ke = T.scrollTop;
|
|
827
827
|
}, 220);
|
|
828
828
|
});
|
|
829
|
-
},
|
|
830
|
-
ee !== null && (window.clearTimeout(ee), ee = null), I.hidden = !1, s && (je(!1),
|
|
829
|
+
}, Pt = () => {
|
|
830
|
+
ee !== null && (window.clearTimeout(ee), ee = null), I.hidden = !1, s && (je(!1), Te("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), F(), t.onPanelOpenChange?.(!1), ee = window.setTimeout(() => {
|
|
831
831
|
m.hidden = !0, L.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
|
|
832
832
|
}, 220);
|
|
833
833
|
};
|
|
@@ -845,7 +845,7 @@ async function ga(e = {}) {
|
|
|
845
845
|
const a = u.value;
|
|
846
846
|
he(a), u.value = "";
|
|
847
847
|
});
|
|
848
|
-
let It = null, pt = null,
|
|
848
|
+
let It = null, pt = null, Pe = null;
|
|
849
849
|
const Sn = (a) => a === u || a === f, Qo = (a) => {
|
|
850
850
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
851
851
|
return null;
|
|
@@ -870,12 +870,12 @@ async function ga(e = {}) {
|
|
|
870
870
|
const d = window.getComputedStyle(a);
|
|
871
871
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
872
872
|
}, En = (a) => {
|
|
873
|
-
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ie(), a !== null ?
|
|
873
|
+
Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Ie(), a !== null ? Pe = window.setInterval(() => {
|
|
874
874
|
const d = Ke;
|
|
875
875
|
(!d || !ei(d)) && En(null);
|
|
876
|
-
}, Ji) :
|
|
876
|
+
}, Ji) : Pe !== null && (window.clearInterval(Pe), Pe = null, pt = null));
|
|
877
877
|
}, ti = () => {
|
|
878
|
-
|
|
878
|
+
Pe !== null && (window.clearInterval(Pe), Pe = null);
|
|
879
879
|
};
|
|
880
880
|
i.addEventListener("focusin", (a) => {
|
|
881
881
|
Sn(a.target) && (It = Date.now(), F());
|
|
@@ -896,12 +896,12 @@ async function ga(e = {}) {
|
|
|
896
896
|
pt = k;
|
|
897
897
|
}), I.addEventListener("keydown", (a) => {
|
|
898
898
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), he());
|
|
899
|
-
}),
|
|
899
|
+
}), v?.addEventListener("pointerdown", (a) => {
|
|
900
900
|
a.stopPropagation();
|
|
901
|
-
}),
|
|
901
|
+
}), v?.addEventListener("click", (a) => {
|
|
902
902
|
a.preventDefault(), a.stopPropagation(), qe("minimized");
|
|
903
|
-
}), L.addEventListener("click",
|
|
904
|
-
|
|
903
|
+
}), L.addEventListener("click", Pt), T.addEventListener("scroll", () => {
|
|
904
|
+
T.scrollTop < ke - 1 && te(!1, "userScroll"), ke = T.scrollTop;
|
|
905
905
|
}), x.addEventListener("click", () => {
|
|
906
906
|
Ko();
|
|
907
907
|
});
|
|
@@ -909,7 +909,7 @@ async function ga(e = {}) {
|
|
|
909
909
|
([a]) => {
|
|
910
910
|
a?.isIntersecting && (te(!0, "bottom"), ne());
|
|
911
911
|
},
|
|
912
|
-
{ root:
|
|
912
|
+
{ root: T, threshold: 0 }
|
|
913
913
|
);
|
|
914
914
|
kn?.observe(ae);
|
|
915
915
|
const Ve = () => t.loginRequired || t.signupRequired;
|
|
@@ -1046,17 +1046,17 @@ async function ga(e = {}) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
}), i.addEventListener("click", (a) => {
|
|
1048
1048
|
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && F();
|
|
1049
|
-
}), l.composerValue && (f.value = l.composerValue, et(f)), t.layout === "page" ? he(f.value, !1) : p === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(f.value, !1),
|
|
1049
|
+
}), l.composerValue && (f.value = l.composerValue, et(f)), t.layout === "page" ? he(f.value, !1) : p === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && he(f.value, !1), Pa(l, i, u, f);
|
|
1050
1050
|
const st = () => r;
|
|
1051
1051
|
let zt = b.getState().appearance !== null, dt = null, Ze = null, Oe = null, Ln = b.getState().isThinking, Ue = null;
|
|
1052
1052
|
const Je = t.taskNotifications;
|
|
1053
1053
|
let Be = null, Fe = !1;
|
|
1054
|
-
const
|
|
1054
|
+
const Tn = () => {
|
|
1055
1055
|
Be !== null && (window.clearTimeout(Be), Be = null);
|
|
1056
1056
|
}, ct = () => {
|
|
1057
1057
|
H && (H.hidden = !0);
|
|
1058
|
-
},
|
|
1059
|
-
if (!Je || !H || Fe || re || !b.getState().isThinking ||
|
|
1058
|
+
}, Pn = () => b.getState().assistantDraft.trim().length > 0, ii = async () => {
|
|
1059
|
+
if (!Je || !H || Fe || re || !b.getState().isThinking || Pn())
|
|
1060
1060
|
return;
|
|
1061
1061
|
let a;
|
|
1062
1062
|
try {
|
|
@@ -1064,12 +1064,12 @@ async function ga(e = {}) {
|
|
|
1064
1064
|
} catch {
|
|
1065
1065
|
return;
|
|
1066
1066
|
}
|
|
1067
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
1067
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Pn() || Fe || re || (H.hidden = !1);
|
|
1068
1068
|
};
|
|
1069
|
-
|
|
1069
|
+
y?.addEventListener("click", () => {
|
|
1070
1070
|
Fe = !0, ct(), Je?.enable().catch(() => {
|
|
1071
1071
|
});
|
|
1072
|
-
}),
|
|
1072
|
+
}), A?.addEventListener("click", () => {
|
|
1073
1073
|
Fe = !0, ct();
|
|
1074
1074
|
}), qo?.addEventListener("click", () => {
|
|
1075
1075
|
Fe = !0, ct(), Je?.dismissForever().catch(() => {
|
|
@@ -1079,7 +1079,7 @@ async function ga(e = {}) {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
const ai = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), Ot = () => f.value.trim().length > 0 || q.length > 0, ri = () => {
|
|
1081
1081
|
const a = We !== null && Zt(b.getState(), Ot());
|
|
1082
|
-
|
|
1082
|
+
R.hidden = !a, a && We !== null && Io(R, We);
|
|
1083
1083
|
};
|
|
1084
1084
|
let He = null;
|
|
1085
1085
|
const Ut = (a = {}) => {
|
|
@@ -1102,7 +1102,7 @@ async function ga(e = {}) {
|
|
|
1102
1102
|
Ue
|
|
1103
1103
|
), t.loginRequired) {
|
|
1104
1104
|
Mt.clear(), ro(
|
|
1105
|
-
|
|
1105
|
+
T,
|
|
1106
1106
|
Q,
|
|
1107
1107
|
Bt,
|
|
1108
1108
|
st,
|
|
@@ -1115,7 +1115,7 @@ async function ga(e = {}) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
if (t.signupRequired) {
|
|
1117
1117
|
Mt.clear(), ro(
|
|
1118
|
-
|
|
1118
|
+
T,
|
|
1119
1119
|
Q,
|
|
1120
1120
|
Bt,
|
|
1121
1121
|
st,
|
|
@@ -1130,11 +1130,11 @@ async function ga(e = {}) {
|
|
|
1130
1130
|
wn = d;
|
|
1131
1131
|
const k = be || Ee.enabled;
|
|
1132
1132
|
be = !1, cr(
|
|
1133
|
-
|
|
1133
|
+
T,
|
|
1134
1134
|
ae,
|
|
1135
1135
|
Q,
|
|
1136
1136
|
Bt,
|
|
1137
|
-
|
|
1137
|
+
R,
|
|
1138
1138
|
a,
|
|
1139
1139
|
We,
|
|
1140
1140
|
We !== null && Zt(a, Ot()),
|
|
@@ -1155,7 +1155,7 @@ async function ga(e = {}) {
|
|
|
1155
1155
|
},
|
|
1156
1156
|
t.morningReport,
|
|
1157
1157
|
() => {
|
|
1158
|
-
t.morningReport = null, t.onMorningReportSnooze?.(),
|
|
1158
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Pt(), W(b.getState());
|
|
1159
1159
|
},
|
|
1160
1160
|
Nt,
|
|
1161
1161
|
ai && !St ? {
|
|
@@ -1176,7 +1176,7 @@ async function ga(e = {}) {
|
|
|
1176
1176
|
St = !0, Me.add(M.id), at.add(M.id), F(), zr(t, !0), Ze = null, W(b.getState());
|
|
1177
1177
|
}
|
|
1178
1178
|
} : void 0
|
|
1179
|
-
), k ? (ke =
|
|
1179
|
+
), k ? (ke = T.scrollTop, ne()) : _ && Na(a) && Vo();
|
|
1180
1180
|
};
|
|
1181
1181
|
return In = ki(
|
|
1182
1182
|
(a) => {
|
|
@@ -1191,7 +1191,7 @@ async function ga(e = {}) {
|
|
|
1191
1191
|
const d = Ln && !a.isThinking;
|
|
1192
1192
|
Ln = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Fe && Be === null && H?.hidden !== !1 && (Be = window.setTimeout(() => {
|
|
1193
1193
|
Be = null, ii();
|
|
1194
|
-
}, zi)), (!a.isThinking || a.assistantDraft.trim()) && (
|
|
1194
|
+
}, zi)), (!a.isThinking || a.assistantDraft.trim()) && (Tn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), At(), a.appearance ? (zt = !0, K(
|
|
1195
1195
|
"web-sdk.widget",
|
|
1196
1196
|
"Agent state supplied appearance",
|
|
1197
1197
|
{
|
|
@@ -1232,7 +1232,7 @@ async function ga(e = {}) {
|
|
|
1232
1232
|
openPanel: () => {
|
|
1233
1233
|
he(f.value, !1);
|
|
1234
1234
|
},
|
|
1235
|
-
closePanel:
|
|
1235
|
+
closePanel: Pt,
|
|
1236
1236
|
updateDisplayState: (a) => {
|
|
1237
1237
|
if (a === "shown") {
|
|
1238
1238
|
qe("shown", !1);
|
|
@@ -1244,7 +1244,7 @@ async function ga(e = {}) {
|
|
|
1244
1244
|
t.morningReport = a ?? null, W(b.getState());
|
|
1245
1245
|
},
|
|
1246
1246
|
destroy: () => {
|
|
1247
|
-
re || (F(), re = !0, xn.disconnect(), kn?.disconnect(), ti(), window.removeEventListener("resize", yn), vn(), Jo(), ue !== null && window.clearTimeout(ue),
|
|
1247
|
+
re || (F(), re = !0, xn.disconnect(), kn?.disconnect(), ti(), window.removeEventListener("resize", yn), vn(), Jo(), ue !== null && window.clearTimeout(ue), Tn(), In(), Oe?.remove(), b.destroy(), vt.release(), n.remove());
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
1250
|
async function li(a) {
|
|
@@ -1365,7 +1365,7 @@ function ba({
|
|
|
1365
1365
|
l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1366
1366
|
}, C = (m) => {
|
|
1367
1367
|
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), g = !1, t.setPointerCapture?.(m.pointerId));
|
|
1368
|
-
},
|
|
1368
|
+
}, P = (m) => {
|
|
1369
1369
|
if (l !== m.pointerId || !p || !s)
|
|
1370
1370
|
return;
|
|
1371
1371
|
m.preventDefault();
|
|
@@ -1383,15 +1383,15 @@ function ba({
|
|
|
1383
1383
|
m.clientY - c.y
|
|
1384
1384
|
) <= an;
|
|
1385
1385
|
c = null, S && (m.preventDefault(), m.stopPropagation());
|
|
1386
|
-
},
|
|
1386
|
+
}, v = (m) => {
|
|
1387
1387
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1388
1388
|
return;
|
|
1389
1389
|
const S = m.shiftKey ? Eo : So, z = o();
|
|
1390
1390
|
let L = null;
|
|
1391
1391
|
m.key === "ArrowUp" ? L = { x: z.x, y: z.y - S } : m.key === "ArrowDown" ? L = { x: z.x, y: z.y + S } : m.key === "ArrowLeft" ? L = { x: z.x - S, y: z.y } : m.key === "ArrowRight" && (L = { x: z.x + S, y: z.y }), L && (m.preventDefault(), m.stopPropagation(), i(L), r());
|
|
1392
1392
|
};
|
|
1393
|
-
return t.addEventListener("pointerdown", C), t.addEventListener("pointermove",
|
|
1394
|
-
t.removeEventListener("pointerdown", C), t.removeEventListener("pointermove",
|
|
1393
|
+
return t.addEventListener("pointerdown", C), t.addEventListener("pointermove", P), t.addEventListener("pointerup", I), t.addEventListener("pointercancel", D), t.addEventListener("click", u, !0), n.addEventListener("keydown", v), () => {
|
|
1394
|
+
t.removeEventListener("pointerdown", C), t.removeEventListener("pointermove", P), t.removeEventListener("pointerup", I), t.removeEventListener("pointercancel", D), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", v);
|
|
1395
1395
|
};
|
|
1396
1396
|
}
|
|
1397
1397
|
function _a({
|
|
@@ -1405,17 +1405,17 @@ function _a({
|
|
|
1405
1405
|
const c = () => {
|
|
1406
1406
|
r = null, l = null, p = null, s = null, g = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1407
1407
|
}, h = (u) => {
|
|
1408
|
-
const
|
|
1409
|
-
!e.classList.contains("pluno-pa-widget--open") || !Kn(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, p = { x: u.clientX, y: u.clientY }, s = n(), g = !1,
|
|
1408
|
+
const v = u.currentTarget, m = v.dataset.resizeDirection;
|
|
1409
|
+
!e.classList.contains("pluno-pa-widget--open") || !Kn(m) || (u.preventDefault(), u.stopPropagation(), r = u.pointerId, l = m, p = { x: u.clientX, y: u.clientY }, s = n(), g = !1, v.setPointerCapture?.(u.pointerId));
|
|
1410
1410
|
}, C = (u) => {
|
|
1411
1411
|
if (r !== u.pointerId || !l || !p || !s)
|
|
1412
1412
|
return;
|
|
1413
1413
|
u.preventDefault(), u.stopPropagation();
|
|
1414
|
-
const
|
|
1415
|
-
!g && Math.hypot(
|
|
1416
|
-
Yn(s, l,
|
|
1414
|
+
const v = u.clientX - p.x, m = u.clientY - p.y;
|
|
1415
|
+
!g && Math.hypot(v, m) < an || (g = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1416
|
+
Yn(s, l, v, m)
|
|
1417
1417
|
));
|
|
1418
|
-
},
|
|
1418
|
+
}, P = (u) => {
|
|
1419
1419
|
r === u.pointerId && (u.preventDefault(), u.stopPropagation(), g && i(), c());
|
|
1420
1420
|
}, I = (u) => {
|
|
1421
1421
|
r === u.pointerId && (u.preventDefault(), c());
|
|
@@ -1425,10 +1425,10 @@ function _a({
|
|
|
1425
1425
|
Kn(m) && (u.key === "ArrowLeft" ? L = -S : u.key === "ArrowRight" ? L = S : u.key === "ArrowUp" ? oe = -S : u.key === "ArrowDown" && (oe = S), !(L === 0 && oe === 0) && (u.preventDefault(), u.stopPropagation(), o(Yn(z, m, L, oe)), i()));
|
|
1426
1426
|
};
|
|
1427
1427
|
for (const u of t)
|
|
1428
|
-
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", C), u.addEventListener("pointerup",
|
|
1428
|
+
u.addEventListener("pointerdown", h), u.addEventListener("pointermove", C), u.addEventListener("pointerup", P), u.addEventListener("pointercancel", I), u.addEventListener("keydown", D);
|
|
1429
1429
|
return () => {
|
|
1430
1430
|
for (const u of t)
|
|
1431
|
-
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", C), u.removeEventListener("pointerup",
|
|
1431
|
+
u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", C), u.removeEventListener("pointerup", P), u.removeEventListener("pointercancel", I), u.removeEventListener("keydown", D);
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
function Kn(e) {
|
|
@@ -1441,11 +1441,11 @@ function Yn(e, t, n, o) {
|
|
|
1441
1441
|
delta: n,
|
|
1442
1442
|
resizeLeading: t.endsWith("left") || t === "left",
|
|
1443
1443
|
resizeTrailing: t.endsWith("right") || t === "right",
|
|
1444
|
-
minLeading:
|
|
1445
|
-
maxTrailing: i.width -
|
|
1444
|
+
minLeading: N,
|
|
1445
|
+
maxTrailing: i.width - N,
|
|
1446
1446
|
minLength: Math.min(
|
|
1447
1447
|
cn,
|
|
1448
|
-
i.width -
|
|
1448
|
+
i.width - N * 2
|
|
1449
1449
|
)
|
|
1450
1450
|
}), l = Xn({
|
|
1451
1451
|
leading: e.position.y,
|
|
@@ -1454,10 +1454,10 @@ function Yn(e, t, n, o) {
|
|
|
1454
1454
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1455
1455
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1456
1456
|
minLeading: Ne,
|
|
1457
|
-
maxTrailing: i.height -
|
|
1457
|
+
maxTrailing: i.height - N,
|
|
1458
1458
|
minLength: Math.min(
|
|
1459
1459
|
un,
|
|
1460
|
-
i.height - Ne -
|
|
1460
|
+
i.height - Ne - N
|
|
1461
1461
|
)
|
|
1462
1462
|
});
|
|
1463
1463
|
return {
|
|
@@ -1527,7 +1527,7 @@ function xa() {
|
|
|
1527
1527
|
cn,
|
|
1528
1528
|
oa
|
|
1529
1529
|
),
|
|
1530
|
-
e.width -
|
|
1530
|
+
e.width - N * 2
|
|
1531
1531
|
),
|
|
1532
1532
|
height: Math.min(
|
|
1533
1533
|
X(
|
|
@@ -1535,7 +1535,7 @@ function xa() {
|
|
|
1535
1535
|
un,
|
|
1536
1536
|
aa
|
|
1537
1537
|
),
|
|
1538
|
-
e.height - Ne -
|
|
1538
|
+
e.height - Ne - N
|
|
1539
1539
|
)
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
@@ -1549,22 +1549,22 @@ function xt(e) {
|
|
|
1549
1549
|
e.width,
|
|
1550
1550
|
Math.min(
|
|
1551
1551
|
cn,
|
|
1552
|
-
t.width -
|
|
1552
|
+
t.width - N * 2
|
|
1553
1553
|
),
|
|
1554
1554
|
Math.max(
|
|
1555
|
-
|
|
1556
|
-
t.width -
|
|
1555
|
+
N,
|
|
1556
|
+
t.width - N * 2
|
|
1557
1557
|
)
|
|
1558
1558
|
),
|
|
1559
1559
|
height: X(
|
|
1560
1560
|
e.height,
|
|
1561
1561
|
Math.min(
|
|
1562
1562
|
un,
|
|
1563
|
-
t.height - Ne -
|
|
1563
|
+
t.height - Ne - N
|
|
1564
1564
|
),
|
|
1565
1565
|
Math.max(
|
|
1566
|
-
|
|
1567
|
-
t.height - Ne -
|
|
1566
|
+
N,
|
|
1567
|
+
t.height - Ne - N
|
|
1568
1568
|
)
|
|
1569
1569
|
)
|
|
1570
1570
|
};
|
|
@@ -1594,7 +1594,7 @@ function Gt(e, t, n) {
|
|
|
1594
1594
|
const o = bt(e, !1);
|
|
1595
1595
|
return t ? rn(
|
|
1596
1596
|
e,
|
|
1597
|
-
|
|
1597
|
+
To(t, o),
|
|
1598
1598
|
o
|
|
1599
1599
|
) : va(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ta);
|
|
1600
1600
|
}
|
|
@@ -1606,14 +1606,14 @@ function va(e, t, n) {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
}
|
|
1608
1608
|
function rn(e, t, n) {
|
|
1609
|
-
const o = Z(), i =
|
|
1609
|
+
const o = Z(), i = N + Ea(e);
|
|
1610
1610
|
return {
|
|
1611
1611
|
x: X(
|
|
1612
1612
|
t.x,
|
|
1613
|
-
|
|
1613
|
+
N,
|
|
1614
1614
|
Math.max(
|
|
1615
|
-
|
|
1616
|
-
o.width - n.width -
|
|
1615
|
+
N,
|
|
1616
|
+
o.width - n.width - N
|
|
1617
1617
|
)
|
|
1618
1618
|
),
|
|
1619
1619
|
y: X(
|
|
@@ -1621,12 +1621,12 @@ function rn(e, t, n) {
|
|
|
1621
1621
|
i,
|
|
1622
1622
|
Math.max(
|
|
1623
1623
|
i,
|
|
1624
|
-
o.height - n.height -
|
|
1624
|
+
o.height - n.height - N
|
|
1625
1625
|
)
|
|
1626
1626
|
)
|
|
1627
1627
|
};
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1629
|
+
function To(e, t) {
|
|
1630
1630
|
const n = Z();
|
|
1631
1631
|
return {
|
|
1632
1632
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
@@ -1660,10 +1660,10 @@ function mt(e, t) {
|
|
|
1660
1660
|
return {
|
|
1661
1661
|
x: X(
|
|
1662
1662
|
e.x,
|
|
1663
|
-
|
|
1663
|
+
N,
|
|
1664
1664
|
Math.max(
|
|
1665
|
-
|
|
1666
|
-
n.width - t.width -
|
|
1665
|
+
N,
|
|
1666
|
+
n.width - t.width - N
|
|
1667
1667
|
)
|
|
1668
1668
|
),
|
|
1669
1669
|
y: X(
|
|
@@ -1671,7 +1671,7 @@ function mt(e, t) {
|
|
|
1671
1671
|
Ne,
|
|
1672
1672
|
Math.max(
|
|
1673
1673
|
Ne,
|
|
1674
|
-
n.height - t.height -
|
|
1674
|
+
n.height - t.height - N
|
|
1675
1675
|
)
|
|
1676
1676
|
)
|
|
1677
1677
|
};
|
|
@@ -1691,8 +1691,8 @@ function Zn(e) {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
function Z() {
|
|
1693
1693
|
return {
|
|
1694
|
-
width: window.innerWidth || document.documentElement.clientWidth || yo +
|
|
1695
|
-
height: window.innerHeight || document.documentElement.clientHeight || vo +
|
|
1694
|
+
width: window.innerWidth || document.documentElement.clientWidth || yo + N * 2,
|
|
1695
|
+
height: window.innerHeight || document.documentElement.clientHeight || vo + N * 2
|
|
1696
1696
|
};
|
|
1697
1697
|
}
|
|
1698
1698
|
function jt(e) {
|
|
@@ -1729,11 +1729,11 @@ function Vt(e, t, n) {
|
|
|
1729
1729
|
attachments: n.length > 0 ? n.map(Ia) : void 0
|
|
1730
1730
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1731
1731
|
}
|
|
1732
|
-
function
|
|
1732
|
+
function Ta(e, t, n) {
|
|
1733
1733
|
const o = e.activeElement;
|
|
1734
1734
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function Pa(e, t, n, o) {
|
|
1737
1737
|
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Mi)
|
|
1738
1738
|
return;
|
|
1739
1739
|
const i = e.focusedInput === "composer" ? o : n;
|
|
@@ -1956,9 +1956,9 @@ function Ha(e) {
|
|
|
1956
1956
|
"pluno-pa-widget__character--empty",
|
|
1957
1957
|
e
|
|
1958
1958
|
)
|
|
1959
|
-
), t.appendChild(
|
|
1959
|
+
), t.appendChild(Po()), t;
|
|
1960
1960
|
}
|
|
1961
|
-
function
|
|
1961
|
+
function Po() {
|
|
1962
1962
|
const e = document.createElement("div");
|
|
1963
1963
|
return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
|
|
1964
1964
|
}
|
|
@@ -2082,7 +2082,7 @@ function $a(e, t) {
|
|
|
2082
2082
|
in2: "innerLight",
|
|
2083
2083
|
mode: "screen"
|
|
2084
2084
|
});
|
|
2085
|
-
const
|
|
2085
|
+
const P = w(r, "filter", {
|
|
2086
2086
|
id: o.eyeShadow,
|
|
2087
2087
|
x: "-24%",
|
|
2088
2088
|
y: "-20%",
|
|
@@ -2090,7 +2090,7 @@ function $a(e, t) {
|
|
|
2090
2090
|
height: "148%",
|
|
2091
2091
|
"color-interpolation-filters": "sRGB"
|
|
2092
2092
|
});
|
|
2093
|
-
w(
|
|
2093
|
+
w(P, "feDropShadow", {
|
|
2094
2094
|
dx: "0",
|
|
2095
2095
|
dy: "8",
|
|
2096
2096
|
stdDeviation: "5",
|
|
@@ -2121,13 +2121,13 @@ function $a(e, t) {
|
|
|
2121
2121
|
d: ft,
|
|
2122
2122
|
fill: Y(o.boltEdge)
|
|
2123
2123
|
});
|
|
2124
|
-
const
|
|
2124
|
+
const v = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
2125
2125
|
w(u, "path", {
|
|
2126
|
-
d:
|
|
2126
|
+
d: v,
|
|
2127
2127
|
fill: Y(o.boltFill),
|
|
2128
2128
|
filter: Y(o.innerDepth)
|
|
2129
2129
|
}), w(u, "path", {
|
|
2130
|
-
d:
|
|
2130
|
+
d: v,
|
|
2131
2131
|
fill: Y(o.boltGlow),
|
|
2132
2132
|
opacity: "0.74"
|
|
2133
2133
|
});
|
|
@@ -2752,7 +2752,7 @@ function Zt(e, t) {
|
|
|
2752
2752
|
(o) => !Uo(o)
|
|
2753
2753
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2754
2754
|
}
|
|
2755
|
-
function cr(e, t, n, o, i, r, l, p, s, g, c, h, C,
|
|
2755
|
+
function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, P, I, D, u, v, m, S) {
|
|
2756
2756
|
const z = mr(r), L = z.filter(
|
|
2757
2757
|
(x) => !Uo(x)
|
|
2758
2758
|
), oe = e.scrollTop, J = [], Re = /* @__PURE__ */ new Set(), U = (x) => {
|
|
@@ -2763,36 +2763,36 @@ function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, T, I, D, u, y, m, S) {
|
|
|
2763
2763
|
if (o(we), u || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2764
2764
|
const x = document.createElement("div");
|
|
2765
2765
|
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2766
|
-
const
|
|
2767
|
-
|
|
2768
|
-
const
|
|
2766
|
+
const R = document.createElement("div");
|
|
2767
|
+
R.className = "pluno-pa-widget__empty-hero";
|
|
2768
|
+
const T = ve(
|
|
2769
2769
|
"pluno-pa-widget__character--empty",
|
|
2770
|
-
|
|
2770
|
+
P()
|
|
2771
2771
|
);
|
|
2772
|
-
if (
|
|
2773
|
-
const
|
|
2774
|
-
|
|
2772
|
+
if (R.appendChild(T), x.appendChild(R), u) {
|
|
2773
|
+
const y = document.createElement("h2");
|
|
2774
|
+
y.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", y.textContent = u.opening, x.appendChild(y);
|
|
2775
2775
|
} else
|
|
2776
|
-
x.appendChild(
|
|
2776
|
+
x.appendChild(Po());
|
|
2777
2777
|
const ae = u?.prompts ?? r.starterPrompts, H = document.createElement("div");
|
|
2778
2778
|
if (H.className = ae.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ae.length === 0 && !r.starterPromptsLoading && H.setAttribute("aria-hidden", "true"), ae.length > 0)
|
|
2779
|
-
for (const
|
|
2780
|
-
const
|
|
2781
|
-
|
|
2782
|
-
I(
|
|
2783
|
-
}), H.appendChild(
|
|
2779
|
+
for (const y of ae) {
|
|
2780
|
+
const A = document.createElement("button");
|
|
2781
|
+
A.type = "button", A.className = "pluno-pa-widget__starter-prompt", A.textContent = `"${y}"`, A.addEventListener("click", () => {
|
|
2782
|
+
I(y);
|
|
2783
|
+
}), H.appendChild(A);
|
|
2784
2784
|
}
|
|
2785
2785
|
else if (r.starterPromptsLoading) {
|
|
2786
|
-
const
|
|
2787
|
-
|
|
2786
|
+
const y = document.createElement("button");
|
|
2787
|
+
y.type = "button", y.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", y.disabled = !0, y.tabIndex = -1, y.textContent = "Generating example tasks...", H.appendChild(y);
|
|
2788
2788
|
} else
|
|
2789
|
-
for (let
|
|
2790
|
-
const
|
|
2791
|
-
|
|
2789
|
+
for (let y = 0; y < Yi; y += 1) {
|
|
2790
|
+
const A = document.createElement("button");
|
|
2791
|
+
A.type = "button", A.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", A.disabled = !0, A.tabIndex = -1, A.textContent = "", H.appendChild(A);
|
|
2792
2792
|
}
|
|
2793
2793
|
if (x.appendChild(H), u) {
|
|
2794
|
-
const
|
|
2795
|
-
|
|
2794
|
+
const y = document.createElement("button");
|
|
2795
|
+
y.type = "button", y.className = "pluno-pa-widget__morning-report-snooze", y.textContent = "Snooze morning report", y.addEventListener("click", v), x.appendChild(y);
|
|
2796
2796
|
}
|
|
2797
2797
|
h.clear(), U(x), U(t), io(e, J);
|
|
2798
2798
|
return;
|
|
@@ -2805,42 +2805,42 @@ function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, T, I, D, u, y, m, S) {
|
|
|
2805
2805
|
Q,
|
|
2806
2806
|
c,
|
|
2807
2807
|
C,
|
|
2808
|
-
|
|
2808
|
+
P()
|
|
2809
2809
|
);
|
|
2810
2810
|
return U(x), B = null, f = x, Q = [], !0;
|
|
2811
2811
|
};
|
|
2812
2812
|
for (let x = 0; x < L.length; x += 1) {
|
|
2813
|
-
const
|
|
2814
|
-
if (
|
|
2815
|
-
Q.push(
|
|
2813
|
+
const R = L[x];
|
|
2814
|
+
if (R.role === "tool") {
|
|
2815
|
+
Q.push(R);
|
|
2816
2816
|
continue;
|
|
2817
2817
|
}
|
|
2818
|
-
if (sn(
|
|
2818
|
+
if (sn(R)) {
|
|
2819
2819
|
if (x !== De)
|
|
2820
2820
|
continue;
|
|
2821
2821
|
if (Se()) {
|
|
2822
|
-
const
|
|
2823
|
-
U(
|
|
2822
|
+
const A = _t();
|
|
2823
|
+
U(A), B = null, f = A;
|
|
2824
2824
|
} else {
|
|
2825
|
-
const
|
|
2826
|
-
U(
|
|
2825
|
+
const A = po(P());
|
|
2826
|
+
U(A), B = null, f = A;
|
|
2827
2827
|
}
|
|
2828
2828
|
continue;
|
|
2829
2829
|
}
|
|
2830
|
-
if (
|
|
2831
|
-
if (
|
|
2830
|
+
if (R.role === "system") {
|
|
2831
|
+
if (R.dataType === "run_error" || R.dataType === "run_status") {
|
|
2832
2832
|
Se();
|
|
2833
|
-
const
|
|
2834
|
-
|
|
2833
|
+
const y = document.createElement("div"), A = R.dataType === "run_error";
|
|
2834
|
+
y.className = A ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", y.textContent = lo(R.content), U(y), B = A ? y : null, f = A ? null : y;
|
|
2835
2835
|
}
|
|
2836
2836
|
continue;
|
|
2837
2837
|
}
|
|
2838
|
-
const
|
|
2839
|
-
if (
|
|
2840
|
-
const
|
|
2841
|
-
U(
|
|
2838
|
+
const T = Se(), ae = lo(R.content);
|
|
2839
|
+
if (R.role === "assistant" && !T) {
|
|
2840
|
+
const y = Bo(P());
|
|
2841
|
+
U(y), B = null, f = y;
|
|
2842
2842
|
}
|
|
2843
|
-
const H = ur(
|
|
2843
|
+
const H = ur(R, ae, h, Re);
|
|
2844
2844
|
U(H), B = H, f = null;
|
|
2845
2845
|
}
|
|
2846
2846
|
const j = Se(), it = L[L.length - 1]?.id === "assistant-draft";
|
|
@@ -2849,19 +2849,19 @@ function cr(e, t, n, o, i, r, l, p, s, g, c, h, C, T, I, D, u, y, m, S) {
|
|
|
2849
2849
|
const x = _t();
|
|
2850
2850
|
U(x), B = null, f = x;
|
|
2851
2851
|
} else {
|
|
2852
|
-
const x = po(
|
|
2852
|
+
const x = po(P());
|
|
2853
2853
|
U(x), B = null, f = x;
|
|
2854
2854
|
}
|
|
2855
2855
|
if (r.lastError) {
|
|
2856
2856
|
const x = document.createElement("div");
|
|
2857
2857
|
x.className = "pluno-pa-widget__error";
|
|
2858
|
-
const
|
|
2859
|
-
if (
|
|
2860
|
-
const
|
|
2861
|
-
|
|
2858
|
+
const R = document.createElement("span");
|
|
2859
|
+
if (R.textContent = r.lastError, x.appendChild(R), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
2860
|
+
const T = document.createElement("button");
|
|
2861
|
+
T.type = "button", T.className = "pluno-pa-widget__error-retry", T.textContent = "Try again", T.addEventListener(
|
|
2862
2862
|
"click",
|
|
2863
2863
|
r.lastErrorCode === "connection_failed" ? m : D
|
|
2864
|
-
), x.appendChild(
|
|
2864
|
+
), x.appendChild(T);
|
|
2865
2865
|
}
|
|
2866
2866
|
U(x), B = x, f = null;
|
|
2867
2867
|
}
|
|
@@ -3072,27 +3072,27 @@ function _r(e, t) {
|
|
|
3072
3072
|
if (g.appendChild(h), s.appendChild(g), e.screenshotDataUrl) {
|
|
3073
3073
|
const u = document.createElement("div");
|
|
3074
3074
|
u.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3075
|
-
const
|
|
3076
|
-
|
|
3075
|
+
const v = document.createElement("img");
|
|
3076
|
+
v.src = e.screenshotDataUrl, v.alt = "Product page with Pluno open", u.appendChild(v), s.appendChild(u);
|
|
3077
3077
|
}
|
|
3078
3078
|
o.appendChild(s), o.appendChild(p);
|
|
3079
3079
|
const C = document.createElement("div");
|
|
3080
3080
|
C.className = "pluno-pa-widget__share-dialog-step";
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3081
|
+
const P = document.createElement("strong");
|
|
3082
|
+
P.className = "pluno-pa-widget__share-dialog-step-title", P.textContent = "2) Share on", C.appendChild(P);
|
|
3083
3083
|
const I = document.createElement("p");
|
|
3084
3084
|
I.className = "pluno-pa-widget__share-dialog-hint", I.textContent = "Post draft opens prefilled on supported platforms.", C.appendChild(I);
|
|
3085
3085
|
const D = document.createElement("footer");
|
|
3086
3086
|
D.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3087
3087
|
for (const u of yr(e)) {
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3088
|
+
const v = document.createElement("a");
|
|
3089
|
+
v.href = u.href, v.target = "_blank", v.rel = "noopener noreferrer", v.title = u.label, v.setAttribute("aria-label", `Open ${u.label}`), v.appendChild(vr(u.id)), D.appendChild(v);
|
|
3090
3090
|
}
|
|
3091
3091
|
if (C.appendChild(D), o.appendChild(C), t.socialPostRewardsUrl) {
|
|
3092
3092
|
const u = document.createElement("div");
|
|
3093
3093
|
u.className = "pluno-pa-widget__share-dialog-step";
|
|
3094
|
-
const
|
|
3095
|
-
|
|
3094
|
+
const v = document.createElement("strong");
|
|
3095
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "3) Submit post to get 2000 free credits!", u.appendChild(v);
|
|
3096
3096
|
const m = document.createElement("a");
|
|
3097
3097
|
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Cr()), u.appendChild(m), o.appendChild(u);
|
|
3098
3098
|
}
|
|
@@ -3187,8 +3187,8 @@ function Sr(e, t, n, o) {
|
|
|
3187
3187
|
for (const h of e) {
|
|
3188
3188
|
const C = document.createElement("div");
|
|
3189
3189
|
C.className = "pluno-pa-widget__tool-line", h.loading && C.appendChild(dn());
|
|
3190
|
-
const
|
|
3191
|
-
|
|
3190
|
+
const P = document.createElement("span");
|
|
3191
|
+
P.textContent = h.content || "Run tool", C.appendChild(P), c.appendChild(C);
|
|
3192
3192
|
}
|
|
3193
3193
|
r.appendChild(c);
|
|
3194
3194
|
}
|
|
@@ -3321,7 +3321,7 @@ function Lr(e) {
|
|
|
3321
3321
|
}
|
|
3322
3322
|
}
|
|
3323
3323
|
function so(e, t) {
|
|
3324
|
-
if (
|
|
3324
|
+
if (Tr(e))
|
|
3325
3325
|
return;
|
|
3326
3326
|
const n = `
|
|
3327
3327
|
:host {
|
|
@@ -5687,18 +5687,18 @@ function so(e, t) {
|
|
|
5687
5687
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
5688
5688
|
}
|
|
5689
5689
|
`;
|
|
5690
|
-
if (
|
|
5690
|
+
if (Pr(e, n))
|
|
5691
5691
|
return;
|
|
5692
5692
|
const o = e.ownerDocument.createElement("style");
|
|
5693
5693
|
o.id = ko, o.textContent = n, e.appendChild(o), Wo(e);
|
|
5694
5694
|
}
|
|
5695
|
-
function
|
|
5695
|
+
function Tr(e) {
|
|
5696
5696
|
return e.getElementById(ko) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Lo) === "true";
|
|
5697
5697
|
}
|
|
5698
5698
|
function Wo(e) {
|
|
5699
5699
|
e.host instanceof HTMLElement && e.host.setAttribute(Lo, "true");
|
|
5700
5700
|
}
|
|
5701
|
-
function
|
|
5701
|
+
function Pr(e, t) {
|
|
5702
5702
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5703
5703
|
return !1;
|
|
5704
5704
|
try {
|
package/package.json
CHANGED