@factorialco/f0-react 16.28.0 → 16.30.0
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/{ArchiveThumbnail-CMsTeEMr.js → ArchiveThumbnail-DKhjfBQx.js} +8 -8
- package/dist/{ArchiveViewer-CVUbHK4J.js → ArchiveViewer-CLfFm7xN.js} +16 -16
- package/dist/{ChatPostComposerDialog-BV9s-5id.js → ChatPostComposerDialog-DgRCi517.js} +3 -3
- package/dist/{Check-7ZMYl7LO.js → Check-B2Oii9hT.js} +1 -1
- package/dist/{CoachmarkProvider-C8ePgf8m.js → CoachmarkProvider-Dv3HGlQn.js} +19842 -19842
- package/dist/{CodeThumbnail-Ce-hHbSv.js → CodeThumbnail-B7i69yiG.js} +1 -1
- package/dist/{CodeViewer-D8ga5D9u.js → CodeViewer-CfJEGONX.js} +6 -6
- package/dist/{DocumentToolbar-DZaHgYSS.js → DocumentToolbar-CFSYNRPK.js} +5 -5
- package/dist/{DocxViewer-YS2VFyiH.js → DocxViewer-CwbEk_um.js} +3 -3
- package/dist/{Ellipsis-BtT73kgp.js → Ellipsis-C36nOldJ.js} +1 -1
- package/dist/{ExternalLink-BPQ4sAxp.js → ExternalLink-oako7DEE.js} +1 -1
- package/dist/{F0AiProcessingOverlay-DsZKXt0-.js → F0AiProcessingOverlay-e45V7jnO.js} +508 -508
- package/dist/{F0Alert-Dp0xk7lJ.js → F0Alert-DIj-yBaJ.js} +9 -9
- package/dist/F0AudioPlayer-SEqjyVEi.js +2 -0
- package/dist/{F0Button-HbVtFNlG.js → F0Button-DVbQTicD.js} +3 -3
- package/dist/{F0CanvasPanel-Ywi76QmC.js → F0CanvasPanel-BimlvEaL.js} +11012 -11001
- package/dist/{F0DocumentViewer-BhBTsls5.js → F0DocumentViewer-Bb-bIqhH.js} +1 -1
- package/dist/{F0DocumentViewer-OIpAVuWz.js → F0DocumentViewer-By0aD22O.js} +4 -4
- package/dist/{F0Map-Op4L5ujR.js → F0Map-DvW_ce3p.js} +12 -12
- package/dist/{F0Select-pMtfuH_i.js → F0Select-D6mxgb1s.js} +11 -11
- package/dist/{F0Text-CK1RLRRz.js → F0Text-CcpTiEit.js} +2 -2
- package/dist/F0VideoPlayer-BtgCaxi2.js +1 -0
- package/dist/{F0VideoPlayer-TeSaMks1.js → F0VideoPlayer-Cz90LvIr.js} +18 -18
- package/dist/{HtmlThumbnail-CgIFoTeK.js → HtmlThumbnail-fMq9VsQi.js} +1 -1
- package/dist/{HtmlViewer-x_fBqOoL.js → HtmlViewer-cxPEUYXY.js} +9 -9
- package/dist/{LayoutGroup-DVmlrvsa.js → LayoutGroup-FkYOcIJ1.js} +1 -1
- package/dist/{LockLocked-Cqz057AU.js → LockLocked-B3KX44wv.js} +1 -1
- package/dist/{Map-BFZ3xNzV.js → Map-BIUj3dSn.js} +13 -13
- package/dist/{PdfThumbnail-DC0k9aDO.js → PdfThumbnail-CZJ17k0R.js} +1 -1
- package/dist/{PdfViewer-DznpRVIs.js → PdfViewer-C-nwVTI1.js} +10 -10
- package/dist/{SandboxedHtmlFrame-B9437NO5.js → SandboxedHtmlFrame-BT6LThaT.js} +3 -3
- package/dist/{SheetViewer-ZUJe4VDI.js → SheetViewer-7y-xBDPP.js} +14 -14
- package/dist/{TextViewer-B1CYL9SW.js → TextViewer-DV3kRMRF.js} +4 -4
- package/dist/ai.d.ts +3 -3
- package/dist/ai.js +5 -5
- package/dist/component-status.js +1 -1
- package/dist/{createIcon-kCRByb2V.js → createIcon-B-z7hPQg.js} +1 -1
- package/dist/{dist-q8xUj5Iy.js → dist-BwlC-i6M.js} +2 -2
- package/dist/{dist-CmQTkrEK.js → dist-C691Abhf.js} +4 -4
- package/dist/{dist-CYCP3Qvh.js → dist-CiC2ZqiK.js} +9 -10
- package/dist/{dist-D6QAI4d5.js → dist-DN0nDQy0.js} +1 -1
- package/dist/{dist-CYC9dxNk.js → dist-_ts6SUAW.js} +1 -1
- package/dist/experimental.d.ts +95 -7
- package/dist/experimental.js +7599 -7389
- package/dist/{exports-BL-7xOvF.d.ts → exports-D-3BWR9h.d.ts} +1 -1
- package/dist/f0.d.ts +4 -4
- package/dist/f0.js +184 -184
- package/dist/{highlight-CfQ8GZnS.js → highlight-DbFt_sj2.js} +4 -4
- package/dist/{i18n-provider-defaults-DAe9_17Z.js → i18n-provider-defaults-BRl6Z_VM.js} +6 -1
- package/dist/{i18n-provider-defaults-CJ7tOOSh.d.ts → i18n-provider-defaults-BuHela-5.d.ts} +7 -0
- package/dist/i18n-provider-defaults.d.ts +1 -1
- package/dist/i18n-provider-defaults.js +1 -1
- package/dist/{i18n-provider-BfJwkJJi.js → i18n-provider-kdMqj3iD.js} +1 -1
- package/dist/{index-sPtVZM_e.d.ts → index-BACLk6eB.d.ts} +2 -2
- package/dist/{index-Dcup12pj.d.ts → index-BYvzhQWm.d.ts} +1 -1
- package/dist/{localized-e61KkjL3.js → localized-D19oXKkk.js} +1 -1
- package/dist/{maplibre-oPXqT1x4.js → maplibre-B3Z_BvY7.js} +1 -1
- package/dist/{pdfWorker-ew8IBxg7.js → pdfWorker-ODowmc3U.js} +1 -1
- package/dist/{popover-CMy0ZyuA.js → popover-BgQJIZoe.js} +1 -1
- package/dist/{skeleton-BrWHkMXn.js → skeleton-9cd4VWq0.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/{toolbarStyles-Bf_kmjgj.js → toolbarStyles-CusTVVsH.js} +1 -1
- package/dist/{useData-Tu399KjB.js → useData-XExWuz7o.js} +6 -6
- package/package.json +1 -1
- package/tailwind.config.ts +137 -0
- package/dist/F0AudioPlayer-bfoWAk4g.js +0 -2
- package/dist/F0VideoPlayer-Bk6wZCcT.js +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as e, r as t } from "./i18n-provider-
|
|
2
|
-
import { n, t as r } from "./skeleton-
|
|
1
|
+
import { a as e, r as t } from "./i18n-provider-kdMqj3iD.js";
|
|
2
|
+
import { n, t as r } from "./skeleton-9cd4VWq0.js";
|
|
3
3
|
import { L as i, R as a } from "./tooltip-NXXT56H4.js";
|
|
4
|
-
import { A as o, D as s, K as c, R as l, V as u, Y as d, b as f, h as p, n as m, r as h, t as g, v as _ } from "./F0Button-
|
|
5
|
-
import { $ as v,
|
|
6
|
-
import { a as U, u as Jt } from "./createIcon-
|
|
7
|
-
import { t as Yt } from "./i18n-provider-defaults-
|
|
8
|
-
import { A as Xt, L as Zt, P as W, U as Qt, W as $t, _ as en, g as tn, u as nn, v as rn, w as an, x as on } from "./useData-
|
|
9
|
-
import { Bn as sn, Bt as cn, Ir as ln, Lr as un, Rr as dn, St as fn, Vr as pn, bn as mn, bt as hn, dt as gn, qt as _n, xt as vn, zn as yn } from "./F0Select-
|
|
10
|
-
import { t as bn } from "./Check-
|
|
11
|
-
import { t as xn } from "./Ellipsis-
|
|
12
|
-
import { t as Sn } from "./ExternalLink-
|
|
13
|
-
import { $ as Cn, a as wn, i as Tn, n as En, t as Dn } from "./popover-
|
|
14
|
-
import { t as On } from "./F0Text-
|
|
4
|
+
import { A as o, D as s, K as c, R as l, V as u, Y as d, b as f, h as p, n as m, r as h, t as g, v as _ } from "./F0Button-DVbQTicD.js";
|
|
5
|
+
import { $ as v, $n as y, Al as b, As as x, At as S, B as C, Bn as w, Bo as T, Ca as E, Cn as D, D as O, Da as ee, Dn as te, Dt as ne, E as k, Fn as A, Go as j, Gs as M, Gt as re, Hl as N, Hn as ie, Ht as ae, I as oe, In as se, J as ce, Jn as le, Js as ue, Kt as P, L as de, Ln as F, Ml as I, Ms as fe, Mt as pe, N as me, Nt as he, O as ge, Oi as _e, On as ve, Ot as ye, P as L, Pn as be, Pt as xe, Q as Se, R as Ce, Sa as we, Sn as Te, St as Ee, T as De, Ta as Oe, Un as ke, Ut as R, Vl as Ae, Vn as je, Vo as Me, Vt as z, Wt as Ne, X as B, Xn as Pe, Xs as Fe, Xt as Ie, Y as Le, Yn as Re, Z as ze, Zi as V, Zs as H, _c as Be, _l as Ve, _t as He, a as Ue, ac as We, as as Ge, at as Ke, b as qe, bn as Je, bt as Ye, c as Xe, ca as Ze, cl as Qe, ct as $e, dt as et, et as tt, fc as nt, fn as rt, fo as it, ft as at, gt as ot, hc as st, hi as ct, hn as lt, ht as ut, in as dt, jl as ft, jn as pt, js as mt, ki as ht, ks as gt, kt as _t, la as vt, li as yt, ln as bt, nt as xt, ot as St, pn as Ct, r as wt, rl as Tt, rn as Et, s as Dt, sa as Ot, sl as kt, tt as At, u as jt, un as Mt, ut as Nt, vn as Pt, vs as Ft, vt as It, w as Lt, wc as Rt, wn as zt, x as Bt, xc as Vt, xt as Ht, y as Ut, yc as Wt, yi as Gt, yt as Kt, z as qt } from "./F0CanvasPanel-BimlvEaL.js";
|
|
6
|
+
import { a as U, u as Jt } from "./createIcon-B-z7hPQg.js";
|
|
7
|
+
import { t as Yt } from "./i18n-provider-defaults-BRl6Z_VM.js";
|
|
8
|
+
import { A as Xt, L as Zt, P as W, U as Qt, W as $t, _ as en, g as tn, u as nn, v as rn, w as an, x as on } from "./useData-XExWuz7o.js";
|
|
9
|
+
import { Bn as sn, Bt as cn, Ir as ln, Lr as un, Rr as dn, St as fn, Vr as pn, bn as mn, bt as hn, dt as gn, qt as _n, xt as vn, zn as yn } from "./F0Select-D6mxgb1s.js";
|
|
10
|
+
import { t as bn } from "./Check-B2Oii9hT.js";
|
|
11
|
+
import { t as xn } from "./Ellipsis-C36nOldJ.js";
|
|
12
|
+
import { t as Sn } from "./ExternalLink-oako7DEE.js";
|
|
13
|
+
import { $ as Cn, a as wn, i as Tn, n as En, t as Dn } from "./popover-BgQJIZoe.js";
|
|
14
|
+
import { t as On } from "./F0Text-CcpTiEit.js";
|
|
15
15
|
import { a as kn } from "./dist-DMTFO2gF.js";
|
|
16
16
|
import { Children as An, Fragment as jn, createContext as Mn, createElement as Nn, forwardRef as Pn, isValidElement as Fn, memo as In, useCallback as G, useContext as Ln, useEffect as K, useId as Rn, useImperativeHandle as zn, useInsertionEffect as Bn, useLayoutEffect as Vn, useMemo as q, useRef as J, useState as Y } from "react";
|
|
17
17
|
import { Fragment as Hn, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
@@ -36,15 +36,15 @@ var Kn = [
|
|
|
36
36
|
"sm",
|
|
37
37
|
"md",
|
|
38
38
|
"lg"
|
|
39
|
-
], Jn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow transition-colors focus-within:border-f1-border", Yn = [], Xn = () => null, Zn = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: o = !1, maxLength: s, maxLengthError: l, error: u = null, labels: f, placeholders: p, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice: S, onTextChange: C, onCleared: w, onEscape: T, onArrowUpWhenEmpty: E, onPasteFiles: D, pastePreferText: O = !1, onStateChange:
|
|
40
|
-
let
|
|
39
|
+
], Jn = "relative flex flex-col rounded-lg border border-solid border-f1-border-secondary bg-f1-background/95 shadow transition-colors focus-within:border-f1-border", Yn = [], Xn = () => null, Zn = ({ onSend: e, inProgress: t = !1, onStop: n, sendKind: r = "send", hasAttachments: a = !1, sendBlocked: o = !1, maxLength: s, maxLengthError: l, error: u = null, labels: f, placeholders: p, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice: S, onTextChange: C, onCleared: w, onEscape: T, onArrowUpWhenEmpty: E, onPasteFiles: D, pastePreferText: O = !1, onStateChange: ee, header: te, tray: k, leading: A, toolbarStart: j, toolbarCenter: M, collapsible: re = !1, collapsed: N = !1, replacement: ie, asForm: ae = !1, className: oe, surfaceRef: se, onSurfaceFocus: ce, onSurfaceBlur: le, handleRef: ue, reducedMotion: P = !1, "data-testid": de }) => {
|
|
40
|
+
let F = Kt(f, S), I = ie != null, { error: fe, show: pe, clear: me } = It(), he = J(() => {}), ge = J(() => {}), _e = J(""), ve = G((e) => {
|
|
41
41
|
let t = _e.current, n = t && !/\s$/.test(t) ? " " : "";
|
|
42
42
|
he.current(`${t}${n}${e}`);
|
|
43
43
|
}, []), ye = {
|
|
44
|
-
"permission-denied":
|
|
45
|
-
"device-error":
|
|
46
|
-
"transcription-failed":
|
|
47
|
-
},
|
|
44
|
+
"permission-denied": F.micPermissionDenied,
|
|
45
|
+
"device-error": F.micError,
|
|
46
|
+
"transcription-failed": F.transcriptionError
|
|
47
|
+
}, L = Pe({
|
|
48
48
|
onTranscribe: S?.onTranscribe,
|
|
49
49
|
onPartial: ve,
|
|
50
50
|
onFinal: (e) => {
|
|
@@ -52,9 +52,9 @@ var Kn = [
|
|
|
52
52
|
},
|
|
53
53
|
onError: (e) => pe(ye[e]),
|
|
54
54
|
onAudio: S?.onAudio
|
|
55
|
-
}), [be, xe] = Y(!1),
|
|
55
|
+
}), [be, xe] = Y(!1), Se = L.status === "recording", Ce = L.status === "transcribing", we = !!S && (!!S.onTranscribe || !!S.onAudio) && L.isSupported, Te = !S?.onAudio && (L.status !== "idle" || be), [De, Oe] = Y(!1), R = Ht({
|
|
56
56
|
mentions: {
|
|
57
|
-
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !
|
|
57
|
+
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !De && !I,
|
|
58
58
|
sources: b?.sources ?? Yn,
|
|
59
59
|
pinned: b?.pinned,
|
|
60
60
|
scopeKey: b?.scopeKey,
|
|
@@ -63,81 +63,81 @@ var Kn = [
|
|
|
63
63
|
transformChange: x?.transformChange,
|
|
64
64
|
onTextChange: C,
|
|
65
65
|
historySuspended: Te
|
|
66
|
-
}), { value:
|
|
66
|
+
}), { value: Ae, setValue: je, setCursorPosition: Me, textareaRef: z, highlightRef: Ne, mentions: B, requestSelection: Fe, clearText: Ie, breakHistory: Le } = R;
|
|
67
67
|
he.current = (e) => {
|
|
68
|
-
|
|
68
|
+
je(e), Me(e.length);
|
|
69
69
|
};
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
let ze = J(
|
|
73
|
-
ze.current =
|
|
74
|
-
let
|
|
70
|
+
let Re = J(Ae);
|
|
71
|
+
Re.current = Ae;
|
|
72
|
+
let ze = J(B.mentions);
|
|
73
|
+
ze.current = B.mentions;
|
|
74
|
+
let V = (x?.useAutocomplete ?? Xn)(R), H = V?.isOpen ?? !1, Be = B.dismissCurrentTrigger;
|
|
75
75
|
K(() => {
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
let { highlightSegments:
|
|
79
|
-
let t =
|
|
76
|
+
Oe(H), H && Be();
|
|
77
|
+
}, [H, Be]);
|
|
78
|
+
let { highlightSegments: Ve, hasOverlay: Ue } = Ee(R, { suppressGhost: H }), We = G((e) => {
|
|
79
|
+
let t = z.current;
|
|
80
80
|
if (!t) return;
|
|
81
81
|
t.focus(e);
|
|
82
82
|
let n = t.value.length;
|
|
83
83
|
t.setSelectionRange(n, n);
|
|
84
|
-
}, [
|
|
85
|
-
ge.current = () =>
|
|
86
|
-
let
|
|
84
|
+
}, [z]);
|
|
85
|
+
ge.current = () => z.current?.focus();
|
|
86
|
+
let Ge = B.close;
|
|
87
87
|
K(() => {
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
let
|
|
88
|
+
I && Ge();
|
|
89
|
+
}, [I, Ge]);
|
|
90
|
+
let Ke = Ae.length === 0;
|
|
91
91
|
K(() => {
|
|
92
|
-
|
|
93
|
-
isEmpty:
|
|
94
|
-
recorder:
|
|
92
|
+
ee?.({
|
|
93
|
+
isEmpty: Ke,
|
|
94
|
+
recorder: L.status
|
|
95
95
|
});
|
|
96
96
|
}, [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
ee,
|
|
98
|
+
Ke,
|
|
99
|
+
L.status
|
|
100
100
|
]);
|
|
101
|
-
let [
|
|
101
|
+
let [qe, Je] = Y(!1), Xe = s !== void 0 && Ae.trim().length > s;
|
|
102
102
|
K(() => {
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
let
|
|
106
|
-
if (!
|
|
107
|
-
if (
|
|
108
|
-
|
|
103
|
+
Xe || Je(!1);
|
|
104
|
+
}, [Xe]);
|
|
105
|
+
let Ze = qe && Xe ? l ?? null : null, $e = Ze ?? u ?? fe, [tt, nt] = Y(!1), rt = J(!1), it = Ae.trim().length > 0 || a, st = it && !Te && !o && !tt && !I, ct = t && !Ce, lt = G(() => {
|
|
106
|
+
if (!st || rt.current) return;
|
|
107
|
+
if (Xe) {
|
|
108
|
+
Je(!0);
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
let t =
|
|
113
|
-
!e &&
|
|
111
|
+
B.close();
|
|
112
|
+
let t = Re.current, n = (e) => {
|
|
113
|
+
!e && Re.current === t && (Ie(), Le()), z.current?.focus({ preventScroll: !0 });
|
|
114
114
|
}, r;
|
|
115
115
|
try {
|
|
116
116
|
r = e({
|
|
117
117
|
text: t,
|
|
118
|
-
mentions:
|
|
118
|
+
mentions: B.mentions
|
|
119
119
|
});
|
|
120
120
|
} catch {
|
|
121
121
|
n(!0);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
r instanceof Promise ? (
|
|
125
|
-
|
|
124
|
+
r instanceof Promise ? (rt.current = !0, nt(!0), r.then((e) => {
|
|
125
|
+
rt.current = !1, nt(!1), n(e === !1);
|
|
126
126
|
}, () => {
|
|
127
|
-
|
|
127
|
+
rt.current = !1, nt(!1), n(!0);
|
|
128
128
|
})) : n(r === !1);
|
|
129
129
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
st,
|
|
131
|
+
Xe,
|
|
132
|
+
B,
|
|
133
133
|
e,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
Ie,
|
|
135
|
+
Le,
|
|
136
|
+
z
|
|
137
137
|
]), dt = G(() => {
|
|
138
138
|
be || (S?.onPress?.(), me(), xe(!0), (async () => {
|
|
139
139
|
try {
|
|
140
|
-
await
|
|
140
|
+
await L.start(), _e.current = Re.current;
|
|
141
141
|
} catch {} finally {
|
|
142
142
|
xe(!1);
|
|
143
143
|
}
|
|
@@ -146,92 +146,92 @@ var Kn = [
|
|
|
146
146
|
be,
|
|
147
147
|
S,
|
|
148
148
|
me,
|
|
149
|
-
|
|
150
|
-
]), ft =
|
|
149
|
+
L
|
|
150
|
+
]), ft = L.cancel, pt = G(() => {
|
|
151
151
|
ft(), S?.onCancelled?.();
|
|
152
|
-
}, [ft, S]),
|
|
152
|
+
}, [ft, S]), mt = J(!1), ht = S?.onStarted;
|
|
153
153
|
K(() => {
|
|
154
|
-
|
|
155
|
-
}, [
|
|
154
|
+
Se && !mt.current && ht?.(), mt.current = Se;
|
|
155
|
+
}, [Se, ht]), zn(ue, () => ({
|
|
156
156
|
focus: (e) => {
|
|
157
|
-
|
|
157
|
+
I || We(e);
|
|
158
158
|
},
|
|
159
|
-
clear:
|
|
160
|
-
loadDraft:
|
|
159
|
+
clear: Ie,
|
|
160
|
+
loadDraft: R.loadDraft,
|
|
161
161
|
getDraft: () => ({
|
|
162
|
-
text:
|
|
162
|
+
text: Re.current,
|
|
163
163
|
mentions: ze.current
|
|
164
164
|
}),
|
|
165
165
|
insertText: (e) => {
|
|
166
|
-
let t =
|
|
167
|
-
|
|
166
|
+
let t = z.current, n = Re.current, r = t?.selectionStart ?? n.length, i = t?.selectionEnd ?? n.length, a = r + e.length, o = n.slice(0, r) + e + n.slice(i);
|
|
167
|
+
je(o), Me(a), C?.(o), Fe(a, o, !0);
|
|
168
168
|
},
|
|
169
169
|
cancelRecording: ft,
|
|
170
|
-
breakHistory:
|
|
170
|
+
breakHistory: Le,
|
|
171
171
|
addFiles: () => {}
|
|
172
172
|
}), [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
Ae,
|
|
173
|
+
I,
|
|
174
|
+
We,
|
|
175
|
+
Ie,
|
|
176
|
+
R.loadDraft,
|
|
177
|
+
z,
|
|
179
178
|
je,
|
|
179
|
+
Me,
|
|
180
180
|
C,
|
|
181
|
-
|
|
181
|
+
Fe,
|
|
182
182
|
ft,
|
|
183
|
-
|
|
183
|
+
Le
|
|
184
184
|
]);
|
|
185
|
-
let { escapeArmed:
|
|
185
|
+
let { escapeArmed: gt, handleClearKeyDown: _t, handleUndoRedoKeyDown: vt } = R, yt = (e) => {
|
|
186
186
|
if (e.key !== "Escape") return !1;
|
|
187
187
|
if (T?.(e)) return !0;
|
|
188
|
-
if (
|
|
189
|
-
let t =
|
|
190
|
-
return
|
|
188
|
+
if (Se) return e.preventDefault(), pt(), !0;
|
|
189
|
+
let t = gt;
|
|
190
|
+
return _t(e) ? (t && (Je(!1), w?.()), !0) : !1;
|
|
191
|
+
}, bt = (e) => {
|
|
192
|
+
I || Ye(e) || vt(e) || V?.handleKeyDown(e) || B.handleKeyDown(e) || yt(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && Ae === "" && L.status === "idle" && !be && !S?.busy && E?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || lt()));
|
|
191
193
|
}, xt = (e) => {
|
|
192
|
-
|
|
193
|
-
}, St = (
|
|
194
|
-
|
|
195
|
-
}, Ct = Nt({
|
|
196
|
-
enabled: !!D && !L,
|
|
194
|
+
e.preventDefault(), !I && (t && !Te ? (B.close(), n?.(), z.current?.focus()) : lt());
|
|
195
|
+
}, St = Nt({
|
|
196
|
+
enabled: !!D && !I,
|
|
197
197
|
onFiles: D ?? (() => {}),
|
|
198
198
|
preferText: O
|
|
199
|
-
}),
|
|
199
|
+
}), Ct = Rn(), wt = Rn(), Tt = `chat-composer-mentions-${Ct.replace(/:/g, "")}`, Et = B.isOpen && !H && !I && (B.isLoading || B.rows.length > 0), Dt = B.rows[B.selectedIndex] ?? B.rows[0], Ot = Et && Dt ? He(Tt, Dt.item) : void 0, kt = (e) => we ? /* @__PURE__ */ X(m, {
|
|
200
200
|
type: "button",
|
|
201
201
|
variant: "ghost",
|
|
202
202
|
size: e,
|
|
203
203
|
hideLabel: !0,
|
|
204
|
-
label: S?.busy ?
|
|
205
|
-
icon:
|
|
204
|
+
label: S?.busy ? F.sendingVoice : F.recordAudio,
|
|
205
|
+
icon: Wt,
|
|
206
206
|
onClick: dt,
|
|
207
207
|
disabled: S?.disabled,
|
|
208
208
|
loading: be || Ce || !!S?.busy
|
|
209
|
-
}) : null,
|
|
210
|
-
streaming:
|
|
211
|
-
hasDataToSend:
|
|
212
|
-
canSend:
|
|
213
|
-
}),
|
|
214
|
-
action:
|
|
209
|
+
}) : null, At = at({
|
|
210
|
+
streaming: ct,
|
|
211
|
+
hasDataToSend: it,
|
|
212
|
+
canSend: st
|
|
213
|
+
}), jt = (e) => /* @__PURE__ */ X(et, {
|
|
214
|
+
action: At,
|
|
215
215
|
sendKind: r,
|
|
216
216
|
size: e,
|
|
217
217
|
submit: ae,
|
|
218
|
-
labels:
|
|
219
|
-
onSend:
|
|
218
|
+
labels: F,
|
|
219
|
+
onSend: lt,
|
|
220
220
|
onStop: () => {
|
|
221
|
-
n?.(),
|
|
221
|
+
n?.(), z.current?.focus();
|
|
222
222
|
}
|
|
223
|
-
}),
|
|
223
|
+
}), Mt = { duration: P ? 0 : .15 }, Pt = typeof j == "function" ? j(L.status) : j, Ft = /* @__PURE__ */ X("div", {
|
|
224
224
|
className: "grid",
|
|
225
225
|
children: /* @__PURE__ */ X(d, {
|
|
226
226
|
initial: !1,
|
|
227
|
-
children:
|
|
227
|
+
children: Se ? /* @__PURE__ */ Z(c.div, {
|
|
228
228
|
className: "flex items-center gap-3 pb-2 pl-3 pr-2 [grid-area:1/1]",
|
|
229
229
|
initial: { opacity: 0 },
|
|
230
230
|
animate: { opacity: 1 },
|
|
231
231
|
exit: { opacity: 0 },
|
|
232
|
-
transition:
|
|
233
|
-
children: [/* @__PURE__ */ X(
|
|
234
|
-
stream:
|
|
232
|
+
transition: Mt,
|
|
233
|
+
children: [/* @__PURE__ */ X(ke, {
|
|
234
|
+
stream: L.stream,
|
|
235
235
|
className: "min-w-0 flex-1"
|
|
236
236
|
}), /* @__PURE__ */ Z("div", {
|
|
237
237
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -240,17 +240,17 @@ var Kn = [
|
|
|
240
240
|
variant: "outline",
|
|
241
241
|
size: "md",
|
|
242
242
|
hideLabel: !0,
|
|
243
|
-
label:
|
|
244
|
-
icon:
|
|
245
|
-
onClick:
|
|
243
|
+
label: F.cancelRecording,
|
|
244
|
+
icon: Qe,
|
|
245
|
+
onClick: pt
|
|
246
246
|
}), /* @__PURE__ */ X(m, {
|
|
247
247
|
type: "button",
|
|
248
248
|
variant: "default",
|
|
249
249
|
size: "md",
|
|
250
250
|
hideLabel: !0,
|
|
251
|
-
label:
|
|
251
|
+
label: F.confirmRecording,
|
|
252
252
|
icon: bn,
|
|
253
|
-
onClick:
|
|
253
|
+
onClick: L.stop
|
|
254
254
|
})]
|
|
255
255
|
})]
|
|
256
256
|
}, "recording-row") : /* @__PURE__ */ Z(c.div, {
|
|
@@ -258,87 +258,87 @@ var Kn = [
|
|
|
258
258
|
initial: { opacity: 0 },
|
|
259
259
|
animate: { opacity: 1 },
|
|
260
260
|
exit: { opacity: 0 },
|
|
261
|
-
transition:
|
|
261
|
+
transition: Mt,
|
|
262
262
|
children: [
|
|
263
|
-
|
|
264
|
-
className: i("flex items-center gap-1",
|
|
265
|
-
children:
|
|
263
|
+
Pt ? /* @__PURE__ */ X("div", {
|
|
264
|
+
className: i("flex items-center gap-1", M ? "shrink-0" : "min-w-0"),
|
|
265
|
+
children: Pt
|
|
266
266
|
}) : null,
|
|
267
|
-
|
|
267
|
+
M ? /* @__PURE__ */ X("div", {
|
|
268
268
|
className: "min-w-0 flex-1",
|
|
269
|
-
children:
|
|
269
|
+
children: M
|
|
270
270
|
}) : null,
|
|
271
271
|
/* @__PURE__ */ Z("div", {
|
|
272
272
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
273
|
-
children: [
|
|
273
|
+
children: [kt("md"), jt("md")]
|
|
274
274
|
})
|
|
275
275
|
]
|
|
276
276
|
}, "actions-row")
|
|
277
277
|
})
|
|
278
|
-
}),
|
|
279
|
-
duration:
|
|
278
|
+
}), Lt = {
|
|
279
|
+
duration: P ? 0 : .32,
|
|
280
280
|
ease: [
|
|
281
281
|
.4,
|
|
282
282
|
0,
|
|
283
283
|
.2,
|
|
284
284
|
1
|
|
285
285
|
]
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
/* @__PURE__ */ X(
|
|
289
|
-
message:
|
|
290
|
-
id:
|
|
291
|
-
reducedMotion:
|
|
286
|
+
}, Rt = /* @__PURE__ */ Z(Hn, { children: [
|
|
287
|
+
te,
|
|
288
|
+
/* @__PURE__ */ X(ut, {
|
|
289
|
+
message: $e,
|
|
290
|
+
id: wt,
|
|
291
|
+
reducedMotion: P
|
|
292
292
|
}),
|
|
293
|
-
|
|
293
|
+
k,
|
|
294
294
|
/* @__PURE__ */ Z("div", {
|
|
295
|
-
className: i((
|
|
295
|
+
className: i((A || N) && "flex items-end", N && "pr-3"),
|
|
296
296
|
children: [
|
|
297
|
-
|
|
298
|
-
/* @__PURE__ */ X(
|
|
297
|
+
A,
|
|
298
|
+
/* @__PURE__ */ X(ne, {
|
|
299
299
|
className: "min-w-0 flex-1",
|
|
300
|
-
textareaRef:
|
|
301
|
-
highlightRef:
|
|
302
|
-
value:
|
|
300
|
+
textareaRef: z,
|
|
301
|
+
highlightRef: Ne,
|
|
302
|
+
value: Ae,
|
|
303
303
|
role: v,
|
|
304
304
|
name: y,
|
|
305
|
-
ariaLabel:
|
|
305
|
+
ariaLabel: F.placeholder,
|
|
306
306
|
placeholder: p ? {
|
|
307
307
|
mode: "overlay",
|
|
308
|
-
texts:
|
|
309
|
-
fallback:
|
|
308
|
+
texts: Se ? [F.listening] : p,
|
|
309
|
+
fallback: Se ? F.listening : F.placeholder,
|
|
310
310
|
paused: h,
|
|
311
|
-
preview:
|
|
311
|
+
preview: Se ? void 0 : g,
|
|
312
312
|
previewOneLine: _
|
|
313
313
|
} : {
|
|
314
314
|
mode: "native",
|
|
315
|
-
text:
|
|
315
|
+
text: Se ? F.listening : F.placeholder
|
|
316
316
|
},
|
|
317
|
-
onChange:
|
|
318
|
-
onKeyDown:
|
|
319
|
-
onPaste:
|
|
320
|
-
onFocus:
|
|
321
|
-
onBlur:
|
|
322
|
-
onCursorUpdate:
|
|
323
|
-
onScroll:
|
|
324
|
-
highlightSegments:
|
|
325
|
-
hasOverlay:
|
|
326
|
-
isAutocompleteOpen:
|
|
327
|
-
autocompleteListboxId:
|
|
328
|
-
activeAutocompleteOptionId: (
|
|
329
|
-
isInvalid:
|
|
330
|
-
errorMessageId:
|
|
317
|
+
onChange: R.handleChange,
|
|
318
|
+
onKeyDown: bt,
|
|
319
|
+
onPaste: St,
|
|
320
|
+
onFocus: V?.handleFocus,
|
|
321
|
+
onBlur: V?.handleBlur,
|
|
322
|
+
onCursorUpdate: R.updateCursorPosition,
|
|
323
|
+
onScroll: R.syncHighlightScroll,
|
|
324
|
+
highlightSegments: Ve,
|
|
325
|
+
hasOverlay: Ue,
|
|
326
|
+
isAutocompleteOpen: H || Et,
|
|
327
|
+
autocompleteListboxId: H ? V?.listboxId : Et ? Tt : void 0,
|
|
328
|
+
activeAutocompleteOptionId: (H ? V?.activeDescendantId : void 0) ?? Ot,
|
|
329
|
+
isInvalid: Ze !== null,
|
|
330
|
+
errorMessageId: wt
|
|
331
331
|
}),
|
|
332
|
-
|
|
332
|
+
N ? /* @__PURE__ */ Z("div", {
|
|
333
333
|
className: "flex shrink-0 items-center gap-2 pb-[10px] pl-2",
|
|
334
334
|
onMouseDown: (e) => e.preventDefault(),
|
|
335
|
-
children: [
|
|
335
|
+
children: [kt("sm"), jt("sm")]
|
|
336
336
|
}) : null
|
|
337
337
|
]
|
|
338
338
|
}),
|
|
339
|
-
|
|
339
|
+
re ? /* @__PURE__ */ X(d, {
|
|
340
340
|
initial: !1,
|
|
341
|
-
children:
|
|
341
|
+
children: N ? null : /* @__PURE__ */ X(c.div, {
|
|
342
342
|
className: "overflow-hidden",
|
|
343
343
|
initial: {
|
|
344
344
|
opacity: 0,
|
|
@@ -352,28 +352,28 @@ var Kn = [
|
|
|
352
352
|
opacity: 0,
|
|
353
353
|
height: 0
|
|
354
354
|
},
|
|
355
|
-
transition:
|
|
356
|
-
children:
|
|
355
|
+
transition: Lt,
|
|
356
|
+
children: Ft
|
|
357
357
|
}, "action-row")
|
|
358
|
-
}) :
|
|
359
|
-
] }),
|
|
360
|
-
|
|
361
|
-
/* @__PURE__ */ X(
|
|
362
|
-
isOpen:
|
|
363
|
-
listboxId:
|
|
364
|
-
label:
|
|
365
|
-
rows:
|
|
366
|
-
groups:
|
|
358
|
+
}) : Ft
|
|
359
|
+
] }), zt = /* @__PURE__ */ Z(Hn, { children: [
|
|
360
|
+
V?.popover,
|
|
361
|
+
/* @__PURE__ */ X(ot, {
|
|
362
|
+
isOpen: Et,
|
|
363
|
+
listboxId: Tt,
|
|
364
|
+
label: F.mentionSuggestions,
|
|
365
|
+
rows: B.rows,
|
|
366
|
+
groups: B.groups,
|
|
367
367
|
showGroupLabels: !!b?.showGroupLabels,
|
|
368
|
-
isLoading:
|
|
369
|
-
selectedIndex:
|
|
370
|
-
position:
|
|
371
|
-
onSelect:
|
|
372
|
-
pinnedDescription:
|
|
368
|
+
isLoading: B.isLoading,
|
|
369
|
+
selectedIndex: B.selectedIndex,
|
|
370
|
+
position: B.popoverPosition,
|
|
371
|
+
onSelect: B.selectRow,
|
|
372
|
+
pinnedDescription: F.mentionPinnedDescription
|
|
373
373
|
}),
|
|
374
|
-
ie === void 0 ?
|
|
374
|
+
ie === void 0 ? Rt : /* @__PURE__ */ X(d, {
|
|
375
375
|
initial: !1,
|
|
376
|
-
children:
|
|
376
|
+
children: I ? /* @__PURE__ */ X(c.div, {
|
|
377
377
|
className: "overflow-hidden",
|
|
378
378
|
initial: {
|
|
379
379
|
height: 0,
|
|
@@ -387,7 +387,7 @@ var Kn = [
|
|
|
387
387
|
height: 0,
|
|
388
388
|
opacity: 0,
|
|
389
389
|
transition: {
|
|
390
|
-
duration:
|
|
390
|
+
duration: P ? 0 : .22,
|
|
391
391
|
ease: [
|
|
392
392
|
.4,
|
|
393
393
|
0,
|
|
@@ -397,7 +397,7 @@ var Kn = [
|
|
|
397
397
|
}
|
|
398
398
|
},
|
|
399
399
|
transition: {
|
|
400
|
-
duration:
|
|
400
|
+
duration: P ? 0 : .4,
|
|
401
401
|
ease: [
|
|
402
402
|
.4,
|
|
403
403
|
0,
|
|
@@ -420,7 +420,7 @@ var Kn = [
|
|
|
420
420
|
height: 0,
|
|
421
421
|
opacity: 0,
|
|
422
422
|
transition: {
|
|
423
|
-
duration:
|
|
423
|
+
duration: P ? 0 : .15,
|
|
424
424
|
ease: [
|
|
425
425
|
.55,
|
|
426
426
|
0,
|
|
@@ -430,7 +430,7 @@ var Kn = [
|
|
|
430
430
|
}
|
|
431
431
|
},
|
|
432
432
|
transition: {
|
|
433
|
-
duration:
|
|
433
|
+
duration: P ? 0 : .4,
|
|
434
434
|
ease: [
|
|
435
435
|
.4,
|
|
436
436
|
0,
|
|
@@ -438,31 +438,31 @@ var Kn = [
|
|
|
438
438
|
1
|
|
439
439
|
]
|
|
440
440
|
},
|
|
441
|
-
children:
|
|
441
|
+
children: Rt
|
|
442
442
|
}, "input")
|
|
443
443
|
})
|
|
444
|
-
] }),
|
|
444
|
+
] }), Bt = i(Jn, oe);
|
|
445
445
|
return ae ? /* @__PURE__ */ X("form", {
|
|
446
|
-
ref:
|
|
446
|
+
ref: se,
|
|
447
447
|
"data-testid": de,
|
|
448
448
|
"data-f0-chat-composer": "",
|
|
449
449
|
"aria-busy": t,
|
|
450
|
-
className:
|
|
450
|
+
className: Bt,
|
|
451
451
|
onClick: () => {
|
|
452
|
-
|
|
452
|
+
I || z.current?.focus();
|
|
453
453
|
},
|
|
454
|
-
onFocus:
|
|
455
|
-
onBlur:
|
|
456
|
-
onSubmit:
|
|
457
|
-
children:
|
|
454
|
+
onFocus: ce,
|
|
455
|
+
onBlur: le,
|
|
456
|
+
onSubmit: xt,
|
|
457
|
+
children: zt
|
|
458
458
|
}) : /* @__PURE__ */ X("div", {
|
|
459
|
-
ref:
|
|
459
|
+
ref: se,
|
|
460
460
|
"data-testid": de,
|
|
461
461
|
"data-f0-chat-composer": "",
|
|
462
|
-
className:
|
|
463
|
-
onFocus:
|
|
464
|
-
onBlur:
|
|
465
|
-
children:
|
|
462
|
+
className: Bt,
|
|
463
|
+
onFocus: ce,
|
|
464
|
+
onBlur: le,
|
|
465
|
+
children: zt
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
468
|
//#endregion
|
|
@@ -492,19 +492,19 @@ function Qn(e, t, n = .2) {
|
|
|
492
492
|
//#endregion
|
|
493
493
|
//#region src/addons/ai/F0AiChatTextArea/components/AttachedFilesList.tsx
|
|
494
494
|
var $n = (e) => {
|
|
495
|
-
let { provided: t } =
|
|
496
|
-
return t ? /* @__PURE__ */ X(er, { ...e }) : /* @__PURE__ */ X(
|
|
495
|
+
let { provided: t } = Mt();
|
|
496
|
+
return t ? /* @__PURE__ */ X(er, { ...e }) : /* @__PURE__ */ X(bt, { children: /* @__PURE__ */ X(er, { ...e }) });
|
|
497
497
|
}, er = ({ attachedFiles: e, isUploading: n, onRemove: r, removeLabel: i, reducedMotion: a }) => {
|
|
498
498
|
let o = t(), s = tr(e), c = q(() => e.flatMap((e) => {
|
|
499
499
|
let t = s.get(e.id);
|
|
500
500
|
if (!t) return [];
|
|
501
|
-
let n = e.file.name, r = e.file.type ||
|
|
501
|
+
let n = e.file.name, r = e.file.type || D({
|
|
502
502
|
name: n,
|
|
503
503
|
url: t
|
|
504
504
|
});
|
|
505
505
|
return [{
|
|
506
506
|
att: e,
|
|
507
|
-
attachment:
|
|
507
|
+
attachment: zt({
|
|
508
508
|
name: n,
|
|
509
509
|
url: t,
|
|
510
510
|
mimeType: r
|
|
@@ -523,10 +523,10 @@ var $n = (e) => {
|
|
|
523
523
|
}];
|
|
524
524
|
}), [e, s]), l = q(() => c.map(({ att: e, attachment: t }, n) => ({
|
|
525
525
|
file: t,
|
|
526
|
-
item: e.status === "uploaded" ?
|
|
527
|
-
})), [c]), u =
|
|
526
|
+
item: e.status === "uploaded" ? Ct(t, lt(n, t.url)) : null
|
|
527
|
+
})), [c]), u = B(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
|
|
528
528
|
id: e.id,
|
|
529
|
-
content: /* @__PURE__ */ X(
|
|
529
|
+
content: /* @__PURE__ */ X(Se, {
|
|
530
530
|
attachment: t,
|
|
531
531
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
532
532
|
errorMessage: e.errorMessage,
|
|
@@ -536,7 +536,7 @@ var $n = (e) => {
|
|
|
536
536
|
testIdPrefix: "ai-chat"
|
|
537
537
|
})
|
|
538
538
|
}));
|
|
539
|
-
return /* @__PURE__ */ X(
|
|
539
|
+
return /* @__PURE__ */ X(ze, {
|
|
540
540
|
items: d,
|
|
541
541
|
label: o.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
|
|
542
542
|
busy: n,
|
|
@@ -566,14 +566,14 @@ var $n = (e) => {
|
|
|
566
566
|
u(e), s?.(e);
|
|
567
567
|
}, f = [...n ? [{
|
|
568
568
|
label: c.ai.addFilesOrPhotos,
|
|
569
|
-
icon:
|
|
569
|
+
icon: We,
|
|
570
570
|
onClick: r,
|
|
571
571
|
disabled: i,
|
|
572
572
|
disabledTooltip: a
|
|
573
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
573
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...Le(e)];
|
|
574
574
|
return /* @__PURE__ */ X("div", {
|
|
575
575
|
onClick: (e) => e.stopPropagation(),
|
|
576
|
-
children: /* @__PURE__ */ X(
|
|
576
|
+
children: /* @__PURE__ */ X(j, {
|
|
577
577
|
items: f,
|
|
578
578
|
align: "start",
|
|
579
579
|
disabled: o,
|
|
@@ -606,7 +606,7 @@ var $n = (e) => {
|
|
|
606
606
|
label: u.ai.attachFile,
|
|
607
607
|
hideLabel: !0,
|
|
608
608
|
type: "button",
|
|
609
|
-
icon:
|
|
609
|
+
icon: We,
|
|
610
610
|
variant: "ghost",
|
|
611
611
|
size: "md",
|
|
612
612
|
disabled: r || d,
|
|
@@ -637,7 +637,7 @@ var $n = (e) => {
|
|
|
637
637
|
};
|
|
638
638
|
}, ar = ({ creditWarning: e, children: n }) => {
|
|
639
639
|
let r = t(), i = ir(e);
|
|
640
|
-
return /* @__PURE__ */ X(
|
|
640
|
+
return /* @__PURE__ */ X(ce, {
|
|
641
641
|
notice: i,
|
|
642
642
|
dismissLabel: r.ai.creditWarning.dismiss ?? "",
|
|
643
643
|
className: "[&_form]:border-f1-border",
|
|
@@ -834,7 +834,7 @@ var mr = (e, t) => e || t ? {
|
|
|
834
834
|
/* @__PURE__ */ X("div", {
|
|
835
835
|
className: "flex items-center py-0.5",
|
|
836
836
|
children: /* @__PURE__ */ X(U, {
|
|
837
|
-
icon:
|
|
837
|
+
icon: M,
|
|
838
838
|
size: "md",
|
|
839
839
|
color: "default"
|
|
840
840
|
})
|
|
@@ -849,7 +849,7 @@ var mr = (e, t) => e || t ? {
|
|
|
849
849
|
variant: "ghost",
|
|
850
850
|
label: r.ai.removeQuote,
|
|
851
851
|
onClick: n,
|
|
852
|
-
icon:
|
|
852
|
+
icon: Qe,
|
|
853
853
|
hideLabel: !0,
|
|
854
854
|
size: "sm"
|
|
855
855
|
})
|
|
@@ -858,7 +858,7 @@ var mr = (e, t) => e || t ? {
|
|
|
858
858
|
});
|
|
859
859
|
}, gr = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ X("div", {
|
|
860
860
|
className: "grid w-full grid-cols-2 gap-3",
|
|
861
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(
|
|
861
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(V, {
|
|
862
862
|
avatar: {
|
|
863
863
|
type: "icon",
|
|
864
864
|
icon: e.icon
|
|
@@ -1002,44 +1002,44 @@ function Sr(e) {
|
|
|
1002
1002
|
//#endregion
|
|
1003
1003
|
//#region src/addons/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
1004
1004
|
var Cr = "w-full max-w-content px-1";
|
|
1005
|
-
function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: o, creditWarning: s, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer:
|
|
1006
|
-
let
|
|
1005
|
+
function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: o, creditWarning: s, clarifyingUI: l, pendingContext: u = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: w, usageLimits: T, footer: E, isWelcomeScreen: D = !1, fullscreen: O = !1, welcomeScreenSuggestions: ee, onSuggestionClick: te, welcomeScreenSuggestionsPlacement: ne = "above", welcomeScreenSuggestionsCollapsedByDefault: k = !1, welcomeScreenCards: A, padding: j = "default", name: M }) {
|
|
1006
|
+
let N = t(), ae = !!p(), oe = J(null), [se, ce] = Y(!1), [le, ue] = Y({
|
|
1007
1007
|
isEmpty: !0,
|
|
1008
1008
|
recorder: "idle"
|
|
1009
|
-
}),
|
|
1009
|
+
}), de = J(null), F = J(null);
|
|
1010
1010
|
K(() => () => {
|
|
1011
|
-
|
|
1011
|
+
F.current && clearTimeout(F.current);
|
|
1012
1012
|
}, []);
|
|
1013
|
-
let
|
|
1013
|
+
let I = l != null, fe = J(u), pe = J(m);
|
|
1014
1014
|
Vn(() => {
|
|
1015
1015
|
fe.current = u, pe.current = m;
|
|
1016
1016
|
});
|
|
1017
|
-
let { tracking:
|
|
1017
|
+
let { tracking: me, setFocusChatInputFunction: ge } = P(), { attachedFiles: _e, fileInputRef: ve, onUploadFiles: L, acceptValue: be, isAtMaxFiles: xe, maxFiles: Se, processFiles: Ce, handleFileSelect: we, handleRemoveFile: Te, transientError: Ee, showTransientError: De } = Sr(g), Oe = vr({
|
|
1018
1018
|
searchPersons: x,
|
|
1019
1019
|
mentionSources: S
|
|
1020
1020
|
});
|
|
1021
1021
|
K(() => {
|
|
1022
|
-
|
|
1022
|
+
k || typeof window < "u" && window.location.hash.length === 0 && oe.current?.focus();
|
|
1023
1023
|
}, []), K(() => {
|
|
1024
|
-
if (
|
|
1024
|
+
if (I) ge(null);
|
|
1025
1025
|
else return ge(() => {
|
|
1026
|
-
|
|
1026
|
+
oe.current?.focus();
|
|
1027
1027
|
}), () => ge(null);
|
|
1028
|
-
}, [
|
|
1028
|
+
}, [I, ge]), K(() => {
|
|
1029
1029
|
if (C) return C((e) => {
|
|
1030
|
-
|
|
1030
|
+
Ce(e);
|
|
1031
1031
|
}), () => {
|
|
1032
1032
|
C(null);
|
|
1033
1033
|
};
|
|
1034
|
-
}, [C,
|
|
1035
|
-
let
|
|
1036
|
-
if (
|
|
1034
|
+
}, [C, Ce]);
|
|
1035
|
+
let ke = G((e) => void Ce(e), [Ce]), R = _e.filter((e) => e.status === "uploaded"), Ae = _e.some((e) => e.status === "uploading"), je = _e.some((e) => e.status === "error"), Me = !le.isEmpty || R.length > 0, z = async ({ text: t, mentions: n }) => {
|
|
1036
|
+
if (je) return De(N.ai.fileUploadBlockedSubmit), !1;
|
|
1037
1037
|
if (a && await a() === !1) return !1;
|
|
1038
|
-
let r =
|
|
1038
|
+
let r = R, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = u, s = m;
|
|
1039
1039
|
o && f?.(null), s && h?.(null);
|
|
1040
1040
|
try {
|
|
1041
1041
|
await e({
|
|
1042
|
-
text:
|
|
1042
|
+
text: he(t, n),
|
|
1043
1043
|
files: i,
|
|
1044
1044
|
context: o,
|
|
1045
1045
|
quote: s
|
|
@@ -1047,46 +1047,46 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1047
1047
|
} catch {
|
|
1048
1048
|
return o && (fe.current == null || fe.current === o) && f?.(o), s && (pe.current == null || pe.current === s) && h?.(s), !1;
|
|
1049
1049
|
}
|
|
1050
|
-
for (let e of r)
|
|
1050
|
+
for (let e of r) Te(e.id);
|
|
1051
1051
|
return !0;
|
|
1052
|
-
},
|
|
1053
|
-
onItemClick:
|
|
1054
|
-
inBar:
|
|
1055
|
-
}),
|
|
1056
|
-
suggestions:
|
|
1057
|
-
onItemClick:
|
|
1058
|
-
onItemHover:
|
|
1059
|
-
side:
|
|
1060
|
-
reserveTwoRows: !
|
|
1061
|
-
overflow:
|
|
1062
|
-
}) : null,
|
|
1063
|
-
|
|
1064
|
-
|
|
1052
|
+
}, B = ne === "inside", Pe = Ne(), Fe = re({
|
|
1053
|
+
onItemClick: te,
|
|
1054
|
+
inBar: B
|
|
1055
|
+
}), Ie = D && ee && ee.length > 0 && te ? /* @__PURE__ */ X(ye, {
|
|
1056
|
+
suggestions: ee,
|
|
1057
|
+
onItemClick: Fe.pick,
|
|
1058
|
+
onItemHover: Fe.preview,
|
|
1059
|
+
side: B ? "bottom" : "top",
|
|
1060
|
+
reserveTwoRows: !B,
|
|
1061
|
+
overflow: B ? "scroll" : "wrap"
|
|
1062
|
+
}) : null, Le = !k || se || Me || le.recorder !== "idle", Re = (e) => e instanceof Node ? de.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, ze = () => {
|
|
1063
|
+
F.current && clearTimeout(F.current), F.current = setTimeout(() => {
|
|
1064
|
+
Re(document.activeElement) || ce(!1);
|
|
1065
1065
|
}, 0);
|
|
1066
|
-
},
|
|
1066
|
+
}, V = B, H = V && k, Be = H && !Le, Ve = V && Ie ? /* @__PURE__ */ X("div", {
|
|
1067
1067
|
onClick: (e) => e.stopPropagation(),
|
|
1068
|
-
children:
|
|
1068
|
+
children: Ie
|
|
1069
1069
|
}) : void 0, He = {
|
|
1070
|
-
duration:
|
|
1070
|
+
duration: ae ? 0 : .32,
|
|
1071
1071
|
ease: [
|
|
1072
1072
|
.4,
|
|
1073
1073
|
0,
|
|
1074
1074
|
.2,
|
|
1075
1075
|
1
|
|
1076
1076
|
]
|
|
1077
|
-
}, Ue =
|
|
1077
|
+
}, Ue = D && O && !!A && A.length > 0, We = O && D, Ge = We || !Pe?.inBar, Ke = We ? null : mr(w, T), qe = I || !!(Ke?.text || Ke?.trailing), { motionProps: Je } = Qn(D, 160, .5);
|
|
1078
1078
|
return /* @__PURE__ */ Z(c.div, {
|
|
1079
1079
|
"data-composer-layout": We ? "welcome" : "docked",
|
|
1080
|
-
className: i("flex flex-col items-center",
|
|
1081
|
-
...
|
|
1080
|
+
className: i("flex flex-col items-center", j === "default" && "px-4 pb-3 pt-2", We && "min-h-0 flex-1 justify-start"),
|
|
1081
|
+
...O ? Je : {},
|
|
1082
1082
|
children: [
|
|
1083
1083
|
/* @__PURE__ */ Z("div", {
|
|
1084
1084
|
className: i("flex flex-col gap-2", Cr),
|
|
1085
1085
|
children: [
|
|
1086
|
-
|
|
1087
|
-
|
|
1086
|
+
E && !O ? E : null,
|
|
1087
|
+
Ie && !B ? /* @__PURE__ */ X("div", { children: k ? /* @__PURE__ */ X(d, {
|
|
1088
1088
|
initial: !1,
|
|
1089
|
-
children:
|
|
1089
|
+
children: Le ? /* @__PURE__ */ X(c.div, {
|
|
1090
1090
|
className: "overflow-hidden",
|
|
1091
1091
|
initial: {
|
|
1092
1092
|
opacity: 0,
|
|
@@ -1101,55 +1101,55 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1101
1101
|
height: 0
|
|
1102
1102
|
},
|
|
1103
1103
|
transition: He,
|
|
1104
|
-
children:
|
|
1104
|
+
children: Ie
|
|
1105
1105
|
}, "welcome-suggestions") : null
|
|
1106
|
-
}) :
|
|
1106
|
+
}) : Ie }) : null,
|
|
1107
1107
|
/* @__PURE__ */ X(ar, {
|
|
1108
1108
|
creditWarning: s,
|
|
1109
1109
|
children: /* @__PURE__ */ X(Zn, {
|
|
1110
1110
|
asForm: !0,
|
|
1111
|
-
surfaceRef:
|
|
1112
|
-
handleRef:
|
|
1111
|
+
surfaceRef: de,
|
|
1112
|
+
handleRef: oe,
|
|
1113
1113
|
className: "isolate z-20 items-stretch bg-f1-special-page-surface p-0 hover:cursor-text",
|
|
1114
|
-
replacement:
|
|
1115
|
-
onSurfaceFocus: () =>
|
|
1116
|
-
onSurfaceBlur:
|
|
1117
|
-
onStateChange:
|
|
1118
|
-
onSend:
|
|
1114
|
+
replacement: I ? l : null,
|
|
1115
|
+
onSurfaceFocus: () => ce(!0),
|
|
1116
|
+
onSurfaceBlur: ze,
|
|
1117
|
+
onStateChange: ue,
|
|
1118
|
+
onSend: z,
|
|
1119
1119
|
inProgress: r,
|
|
1120
1120
|
onStop: n,
|
|
1121
|
-
hasAttachments:
|
|
1122
|
-
sendBlocked:
|
|
1123
|
-
error:
|
|
1121
|
+
hasAttachments: R.length > 0,
|
|
1122
|
+
sendBlocked: Ae,
|
|
1123
|
+
error: Ee,
|
|
1124
1124
|
role: "textbox",
|
|
1125
|
-
name:
|
|
1125
|
+
name: M,
|
|
1126
1126
|
placeholders: o ?? [],
|
|
1127
1127
|
placeholdersPaused: r,
|
|
1128
|
-
placeholderPreview:
|
|
1128
|
+
placeholderPreview: Pe?.prompt,
|
|
1129
1129
|
placeholderPreviewOneLine: Ge,
|
|
1130
1130
|
labels: {
|
|
1131
|
-
placeholder:
|
|
1132
|
-
listening:
|
|
1133
|
-
send:
|
|
1134
|
-
stop:
|
|
1135
|
-
recordAudio:
|
|
1136
|
-
cancelRecording:
|
|
1137
|
-
confirmRecording:
|
|
1138
|
-
micPermissionDenied:
|
|
1139
|
-
micError:
|
|
1140
|
-
transcriptionError:
|
|
1141
|
-
mentionSuggestions:
|
|
1131
|
+
placeholder: N.ai.inputPlaceholder,
|
|
1132
|
+
listening: N.ai.listening,
|
|
1133
|
+
send: N.ai.sendMessage,
|
|
1134
|
+
stop: N.ai.stopAnswerGeneration,
|
|
1135
|
+
recordAudio: N.ai.recordAudio,
|
|
1136
|
+
cancelRecording: N.ai.cancelRecording,
|
|
1137
|
+
confirmRecording: N.ai.stopRecording,
|
|
1138
|
+
micPermissionDenied: N.ai.micPermissionDenied,
|
|
1139
|
+
micError: N.ai.micError,
|
|
1140
|
+
transcriptionError: N.ai.transcriptionError,
|
|
1141
|
+
mentionSuggestions: N.ai.mentions.suggestions
|
|
1142
1142
|
},
|
|
1143
1143
|
mentions: {
|
|
1144
|
-
sources:
|
|
1145
|
-
showGroupLabels:
|
|
1144
|
+
sources: Oe,
|
|
1145
|
+
showGroupLabels: Oe.length > 1
|
|
1146
1146
|
},
|
|
1147
1147
|
voice: b ? {
|
|
1148
1148
|
onTranscribe: b,
|
|
1149
|
-
onPress:
|
|
1150
|
-
onCancelled:
|
|
1149
|
+
onPress: me?.onDictationStart,
|
|
1150
|
+
onCancelled: me?.onDictationCancel
|
|
1151
1151
|
} : void 0,
|
|
1152
|
-
onPasteFiles: g?.onUploadFiles ?
|
|
1152
|
+
onPasteFiles: g?.onUploadFiles ? ke : void 0,
|
|
1153
1153
|
pastePreferText: !0,
|
|
1154
1154
|
header: m ? /* @__PURE__ */ X(hr, {
|
|
1155
1155
|
quote: m,
|
|
@@ -1157,27 +1157,27 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1157
1157
|
}) : null,
|
|
1158
1158
|
tray: /* @__PURE__ */ X($n, {
|
|
1159
1159
|
attachedFiles: _e,
|
|
1160
|
-
isUploading:
|
|
1161
|
-
onRemove:
|
|
1162
|
-
removeLabel:
|
|
1163
|
-
reducedMotion:
|
|
1160
|
+
isUploading: Ae,
|
|
1161
|
+
onRemove: Te,
|
|
1162
|
+
removeLabel: N.ai.removeFile,
|
|
1163
|
+
reducedMotion: ae
|
|
1164
1164
|
}),
|
|
1165
|
-
leading:
|
|
1165
|
+
leading: V ? /* @__PURE__ */ X("div", {
|
|
1166
1166
|
className: "flex shrink-0 self-center pl-3",
|
|
1167
|
-
children: /* @__PURE__ */ X(
|
|
1167
|
+
children: /* @__PURE__ */ X(ie, {
|
|
1168
1168
|
size: "sm",
|
|
1169
1169
|
spin: r
|
|
1170
1170
|
})
|
|
1171
1171
|
}) : void 0,
|
|
1172
|
-
toolbarStart:
|
|
1173
|
-
onUploadFiles:
|
|
1172
|
+
toolbarStart: L || _ || v?.length ? (e) => /* @__PURE__ */ Z(Hn, { children: [/* @__PURE__ */ X(rr, {
|
|
1173
|
+
onUploadFiles: L,
|
|
1174
1174
|
composerActions: v,
|
|
1175
1175
|
onComposerActionsOpenChange: y,
|
|
1176
|
-
isAtMaxFiles:
|
|
1177
|
-
maxFiles:
|
|
1178
|
-
acceptValue:
|
|
1176
|
+
isAtMaxFiles: xe,
|
|
1177
|
+
maxFiles: Se,
|
|
1178
|
+
acceptValue: be,
|
|
1179
1179
|
fileInputRef: ve,
|
|
1180
|
-
handleFileSelect:
|
|
1180
|
+
handleFileSelect: we,
|
|
1181
1181
|
recordingStatus: e
|
|
1182
1182
|
}), _ ? /* @__PURE__ */ X("div", {
|
|
1183
1183
|
className: "min-w-0 cursor-default",
|
|
@@ -1185,9 +1185,9 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1185
1185
|
children: _
|
|
1186
1186
|
}) : null] }) : void 0,
|
|
1187
1187
|
toolbarCenter: Ve,
|
|
1188
|
-
collapsible:
|
|
1188
|
+
collapsible: H,
|
|
1189
1189
|
collapsed: Be,
|
|
1190
|
-
reducedMotion:
|
|
1190
|
+
reducedMotion: ae
|
|
1191
1191
|
})
|
|
1192
1192
|
})
|
|
1193
1193
|
]
|
|
@@ -1196,25 +1196,25 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1196
1196
|
className: i("grid transition-collapse duration-base ease-out-swift motion-reduce:transition-none", Cr, qe ? "mt-2 grid-rows-expanded" : "mt-0 grid-rows-collapsed"),
|
|
1197
1197
|
children: /* @__PURE__ */ X("div", {
|
|
1198
1198
|
className: i("flex min-h-0 min-w-0 flex-col items-center", !qe && "overflow-hidden"),
|
|
1199
|
-
children: /* @__PURE__ */ X(
|
|
1200
|
-
hint:
|
|
1201
|
-
navigate:
|
|
1202
|
-
select:
|
|
1203
|
-
cancel:
|
|
1199
|
+
children: /* @__PURE__ */ X(_t, {
|
|
1200
|
+
hint: I ? {
|
|
1201
|
+
navigate: N.ai.clarifyingQuestion.navHint.navigate,
|
|
1202
|
+
select: N.ai.clarifyingQuestion.navHint.select,
|
|
1203
|
+
cancel: N.ai.clarifyingQuestion.navHint.cancel
|
|
1204
1204
|
} : null,
|
|
1205
1205
|
disclaimer: Ke,
|
|
1206
|
-
reducedMotion:
|
|
1206
|
+
reducedMotion: ae,
|
|
1207
1207
|
fieldInset: "button"
|
|
1208
1208
|
})
|
|
1209
1209
|
})
|
|
1210
1210
|
}),
|
|
1211
1211
|
Ue ? /* @__PURE__ */ X("div", {
|
|
1212
1212
|
className: i("mt-2 pt-2", Cr),
|
|
1213
|
-
children: /* @__PURE__ */ X(gr, { cards:
|
|
1213
|
+
children: /* @__PURE__ */ X(gr, { cards: A })
|
|
1214
1214
|
}) : null,
|
|
1215
|
-
|
|
1215
|
+
E && D && O ? /* @__PURE__ */ X("div", {
|
|
1216
1216
|
className: "mx-auto mt-2 flex w-full max-w-content justify-center py-4",
|
|
1217
|
-
children:
|
|
1217
|
+
children: E
|
|
1218
1218
|
}) : null
|
|
1219
1219
|
]
|
|
1220
1220
|
});
|
|
@@ -1226,7 +1226,7 @@ function Tr(e) {
|
|
|
1226
1226
|
...e,
|
|
1227
1227
|
name: "one-ai-input"
|
|
1228
1228
|
});
|
|
1229
|
-
return
|
|
1229
|
+
return R() ? t : /* @__PURE__ */ X(ae, { children: t });
|
|
1230
1230
|
}
|
|
1231
1231
|
//#endregion
|
|
1232
1232
|
//#region src/addons/ai/markdown/typography.ts
|
|
@@ -1326,12 +1326,12 @@ function Vr({ children: e, ...t }) {
|
|
|
1326
1326
|
//#endregion
|
|
1327
1327
|
//#region src/addons/ai/markdown/Image.tsx
|
|
1328
1328
|
function Hr({ src: e, alt: n, ...r }) {
|
|
1329
|
-
let o = t(), s =
|
|
1329
|
+
let o = t(), s = be(), c = A(), l = F(e || void 0), [u, d] = Y(!1), [f, p] = Y(!1), m = n || (e ? Pt(e) : "") || "image";
|
|
1330
1330
|
if (!e || u || l.status === "error") return n ? /* @__PURE__ */ X("span", {
|
|
1331
1331
|
className: "text-f1-foreground-secondary",
|
|
1332
1332
|
children: n
|
|
1333
1333
|
}) : null;
|
|
1334
|
-
let h = l.status === "ready" ? /* @__PURE__ */ X(
|
|
1334
|
+
let h = l.status === "ready" ? /* @__PURE__ */ X(pt, {
|
|
1335
1335
|
...r,
|
|
1336
1336
|
src: l.url,
|
|
1337
1337
|
alt: n,
|
|
@@ -1359,7 +1359,7 @@ function Hr({ src: e, alt: n, ...r }) {
|
|
|
1359
1359
|
variant: "neutral",
|
|
1360
1360
|
label: o.chat.download,
|
|
1361
1361
|
hideLabel: !0,
|
|
1362
|
-
icon:
|
|
1362
|
+
icon: Tt,
|
|
1363
1363
|
onClick: () => c(e, m)
|
|
1364
1364
|
})
|
|
1365
1365
|
})]
|
|
@@ -1468,7 +1468,7 @@ var Zr = (e) => Array.from(e.querySelector("tr")?.children ?? []), Qr = (e) => {
|
|
|
1468
1468
|
//#endregion
|
|
1469
1469
|
//#region src/addons/ai/markdown/useOneLineWidth.ts
|
|
1470
1470
|
function ti(e, t) {
|
|
1471
|
-
let n = J(null), r =
|
|
1471
|
+
let n = J(null), r = we(), [i, a] = Y();
|
|
1472
1472
|
return Vn(function() {
|
|
1473
1473
|
if (!t || !n.current) return;
|
|
1474
1474
|
let e = parseFloat(getComputedStyle(n.current, "::before").width);
|
|
@@ -1496,11 +1496,11 @@ var ni = (e) => An.toArray(e).filter((e) => Fn(e)), ri = (e) => ni(e.props.child
|
|
|
1496
1496
|
return t;
|
|
1497
1497
|
};
|
|
1498
1498
|
async function ai({ header: e, rows: t }, n, r) {
|
|
1499
|
-
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) =>
|
|
1499
|
+
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) => qt(Xr(e)))), a = n === "xlsx" ? await C([{
|
|
1500
1500
|
name: "Data",
|
|
1501
1501
|
rows: i
|
|
1502
|
-
}]) : await
|
|
1503
|
-
|
|
1502
|
+
}]) : await de(i);
|
|
1503
|
+
Ce(a, `${r}.${n}`);
|
|
1504
1504
|
}
|
|
1505
1505
|
var oi = (e, t, n) => e ? {
|
|
1506
1506
|
role: "region",
|
|
@@ -1508,32 +1508,32 @@ var oi = (e, t, n) => e ? {
|
|
|
1508
1508
|
"aria-label": t || n
|
|
1509
1509
|
} : {};
|
|
1510
1510
|
function si({ children: e, title: n, ...r }) {
|
|
1511
|
-
let o = t(), s = J(null), c = $r(s), l = c.left || c.right, u = p(), d =
|
|
1511
|
+
let o = t(), s = J(null), c = $r(s), l = c.left || c.right, u = p(), d = oe(), f = (t) => {
|
|
1512
1512
|
let r = n?.replace(/\s+/g, "_").toLowerCase() || "table";
|
|
1513
1513
|
ai(ii(e), t, r);
|
|
1514
1514
|
}, h = /* @__PURE__ */ Z("div", {
|
|
1515
1515
|
className: "-ml-2 flex gap-1 pt-1",
|
|
1516
|
-
children: [/* @__PURE__ */ X(
|
|
1516
|
+
children: [/* @__PURE__ */ X(j, {
|
|
1517
1517
|
items: [{
|
|
1518
1518
|
label: o.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1519
|
-
icon:
|
|
1519
|
+
icon: Tt,
|
|
1520
1520
|
onClick: () => f("xlsx")
|
|
1521
1521
|
}, {
|
|
1522
1522
|
label: o.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1523
|
-
icon:
|
|
1523
|
+
icon: Tt,
|
|
1524
1524
|
onClick: () => f("csv")
|
|
1525
1525
|
}],
|
|
1526
1526
|
children: /* @__PURE__ */ X(m, {
|
|
1527
1527
|
variant: "ghost",
|
|
1528
1528
|
size: "sm",
|
|
1529
|
-
icon:
|
|
1529
|
+
icon: Tt,
|
|
1530
1530
|
label: o.ai.dataDownload.title,
|
|
1531
1531
|
className: "text-f1-foreground-secondary hover:text-f1-foreground"
|
|
1532
1532
|
})
|
|
1533
1533
|
}), l && (c.after > 0 || c.left) ? /* @__PURE__ */ X(m, {
|
|
1534
1534
|
variant: "ghost",
|
|
1535
1535
|
size: "sm",
|
|
1536
|
-
icon: c.after > 0 ?
|
|
1536
|
+
icon: c.after > 0 ? b : pn,
|
|
1537
1537
|
iconPosition: c.after > 0 ? "right" : "left",
|
|
1538
1538
|
label: c.after > 0 ? o.t(c.after === 1 ? "ai.aiTable.moreColumns.one" : "ai.aiTable.moreColumns.other", { count: c.after }) : o.ai.aiTable.backToStart,
|
|
1539
1539
|
className: "text-f1-foreground-secondary hover:text-f1-foreground",
|
|
@@ -1564,7 +1564,7 @@ var ci = "border-0 border-b border-solid pr-4 text-left text-sm leading-4.5 @[56
|
|
|
1564
1564
|
className: "after:invisible after:block after:h-0 after:w-max after:overflow-hidden after:content-[attr(data-floor)] first:after:max-w-44"
|
|
1565
1565
|
}), di = "after:max-w-[min(20rem,40cqi)]", fi = i("[--cap:min(20rem,40cqi)]", "after:max-w-[calc(var(--cap)_-_(var(--cap)_-_min(6rem,var(--cap)))_*_max(0,sign(var(--one-line,0px)_-_var(--cap))))]", "before:invisible before:absolute before:end-full before:h-0 before:w-max before:overflow-hidden before:whitespace-nowrap before:content-[attr(data-floor)]");
|
|
1566
1566
|
function pi({ children: e, ...t }) {
|
|
1567
|
-
let { className: n, ...r } = ui(Xr(e)), a =
|
|
1567
|
+
let { className: n, ...r } = ui(Xr(e)), a = oe();
|
|
1568
1568
|
return /* @__PURE__ */ X("th", {
|
|
1569
1569
|
...r,
|
|
1570
1570
|
...t,
|
|
@@ -1573,7 +1573,7 @@ function pi({ children: e, ...t }) {
|
|
|
1573
1573
|
});
|
|
1574
1574
|
}
|
|
1575
1575
|
function mi({ children: e, ellipsis: t = !1, ...n }) {
|
|
1576
|
-
let r = Xr(e), { className: a, ...o } = ui(r), { cell: s, width: c } = ti(r, !t), l =
|
|
1576
|
+
let r = Xr(e), { className: a, ...o } = ui(r), { cell: s, width: c } = ti(r, !t), l = oe();
|
|
1577
1577
|
return /* @__PURE__ */ X("td", {
|
|
1578
1578
|
ref: s,
|
|
1579
1579
|
title: t && r || void 0,
|
|
@@ -1634,7 +1634,7 @@ function gi({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...a
|
|
|
1634
1634
|
side: "top",
|
|
1635
1635
|
align: "start",
|
|
1636
1636
|
className: i(r, "rounded-2xl border-none bg-f1-background p-0 text-f1-foreground shadow-md"),
|
|
1637
|
-
children: a.renderCard ? a.renderCard(o) : o.status === "loading" ? /* @__PURE__ */ X(
|
|
1637
|
+
children: a.renderCard ? a.renderCard(o) : o.status === "loading" ? /* @__PURE__ */ X(V.Skeleton, {}) : /* @__PURE__ */ X(V, { ...o.status === "ready" ? a.mapToCard(o.data) : a.fallbackCard })
|
|
1638
1638
|
})]
|
|
1639
1639
|
});
|
|
1640
1640
|
}
|
|
@@ -1682,7 +1682,7 @@ var yi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1682
1682
|
}));
|
|
1683
1683
|
yi.displayName = "CandidateTrigger";
|
|
1684
1684
|
function bi({ id: e, label: n }) {
|
|
1685
|
-
let { entityRefs: r } =
|
|
1685
|
+
let { entityRefs: r } = P(), i = r?.resolvers?.candidate, a = t(), o = r?.urls?.candidate?.(e), s = q(() => (e) => {
|
|
1686
1686
|
let t = [];
|
|
1687
1687
|
return e.source && t.push({
|
|
1688
1688
|
title: a.t("ai.entityRef.candidate.source"),
|
|
@@ -1746,10 +1746,10 @@ var xi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1746
1746
|
}));
|
|
1747
1747
|
xi.displayName = "ExpenseTrigger";
|
|
1748
1748
|
function Si({ id: e, label: n }) {
|
|
1749
|
-
let { entityRefs: r } =
|
|
1749
|
+
let { entityRefs: r } = P(), i = r?.resolvers?.expense, a = t(), o = r?.urls?.expense?.(e), s = q(() => (e) => ({
|
|
1750
1750
|
avatar: {
|
|
1751
1751
|
type: "icon",
|
|
1752
|
-
icon:
|
|
1752
|
+
icon: st
|
|
1753
1753
|
},
|
|
1754
1754
|
title: e.description || `Expense #${e.id}`,
|
|
1755
1755
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1787,7 +1787,7 @@ var Ci = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1787
1787
|
}));
|
|
1788
1788
|
Ci.displayName = "JobPostingTrigger";
|
|
1789
1789
|
function wi({ id: e, label: n }) {
|
|
1790
|
-
let { entityRefs: r } =
|
|
1790
|
+
let { entityRefs: r } = P(), i = r?.resolvers?.jobPosting, a = t(), o = r?.urls?.jobPosting?.(e), s = q(() => (e) => ({
|
|
1791
1791
|
title: e.title,
|
|
1792
1792
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1793
1793
|
...o && { secondaryActions: {
|
|
@@ -1817,7 +1817,7 @@ function wi({ id: e, label: n }) {
|
|
|
1817
1817
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1818
1818
|
var Ti = "\xA0";
|
|
1819
1819
|
function Ei({ id: e, label: t }) {
|
|
1820
|
-
let { entityRefs: n } =
|
|
1820
|
+
let { entityRefs: n } = P(), r = n?.resolvers?.person, i = n?.urls?.person?.(e);
|
|
1821
1821
|
if (!r) return /* @__PURE__ */ Z("span", {
|
|
1822
1822
|
className: "text-f1-foreground-secondary",
|
|
1823
1823
|
children: ["@", t]
|
|
@@ -1829,7 +1829,7 @@ function Ei({ id: e, label: t }) {
|
|
|
1829
1829
|
resolver: r,
|
|
1830
1830
|
contentClassName: "w-72",
|
|
1831
1831
|
renderCard: (e) => {
|
|
1832
|
-
if (e.status !== "ready") return /* @__PURE__ */ X(
|
|
1832
|
+
if (e.status !== "ready") return /* @__PURE__ */ X(L, {
|
|
1833
1833
|
name: t,
|
|
1834
1834
|
avatar: {
|
|
1835
1835
|
type: "person",
|
|
@@ -1840,7 +1840,7 @@ function Ei({ id: e, label: t }) {
|
|
|
1840
1840
|
profileHref: i
|
|
1841
1841
|
});
|
|
1842
1842
|
let n = e.data;
|
|
1843
|
-
return /* @__PURE__ */ X(
|
|
1843
|
+
return /* @__PURE__ */ X(L, {
|
|
1844
1844
|
name: `${n.firstName} ${n.lastName}`,
|
|
1845
1845
|
avatar: {
|
|
1846
1846
|
type: "person",
|
|
@@ -1884,7 +1884,7 @@ var Oi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1884
1884
|
}));
|
|
1885
1885
|
Oi.displayName = "RequisitionTrigger";
|
|
1886
1886
|
function ki({ id: e, label: n }) {
|
|
1887
|
-
let { entityRefs: r } =
|
|
1887
|
+
let { entityRefs: r } = P(), i = r?.resolvers?.requisition, a = t(), o = r?.urls?.requisition?.(e), s = q(() => (e) => {
|
|
1888
1888
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1889
1889
|
e.status ? {
|
|
1890
1890
|
label: a.t("ai.entityRef.requisition.status"),
|
|
@@ -1952,7 +1952,7 @@ var Ai = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1952
1952
|
}));
|
|
1953
1953
|
Ai.displayName = "VacancyTrigger";
|
|
1954
1954
|
function ji({ id: e, label: n }) {
|
|
1955
|
-
let { entityRefs: r } =
|
|
1955
|
+
let { entityRefs: r } = P(), i = r?.resolvers?.vacancy, a = t(), o = r?.urls?.vacancy?.(e), s = q(() => (e) => ({
|
|
1956
1956
|
title: e.name,
|
|
1957
1957
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1958
1958
|
...o && { secondaryActions: {
|
|
@@ -1997,7 +1997,7 @@ function Pi(e, t) {
|
|
|
1997
1997
|
//#endregion
|
|
1998
1998
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRef.tsx
|
|
1999
1999
|
function Fi({ type: e, id: t, children: n, typed: r = !1 }) {
|
|
2000
|
-
let { entityRefs: i } =
|
|
2000
|
+
let { entityRefs: i } = P(), a = Xr(n), o = r ? /* @__PURE__ */ Z("span", {
|
|
2001
2001
|
className: "text-f1-foreground-secondary",
|
|
2002
2002
|
children: ["@", a]
|
|
2003
2003
|
}) : /* @__PURE__ */ X("span", { children: n });
|
|
@@ -2095,7 +2095,7 @@ var Vi = (e) => typeof e == "object" && !!e, Q = (e) => typeof e == "string" &&
|
|
|
2095
2095
|
return i ? `${r}.${i}` : r;
|
|
2096
2096
|
}
|
|
2097
2097
|
let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
|
|
2098
|
-
return
|
|
2098
|
+
return Pt(r ?? t) || e || "file";
|
|
2099
2099
|
}, Ui = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, Wi = (e, t) => {
|
|
2100
2100
|
let n = Q(e.data), r = Q(e.url) ?? (n ? Ui(n, t) : void 0);
|
|
2101
2101
|
if (!r) return null;
|
|
@@ -2146,11 +2146,11 @@ var Vi = (e) => typeof e == "object" && !!e, Q = (e) => typeof e == "string" &&
|
|
|
2146
2146
|
if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
|
|
2147
2147
|
}, Qi = (e, { urlFor: t } = {}) => ({
|
|
2148
2148
|
url: e.url ?? t?.(e.path) ?? e.path,
|
|
2149
|
-
name: e.displayName ||
|
|
2149
|
+
name: e.displayName || Pt(e.path),
|
|
2150
2150
|
mimeType: e.mimeType,
|
|
2151
2151
|
size: e.bytes,
|
|
2152
2152
|
previewUrl: e.preview ? t?.(e.preview.path) ?? e.preview.url : void 0
|
|
2153
|
-
}), $i = (e) =>
|
|
2153
|
+
}), $i = (e) => D(e) ?? "", ea = Mn(!1), ta = () => Ln(ea), na = (e, t) => {
|
|
2154
2154
|
let [n, r] = Y(() => t ? null : new Set(e));
|
|
2155
2155
|
return t && n !== null ? r(null) : !t && n === null && r(new Set(e)), (e) => e !== void 0 && n !== null && !n.has(e);
|
|
2156
2156
|
}, ra = kn.settleMs, ia = 1e3, aa = 2, oa = "data-ai-anchor", sa = "data-turn-index", ca = (e) => {
|
|
@@ -2460,7 +2460,7 @@ function Fa(e) {
|
|
|
2460
2460
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
2461
2461
|
}
|
|
2462
2462
|
function Ia(e) {
|
|
2463
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
2463
|
+
let { days: t, hours: n, minutes: r, seconds: i } = ct(e), a = [];
|
|
2464
2464
|
return t > 0 && a.push(`${t}d`), n > 0 && a.push(`${n}h`), r > 0 && a.push(`${r}m`), (i > 0 || a.length === 0) && a.push(`${i}s`), a.join(" ");
|
|
2465
2465
|
}
|
|
2466
2466
|
function La(e) {
|
|
@@ -2535,7 +2535,7 @@ function Ba(e, t) {
|
|
|
2535
2535
|
};
|
|
2536
2536
|
}
|
|
2537
2537
|
function Va({ formName: e, formDescription: t, module: n, cardTitle: r, cardDescription: i, fieldDescriptions: a, formValues: o, valueFormatter: s }) {
|
|
2538
|
-
let { canvasContent: c, openCanvas: l, dismissCanvas: u } =
|
|
2538
|
+
let { canvasContent: c, openCanvas: l, dismissCanvas: u } = P(), d = ka(e), f = s ?? d, p = J(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
2539
2539
|
type: "form",
|
|
2540
2540
|
title: m,
|
|
2541
2541
|
description: h,
|
|
@@ -2579,7 +2579,7 @@ function Va({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
2579
2579
|
},
|
|
2580
2580
|
children: y.length > 0 && !g ? /* @__PURE__ */ X("div", {
|
|
2581
2581
|
className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
|
|
2582
|
-
children: /* @__PURE__ */ X(
|
|
2582
|
+
children: /* @__PURE__ */ X(ge, {
|
|
2583
2583
|
details: y.map((e) => ({
|
|
2584
2584
|
title: e.label,
|
|
2585
2585
|
content: e.content,
|
|
@@ -2596,7 +2596,7 @@ Va.displayName = "FormCard";
|
|
|
2596
2596
|
//#endregion
|
|
2597
2597
|
//#region src/addons/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
2598
2598
|
function Ha() {
|
|
2599
|
-
let e =
|
|
2599
|
+
let e = y(), t = e?.activeForm;
|
|
2600
2600
|
if (!t) return null;
|
|
2601
2601
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
2602
2602
|
return !n || !r || !i ? null : /* @__PURE__ */ X("div", {
|
|
@@ -2615,9 +2615,9 @@ function Ha() {
|
|
|
2615
2615
|
//#endregion
|
|
2616
2616
|
//#region src/addons/ai/F0AiFileAttachments/components/FileCanvasCards.tsx
|
|
2617
2617
|
var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile: t, onCanvasUnavailable: n }) => {
|
|
2618
|
-
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } =
|
|
2618
|
+
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } = P(), s = w(), c = ta(), l = e.map((e) => e.file), u = (r, { fallback: a = !0 } = {}) => {
|
|
2619
2619
|
let o = e[r];
|
|
2620
|
-
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(
|
|
2620
|
+
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(Xe({
|
|
2621
2621
|
files: l,
|
|
2622
2622
|
index: r,
|
|
2623
2623
|
config: s
|
|
@@ -2637,7 +2637,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2637
2637
|
className: "flex w-full max-w-sm flex-col gap-2",
|
|
2638
2638
|
"data-testid": "ai-chat-file-canvas-cards",
|
|
2639
2639
|
children: e.map(({ file: e }, t) => {
|
|
2640
|
-
let n =
|
|
2640
|
+
let n = jt(r, e.url);
|
|
2641
2641
|
return /* @__PURE__ */ X("div", {
|
|
2642
2642
|
"data-active": n || void 0,
|
|
2643
2643
|
"data-testid": "ai-chat-file-canvas-card",
|
|
@@ -2651,7 +2651,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2651
2651
|
}
|
|
2652
2652
|
},
|
|
2653
2653
|
title: e.name,
|
|
2654
|
-
description: e.size ?
|
|
2654
|
+
description: e.size ? Te(e.size) : rt(e.name, $i(e)),
|
|
2655
2655
|
isActive: n,
|
|
2656
2656
|
action: {
|
|
2657
2657
|
type: "open",
|
|
@@ -2663,8 +2663,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2663
2663
|
})
|
|
2664
2664
|
});
|
|
2665
2665
|
}, Ka = "rounded-xl", qa = "ai-chat", Ja = (e) => {
|
|
2666
|
-
let { provided: t } =
|
|
2667
|
-
return t ? /* @__PURE__ */ X(Za, { ...e }) : /* @__PURE__ */ X(
|
|
2666
|
+
let { provided: t } = Mt();
|
|
2667
|
+
return t ? /* @__PURE__ */ X(Za, { ...e }) : /* @__PURE__ */ X(bt, { children: /* @__PURE__ */ X(Za, { ...e }) });
|
|
2668
2668
|
}, Ya = {
|
|
2669
2669
|
image: 0,
|
|
2670
2670
|
video: 1,
|
|
@@ -2672,11 +2672,11 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2672
2672
|
audio: 3,
|
|
2673
2673
|
file: 4
|
|
2674
2674
|
}, Xa = (e) => e.bucket === "image" || e.bucket === "video" || e.bucket === "audio" || e.bucket === "document" ? e.bucket : "file", Za = ({ files: e, align: t = "start", onOpenFile: n, onFileDownloaded: r, size: i = "default", opensIn: a }) => {
|
|
2675
|
-
let { remotePreviews: o } =
|
|
2675
|
+
let { remotePreviews: o } = Mt(), s = Ie(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = Y(() => /* @__PURE__ */ new Set()), d = q(() => Qa(e, o, l), [
|
|
2676
2676
|
e,
|
|
2677
2677
|
o,
|
|
2678
2678
|
l
|
|
2679
|
-
]), f = q(() => i === "compact" ? d : [...d].sort((e, t) => Ya[e.cls.bucket] - Ya[t.cls.bucket]), [d, i]), p =
|
|
2679
|
+
]), f = q(() => i === "compact" ? d : [...d].sort((e, t) => Ya[e.cls.bucket] - Ya[t.cls.bucket]), [d, i]), p = B(f, "transcript");
|
|
2680
2680
|
return e.length === 0 ? null : X(i === "compact" ? to : eo, {
|
|
2681
2681
|
entries: d,
|
|
2682
2682
|
canvas: c,
|
|
@@ -2689,12 +2689,12 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2689
2689
|
onImageError: (e) => u((t) => new Set(t).add(e.url))
|
|
2690
2690
|
});
|
|
2691
2691
|
}, Qa = (e, t, n) => e.map((e, r) => {
|
|
2692
|
-
let i =
|
|
2692
|
+
let i = Je(e), a = !(t || je(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
|
|
2693
2693
|
return {
|
|
2694
2694
|
file: e,
|
|
2695
2695
|
cls: i,
|
|
2696
2696
|
generic: a,
|
|
2697
|
-
item: a ? null :
|
|
2697
|
+
item: a ? null : Ct(e, lt(r, e.url))
|
|
2698
2698
|
};
|
|
2699
2699
|
}), $a = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ X("div", {
|
|
2700
2700
|
className: i("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
@@ -2726,8 +2726,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2726
2726
|
}) : null,
|
|
2727
2727
|
c.map((e, t) => {
|
|
2728
2728
|
let { file: n, cls: r } = e, i = `${n.name}-${t}`;
|
|
2729
|
-
return r.bucket === "video" ? /* @__PURE__ */ X(
|
|
2730
|
-
file:
|
|
2729
|
+
return r.bucket === "video" ? /* @__PURE__ */ X(Lt, {
|
|
2730
|
+
file: ve(n),
|
|
2731
2731
|
cornerClass: "rounded-xl",
|
|
2732
2732
|
testIdPrefix: qa,
|
|
2733
2733
|
onDownloaded: () => s?.(n)
|
|
@@ -2735,8 +2735,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2735
2735
|
}),
|
|
2736
2736
|
f || t ? null : d.map((e, t) => {
|
|
2737
2737
|
let { file: n, cls: i } = e;
|
|
2738
|
-
return i.bucket === "document" ? /* @__PURE__ */ X(
|
|
2739
|
-
file:
|
|
2738
|
+
return i.bucket === "document" ? /* @__PURE__ */ X(St, {
|
|
2739
|
+
file: ve(n),
|
|
2740
2740
|
kind: i.kind,
|
|
2741
2741
|
cornerClass: "rounded-xl",
|
|
2742
2742
|
testIdPrefix: qa,
|
|
@@ -2748,8 +2748,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2748
2748
|
onDownloaded: () => s?.(n)
|
|
2749
2749
|
}, `${n.name}-${t}`) : null;
|
|
2750
2750
|
}),
|
|
2751
|
-
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(
|
|
2752
|
-
file:
|
|
2751
|
+
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(k, {
|
|
2752
|
+
file: ve(e.file),
|
|
2753
2753
|
testIdPrefix: qa,
|
|
2754
2754
|
onDownloaded: () => s?.(e.file)
|
|
2755
2755
|
}, `${e.file.name}-${t}`) : null),
|
|
@@ -2759,8 +2759,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2759
2759
|
"data-testid": f ? `${qa}-file-shelf` : void 0,
|
|
2760
2760
|
children: [g.length > 0 ? g.map((e, t) => {
|
|
2761
2761
|
let { file: n, cls: i } = e;
|
|
2762
|
-
return i.bucket === "document" ? /* @__PURE__ */ X(
|
|
2763
|
-
file:
|
|
2762
|
+
return i.bucket === "document" ? /* @__PURE__ */ X(St, {
|
|
2763
|
+
file: ve(n),
|
|
2764
2764
|
kind: i.kind,
|
|
2765
2765
|
cornerClass: "rounded-xl",
|
|
2766
2766
|
compact: !0,
|
|
@@ -2795,12 +2795,12 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2795
2795
|
}, c) : s.bucket === "video" ? /* @__PURE__ */ X(ao, {
|
|
2796
2796
|
file: i,
|
|
2797
2797
|
onOpen: () => n(e)
|
|
2798
|
-
}, c) : s.bucket === "audio" ? /* @__PURE__ */ X(
|
|
2799
|
-
file:
|
|
2798
|
+
}, c) : s.bucket === "audio" ? /* @__PURE__ */ X(O, {
|
|
2799
|
+
file: ve(i),
|
|
2800
2800
|
testIdPrefix: qa,
|
|
2801
2801
|
onOpen: () => n(e)
|
|
2802
|
-
}, c) : s.bucket === "document" ? /* @__PURE__ */ X(
|
|
2803
|
-
file:
|
|
2802
|
+
}, c) : s.bucket === "document" ? /* @__PURE__ */ X(St, {
|
|
2803
|
+
file: ve(i),
|
|
2804
2804
|
kind: s.kind,
|
|
2805
2805
|
cornerClass: "rounded-xl",
|
|
2806
2806
|
compact: !0,
|
|
@@ -2814,32 +2814,32 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2814
2814
|
})
|
|
2815
2815
|
})
|
|
2816
2816
|
}), no = ({ file: e, onFileDownloaded: n }) => {
|
|
2817
|
-
let r = t(), i =
|
|
2818
|
-
return /* @__PURE__ */ X(
|
|
2817
|
+
let r = t(), i = A(), a = $i(e);
|
|
2818
|
+
return /* @__PURE__ */ X($e, {
|
|
2819
2819
|
file: {
|
|
2820
2820
|
...e,
|
|
2821
2821
|
mimeType: a
|
|
2822
2822
|
},
|
|
2823
|
-
icon: a === "application/zip" ?
|
|
2823
|
+
icon: a === "application/zip" ? I : void 0,
|
|
2824
2824
|
testId: `${qa}-file-tile`,
|
|
2825
2825
|
action: {
|
|
2826
2826
|
label: r.t("chat.downloadNamedFile", { name: e.name }),
|
|
2827
|
-
icon:
|
|
2827
|
+
icon: Tt,
|
|
2828
2828
|
onClick: () => {
|
|
2829
2829
|
i(e.url, e.name), n?.(e);
|
|
2830
2830
|
}
|
|
2831
2831
|
}
|
|
2832
2832
|
});
|
|
2833
2833
|
}, ro = "relative box-border h-[132px] w-[168px] shrink-0 overflow-hidden rounded-xl border border-solid border-f1-border-secondary bg-f1-background-secondary p-0 transition-opacity hover:opacity-90", io = ({ file: e, onOpen: n, onError: r }) => {
|
|
2834
|
-
let o = t(), s =
|
|
2835
|
-
return
|
|
2834
|
+
let o = t(), s = F(e.thumbnailUrl ?? e.url);
|
|
2835
|
+
return se(s.status, r), /* @__PURE__ */ X("button", {
|
|
2836
2836
|
type: "button",
|
|
2837
2837
|
onClick: n,
|
|
2838
2838
|
draggable: !1,
|
|
2839
2839
|
"aria-label": o.t("chat.openNamedDocument", { name: e.name }),
|
|
2840
2840
|
className: i(ro, a()),
|
|
2841
2841
|
"data-testid": "ai-chat-image-attachment",
|
|
2842
|
-
children: s.status === "ready" ? /* @__PURE__ */ X(
|
|
2842
|
+
children: s.status === "ready" ? /* @__PURE__ */ X(pt, {
|
|
2843
2843
|
src: s.url,
|
|
2844
2844
|
alt: e.name,
|
|
2845
2845
|
draggable: !1,
|
|
@@ -2848,31 +2848,31 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2848
2848
|
}) : null
|
|
2849
2849
|
});
|
|
2850
2850
|
}, ao = ({ file: e, onOpen: n }) => {
|
|
2851
|
-
let r = t(), { urlCache: o } =
|
|
2851
|
+
let r = t(), { urlCache: o } = w(), s = F(e.thumbnailUrl), c = !e.thumbnailUrl && o === null, [l, u] = Y(!1);
|
|
2852
2852
|
return /* @__PURE__ */ Z("button", {
|
|
2853
2853
|
type: "button",
|
|
2854
2854
|
onClick: n,
|
|
2855
2855
|
"aria-label": r.t("chat.videoPlayerLabel", { name: e.name }),
|
|
2856
2856
|
className: i(ro, a()),
|
|
2857
2857
|
"data-testid": "ai-chat-video-attachment",
|
|
2858
|
-
children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ X(
|
|
2858
|
+
children: [!l && (s.status === "ready" || c) ? /* @__PURE__ */ X(tt, {
|
|
2859
2859
|
url: e.url,
|
|
2860
2860
|
posterUrl: s.status === "ready" ? s.url : void 0,
|
|
2861
2861
|
onError: () => u(!0)
|
|
2862
2862
|
}) : null, /* @__PURE__ */ X(v, {})]
|
|
2863
2863
|
});
|
|
2864
2864
|
}, oo = ({ images: e, onOpen: n, onImageError: r }) => {
|
|
2865
|
-
let a = t(), o = e.length === 1 ? e[0] : void 0, s =
|
|
2865
|
+
let a = t(), o = e.length === 1 ? e[0] : void 0, s = F(o ? o.thumbnailUrl ?? o.url : void 0), c = Bt(o && s.status === "ready" ? s.url : void 0, o) ?? void 0, l = o ? qe(c?.width, c?.height) : null;
|
|
2866
2866
|
return /* @__PURE__ */ X("div", {
|
|
2867
2867
|
style: l ? { width: l.width } : void 0,
|
|
2868
|
-
className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" :
|
|
2868
|
+
className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : Ke, At, Ka),
|
|
2869
2869
|
"data-testid": "ai-chat-image-album",
|
|
2870
|
-
children:
|
|
2870
|
+
children: Ut(c ? [c] : e).map((t, o, s) => {
|
|
2871
2871
|
let c = e[t.index];
|
|
2872
2872
|
if (!c) return null;
|
|
2873
2873
|
let l = o === s.length - 1;
|
|
2874
|
-
return /* @__PURE__ */ X(
|
|
2875
|
-
image:
|
|
2874
|
+
return /* @__PURE__ */ X(De, {
|
|
2875
|
+
image: te(c),
|
|
2876
2876
|
aspectRatio: t.aspectRatio,
|
|
2877
2877
|
spanFull: t.span === 2,
|
|
2878
2878
|
inset: t.inset,
|
|
@@ -2888,7 +2888,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2888
2888
|
testIdPrefix: qa,
|
|
2889
2889
|
overlay: t.hiddenCount > 0 ? /* @__PURE__ */ X("span", {
|
|
2890
2890
|
"aria-hidden": !0,
|
|
2891
|
-
className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse",
|
|
2891
|
+
className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", xt),
|
|
2892
2892
|
"data-testid": "ai-chat-image-album-more",
|
|
2893
2893
|
children: `+${t.hiddenCount}`
|
|
2894
2894
|
}) : void 0
|
|
@@ -2967,7 +2967,7 @@ function mo({ anchor: e, onReply: n }) {
|
|
|
2967
2967
|
type: "button",
|
|
2968
2968
|
variant: "ghost",
|
|
2969
2969
|
label: c,
|
|
2970
|
-
icon:
|
|
2970
|
+
icon: ue,
|
|
2971
2971
|
onClick: () => {
|
|
2972
2972
|
n(e.text);
|
|
2973
2973
|
}
|
|
@@ -2976,7 +2976,7 @@ function mo({ anchor: e, onReply: n }) {
|
|
|
2976
2976
|
}
|
|
2977
2977
|
//#endregion
|
|
2978
2978
|
//#region src/addons/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2979
|
-
var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(
|
|
2979
|
+
var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(ht, {
|
|
2980
2980
|
content: e,
|
|
2981
2981
|
format: "markdown"
|
|
2982
2982
|
}), vo = ({ isGenerating: e, isLoading: t, isLive: n = !1, message: r, renderToolCall: i, onReplyQuote: a, onRendered: o, renderMarkdown: s }) => {
|
|
@@ -3041,7 +3041,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3041
3041
|
return document.addEventListener("keydown", e), () => {
|
|
3042
3042
|
document.removeEventListener("keydown", e);
|
|
3043
3043
|
};
|
|
3044
|
-
}, [d]), /* @__PURE__ */ X(
|
|
3044
|
+
}, [d]), /* @__PURE__ */ X(Gt, {
|
|
3045
3045
|
position: "center",
|
|
3046
3046
|
isOpen: !0,
|
|
3047
3047
|
onClose: f,
|
|
@@ -3058,7 +3058,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3058
3058
|
},
|
|
3059
3059
|
children: /* @__PURE__ */ X("div", {
|
|
3060
3060
|
className: "flex flex-col gap-6",
|
|
3061
|
-
children: /* @__PURE__ */ X(
|
|
3061
|
+
children: /* @__PURE__ */ X(yt, {
|
|
3062
3062
|
autoFocus: !0,
|
|
3063
3063
|
label: l,
|
|
3064
3064
|
placeholder: u,
|
|
@@ -3074,7 +3074,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3074
3074
|
return /* @__PURE__ */ Z("div", {
|
|
3075
3075
|
className: i("-ml-2 -mt-1 flex items-center", !a && f === null && "opacity-0 transition-opacity duration-150 focus-within:opacity-100 group-hover/turn:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100"),
|
|
3076
3076
|
children: [
|
|
3077
|
-
/* @__PURE__ */ X(
|
|
3077
|
+
/* @__PURE__ */ X(_e, {
|
|
3078
3078
|
size: "md",
|
|
3079
3079
|
variant: "ghost",
|
|
3080
3080
|
valueToCopy: e,
|
|
@@ -3095,7 +3095,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3095
3095
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3096
3096
|
children: /* @__PURE__ */ X(U, {
|
|
3097
3097
|
size: "md",
|
|
3098
|
-
icon: f === "like" ?
|
|
3098
|
+
icon: f === "like" ? gt : x,
|
|
3099
3099
|
color: "default"
|
|
3100
3100
|
})
|
|
3101
3101
|
})
|
|
@@ -3113,7 +3113,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3113
3113
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3114
3114
|
children: /* @__PURE__ */ X(U, {
|
|
3115
3115
|
size: "md",
|
|
3116
|
-
icon: f === "dislike" ?
|
|
3116
|
+
icon: f === "dislike" ? mt : fe,
|
|
3117
3117
|
color: "default"
|
|
3118
3118
|
})
|
|
3119
3119
|
})
|
|
@@ -3130,7 +3130,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(D, {
|
|
|
3130
3130
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3131
3131
|
children: /* @__PURE__ */ X(U, {
|
|
3132
3132
|
size: "md",
|
|
3133
|
-
icon:
|
|
3133
|
+
icon: ft,
|
|
3134
3134
|
color: "default"
|
|
3135
3135
|
})
|
|
3136
3136
|
})
|
|
@@ -3191,11 +3191,11 @@ function xo() {
|
|
|
3191
3191
|
//#region src/addons/ai/F0AiMessagesContainer/components/rail.ts
|
|
3192
3192
|
var So = "-ml-1 flex w-5 shrink-0 flex-col items-center", Co = "w-px shrink-0 bg-f1-border-secondary", wo = ({ icon: e, title: t, children: n, open: r, onOpenChange: a, disabled: o = !1 }) => {
|
|
3193
3193
|
let s = p();
|
|
3194
|
-
return /* @__PURE__ */ Z(
|
|
3194
|
+
return /* @__PURE__ */ Z(Ot, {
|
|
3195
3195
|
className: "mb-1 w-full",
|
|
3196
3196
|
open: r,
|
|
3197
3197
|
onOpenChange: a,
|
|
3198
|
-
children: [/* @__PURE__ */ Z(
|
|
3198
|
+
children: [/* @__PURE__ */ Z(vt, {
|
|
3199
3199
|
disabled: o,
|
|
3200
3200
|
className: i("group/rail flex w-full items-start gap-1.5 text-left text-base text-f1-foreground-secondary", !o && "transition-colors duration-150 hover:text-f1-foreground"),
|
|
3201
3201
|
children: [e ? /* @__PURE__ */ X("span", {
|
|
@@ -3212,7 +3212,7 @@ var So = "-ml-1 flex w-5 shrink-0 flex-col items-center", Co = "w-px shrink-0 bg
|
|
|
3212
3212
|
})
|
|
3213
3213
|
})] })
|
|
3214
3214
|
})]
|
|
3215
|
-
}), /* @__PURE__ */ X(
|
|
3215
|
+
}), /* @__PURE__ */ X(Ze, {
|
|
3216
3216
|
forceMount: !0,
|
|
3217
3217
|
className: "data-[state=open]:mt-1.5",
|
|
3218
3218
|
children: /* @__PURE__ */ X(c.div, {
|
|
@@ -3246,11 +3246,11 @@ function To({ step: e, last: t }) {
|
|
|
3246
3246
|
className: "flex gap-1.5",
|
|
3247
3247
|
children: [/* @__PURE__ */ Z("span", {
|
|
3248
3248
|
className: i(So, "pt-0.5"),
|
|
3249
|
-
children: [n ? /* @__PURE__ */ X(
|
|
3249
|
+
children: [n ? /* @__PURE__ */ X(Re, {
|
|
3250
3250
|
variant: "thinking",
|
|
3251
3251
|
size: 15
|
|
3252
3252
|
}) : /* @__PURE__ */ X(U, {
|
|
3253
|
-
icon:
|
|
3253
|
+
icon: Ve,
|
|
3254
3254
|
size: "sm",
|
|
3255
3255
|
color: "secondary"
|
|
3256
3256
|
}), t ? null : /* @__PURE__ */ X("span", {
|
|
@@ -3330,7 +3330,7 @@ var jo = (e, t) => {
|
|
|
3330
3330
|
function Mo({ titles: e, isThinking: t, startedAt: n }) {
|
|
3331
3331
|
let [r, a] = Y(!1), o = jo(e, t), s = o.length > 0, c = r && s, l = t && !c;
|
|
3332
3332
|
return /* @__PURE__ */ X(wo, {
|
|
3333
|
-
icon: l ? /* @__PURE__ */ X(
|
|
3333
|
+
icon: l ? /* @__PURE__ */ X(Re, {
|
|
3334
3334
|
variant: "thinking",
|
|
3335
3335
|
size: 15
|
|
3336
3336
|
}) : null,
|
|
@@ -3372,12 +3372,12 @@ function Po({ turn: e }) {
|
|
|
3372
3372
|
className: "flex items-start gap-1.5 text-f1-foreground-secondary",
|
|
3373
3373
|
children: [/* @__PURE__ */ X("span", {
|
|
3374
3374
|
className: i(So, "h-5 justify-center"),
|
|
3375
|
-
children: /* @__PURE__ */ X(
|
|
3375
|
+
children: /* @__PURE__ */ X(Re, {
|
|
3376
3376
|
variant: r,
|
|
3377
3377
|
size: 15
|
|
3378
3378
|
})
|
|
3379
3379
|
}), e.status === "asking" ? /* @__PURE__ */ X("p", {
|
|
3380
|
-
className: i("text-pretty leading-5",
|
|
3380
|
+
className: i("text-pretty leading-5", le),
|
|
3381
3381
|
children: n.ai.askingQuestions
|
|
3382
3382
|
}) : null]
|
|
3383
3383
|
}) : null;
|
|
@@ -3424,7 +3424,7 @@ function Ro({ children: e }) {
|
|
|
3424
3424
|
display: "flex",
|
|
3425
3425
|
height: "5",
|
|
3426
3426
|
alignItems: "center",
|
|
3427
|
-
children: /* @__PURE__ */ X(U, { icon:
|
|
3427
|
+
children: /* @__PURE__ */ X(U, { icon: M })
|
|
3428
3428
|
}), /* @__PURE__ */ Z("div", {
|
|
3429
3429
|
className: "min-w-0 whitespace-pre-wrap text-base leading-5 [overflow-wrap:anywhere] [&>div]:flex [&>div]:flex-col [&>div]:gap-1 [&_p]:m-0",
|
|
3430
3430
|
children: [/* @__PURE__ */ X("span", {
|
|
@@ -3478,7 +3478,7 @@ function Vo(e) {
|
|
|
3478
3478
|
}
|
|
3479
3479
|
//#endregion
|
|
3480
3480
|
//#region src/addons/ai/F0AiMessagesContainer/components/UserMessage.tsx
|
|
3481
|
-
var Ho = (e) => /* @__PURE__ */ X(
|
|
3481
|
+
var Ho = (e) => /* @__PURE__ */ X(ht, {
|
|
3482
3482
|
content: e,
|
|
3483
3483
|
format: "markdown"
|
|
3484
3484
|
}), Uo = /[.,:;!?*_~]/, Wo = (e, t) => e.split(t).length - 1, Go = (e) => {
|
|
@@ -3496,9 +3496,9 @@ var Ho = (e) => /* @__PURE__ */ X(D, {
|
|
|
3496
3496
|
target: "_blank",
|
|
3497
3497
|
children: r
|
|
3498
3498
|
}), e.slice(n)] }, t);
|
|
3499
|
-
}, qo = (e, t) =>
|
|
3499
|
+
}, qo = (e, t) => xe(e).map((e, n) => n % 2 == 1 ? Ko(e, `${t}-${n}`) : e), Jo = (e) => /* @__PURE__ */ X("p", {
|
|
3500
3500
|
className: "m-0",
|
|
3501
|
-
children:
|
|
3501
|
+
children: pe(e).map((e, t) => e.kind === "text" ? qo(e.text, t) : /* @__PURE__ */ X(Fi, {
|
|
3502
3502
|
type: e.type,
|
|
3503
3503
|
id: e.id,
|
|
3504
3504
|
typed: !0,
|
|
@@ -3509,7 +3509,7 @@ function Xo({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3509
3509
|
let s = Vo(a), c = J(null), l = e?.content, u = e?.rawData, d = q(() => Xi({
|
|
3510
3510
|
content: l,
|
|
3511
3511
|
rawData: u
|
|
3512
|
-
}), [l, u]), f = (Zi(l, "user") ?? "").trim(), p = e?.presentation, m = p?.kind === "notice", h = p?.kind === "answers" && p.questions.length > 0 ? p.questions : null, g = h !== null || f.length > 0, _ = t(), v = h ? h.map(({ question: e, answers: t }) => `${e}\n${Fo(t, _.ai.clarifyingQuestion.skipped)}`).join("\n\n") :
|
|
3512
|
+
}), [l, u]), f = (Zi(l, "user") ?? "").trim(), p = e?.presentation, m = p?.kind === "notice", h = p?.kind === "answers" && p.questions.length > 0 ? p.questions : null, g = h !== null || f.length > 0, _ = t(), v = h ? h.map(({ question: e, answers: t }) => `${e}\n${Fo(t, _.ai.clarifyingQuestion.skipped)}`).join("\n\n") : S(f), { anchor: y, clear: b } = uo({
|
|
3513
3513
|
containerRef: c,
|
|
3514
3514
|
enabled: g && !m
|
|
3515
3515
|
});
|
|
@@ -3521,7 +3521,7 @@ function Xo({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3521
3521
|
children: f
|
|
3522
3522
|
})
|
|
3523
3523
|
});
|
|
3524
|
-
let
|
|
3524
|
+
let x = o ?? Yo(f), C = o ?? Ho;
|
|
3525
3525
|
return /* @__PURE__ */ Z("div", {
|
|
3526
3526
|
ref: s,
|
|
3527
3527
|
className: "group/user-message my-4 flex w-full flex-col items-end gap-2 first:mt-0 last:mb-0",
|
|
@@ -3544,10 +3544,10 @@ function Xo({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3544
3544
|
children: [/* @__PURE__ */ X("div", {
|
|
3545
3545
|
ref: c,
|
|
3546
3546
|
className: "whitespace-pre-wrap rounded-xl [overflow-wrap:anywhere] bg-f1-background-tertiary px-4 py-3 [&>div]:flex [&>div]:flex-col [&>div]:gap-3",
|
|
3547
|
-
children: h ? /* @__PURE__ */ X(Lo, { questions: h }) :
|
|
3547
|
+
children: h ? /* @__PURE__ */ X(Lo, { questions: h }) : x(f)
|
|
3548
3548
|
}), /* @__PURE__ */ X("div", {
|
|
3549
3549
|
className: i("absolute bottom-0 right-full mr-1 flex", "opacity-0 transition-opacity duration-150 focus-within:opacity-100 group-hover/user-message:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100"),
|
|
3550
|
-
children: /* @__PURE__ */ X(
|
|
3550
|
+
children: /* @__PURE__ */ X(_e, {
|
|
3551
3551
|
size: "md",
|
|
3552
3552
|
variant: "ghost",
|
|
3553
3553
|
valueToCopy: v,
|
|
@@ -3586,7 +3586,7 @@ function Zo({ phrase: e, caption: t, onClick: n }) {
|
|
|
3586
3586
|
//#endregion
|
|
3587
3587
|
//#region src/addons/ai/F0AiChat/providers/useWelcomeRound.ts
|
|
3588
3588
|
var Qo = () => {
|
|
3589
|
-
let e = Ln(
|
|
3589
|
+
let e = Ln(z), [t] = Y(() => e?.nextRound ?? 0), n = e?.claimRound;
|
|
3590
3590
|
return K(function() {
|
|
3591
3591
|
n?.(t);
|
|
3592
3592
|
}, [n, t]), t;
|
|
@@ -3595,7 +3595,7 @@ var Qo = () => {
|
|
|
3595
3595
|
return () => t(null);
|
|
3596
3596
|
}, [e, t]);
|
|
3597
3597
|
}, es = ({ onItemClick: e, onItemHover: t }) => {
|
|
3598
|
-
let { preview: n, pick: r } =
|
|
3598
|
+
let { preview: n, pick: r } = re({ onItemClick: e }), i = _((e) => t?.(e));
|
|
3599
3599
|
return {
|
|
3600
3600
|
preview: G((e) => {
|
|
3601
3601
|
n(e), i(e);
|
|
@@ -3663,7 +3663,7 @@ function cs({ prompts: { suggestions: e, onItemClick: t, onItemHover: n }, round
|
|
|
3663
3663
|
flexDirection: "column",
|
|
3664
3664
|
gap: "md",
|
|
3665
3665
|
width: "full",
|
|
3666
|
-
children: o.map(({ item: e, group: t, onOverflowChange: n }, r) => /* @__PURE__ */ X(
|
|
3666
|
+
children: o.map(({ item: e, group: t, onOverflowChange: n }, r) => /* @__PURE__ */ X(Dt, {
|
|
3667
3667
|
label: e.title,
|
|
3668
3668
|
icon: t.icon,
|
|
3669
3669
|
onClick: () => a(e, t),
|
|
@@ -3733,21 +3733,21 @@ var ds = {
|
|
|
3733
3733
|
onThumbsDown: () => {}
|
|
3734
3734
|
}, fs = (e) => e?.status === "working" || e?.status === "answering";
|
|
3735
3735
|
function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a, initialMessageCaption: o, initialMessageSubtitle: s, onWelcomeClick: l, welcomePrompts: u, renderToolCall: f, onReplyQuote: p, onAssistantMessageRendered: m, autoScrollUserIntoView: h = !0, renderMarkdown: g, feedback: _, freezeLayout: v = !1, noShadows: y = !1, children: b, AssistantMessage: x, UserMessage: S, onRegenerate: C, onCopy: w }) {
|
|
3736
|
-
let { modal: T, handleSubmit: E, handleClose: D } = Bi(_ ?? ds), O = t(), ee = x ?? vo, te = S ?? Xo,
|
|
3737
|
-
viewportRef:
|
|
3738
|
-
contentRef:
|
|
3739
|
-
lastTurnRef:
|
|
3736
|
+
let { modal: T, handleSubmit: E, handleClose: D } = Bi(_ ?? ds), O = t(), ee = x ?? vo, te = S ?? Xo, ne = a ?? O.ai.defaultInitialMessage, k = !n && e.length === 0 && ne !== "", A = J(null), j = J(null), M = J(null), re = J(null), { showScrollBtn: N, scrolledFromTop: ie, turnMinHeight: ae, scrollToBottom: oe } = Ca({
|
|
3737
|
+
viewportRef: A,
|
|
3738
|
+
contentRef: j,
|
|
3739
|
+
lastTurnRef: re,
|
|
3740
3740
|
turnsCount: e.length,
|
|
3741
3741
|
isLoadingThread: n,
|
|
3742
3742
|
lastTurnInProgress: fs(e.at(-1)),
|
|
3743
3743
|
freezeTurnMinHeight: v
|
|
3744
3744
|
});
|
|
3745
3745
|
da({
|
|
3746
|
-
viewportRef:
|
|
3747
|
-
contentRef:
|
|
3746
|
+
viewportRef: A,
|
|
3747
|
+
contentRef: j
|
|
3748
3748
|
});
|
|
3749
|
-
let
|
|
3750
|
-
let r = n === e.length - 1, i = fs(t), a = r &&
|
|
3749
|
+
let se = e[e.length - 1], ce = se?.status === "working", le = fa(ce), ue = se?.status === "asking" ? O.ai.askingQuestions : ce ? se.thinking?.titles.at(-1) ?? O.ai.thinkingNow : "", P = na(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), de = (t, n) => {
|
|
3750
|
+
let r = n === e.length - 1, i = fs(t), a = r && ce, o = t.thinking ?? (a ? { titles: [] } : null), s = t.assistantMessages.some(ms), c = {
|
|
3751
3751
|
renderToolCall: f,
|
|
3752
3752
|
onReplyQuote: p,
|
|
3753
3753
|
onRendered: m,
|
|
@@ -3783,15 +3783,15 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3783
3783
|
return /* @__PURE__ */ X(ee, {
|
|
3784
3784
|
...l,
|
|
3785
3785
|
isGenerating: i && o,
|
|
3786
|
-
isLive: i ||
|
|
3786
|
+
isLive: i || P(e.id),
|
|
3787
3787
|
isLoading: i && o && !ms(e)
|
|
3788
3788
|
}, `${n}-a-${a}`);
|
|
3789
3789
|
};
|
|
3790
3790
|
return /* @__PURE__ */ Z("div", {
|
|
3791
|
-
ref: r ?
|
|
3791
|
+
ref: r ? re : void 0,
|
|
3792
3792
|
className: "group/turn flex flex-col items-start justify-start gap-2 px-1",
|
|
3793
3793
|
[sa]: n,
|
|
3794
|
-
style: { minHeight: r &&
|
|
3794
|
+
style: { minHeight: r && ae || void 0 },
|
|
3795
3795
|
children: [
|
|
3796
3796
|
t.userMessages.map((e, t) => l(e, t)),
|
|
3797
3797
|
o || s ? /* @__PURE__ */ X("span", {
|
|
@@ -3801,7 +3801,7 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3801
3801
|
o ? /* @__PURE__ */ X(Mo, {
|
|
3802
3802
|
titles: o.titles,
|
|
3803
3803
|
isThinking: a,
|
|
3804
|
-
startedAt: r ?
|
|
3804
|
+
startedAt: r ? le : null
|
|
3805
3805
|
}) : null,
|
|
3806
3806
|
t.assistantMessages.map((e, t) => u(e, t)),
|
|
3807
3807
|
/* @__PURE__ */ X(Po, { turn: t }),
|
|
@@ -3824,21 +3824,21 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3824
3824
|
/* @__PURE__ */ X("div", {
|
|
3825
3825
|
role: "status",
|
|
3826
3826
|
className: "sr-only",
|
|
3827
|
-
children:
|
|
3827
|
+
children: ue
|
|
3828
3828
|
}),
|
|
3829
3829
|
/* @__PURE__ */ X("div", {
|
|
3830
|
-
ref:
|
|
3830
|
+
ref: A,
|
|
3831
3831
|
className: i("flex-1 overflow-y-scroll [overflow-anchor:none]", "relative", "[mask-image:linear-gradient(to_top,transparent_var(--f0-ai-composer-overlap,0px),#000_var(--f0-ai-composer-overlap,0px))]", "scroll-pb-[var(--f0-ai-composer-overlap,0px)]", "scrollbar-on-hover"),
|
|
3832
3832
|
children: /* @__PURE__ */ Z("div", {
|
|
3833
|
-
ref:
|
|
3834
|
-
className: i("flex min-h-full flex-col items-center px-4 pt-4",
|
|
3833
|
+
ref: j,
|
|
3834
|
+
className: i("flex min-h-full flex-col items-center px-4 pt-4", k ? "pb-[calc(1rem+var(--f0-ai-composer-overlap,0px))]" : "pb-[calc(3rem+var(--f0-ai-composer-overlap,0px))]"),
|
|
3835
3835
|
children: [
|
|
3836
3836
|
/* @__PURE__ */ Z("div", {
|
|
3837
|
-
className: i(
|
|
3837
|
+
className: i(k ? "flex flex-1 px-1" : "flex flex-col gap-6", "w-full max-w-content"),
|
|
3838
3838
|
children: [
|
|
3839
3839
|
n ? /* @__PURE__ */ X(xo, {}) : null,
|
|
3840
|
-
|
|
3841
|
-
phrase:
|
|
3840
|
+
k ? /* @__PURE__ */ X(us, {
|
|
3841
|
+
phrase: ne,
|
|
3842
3842
|
caption: o,
|
|
3843
3843
|
subtitle: s,
|
|
3844
3844
|
prompts: u,
|
|
@@ -3849,7 +3849,7 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3849
3849
|
]
|
|
3850
3850
|
}),
|
|
3851
3851
|
/* @__PURE__ */ X("div", {
|
|
3852
|
-
ref:
|
|
3852
|
+
ref: M,
|
|
3853
3853
|
className: "h-px shrink-0",
|
|
3854
3854
|
"aria-hidden": !0
|
|
3855
3855
|
}),
|
|
@@ -3860,7 +3860,7 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3860
3860
|
]
|
|
3861
3861
|
})
|
|
3862
3862
|
}),
|
|
3863
|
-
/* @__PURE__ */ X(d, { children:
|
|
3863
|
+
/* @__PURE__ */ X(d, { children: N ? /* @__PURE__ */ X(c.div, {
|
|
3864
3864
|
className: "pointer-events-none absolute inset-x-0 bottom-[calc(var(--f0-ai-composer-overlap,0px)+1rem)] z-20 flex justify-center",
|
|
3865
3865
|
initial: {
|
|
3866
3866
|
opacity: 0,
|
|
@@ -3875,12 +3875,12 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3875
3875
|
scale: .8
|
|
3876
3876
|
},
|
|
3877
3877
|
transition: { duration: .2 },
|
|
3878
|
-
children: /* @__PURE__ */ X(
|
|
3878
|
+
children: /* @__PURE__ */ X(me, {
|
|
3879
3879
|
label: O.ai.scrollToBottom,
|
|
3880
|
-
onClick: () =>
|
|
3880
|
+
onClick: () => oe()
|
|
3881
3881
|
})
|
|
3882
3882
|
}) : null }),
|
|
3883
|
-
y ? null : /* @__PURE__ */ X(pa, { visible:
|
|
3883
|
+
y ? null : /* @__PURE__ */ X(pa, { visible: ie })
|
|
3884
3884
|
]
|
|
3885
3885
|
}), T.isOpen ? /* @__PURE__ */ X(yo, {
|
|
3886
3886
|
onSubmit: E,
|
|
@@ -3893,8 +3893,8 @@ var ms = (e) => !!Zi(e.content) || Xi(e).length > 0;
|
|
|
3893
3893
|
//#endregion
|
|
3894
3894
|
//#region src/addons/ai/F0AiMessagesContainer/F0AiMessagesContainer.tsx
|
|
3895
3895
|
function hs(e) {
|
|
3896
|
-
let t =
|
|
3897
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ X(
|
|
3896
|
+
let t = Mt(), n = /* @__PURE__ */ X(Ri, { children: /* @__PURE__ */ X(ps, { ...e }) });
|
|
3897
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ X(bt, {
|
|
3898
3898
|
filePreviews: e.filePreviews,
|
|
3899
3899
|
children: n
|
|
3900
3900
|
}) : n;
|
|
@@ -3916,7 +3916,7 @@ function ys() {
|
|
|
3916
3916
|
//#endregion
|
|
3917
3917
|
//#region src/addons/ai/F0AiChat/providers/useCanvasEntities.ts
|
|
3918
3918
|
function bs() {
|
|
3919
|
-
let { canvasEntities: e } =
|
|
3919
|
+
let { canvasEntities: e } = P();
|
|
3920
3920
|
return e;
|
|
3921
3921
|
}
|
|
3922
3922
|
//#endregion
|
|
@@ -4164,7 +4164,7 @@ var Ds = [
|
|
|
4164
4164
|
onClick: c,
|
|
4165
4165
|
label: l.actions.cancel,
|
|
4166
4166
|
hideLabel: !0,
|
|
4167
|
-
icon:
|
|
4167
|
+
icon: Qe
|
|
4168
4168
|
})
|
|
4169
4169
|
]
|
|
4170
4170
|
});
|
|
@@ -4172,26 +4172,26 @@ var Ds = [
|
|
|
4172
4172
|
clarifyingQuestion: e,
|
|
4173
4173
|
isSubmitDisabled: t
|
|
4174
4174
|
}), Rs = ({ clarifyingQuestion: e, isSubmitDisabled: n }) => {
|
|
4175
|
-
let r = t(), i = p(), { currentStep: a, currentStepIndex: o, totalSteps: s, toggleOption: l, confirm: u, skip: f, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = J(null), O = S ?? "single", ee = s > 1, te = o === 0,
|
|
4175
|
+
let r = t(), i = p(), { currentStep: a, currentStepIndex: o, totalSteps: s, toggleOption: l, confirm: u, skip: f, cancel: m, back: h, setCustomAnswerText: g, setCustomAnswerActive: _, activateCustomAnswer: v } = e, { question: y, options: b, selectedOptionIds: x, selectionMode: S, optional: C, allowCustomAnswer: w, customAnswerText: T, isCustomAnswerActive: E } = a, D = J(null), O = S ?? "single", ee = s > 1, te = o === 0, ne = o === s - 1, k = ee ? r.t("ai.clarifyingQuestion.stepOf", {
|
|
4176
4176
|
current: String(o + 1),
|
|
4177
4177
|
total: String(s)
|
|
4178
|
-
}) : void 0,
|
|
4179
|
-
|
|
4180
|
-
},
|
|
4181
|
-
|
|
4182
|
-
},
|
|
4178
|
+
}) : void 0, A = x.length > 0, j = (T ?? "").trim().length > 0, M = A || E && j || C === !0, re = n === !0 && ne, N = () => {
|
|
4179
|
+
re || u();
|
|
4180
|
+
}, ie = () => {
|
|
4181
|
+
re || f();
|
|
4182
|
+
}, ae = (e) => {
|
|
4183
4183
|
let t = O === "single" && x.includes(e);
|
|
4184
|
-
l(e), O === "single" && !
|
|
4185
|
-
},
|
|
4184
|
+
l(e), O === "single" && !ne && !t && Promise.resolve().then(u);
|
|
4185
|
+
}, oe = ne ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, se = C === !0 && !A && !(E && j), ce = () => {
|
|
4186
4186
|
v(), requestAnimationFrame(() => {
|
|
4187
4187
|
D.current?.focus();
|
|
4188
4188
|
});
|
|
4189
|
-
},
|
|
4189
|
+
}, le = (e) => {
|
|
4190
4190
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
4191
|
-
},
|
|
4191
|
+
}, ue = i ? 0 : Fs, P = i ? 0 : Is;
|
|
4192
4192
|
return /* @__PURE__ */ Z("div", {
|
|
4193
4193
|
className: "flex flex-col",
|
|
4194
|
-
onKeyDown:
|
|
4194
|
+
onKeyDown: le,
|
|
4195
4195
|
children: [/* @__PURE__ */ X("div", {
|
|
4196
4196
|
className: "flex flex-col gap-3 pt-3",
|
|
4197
4197
|
children: /* @__PURE__ */ X(d, {
|
|
@@ -4203,23 +4203,23 @@ var Ds = [
|
|
|
4203
4203
|
animate: {
|
|
4204
4204
|
opacity: 1,
|
|
4205
4205
|
transition: {
|
|
4206
|
-
duration:
|
|
4206
|
+
duration: ue,
|
|
4207
4207
|
ease: Ps
|
|
4208
4208
|
}
|
|
4209
4209
|
},
|
|
4210
4210
|
exit: {
|
|
4211
4211
|
opacity: 0,
|
|
4212
4212
|
transition: {
|
|
4213
|
-
duration:
|
|
4213
|
+
duration: P,
|
|
4214
4214
|
ease: Ps
|
|
4215
4215
|
}
|
|
4216
4216
|
},
|
|
4217
4217
|
children: [/* @__PURE__ */ X(Ns, {
|
|
4218
4218
|
question: y,
|
|
4219
|
-
stepLabel:
|
|
4219
|
+
stepLabel: k,
|
|
4220
4220
|
isFirstStep: te,
|
|
4221
|
-
isFinalStep:
|
|
4222
|
-
canProceed:
|
|
4221
|
+
isFinalStep: ne,
|
|
4222
|
+
canProceed: M,
|
|
4223
4223
|
onBack: h,
|
|
4224
4224
|
onNext: u,
|
|
4225
4225
|
onCancel: m
|
|
@@ -4229,27 +4229,27 @@ var Ds = [
|
|
|
4229
4229
|
options: b,
|
|
4230
4230
|
selectedOptionIds: x,
|
|
4231
4231
|
allowCustomAnswer: w,
|
|
4232
|
-
hasSelection:
|
|
4233
|
-
hasCustomText:
|
|
4232
|
+
hasSelection: A,
|
|
4233
|
+
hasCustomText: j,
|
|
4234
4234
|
customAnswerText: T,
|
|
4235
4235
|
isCustomAnswerActive: E,
|
|
4236
|
-
canProceed:
|
|
4236
|
+
canProceed: M,
|
|
4237
4237
|
customInputRef: D,
|
|
4238
|
-
onToggleOption:
|
|
4239
|
-
onActivateCustom:
|
|
4238
|
+
onToggleOption: ae,
|
|
4239
|
+
onActivateCustom: ce,
|
|
4240
4240
|
onChangeCustomText: g,
|
|
4241
4241
|
onToggleCustomActive: _,
|
|
4242
|
-
onConfirm:
|
|
4242
|
+
onConfirm: N
|
|
4243
4243
|
})]
|
|
4244
4244
|
}, o)
|
|
4245
4245
|
})
|
|
4246
4246
|
}), /* @__PURE__ */ X(Ss, {
|
|
4247
|
-
canProceed:
|
|
4248
|
-
submitDisabled:
|
|
4249
|
-
label:
|
|
4250
|
-
onConfirm:
|
|
4251
|
-
onSkip:
|
|
4252
|
-
showSkip:
|
|
4247
|
+
canProceed: M,
|
|
4248
|
+
submitDisabled: re,
|
|
4249
|
+
label: oe,
|
|
4250
|
+
onConfirm: N,
|
|
4251
|
+
onSkip: ie,
|
|
4252
|
+
showSkip: se
|
|
4253
4253
|
})]
|
|
4254
4254
|
});
|
|
4255
4255
|
};
|
|
@@ -4575,13 +4575,13 @@ var Ks = class {
|
|
|
4575
4575
|
repeatType: "mirror"
|
|
4576
4576
|
};
|
|
4577
4577
|
function $s(e) {
|
|
4578
|
-
let [t, n] = Y(e), r =
|
|
4578
|
+
let [t, n] = Y(e), r = N(e), i = J(null);
|
|
4579
4579
|
return Gn(r, "change", (e) => n(e)), {
|
|
4580
4580
|
value: t,
|
|
4581
4581
|
motionValue: r,
|
|
4582
4582
|
controls: i,
|
|
4583
4583
|
animate: G((e, t) => {
|
|
4584
|
-
i.current =
|
|
4584
|
+
i.current = Ae(r, e, t);
|
|
4585
4585
|
}, [r])
|
|
4586
4586
|
};
|
|
4587
4587
|
}
|
|
@@ -4869,19 +4869,19 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4869
4869
|
-1,
|
|
4870
4870
|
0
|
|
4871
4871
|
]), e.STATIC_DRAW);
|
|
4872
|
-
},
|
|
4872
|
+
}, ne = ({ alpha: e, beta: t, gamma: n }) => {
|
|
4873
4873
|
E.current.iDeviceOrientation.value = [
|
|
4874
4874
|
e ?? 0,
|
|
4875
4875
|
t ?? 0,
|
|
4876
4876
|
n ?? 0,
|
|
4877
4877
|
window.orientation ?? 0
|
|
4878
4878
|
];
|
|
4879
|
-
},
|
|
4879
|
+
}, k = (e) => {
|
|
4880
4880
|
let [t = 0, n = 0] = Dc(e), r = t - (b.current?.left ?? 0) - window.pageXOffset, i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0) - window.pageYOffset;
|
|
4881
4881
|
y.current = !0;
|
|
4882
4882
|
let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4883
4883
|
a && (a[2] = r, a[3] = i), S.current[0] = r, S.current[1] = i;
|
|
4884
|
-
},
|
|
4884
|
+
}, A = (e) => {
|
|
4885
4885
|
b.current = p.current?.getBoundingClientRect();
|
|
4886
4886
|
let [t = 0, n = 0] = Dc(e), r = t - (b.current?.left ?? 0), i = (b.current?.height ?? 0) - n - (b.current?.top ?? 0);
|
|
4887
4887
|
if (c !== 1) S.current[0] = r, S.current[1] = i;
|
|
@@ -4889,10 +4889,10 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4889
4889
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4890
4890
|
e && (e[0] = r, e[1] = i);
|
|
4891
4891
|
}
|
|
4892
|
-
},
|
|
4892
|
+
}, j = () => {
|
|
4893
4893
|
let e = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
4894
4894
|
e && (e[2] = 0, e[3] = 0);
|
|
4895
|
-
},
|
|
4895
|
+
}, M = () => {
|
|
4896
4896
|
let e = m.current;
|
|
4897
4897
|
if (!e) return;
|
|
4898
4898
|
b.current = p.current?.getBoundingClientRect();
|
|
@@ -4901,7 +4901,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4901
4901
|
let t = e.getUniformLocation(g.current, uc);
|
|
4902
4902
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
4903
4903
|
}
|
|
4904
|
-
},
|
|
4904
|
+
}, re = (e, t) => {
|
|
4905
4905
|
let n = m.current;
|
|
4906
4906
|
if (!n) return null;
|
|
4907
4907
|
let r = n.createShader(e);
|
|
@@ -4912,12 +4912,12 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4912
4912
|
n.deleteShader(r), d?.(Ec(`Shader compiler log: ${e}`));
|
|
4913
4913
|
}
|
|
4914
4914
|
return r;
|
|
4915
|
-
},
|
|
4915
|
+
}, N = (e, t) => {
|
|
4916
4916
|
let n = m.current;
|
|
4917
4917
|
if (!n) return;
|
|
4918
|
-
let r =
|
|
4918
|
+
let r = re(n.FRAGMENT_SHADER, e), i = re(n.VERTEX_SHADER, t);
|
|
4919
4919
|
g.current = n.createProgram(), g.current && i && r && (n.attachShader(g.current, i), n.attachShader(g.current, r), n.linkProgram(g.current), n.getProgramParameter(g.current, n.LINK_STATUS) ? (n.useProgram(g.current), _.current = n.getAttribLocation(g.current, "aVertexPosition"), n.enableVertexAttribArray(_.current)) : d?.(Ec(`Unable to initialize the shader program: ${n.getProgramInfoLog(g.current)}`)));
|
|
4920
|
-
},
|
|
4920
|
+
}, ie = () => {
|
|
4921
4921
|
if (r) for (let e of Object.keys(r)) {
|
|
4922
4922
|
let t = r[e];
|
|
4923
4923
|
if (!t) continue;
|
|
@@ -4931,7 +4931,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4931
4931
|
...o ? { arraySize: o } : {}
|
|
4932
4932
|
};
|
|
4933
4933
|
}
|
|
4934
|
-
},
|
|
4934
|
+
}, ae = () => {
|
|
4935
4935
|
let e = m.current;
|
|
4936
4936
|
if (e) {
|
|
4937
4937
|
if (n && n.length > 0) {
|
|
@@ -4952,7 +4952,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4952
4952
|
});
|
|
4953
4953
|
} else u && u();
|
|
4954
4954
|
}
|
|
4955
|
-
},
|
|
4955
|
+
}, oe = (e) => {
|
|
4956
4956
|
let t = tc.includes(a ?? "highp"), n = `precision ${t ? a : tc[1]} float;\n`;
|
|
4957
4957
|
t || f?.(Ec(`wrong precision type ${a}, please make sure to pass one of a valid precision lowp, mediump, highp, by default you shader precision will be set to highp.`));
|
|
4958
4958
|
let r = n.concat(`#define DPR ${l.toFixed(1)}\n`).concat(e.replace(/texture\(/g, "texture2D("));
|
|
@@ -4962,7 +4962,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4962
4962
|
r = kc(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
4963
4963
|
}
|
|
4964
4964
|
return e.includes("mainImage") && (r = r.concat(nc)), r;
|
|
4965
|
-
},
|
|
4965
|
+
}, se = (e) => {
|
|
4966
4966
|
let t = m.current;
|
|
4967
4967
|
if (!t || !g.current) return;
|
|
4968
4968
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -5021,22 +5021,22 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5021
5021
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
5022
5022
|
}
|
|
5023
5023
|
}
|
|
5024
|
-
},
|
|
5024
|
+
}, ce = (e) => {
|
|
5025
5025
|
let t = m.current;
|
|
5026
5026
|
if (!t) return;
|
|
5027
|
-
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0),
|
|
5027
|
+
t.viewport(0, 0, t.drawingBufferWidth, t.drawingBufferHeight), t.clear(t.COLOR_BUFFER_BIT | t.DEPTH_BUFFER_BIT), t.bindBuffer(t.ARRAY_BUFFER, h.current), t.vertexAttribPointer(_.current ?? 0, 3, t.FLOAT, !1, 0, 0), se(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
5028
5028
|
let n = E.current.iMouse?.value;
|
|
5029
5029
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
5030
5030
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
5031
5031
|
n[0] = Oc(e, S.current[0] ?? 0, c), n[1] = Oc(t, S.current[1] ?? 0, c);
|
|
5032
5032
|
}
|
|
5033
|
-
v.current = requestAnimationFrame(
|
|
5034
|
-
},
|
|
5033
|
+
v.current = requestAnimationFrame(ce);
|
|
5034
|
+
}, le = () => {
|
|
5035
5035
|
let e = { passive: !0 };
|
|
5036
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove",
|
|
5037
|
-
},
|
|
5036
|
+
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", A, e), p.current.addEventListener("mouseout", j, e), p.current.addEventListener("mouseup", j, e), p.current.addEventListener("mousedown", k, e), p.current.addEventListener("touchmove", A, e), p.current.addEventListener("touchend", j, e), p.current.addEventListener("touchstart", k, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", ne, e), p.current && (T.current = new ResizeObserver(M), T.current.observe(p.current), window.addEventListener("resize", M, e));
|
|
5037
|
+
}, ue = () => {
|
|
5038
5038
|
let e = { passive: !0 };
|
|
5039
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove",
|
|
5039
|
+
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", A, e), p.current.removeEventListener("mouseout", j, e), p.current.removeEventListener("mouseup", j, e), p.current.removeEventListener("mousedown", k, e), p.current.removeEventListener("touchmove", A, e), p.current.removeEventListener("touchend", j, e), p.current.removeEventListener("touchstart", k, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", ne, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", M, e));
|
|
5040
5040
|
};
|
|
5041
5041
|
return K(() => {
|
|
5042
5042
|
D.current = r;
|
|
@@ -5045,7 +5045,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5045
5045
|
function r() {
|
|
5046
5046
|
ee();
|
|
5047
5047
|
let n = m.current;
|
|
5048
|
-
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth,
|
|
5048
|
+
n && p.current && (n.clearColor(...i), n.clearDepth(1), n.enable(n.DEPTH_TEST), n.depthFunc(n.LEQUAL), n.viewport(0, 0, p.current.width, p.current.height), p.current.height = p.current.clientHeight, p.current.width = p.current.clientWidth, ie(), ae(), N(oe(e || rc), t || ic), te(), requestAnimationFrame(ce), le(), M());
|
|
5049
5049
|
}
|
|
5050
5050
|
return requestAnimationFrame(r), () => {
|
|
5051
5051
|
let e = m.current;
|
|
@@ -5053,7 +5053,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5053
5053
|
if (e.getExtension("WEBGL_lose_context")?.loseContext(), e.useProgram(null), e.deleteProgram(g.current ?? null), n.length > 0) for (let t of n) e.deleteTexture(t._webglTexture);
|
|
5054
5054
|
g.current = null;
|
|
5055
5055
|
}
|
|
5056
|
-
|
|
5056
|
+
ue(), cancelAnimationFrame(v.current ?? 0);
|
|
5057
5057
|
};
|
|
5058
5058
|
}, []), /* @__PURE__ */ X("canvas", {
|
|
5059
5059
|
ref: p,
|
|
@@ -5192,7 +5192,7 @@ function Fc({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
5192
5192
|
}
|
|
5193
5193
|
//#endregion
|
|
5194
5194
|
//#region src/blocks/ai/F0HILActionConfirmation/F0HILActionConfirmation.tsx
|
|
5195
|
-
var Ic = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ X(
|
|
5195
|
+
var Ic = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ X(Ue, {
|
|
5196
5196
|
title: e,
|
|
5197
5197
|
description: t,
|
|
5198
5198
|
avatar: n,
|
|
@@ -5365,10 +5365,10 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5365
5365
|
className: "relative w-full flex-1",
|
|
5366
5366
|
role: "img",
|
|
5367
5367
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
5368
|
-
children: [/* @__PURE__ */ X(
|
|
5368
|
+
children: [/* @__PURE__ */ X(it, {
|
|
5369
5369
|
width: "100%",
|
|
5370
5370
|
height: "100%",
|
|
5371
|
-
children: /* @__PURE__ */ Z(
|
|
5371
|
+
children: /* @__PURE__ */ Z(E, {
|
|
5372
5372
|
data: e,
|
|
5373
5373
|
margin: {
|
|
5374
5374
|
top: 4,
|
|
@@ -5393,11 +5393,11 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5393
5393
|
stopOpacity: .02
|
|
5394
5394
|
})]
|
|
5395
5395
|
}) }),
|
|
5396
|
-
/* @__PURE__ */ X(
|
|
5396
|
+
/* @__PURE__ */ X(Oe, {
|
|
5397
5397
|
hide: !0,
|
|
5398
5398
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
5399
5399
|
}),
|
|
5400
|
-
/* @__PURE__ */ X(
|
|
5400
|
+
/* @__PURE__ */ X(ee, {
|
|
5401
5401
|
type: "linear",
|
|
5402
5402
|
dataKey: "value",
|
|
5403
5403
|
stroke: a.stroke,
|
|
@@ -5484,7 +5484,7 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5484
5484
|
});
|
|
5485
5485
|
});
|
|
5486
5486
|
Qc.displayName = "F0AiInsightCard";
|
|
5487
|
-
var $c = e(
|
|
5487
|
+
var $c = e(Ge(Qc, () => /* @__PURE__ */ Z("div", {
|
|
5488
5488
|
className: "flex w-[217px] h-[200px] flex-col gap-2 rounded-2xl border border-solid border-f1-border-secondary bg-f1-background p-4",
|
|
5489
5489
|
"aria-busy": "true",
|
|
5490
5490
|
"aria-live": "polite",
|
|
@@ -5569,11 +5569,11 @@ ol.displayName = "F0AiProposalCard";
|
|
|
5569
5569
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
5570
5570
|
var sl = ({ icon: e, title: t, children: n }) => {
|
|
5571
5571
|
let [r, i] = Y(!1), a = p();
|
|
5572
|
-
return /* @__PURE__ */ Z(
|
|
5572
|
+
return /* @__PURE__ */ Z(Ot, {
|
|
5573
5573
|
className: "mb-1 w-full",
|
|
5574
5574
|
open: r,
|
|
5575
5575
|
onOpenChange: i,
|
|
5576
|
-
children: [/* @__PURE__ */ Z(
|
|
5576
|
+
children: [/* @__PURE__ */ Z(vt, {
|
|
5577
5577
|
className: "flex w-full items-center text-base text-f1-foreground-secondary transition-colors duration-150 hover:text-f1-foreground [&[data-state=open]>svg]:rotate-90",
|
|
5578
5578
|
children: [
|
|
5579
5579
|
/* @__PURE__ */ X("span", {
|
|
@@ -5592,7 +5592,7 @@ var sl = ({ icon: e, title: t, children: n }) => {
|
|
|
5592
5592
|
className: "h-4 w-4 transition-transform duration-200"
|
|
5593
5593
|
})
|
|
5594
5594
|
]
|
|
5595
|
-
}), /* @__PURE__ */ X(
|
|
5595
|
+
}), /* @__PURE__ */ X(Ze, {
|
|
5596
5596
|
forceMount: !0,
|
|
5597
5597
|
className: "data-[state=open]:mt-3",
|
|
5598
5598
|
children: /* @__PURE__ */ X(c.div, {
|
|
@@ -5616,7 +5616,7 @@ var sl = ({ icon: e, title: t, children: n }) => {
|
|
|
5616
5616
|
})
|
|
5617
5617
|
})]
|
|
5618
5618
|
});
|
|
5619
|
-
}, cl = (e) =>
|
|
5619
|
+
}, cl = (e) => Ft[e] ?? Sn, ll = ({ iconName: e }) => e ? /* @__PURE__ */ X("div", {
|
|
5620
5620
|
className: "mr-1 flex items-center justify-center",
|
|
5621
5621
|
children: /* @__PURE__ */ X(U, {
|
|
5622
5622
|
icon: cl(e),
|
|
@@ -5704,7 +5704,7 @@ function ml({ indicator: e }) {
|
|
|
5704
5704
|
hideLabel: !0,
|
|
5705
5705
|
label: n.ai.conversations,
|
|
5706
5706
|
"aria-describedby": i ? r : void 0,
|
|
5707
|
-
icon:
|
|
5707
|
+
icon: Vt
|
|
5708
5708
|
})
|
|
5709
5709
|
}),
|
|
5710
5710
|
/* @__PURE__ */ X("span", {
|
|
@@ -5780,7 +5780,7 @@ function vl({ label: e, onClick: t }) {
|
|
|
5780
5780
|
variant: "ghost",
|
|
5781
5781
|
hideLabel: !0,
|
|
5782
5782
|
label: e,
|
|
5783
|
-
icon:
|
|
5783
|
+
icon: nt,
|
|
5784
5784
|
onClick: t
|
|
5785
5785
|
})
|
|
5786
5786
|
}) : null
|
|
@@ -5806,7 +5806,7 @@ function xl(e) {
|
|
|
5806
5806
|
e.detail !== 0 && (e.preventDefault(), e.stopPropagation());
|
|
5807
5807
|
}
|
|
5808
5808
|
var Sl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode: r, onClose: a, onNewChat: o, history: s, historyIndicator: l, historyOpen: u, onHistoryOpenChange: d }) => {
|
|
5809
|
-
let f = t(), h = p(), g = e?.trim() ?? "", { panelOverlays: _ } =
|
|
5809
|
+
let f = t(), h = p(), g = e?.trim() ?? "", { panelOverlays: _ } = P(), [v, y] = Y(null), b = bl();
|
|
5810
5810
|
return /* @__PURE__ */ Z(Dn, {
|
|
5811
5811
|
open: u,
|
|
5812
5812
|
onOpenChange: d,
|
|
@@ -5839,14 +5839,14 @@ var Sl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode
|
|
|
5839
5839
|
variant: "ghost",
|
|
5840
5840
|
hideLabel: !0,
|
|
5841
5841
|
label: n ? f.ai.collapseChat : f.ai.expandChat,
|
|
5842
|
-
icon: n ?
|
|
5842
|
+
icon: n ? Be : Rt,
|
|
5843
5843
|
onClick: r
|
|
5844
5844
|
}),
|
|
5845
5845
|
/* @__PURE__ */ X(m, {
|
|
5846
5846
|
variant: "ghost",
|
|
5847
5847
|
hideLabel: !0,
|
|
5848
5848
|
label: f.ai.closeChat,
|
|
5849
|
-
icon:
|
|
5849
|
+
icon: Qe,
|
|
5850
5850
|
onClick: a
|
|
5851
5851
|
})
|
|
5852
5852
|
]
|
|
@@ -5872,7 +5872,7 @@ function Cl({ items: e }) {
|
|
|
5872
5872
|
let n = t();
|
|
5873
5873
|
return /* @__PURE__ */ X("div", {
|
|
5874
5874
|
className: i("hidden shrink-0 items-center", "group-hover:flex group-focus-within:flex", "has-[[aria-expanded=true]]:flex", "[@media(hover:none)]:flex [@media(pointer:coarse)]:flex"),
|
|
5875
|
-
children: /* @__PURE__ */ X(
|
|
5875
|
+
children: /* @__PURE__ */ X(j, {
|
|
5876
5876
|
items: e,
|
|
5877
5877
|
children: /* @__PURE__ */ X(m, {
|
|
5878
5878
|
icon: xn,
|
|
@@ -5939,16 +5939,16 @@ function Tl({ items: e, status: n, statusId: r, isPending: a }) {
|
|
|
5939
5939
|
//#endregion
|
|
5940
5940
|
//#region src/addons/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5941
5941
|
function El({ thread: e, isPinned: n, isActive: r = !1, isPending: a = !1, onSelect: o, onPin: c, onUnpin: l, onDelete: u, threadActions: d, className: f }) {
|
|
5942
|
-
let p = t(), m = Rn(), g =
|
|
5942
|
+
let p = t(), m = Rn(), g = wt() === "two-level", _ = q(() => [
|
|
5943
5943
|
{
|
|
5944
5944
|
label: n ? p.ai.unpinChat : p.ai.pinChat,
|
|
5945
|
-
icon: n ?
|
|
5945
|
+
icon: n ? Fe : H,
|
|
5946
5946
|
onClick: () => n ? l(e.id) : c(e.id)
|
|
5947
5947
|
},
|
|
5948
5948
|
...d?.(e) ?? [],
|
|
5949
5949
|
{
|
|
5950
5950
|
label: p.ai.deleteChat,
|
|
5951
|
-
icon:
|
|
5951
|
+
icon: kt,
|
|
5952
5952
|
critical: !0,
|
|
5953
5953
|
onClick: () => u(e.id)
|
|
5954
5954
|
}
|
|
@@ -5964,7 +5964,7 @@ function El({ thread: e, isPinned: n, isActive: r = !1, isPending: a = !1, onSel
|
|
|
5964
5964
|
p.ai.deleteChat
|
|
5965
5965
|
]);
|
|
5966
5966
|
return /* @__PURE__ */ Z("div", {
|
|
5967
|
-
className: i("group flex items-center gap-1 rounded-md py-1.5 pr-1.5 hover:bg-f1-background-hover", g ? "pl-
|
|
5967
|
+
className: i("group flex items-center gap-1 rounded-md py-1.5 pr-1.5 hover:bg-f1-background-hover", g ? "pl-nav-label" : "pl-3", f, r && "bg-f1-background-secondary"),
|
|
5968
5968
|
children: [
|
|
5969
5969
|
/* @__PURE__ */ X(s, {
|
|
5970
5970
|
type: "button",
|
|
@@ -6131,7 +6131,7 @@ function Nl({ value: e, onChange: n }) {
|
|
|
6131
6131
|
size: "sm",
|
|
6132
6132
|
hideLabel: !0,
|
|
6133
6133
|
label: r.actions.clear,
|
|
6134
|
-
icon:
|
|
6134
|
+
icon: Qe,
|
|
6135
6135
|
onClick: () => n("")
|
|
6136
6136
|
}) : null
|
|
6137
6137
|
]
|
|
@@ -6159,7 +6159,7 @@ var Pl = () => {
|
|
|
6159
6159
|
//#region src/addons/ai/F0AiChatHistory/utils.ts
|
|
6160
6160
|
function Fl(e) {
|
|
6161
6161
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
6162
|
-
return
|
|
6162
|
+
return Me(t) ? "today" : T(t) ? "yesterday" : mn(t, n) ? "thisMonth" : "older";
|
|
6163
6163
|
}
|
|
6164
6164
|
function Il(e) {
|
|
6165
6165
|
let t = {
|
|
@@ -6214,7 +6214,7 @@ function Ll({ onClose: e, onSelectThread: n, onNewChat: r, actions: a, threads:
|
|
|
6214
6214
|
className: "flex flex-col gap-2",
|
|
6215
6215
|
children: [
|
|
6216
6216
|
r ? /* @__PURE__ */ X(Ml, {
|
|
6217
|
-
icon:
|
|
6217
|
+
icon: nt,
|
|
6218
6218
|
label: h.ai.startNewChat,
|
|
6219
6219
|
onClick: () => {
|
|
6220
6220
|
r(), e();
|
|
@@ -6310,11 +6310,11 @@ var Vl = [
|
|
|
6310
6310
|
"attention"
|
|
6311
6311
|
], Hl = "f0-ai-pinned-threads";
|
|
6312
6312
|
function Ul() {
|
|
6313
|
-
let e =
|
|
6313
|
+
let e = Et(Hl, []);
|
|
6314
6314
|
return new Set(Array.isArray(e) ? e : []);
|
|
6315
6315
|
}
|
|
6316
6316
|
function Wl(e) {
|
|
6317
|
-
|
|
6317
|
+
dt(Hl, [...e]);
|
|
6318
6318
|
}
|
|
6319
6319
|
function Gl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
6320
6320
|
let [a, o] = Y([]), [s, c] = Y(!1), [l, u] = Y(null), [d, f] = Y(Ul), [p, m] = Y(() => /* @__PURE__ */ new Set()), h = G(async () => {
|
|
@@ -6384,7 +6384,7 @@ function Gl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
6384
6384
|
}
|
|
6385
6385
|
//#endregion
|
|
6386
6386
|
//#region src/addons/ai/F0AiChatHeader/types.ts
|
|
6387
|
-
var Kl = ["attention"], ql = ["top", "bottom"], Jl = c.create(
|
|
6387
|
+
var Kl = ["attention"], ql = ["top", "bottom"], Jl = c.create(ie), Yl = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ Z("div", {
|
|
6388
6388
|
role: "status",
|
|
6389
6389
|
"aria-live": "polite",
|
|
6390
6390
|
className: "flex flex-row items-center gap-1 rounded-full border border-solid border-f1-border-secondary bg-f1-background px-2 py-1.5 pr-2.5 shadow-md",
|