@factorialco/f0-react 16.39.1 → 16.40.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-BuomQ0jm.js → ArchiveThumbnail-fx1k9zF5.js} +1 -1
- package/dist/{ArchiveViewer-Cb1a_yK5.js → ArchiveViewer-4mkxdXyf.js} +2 -2
- package/dist/{ChatPostComposerDialog-BoMZ0Olp.js → ChatPostComposerDialog-ZGoAsax9.js} +2 -2
- package/dist/{CoachmarkProvider-w30wNBNx.js → CoachmarkProvider-BwLQ3v9f.js} +14091 -14093
- package/dist/{CodeThumbnail-bnwIB0Q2.js → CodeThumbnail-DIRVdTYf.js} +1 -1
- package/dist/{CodeViewer-DVL3P-jF.js → CodeViewer-BHA1Osng.js} +4 -4
- package/dist/{DocumentToolbar-7s9QNMWY.js → DocumentToolbar-C8_A4Bhd.js} +5 -5
- package/dist/{DocxViewer-Bn22Gst6.js → DocxViewer-C-UaGNXG.js} +1 -1
- package/dist/{F0AiProcessingOverlay-B6DLMrO7.js → F0AiProcessingOverlay-BQGg-wTQ.js} +502 -504
- package/dist/{F0Alert-m54uY33f.js → F0Alert-Cj4ufDl7.js} +3 -3
- package/dist/F0AudioPlayer-C5CokjE_.js +2 -0
- package/dist/{F0CanvasPanel-CfPdTW_o.js → F0CanvasPanel-D4PhLARb.js} +8987 -9185
- package/dist/{F0DocumentViewer-FuhnkhM-.js → F0DocumentViewer-382b-101.js} +1 -1
- package/dist/{F0DocumentViewer-C_E6pFUZ.js → F0DocumentViewer-De5STCB5.js} +2 -2
- package/dist/{F0Map-BwRUOPzu.js → F0Map-Dz_-4gAZ.js} +764 -697
- package/dist/{F0Select-BCUynP2p.js → F0Select-BQMaDPcg.js} +8266 -8522
- package/dist/{Ellipsis-Bxq1iUUk.js → F0Text-DmUg-CLb.js} +22 -14
- package/dist/F0VideoPlayer-AXw_DAL_.js +1 -0
- package/dist/{F0VideoPlayer-DGHxduSr.js → F0VideoPlayer-Dsna4Es9.js} +306 -307
- package/dist/{HtmlViewer-Q3xUMpkP.js → HtmlViewer-CIAxNnvP.js} +4 -4
- package/dist/{Map-Dt3tV3na.js → Map-DGd3Cl-3.js} +13 -13
- package/dist/{PdfThumbnail-QkmwtnOA.js → PdfThumbnail-BtzXcGHN.js} +1 -1
- package/dist/{PdfViewer-D4NjCixG.js → PdfViewer-BZVnaYKF.js} +6 -6
- package/dist/{SheetViewer-RsRTbw7A.js → SheetViewer-Bn3N9G4D.js} +3 -3
- package/dist/{TextViewer-BvwaMVDG.js → TextViewer-C9NBnJvl.js} +1 -1
- package/dist/ai.d.ts +2 -2
- package/dist/ai.js +2 -2
- package/dist/component-status.js +1 -1
- package/dist/{dist-CngBJJ6S.js → dist-CWrWx4g2.js} +4 -4
- package/dist/{dist-CUKjZKvr.js → dist-CZnQ15Wl.js} +1 -1
- package/dist/{dist-CGYo25BY.js → dist-DCb1475M.js} +151 -142
- package/dist/{dist-D83RDDAb.js → dist-DNltp03U.js} +6 -15
- package/dist/{dist-DDAe_kuu.js → dist-DxwodHyk.js} +1 -1
- package/dist/experimental.d.ts +2 -2
- package/dist/experimental.js +819 -821
- package/dist/{exports-DYl7Pf17.d.ts → exports-CbmGLzn6.d.ts} +1 -1
- package/dist/f0.d.ts +3 -3
- package/dist/f0.js +318 -320
- package/dist/{highlight-CJDVXMe_.js → highlight-u9A6kwy7.js} +1 -1
- package/dist/{index-DA_a_mE2.d.ts → index-CcbdFJRr.d.ts} +1 -1
- package/dist/{index-DOU2q_xI.d.ts → index-D0QIgPoz.d.ts} +7 -0
- package/dist/internal-CGrF2KLC.js +261 -0
- package/dist/{maplibre-BFO6CAl9.js → maplibre-Dqb2AOHT.js} +12 -13
- package/dist/{pdfWorker-BlDYyNbC.js → pdfWorker-C_2eH-2_.js} +1 -1
- package/dist/{popover-BGv1b-fc.js → popover-Y2y9anVX.js} +1282 -1247
- package/dist/styles.css +1 -1
- package/dist/{useData-CmFkOA0P.js → useData-OLWBwcfd.js} +5129 -4873
- package/package.json +1 -1
- package/tailwind.config.ts +4 -0
- package/dist/Check-Cg2vvL5g.js +0 -39
- package/dist/F0AudioPlayer-Ck9Vyjrb.js +0 -2
- package/dist/F0Text-CnmiWNAg.js +0 -14
- package/dist/F0VideoPlayer-BshnHziC.js +0 -1
- package/dist/LayoutGroup-OcrcUDNP.js +0 -57
|
@@ -2,16 +2,14 @@ import { a as e, r as t } from "./i18n-provider-Bx71VZQH.js";
|
|
|
2
2
|
import { n, t as r } from "./skeleton-BsSrazKY.js";
|
|
3
3
|
import { L as i, R as a } from "./tooltip-NXXT56H4.js";
|
|
4
4
|
import { H as o, O as s, X as c, b as l, h as u, j as d, n as f, q as p, r as m, t as h, v as g, z as _ } from "./F0Button-fMxOyyNk.js";
|
|
5
|
-
import { $ as v, Ai as y, An as b, C as x,
|
|
5
|
+
import { $ as v, Ai as y, An as b, C as x, Cc as S, D as C, Dt as w, E as T, En as E, Et as D, F as O, Fl as k, Fs as ee, Gl as A, Gn as te, Gt as j, Hn as M, I as N, Il as P, In as F, Is as ne, J as re, Jo as ie, Jt as I, Kl as ae, Kt as oe, L as se, Ln as ce, M as le, Mt as ue, N as de, Na as L, Nn as R, Ns as fe, Nt as pe, Oa as me, Oc as he, Ot as ge, Pl as _e, Ps as ve, Q as ye, Qn as be, Qo as z, Qs as xe, Qt as Se, R as Ce, Rn as we, Sn as Te, Ss as Ee, T as De, Tc as Oe, Tn as B, Un as ke, Ut as Ae, Wn as je, Wt as V, X as Me, Xn as H, Y as Ne, Ys as Pe, Z as Fe, Zn as Ie, _i as Le, _n as Re, _t as ze, a as Be, an as Ve, at as He, b as Ue, bn as We, bt as Ge, di as Ke, dl as qe, dn as Je, dt as Ye, ec as Xe, et as Ze, fa as Qe, fl as $e, fn as et, fs as tt, gc as nt, gt as rt, hn as it, ht as at, it as ot, ja as st, ji as ct, jt as lt, ka as ut, kn as dt, kt as ft, l as pt, lc as mt, lt as ht, ma as gt, mn as _t, mt as vt, na as yt, o as bt, on as xt, pa as St, q as Ct, qo as wt, qt as Tt, r as Et, s as Dt, sl as Ot, st as kt, tc as At, tr as jt, tt as Mt, ut as Nt, v as Pt, vo as Ft, vt as It, w as Lt, wn as Rt, xc as zt, xi as Bt, xl as Vt, xt as Ht, y as Ut, yc as Wt, yt as Gt, z as Kt, zn as qt } from "./F0CanvasPanel-D4PhLARb.js";
|
|
6
6
|
import { a as U, u as Jt } from "./createIcon-iM5M-dE_.js";
|
|
7
7
|
import { t as Yt } from "./i18n-provider-defaults-Dlzuk_lt.js";
|
|
8
|
-
import { C as Xt,
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { $ as Cn, a as wn, i as Tn, n as En, t as Dn } from "./popover-BGv1b-fc.js";
|
|
14
|
-
import { t as On } from "./F0Text-CnmiWNAg.js";
|
|
8
|
+
import { C as Xt, E as Zt, I as W, M as Qt, Q as $t, W as en, Z as tn, b as nn, u as rn, v as an, y as on } from "./useData-OLWBwcfd.js";
|
|
9
|
+
import { Ar as sn, Fr as cn, Hn as ln, Ht as un, Mr as dn, Sn as fn, St as pn, Vn as mn, Yt as hn, bt as gn, ft as _n, jr as vn, xt as yn } from "./F0Select-BQMaDPcg.js";
|
|
10
|
+
import { $ as bn, a as xn, et as Sn, i as Cn, n as wn, t as Tn } from "./popover-Y2y9anVX.js";
|
|
11
|
+
import { n as En, t as Dn } from "./F0Text-DmUg-CLb.js";
|
|
12
|
+
import { t as On } from "./ExternalLink-0G_eeFcn.js";
|
|
15
13
|
import { a as kn } from "./dist-DMTFO2gF.js";
|
|
16
14
|
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
15
|
import { Fragment as Hn, jsx as X, jsxs as Z } from "react/jsx-runtime";
|
|
@@ -36,202 +34,202 @@ var Kn = [
|
|
|
36
34
|
"sm",
|
|
37
35
|
"md",
|
|
38
36
|
"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: d, placeholders: m, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice:
|
|
40
|
-
let
|
|
41
|
-
let t =
|
|
42
|
-
|
|
43
|
-
}, []),
|
|
44
|
-
"permission-denied":
|
|
45
|
-
"device-error":
|
|
46
|
-
"transcription-failed":
|
|
47
|
-
},
|
|
48
|
-
onTranscribe:
|
|
49
|
-
onPartial:
|
|
37
|
+
], 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: d, placeholders: m, placeholdersPaused: h, placeholderPreview: g, placeholderPreviewOneLine: _ = !1, role: v = "combobox", name: y, mentions: b, autocomplete: x, voice: C, onTextChange: w, onCleared: T, onEscape: E, onArrowUpWhenEmpty: O, onPasteFiles: k, pastePreferText: ee = !1, onStateChange: A, header: j, tray: M, leading: N, toolbarStart: P, toolbarCenter: F, collapsible: ne = !1, collapsed: re = !1, replacement: ie, asForm: I = !1, className: ae, surfaceRef: oe, onSurfaceFocus: se, onSurfaceBlur: ce, handleRef: le, reducedMotion: ue = !1, "data-testid": de }) => {
|
|
38
|
+
let L = It(d, C), R = ie != null, { error: fe, show: pe, clear: me } = ze(), he = J(() => {}), ge = J(() => {}), _e = J(""), ve = G((e) => {
|
|
39
|
+
let t = _e.current, n = t && !/\s$/.test(t) ? " " : "";
|
|
40
|
+
he.current(`${t}${n}${e}`);
|
|
41
|
+
}, []), ye = {
|
|
42
|
+
"permission-denied": L.micPermissionDenied,
|
|
43
|
+
"device-error": L.micError,
|
|
44
|
+
"transcription-failed": L.transcriptionError
|
|
45
|
+
}, z = be({
|
|
46
|
+
onTranscribe: C?.onTranscribe,
|
|
47
|
+
onPartial: ve,
|
|
50
48
|
onFinal: (e) => {
|
|
51
|
-
|
|
49
|
+
ve(e), ge.current();
|
|
52
50
|
},
|
|
53
|
-
onError: (e) =>
|
|
54
|
-
onAudio:
|
|
55
|
-
}), [
|
|
51
|
+
onError: (e) => pe(ye[e]),
|
|
52
|
+
onAudio: C?.onAudio
|
|
53
|
+
}), [xe, Se] = Y(!1), Ce = z.status === "recording", we = z.status === "transcribing", Te = !!C && (!!C.onTranscribe || !!C.onAudio) && z.isSupported, Ee = !C?.onAudio && (z.status !== "idle" || xe), [De, Oe] = Y(!1), B = Ge({
|
|
56
54
|
mentions: {
|
|
57
|
-
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !De && !
|
|
55
|
+
enabled: !!b && b.sources.length + +!!b.pinned > 0 && !De && !R,
|
|
58
56
|
sources: b?.sources ?? Yn,
|
|
59
57
|
pinned: b?.pinned,
|
|
60
58
|
scopeKey: b?.scopeKey,
|
|
61
59
|
onInserted: b?.onInserted
|
|
62
60
|
},
|
|
63
61
|
transformChange: x?.transformChange,
|
|
64
|
-
onTextChange:
|
|
62
|
+
onTextChange: w,
|
|
65
63
|
historySuspended: Ee
|
|
66
|
-
}), { value:
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
}), { value: ke, setValue: Ae, setCursorPosition: je, textareaRef: V, highlightRef: Me, mentions: H, requestSelection: Ne, clearText: Pe, breakHistory: Fe } = B;
|
|
65
|
+
he.current = (e) => {
|
|
66
|
+
Ae(e), je(e.length);
|
|
69
67
|
};
|
|
70
|
-
let
|
|
71
|
-
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
let
|
|
68
|
+
let Ie = J(ke);
|
|
69
|
+
Ie.current = ke;
|
|
70
|
+
let Le = J(H.mentions);
|
|
71
|
+
Le.current = H.mentions;
|
|
72
|
+
let Re = (x?.useAutocomplete ?? Xn)(B), Be = Re?.isOpen ?? !1, Ve = H.dismissCurrentTrigger;
|
|
75
73
|
K(() => {
|
|
76
74
|
Oe(Be), Be && Ve();
|
|
77
75
|
}, [Be, Ve]);
|
|
78
|
-
let { highlightSegments:
|
|
79
|
-
let t =
|
|
76
|
+
let { highlightSegments: He, hasOverlay: Ue } = Ht(B, { suppressGhost: Be }), We = G((e) => {
|
|
77
|
+
let t = V.current;
|
|
80
78
|
if (!t) return;
|
|
81
79
|
t.focus(e);
|
|
82
80
|
let n = t.value.length;
|
|
83
81
|
t.setSelectionRange(n, n);
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
let
|
|
82
|
+
}, [V]);
|
|
83
|
+
ge.current = () => V.current?.focus();
|
|
84
|
+
let Ke = H.close;
|
|
87
85
|
K(() => {
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
let
|
|
86
|
+
R && Ke();
|
|
87
|
+
}, [R, Ke]);
|
|
88
|
+
let qe = ke.length === 0;
|
|
91
89
|
K(() => {
|
|
92
90
|
A?.({
|
|
93
|
-
isEmpty:
|
|
94
|
-
recorder:
|
|
91
|
+
isEmpty: qe,
|
|
92
|
+
recorder: z.status
|
|
95
93
|
});
|
|
96
94
|
}, [
|
|
97
95
|
A,
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
qe,
|
|
97
|
+
z.status
|
|
100
98
|
]);
|
|
101
|
-
let [
|
|
99
|
+
let [Je, Xe] = Y(!1), Ze = s !== void 0 && ke.trim().length > s;
|
|
102
100
|
K(() => {
|
|
103
|
-
|
|
104
|
-
}, [
|
|
105
|
-
let
|
|
106
|
-
if (!st ||
|
|
107
|
-
if (
|
|
101
|
+
Ze || Xe(!1);
|
|
102
|
+
}, [Ze]);
|
|
103
|
+
let Qe = Je && Ze ? l ?? null : null, et = Qe ?? u ?? fe, [tt, nt] = Y(!1), it = J(!1), ot = ke.trim().length > 0 || a, st = ot && !Ee && !o && !tt && !R, ct = t && !we, lt = G(() => {
|
|
104
|
+
if (!st || it.current) return;
|
|
105
|
+
if (Ze) {
|
|
108
106
|
Xe(!0);
|
|
109
107
|
return;
|
|
110
108
|
}
|
|
111
|
-
|
|
112
|
-
let t =
|
|
113
|
-
!e &&
|
|
109
|
+
H.close();
|
|
110
|
+
let t = Ie.current, n = (e) => {
|
|
111
|
+
!e && Ie.current === t && (Pe(), Fe()), V.current?.focus({ preventScroll: !0 });
|
|
114
112
|
}, r;
|
|
115
113
|
try {
|
|
116
114
|
r = e({
|
|
117
115
|
text: t,
|
|
118
|
-
mentions:
|
|
116
|
+
mentions: H.mentions
|
|
119
117
|
});
|
|
120
118
|
} catch {
|
|
121
119
|
n(!0);
|
|
122
120
|
return;
|
|
123
121
|
}
|
|
124
|
-
r instanceof Promise ? (
|
|
125
|
-
|
|
122
|
+
r instanceof Promise ? (it.current = !0, nt(!0), r.then((e) => {
|
|
123
|
+
it.current = !1, nt(!1), n(e === !1);
|
|
126
124
|
}, () => {
|
|
127
|
-
|
|
125
|
+
it.current = !1, nt(!1), n(!0);
|
|
128
126
|
})) : n(r === !1);
|
|
129
127
|
}, [
|
|
130
128
|
st,
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
Ze,
|
|
130
|
+
H,
|
|
133
131
|
e,
|
|
132
|
+
Pe,
|
|
134
133
|
Fe,
|
|
135
|
-
|
|
136
|
-
B
|
|
134
|
+
V
|
|
137
135
|
]), ut = G(() => {
|
|
138
|
-
|
|
136
|
+
xe || (C?.onPress?.(), me(), Se(!0), (async () => {
|
|
139
137
|
try {
|
|
140
|
-
await
|
|
138
|
+
await z.start(), _e.current = Ie.current;
|
|
141
139
|
} catch {} finally {
|
|
142
|
-
|
|
140
|
+
Se(!1);
|
|
143
141
|
}
|
|
144
142
|
})());
|
|
145
143
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
]),
|
|
151
|
-
|
|
152
|
-
}, [
|
|
144
|
+
xe,
|
|
145
|
+
C,
|
|
146
|
+
me,
|
|
147
|
+
z
|
|
148
|
+
]), dt = z.cancel, ft = G(() => {
|
|
149
|
+
dt(), C?.onCancelled?.();
|
|
150
|
+
}, [dt, C]), pt = J(!1), mt = C?.onStarted;
|
|
153
151
|
K(() => {
|
|
154
|
-
|
|
155
|
-
}, [
|
|
152
|
+
Ce && !pt.current && mt?.(), pt.current = Ce;
|
|
153
|
+
}, [Ce, mt]), zn(le, () => ({
|
|
156
154
|
focus: (e) => {
|
|
157
|
-
|
|
155
|
+
R || We(e);
|
|
158
156
|
},
|
|
159
|
-
clear:
|
|
160
|
-
loadDraft:
|
|
157
|
+
clear: Pe,
|
|
158
|
+
loadDraft: B.loadDraft,
|
|
161
159
|
getDraft: () => ({
|
|
162
|
-
text:
|
|
163
|
-
mentions:
|
|
160
|
+
text: Ie.current,
|
|
161
|
+
mentions: Le.current
|
|
164
162
|
}),
|
|
165
163
|
insertText: (e) => {
|
|
166
|
-
let t =
|
|
167
|
-
|
|
164
|
+
let t = V.current, n = Ie.current, r = t?.selectionStart ?? n.length, i = t?.selectionEnd ?? n.length, a = r + e.length, o = n.slice(0, r) + e + n.slice(i);
|
|
165
|
+
Ae(o), je(a), w?.(o), Ne(a, o, !0);
|
|
168
166
|
},
|
|
169
|
-
cancelRecording:
|
|
170
|
-
breakHistory:
|
|
167
|
+
cancelRecording: dt,
|
|
168
|
+
breakHistory: Fe,
|
|
171
169
|
addFiles: () => {}
|
|
172
170
|
}), [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Fe,
|
|
176
|
-
ke.loadDraft,
|
|
177
|
-
B,
|
|
178
|
-
je,
|
|
179
|
-
Me,
|
|
180
|
-
C,
|
|
171
|
+
R,
|
|
172
|
+
We,
|
|
181
173
|
Pe,
|
|
182
|
-
|
|
183
|
-
|
|
174
|
+
B.loadDraft,
|
|
175
|
+
V,
|
|
176
|
+
Ae,
|
|
177
|
+
je,
|
|
178
|
+
w,
|
|
179
|
+
Ne,
|
|
180
|
+
dt,
|
|
181
|
+
Fe
|
|
184
182
|
]);
|
|
185
|
-
let { escapeArmed:
|
|
183
|
+
let { escapeArmed: gt, handleClearKeyDown: _t, handleUndoRedoKeyDown: yt } = B, bt = (e) => {
|
|
186
184
|
if (e.key !== "Escape") return !1;
|
|
187
185
|
if (E?.(e)) return !0;
|
|
188
|
-
if (
|
|
189
|
-
let t =
|
|
190
|
-
return
|
|
186
|
+
if (Ce) return e.preventDefault(), ft(), !0;
|
|
187
|
+
let t = gt;
|
|
188
|
+
return _t(e) ? (t && (Xe(!1), T?.()), !0) : !1;
|
|
191
189
|
}, xt = (e) => {
|
|
192
|
-
|
|
190
|
+
R || Gt(e) || yt(e) || Re?.handleKeyDown(e) || H.handleKeyDown(e) || bt(e) || (e.key === "ArrowUp" && !e.shiftKey && !e.altKey && !e.metaKey && !e.ctrlKey && ke === "" && z.status === "idle" && !xe && !C?.busy && O?.() ? e.preventDefault() : e.key === "Enter" && !e.shiftKey && (e.preventDefault(), t || lt()));
|
|
193
191
|
}, St = (e) => {
|
|
194
|
-
e.preventDefault(), !
|
|
195
|
-
}, Ct =
|
|
196
|
-
enabled: !!
|
|
197
|
-
onFiles:
|
|
198
|
-
preferText:
|
|
199
|
-
}), wt = Rn(), Tt = Rn(), Et = `chat-composer-mentions-${wt.replace(/:/g, "")}`, Dt =
|
|
192
|
+
e.preventDefault(), !R && (t && !Ee ? (H.close(), n?.(), V.current?.focus()) : lt());
|
|
193
|
+
}, Ct = ht({
|
|
194
|
+
enabled: !!k && !R,
|
|
195
|
+
onFiles: k ?? (() => {}),
|
|
196
|
+
preferText: ee
|
|
197
|
+
}), wt = Rn(), Tt = Rn(), Et = `chat-composer-mentions-${wt.replace(/:/g, "")}`, Dt = H.isOpen && !Be && !R && (H.isLoading || H.rows.length > 0), Ot = H.rows[H.selectedIndex] ?? H.rows[0], kt = Dt && Ot ? rt(Et, Ot.item) : void 0, At = (e) => Te ? /* @__PURE__ */ X(f, {
|
|
200
198
|
type: "button",
|
|
201
199
|
variant: "ghost",
|
|
202
200
|
size: e,
|
|
203
201
|
hideLabel: !0,
|
|
204
|
-
label:
|
|
205
|
-
icon:
|
|
202
|
+
label: C?.busy ? L.sendingVoice : L.recordAudio,
|
|
203
|
+
icon: S,
|
|
206
204
|
onClick: ut,
|
|
207
|
-
disabled:
|
|
208
|
-
loading:
|
|
209
|
-
}) : null,
|
|
205
|
+
disabled: C?.disabled,
|
|
206
|
+
loading: xe || we || !!C?.busy
|
|
207
|
+
}) : null, jt = Ye({
|
|
210
208
|
streaming: ct,
|
|
211
209
|
hasDataToSend: ot,
|
|
212
210
|
canSend: st
|
|
213
|
-
}),
|
|
214
|
-
action:
|
|
211
|
+
}), Mt = (e) => /* @__PURE__ */ X(Nt, {
|
|
212
|
+
action: jt,
|
|
215
213
|
sendKind: r,
|
|
216
214
|
size: e,
|
|
217
|
-
submit:
|
|
218
|
-
labels:
|
|
215
|
+
submit: I,
|
|
216
|
+
labels: L,
|
|
219
217
|
onSend: lt,
|
|
220
218
|
onStop: () => {
|
|
221
|
-
n?.(),
|
|
219
|
+
n?.(), V.current?.focus();
|
|
222
220
|
}
|
|
223
|
-
}),
|
|
221
|
+
}), Pt = { duration: ue ? 0 : .15 }, Ft = typeof P == "function" ? P(z.status) : P, Lt = /* @__PURE__ */ X("div", {
|
|
224
222
|
className: "grid",
|
|
225
223
|
children: /* @__PURE__ */ X(c, {
|
|
226
224
|
initial: !1,
|
|
227
|
-
children:
|
|
225
|
+
children: Ce ? /* @__PURE__ */ Z(p.div, {
|
|
228
226
|
className: "flex items-center gap-3 pb-2 pl-3 pr-2 [grid-area:1/1]",
|
|
229
227
|
initial: { opacity: 0 },
|
|
230
228
|
animate: { opacity: 1 },
|
|
231
229
|
exit: { opacity: 0 },
|
|
232
|
-
transition:
|
|
233
|
-
children: [/* @__PURE__ */ X(
|
|
234
|
-
stream:
|
|
230
|
+
transition: Pt,
|
|
231
|
+
children: [/* @__PURE__ */ X(te, {
|
|
232
|
+
stream: z.stream,
|
|
235
233
|
className: "min-w-0 flex-1"
|
|
236
234
|
}), /* @__PURE__ */ Z("div", {
|
|
237
235
|
className: "flex shrink-0 items-center gap-2",
|
|
@@ -240,17 +238,17 @@ var Kn = [
|
|
|
240
238
|
variant: "outline",
|
|
241
239
|
size: "md",
|
|
242
240
|
hideLabel: !0,
|
|
243
|
-
label:
|
|
244
|
-
icon:
|
|
245
|
-
onClick:
|
|
241
|
+
label: L.cancelRecording,
|
|
242
|
+
icon: $e,
|
|
243
|
+
onClick: ft
|
|
246
244
|
}), /* @__PURE__ */ X(f, {
|
|
247
245
|
type: "button",
|
|
248
246
|
variant: "default",
|
|
249
247
|
size: "md",
|
|
250
248
|
hideLabel: !0,
|
|
251
|
-
label:
|
|
252
|
-
icon:
|
|
253
|
-
onClick:
|
|
249
|
+
label: L.confirmRecording,
|
|
250
|
+
icon: Sn,
|
|
251
|
+
onClick: z.stop
|
|
254
252
|
})]
|
|
255
253
|
})]
|
|
256
254
|
}, "recording-row") : /* @__PURE__ */ Z(p.div, {
|
|
@@ -258,25 +256,25 @@ var Kn = [
|
|
|
258
256
|
initial: { opacity: 0 },
|
|
259
257
|
animate: { opacity: 1 },
|
|
260
258
|
exit: { opacity: 0 },
|
|
261
|
-
transition:
|
|
259
|
+
transition: Pt,
|
|
262
260
|
children: [
|
|
263
|
-
|
|
264
|
-
className: i("flex items-center gap-1",
|
|
265
|
-
children:
|
|
261
|
+
Ft ? /* @__PURE__ */ X("div", {
|
|
262
|
+
className: i("flex items-center gap-1", F ? "shrink-0" : "min-w-0"),
|
|
263
|
+
children: Ft
|
|
266
264
|
}) : null,
|
|
267
|
-
|
|
265
|
+
F ? /* @__PURE__ */ X("div", {
|
|
268
266
|
className: "min-w-0 flex-1",
|
|
269
|
-
children:
|
|
267
|
+
children: F
|
|
270
268
|
}) : null,
|
|
271
269
|
/* @__PURE__ */ Z("div", {
|
|
272
270
|
className: "ml-auto flex shrink-0 items-center gap-1",
|
|
273
|
-
children: [At("md"),
|
|
271
|
+
children: [At("md"), Mt("md")]
|
|
274
272
|
})
|
|
275
273
|
]
|
|
276
274
|
}, "actions-row")
|
|
277
275
|
})
|
|
278
276
|
}), Rt = {
|
|
279
|
-
duration:
|
|
277
|
+
duration: ue ? 0 : .32,
|
|
280
278
|
ease: [
|
|
281
279
|
.4,
|
|
282
280
|
0,
|
|
@@ -285,10 +283,10 @@ var Kn = [
|
|
|
285
283
|
]
|
|
286
284
|
}, zt = /* @__PURE__ */ Z(Hn, { children: [
|
|
287
285
|
j,
|
|
288
|
-
/* @__PURE__ */ X(
|
|
289
|
-
message:
|
|
286
|
+
/* @__PURE__ */ X(vt, {
|
|
287
|
+
message: et,
|
|
290
288
|
id: Tt,
|
|
291
|
-
reducedMotion:
|
|
289
|
+
reducedMotion: ue
|
|
292
290
|
}),
|
|
293
291
|
M,
|
|
294
292
|
/* @__PURE__ */ Z("div", {
|
|
@@ -297,46 +295,46 @@ var Kn = [
|
|
|
297
295
|
N,
|
|
298
296
|
/* @__PURE__ */ X(D, {
|
|
299
297
|
className: "min-w-0 flex-1",
|
|
300
|
-
textareaRef:
|
|
301
|
-
highlightRef:
|
|
302
|
-
value:
|
|
298
|
+
textareaRef: V,
|
|
299
|
+
highlightRef: Me,
|
|
300
|
+
value: ke,
|
|
303
301
|
role: v,
|
|
304
302
|
name: y,
|
|
305
|
-
ariaLabel:
|
|
303
|
+
ariaLabel: L.placeholder,
|
|
306
304
|
placeholder: m ? {
|
|
307
305
|
mode: "overlay",
|
|
308
|
-
texts:
|
|
309
|
-
fallback:
|
|
306
|
+
texts: Ce ? [L.listening] : m,
|
|
307
|
+
fallback: Ce ? L.listening : L.placeholder,
|
|
310
308
|
paused: h,
|
|
311
|
-
preview:
|
|
309
|
+
preview: Ce ? void 0 : g,
|
|
312
310
|
previewOneLine: _
|
|
313
311
|
} : {
|
|
314
312
|
mode: "native",
|
|
315
|
-
text:
|
|
313
|
+
text: Ce ? L.listening : L.placeholder
|
|
316
314
|
},
|
|
317
|
-
onChange:
|
|
315
|
+
onChange: B.handleChange,
|
|
318
316
|
onKeyDown: xt,
|
|
319
317
|
onPaste: Ct,
|
|
320
|
-
onFocus:
|
|
321
|
-
onBlur:
|
|
322
|
-
onCursorUpdate:
|
|
323
|
-
onScroll:
|
|
324
|
-
highlightSegments:
|
|
325
|
-
hasOverlay:
|
|
318
|
+
onFocus: Re?.handleFocus,
|
|
319
|
+
onBlur: Re?.handleBlur,
|
|
320
|
+
onCursorUpdate: B.updateCursorPosition,
|
|
321
|
+
onScroll: B.syncHighlightScroll,
|
|
322
|
+
highlightSegments: He,
|
|
323
|
+
hasOverlay: Ue,
|
|
326
324
|
isAutocompleteOpen: Be || Dt,
|
|
327
|
-
autocompleteListboxId: Be ?
|
|
328
|
-
activeAutocompleteOptionId: (Be ?
|
|
329
|
-
isInvalid:
|
|
325
|
+
autocompleteListboxId: Be ? Re?.listboxId : Dt ? Et : void 0,
|
|
326
|
+
activeAutocompleteOptionId: (Be ? Re?.activeDescendantId : void 0) ?? kt,
|
|
327
|
+
isInvalid: Qe !== null,
|
|
330
328
|
errorMessageId: Tt
|
|
331
329
|
}),
|
|
332
330
|
re ? /* @__PURE__ */ Z("div", {
|
|
333
331
|
className: "flex shrink-0 items-center gap-2 pb-[10px] pl-2",
|
|
334
332
|
onMouseDown: (e) => e.preventDefault(),
|
|
335
|
-
children: [At("sm"),
|
|
333
|
+
children: [At("sm"), Mt("sm")]
|
|
336
334
|
}) : null
|
|
337
335
|
]
|
|
338
336
|
}),
|
|
339
|
-
|
|
337
|
+
ne ? /* @__PURE__ */ X(c, {
|
|
340
338
|
initial: !1,
|
|
341
339
|
children: re ? null : /* @__PURE__ */ X(p.div, {
|
|
342
340
|
className: "overflow-hidden",
|
|
@@ -356,24 +354,24 @@ var Kn = [
|
|
|
356
354
|
children: Lt
|
|
357
355
|
}, "action-row")
|
|
358
356
|
}) : Lt
|
|
359
|
-
] }),
|
|
360
|
-
|
|
361
|
-
/* @__PURE__ */ X(
|
|
357
|
+
] }), Bt = /* @__PURE__ */ Z(Hn, { children: [
|
|
358
|
+
Re?.popover,
|
|
359
|
+
/* @__PURE__ */ X(at, {
|
|
362
360
|
isOpen: Dt,
|
|
363
361
|
listboxId: Et,
|
|
364
|
-
label:
|
|
365
|
-
rows:
|
|
366
|
-
groups:
|
|
362
|
+
label: L.mentionSuggestions,
|
|
363
|
+
rows: H.rows,
|
|
364
|
+
groups: H.groups,
|
|
367
365
|
showGroupLabels: !!b?.showGroupLabels,
|
|
368
|
-
isLoading:
|
|
369
|
-
selectedIndex:
|
|
370
|
-
position:
|
|
371
|
-
onSelect:
|
|
372
|
-
pinnedDescription:
|
|
366
|
+
isLoading: H.isLoading,
|
|
367
|
+
selectedIndex: H.selectedIndex,
|
|
368
|
+
position: H.popoverPosition,
|
|
369
|
+
onSelect: H.selectRow,
|
|
370
|
+
pinnedDescription: L.mentionPinnedDescription
|
|
373
371
|
}),
|
|
374
372
|
ie === void 0 ? zt : /* @__PURE__ */ X(c, {
|
|
375
373
|
initial: !1,
|
|
376
|
-
children:
|
|
374
|
+
children: R ? /* @__PURE__ */ X(p.div, {
|
|
377
375
|
className: "overflow-hidden",
|
|
378
376
|
initial: {
|
|
379
377
|
height: 0,
|
|
@@ -387,7 +385,7 @@ var Kn = [
|
|
|
387
385
|
height: 0,
|
|
388
386
|
opacity: 0,
|
|
389
387
|
transition: {
|
|
390
|
-
duration:
|
|
388
|
+
duration: ue ? 0 : .22,
|
|
391
389
|
ease: [
|
|
392
390
|
.4,
|
|
393
391
|
0,
|
|
@@ -397,7 +395,7 @@ var Kn = [
|
|
|
397
395
|
}
|
|
398
396
|
},
|
|
399
397
|
transition: {
|
|
400
|
-
duration:
|
|
398
|
+
duration: ue ? 0 : .4,
|
|
401
399
|
ease: [
|
|
402
400
|
.4,
|
|
403
401
|
0,
|
|
@@ -420,7 +418,7 @@ var Kn = [
|
|
|
420
418
|
height: 0,
|
|
421
419
|
opacity: 0,
|
|
422
420
|
transition: {
|
|
423
|
-
duration:
|
|
421
|
+
duration: ue ? 0 : .15,
|
|
424
422
|
ease: [
|
|
425
423
|
.55,
|
|
426
424
|
0,
|
|
@@ -430,7 +428,7 @@ var Kn = [
|
|
|
430
428
|
}
|
|
431
429
|
},
|
|
432
430
|
transition: {
|
|
433
|
-
duration:
|
|
431
|
+
duration: ue ? 0 : .4,
|
|
434
432
|
ease: [
|
|
435
433
|
.4,
|
|
436
434
|
0,
|
|
@@ -441,28 +439,28 @@ var Kn = [
|
|
|
441
439
|
children: zt
|
|
442
440
|
}, "input")
|
|
443
441
|
})
|
|
444
|
-
] }),
|
|
445
|
-
return
|
|
446
|
-
ref:
|
|
447
|
-
"data-testid":
|
|
442
|
+
] }), Vt = i(Jn, ae);
|
|
443
|
+
return I ? /* @__PURE__ */ X("form", {
|
|
444
|
+
ref: oe,
|
|
445
|
+
"data-testid": de,
|
|
448
446
|
"data-f0-chat-composer": "",
|
|
449
447
|
"aria-busy": t,
|
|
450
|
-
className:
|
|
448
|
+
className: Vt,
|
|
451
449
|
onClick: () => {
|
|
452
|
-
|
|
450
|
+
R || V.current?.focus();
|
|
453
451
|
},
|
|
454
|
-
onFocus:
|
|
455
|
-
onBlur:
|
|
452
|
+
onFocus: se,
|
|
453
|
+
onBlur: ce,
|
|
456
454
|
onSubmit: St,
|
|
457
|
-
children:
|
|
455
|
+
children: Bt
|
|
458
456
|
}) : /* @__PURE__ */ X("div", {
|
|
459
|
-
ref:
|
|
460
|
-
"data-testid":
|
|
457
|
+
ref: oe,
|
|
458
|
+
"data-testid": de,
|
|
461
459
|
"data-f0-chat-composer": "",
|
|
462
|
-
className:
|
|
463
|
-
onFocus:
|
|
464
|
-
onBlur:
|
|
465
|
-
children:
|
|
460
|
+
className: Vt,
|
|
461
|
+
onFocus: se,
|
|
462
|
+
onBlur: ce,
|
|
463
|
+
children: Bt
|
|
466
464
|
});
|
|
467
465
|
};
|
|
468
466
|
//#endregion
|
|
@@ -492,13 +490,13 @@ function Qn(e, t, n = .2) {
|
|
|
492
490
|
//#endregion
|
|
493
491
|
//#region src/addons/ai/F0AiChatTextArea/components/AttachedFilesList.tsx
|
|
494
492
|
var $n = (e) => {
|
|
495
|
-
let { provided: t } =
|
|
496
|
-
return t ? /* @__PURE__ */ X(er, { ...e }) : /* @__PURE__ */ X(
|
|
493
|
+
let { provided: t } = et();
|
|
494
|
+
return t ? /* @__PURE__ */ X(er, { ...e }) : /* @__PURE__ */ X(Je, { children: /* @__PURE__ */ X(er, { ...e }) });
|
|
497
495
|
}, er = ({ attachedFiles: e, isUploading: n, onRemove: r, removeLabel: i, reducedMotion: a }) => {
|
|
498
496
|
let o = t(), s = tr(e), c = q(() => e.flatMap((e) => {
|
|
499
497
|
let t = s.get(e.id);
|
|
500
498
|
if (!t) return [];
|
|
501
|
-
let n = e.file.name, r = e.file.type ||
|
|
499
|
+
let n = e.file.name, r = e.file.type || B({
|
|
502
500
|
name: n,
|
|
503
501
|
url: t
|
|
504
502
|
});
|
|
@@ -523,10 +521,10 @@ var $n = (e) => {
|
|
|
523
521
|
}];
|
|
524
522
|
}), [e, s]), l = q(() => c.map(({ att: e, attachment: t }, n) => ({
|
|
525
523
|
file: t,
|
|
526
|
-
item: e.status === "uploaded" ?
|
|
527
|
-
})), [c]), u =
|
|
524
|
+
item: e.status === "uploaded" ? it(t, Re(n, t.url)) : null
|
|
525
|
+
})), [c]), u = Ne(l, "composer"), d = c.map(({ att: e, attachment: t }) => ({
|
|
528
526
|
id: e.id,
|
|
529
|
-
content: /* @__PURE__ */ X(
|
|
527
|
+
content: /* @__PURE__ */ X(Fe, {
|
|
530
528
|
attachment: t,
|
|
531
529
|
status: e.status === "uploaded" ? "ready" : e.status === "error" ? "error" : "uploading",
|
|
532
530
|
errorMessage: e.errorMessage,
|
|
@@ -536,7 +534,7 @@ var $n = (e) => {
|
|
|
536
534
|
testIdPrefix: "ai-chat"
|
|
537
535
|
})
|
|
538
536
|
}));
|
|
539
|
-
return /* @__PURE__ */ X(
|
|
537
|
+
return /* @__PURE__ */ X(Me, {
|
|
540
538
|
items: d,
|
|
541
539
|
label: o.t(e.length === 1 ? "chat.attachmentCount.one" : "chat.attachmentCount.other", { count: e.length }),
|
|
542
540
|
busy: n,
|
|
@@ -566,14 +564,14 @@ var $n = (e) => {
|
|
|
566
564
|
u(e), s?.(e);
|
|
567
565
|
}, p = [...n ? [{
|
|
568
566
|
label: c.ai.addFilesOrPhotos,
|
|
569
|
-
icon:
|
|
567
|
+
icon: mt,
|
|
570
568
|
onClick: r,
|
|
571
569
|
disabled: i,
|
|
572
570
|
disabledTooltip: a
|
|
573
|
-
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...
|
|
571
|
+
}, ...e.length > 0 ? [{ type: "separator" }] : []] : [], ...re(e)];
|
|
574
572
|
return /* @__PURE__ */ X("div", {
|
|
575
573
|
onClick: (e) => e.stopPropagation(),
|
|
576
|
-
children: /* @__PURE__ */ X(
|
|
574
|
+
children: /* @__PURE__ */ X(z, {
|
|
577
575
|
items: p,
|
|
578
576
|
align: "start",
|
|
579
577
|
disabled: o,
|
|
@@ -606,7 +604,7 @@ var $n = (e) => {
|
|
|
606
604
|
label: u.ai.attachFile,
|
|
607
605
|
hideLabel: !0,
|
|
608
606
|
type: "button",
|
|
609
|
-
icon:
|
|
607
|
+
icon: mt,
|
|
610
608
|
variant: "ghost",
|
|
611
609
|
size: "md",
|
|
612
610
|
disabled: r || d,
|
|
@@ -637,7 +635,7 @@ var $n = (e) => {
|
|
|
637
635
|
};
|
|
638
636
|
}, ar = ({ creditWarning: e, children: n }) => {
|
|
639
637
|
let r = t(), i = ir(e);
|
|
640
|
-
return /* @__PURE__ */ X(
|
|
638
|
+
return /* @__PURE__ */ X(Ct, {
|
|
641
639
|
notice: i,
|
|
642
640
|
dismissLabel: r.ai.creditWarning.dismiss ?? "",
|
|
643
641
|
className: "[&_form]:border-f1-border",
|
|
@@ -675,7 +673,7 @@ var $n = (e) => {
|
|
|
675
673
|
function lr({ open: e, percentage: t, tone: n, label: r }) {
|
|
676
674
|
return /* @__PURE__ */ X(_, {
|
|
677
675
|
description: e ? "" : r,
|
|
678
|
-
children: /* @__PURE__ */ X(
|
|
676
|
+
children: /* @__PURE__ */ X(xn, {
|
|
679
677
|
asChild: !0,
|
|
680
678
|
children: /* @__PURE__ */ Z("button", {
|
|
681
679
|
type: "button",
|
|
@@ -756,10 +754,10 @@ function pr({ usage: e, error: n = !1, onOpenChange: r, trigger: o, side: s = "t
|
|
|
756
754
|
let c = t(), [l, u] = Y(!1), d = J(null), f = G((e) => {
|
|
757
755
|
u(e), r?.(e);
|
|
758
756
|
}, [r]), p = e ? fr(e.usedPercentage) : 0, m = e?.unlimited ?? !1, h = m ? "unlimited" : p >= 100 ? "exhausted" : "default", g = e?.sections ?? [], _ = !!e?.onSeeCompany || g.length > 0, v = c.t("ai.usageLimits.title"), y = m ? c.t("ai.usageLimits.unlimited") : c.t("ai.usageLimits.used", { percentage: p }), b = e ? `${v}: ${y}` : v;
|
|
759
|
-
return /* @__PURE__ */ Z(
|
|
757
|
+
return /* @__PURE__ */ Z(Tn, {
|
|
760
758
|
open: l,
|
|
761
759
|
onOpenChange: f,
|
|
762
|
-
children: [o ? /* @__PURE__ */ X(
|
|
760
|
+
children: [o ? /* @__PURE__ */ X(xn, {
|
|
763
761
|
asChild: !0,
|
|
764
762
|
children: o
|
|
765
763
|
}) : /* @__PURE__ */ X(lr, {
|
|
@@ -767,7 +765,7 @@ function pr({ usage: e, error: n = !1, onOpenChange: r, trigger: o, side: s = "t
|
|
|
767
765
|
percentage: p,
|
|
768
766
|
tone: h,
|
|
769
767
|
label: b
|
|
770
|
-
}), /* @__PURE__ */ Z(
|
|
768
|
+
}), /* @__PURE__ */ Z(Cn, {
|
|
771
769
|
ref: d,
|
|
772
770
|
side: s,
|
|
773
771
|
align: "end",
|
|
@@ -799,7 +797,7 @@ function pr({ usage: e, error: n = !1, onOpenChange: r, trigger: o, side: s = "t
|
|
|
799
797
|
className: "min-w-0 flex-1 truncate",
|
|
800
798
|
children: c.t("ai.usageLimits.yourCompany")
|
|
801
799
|
}), /* @__PURE__ */ X(U, {
|
|
802
|
-
icon:
|
|
800
|
+
icon: vn,
|
|
803
801
|
size: "md",
|
|
804
802
|
color: "default"
|
|
805
803
|
})]
|
|
@@ -834,7 +832,7 @@ var mr = (e, t) => e || t ? {
|
|
|
834
832
|
/* @__PURE__ */ X("div", {
|
|
835
833
|
className: "flex items-center py-0.5",
|
|
836
834
|
children: /* @__PURE__ */ X(U, {
|
|
837
|
-
icon:
|
|
835
|
+
icon: Pe,
|
|
838
836
|
size: "md",
|
|
839
837
|
color: "default"
|
|
840
838
|
})
|
|
@@ -849,7 +847,7 @@ var mr = (e, t) => e || t ? {
|
|
|
849
847
|
variant: "ghost",
|
|
850
848
|
label: r.ai.removeQuote,
|
|
851
849
|
onClick: n,
|
|
852
|
-
icon:
|
|
850
|
+
icon: $e,
|
|
853
851
|
hideLabel: !0,
|
|
854
852
|
size: "sm"
|
|
855
853
|
})
|
|
@@ -858,7 +856,7 @@ var mr = (e, t) => e || t ? {
|
|
|
858
856
|
});
|
|
859
857
|
}, gr = ({ cards: e }) => e.length === 0 ? null : /* @__PURE__ */ X("div", {
|
|
860
858
|
className: "grid w-full grid-cols-2 gap-3",
|
|
861
|
-
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(
|
|
859
|
+
children: e.slice(0, 4).map((e) => /* @__PURE__ */ X(yt, {
|
|
862
860
|
avatar: {
|
|
863
861
|
type: "icon",
|
|
864
862
|
icon: e.icon
|
|
@@ -1002,91 +1000,91 @@ function Sr(e) {
|
|
|
1002
1000
|
//#endregion
|
|
1003
1001
|
//#region src/addons/ai/F0AiChatTextArea/AiChatComposer.tsx
|
|
1004
1002
|
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: d = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef:
|
|
1006
|
-
let
|
|
1003
|
+
function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placeholders: o, creditWarning: s, clarifyingUI: l, pendingContext: d = null, onPendingContextChange: f, pendingQuote: m = null, onPendingQuoteChange: h, fileAttachments: g, toolbarStart: _, composerActions: v, onComposerActionsOpenChange: y, onTranscribe: b, searchPersons: x, mentionSources: S, onProcessFilesRef: C, disclaimer: T, usageLimits: E, footer: D, isWelcomeScreen: O = !1, fullscreen: k = !1, welcomeScreenSuggestions: ee, onSuggestionClick: A, welcomeScreenSuggestionsPlacement: te = "above", welcomeScreenSuggestionsCollapsedByDefault: j = !1, welcomeScreenCards: M, padding: N = "default", name: P }) {
|
|
1004
|
+
let F = t(), ne = !!u(), re = J(null), [ie, ae] = Y(!1), [se, ce] = Y({
|
|
1007
1005
|
isEmpty: !0,
|
|
1008
1006
|
recorder: "idle"
|
|
1009
|
-
}),
|
|
1007
|
+
}), le = J(null), de = J(null);
|
|
1010
1008
|
K(() => () => {
|
|
1011
|
-
|
|
1009
|
+
de.current && clearTimeout(de.current);
|
|
1012
1010
|
}, []);
|
|
1013
|
-
let
|
|
1011
|
+
let L = l != null, R = J(d), fe = J(m);
|
|
1014
1012
|
Vn(() => {
|
|
1015
|
-
|
|
1013
|
+
R.current = d, fe.current = m;
|
|
1016
1014
|
});
|
|
1017
|
-
let { tracking:
|
|
1015
|
+
let { tracking: pe, setFocusChatInputFunction: me } = I(), { attachedFiles: he, fileInputRef: _e, onUploadFiles: ve, acceptValue: ye, isAtMaxFiles: be, maxFiles: z, processFiles: xe, handleFileSelect: Se, handleRemoveFile: Ce, transientError: we, showTransientError: Te } = Sr(g), Ee = vr({
|
|
1018
1016
|
searchPersons: x,
|
|
1019
1017
|
mentionSources: S
|
|
1020
1018
|
});
|
|
1021
1019
|
K(() => {
|
|
1022
|
-
j || typeof window < "u" && window.location.hash.length === 0 &&
|
|
1020
|
+
j || typeof window < "u" && window.location.hash.length === 0 && re.current?.focus();
|
|
1023
1021
|
}, []), K(() => {
|
|
1024
|
-
if (
|
|
1025
|
-
else return
|
|
1026
|
-
|
|
1027
|
-
}), () =>
|
|
1028
|
-
}, [
|
|
1029
|
-
if (
|
|
1030
|
-
|
|
1022
|
+
if (L) me(null);
|
|
1023
|
+
else return me(() => {
|
|
1024
|
+
re.current?.focus();
|
|
1025
|
+
}), () => me(null);
|
|
1026
|
+
}, [L, me]), K(() => {
|
|
1027
|
+
if (C) return C((e) => {
|
|
1028
|
+
xe(e);
|
|
1031
1029
|
}), () => {
|
|
1032
|
-
|
|
1030
|
+
C(null);
|
|
1033
1031
|
};
|
|
1034
|
-
}, [
|
|
1035
|
-
let De = G((e) => void
|
|
1036
|
-
if (
|
|
1032
|
+
}, [C, xe]);
|
|
1033
|
+
let De = G((e) => void xe(e), [xe]), Oe = he.filter((e) => e.status === "uploaded"), B = he.some((e) => e.status === "uploading"), ke = he.some((e) => e.status === "error"), Ae = !se.isEmpty || Oe.length > 0, V = async ({ text: t, mentions: n }) => {
|
|
1034
|
+
if (ke) return Te(F.ai.fileUploadBlockedSubmit), !1;
|
|
1037
1035
|
if (a && await a() === !1) return !1;
|
|
1038
1036
|
let r = Oe, i = r.flatMap((e) => e.uploadedFile ? [e.uploadedFile] : []), o = d, s = m;
|
|
1039
1037
|
o && f?.(null), s && h?.(null);
|
|
1040
1038
|
try {
|
|
1041
1039
|
await e({
|
|
1042
|
-
text:
|
|
1040
|
+
text: ue(t, n),
|
|
1043
1041
|
files: i,
|
|
1044
1042
|
context: o,
|
|
1045
1043
|
quote: s
|
|
1046
1044
|
});
|
|
1047
1045
|
} catch {
|
|
1048
|
-
return o && (
|
|
1046
|
+
return o && (R.current == null || R.current === o) && f?.(o), s && (fe.current == null || fe.current === s) && h?.(s), !1;
|
|
1049
1047
|
}
|
|
1050
|
-
for (let e of r)
|
|
1048
|
+
for (let e of r) Ce(e.id);
|
|
1051
1049
|
return !0;
|
|
1052
|
-
},
|
|
1053
|
-
onItemClick:
|
|
1054
|
-
inBar:
|
|
1055
|
-
}),
|
|
1056
|
-
suggestions:
|
|
1057
|
-
onItemClick:
|
|
1058
|
-
onItemHover:
|
|
1059
|
-
side:
|
|
1060
|
-
reserveTwoRows: !
|
|
1061
|
-
overflow:
|
|
1062
|
-
}) : null,
|
|
1063
|
-
|
|
1064
|
-
|
|
1050
|
+
}, Me = te === "inside", H = oe(), Ne = Tt({
|
|
1051
|
+
onItemClick: A,
|
|
1052
|
+
inBar: Me
|
|
1053
|
+
}), Pe = O && ee && ee.length > 0 && A ? /* @__PURE__ */ X(w, {
|
|
1054
|
+
suggestions: ee,
|
|
1055
|
+
onItemClick: Ne.pick,
|
|
1056
|
+
onItemHover: Ne.preview,
|
|
1057
|
+
side: Me ? "bottom" : "top",
|
|
1058
|
+
reserveTwoRows: !Me,
|
|
1059
|
+
overflow: Me ? "scroll" : "wrap"
|
|
1060
|
+
}) : null, Fe = !j || ie || Ae || se.recorder !== "idle", Ie = (e) => e instanceof Node ? le.current?.contains(e) ? !0 : e instanceof Element && e.closest("[data-radix-popper-content-wrapper]") !== null : !1, Le = () => {
|
|
1061
|
+
de.current && clearTimeout(de.current), de.current = setTimeout(() => {
|
|
1062
|
+
Ie(document.activeElement) || ae(!1);
|
|
1065
1063
|
}, 0);
|
|
1066
|
-
},
|
|
1064
|
+
}, Re = Me, ze = Re && j, Be = ze && !Fe, Ve = Re && Pe ? /* @__PURE__ */ X("div", {
|
|
1067
1065
|
onClick: (e) => e.stopPropagation(),
|
|
1068
|
-
children:
|
|
1066
|
+
children: Pe
|
|
1069
1067
|
}) : void 0, He = {
|
|
1070
|
-
duration:
|
|
1068
|
+
duration: ne ? 0 : .32,
|
|
1071
1069
|
ease: [
|
|
1072
1070
|
.4,
|
|
1073
1071
|
0,
|
|
1074
1072
|
.2,
|
|
1075
1073
|
1
|
|
1076
1074
|
]
|
|
1077
|
-
}, Ue = O &&
|
|
1075
|
+
}, Ue = O && k && !!M && M.length > 0, We = k && O, Ge = We || !H?.inBar, Ke = We ? null : mr(T, E), qe = L || !!(Ke?.text || Ke?.trailing), { motionProps: Je } = Qn(O, 160, .5);
|
|
1078
1076
|
return /* @__PURE__ */ Z(p.div, {
|
|
1079
1077
|
"data-composer-layout": We ? "welcome" : "docked",
|
|
1080
1078
|
className: i("flex flex-col items-center", N === "default" && "px-4 pb-3 pt-2", We && "min-h-0 flex-1 justify-start"),
|
|
1081
|
-
...
|
|
1079
|
+
...k ? Je : {},
|
|
1082
1080
|
children: [
|
|
1083
1081
|
/* @__PURE__ */ Z("div", {
|
|
1084
1082
|
className: i("flex flex-col gap-2", Cr),
|
|
1085
1083
|
children: [
|
|
1086
|
-
D && !
|
|
1087
|
-
|
|
1084
|
+
D && !k ? D : null,
|
|
1085
|
+
Pe && !Me ? /* @__PURE__ */ X("div", { children: j ? /* @__PURE__ */ X(c, {
|
|
1088
1086
|
initial: !1,
|
|
1089
|
-
children:
|
|
1087
|
+
children: Fe ? /* @__PURE__ */ X(p.div, {
|
|
1090
1088
|
className: "overflow-hidden",
|
|
1091
1089
|
initial: {
|
|
1092
1090
|
opacity: 0,
|
|
@@ -1101,44 +1099,44 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1101
1099
|
height: 0
|
|
1102
1100
|
},
|
|
1103
1101
|
transition: He,
|
|
1104
|
-
children:
|
|
1102
|
+
children: Pe
|
|
1105
1103
|
}, "welcome-suggestions") : null
|
|
1106
|
-
}) :
|
|
1104
|
+
}) : Pe }) : null,
|
|
1107
1105
|
/* @__PURE__ */ X(ar, {
|
|
1108
1106
|
creditWarning: s,
|
|
1109
1107
|
children: /* @__PURE__ */ X(Zn, {
|
|
1110
1108
|
asForm: !0,
|
|
1111
|
-
surfaceRef:
|
|
1112
|
-
handleRef:
|
|
1109
|
+
surfaceRef: le,
|
|
1110
|
+
handleRef: re,
|
|
1113
1111
|
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:
|
|
1112
|
+
replacement: L ? l : null,
|
|
1113
|
+
onSurfaceFocus: () => ae(!0),
|
|
1114
|
+
onSurfaceBlur: Le,
|
|
1115
|
+
onStateChange: ce,
|
|
1116
|
+
onSend: V,
|
|
1119
1117
|
inProgress: r,
|
|
1120
1118
|
onStop: n,
|
|
1121
1119
|
hasAttachments: Oe.length > 0,
|
|
1122
|
-
sendBlocked:
|
|
1120
|
+
sendBlocked: B,
|
|
1123
1121
|
error: we,
|
|
1124
1122
|
role: "textbox",
|
|
1125
|
-
name:
|
|
1123
|
+
name: P,
|
|
1126
1124
|
placeholders: o ?? [],
|
|
1127
1125
|
placeholdersPaused: r,
|
|
1128
|
-
placeholderPreview:
|
|
1126
|
+
placeholderPreview: H?.prompt,
|
|
1129
1127
|
placeholderPreviewOneLine: Ge,
|
|
1130
1128
|
labels: {
|
|
1131
|
-
placeholder:
|
|
1132
|
-
listening:
|
|
1133
|
-
send:
|
|
1134
|
-
stop:
|
|
1135
|
-
recordAudio:
|
|
1136
|
-
cancelRecording:
|
|
1137
|
-
confirmRecording:
|
|
1138
|
-
micPermissionDenied:
|
|
1139
|
-
micError:
|
|
1140
|
-
transcriptionError:
|
|
1141
|
-
mentionSuggestions:
|
|
1129
|
+
placeholder: F.ai.inputPlaceholder,
|
|
1130
|
+
listening: F.ai.listening,
|
|
1131
|
+
send: F.ai.sendMessage,
|
|
1132
|
+
stop: F.ai.stopAnswerGeneration,
|
|
1133
|
+
recordAudio: F.ai.recordAudio,
|
|
1134
|
+
cancelRecording: F.ai.cancelRecording,
|
|
1135
|
+
confirmRecording: F.ai.stopRecording,
|
|
1136
|
+
micPermissionDenied: F.ai.micPermissionDenied,
|
|
1137
|
+
micError: F.ai.micError,
|
|
1138
|
+
transcriptionError: F.ai.transcriptionError,
|
|
1139
|
+
mentionSuggestions: F.ai.mentions.suggestions
|
|
1142
1140
|
},
|
|
1143
1141
|
mentions: {
|
|
1144
1142
|
sources: Ee,
|
|
@@ -1146,8 +1144,8 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1146
1144
|
},
|
|
1147
1145
|
voice: b ? {
|
|
1148
1146
|
onTranscribe: b,
|
|
1149
|
-
onPress:
|
|
1150
|
-
onCancelled:
|
|
1147
|
+
onPress: pe?.onDictationStart,
|
|
1148
|
+
onCancelled: pe?.onDictationCancel
|
|
1151
1149
|
} : void 0,
|
|
1152
1150
|
onPasteFiles: g?.onUploadFiles ? De : void 0,
|
|
1153
1151
|
pastePreferText: !0,
|
|
@@ -1156,28 +1154,28 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1156
1154
|
onRemove: () => h?.(null)
|
|
1157
1155
|
}) : null,
|
|
1158
1156
|
tray: /* @__PURE__ */ X($n, {
|
|
1159
|
-
attachedFiles:
|
|
1160
|
-
isUploading:
|
|
1161
|
-
onRemove:
|
|
1162
|
-
removeLabel:
|
|
1163
|
-
reducedMotion:
|
|
1157
|
+
attachedFiles: he,
|
|
1158
|
+
isUploading: B,
|
|
1159
|
+
onRemove: Ce,
|
|
1160
|
+
removeLabel: F.ai.removeFile,
|
|
1161
|
+
reducedMotion: ne
|
|
1164
1162
|
}),
|
|
1165
|
-
leading:
|
|
1163
|
+
leading: Re ? /* @__PURE__ */ X("div", {
|
|
1166
1164
|
className: "flex shrink-0 self-center pl-3",
|
|
1167
|
-
children: /* @__PURE__ */ X(
|
|
1165
|
+
children: /* @__PURE__ */ X(je, {
|
|
1168
1166
|
size: "sm",
|
|
1169
1167
|
spin: r
|
|
1170
1168
|
})
|
|
1171
1169
|
}) : void 0,
|
|
1172
|
-
toolbarStart:
|
|
1173
|
-
onUploadFiles:
|
|
1170
|
+
toolbarStart: ve || _ || v?.length ? (e) => /* @__PURE__ */ Z(Hn, { children: [/* @__PURE__ */ X(rr, {
|
|
1171
|
+
onUploadFiles: ve,
|
|
1174
1172
|
composerActions: v,
|
|
1175
1173
|
onComposerActionsOpenChange: y,
|
|
1176
|
-
isAtMaxFiles:
|
|
1177
|
-
maxFiles:
|
|
1178
|
-
acceptValue:
|
|
1179
|
-
fileInputRef:
|
|
1180
|
-
handleFileSelect:
|
|
1174
|
+
isAtMaxFiles: be,
|
|
1175
|
+
maxFiles: z,
|
|
1176
|
+
acceptValue: ye,
|
|
1177
|
+
fileInputRef: _e,
|
|
1178
|
+
handleFileSelect: Se,
|
|
1181
1179
|
recordingStatus: e
|
|
1182
1180
|
}), _ ? /* @__PURE__ */ X("div", {
|
|
1183
1181
|
className: "min-w-0 cursor-default",
|
|
@@ -1185,9 +1183,9 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1185
1183
|
children: _
|
|
1186
1184
|
}) : null] }) : void 0,
|
|
1187
1185
|
toolbarCenter: Ve,
|
|
1188
|
-
collapsible:
|
|
1186
|
+
collapsible: ze,
|
|
1189
1187
|
collapsed: Be,
|
|
1190
|
-
reducedMotion:
|
|
1188
|
+
reducedMotion: ne
|
|
1191
1189
|
})
|
|
1192
1190
|
})
|
|
1193
1191
|
]
|
|
@@ -1196,14 +1194,14 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1196
1194
|
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
1195
|
children: /* @__PURE__ */ X("div", {
|
|
1198
1196
|
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:
|
|
1197
|
+
children: /* @__PURE__ */ X(ge, {
|
|
1198
|
+
hint: L ? {
|
|
1199
|
+
navigate: F.ai.clarifyingQuestion.navHint.navigate,
|
|
1200
|
+
select: F.ai.clarifyingQuestion.navHint.select,
|
|
1201
|
+
cancel: F.ai.clarifyingQuestion.navHint.cancel
|
|
1204
1202
|
} : null,
|
|
1205
1203
|
disclaimer: Ke,
|
|
1206
|
-
reducedMotion:
|
|
1204
|
+
reducedMotion: ne,
|
|
1207
1205
|
fieldInset: "button"
|
|
1208
1206
|
})
|
|
1209
1207
|
})
|
|
@@ -1212,7 +1210,7 @@ function wr({ onSubmit: e, onStop: n, inProgress: r, onBeforeSubmit: a, placehol
|
|
|
1212
1210
|
className: i("mt-2 pt-2", Cr),
|
|
1213
1211
|
children: /* @__PURE__ */ X(gr, { cards: M })
|
|
1214
1212
|
}) : null,
|
|
1215
|
-
D && O &&
|
|
1213
|
+
D && O && k ? /* @__PURE__ */ X("div", {
|
|
1216
1214
|
className: "mx-auto mt-2 flex w-full max-w-content justify-center py-4",
|
|
1217
1215
|
children: D
|
|
1218
1216
|
}) : null
|
|
@@ -1226,7 +1224,7 @@ function Tr(e) {
|
|
|
1226
1224
|
...e,
|
|
1227
1225
|
name: "one-ai-input"
|
|
1228
1226
|
});
|
|
1229
|
-
return
|
|
1227
|
+
return j() ? t : /* @__PURE__ */ X(V, { children: t });
|
|
1230
1228
|
}
|
|
1231
1229
|
//#endregion
|
|
1232
1230
|
//#region src/addons/ai/markdown/typography.ts
|
|
@@ -1326,12 +1324,12 @@ function Vr({ children: e, ...t }) {
|
|
|
1326
1324
|
//#endregion
|
|
1327
1325
|
//#region src/addons/ai/markdown/Image.tsx
|
|
1328
1326
|
function Hr({ src: e, alt: n, ...r }) {
|
|
1329
|
-
let o = t(), s =
|
|
1327
|
+
let o = t(), s = F(), c = ce(), l = qt(e || void 0), [u, d] = Y(!1), [f, p] = Y(!1), m = n || (e ? We(e) : "") || "image";
|
|
1330
1328
|
if (!e || u || l.status === "error") return n ? /* @__PURE__ */ X("span", {
|
|
1331
1329
|
className: "text-f1-foreground-secondary",
|
|
1332
1330
|
children: n
|
|
1333
1331
|
}) : null;
|
|
1334
|
-
let g = l.status === "ready" ? /* @__PURE__ */ X(
|
|
1332
|
+
let g = l.status === "ready" ? /* @__PURE__ */ X(R, {
|
|
1335
1333
|
...r,
|
|
1336
1334
|
src: l.url,
|
|
1337
1335
|
alt: n,
|
|
@@ -1359,7 +1357,7 @@ function Hr({ src: e, alt: n, ...r }) {
|
|
|
1359
1357
|
variant: "neutral",
|
|
1360
1358
|
label: o.chat.download,
|
|
1361
1359
|
hideLabel: !0,
|
|
1362
|
-
icon:
|
|
1360
|
+
icon: Ot,
|
|
1363
1361
|
onClick: () => c(e, m)
|
|
1364
1362
|
})
|
|
1365
1363
|
})]
|
|
@@ -1377,7 +1375,7 @@ function Ur({ children: e, className: n, target: r, ...s }) {
|
|
|
1377
1375
|
children: [e, l ? /* @__PURE__ */ Z(Hn, { children: [/* @__PURE__ */ X("span", {
|
|
1378
1376
|
className: "ml-1 inline-block align-[-3px]",
|
|
1379
1377
|
children: /* @__PURE__ */ X(U, {
|
|
1380
|
-
icon:
|
|
1378
|
+
icon: On,
|
|
1381
1379
|
size: "sm",
|
|
1382
1380
|
"aria-hidden": !0
|
|
1383
1381
|
})
|
|
@@ -1468,7 +1466,7 @@ var Zr = (e) => Array.from(e.querySelector("tr")?.children ?? []), Qr = (e) => {
|
|
|
1468
1466
|
//#endregion
|
|
1469
1467
|
//#region src/addons/ai/markdown/useOneLineWidth.ts
|
|
1470
1468
|
function ti(e, t) {
|
|
1471
|
-
let n = J(null), r =
|
|
1469
|
+
let n = J(null), r = me(), [i, a] = Y();
|
|
1472
1470
|
return Vn(function() {
|
|
1473
1471
|
if (!t || !n.current) return;
|
|
1474
1472
|
let e = parseFloat(getComputedStyle(n.current, "::before").width);
|
|
@@ -1496,11 +1494,11 @@ var ni = (e) => An.toArray(e).filter((e) => Fn(e)), ri = (e) => ni(e.props.child
|
|
|
1496
1494
|
return t;
|
|
1497
1495
|
};
|
|
1498
1496
|
async function ai({ header: e, rows: t }, n, r) {
|
|
1499
|
-
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) =>
|
|
1497
|
+
let i = (e.length > 0 ? [e, ...t] : t).map((e) => e.map((e) => Ce(Xr(e)))), a = n === "xlsx" ? await Kt([{
|
|
1500
1498
|
name: "Data",
|
|
1501
1499
|
rows: i
|
|
1502
|
-
}]) : await
|
|
1503
|
-
|
|
1500
|
+
}]) : await N(i);
|
|
1501
|
+
se(a, `${r}.${n}`);
|
|
1504
1502
|
}
|
|
1505
1503
|
var oi = (e, t, n) => e ? {
|
|
1506
1504
|
role: "region",
|
|
@@ -1513,27 +1511,27 @@ function si({ children: e, title: n, ...r }) {
|
|
|
1513
1511
|
ai(ii(e), t, r);
|
|
1514
1512
|
}, h = /* @__PURE__ */ Z("div", {
|
|
1515
1513
|
className: "-ml-2 flex gap-1 pt-1",
|
|
1516
|
-
children: [/* @__PURE__ */ X(
|
|
1514
|
+
children: [/* @__PURE__ */ X(z, {
|
|
1517
1515
|
items: [{
|
|
1518
1516
|
label: o.t("ai.dataDownload.download", { format: "Excel" }),
|
|
1519
|
-
icon:
|
|
1517
|
+
icon: Ot,
|
|
1520
1518
|
onClick: () => m("xlsx")
|
|
1521
1519
|
}, {
|
|
1522
1520
|
label: o.t("ai.dataDownload.download", { format: "CSV" }),
|
|
1523
|
-
icon:
|
|
1521
|
+
icon: Ot,
|
|
1524
1522
|
onClick: () => m("csv")
|
|
1525
1523
|
}],
|
|
1526
1524
|
children: /* @__PURE__ */ X(f, {
|
|
1527
1525
|
variant: "ghost",
|
|
1528
1526
|
size: "sm",
|
|
1529
|
-
icon:
|
|
1527
|
+
icon: Ot,
|
|
1530
1528
|
label: o.ai.dataDownload.title,
|
|
1531
1529
|
className: "text-f1-foreground-secondary hover:text-f1-foreground"
|
|
1532
1530
|
})
|
|
1533
1531
|
}), l && (c.after > 0 || c.left) ? /* @__PURE__ */ X(f, {
|
|
1534
1532
|
variant: "ghost",
|
|
1535
1533
|
size: "sm",
|
|
1536
|
-
icon: c.after > 0 ?
|
|
1534
|
+
icon: c.after > 0 ? _e : cn,
|
|
1537
1535
|
iconPosition: c.after > 0 ? "right" : "left",
|
|
1538
1536
|
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
1537
|
className: "text-f1-foreground-secondary hover:text-f1-foreground",
|
|
@@ -1627,14 +1625,14 @@ function gi({ id: e, trigger: t, resolver: n, contentClassName: r = "w-64", ...a
|
|
|
1627
1625
|
onOpenChange: (e) => {
|
|
1628
1626
|
e && s();
|
|
1629
1627
|
},
|
|
1630
|
-
children: [/* @__PURE__ */ X(
|
|
1628
|
+
children: [/* @__PURE__ */ X(pn, {
|
|
1631
1629
|
asChild: !0,
|
|
1632
1630
|
children: t
|
|
1633
|
-
}), /* @__PURE__ */ X(
|
|
1631
|
+
}), /* @__PURE__ */ X(yn, {
|
|
1634
1632
|
side: "top",
|
|
1635
1633
|
align: "start",
|
|
1636
1634
|
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(
|
|
1635
|
+
children: a.renderCard ? a.renderCard(o) : o.status === "loading" ? /* @__PURE__ */ X(yt.Skeleton, {}) : /* @__PURE__ */ X(yt, { ...o.status === "ready" ? a.mapToCard(o.data) : a.fallbackCard })
|
|
1638
1636
|
})]
|
|
1639
1637
|
});
|
|
1640
1638
|
}
|
|
@@ -1682,7 +1680,7 @@ var yi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1682
1680
|
}));
|
|
1683
1681
|
yi.displayName = "CandidateTrigger";
|
|
1684
1682
|
function bi({ id: e, label: n }) {
|
|
1685
|
-
let { entityRefs: r } =
|
|
1683
|
+
let { entityRefs: r } = I(), i = r?.resolvers?.candidate, a = t(), o = r?.urls?.candidate?.(e), s = q(() => (e) => {
|
|
1686
1684
|
let t = [];
|
|
1687
1685
|
return e.source && t.push({
|
|
1688
1686
|
title: a.t("ai.entityRef.candidate.source"),
|
|
@@ -1746,10 +1744,10 @@ var xi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1746
1744
|
}));
|
|
1747
1745
|
xi.displayName = "ExpenseTrigger";
|
|
1748
1746
|
function Si({ id: e, label: n }) {
|
|
1749
|
-
let { entityRefs: r } =
|
|
1747
|
+
let { entityRefs: r } = I(), i = r?.resolvers?.expense, a = t(), o = r?.urls?.expense?.(e), s = q(() => (e) => ({
|
|
1750
1748
|
avatar: {
|
|
1751
1749
|
type: "icon",
|
|
1752
|
-
icon:
|
|
1750
|
+
icon: Wt
|
|
1753
1751
|
},
|
|
1754
1752
|
title: e.description || `Expense #${e.id}`,
|
|
1755
1753
|
description: [e.amount, e.status].filter(Boolean).join(" · "),
|
|
@@ -1787,7 +1785,7 @@ var Ci = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1787
1785
|
}));
|
|
1788
1786
|
Ci.displayName = "JobPostingTrigger";
|
|
1789
1787
|
function wi({ id: e, label: n }) {
|
|
1790
|
-
let { entityRefs: r } =
|
|
1788
|
+
let { entityRefs: r } = I(), i = r?.resolvers?.jobPosting, a = t(), o = r?.urls?.jobPosting?.(e), s = q(() => (e) => ({
|
|
1791
1789
|
title: e.title,
|
|
1792
1790
|
description: [e.status, e.location].filter(Boolean).join(" · "),
|
|
1793
1791
|
...o && { secondaryActions: {
|
|
@@ -1817,7 +1815,7 @@ function wi({ id: e, label: n }) {
|
|
|
1817
1815
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/entityRef/entities/person/PersonEntityRef.tsx
|
|
1818
1816
|
var Ti = "\xA0";
|
|
1819
1817
|
function Ei({ id: e, label: t }) {
|
|
1820
|
-
let { entityRefs: n } =
|
|
1818
|
+
let { entityRefs: n } = I(), r = n?.resolvers?.person, i = n?.urls?.person?.(e);
|
|
1821
1819
|
if (!r) return /* @__PURE__ */ Z("span", {
|
|
1822
1820
|
className: "text-f1-foreground-secondary",
|
|
1823
1821
|
children: ["@", t]
|
|
@@ -1829,7 +1827,7 @@ function Ei({ id: e, label: t }) {
|
|
|
1829
1827
|
resolver: r,
|
|
1830
1828
|
contentClassName: "w-72",
|
|
1831
1829
|
renderCard: (e) => {
|
|
1832
|
-
if (e.status !== "ready") return /* @__PURE__ */ X(
|
|
1830
|
+
if (e.status !== "ready") return /* @__PURE__ */ X(de, {
|
|
1833
1831
|
name: t,
|
|
1834
1832
|
avatar: {
|
|
1835
1833
|
type: "person",
|
|
@@ -1840,7 +1838,7 @@ function Ei({ id: e, label: t }) {
|
|
|
1840
1838
|
profileHref: i
|
|
1841
1839
|
});
|
|
1842
1840
|
let n = e.data;
|
|
1843
|
-
return /* @__PURE__ */ X(
|
|
1841
|
+
return /* @__PURE__ */ X(de, {
|
|
1844
1842
|
name: `${n.firstName} ${n.lastName}`,
|
|
1845
1843
|
avatar: {
|
|
1846
1844
|
type: "person",
|
|
@@ -1884,7 +1882,7 @@ var Oi = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1884
1882
|
}));
|
|
1885
1883
|
Oi.displayName = "RequisitionTrigger";
|
|
1886
1884
|
function ki({ id: e, label: n }) {
|
|
1887
|
-
let { entityRefs: r } =
|
|
1885
|
+
let { entityRefs: r } = I(), i = r?.resolvers?.requisition, a = t(), o = r?.urls?.requisition?.(e), s = q(() => (e) => {
|
|
1888
1886
|
let t = e.lineManager ? `${e.lineManager.firstName} ${e.lineManager.lastName}` : void 0, n = [
|
|
1889
1887
|
e.status ? {
|
|
1890
1888
|
label: a.t("ai.entityRef.requisition.status"),
|
|
@@ -1900,7 +1898,7 @@ function ki({ id: e, label: n }) {
|
|
|
1900
1898
|
label: a.t("ai.entityRef.requisition.lineManager"),
|
|
1901
1899
|
value: /* @__PURE__ */ Z("div", {
|
|
1902
1900
|
className: "flex items-center gap-1.5 pt-1",
|
|
1903
|
-
children: [/* @__PURE__ */ X(
|
|
1901
|
+
children: [/* @__PURE__ */ X(on, {
|
|
1904
1902
|
firstName: e.lineManager.firstName,
|
|
1905
1903
|
lastName: e.lineManager.lastName,
|
|
1906
1904
|
src: e.lineManager.avatarUrl,
|
|
@@ -1952,7 +1950,7 @@ var Ai = Pn(({ label: e, ...t }, n) => /* @__PURE__ */ X("button", {
|
|
|
1952
1950
|
}));
|
|
1953
1951
|
Ai.displayName = "VacancyTrigger";
|
|
1954
1952
|
function ji({ id: e, label: n }) {
|
|
1955
|
-
let { entityRefs: r } =
|
|
1953
|
+
let { entityRefs: r } = I(), i = r?.resolvers?.vacancy, a = t(), o = r?.urls?.vacancy?.(e), s = q(() => (e) => ({
|
|
1956
1954
|
title: e.name,
|
|
1957
1955
|
description: [e.status, e.vacancyType].filter(Boolean).join(" · "),
|
|
1958
1956
|
...o && { secondaryActions: {
|
|
@@ -1997,7 +1995,7 @@ function Pi(e, t) {
|
|
|
1997
1995
|
//#endregion
|
|
1998
1996
|
//#region src/addons/ai/F0AiChat/components/markdownRenderers/entityRef/components/EntityRef.tsx
|
|
1999
1997
|
function Fi({ type: e, id: t, children: n, typed: r = !1 }) {
|
|
2000
|
-
let { entityRefs: i } =
|
|
1998
|
+
let { entityRefs: i } = I(), a = Xr(n), o = r ? /* @__PURE__ */ Z("span", {
|
|
2001
1999
|
className: "text-f1-foreground-secondary",
|
|
2002
2000
|
children: ["@", a]
|
|
2003
2001
|
}) : /* @__PURE__ */ X("span", { children: n });
|
|
@@ -2095,7 +2093,7 @@ var Vi = (e) => typeof e == "object" && !!e, Q = (e) => typeof e == "string" &&
|
|
|
2095
2093
|
return i ? `${r}.${i}` : r;
|
|
2096
2094
|
}
|
|
2097
2095
|
let n = t.split("?")[1], r = n ? new URLSearchParams(n.split("#")[0]).get("path") : null;
|
|
2098
|
-
return
|
|
2096
|
+
return We(r ?? t) || e || "file";
|
|
2099
2097
|
}, Ui = (e, t) => e.startsWith("data:") ? e : `data:${t ?? "application/octet-stream"};base64,${e}`, Wi = (e, t) => {
|
|
2100
2098
|
let n = Q(e.data), r = Q(e.url) ?? (n ? Ui(n, t) : void 0);
|
|
2101
2099
|
if (!r) return null;
|
|
@@ -2146,11 +2144,11 @@ var Vi = (e) => typeof e == "object" && !!e, Q = (e) => typeof e == "string" &&
|
|
|
2146
2144
|
if (n.length !== 0) return t === "user" ? n[n.length - 1] : n.join("\n\n");
|
|
2147
2145
|
}, Qi = (e, { urlFor: t } = {}) => ({
|
|
2148
2146
|
url: e.url ?? t?.(e.path) ?? e.path,
|
|
2149
|
-
name: e.displayName ||
|
|
2147
|
+
name: e.displayName || We(e.path),
|
|
2150
2148
|
mimeType: e.mimeType,
|
|
2151
2149
|
size: e.bytes,
|
|
2152
2150
|
previewUrl: e.preview ? t?.(e.preview.path) ?? e.preview.url : void 0
|
|
2153
|
-
}), $i = (e) =>
|
|
2151
|
+
}), $i = (e) => B(e) ?? "", ea = Mn(!1), ta = () => Ln(ea), na = (e, t) => {
|
|
2154
2152
|
let [n, r] = Y(() => t ? null : new Set(e));
|
|
2155
2153
|
return t && n !== null ? r(null) : !t && n === null && r(new Set(e)), (e) => e !== void 0 && n !== null && !n.has(e);
|
|
2156
2154
|
}, ra = kn.settleMs, ia = 1e3, aa = 2, oa = "data-ai-anchor", sa = "data-turn-index", ca = (e) => {
|
|
@@ -2356,13 +2354,13 @@ function Ca({ viewportRef: e, contentRef: t, lastTurnRef: n, turnsCount: r, isLo
|
|
|
2356
2354
|
}
|
|
2357
2355
|
//#endregion
|
|
2358
2356
|
//#region src/addons/ai/canvas/F0CanvasCard/F0CanvasCard.tsx
|
|
2359
|
-
var wa = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ X(
|
|
2357
|
+
var wa = ({ avatar: e }) => e?.type === "module" ? /* @__PURE__ */ X(Qt, {
|
|
2360
2358
|
module: e.module,
|
|
2361
2359
|
size: "md"
|
|
2362
|
-
}) : e?.type === "file" ? /* @__PURE__ */ X(
|
|
2360
|
+
}) : e?.type === "file" ? /* @__PURE__ */ X(Xt, {
|
|
2363
2361
|
file: e.file,
|
|
2364
2362
|
size: "lg"
|
|
2365
|
-
}) : e?.type === "icon" ? /* @__PURE__ */ X(
|
|
2363
|
+
}) : e?.type === "icon" ? /* @__PURE__ */ X(nn, {
|
|
2366
2364
|
icon: e.icon,
|
|
2367
2365
|
size: "md"
|
|
2368
2366
|
}) : null, Ta = ({ action: e, isActive: n }) => {
|
|
@@ -2460,7 +2458,7 @@ function Fa(e) {
|
|
|
2460
2458
|
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
2461
2459
|
}
|
|
2462
2460
|
function Ia(e) {
|
|
2463
|
-
let { days: t, hours: n, minutes: r, seconds: i } =
|
|
2461
|
+
let { days: t, hours: n, minutes: r, seconds: i } = Le(e), a = [];
|
|
2464
2462
|
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
2463
|
}
|
|
2466
2464
|
function La(e) {
|
|
@@ -2535,7 +2533,7 @@ function Ba(e, t) {
|
|
|
2535
2533
|
};
|
|
2536
2534
|
}
|
|
2537
2535
|
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 } =
|
|
2536
|
+
let { canvasContent: c, openCanvas: l, dismissCanvas: u } = I(), d = ka(e), f = s ?? d, p = J(() => {}), m = r ?? e, h = i ?? t ?? "", g = c?.type === "form" && c.formName === e, _ = () => l({
|
|
2539
2537
|
type: "form",
|
|
2540
2538
|
title: m,
|
|
2541
2539
|
description: h,
|
|
@@ -2579,7 +2577,7 @@ function Va({ formName: e, formDescription: t, module: n, cardTitle: r, cardDesc
|
|
|
2579
2577
|
},
|
|
2580
2578
|
children: y.length > 0 && !g ? /* @__PURE__ */ X("div", {
|
|
2581
2579
|
className: "-mx-3 flex w-full flex-col overflow-hidden pb-1",
|
|
2582
|
-
children: /* @__PURE__ */ X(
|
|
2580
|
+
children: /* @__PURE__ */ X(C, {
|
|
2583
2581
|
details: y.map((e) => ({
|
|
2584
2582
|
title: e.label,
|
|
2585
2583
|
content: e.content,
|
|
@@ -2596,7 +2594,7 @@ Va.displayName = "FormCard";
|
|
|
2596
2594
|
//#endregion
|
|
2597
2595
|
//#region src/addons/ai/F0AiMessagesContainer/components/ActiveFormCard.tsx
|
|
2598
2596
|
function Ha() {
|
|
2599
|
-
let e =
|
|
2597
|
+
let e = jt(), t = e?.activeForm;
|
|
2600
2598
|
if (!t) return null;
|
|
2601
2599
|
let n = t.cardTitle, r = t.cardDescription, i = (e?.getFillVersion(t.formName) ?? 0) > 0;
|
|
2602
2600
|
return !n || !r || !i ? null : /* @__PURE__ */ X("div", {
|
|
@@ -2615,9 +2613,9 @@ function Ha() {
|
|
|
2615
2613
|
//#endregion
|
|
2616
2614
|
//#region src/addons/ai/F0AiFileAttachments/components/FileCanvasCards.tsx
|
|
2617
2615
|
var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile: t, onCanvasUnavailable: n }) => {
|
|
2618
|
-
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } =
|
|
2616
|
+
let { canvasContent: r, tryOpenCanvas: i, dismissCanvas: a, panelOverlays: o } = I(), s = M(), c = ta(), l = e.map((e) => e.file), u = (r, { fallback: a = !0 } = {}) => {
|
|
2619
2617
|
let o = e[r];
|
|
2620
|
-
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(
|
|
2618
|
+
o && t?.(o.file, "document", { documentKind: o.documentKind }) !== !1 && !i(Dt({
|
|
2621
2619
|
files: l,
|
|
2622
2620
|
index: r,
|
|
2623
2621
|
config: s
|
|
@@ -2637,7 +2635,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2637
2635
|
className: "flex w-full max-w-sm flex-col gap-2",
|
|
2638
2636
|
"data-testid": "ai-chat-file-canvas-cards",
|
|
2639
2637
|
children: e.map(({ file: e }, t) => {
|
|
2640
|
-
let n =
|
|
2638
|
+
let n = pt(r, e.url);
|
|
2641
2639
|
return /* @__PURE__ */ X("div", {
|
|
2642
2640
|
"data-active": n || void 0,
|
|
2643
2641
|
"data-testid": "ai-chat-file-canvas-card",
|
|
@@ -2651,7 +2649,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2651
2649
|
}
|
|
2652
2650
|
},
|
|
2653
2651
|
title: e.name,
|
|
2654
|
-
description: e.size ? Rt(e.size) :
|
|
2652
|
+
description: e.size ? Rt(e.size) : _t(e.name, $i(e)),
|
|
2655
2653
|
isActive: n,
|
|
2656
2654
|
action: {
|
|
2657
2655
|
type: "open",
|
|
@@ -2663,8 +2661,8 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2663
2661
|
})
|
|
2664
2662
|
});
|
|
2665
2663
|
}, Ka = "rounded-xl", qa = "ai-chat", Ja = (e) => {
|
|
2666
|
-
let { provided: t } =
|
|
2667
|
-
return t ? /* @__PURE__ */ X(Za, { ...e }) : /* @__PURE__ */ X(
|
|
2664
|
+
let { provided: t } = et();
|
|
2665
|
+
return t ? /* @__PURE__ */ X(Za, { ...e }) : /* @__PURE__ */ X(Je, { children: /* @__PURE__ */ X(Za, { ...e }) });
|
|
2668
2666
|
}, Ya = {
|
|
2669
2667
|
image: 0,
|
|
2670
2668
|
video: 1,
|
|
@@ -2672,11 +2670,11 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2672
2670
|
audio: 3,
|
|
2673
2671
|
file: 4
|
|
2674
2672
|
}, 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 } =
|
|
2673
|
+
let { remotePreviews: o } = et(), s = Se(), c = i === "default" && (a ?? (t === "start" && s ? "canvas" : "viewer")) === "canvas", [l, u] = Y(() => /* @__PURE__ */ new Set()), d = q(() => Qa(e, o, l), [
|
|
2676
2674
|
e,
|
|
2677
2675
|
o,
|
|
2678
2676
|
l
|
|
2679
|
-
]), f = q(() => i === "compact" ? d : [...d].sort((e, t) => Ya[e.cls.bucket] - Ya[t.cls.bucket]), [d, i]), p =
|
|
2677
|
+
]), f = q(() => i === "compact" ? d : [...d].sort((e, t) => Ya[e.cls.bucket] - Ya[t.cls.bucket]), [d, i]), p = Ne(f, "transcript");
|
|
2680
2678
|
return e.length === 0 ? null : X(i === "compact" ? to : eo, {
|
|
2681
2679
|
entries: d,
|
|
2682
2680
|
canvas: c,
|
|
@@ -2689,12 +2687,12 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2689
2687
|
onImageError: (e) => u((t) => new Set(t).add(e.url))
|
|
2690
2688
|
});
|
|
2691
2689
|
}, Qa = (e, t, n) => e.map((e, r) => {
|
|
2692
|
-
let i =
|
|
2690
|
+
let i = Te(e), a = !(t || ke(e.url)) || i.bucket === "file" || i.bucket === "image" && n.has(e.url);
|
|
2693
2691
|
return {
|
|
2694
2692
|
file: e,
|
|
2695
2693
|
cls: i,
|
|
2696
2694
|
generic: a,
|
|
2697
|
-
item: a ? null :
|
|
2695
|
+
item: a ? null : it(e, Re(r, e.url))
|
|
2698
2696
|
};
|
|
2699
2697
|
}), $a = ({ align: e, compact: t = !1, children: n }) => /* @__PURE__ */ X("div", {
|
|
2700
2698
|
className: i("flex w-full min-w-0 flex-col gap-1.5", e === "end" ? "items-end" : "items-start"),
|
|
@@ -2735,7 +2733,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2735
2733
|
}),
|
|
2736
2734
|
f || t ? null : d.map((e, t) => {
|
|
2737
2735
|
let { file: n, cls: i } = e;
|
|
2738
|
-
return i.bucket === "document" ? /* @__PURE__ */ X(
|
|
2736
|
+
return i.bucket === "document" ? /* @__PURE__ */ X(He, {
|
|
2739
2737
|
file: b(n),
|
|
2740
2738
|
kind: i.kind,
|
|
2741
2739
|
cornerClass: "rounded-xl",
|
|
@@ -2748,7 +2746,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2748
2746
|
onDownloaded: () => s?.(n)
|
|
2749
2747
|
}, `${n.name}-${t}`) : null;
|
|
2750
2748
|
}),
|
|
2751
|
-
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(
|
|
2749
|
+
c.map((e, t) => e.cls.bucket === "audio" ? /* @__PURE__ */ X(De, {
|
|
2752
2750
|
file: b(e.file),
|
|
2753
2751
|
testIdPrefix: qa,
|
|
2754
2752
|
onDownloaded: () => s?.(e.file)
|
|
@@ -2759,7 +2757,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2759
2757
|
"data-testid": f ? `${qa}-file-shelf` : void 0,
|
|
2760
2758
|
children: [g.length > 0 ? g.map((e, t) => {
|
|
2761
2759
|
let { file: n, cls: i } = e;
|
|
2762
|
-
return i.bucket === "document" ? /* @__PURE__ */ X(
|
|
2760
|
+
return i.bucket === "document" ? /* @__PURE__ */ X(He, {
|
|
2763
2761
|
file: b(n),
|
|
2764
2762
|
kind: i.kind,
|
|
2765
2763
|
cornerClass: "rounded-xl",
|
|
@@ -2795,11 +2793,11 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2795
2793
|
}, c) : s.bucket === "video" ? /* @__PURE__ */ X(ao, {
|
|
2796
2794
|
file: i,
|
|
2797
2795
|
onOpen: () => n(e)
|
|
2798
|
-
}, c) : s.bucket === "audio" ? /* @__PURE__ */ X(
|
|
2796
|
+
}, c) : s.bucket === "audio" ? /* @__PURE__ */ X(T, {
|
|
2799
2797
|
file: b(i),
|
|
2800
2798
|
testIdPrefix: qa,
|
|
2801
2799
|
onOpen: () => n(e)
|
|
2802
|
-
}, c) : s.bucket === "document" ? /* @__PURE__ */ X(
|
|
2800
|
+
}, c) : s.bucket === "document" ? /* @__PURE__ */ X(He, {
|
|
2803
2801
|
file: b(i),
|
|
2804
2802
|
kind: s.kind,
|
|
2805
2803
|
cornerClass: "rounded-xl",
|
|
@@ -2814,32 +2812,32 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2814
2812
|
})
|
|
2815
2813
|
})
|
|
2816
2814
|
}), no = ({ file: e, onFileDownloaded: n }) => {
|
|
2817
|
-
let r = t(), i =
|
|
2818
|
-
return /* @__PURE__ */ X(
|
|
2815
|
+
let r = t(), i = ce(), a = $i(e);
|
|
2816
|
+
return /* @__PURE__ */ X(kt, {
|
|
2819
2817
|
file: {
|
|
2820
2818
|
...e,
|
|
2821
2819
|
mimeType: a
|
|
2822
2820
|
},
|
|
2823
|
-
icon: a === "application/zip" ?
|
|
2821
|
+
icon: a === "application/zip" ? P : void 0,
|
|
2824
2822
|
testId: `${qa}-file-tile`,
|
|
2825
2823
|
action: {
|
|
2826
2824
|
label: r.t("chat.downloadNamedFile", { name: e.name }),
|
|
2827
|
-
icon:
|
|
2825
|
+
icon: Ot,
|
|
2828
2826
|
onClick: () => {
|
|
2829
2827
|
i(e.url, e.name), n?.(e);
|
|
2830
2828
|
}
|
|
2831
2829
|
}
|
|
2832
2830
|
});
|
|
2833
2831
|
}, 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
|
|
2832
|
+
let o = t(), s = qt(e.thumbnailUrl ?? e.url);
|
|
2833
|
+
return we(s.status, r), /* @__PURE__ */ X("button", {
|
|
2836
2834
|
type: "button",
|
|
2837
2835
|
onClick: n,
|
|
2838
2836
|
draggable: !1,
|
|
2839
2837
|
"aria-label": o.t("chat.openNamedDocument", { name: e.name }),
|
|
2840
2838
|
className: i(ro, a()),
|
|
2841
2839
|
"data-testid": "ai-chat-image-attachment",
|
|
2842
|
-
children: s.status === "ready" ? /* @__PURE__ */ X(
|
|
2840
|
+
children: s.status === "ready" ? /* @__PURE__ */ X(R, {
|
|
2843
2841
|
src: s.url,
|
|
2844
2842
|
alt: e.name,
|
|
2845
2843
|
draggable: !1,
|
|
@@ -2848,7 +2846,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2848
2846
|
}) : null
|
|
2849
2847
|
});
|
|
2850
2848
|
}, ao = ({ file: e, onOpen: n }) => {
|
|
2851
|
-
let r = t(), { urlCache: o } =
|
|
2849
|
+
let r = t(), { urlCache: o } = M(), s = qt(e.thumbnailUrl), c = !e.thumbnailUrl && o === null, [l, u] = Y(!1);
|
|
2852
2850
|
return /* @__PURE__ */ Z("button", {
|
|
2853
2851
|
type: "button",
|
|
2854
2852
|
onClick: n,
|
|
@@ -2859,20 +2857,20 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2859
2857
|
url: e.url,
|
|
2860
2858
|
posterUrl: s.status === "ready" ? s.url : void 0,
|
|
2861
2859
|
onError: () => u(!0)
|
|
2862
|
-
}) : null, /* @__PURE__ */ X(
|
|
2860
|
+
}) : null, /* @__PURE__ */ X(ye, {})]
|
|
2863
2861
|
});
|
|
2864
2862
|
}, oo = ({ images: e, onOpen: n, onImageError: r }) => {
|
|
2865
|
-
let a = t(), o = e.length === 1 ? e[0] : void 0, s =
|
|
2863
|
+
let a = t(), o = e.length === 1 ? e[0] : void 0, s = qt(o ? o.thumbnailUrl ?? o.url : void 0), c = Ue(o && s.status === "ready" ? s.url : void 0, o) ?? void 0, l = o ? Ut(c?.width, c?.height) : null;
|
|
2866
2864
|
return /* @__PURE__ */ X("div", {
|
|
2867
2865
|
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" :
|
|
2866
|
+
className: i("grid grid-cols-2 overflow-hidden border border-solid border-f1-border-secondary", l ? "max-w-full" : ot, Ze, Ka),
|
|
2869
2867
|
"data-testid": "ai-chat-image-album",
|
|
2870
|
-
children:
|
|
2868
|
+
children: Pt(c ? [c] : e).map((t, o, s) => {
|
|
2871
2869
|
let c = e[t.index];
|
|
2872
2870
|
if (!c) return null;
|
|
2873
2871
|
let l = o === s.length - 1;
|
|
2874
|
-
return /* @__PURE__ */ X(
|
|
2875
|
-
image:
|
|
2872
|
+
return /* @__PURE__ */ X(Lt, {
|
|
2873
|
+
image: dt(c),
|
|
2876
2874
|
aspectRatio: t.aspectRatio,
|
|
2877
2875
|
spanFull: t.span === 2,
|
|
2878
2876
|
inset: t.inset,
|
|
@@ -2888,7 +2886,7 @@ var Ua = 625, Wa = /* @__PURE__ */ new Set(), Ga = ({ documents: e, onOpenFile:
|
|
|
2888
2886
|
testIdPrefix: qa,
|
|
2889
2887
|
overlay: t.hiddenCount > 0 ? /* @__PURE__ */ X("span", {
|
|
2890
2888
|
"aria-hidden": !0,
|
|
2891
|
-
className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse",
|
|
2889
|
+
className: i("absolute inset-0 flex items-center justify-center text-2xl font-semibold text-f1-foreground-inverse", Mt),
|
|
2892
2890
|
"data-testid": "ai-chat-image-album-more",
|
|
2893
2891
|
children: `+${t.hiddenCount}`
|
|
2894
2892
|
}) : void 0
|
|
@@ -2967,7 +2965,7 @@ function mo({ anchor: e, onReply: n }) {
|
|
|
2967
2965
|
type: "button",
|
|
2968
2966
|
variant: "ghost",
|
|
2969
2967
|
label: c,
|
|
2970
|
-
icon:
|
|
2968
|
+
icon: xe,
|
|
2971
2969
|
onClick: () => {
|
|
2972
2970
|
n(e.text);
|
|
2973
2971
|
}
|
|
@@ -2976,7 +2974,7 @@ function mo({ anchor: e, onReply: n }) {
|
|
|
2976
2974
|
}
|
|
2977
2975
|
//#endregion
|
|
2978
2976
|
//#region src/addons/ai/F0AiMessagesContainer/components/AssistantMessage.tsx
|
|
2979
|
-
var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(
|
|
2977
|
+
var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(ct, {
|
|
2980
2978
|
content: e,
|
|
2981
2979
|
format: "markdown"
|
|
2982
2980
|
}), vo = ({ isGenerating: e, isLoading: t, isLive: n = !1, message: r, renderToolCall: i, onReplyQuote: a, onRendered: o, renderMarkdown: s }) => {
|
|
@@ -3041,7 +3039,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(at, {
|
|
|
3041
3039
|
return document.addEventListener("keydown", e), () => {
|
|
3042
3040
|
document.removeEventListener("keydown", e);
|
|
3043
3041
|
};
|
|
3044
|
-
}, [d]), /* @__PURE__ */ X(
|
|
3042
|
+
}, [d]), /* @__PURE__ */ X(Bt, {
|
|
3045
3043
|
position: "center",
|
|
3046
3044
|
isOpen: !0,
|
|
3047
3045
|
onClose: f,
|
|
@@ -3058,7 +3056,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(at, {
|
|
|
3058
3056
|
},
|
|
3059
3057
|
children: /* @__PURE__ */ X("div", {
|
|
3060
3058
|
className: "flex flex-col gap-6",
|
|
3061
|
-
children: /* @__PURE__ */ X(
|
|
3059
|
+
children: /* @__PURE__ */ X(Ke, {
|
|
3062
3060
|
autoFocus: !0,
|
|
3063
3061
|
label: l,
|
|
3064
3062
|
placeholder: u,
|
|
@@ -3095,7 +3093,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(at, {
|
|
|
3095
3093
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3096
3094
|
children: /* @__PURE__ */ X(U, {
|
|
3097
3095
|
size: "md",
|
|
3098
|
-
icon: f === "like" ?
|
|
3096
|
+
icon: f === "like" ? fe : ve,
|
|
3099
3097
|
color: "default"
|
|
3100
3098
|
})
|
|
3101
3099
|
})
|
|
@@ -3113,7 +3111,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(at, {
|
|
|
3113
3111
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3114
3112
|
children: /* @__PURE__ */ X(U, {
|
|
3115
3113
|
size: "md",
|
|
3116
|
-
icon: f === "dislike" ?
|
|
3114
|
+
icon: f === "dislike" ? ee : ne,
|
|
3117
3115
|
color: "default"
|
|
3118
3116
|
})
|
|
3119
3117
|
})
|
|
@@ -3130,7 +3128,7 @@ var ho = Mn(void 0), go = () => Ln(ho), _o = (e) => /* @__PURE__ */ X(at, {
|
|
|
3130
3128
|
className: "flex min-w-0 flex-1 items-center justify-center gap-1",
|
|
3131
3129
|
children: /* @__PURE__ */ X(U, {
|
|
3132
3130
|
size: "md",
|
|
3133
|
-
icon:
|
|
3131
|
+
icon: k,
|
|
3134
3132
|
color: "default"
|
|
3135
3133
|
})
|
|
3136
3134
|
})
|
|
@@ -3191,11 +3189,11 @@ function xo() {
|
|
|
3191
3189
|
//#region src/addons/ai/F0AiMessagesContainer/components/rail.ts
|
|
3192
3190
|
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
3191
|
let s = u();
|
|
3194
|
-
return /* @__PURE__ */ Z(
|
|
3192
|
+
return /* @__PURE__ */ Z(Qe, {
|
|
3195
3193
|
className: "mb-1 w-full",
|
|
3196
3194
|
open: r,
|
|
3197
3195
|
onOpenChange: a,
|
|
3198
|
-
children: [/* @__PURE__ */ Z(
|
|
3196
|
+
children: [/* @__PURE__ */ Z(gt, {
|
|
3199
3197
|
disabled: o,
|
|
3200
3198
|
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
3199
|
children: [e ? /* @__PURE__ */ X("span", {
|
|
@@ -3207,12 +3205,12 @@ var So = "-ml-1 flex w-5 shrink-0 flex-col items-center", Co = "w-px shrink-0 bg
|
|
|
3207
3205
|
children: /* @__PURE__ */ Z("span", { children: [t, o ? null : /* @__PURE__ */ X("span", {
|
|
3208
3206
|
className: "ml-[3px] inline-flex align-middle group-data-[state=open]/rail:rotate-90",
|
|
3209
3207
|
children: /* @__PURE__ */ X(U, {
|
|
3210
|
-
icon:
|
|
3208
|
+
icon: vn,
|
|
3211
3209
|
size: "sm"
|
|
3212
3210
|
})
|
|
3213
3211
|
})] })
|
|
3214
3212
|
})]
|
|
3215
|
-
}), /* @__PURE__ */ X(
|
|
3213
|
+
}), /* @__PURE__ */ X(St, {
|
|
3216
3214
|
forceMount: !0,
|
|
3217
3215
|
className: "data-[state=open]:mt-1.5",
|
|
3218
3216
|
children: /* @__PURE__ */ X(p.div, {
|
|
@@ -3246,11 +3244,11 @@ function To({ step: e, last: t }) {
|
|
|
3246
3244
|
className: "flex gap-1.5",
|
|
3247
3245
|
children: [/* @__PURE__ */ Z("span", {
|
|
3248
3246
|
className: i(So, "pt-0.5"),
|
|
3249
|
-
children: [n ? /* @__PURE__ */ X(
|
|
3247
|
+
children: [n ? /* @__PURE__ */ X(Ie, {
|
|
3250
3248
|
variant: "thinking",
|
|
3251
3249
|
size: 15
|
|
3252
3250
|
}) : /* @__PURE__ */ X(U, {
|
|
3253
|
-
icon:
|
|
3251
|
+
icon: Vt,
|
|
3254
3252
|
size: "sm",
|
|
3255
3253
|
color: "secondary"
|
|
3256
3254
|
}), t ? null : /* @__PURE__ */ X("span", {
|
|
@@ -3330,7 +3328,7 @@ var jo = (e, t) => {
|
|
|
3330
3328
|
function Mo({ titles: e, isThinking: t, startedAt: n }) {
|
|
3331
3329
|
let [r, a] = Y(!1), o = jo(e, t), s = o.length > 0, c = r && s, l = t && !c;
|
|
3332
3330
|
return /* @__PURE__ */ X(wo, {
|
|
3333
|
-
icon: l ? /* @__PURE__ */ X(
|
|
3331
|
+
icon: l ? /* @__PURE__ */ X(Ie, {
|
|
3334
3332
|
variant: "thinking",
|
|
3335
3333
|
size: 15
|
|
3336
3334
|
}) : null,
|
|
@@ -3372,12 +3370,12 @@ function Po({ turn: e }) {
|
|
|
3372
3370
|
className: "flex items-start gap-1.5 text-f1-foreground-secondary",
|
|
3373
3371
|
children: [/* @__PURE__ */ X("span", {
|
|
3374
3372
|
className: i(So, "h-5 justify-center"),
|
|
3375
|
-
children: /* @__PURE__ */ X(
|
|
3373
|
+
children: /* @__PURE__ */ X(Ie, {
|
|
3376
3374
|
variant: r,
|
|
3377
3375
|
size: 15
|
|
3378
3376
|
})
|
|
3379
3377
|
}), e.status === "asking" ? /* @__PURE__ */ X("p", {
|
|
3380
|
-
className: i("text-pretty leading-5",
|
|
3378
|
+
className: i("text-pretty leading-5", H),
|
|
3381
3379
|
children: n.ai.askingQuestions
|
|
3382
3380
|
}) : null]
|
|
3383
3381
|
}) : null;
|
|
@@ -3424,7 +3422,7 @@ function Ro({ children: e }) {
|
|
|
3424
3422
|
display: "flex",
|
|
3425
3423
|
height: "5",
|
|
3426
3424
|
alignItems: "center",
|
|
3427
|
-
children: /* @__PURE__ */ X(U, { icon:
|
|
3425
|
+
children: /* @__PURE__ */ X(U, { icon: Pe })
|
|
3428
3426
|
}), /* @__PURE__ */ Z("div", {
|
|
3429
3427
|
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
3428
|
children: [/* @__PURE__ */ X("span", {
|
|
@@ -3478,7 +3476,7 @@ function Vo(e) {
|
|
|
3478
3476
|
}
|
|
3479
3477
|
//#endregion
|
|
3480
3478
|
//#region src/addons/ai/F0AiMessagesContainer/components/UserMessage.tsx
|
|
3481
|
-
var Ho = (e) => /* @__PURE__ */ X(
|
|
3479
|
+
var Ho = (e) => /* @__PURE__ */ X(ct, {
|
|
3482
3480
|
content: e,
|
|
3483
3481
|
format: "markdown"
|
|
3484
3482
|
}), Uo = /[.,:;!?*_~]/, Wo = (e, t) => e.split(t).length - 1, Go = (e) => {
|
|
@@ -3496,9 +3494,9 @@ var Ho = (e) => /* @__PURE__ */ X(at, {
|
|
|
3496
3494
|
target: "_blank",
|
|
3497
3495
|
children: r
|
|
3498
3496
|
}), e.slice(n)] }, t);
|
|
3499
|
-
}, qo = (e, t) =>
|
|
3497
|
+
}, qo = (e, t) => pe(e).map((e, n) => n % 2 == 1 ? Ko(e, `${t}-${n}`) : e), Jo = (e) => /* @__PURE__ */ X("p", {
|
|
3500
3498
|
className: "m-0",
|
|
3501
|
-
children:
|
|
3499
|
+
children: lt(e).map((e, t) => e.kind === "text" ? qo(e.text, t) : /* @__PURE__ */ X(Fi, {
|
|
3502
3500
|
type: e.type,
|
|
3503
3501
|
id: e.id,
|
|
3504
3502
|
typed: !0,
|
|
@@ -3509,7 +3507,7 @@ function Xo({ message: e, onReplyQuote: n, onCopy: r, autoScrollIntoView: a = !0
|
|
|
3509
3507
|
let s = Vo(a), c = J(null), l = e?.content, u = e?.rawData, d = q(() => Xi({
|
|
3510
3508
|
content: l,
|
|
3511
3509
|
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") :
|
|
3510
|
+
}), [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") : ft(f), { anchor: b, clear: x } = uo({
|
|
3513
3511
|
containerRef: c,
|
|
3514
3512
|
enabled: g && !m
|
|
3515
3513
|
});
|
|
@@ -3586,7 +3584,7 @@ function Zo({ phrase: e, caption: t, onClick: n }) {
|
|
|
3586
3584
|
//#endregion
|
|
3587
3585
|
//#region src/addons/ai/F0AiChat/providers/useWelcomeRound.ts
|
|
3588
3586
|
var Qo = () => {
|
|
3589
|
-
let e = Ln(
|
|
3587
|
+
let e = Ln(Ae), [t] = Y(() => e?.nextRound ?? 0), n = e?.claimRound;
|
|
3590
3588
|
return K(function() {
|
|
3591
3589
|
n?.(t);
|
|
3592
3590
|
}, [n, t]), t;
|
|
@@ -3595,7 +3593,7 @@ var Qo = () => {
|
|
|
3595
3593
|
return () => t(null);
|
|
3596
3594
|
}, [e, t]);
|
|
3597
3595
|
}, es = ({ onItemClick: e, onItemHover: t }) => {
|
|
3598
|
-
let { preview: n, pick: r } =
|
|
3596
|
+
let { preview: n, pick: r } = Tt({ onItemClick: e }), i = g((e) => t?.(e));
|
|
3599
3597
|
return {
|
|
3600
3598
|
preview: G((e) => {
|
|
3601
3599
|
n(e), i(e);
|
|
@@ -3663,7 +3661,7 @@ function cs({ prompts: { suggestions: e, onItemClick: t, onItemHover: n }, round
|
|
|
3663
3661
|
flexDirection: "column",
|
|
3664
3662
|
gap: "md",
|
|
3665
3663
|
width: "full",
|
|
3666
|
-
children: o.map(({ item: e, group: t, onOverflowChange: n }, r) => /* @__PURE__ */ X(
|
|
3664
|
+
children: o.map(({ item: e, group: t, onOverflowChange: n }, r) => /* @__PURE__ */ X(bt, {
|
|
3667
3665
|
label: e.title,
|
|
3668
3666
|
icon: t.icon,
|
|
3669
3667
|
onClick: () => a(e, t),
|
|
@@ -3716,7 +3714,7 @@ function us({ phrase: e, caption: t, subtitle: n, prompts: r, onClick: i }) {
|
|
|
3716
3714
|
phrase: e,
|
|
3717
3715
|
caption: t,
|
|
3718
3716
|
onClick: i
|
|
3719
|
-
}), n ? /* @__PURE__ */ X(
|
|
3717
|
+
}), n ? /* @__PURE__ */ X(Dn, {
|
|
3720
3718
|
variant: "description",
|
|
3721
3719
|
align: "center",
|
|
3722
3720
|
content: n,
|
|
@@ -3733,10 +3731,10 @@ var ds = {
|
|
|
3733
3731
|
onThumbsDown: () => {}
|
|
3734
3732
|
}, fs = (e) => e?.status === "working" || e?.status === "answering";
|
|
3735
3733
|
function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a, initialMessageCaption: o, initialMessageSubtitle: s, onWelcomeClick: l, welcomePrompts: u, renderToolCall: d, onReplyQuote: f, 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(),
|
|
3734
|
+
let { modal: T, handleSubmit: E, handleClose: D } = Bi(_ ?? ds), O = t(), k = x ?? vo, ee = S ?? Xo, A = a ?? O.ai.defaultInitialMessage, te = !n && e.length === 0 && A !== "", j = J(null), M = J(null), N = J(null), P = J(null), { showScrollBtn: F, scrolledFromTop: ne, turnMinHeight: re, scrollToBottom: ie } = Ca({
|
|
3737
3735
|
viewportRef: j,
|
|
3738
3736
|
contentRef: M,
|
|
3739
|
-
lastTurnRef:
|
|
3737
|
+
lastTurnRef: P,
|
|
3740
3738
|
turnsCount: e.length,
|
|
3741
3739
|
isLoadingThread: n,
|
|
3742
3740
|
lastTurnInProgress: fs(e.at(-1)),
|
|
@@ -3746,8 +3744,8 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3746
3744
|
viewportRef: j,
|
|
3747
3745
|
contentRef: M
|
|
3748
3746
|
});
|
|
3749
|
-
let
|
|
3750
|
-
let r = n === e.length - 1, i = fs(t), a = r &&
|
|
3747
|
+
let I = e[e.length - 1], ae = I?.status === "working", oe = fa(ae), se = I?.status === "asking" ? O.ai.askingQuestions : ae ? I.thinking?.titles.at(-1) ?? O.ai.thinkingNow : "", ce = na(e.flatMap((e) => e.assistantMessages.flatMap((e) => e.id ? [e.id] : [])), n), ue = (t, n) => {
|
|
3748
|
+
let r = n === e.length - 1, i = fs(t), a = r && ae, o = t.thinking ?? (a ? { titles: [] } : null), s = t.assistantMessages.some(ms), c = {
|
|
3751
3749
|
renderToolCall: d,
|
|
3752
3750
|
onReplyQuote: f,
|
|
3753
3751
|
onRendered: m,
|
|
@@ -3759,36 +3757,36 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3759
3757
|
inProgress: i,
|
|
3760
3758
|
index: t,
|
|
3761
3759
|
isCurrentMessage: !1,
|
|
3762
|
-
AssistantMessage:
|
|
3763
|
-
UserMessage:
|
|
3760
|
+
AssistantMessage: k,
|
|
3761
|
+
UserMessage: ee,
|
|
3764
3762
|
onRegenerate: C,
|
|
3765
3763
|
onCopy: w,
|
|
3766
3764
|
rawData: e.rawData || {},
|
|
3767
3765
|
...c
|
|
3768
3766
|
};
|
|
3769
|
-
return /* @__PURE__ */ X(
|
|
3767
|
+
return /* @__PURE__ */ X(ee, { ...r }, `${n}-u-${t}`);
|
|
3770
3768
|
}, u = (e, a) => {
|
|
3771
3769
|
let o = r && a === t.assistantMessages.length - 1, s = t.userMessages.length + a, l = {
|
|
3772
3770
|
message: e,
|
|
3773
3771
|
inProgress: i,
|
|
3774
3772
|
index: s,
|
|
3775
3773
|
isCurrentMessage: o,
|
|
3776
|
-
AssistantMessage:
|
|
3777
|
-
UserMessage:
|
|
3774
|
+
AssistantMessage: k,
|
|
3775
|
+
UserMessage: ee,
|
|
3778
3776
|
onRegenerate: C,
|
|
3779
3777
|
onCopy: w,
|
|
3780
3778
|
rawData: e.rawData || {},
|
|
3781
3779
|
...c
|
|
3782
3780
|
};
|
|
3783
|
-
return /* @__PURE__ */ X(
|
|
3781
|
+
return /* @__PURE__ */ X(k, {
|
|
3784
3782
|
...l,
|
|
3785
3783
|
isGenerating: i && o,
|
|
3786
|
-
isLive: i ||
|
|
3784
|
+
isLive: i || ce(e.id),
|
|
3787
3785
|
isLoading: i && o && !ms(e)
|
|
3788
3786
|
}, `${n}-a-${a}`);
|
|
3789
3787
|
};
|
|
3790
3788
|
return /* @__PURE__ */ Z("div", {
|
|
3791
|
-
ref: r ?
|
|
3789
|
+
ref: r ? P : void 0,
|
|
3792
3790
|
className: "group/turn flex flex-col items-start justify-start gap-2 px-1",
|
|
3793
3791
|
[sa]: n,
|
|
3794
3792
|
style: { minHeight: r && re || void 0 },
|
|
@@ -3801,7 +3799,7 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3801
3799
|
o ? /* @__PURE__ */ X(Mo, {
|
|
3802
3800
|
titles: o.titles,
|
|
3803
3801
|
isThinking: a,
|
|
3804
|
-
startedAt: r ?
|
|
3802
|
+
startedAt: r ? oe : null
|
|
3805
3803
|
}) : null,
|
|
3806
3804
|
t.assistantMessages.map((e, t) => u(e, t)),
|
|
3807
3805
|
/* @__PURE__ */ X(Po, { turn: t }),
|
|
@@ -3824,27 +3822,27 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3824
3822
|
/* @__PURE__ */ X("div", {
|
|
3825
3823
|
role: "status",
|
|
3826
3824
|
className: "sr-only",
|
|
3827
|
-
children:
|
|
3825
|
+
children: se
|
|
3828
3826
|
}),
|
|
3829
3827
|
/* @__PURE__ */ X("div", {
|
|
3830
3828
|
ref: j,
|
|
3831
3829
|
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
3830
|
children: /* @__PURE__ */ Z("div", {
|
|
3833
3831
|
ref: M,
|
|
3834
|
-
className: i("flex min-h-full flex-col items-center px-4 pt-4",
|
|
3832
|
+
className: i("flex min-h-full flex-col items-center px-4 pt-4", te ? "pb-[calc(1rem+var(--f0-ai-composer-overlap,0px))]" : "pb-[calc(3rem+var(--f0-ai-composer-overlap,0px))]"),
|
|
3835
3833
|
children: [
|
|
3836
3834
|
/* @__PURE__ */ Z("div", {
|
|
3837
|
-
className: i(
|
|
3835
|
+
className: i(te ? "flex flex-1 px-1" : "flex flex-col gap-6", "w-full max-w-content"),
|
|
3838
3836
|
children: [
|
|
3839
3837
|
n ? /* @__PURE__ */ X(xo, {}) : null,
|
|
3840
|
-
|
|
3841
|
-
phrase:
|
|
3838
|
+
te ? /* @__PURE__ */ X(us, {
|
|
3839
|
+
phrase: A,
|
|
3842
3840
|
caption: o,
|
|
3843
3841
|
subtitle: s,
|
|
3844
3842
|
prompts: u,
|
|
3845
3843
|
onClick: l
|
|
3846
3844
|
}) : null,
|
|
3847
|
-
n ? null : e.map((e, t) =>
|
|
3845
|
+
n ? null : e.map((e, t) => ue(e, t)),
|
|
3848
3846
|
r
|
|
3849
3847
|
]
|
|
3850
3848
|
}),
|
|
@@ -3860,7 +3858,7 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3860
3858
|
]
|
|
3861
3859
|
})
|
|
3862
3860
|
}),
|
|
3863
|
-
/* @__PURE__ */ X(c, { children:
|
|
3861
|
+
/* @__PURE__ */ X(c, { children: F ? /* @__PURE__ */ X(p.div, {
|
|
3864
3862
|
className: "pointer-events-none absolute inset-x-0 bottom-[calc(var(--f0-ai-composer-overlap,0px)+1rem)] z-20 flex justify-center",
|
|
3865
3863
|
initial: {
|
|
3866
3864
|
opacity: 0,
|
|
@@ -3875,12 +3873,12 @@ function ps({ turns: e, isLoadingThread: n = !1, interrupt: r, initialMessage: a
|
|
|
3875
3873
|
scale: .8
|
|
3876
3874
|
},
|
|
3877
3875
|
transition: { duration: .2 },
|
|
3878
|
-
children: /* @__PURE__ */ X(
|
|
3876
|
+
children: /* @__PURE__ */ X(le, {
|
|
3879
3877
|
label: O.ai.scrollToBottom,
|
|
3880
3878
|
onClick: () => ie()
|
|
3881
3879
|
})
|
|
3882
3880
|
}) : null }),
|
|
3883
|
-
y ? null : /* @__PURE__ */ X(pa, { visible:
|
|
3881
|
+
y ? null : /* @__PURE__ */ X(pa, { visible: ne })
|
|
3884
3882
|
]
|
|
3885
3883
|
}), T.isOpen ? /* @__PURE__ */ X(yo, {
|
|
3886
3884
|
onSubmit: E,
|
|
@@ -3893,8 +3891,8 @@ var ms = (e) => !!Zi(e.content) || Xi(e).length > 0;
|
|
|
3893
3891
|
//#endregion
|
|
3894
3892
|
//#region src/addons/ai/F0AiMessagesContainer/F0AiMessagesContainer.tsx
|
|
3895
3893
|
function hs(e) {
|
|
3896
|
-
let t =
|
|
3897
|
-
return e.filePreviews || !t.provided ? /* @__PURE__ */ X(
|
|
3894
|
+
let t = et(), n = /* @__PURE__ */ X(Ri, { children: /* @__PURE__ */ X(ps, { ...e }) });
|
|
3895
|
+
return e.filePreviews || !t.provided ? /* @__PURE__ */ X(Je, {
|
|
3898
3896
|
filePreviews: e.filePreviews,
|
|
3899
3897
|
children: n
|
|
3900
3898
|
}) : n;
|
|
@@ -3916,7 +3914,7 @@ function ys() {
|
|
|
3916
3914
|
//#endregion
|
|
3917
3915
|
//#region src/addons/ai/F0AiChat/providers/useCanvasEntities.ts
|
|
3918
3916
|
function bs() {
|
|
3919
|
-
let { canvasEntities: e } =
|
|
3917
|
+
let { canvasEntities: e } = I();
|
|
3920
3918
|
return e;
|
|
3921
3919
|
}
|
|
3922
3920
|
//#endregion
|
|
@@ -3952,7 +3950,7 @@ var Ss = ({ canProceed: e, submitDisabled: n, label: r, onConfirm: i, onSkip: a,
|
|
|
3952
3950
|
className: i("flex h-5 w-5 shrink-0 items-center justify-center rounded-full transition-colors", e ? "bg-f1-background-selected-bold" : "border-2 border-solid border-f1-border bg-f1-background"),
|
|
3953
3951
|
children: e ? /* @__PURE__ */ X("div", { className: "h-2 w-2 rounded-full bg-f1-background" }) : null
|
|
3954
3952
|
}), ws = 132, Ts = ({ mode: e, hasSelection: n, hasCustomText: r, customAnswerText: a, isCustomAnswerActive: o, canProceed: s, inputRef: c, onActivate: l, onChangeText: u, onToggleActive: d, onConfirm: f }) => {
|
|
3955
|
-
let p = t().ai.clarifyingQuestion.typeYourAnswer, m = J(null), h =
|
|
3953
|
+
let p = t().ai.clarifyingQuestion.typeYourAnswer, m = J(null), h = bn(m, c);
|
|
3956
3954
|
Vn(() => {
|
|
3957
3955
|
let e = m.current;
|
|
3958
3956
|
if (!e) return;
|
|
@@ -4139,7 +4137,7 @@ var Ds = [
|
|
|
4139
4137
|
disabled: r,
|
|
4140
4138
|
label: l.ai.clarifyingQuestion.back,
|
|
4141
4139
|
hideLabel: !0,
|
|
4142
|
-
icon:
|
|
4140
|
+
icon: dn
|
|
4143
4141
|
}),
|
|
4144
4142
|
/* @__PURE__ */ X("span", {
|
|
4145
4143
|
className: "translate-y-px text-sm font-semibold text-f1-foreground-tertiary",
|
|
@@ -4153,7 +4151,7 @@ var Ds = [
|
|
|
4153
4151
|
disabled: i || !a,
|
|
4154
4152
|
label: l.ai.clarifyingQuestion.next,
|
|
4155
4153
|
hideLabel: !0,
|
|
4156
|
-
icon:
|
|
4154
|
+
icon: vn
|
|
4157
4155
|
})
|
|
4158
4156
|
]
|
|
4159
4157
|
}) : null,
|
|
@@ -4164,7 +4162,7 @@ var Ds = [
|
|
|
4164
4162
|
onClick: c,
|
|
4165
4163
|
label: l.actions.cancel,
|
|
4166
4164
|
hideLabel: !0,
|
|
4167
|
-
icon:
|
|
4165
|
+
icon: $e
|
|
4168
4166
|
})
|
|
4169
4167
|
]
|
|
4170
4168
|
});
|
|
@@ -4172,26 +4170,26 @@ var Ds = [
|
|
|
4172
4170
|
clarifyingQuestion: e,
|
|
4173
4171
|
isSubmitDisabled: t
|
|
4174
4172
|
}), Rs = ({ clarifyingQuestion: e, isSubmitDisabled: n }) => {
|
|
4175
|
-
let r = t(), i = u(), { currentStep: a, currentStepIndex: o, totalSteps: s, toggleOption: l, confirm: d, 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",
|
|
4173
|
+
let r = t(), i = u(), { currentStep: a, currentStepIndex: o, totalSteps: s, toggleOption: l, confirm: d, 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", k = s > 1, ee = o === 0, A = o === s - 1, te = k ? r.t("ai.clarifyingQuestion.stepOf", {
|
|
4176
4174
|
current: String(o + 1),
|
|
4177
4175
|
total: String(s)
|
|
4178
|
-
}) : void 0, j = x.length > 0, M = (T ?? "").trim().length > 0, N = j || E && M || C === !0,
|
|
4179
|
-
|
|
4180
|
-
},
|
|
4181
|
-
|
|
4176
|
+
}) : void 0, j = x.length > 0, M = (T ?? "").trim().length > 0, N = j || E && M || C === !0, P = n === !0 && A, F = () => {
|
|
4177
|
+
P || d();
|
|
4178
|
+
}, ne = () => {
|
|
4179
|
+
P || f();
|
|
4182
4180
|
}, re = (e) => {
|
|
4183
4181
|
let t = O === "single" && x.includes(e);
|
|
4184
|
-
l(e), O === "single" && !
|
|
4185
|
-
}, ie =
|
|
4182
|
+
l(e), O === "single" && !A && !t && Promise.resolve().then(d);
|
|
4183
|
+
}, ie = A ? r.ai.clarifyingQuestion.submit : r.ai.clarifyingQuestion.next, I = C === !0 && !j && !(E && M), ae = () => {
|
|
4186
4184
|
v(), requestAnimationFrame(() => {
|
|
4187
4185
|
D.current?.focus();
|
|
4188
4186
|
});
|
|
4189
|
-
},
|
|
4187
|
+
}, oe = (e) => {
|
|
4190
4188
|
e.key === "Escape" && (e.preventDefault(), m());
|
|
4191
|
-
},
|
|
4189
|
+
}, se = i ? 0 : Fs, ce = i ? 0 : Is;
|
|
4192
4190
|
return /* @__PURE__ */ Z("div", {
|
|
4193
4191
|
className: "flex flex-col",
|
|
4194
|
-
onKeyDown:
|
|
4192
|
+
onKeyDown: oe,
|
|
4195
4193
|
children: [/* @__PURE__ */ X("div", {
|
|
4196
4194
|
className: "flex flex-col gap-3 pt-3",
|
|
4197
4195
|
children: /* @__PURE__ */ X(c, {
|
|
@@ -4203,22 +4201,22 @@ var Ds = [
|
|
|
4203
4201
|
animate: {
|
|
4204
4202
|
opacity: 1,
|
|
4205
4203
|
transition: {
|
|
4206
|
-
duration:
|
|
4204
|
+
duration: se,
|
|
4207
4205
|
ease: Ps
|
|
4208
4206
|
}
|
|
4209
4207
|
},
|
|
4210
4208
|
exit: {
|
|
4211
4209
|
opacity: 0,
|
|
4212
4210
|
transition: {
|
|
4213
|
-
duration:
|
|
4211
|
+
duration: ce,
|
|
4214
4212
|
ease: Ps
|
|
4215
4213
|
}
|
|
4216
4214
|
},
|
|
4217
4215
|
children: [/* @__PURE__ */ X(Ns, {
|
|
4218
4216
|
question: y,
|
|
4219
|
-
stepLabel:
|
|
4220
|
-
isFirstStep:
|
|
4221
|
-
isFinalStep:
|
|
4217
|
+
stepLabel: te,
|
|
4218
|
+
isFirstStep: ee,
|
|
4219
|
+
isFinalStep: A,
|
|
4222
4220
|
canProceed: N,
|
|
4223
4221
|
onBack: h,
|
|
4224
4222
|
onNext: d,
|
|
@@ -4236,20 +4234,20 @@ var Ds = [
|
|
|
4236
4234
|
canProceed: N,
|
|
4237
4235
|
customInputRef: D,
|
|
4238
4236
|
onToggleOption: re,
|
|
4239
|
-
onActivateCustom:
|
|
4237
|
+
onActivateCustom: ae,
|
|
4240
4238
|
onChangeCustomText: g,
|
|
4241
4239
|
onToggleCustomActive: _,
|
|
4242
|
-
onConfirm:
|
|
4240
|
+
onConfirm: F
|
|
4243
4241
|
})]
|
|
4244
4242
|
}, o)
|
|
4245
4243
|
})
|
|
4246
4244
|
}), /* @__PURE__ */ X(Ss, {
|
|
4247
4245
|
canProceed: N,
|
|
4248
|
-
submitDisabled:
|
|
4246
|
+
submitDisabled: P,
|
|
4249
4247
|
label: ie,
|
|
4250
|
-
onConfirm:
|
|
4251
|
-
onSkip:
|
|
4252
|
-
showSkip:
|
|
4248
|
+
onConfirm: F,
|
|
4249
|
+
onSkip: ne,
|
|
4250
|
+
showSkip: I
|
|
4253
4251
|
})]
|
|
4254
4252
|
});
|
|
4255
4253
|
};
|
|
@@ -4575,13 +4573,13 @@ var Ks = class {
|
|
|
4575
4573
|
repeatType: "mirror"
|
|
4576
4574
|
};
|
|
4577
4575
|
function $s(e) {
|
|
4578
|
-
let [t, n] = Y(e), r =
|
|
4576
|
+
let [t, n] = Y(e), r = ae(e), i = J(null);
|
|
4579
4577
|
return Gn(r, "change", (e) => n(e)), {
|
|
4580
4578
|
value: t,
|
|
4581
4579
|
motionValue: r,
|
|
4582
4580
|
controls: i,
|
|
4583
4581
|
animate: G((e, t) => {
|
|
4584
|
-
i.current =
|
|
4582
|
+
i.current = A(r, e, t);
|
|
4585
4583
|
}, [r])
|
|
4586
4584
|
};
|
|
4587
4585
|
}
|
|
@@ -4851,9 +4849,9 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4851
4849
|
Array.isArray(i.value) || (i.value = []);
|
|
4852
4850
|
let a = i.value;
|
|
4853
4851
|
a[t * 3] = n * l, a[t * 3 + 1] = r * l, a[t * 3 + 2] = 0;
|
|
4854
|
-
},
|
|
4852
|
+
}, k = () => {
|
|
4855
4853
|
p.current && (m.current = p.current.getContext("webgl", s) || p.current.getContext("experimental-webgl", s), m.current?.getExtension("OES_standard_derivatives"), m.current?.getExtension("EXT_shader_texture_lod"));
|
|
4856
|
-
},
|
|
4854
|
+
}, ee = () => {
|
|
4857
4855
|
let e = m.current;
|
|
4858
4856
|
h.current = e?.createBuffer() ?? null, e?.bindBuffer(e.ARRAY_BUFFER, h.current), e?.bufferData(e.ARRAY_BUFFER, new Float32Array([
|
|
4859
4857
|
1,
|
|
@@ -4869,14 +4867,14 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4869
4867
|
-1,
|
|
4870
4868
|
0
|
|
4871
4869
|
]), e.STATIC_DRAW);
|
|
4872
|
-
},
|
|
4870
|
+
}, A = ({ alpha: e, beta: t, gamma: n }) => {
|
|
4873
4871
|
E.current.iDeviceOrientation.value = [
|
|
4874
4872
|
e ?? 0,
|
|
4875
4873
|
t ?? 0,
|
|
4876
4874
|
n ?? 0,
|
|
4877
4875
|
window.orientation ?? 0
|
|
4878
4876
|
];
|
|
4879
|
-
},
|
|
4877
|
+
}, te = (e) => {
|
|
4880
4878
|
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
4879
|
y.current = !0;
|
|
4882
4880
|
let a = Array.isArray(E.current.iMouse?.value) ? E.current.iMouse.value : void 0;
|
|
@@ -4901,7 +4899,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4901
4899
|
let t = e.getUniformLocation(g.current, uc);
|
|
4902
4900
|
e.uniform2fv(t, [e.canvas.width, e.canvas.height]);
|
|
4903
4901
|
}
|
|
4904
|
-
},
|
|
4902
|
+
}, P = (e, t) => {
|
|
4905
4903
|
let n = m.current;
|
|
4906
4904
|
if (!n) return null;
|
|
4907
4905
|
let r = n.createShader(e);
|
|
@@ -4912,12 +4910,12 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4912
4910
|
n.deleteShader(r), d?.(Ec(`Shader compiler log: ${e}`));
|
|
4913
4911
|
}
|
|
4914
4912
|
return r;
|
|
4915
|
-
},
|
|
4913
|
+
}, F = (e, t) => {
|
|
4916
4914
|
let n = m.current;
|
|
4917
4915
|
if (!n) return;
|
|
4918
|
-
let r =
|
|
4916
|
+
let r = P(n.FRAGMENT_SHADER, e), i = P(n.VERTEX_SHADER, t);
|
|
4919
4917
|
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
|
-
},
|
|
4918
|
+
}, ne = () => {
|
|
4921
4919
|
if (r) for (let e of Object.keys(r)) {
|
|
4922
4920
|
let t = r[e];
|
|
4923
4921
|
if (!t) continue;
|
|
@@ -4962,7 +4960,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
4962
4960
|
r = kc(r, `uniform ${e.type} ${t}${e.arraySize || ""}; \n`, r.lastIndexOf(n) + n.length), e.isNeeded = !0;
|
|
4963
4961
|
}
|
|
4964
4962
|
return e.includes("mainImage") && (r = r.concat(nc)), r;
|
|
4965
|
-
},
|
|
4963
|
+
}, I = (e) => {
|
|
4966
4964
|
let t = m.current;
|
|
4967
4965
|
if (!t || !g.current) return;
|
|
4968
4966
|
let n = w.current ? (e - w.current) / 1e3 : 0;
|
|
@@ -5021,31 +5019,31 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5021
5019
|
t.activeTexture(t.TEXTURE0 + e), t.bindTexture(t.TEXTURE_2D, i), t.uniform1i(s, e), r && n.updateTexture(i, a, o);
|
|
5022
5020
|
}
|
|
5023
5021
|
}
|
|
5024
|
-
},
|
|
5022
|
+
}, ae = (e) => {
|
|
5025
5023
|
let t = m.current;
|
|
5026
5024
|
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),
|
|
5025
|
+
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), I(e), t.drawArrays(t.TRIANGLE_STRIP, 0, 4);
|
|
5028
5026
|
let n = E.current.iMouse?.value;
|
|
5029
5027
|
if (E.current.iMouse?.isNeeded && c !== 1 && Array.isArray(n)) {
|
|
5030
5028
|
let e = n[0] ?? 0, t = n[1] ?? 0;
|
|
5031
5029
|
n[0] = Oc(e, S.current[0] ?? 0, c), n[1] = Oc(t, S.current[1] ?? 0, c);
|
|
5032
5030
|
}
|
|
5033
|
-
v.current = requestAnimationFrame(
|
|
5034
|
-
},
|
|
5031
|
+
v.current = requestAnimationFrame(ae);
|
|
5032
|
+
}, oe = () => {
|
|
5035
5033
|
let e = { passive: !0 };
|
|
5036
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", j, e), p.current.addEventListener("mouseout", M, e), p.current.addEventListener("mouseup", M, e), p.current.addEventListener("mousedown",
|
|
5037
|
-
},
|
|
5034
|
+
E.current.iMouse?.isNeeded && p.current && (p.current.addEventListener("mousemove", j, e), p.current.addEventListener("mouseout", M, e), p.current.addEventListener("mouseup", M, e), p.current.addEventListener("mousedown", te, e), p.current.addEventListener("touchmove", j, e), p.current.addEventListener("touchend", M, e), p.current.addEventListener("touchstart", te, e)), E.current.iDeviceOrientation?.isNeeded && window.addEventListener("deviceorientation", A, e), p.current && (T.current = new ResizeObserver(N), T.current.observe(p.current), window.addEventListener("resize", N, e));
|
|
5035
|
+
}, se = () => {
|
|
5038
5036
|
let e = { passive: !0 };
|
|
5039
|
-
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", j, e), p.current.removeEventListener("mouseout", M, e), p.current.removeEventListener("mouseup", M, e), p.current.removeEventListener("mousedown",
|
|
5037
|
+
E.current.iMouse?.isNeeded && p.current && (p.current.removeEventListener("mousemove", j, e), p.current.removeEventListener("mouseout", M, e), p.current.removeEventListener("mouseup", M, e), p.current.removeEventListener("mousedown", te, e), p.current.removeEventListener("touchmove", j, e), p.current.removeEventListener("touchend", M, e), p.current.removeEventListener("touchstart", te, e)), E.current.iDeviceOrientation?.isNeeded && window.removeEventListener("deviceorientation", A, e), T.current && (T.current.disconnect(), window.removeEventListener("resize", N, e));
|
|
5040
5038
|
};
|
|
5041
5039
|
return K(() => {
|
|
5042
5040
|
D.current = r;
|
|
5043
5041
|
}, [r]), K(() => {
|
|
5044
5042
|
let n = C.current;
|
|
5045
5043
|
function r() {
|
|
5046
|
-
|
|
5044
|
+
k();
|
|
5047
5045
|
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,
|
|
5046
|
+
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, ne(), re(), F(ie(e || rc), t || ic), ee(), requestAnimationFrame(ae), oe(), N());
|
|
5049
5047
|
}
|
|
5050
5048
|
return requestAnimationFrame(r), () => {
|
|
5051
5049
|
let e = m.current;
|
|
@@ -5053,7 +5051,7 @@ function Ac({ fs: e, vs: t = ic, textures: n = [], uniforms: r, clearColor: i =
|
|
|
5053
5051
|
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
5052
|
g.current = null;
|
|
5055
5053
|
}
|
|
5056
|
-
|
|
5054
|
+
se(), cancelAnimationFrame(v.current ?? 0);
|
|
5057
5055
|
};
|
|
5058
5056
|
}, []), /* @__PURE__ */ X("canvas", {
|
|
5059
5057
|
ref: p,
|
|
@@ -5192,7 +5190,7 @@ function Fc({ size: e = "lg", state: t, color: n, colorShift: r = .05, audioTrac
|
|
|
5192
5190
|
}
|
|
5193
5191
|
//#endregion
|
|
5194
5192
|
//#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(
|
|
5193
|
+
var Ic = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm: i, cancelText: a, onCancel: o, stackAt: s = "sm" }) => /* @__PURE__ */ X(Be, {
|
|
5196
5194
|
title: e,
|
|
5197
5195
|
description: t,
|
|
5198
5196
|
avatar: n,
|
|
@@ -5267,32 +5265,32 @@ var Ic = ({ text: e, description: t, avatar: n, confirmationText: r, onConfirm:
|
|
|
5267
5265
|
let { label: t } = e;
|
|
5268
5266
|
return e.content === "person" ? /* @__PURE__ */ X(Uc, {
|
|
5269
5267
|
label: t,
|
|
5270
|
-
children: /* @__PURE__ */ X(
|
|
5268
|
+
children: /* @__PURE__ */ X(on, {
|
|
5271
5269
|
firstName: e.avatar.firstName,
|
|
5272
5270
|
lastName: e.avatar.lastName,
|
|
5273
5271
|
src: e.avatar.src,
|
|
5274
5272
|
size: "xs"
|
|
5275
5273
|
})
|
|
5276
|
-
}) : e.content === "people" ? /* @__PURE__ */ X(
|
|
5274
|
+
}) : e.content === "people" ? /* @__PURE__ */ X(rn, {
|
|
5277
5275
|
type: "person",
|
|
5278
5276
|
avatars: e.avatars,
|
|
5279
5277
|
size: "md",
|
|
5280
5278
|
max: 3
|
|
5281
5279
|
}) : e.content === "team" ? /* @__PURE__ */ X(Uc, {
|
|
5282
5280
|
label: t,
|
|
5283
|
-
children: /* @__PURE__ */ X(
|
|
5281
|
+
children: /* @__PURE__ */ X(an, {
|
|
5284
5282
|
name: e.avatar.name,
|
|
5285
5283
|
src: e.avatar.src,
|
|
5286
5284
|
size: "xs"
|
|
5287
5285
|
})
|
|
5288
5286
|
}) : e.content === "company" ? /* @__PURE__ */ X(Uc, {
|
|
5289
5287
|
label: t,
|
|
5290
|
-
children: /* @__PURE__ */ X(
|
|
5288
|
+
children: /* @__PURE__ */ X(Zt, {
|
|
5291
5289
|
name: e.avatar.name,
|
|
5292
5290
|
src: e.avatar.src,
|
|
5293
5291
|
size: "xs"
|
|
5294
5292
|
})
|
|
5295
|
-
}) : e.content === "alert" ? /* @__PURE__ */ X(
|
|
5293
|
+
}) : e.content === "alert" ? /* @__PURE__ */ X(ln, {
|
|
5296
5294
|
text: e.alertLabel,
|
|
5297
5295
|
level: e.level
|
|
5298
5296
|
}) : e.content === "balance" ? /* @__PURE__ */ X(Wc, { balance: e.balance }) : null;
|
|
@@ -5365,10 +5363,10 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5365
5363
|
className: "relative w-full flex-1",
|
|
5366
5364
|
role: "img",
|
|
5367
5365
|
"aria-label": `Sparkline chart showing ${i} trend`,
|
|
5368
|
-
children: [/* @__PURE__ */ X(
|
|
5366
|
+
children: [/* @__PURE__ */ X(Ft, {
|
|
5369
5367
|
width: "100%",
|
|
5370
5368
|
height: "100%",
|
|
5371
|
-
children: /* @__PURE__ */ Z(
|
|
5369
|
+
children: /* @__PURE__ */ Z(ut, {
|
|
5372
5370
|
data: e,
|
|
5373
5371
|
margin: {
|
|
5374
5372
|
top: 4,
|
|
@@ -5393,11 +5391,11 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5393
5391
|
stopOpacity: .02
|
|
5394
5392
|
})]
|
|
5395
5393
|
}) }),
|
|
5396
|
-
/* @__PURE__ */ X(
|
|
5394
|
+
/* @__PURE__ */ X(st, {
|
|
5397
5395
|
hide: !0,
|
|
5398
5396
|
domain: ["dataMin - 1", "dataMax + 1"]
|
|
5399
5397
|
}),
|
|
5400
|
-
/* @__PURE__ */ X(
|
|
5398
|
+
/* @__PURE__ */ X(L, {
|
|
5401
5399
|
type: "linear",
|
|
5402
5400
|
dataKey: "value",
|
|
5403
5401
|
stroke: a.stroke,
|
|
@@ -5484,7 +5482,7 @@ var Yc = ({ cx: e, cy: t, index: n, dataLength: r, color: i }) => n !== r - 1 ||
|
|
|
5484
5482
|
});
|
|
5485
5483
|
});
|
|
5486
5484
|
Qc.displayName = "F0AiInsightCard";
|
|
5487
|
-
var $c = e(
|
|
5485
|
+
var $c = e(tt(Qc, () => /* @__PURE__ */ Z("div", {
|
|
5488
5486
|
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
5487
|
"aria-busy": "true",
|
|
5490
5488
|
"aria-live": "polite",
|
|
@@ -5518,7 +5516,7 @@ function ol(e) {
|
|
|
5518
5516
|
children: [
|
|
5519
5517
|
/* @__PURE__ */ Z("div", {
|
|
5520
5518
|
className: "flex items-center gap-3 px-4 py-3",
|
|
5521
|
-
children: [t ? /* @__PURE__ */ X(
|
|
5519
|
+
children: [t ? /* @__PURE__ */ X(Qt, {
|
|
5522
5520
|
module: t,
|
|
5523
5521
|
size: "md"
|
|
5524
5522
|
}) : null, /* @__PURE__ */ Z("div", {
|
|
@@ -5569,11 +5567,11 @@ ol.displayName = "F0AiProposalCard";
|
|
|
5569
5567
|
//#region src/blocks/ai/F0AiMessageSources/components/CollapsibleMessage.tsx
|
|
5570
5568
|
var sl = ({ icon: e, title: t, children: n }) => {
|
|
5571
5569
|
let [r, i] = Y(!1), a = u();
|
|
5572
|
-
return /* @__PURE__ */ Z(
|
|
5570
|
+
return /* @__PURE__ */ Z(Qe, {
|
|
5573
5571
|
className: "mb-1 w-full",
|
|
5574
5572
|
open: r,
|
|
5575
5573
|
onOpenChange: i,
|
|
5576
|
-
children: [/* @__PURE__ */ Z(
|
|
5574
|
+
children: [/* @__PURE__ */ Z(gt, {
|
|
5577
5575
|
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
5576
|
children: [
|
|
5579
5577
|
/* @__PURE__ */ X("span", {
|
|
@@ -5588,11 +5586,11 @@ var sl = ({ icon: e, title: t, children: n }) => {
|
|
|
5588
5586
|
children: t
|
|
5589
5587
|
}),
|
|
5590
5588
|
/* @__PURE__ */ X(U, {
|
|
5591
|
-
icon:
|
|
5589
|
+
icon: vn,
|
|
5592
5590
|
className: "h-4 w-4 transition-transform duration-200"
|
|
5593
5591
|
})
|
|
5594
5592
|
]
|
|
5595
|
-
}), /* @__PURE__ */ X(
|
|
5593
|
+
}), /* @__PURE__ */ X(St, {
|
|
5596
5594
|
forceMount: !0,
|
|
5597
5595
|
className: "data-[state=open]:mt-3",
|
|
5598
5596
|
children: /* @__PURE__ */ X(p.div, {
|
|
@@ -5616,7 +5614,7 @@ var sl = ({ icon: e, title: t, children: n }) => {
|
|
|
5616
5614
|
})
|
|
5617
5615
|
})]
|
|
5618
5616
|
});
|
|
5619
|
-
}, cl = (e) => Ee[e] ??
|
|
5617
|
+
}, cl = (e) => Ee[e] ?? On, ll = ({ iconName: e }) => e ? /* @__PURE__ */ X("div", {
|
|
5620
5618
|
className: "mr-1 flex items-center justify-center",
|
|
5621
5619
|
children: /* @__PURE__ */ X(U, {
|
|
5622
5620
|
icon: cl(e),
|
|
@@ -5629,7 +5627,7 @@ function ul({ sources: e, title: n }) {
|
|
|
5629
5627
|
if (!e || e.length === 0 || !Array.isArray(e)) return null;
|
|
5630
5628
|
let i = n ?? r.ai.resourcesGroupTitle;
|
|
5631
5629
|
return /* @__PURE__ */ X(sl, {
|
|
5632
|
-
icon:
|
|
5630
|
+
icon: en,
|
|
5633
5631
|
title: i,
|
|
5634
5632
|
children: /* @__PURE__ */ X("div", {
|
|
5635
5633
|
className: "flex flex-col gap-1 rounded-lg border border-solid border-f1-border-secondary p-2",
|
|
@@ -5697,14 +5695,14 @@ function ml({ indicator: e }) {
|
|
|
5697
5695
|
return /* @__PURE__ */ Z("div", {
|
|
5698
5696
|
className: "group/conversations relative flex shrink-0",
|
|
5699
5697
|
children: [
|
|
5700
|
-
/* @__PURE__ */ X(
|
|
5698
|
+
/* @__PURE__ */ X(xn, {
|
|
5701
5699
|
asChild: !0,
|
|
5702
5700
|
children: /* @__PURE__ */ X(f, {
|
|
5703
5701
|
variant: "ghost",
|
|
5704
5702
|
hideLabel: !0,
|
|
5705
5703
|
label: n.ai.conversations,
|
|
5706
5704
|
"aria-describedby": i ? r : void 0,
|
|
5707
|
-
icon:
|
|
5705
|
+
icon: Oe
|
|
5708
5706
|
})
|
|
5709
5707
|
}),
|
|
5710
5708
|
/* @__PURE__ */ X("span", {
|
|
@@ -5780,7 +5778,7 @@ function vl({ label: e, onClick: t }) {
|
|
|
5780
5778
|
variant: "ghost",
|
|
5781
5779
|
hideLabel: !0,
|
|
5782
5780
|
label: e,
|
|
5783
|
-
icon:
|
|
5781
|
+
icon: nt,
|
|
5784
5782
|
onClick: t
|
|
5785
5783
|
})
|
|
5786
5784
|
}) : null
|
|
@@ -5806,11 +5804,11 @@ function xl(e) {
|
|
|
5806
5804
|
e.detail !== 0 && (e.preventDefault(), e.stopPropagation());
|
|
5807
5805
|
}
|
|
5808
5806
|
var Sl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode: r, onClose: a, onNewChat: o, history: s, historyIndicator: c, historyOpen: l, onHistoryOpenChange: d }) => {
|
|
5809
|
-
let m = t(), h = u(), g = e?.trim() ?? "", { panelOverlays: _ } =
|
|
5810
|
-
return /* @__PURE__ */ Z(
|
|
5807
|
+
let m = t(), h = u(), g = e?.trim() ?? "", { panelOverlays: _ } = I(), [v, y] = Y(null), b = bl();
|
|
5808
|
+
return /* @__PURE__ */ Z(Tn, {
|
|
5811
5809
|
open: l,
|
|
5812
5810
|
onOpenChange: d,
|
|
5813
|
-
children: [/* @__PURE__ */ X(
|
|
5811
|
+
children: [/* @__PURE__ */ X(wn, {
|
|
5814
5812
|
asChild: !0,
|
|
5815
5813
|
children: /* @__PURE__ */ Z("header", {
|
|
5816
5814
|
ref: y,
|
|
@@ -5839,21 +5837,21 @@ var Sl = ({ currentThreadTitle: e, fullscreen: n = !1, onToggleVisualizationMode
|
|
|
5839
5837
|
variant: "ghost",
|
|
5840
5838
|
hideLabel: !0,
|
|
5841
5839
|
label: n ? m.ai.collapseChat : m.ai.expandChat,
|
|
5842
|
-
icon: n ?
|
|
5840
|
+
icon: n ? zt : he,
|
|
5843
5841
|
onClick: r
|
|
5844
5842
|
}),
|
|
5845
5843
|
/* @__PURE__ */ X(f, {
|
|
5846
5844
|
variant: "ghost",
|
|
5847
5845
|
hideLabel: !0,
|
|
5848
5846
|
label: m.ai.closeChat,
|
|
5849
|
-
icon:
|
|
5847
|
+
icon: $e,
|
|
5850
5848
|
onClick: a
|
|
5851
5849
|
})
|
|
5852
5850
|
]
|
|
5853
5851
|
})
|
|
5854
5852
|
]
|
|
5855
5853
|
})
|
|
5856
|
-
}), s ? /* @__PURE__ */ X(
|
|
5854
|
+
}), s ? /* @__PURE__ */ X(Cn, {
|
|
5857
5855
|
container: v?.parentElement,
|
|
5858
5856
|
side: "bottom",
|
|
5859
5857
|
align: "start",
|
|
@@ -5872,10 +5870,10 @@ function Cl({ items: e }) {
|
|
|
5872
5870
|
let n = t();
|
|
5873
5871
|
return /* @__PURE__ */ X("div", {
|
|
5874
5872
|
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(
|
|
5873
|
+
children: /* @__PURE__ */ X(z, {
|
|
5876
5874
|
items: e,
|
|
5877
5875
|
children: /* @__PURE__ */ X(f, {
|
|
5878
|
-
icon:
|
|
5876
|
+
icon: En,
|
|
5879
5877
|
variant: "ghost",
|
|
5880
5878
|
size: "sm",
|
|
5881
5879
|
label: n.ai.threadOptions,
|
|
@@ -5907,7 +5905,7 @@ function wl({ id: e, status: n }) {
|
|
|
5907
5905
|
}), n === "running" ? /* @__PURE__ */ X(W, {
|
|
5908
5906
|
display: "flex",
|
|
5909
5907
|
"aria-hidden": "true",
|
|
5910
|
-
children: /* @__PURE__ */ X(
|
|
5908
|
+
children: /* @__PURE__ */ X(un, { size: "small" })
|
|
5911
5909
|
}) : /* @__PURE__ */ X(pl, { status: n })]
|
|
5912
5910
|
});
|
|
5913
5911
|
}
|
|
@@ -5923,7 +5921,7 @@ function Tl({ items: e, status: n, statusId: r, isPending: a }) {
|
|
|
5923
5921
|
alignItems: "center",
|
|
5924
5922
|
justifyContent: "center",
|
|
5925
5923
|
"aria-label": o.ai.threadOptions,
|
|
5926
|
-
children: /* @__PURE__ */ X(
|
|
5924
|
+
children: /* @__PURE__ */ X(un, { size: "small" })
|
|
5927
5925
|
}) : /* @__PURE__ */ Z("div", {
|
|
5928
5926
|
"data-testid": "thread-actions-slot",
|
|
5929
5927
|
className: n ? i("group/slot relative flex h-7 w-7 shrink-0 items-center justify-center", "[@media(hover:none)]:w-auto [@media(hover:none)]:gap-1", "[@media(pointer:coarse)]:w-auto [@media(pointer:coarse)]:gap-1") : "contents",
|
|
@@ -5939,16 +5937,16 @@ function Tl({ items: e, status: n, statusId: r, isPending: a }) {
|
|
|
5939
5937
|
//#endregion
|
|
5940
5938
|
//#region src/addons/ai/F0AiChatHistory/components/ThreadItem.tsx
|
|
5941
5939
|
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(), h = Rn(), g =
|
|
5940
|
+
let p = t(), h = Rn(), g = Et() === "two-level", _ = q(() => [
|
|
5943
5941
|
{
|
|
5944
5942
|
label: n ? p.ai.unpinChat : p.ai.pinChat,
|
|
5945
|
-
icon: n ?
|
|
5943
|
+
icon: n ? Xe : At,
|
|
5946
5944
|
onClick: () => n ? l(e.id) : c(e.id)
|
|
5947
5945
|
},
|
|
5948
5946
|
...d?.(e) ?? [],
|
|
5949
5947
|
{
|
|
5950
5948
|
label: p.ai.deleteChat,
|
|
5951
|
-
icon:
|
|
5949
|
+
icon: qe,
|
|
5952
5950
|
critical: !0,
|
|
5953
5951
|
onClick: () => u(e.id)
|
|
5954
5952
|
}
|
|
@@ -6022,7 +6020,7 @@ function Dl({ label: e, threads: t, pinnedIds: n, activeThreadId: r, onSelect: o
|
|
|
6022
6020
|
}), /* @__PURE__ */ X("span", {
|
|
6023
6021
|
className: i("flex opacity-0 transition-opacity duration-150 group-hover/label:opacity-100 group-focus-visible/label:opacity-100 motion-reduce:transition-none", !d && "opacity-100"),
|
|
6024
6022
|
children: /* @__PURE__ */ X(U, {
|
|
6025
|
-
icon: d ?
|
|
6023
|
+
icon: d ? tn : sn,
|
|
6026
6024
|
color: "secondary",
|
|
6027
6025
|
size: "xs"
|
|
6028
6026
|
})
|
|
@@ -6114,7 +6112,7 @@ function Nl({ value: e, onChange: n }) {
|
|
|
6114
6112
|
className: "flex h-12 shrink-0 items-center gap-2 border-0 border-b border-solid border-f1-border-secondary pl-5 pr-2",
|
|
6115
6113
|
children: [
|
|
6116
6114
|
/* @__PURE__ */ X(U, {
|
|
6117
|
-
icon:
|
|
6115
|
+
icon: en,
|
|
6118
6116
|
color: "secondary",
|
|
6119
6117
|
size: "md"
|
|
6120
6118
|
}),
|
|
@@ -6131,7 +6129,7 @@ function Nl({ value: e, onChange: n }) {
|
|
|
6131
6129
|
size: "sm",
|
|
6132
6130
|
hideLabel: !0,
|
|
6133
6131
|
label: r.actions.clear,
|
|
6134
|
-
icon:
|
|
6132
|
+
icon: $e,
|
|
6135
6133
|
onClick: () => n("")
|
|
6136
6134
|
}) : null
|
|
6137
6135
|
]
|
|
@@ -6159,7 +6157,7 @@ var Pl = () => {
|
|
|
6159
6157
|
//#region src/addons/ai/F0AiChatHistory/utils.ts
|
|
6160
6158
|
function Fl(e) {
|
|
6161
6159
|
let t = new Date(e), n = /* @__PURE__ */ new Date();
|
|
6162
|
-
return
|
|
6160
|
+
return ie(t) ? "today" : wt(t) ? "yesterday" : fn(t, n) ? "thisMonth" : "older";
|
|
6163
6161
|
}
|
|
6164
6162
|
function Il(e) {
|
|
6165
6163
|
let t = {
|
|
@@ -6214,7 +6212,7 @@ function Ll({ onClose: e, onSelectThread: n, onNewChat: r, actions: a, threads:
|
|
|
6214
6212
|
className: "flex flex-col gap-2",
|
|
6215
6213
|
children: [
|
|
6216
6214
|
r ? /* @__PURE__ */ X(Ml, {
|
|
6217
|
-
icon:
|
|
6215
|
+
icon: nt,
|
|
6218
6216
|
label: h.ai.startNewChat,
|
|
6219
6217
|
onClick: () => {
|
|
6220
6218
|
r(), e();
|
|
@@ -6310,11 +6308,11 @@ var Vl = [
|
|
|
6310
6308
|
"attention"
|
|
6311
6309
|
], Hl = "f0-ai-pinned-threads";
|
|
6312
6310
|
function Ul() {
|
|
6313
|
-
let e =
|
|
6311
|
+
let e = Ve(Hl, []);
|
|
6314
6312
|
return new Set(Array.isArray(e) ? e : []);
|
|
6315
6313
|
}
|
|
6316
6314
|
function Wl(e) {
|
|
6317
|
-
|
|
6315
|
+
xt(Hl, [...e]);
|
|
6318
6316
|
}
|
|
6319
6317
|
function Gl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, unpinThread: i }) {
|
|
6320
6318
|
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 +6382,7 @@ function Gl({ enabled: e = !1, fetchThreads: t, deleteThread: n, pinThread: r, u
|
|
|
6384
6382
|
}
|
|
6385
6383
|
//#endregion
|
|
6386
6384
|
//#region src/addons/ai/F0AiChatHeader/types.ts
|
|
6387
|
-
var Kl = ["attention"], ql = ["top", "bottom"], Jl = p.create(
|
|
6385
|
+
var Kl = ["attention"], ql = ["top", "bottom"], Jl = p.create(je), Yl = ({ label: e, reduceMotion: t }) => /* @__PURE__ */ Z("div", {
|
|
6388
6386
|
role: "status",
|
|
6389
6387
|
"aria-live": "polite",
|
|
6390
6388
|
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",
|