@qredence/fleet 0.5.1 → 0.5.7
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/CHANGELOG.md +19 -0
- package/bin/fleet-prime.mjs +6 -0
- package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +1 -0
- package/dist/web/client/assets/agent-activity-CDcDNVC6.js +1 -0
- package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +1 -0
- package/dist/web/client/assets/analytics-stub-B8MIkiDB.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-CX62LQ13.js → artifacts-panel-CmHYXfoo.js} +1 -1
- package/dist/web/client/assets/button-BV9NafmI.js +1 -0
- package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-DiG-i3uJ.js +1 -0
- package/dist/web/client/assets/check-JjHKAZas.js +1 -0
- package/dist/web/client/assets/chevron-up-CnSvySGH.js +1 -0
- package/dist/web/client/assets/circle-alert-CONlFReH.js +1 -0
- package/dist/web/client/assets/circle-x-CkKCB__4.js +1 -0
- package/dist/web/client/assets/citations-CpTFUvx7.js +2 -0
- package/dist/web/client/assets/collapsible-BoXtZZWN.js +1 -0
- package/dist/web/client/assets/command-Cx-UYeQ9.js +1 -0
- package/dist/web/client/assets/createBaseUIEventDetails-DV0dQrBX.js +1 -0
- package/dist/web/client/assets/dialog-Dh7WpGIu.js +1 -0
- package/dist/web/client/assets/dist-BPaFisIZ.js +41 -0
- package/dist/web/client/assets/earth-DGZXAN5r.js +1 -0
- package/dist/web/client/assets/ease-u56MhKYS.js +1 -0
- package/dist/web/client/assets/file-text-T-NcAlZs.js +1 -0
- package/dist/web/client/assets/fleet-message-queue-B6zAK-hX.js +1 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-Btq9mDUe.js} +29 -29
- package/dist/web/client/assets/fleet-reasoning-panel-MtbSdoCv.js +1 -0
- package/dist/web/client/assets/fleet-subagent-list-iszvrvy_.js +1 -0
- package/dist/web/client/assets/fleet-tool-timeline-COzPrwr8.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-C2cVJUbf.js → fork-picker-dialog-CAhWx0G5.js} +1 -1
- package/dist/web/client/assets/gauge-DNpstbBn.js +1 -0
- package/dist/web/client/assets/generative-text-renderer-C1JrmYfx.js +6 -0
- package/dist/web/client/assets/globals-Bfr0jrPq.css +2 -0
- package/dist/web/client/assets/horizontal-resize-Bl3AyBJg.js +1 -0
- package/dist/web/client/assets/image-BbPmlw-n.js +1 -0
- package/dist/web/client/assets/index-QgUwd4m8.js +12 -0
- package/dist/web/client/assets/input-Bol3TP4v.js +1 -0
- package/dist/web/client/assets/input-group-D5gi9zBK.js +1 -0
- package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
- package/dist/web/client/assets/{markdown-DG7pUdsX.js → markdown-RD_ydkyD.js} +2 -2
- package/dist/web/client/assets/{markdown-code-BgMzpy7O.js → markdown-code-ETqXqY8E.js} +1 -1
- package/dist/web/client/assets/message-square-hbDao-A1.js +1 -0
- package/dist/web/client/assets/model-selector-list-CJY9pyt2.js +1 -0
- package/dist/web/client/assets/notify-DKTqXChG.js +1 -0
- package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-BZMghkzQ.js} +8 -8
- package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
- package/dist/web/client/assets/prompt-suggestions-CXM6knMK.js +1 -0
- package/dist/web/client/assets/provider-catalog-CHKFGwHr.js +1 -0
- package/dist/web/client/assets/provider-label-KkqVX1CI.js +1 -0
- package/dist/web/client/assets/range-BWOHiLNe.js +1 -0
- package/dist/web/client/assets/refresh-cw-IThTJ3j-.js +1 -0
- package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
- package/dist/web/client/assets/{resource-helpers-ULlyU8qK.js → resource-helpers-Q2T0YCMO.js} +1 -1
- package/dist/web/client/assets/resources-panel-Bo8dfUdm.js +1 -0
- package/dist/web/client/assets/right-panel-context-B2VAZ2p4.js +1 -0
- package/dist/web/client/assets/right-panel-registry-C5fQcBKw.js +2 -0
- package/dist/web/client/assets/routes-C1hRkRkv.js +16 -0
- package/dist/web/client/assets/safe-external-url-D3PJJIcM.js +1 -0
- package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
- package/dist/web/client/assets/settings-dialog-CvvM6T0m.js +1 -0
- package/dist/web/client/assets/{sparkles-C5H3Jtgf.js → shield-check-CkA2viVW.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-fStjEeRP.js → skeleton-loaders-DjGv9LLA.js} +1 -1
- package/dist/web/client/assets/sparkles-DuclzqlE.js +1 -0
- package/dist/web/client/assets/subagent-chat-panel-tGCg6gcn.js +1 -0
- package/dist/web/client/assets/subagent-transcript-NO0PR8RU.js +1 -0
- package/dist/web/client/assets/subagent-utils-CQbaJ1g-.js +1 -0
- package/dist/web/client/assets/subagents-panel-BkFLsQQY.js +1 -0
- package/dist/web/client/assets/surfaces-cW-gp56p.js +1 -0
- package/dist/web/client/assets/switch-CcOFiQBK.js +1 -0
- package/dist/web/client/assets/terminal-DOS1s1gm.js +1 -0
- package/dist/web/client/assets/toast-ATq44uAL.js +1 -0
- package/dist/web/client/assets/tool-result-pklnrxSW.js +4 -0
- package/dist/web/client/assets/use-reduced-motion-eORd7fqW.js +9 -0
- package/dist/web/client/assets/useBaseUiId-CHqXB2UQ.js +1 -0
- package/dist/web/client/assets/useControlled-CJJ9BOQB.js +1 -0
- package/dist/web/client/assets/workspace-panel-BmMW7h7b.js +1 -0
- package/dist/web/client/assets/wrench-BJNNe07k.js +1 -0
- package/dist/web/client/assets/x-CsRC_tCI.js +1 -0
- package/dist/web/client/bundle-budget.json +10 -0
- package/dist/web/server/_tanstack-start-manifest_v-B4BnRTa_-DR7WQTT5.js +90 -0
- package/dist/web/server/agent-activity-Dx6AlDhN-JXOL2EXK.js +514 -0
- package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-CloS3-ij-XWYXKL6A.js} +30 -22
- package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Cc0uGvNm-GKENKTO7.js} +48 -22
- package/dist/web/server/{chunk-KPNGZR2R.js → chunk-3B6M63AO.js} +206 -209
- package/dist/web/server/chunk-3D4Z32XA.js +22 -0
- package/dist/web/server/chunk-3SSHBMDS.js +196 -0
- package/dist/web/server/chunk-4PQ6OD6J.js +22 -0
- package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
- package/dist/web/server/chunk-56SEDI5N.js +19 -0
- package/dist/web/server/chunk-6QNW66XR.js +19 -0
- package/dist/web/server/chunk-744IIIDL.js +19 -0
- package/dist/web/server/{chunk-52SJQXO4.js → chunk-7PQTPSEE.js} +568 -568
- package/dist/web/server/{chunk-XYYNYFFD.js → chunk-7SR6WDM2.js} +2 -2
- package/dist/web/server/chunk-ANL4B775.js +60 -0
- package/dist/web/server/chunk-BNQWMQHD.js +35 -0
- package/dist/web/server/{chunk-X2TUFLTP.js → chunk-C5X6G26O.js} +436 -454
- package/dist/web/server/chunk-C66BSNA6.js +42 -0
- package/dist/web/server/{chunk-3GSFXWL5.js → chunk-DEUBJJZN.js} +4 -59
- package/dist/web/server/chunk-E365EOXJ.js +35 -0
- package/dist/web/server/{chunk-5WZFFNFY.js → chunk-EFAGCVZ3.js} +2 -23
- package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-EGQ6ZX4D.js} +563 -830
- package/dist/web/server/{chunk-DO3TVNGA.js → chunk-EKBKGAWX.js} +12 -10
- package/dist/web/server/{chunk-RPROZ2JC.js → chunk-F6MGAW3L.js} +133 -133
- package/dist/web/server/chunk-GABXCOY3.js +37 -0
- package/dist/web/server/chunk-GV7DJIHY.js +36 -0
- package/dist/web/server/{chunk-PWK2HJIV.js → chunk-HSJMLO36.js} +5 -252
- package/dist/web/server/{chunk-46VQY7SG.js → chunk-HU4AIJV3.js} +4 -4
- package/dist/web/server/{chunk-H64JLONZ.js → chunk-HZY3LBGP.js} +146 -2
- package/dist/web/server/{chunk-3IKSPTYI.js → chunk-J6MRJXUH.js} +22 -15
- package/dist/web/server/{chunk-FE4KN6T2.js → chunk-JOSTE7WK.js} +7 -5
- package/dist/web/server/{chunk-QJBEWT4E.js → chunk-K3BXQG3N.js} +27 -292
- package/dist/web/server/chunk-K4ESBQ3R.js +20 -0
- package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
- package/dist/web/server/{chunk-44IVTHDV.js → chunk-KZSM3BHO.js} +28 -119
- package/dist/web/server/chunk-L46H6IDX.js +13 -0
- package/dist/web/server/chunk-LNGWHEE6.js +206 -0
- package/dist/web/server/{chunk-2U7PWSJX.js → chunk-MOSVTKH5.js} +262 -3661
- package/dist/web/server/{chunk-MDYA4NXK.js → chunk-NJRYX4A2.js} +4 -4
- package/dist/web/server/chunk-NNMZQN7Q.js +296 -0
- package/dist/web/server/{chunk-VHCAD46L.js → chunk-NPPG2GTW.js} +7 -7
- package/dist/web/server/{chunk-AZZHUVJR.js → chunk-PJNYH5SR.js} +7 -303
- package/dist/web/server/{chunk-7APYEQIO.js → chunk-QAE5SXDK.js} +1 -24
- package/dist/web/server/chunk-QTFCJGOY.js +189 -0
- package/dist/web/server/{chunk-FBOO3G67.js → chunk-RANJ6OJ3.js} +9 -9
- package/dist/web/server/chunk-RPBSDXJ4.js +62 -0
- package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-RYHIJMFD.js} +63 -34
- package/dist/web/server/{chunk-NLIUTTKL.js → chunk-S3PQ6HKH.js} +1 -16
- package/dist/web/server/chunk-SG4W4SPQ.js +31 -0
- package/dist/web/server/{chunk-LESNF5O4.js → chunk-T23OO4SC.js} +2 -11
- package/dist/web/server/{chunk-FVWDJNXR.js → chunk-UNZJQ7CY.js} +6 -4
- package/dist/web/server/chunk-V3S6BVXO.js +22 -0
- package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
- package/dist/web/server/{chunk-WK7CQS2N.js → chunk-W5GRNHV5.js} +51 -49
- package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
- package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
- package/dist/web/server/{chunk-EIVNRYP3.js → chunk-XKYEXPLQ.js} +2 -17
- package/dist/web/server/{chunk-6GMKRR3C.js → chunk-XNYQSCB2.js} +2 -2
- package/dist/web/server/chunk-YHXAXJ6I.js +22 -0
- package/dist/web/server/chunk-YLMXYMLG.js +86 -0
- package/dist/web/server/chunk-YNGDUWCF.js +56 -0
- package/dist/web/server/chunk-ZJFA4F5X.js +280 -0
- package/dist/web/server/fleet-message-queue-Bn0_3Efe-G4BZR2EU.js +74 -0
- package/dist/web/server/fleet-pi-tool-renderer-C52SZmPx-CIAH3IV7.js +51 -0
- package/dist/web/server/fleet-reasoning-panel-C_e7wzVm-SDHEWDQT.js +199 -0
- package/dist/web/server/fleet-subagent-list-CQltKswG-EKCMQHDI.js +18 -0
- package/dist/web/server/fleet-tool-timeline-KENErMKg-HTN7SW3D.js +16 -0
- package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DK9YGQuB-4QEFWRU4.js} +6 -5
- package/dist/web/server/{markdown-Boni3lHk-AZGKDNAR.js → markdown-QcSUaLyd-6DJUK5NC.js} +1 -1
- package/dist/web/server/{markdown-code-BrWukbg3-D2GN4Y77.js → markdown-code-Dyo1_13a-52ZQZSPE.js} +2 -2
- package/dist/web/server/model-selector-list-CEfWjRc--GBW2GUO6.js +289 -0
- package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-Dk0Ak9cW-MUJQHDAS.js} +19 -16
- package/dist/web/server/prompt-suggestions-BOmHi4-J-C563CHFU.js +30 -0
- package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
- package/dist/web/server/{resources-panel-CwKh4U9f-D3VDEMDW.js → resources-panel-B03M8bEp-SZG726N5.js} +7 -6
- package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-BE9HcX2W-JMQ3JWE5.js} +1756 -1374
- package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-CJTRGB1Z-WJKXJFFT.js} +3748 -3955
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
- package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-yDibpbBH-TCLJ7NRJ.js} +172 -161
- package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
- package/dist/web/server/subagent-chat-panel-B1YoZIKO-DFRUDQJ2.js +82 -0
- package/dist/web/server/subagents-panel-dJJwpsEL-FTWWCHND.js +200 -0
- package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-BC_H8Jri-5MHAEQQS.js} +22 -18
- package/package.json +5 -5
- package/dist/web/client/assets/analytics-stub-Jh3lkb8P.js +0 -1
- package/dist/web/client/assets/button-0At5xSyU.js +0 -1
- package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
- package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
- package/dist/web/client/assets/command-CB6emP8m.js +0 -2
- package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
- package/dist/web/client/assets/dialog-DZ44tBtH.js +0 -1
- package/dist/web/client/assets/dist-MNgIFxqY.js +0 -41
- package/dist/web/client/assets/ease-vFBiNFNK.js +0 -9
- package/dist/web/client/assets/file-text-BhQ0ZnoU.js +0 -1
- package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
- package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +0 -1
- package/dist/web/client/assets/index-DweoFRMs.js +0 -12
- package/dist/web/client/assets/input-CqC82Agz.js +0 -1
- package/dist/web/client/assets/input-group-H0TG-mkU.js +0 -1
- package/dist/web/client/assets/notify-Duj26eeZ.js +0 -1
- package/dist/web/client/assets/provider-catalog-BZhZuKSz.js +0 -1
- package/dist/web/client/assets/provider-label-jKm8v18u.js +0 -1
- package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
- package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
- package/dist/web/client/assets/resources-panel-DSU7VGX2.js +0 -1
- package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
- package/dist/web/client/assets/safe-external-url-Bl_78dpZ.js +0 -1
- package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
- package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +0 -1
- package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
- package/dist/web/client/assets/switch-BFEBpUEU.js +0 -1
- package/dist/web/client/assets/toast-C4s7FYYa.js +0 -1
- package/dist/web/client/assets/tool-result-CBzwwUE9.js +0 -4
- package/dist/web/client/assets/useBaseUiId-B9f7fokB.js +0 -1
- package/dist/web/client/assets/useControlled-CoY1jSuL.js +0 -1
- package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +0 -1
- package/dist/web/client/assets/x-BgciQ7_C.js +0 -1
- package/dist/web/server/_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js +0 -82
- package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
- package/dist/web/server/fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js +0 -35
- package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SubagentTranscriptView
|
|
3
|
+
} from "./chunk-3SSHBMDS.js";
|
|
4
|
+
import "./chunk-EGQ6ZX4D.js";
|
|
5
|
+
import "./chunk-GV7DJIHY.js";
|
|
6
|
+
import "./chunk-XKYEXPLQ.js";
|
|
7
|
+
import "./chunk-K4ESBQ3R.js";
|
|
8
|
+
import "./chunk-W5GRNHV5.js";
|
|
9
|
+
import {
|
|
10
|
+
Bot
|
|
11
|
+
} from "./chunk-74QOI457.js";
|
|
12
|
+
import "./chunk-RYHIJMFD.js";
|
|
13
|
+
import "./chunk-KZSM3BHO.js";
|
|
14
|
+
import "./chunk-E365EOXJ.js";
|
|
15
|
+
import "./chunk-V3S6BVXO.js";
|
|
16
|
+
import "./chunk-ANL4B775.js";
|
|
17
|
+
import "./chunk-DBXYBYBP.js";
|
|
18
|
+
import "./chunk-EFAGCVZ3.js";
|
|
19
|
+
import "./chunk-BNQWMQHD.js";
|
|
20
|
+
import "./chunk-QTFCJGOY.js";
|
|
21
|
+
import "./chunk-4PQ6OD6J.js";
|
|
22
|
+
import "./chunk-YLMXYMLG.js";
|
|
23
|
+
import {
|
|
24
|
+
orderedRlmChildren,
|
|
25
|
+
rlmStatusIcon
|
|
26
|
+
} from "./chunk-YNGDUWCF.js";
|
|
27
|
+
import "./chunk-P66QQWUM.js";
|
|
28
|
+
import "./chunk-2H6A6Z7F.js";
|
|
29
|
+
import "./chunk-YRWVQ7BW.js";
|
|
30
|
+
import "./chunk-4UBOIY2S.js";
|
|
31
|
+
import "./chunk-J6MRJXUH.js";
|
|
32
|
+
import "./chunk-LNGWHEE6.js";
|
|
33
|
+
import "./chunk-C66BSNA6.js";
|
|
34
|
+
import "./chunk-HSJMLO36.js";
|
|
35
|
+
import "./chunk-6RJYXDSD.js";
|
|
36
|
+
import "./chunk-744IIIDL.js";
|
|
37
|
+
import "./chunk-SG4W4SPQ.js";
|
|
38
|
+
import "./chunk-PKCTG7EW.js";
|
|
39
|
+
import "./chunk-ZJFA4F5X.js";
|
|
40
|
+
import {
|
|
41
|
+
ChevronRight
|
|
42
|
+
} from "./chunk-7QCDOBZ3.js";
|
|
43
|
+
import "./chunk-K3BXQG3N.js";
|
|
44
|
+
import "./chunk-FAGDMGLK.js";
|
|
45
|
+
import "./chunk-NFRJDPB3.js";
|
|
46
|
+
import "./chunk-T23OO4SC.js";
|
|
47
|
+
import "./chunk-L46H6IDX.js";
|
|
48
|
+
import "./chunk-QLY3L4A2.js";
|
|
49
|
+
import {
|
|
50
|
+
Button
|
|
51
|
+
} from "./chunk-F6MGAW3L.js";
|
|
52
|
+
import "./chunk-6QNW66XR.js";
|
|
53
|
+
import "./chunk-S3PQ6HKH.js";
|
|
54
|
+
import "./chunk-7SR6WDM2.js";
|
|
55
|
+
import "./chunk-YHXAXJ6I.js";
|
|
56
|
+
import "./chunk-C5X6G26O.js";
|
|
57
|
+
import "./chunk-ST5I2PLN.js";
|
|
58
|
+
import "./chunk-QAE5SXDK.js";
|
|
59
|
+
import "./chunk-GABXCOY3.js";
|
|
60
|
+
import "./chunk-VGDP4YDU.js";
|
|
61
|
+
import "./chunk-G5BCQQ5N.js";
|
|
62
|
+
import "./chunk-BYXBJQAS.js";
|
|
63
|
+
import "./chunk-E26EAQIM.js";
|
|
64
|
+
import {
|
|
65
|
+
cn
|
|
66
|
+
} from "./chunk-DJMHPJBP.js";
|
|
67
|
+
import "./chunk-UQVZJSZZ.js";
|
|
68
|
+
import "./chunk-JDCCC7A7.js";
|
|
69
|
+
import "./chunk-L547YHC4.js";
|
|
70
|
+
import "./chunk-MLKGABMK.js";
|
|
71
|
+
|
|
72
|
+
// web/app/dist/server/assets/subagents-panel-dJJwpsEL.js
|
|
73
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
74
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
75
|
+
function SubagentsPanelContent({ agents, loadSession, onOpenTab, parentSessionId, tree }) {
|
|
76
|
+
const ordered = useMemo(() => orderedRlmChildren(agents, tree), [agents, tree]);
|
|
77
|
+
const [selectedAgentId, setSelectedAgentId] = useState(null);
|
|
78
|
+
const [transcripts, setTranscripts] = useState({});
|
|
79
|
+
const requestVersions = useRef(/* @__PURE__ */ new Map());
|
|
80
|
+
const selectedAgent = ordered.find((agent) => agent.id === selectedAgentId) ?? ordered[0];
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (selectedAgentId && ordered.some((agent) => agent.id === selectedAgentId)) return;
|
|
83
|
+
setSelectedAgentId(ordered[0]?.id ?? null);
|
|
84
|
+
}, [ordered, selectedAgentId]);
|
|
85
|
+
const loadTranscript = useCallback(async (agent, force = false) => {
|
|
86
|
+
if (!parentSessionId) return;
|
|
87
|
+
const requestKey = `${parentSessionId}:${agent.id}:${agent.status}:${agent.timestamp}:${agent.activeSessionId ?? ""}`;
|
|
88
|
+
const current = transcripts[agent.id];
|
|
89
|
+
if (!force && current?.requestKey === requestKey) return;
|
|
90
|
+
const version = (requestVersions.current.get(agent.id) ?? 0) + 1;
|
|
91
|
+
requestVersions.current.set(agent.id, version);
|
|
92
|
+
setTranscripts((previous) => ({
|
|
93
|
+
...previous,
|
|
94
|
+
[agent.id]: {
|
|
95
|
+
requestKey,
|
|
96
|
+
status: "loading",
|
|
97
|
+
messages: []
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
try {
|
|
101
|
+
const response = await loadSession(parentSessionId, agent.id);
|
|
102
|
+
if (requestVersions.current.get(agent.id) !== version) return;
|
|
103
|
+
setTranscripts((previous) => ({
|
|
104
|
+
...previous,
|
|
105
|
+
[agent.id]: {
|
|
106
|
+
requestKey,
|
|
107
|
+
status: "ready",
|
|
108
|
+
messages: response.messages,
|
|
109
|
+
presentation: response.presentation
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
} catch (error) {
|
|
113
|
+
if (requestVersions.current.get(agent.id) !== version) return;
|
|
114
|
+
setTranscripts((previous) => ({
|
|
115
|
+
...previous,
|
|
116
|
+
[agent.id]: {
|
|
117
|
+
requestKey,
|
|
118
|
+
status: "error",
|
|
119
|
+
messages: [],
|
|
120
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
}, [
|
|
125
|
+
loadSession,
|
|
126
|
+
parentSessionId,
|
|
127
|
+
transcripts
|
|
128
|
+
]);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (selectedAgent) loadTranscript(selectedAgent);
|
|
131
|
+
}, [loadTranscript, selectedAgent]);
|
|
132
|
+
if (ordered.length === 0) return /* @__PURE__ */ jsx("section", {
|
|
133
|
+
"aria-label": "Subagents",
|
|
134
|
+
className: "flex min-h-36 items-center rounded-md border border-dashed border-border/70 px-4 text-center text-[12px] leading-5 text-foreground/45",
|
|
135
|
+
children: "Subagent threads will appear here when Prime delegates work."
|
|
136
|
+
});
|
|
137
|
+
return /* @__PURE__ */ jsxs("section", {
|
|
138
|
+
"aria-label": "Subagents",
|
|
139
|
+
className: "space-y-2 pb-1",
|
|
140
|
+
children: [
|
|
141
|
+
/* @__PURE__ */ jsxs("div", {
|
|
142
|
+
className: "flex min-w-0 items-center gap-2 rounded-sm bg-foreground/5 px-2 py-1.5",
|
|
143
|
+
children: [
|
|
144
|
+
/* @__PURE__ */ jsx(Bot, { className: "size-3.5 shrink-0 text-foreground/45" }),
|
|
145
|
+
/* @__PURE__ */ jsx("span", {
|
|
146
|
+
className: "min-w-0 flex-1 truncate text-label font-medium text-foreground/70",
|
|
147
|
+
children: "Invoked subagents"
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ jsx("span", {
|
|
150
|
+
className: "shrink-0 text-[10px] text-foreground/40",
|
|
151
|
+
children: ordered.length
|
|
152
|
+
})
|
|
153
|
+
]
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx("div", {
|
|
156
|
+
className: "space-y-0.5",
|
|
157
|
+
"data-testid": "subagent-thread-list",
|
|
158
|
+
children: ordered.map((agent) => {
|
|
159
|
+
const selected = agent.id === selectedAgent?.id;
|
|
160
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
161
|
+
type: "button",
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "sm",
|
|
164
|
+
"aria-pressed": selected,
|
|
165
|
+
className: cn("flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-foreground/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", selected && "bg-foreground/8"),
|
|
166
|
+
style: { paddingLeft: `${8 + Math.max(0, agent.depth ?? 0) * 12}px` },
|
|
167
|
+
onClick: () => {
|
|
168
|
+
setSelectedAgentId(agent.id);
|
|
169
|
+
onOpenTab?.(agent.id);
|
|
170
|
+
},
|
|
171
|
+
children: [
|
|
172
|
+
/* @__PURE__ */ jsx("span", {
|
|
173
|
+
className: "shrink-0",
|
|
174
|
+
children: rlmStatusIcon(agent.status)
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ jsx("span", {
|
|
177
|
+
className: "min-w-0 flex-1 truncate text-xs text-foreground/80",
|
|
178
|
+
children: agent.label
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ jsx(ChevronRight, { className: "size-3 shrink-0 text-foreground/30" }),
|
|
181
|
+
/* @__PURE__ */ jsx("span", {
|
|
182
|
+
className: "shrink-0 text-[10px] capitalize text-foreground/45",
|
|
183
|
+
children: agent.status
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
}, agent.id);
|
|
187
|
+
})
|
|
188
|
+
}),
|
|
189
|
+
selectedAgent ? /* @__PURE__ */ jsx(SubagentTranscriptView, {
|
|
190
|
+
child: selectedAgent,
|
|
191
|
+
parentSessionId,
|
|
192
|
+
transcript: transcripts[selectedAgent.id],
|
|
193
|
+
onRefresh: () => void loadTranscript(selectedAgent, true)
|
|
194
|
+
}) : null
|
|
195
|
+
]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
SubagentsPanelContent
|
|
200
|
+
};
|
|
@@ -8,47 +8,51 @@ import {
|
|
|
8
8
|
readStoredWidth,
|
|
9
9
|
startHorizontalResize,
|
|
10
10
|
storeStoredWidth
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UNZJQ7CY.js";
|
|
12
12
|
import "./chunk-QK4CHLVV.js";
|
|
13
|
-
import {
|
|
14
|
-
isPathWithinScope
|
|
15
|
-
} from "./chunk-P66QQWUM.js";
|
|
16
13
|
import {
|
|
17
14
|
Folder
|
|
18
15
|
} from "./chunk-OLG5DQ7V.js";
|
|
19
16
|
import {
|
|
20
17
|
HardDrive
|
|
21
18
|
} from "./chunk-HUX64PWB.js";
|
|
19
|
+
import {
|
|
20
|
+
isPathWithinScope
|
|
21
|
+
} from "./chunk-P66QQWUM.js";
|
|
22
22
|
import {
|
|
23
23
|
AnimatePresence,
|
|
24
|
-
EASE_OUT,
|
|
25
|
-
SPRING_LAYOUT,
|
|
26
|
-
SPRING_SWAP,
|
|
27
|
-
motion,
|
|
28
24
|
useReducedMotion
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-FAGDMGLK.js";
|
|
25
|
+
} from "./chunk-ZJFA4F5X.js";
|
|
31
26
|
import {
|
|
32
27
|
ChevronRight
|
|
33
28
|
} from "./chunk-7QCDOBZ3.js";
|
|
29
|
+
import {
|
|
30
|
+
EASE_OUT,
|
|
31
|
+
SPRING_LAYOUT,
|
|
32
|
+
SPRING_SWAP,
|
|
33
|
+
motion
|
|
34
|
+
} from "./chunk-K3BXQG3N.js";
|
|
35
|
+
import "./chunk-FAGDMGLK.js";
|
|
34
36
|
import {
|
|
35
37
|
Markdown
|
|
36
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-NJRYX4A2.js";
|
|
37
39
|
import {
|
|
38
40
|
ResourceChipSection,
|
|
39
41
|
ResourceNotice,
|
|
40
42
|
WorkspacePreviewSkeleton,
|
|
41
43
|
WorkspaceSkeleton
|
|
42
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-XNYQSCB2.js";
|
|
43
45
|
import {
|
|
44
46
|
findWorkspaceNode
|
|
45
|
-
} from "./chunk-
|
|
46
|
-
import {
|
|
47
|
-
CircleAlert,
|
|
48
|
-
FileText
|
|
49
|
-
} from "./chunk-7APYEQIO.js";
|
|
47
|
+
} from "./chunk-HU4AIJV3.js";
|
|
50
48
|
import "./chunk-BSFYTSN6.js";
|
|
51
49
|
import "./chunk-EAJTWMK5.js";
|
|
50
|
+
import {
|
|
51
|
+
FileText
|
|
52
|
+
} from "./chunk-QAE5SXDK.js";
|
|
53
|
+
import {
|
|
54
|
+
CircleAlert
|
|
55
|
+
} from "./chunk-GABXCOY3.js";
|
|
52
56
|
import "./chunk-ZGFQ7HIX.js";
|
|
53
57
|
import "./chunk-BYXBJQAS.js";
|
|
54
58
|
import "./chunk-E26EAQIM.js";
|
|
@@ -61,7 +65,7 @@ import "./chunk-JDCCC7A7.js";
|
|
|
61
65
|
import "./chunk-L547YHC4.js";
|
|
62
66
|
import "./chunk-MLKGABMK.js";
|
|
63
67
|
|
|
64
|
-
// web/app/dist/server/assets/workspace-panel-
|
|
68
|
+
// web/app/dist/server/assets/workspace-panel-BC_H8Jri.js
|
|
65
69
|
import { Children, Fragment, isValidElement, useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
66
70
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
67
71
|
function FileTreeFolder(_props) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qredence/fleet",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Fleet Prime: local web interface and launcher for the pinned Prime Agent runtime",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/Qredence/fleet-prime-agent.git",
|
|
12
|
-
"directory": "packages/fleet-
|
|
12
|
+
"directory": "packages/fleet-web"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"ai",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"registry": "https://registry.npmjs.org/"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@earendil-works/pi-agent-core": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.
|
|
47
|
-
"@earendil-works/pi-ai": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.
|
|
48
|
-
"prime-agent": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.
|
|
46
|
+
"@earendil-works/pi-agent-core": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-core-0.9.1.tgz",
|
|
47
|
+
"@earendil-works/pi-ai": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-ai-0.9.1.tgz",
|
|
48
|
+
"prime-agent": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.1/prime-agent-0.9.1.tgz",
|
|
49
49
|
"react": "19.2.8",
|
|
50
50
|
"react-dom": "19.2.8",
|
|
51
51
|
"use-sync-external-store": "1.6.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,d as i,i as a,l as o,n as s}from"./layout-gyLzPvVv.js";var c=e(t(),1),l=c.createContext(null);function u(e){return c.useContext(l)}function d(e){let t=u();return c.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var f=n(),p=c.createContext(void 0),m=e=>{let t=c.useContext(p);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},h=({client:e,children:t})=>(c.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,f.jsx)(p.Provider,{value:e,children:t})),g={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_=new class{#e=g;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ee(e){setTimeout(e,0)}var v=typeof window>`u`||`Deno`in globalThis;function y(){}function b(e,t){return typeof e==`function`?e(t):e}function x(e){return typeof e==`number`&&e>=0&&e!==1/0}function S(e,t){return Math.max(e+(t||0)-Date.now(),0)}function C(e,t){return typeof e==`function`?e(t):e}function w(e,t){return typeof e==`function`?e(t):e}function te(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==T(o,t.options))return!1}else if(!D(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ne(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(E(t.options.mutationKey)!==E(a))return!1}else if(!D(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function T(e,t){return(t?.queryKeyHashFn||E)(e)}function E(e){return JSON.stringify(e,(e,t)=>j(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function D(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!D(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!D(e[r],t[r]))return!1;return!0}return!1}var O=Object.prototype.hasOwnProperty;function k(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=A(e)&&A(t);if(!r&&!(j(e)&&j(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:O.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=k(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function re(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function A(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function j(e){if(!M(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!M(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function M(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{_.setTimeout(t,e)})}function N(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:k(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function P(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var F=Symbol();function I(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===F?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function oe(e,t){return typeof e==`function`?e(...t):!!e}function se(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var L=(()=>{let e=()=>v;return{isServer(){return e()},setIsServer(t){e=t}}})(),R=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},z=new class extends R{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},ce=ee;function B(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ce,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var V=B(),H=new class extends R{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function U(e){return Math.min(1e3*2**e,3e4)}function W(e){return(e??`online`)!==`online`||H.isOnline()}var G=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function K(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(y);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new G(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>z.isFocused()&&(e.networkMode===`always`||H.isOnline())&&e.canRun(),p=()=>W(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(L.isServer()?0:3),a=e.retryDelay??U,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),ie(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var q=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),x(this.gcTime)&&(this.#e=_.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(L.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(_.clearTimeout(this.#e),this.#e=void 0)}};function le(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{se(e,()=>t.signal,()=>n=!0)},u=I(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?P:ae;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?ue:J,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:J(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function J(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ue(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var de=class extends q{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Z(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Z(this.options);e.data!==void 0&&(this.setState(X(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=N(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(y).catch(y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>w(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===F||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>C(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!S(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=I(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?le(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=K({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof G&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof G){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Y(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...X(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),V.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Y(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:W(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function X(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Z(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var fe=class extends q{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Q(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=K({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),V.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Q(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}function pe({children:e,features:t,strict:n=!1}){let[,r]=(0,c.useState)(!$(t)),a=(0,c.useRef)(void 0);if(!$(t)){let{renderer:e,...n}=t;a.current=e,o(n)}return(0,c.useEffect)(()=>{$(t)&&t().then(({renderer:e,...t})=>{o(t),a.current=e,r(!0)})},[]),(0,f.jsx)(i.Provider,{value:{renderer:a.current,strict:n},children:e})}function $(e){return typeof e==`function`}var me={renderer:r,...a,...s};function he(){}function ge(e){}function _e(){}function ve(e){}function ye(e){}export{oe as A,te as C,w as D,N as E,m as F,d as I,u as L,S as M,_ as N,C as O,h as P,l as R,ne as S,D as T,b as _,_e as a,v as b,fe as c,Y as d,H as f,L as g,R as h,he as i,F as j,re as k,Q as l,z as m,ye as n,me as o,V as p,ge as r,pe as s,ve as t,de as u,E as v,y as w,x,T as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{i as n,r}from"./bundle-mjs-DKHVkVWu.js";import{t as i}from"./react-dom-Bwxum3ti.js";import{t as a}from"./jsx-runtime-NZYk81nU.js";import{B as o,C as s,F as c,I as l,K as u,Y as d,Z as f,at as p,ct as m,it as h,k as g,lt as _,n as v,nt as y,ot as b,q as x,tt as S,y as C}from"./x-BgciQ7_C.js";import{t as w}from"./utils-Eg7xtNmV.js";var ee=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),T=t(((e,t)=>{t.exports=ee()})),te=t((e=>{var t=n(),r=T();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),E=t(((e,t)=>{t.exports=te()})),ne=T(),re=e(E(),1),D=e(n(),1),O=[],k=void 0;function ie(){return k}function ae(e){O.push(e)}function A(e){let t=(t,n)=>{let r=p(se).current,i;try{k=r;for(let e of O)e.before(r);i=e(t,n);for(let e of O)e.after(r);r.didInitialize=!0}finally{k=void 0}return i};return t.displayName=e.displayName||e.name,t}function oe(e){return D.forwardRef(A(e))}function se(){return{didInitialize:!1}}var ce=y(19)?ue:de;function j(e,t,n,r,i){return ce(e,t,n,r,i)}function le(e,t,n,r,i){let a=D.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,ne.useSyncExternalStore)(e.subscribe,a,a)}ae({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,ne.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function ue(e,t,n,r,i){let a=ie();if(!a)return le(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function de(e,t,n,r,i){return(0,re.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var fe=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return j(this,e,t,n,r)}},pe=class extends fe{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){D.useDebugValue(e);let n=this;h(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;h(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);h(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){D.useDebugValue(e);let n=this,r=t!==void 0;h(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return D.useDebugValue(e),j(this,this.selectors[e],t,n,r)}useContextCallback(e,t){D.useDebugValue(e);let n=S(t??_);this.context[e]=n}useStateSetter(e){let t=D.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},me=e(i(),1);function he(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}var M=a();function N(e){return e?.ownerDocument||document}var P=0,F=class e{static create(){return new e}currentId=P;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=P,t()},e)}isStarted(){return this.currentId!==P}clear=()=>{this.currentId!==P&&(clearTimeout(this.currentId),this.currentId=P)};disposeEffect=()=>this.clear};function ge(){let e=p(F.create).current;return b(e.disposeEffect),e}function _e(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ve,platform:ye,maxTouchPoints:be}=_e(),I=ve.toLowerCase(),L=ye.toLowerCase(),R=/^i(os$|p)/.test(L)||L===`macintel`&&be>1,z=`android`,xe=L===z||I.includes(z),Se=!R&&L.startsWith(`mac`);L.startsWith(`win`),!xe&&/^(linux|chrome os)/.test(L);var Ce=Se||R,B=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!B&&I.includes(`firefox`),!B&&I.includes(`chrom`);var we=Ce,Te=/jsdom|happydom/.test(I),Ee=`data-base-ui-focusable`,De=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,Oe=`ArrowLeft`,ke=`ArrowRight`,Ae=`ArrowUp`,je=`ArrowDown`;function V(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function H(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Me(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ne(e,t){if(!u(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(H(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function Pe(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Fe(e){return e.matches(`html,body`)}function U(e){return x(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ie(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${De}`)!=null}function Le(e){return e?e.getAttribute(`role`)===`combobox`&&U(e):!1}function Re(e){if(!e||Te)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ze(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Be(e,t){return t<0||t>=e.length}function Ve(e,t){return W(e.current,{disabledIndices:t})}function He(e,t){return W(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function W(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&G(e,a,r));return a}function G(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!K(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ue(e){return e.visibility===`hidden`||e.visibility===`collapse`}function K(e,t=e?l(e):null){return!e||!e.isConnected||!t||Ue(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var We=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ge(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return f(n)?n.host:null}function q(e){for(let t of Array.from(e.children))if(o(t)===`summary`)return t;return null}function Ke(e,t){let n=q(t);return!!n&&(e===n||H(n,e))}function J(e){let t=e?o(e):``;return e!=null&&e.matches(We)&&(t!==`summary`||e.parentElement!=null&&o(e.parentElement)===`details`&&q(e.parentElement)===e)&&(t!==`details`||q(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Y(e){if(!J(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ge(t)){let n=t!==e,r=o(t)===`slot`;if(t.hasAttribute(`inert`)||n&&o(t)===`details`&&!t.open&&!Ke(e,t)||t.hasAttribute(`hidden`)||!r&&!qe(t,n))return!1}return!0}function qe(e,t){let n=l(e);return t?n.display!==`none`:K(e,n)}function Je(e){let t=e.tabIndex;if(t<0){let t=o(e);if(t===`details`||t===`audio`||t===`video`||x(e)&&e.isContentEditable)return 0}return t}function X(e){if(o(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Ye(e,t){let n=X(e);if(!n)return!0;let r=t.find(e=>{let t=X(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=X(e);return t?.name===n.name&&t.form===n.form})===n}function Xe(e){if(x(e)&&o(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return x(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ze(e,t){Xe(e).forEach(e=>{J(e)&&t.push(e),Ze(e,t)})}function Qe(e,t,n){Xe(e).forEach(e=>{x(e)&&e.matches(t)&&n.push(e),Qe(e,t,n)})}function $e(e){return Y(e)&&Je(e)>=0}function et(e){let t=[];return Ze(e,t),t.filter(Y)}function Z(e){let t=et(e);return t.filter(e=>Je(e)>=0&&Ye(e,t))}function tt(e,t){let n=Z(e),r=n.length;if(r===0)return;let i=V(N(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function nt(e){return tt(N(e).body,1)||e}function rt(e){return tt(N(e).body,-1)||e}function it(e,t){if(!e)return null;let n=Z(N(e).body),r=n.length;if(r===0)return null;let i=n.indexOf(e);return i===-1?null:n[(i+t+r)%r]}function at(e){return it(e,1)}function ot(e){return it(e,-1)}function Q(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!H(n,r)}function st(e){Z(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ct(e){let t=[];Qe(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var lt={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},ut={...lt,position:`fixed`,top:0,left:0},dt={...lt,position:`absolute`},$=D.forwardRef(function(e,t){let[n,r]=D.useState();h(()=>{we&&B&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,M.jsx)(`span`,{...e,ref:t,style:ut,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function ft(e){return y(19)?e:e?`true`:void 0}var pt={style:{transition:`none`}},mt=`data-base-ui-click-trigger`,ht=`data-base-ui-swipe-ignore`,gt=`data-swipe-ignore`,_t=`[${ht}]`,vt=`[${gt}]`,yt={fallbackAxisSide:`none`},bt={fallbackAxisSide:`end`},xt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function St(e){return`data-base-ui-${e}`}var Ct=D.createContext(null),wt=()=>D.useContext(Ct),Tt=St(`portal`);function Et(e={}){let{ref:t,container:n,componentProps:r=m,elementProps:i}=e,a=s(),o=wt()?.portalNode,[c,l]=D.useState(null),[u,f]=D.useState(null),p=S(e=>{e!==null&&f(e)}),_=D.useRef(null);h(()=>{if(n===null){_.current&&(_.current=null,f(null),l(null));return}let e=(n&&(d(n)?n:n.current))??o??document.body;if(e==null){_.current&&(_.current=null,f(null),l(null));return}_.current!==e&&(_.current=e,f(null),l(e))},[n,o]);let v=g(`div`,r,{ref:[t,p],props:[{id:a,[Tt]:``},i]}),y=c&&v?me.createPortal(v,c):null;return{node:u,nodeId:D.isValidElement(v)?v.props.id:void 0,subtree:y}}var Dt=D.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,...s}=e,{node:l,nodeId:u,subtree:d}=Et({container:o,ref:t,componentProps:e,elementProps:s}),f=D.useRef(null),p=D.useRef(null),m=D.useRef(null),g=D.useRef(null),[_,y]=D.useState(null),b=D.useRef(!1),x=_?.modal,S=_?.open,C=!!_&&!_.modal&&_.open&&!!l;D.useEffect(()=>{if(!l||x)return;function e(e){l&&e.relatedTarget&&Q(e)&&(e.type===`focusin`?b.current&&=(ct(l),!1):(st(l),b.current=!0))}return he(c(l,`focusin`,e,!0),c(l,`focusout`,e,!0))},[l,x]),h(()=>{!l||S!==!0||!b.current||(ct(l),b.current=!1)},[S,l]);let w=D.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:y}),[l]);return(0,M.jsxs)(D.Fragment,{children:[d,(0,M.jsxs)(Ct.Provider,{value:w,children:[C&&l&&(0,M.jsx)($,{"data-type":`outside`,ref:f,onFocus:e=>{Q(e,l)?m.current?.focus():rt(_?_.domReference:null)?.focus()}}),C&&l&&(0,M.jsx)(`span`,{"aria-owns":u,style:xt}),l&&me.createPortal(a,l),C&&l&&(0,M.jsx)($,{"data-type":`outside`,ref:p,onFocus:e=>{Q(e,l)?g.current?.focus():(nt(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,v(`focus-out`,e.nativeEvent)))}})]})]})}),Ot=D.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=C({disabled:i,focusableWhenDisabled:a,native:o});return g(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),kt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,At=r,jt=(e,t)=>n=>{if(t?.variants==null)return At(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=kt(t)||kt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return At(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Mt=jt(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Nt({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,M.jsx)(Ot,{"data-slot":`button`,className:w(Mt({variant:t,size:n,className:e})),...r})}export{ge as $,G as A,H as B,$e as C,Ve as D,He as E,Ne as F,Ae as G,je as H,Le as I,B as J,Ee as K,U as L,Pe as M,Ie as N,K as O,Fe as P,F as Q,Re as R,Q as S,W as T,Oe as U,Me as V,ke as W,R as X,xe as Y,Se as Z,et as _,wt as a,oe as at,at as b,mt as c,vt as d,N as et,bt as f,dt as g,ut as h,Et as i,A as it,ze as j,Be as k,pt as l,$ as m,jt as n,pe as nt,St as o,E as ot,ft as p,Te as q,Dt as r,j as rt,_t as s,T as st,Nt as t,he as tt,yt as u,nt as v,Z as w,ot as x,rt as y,V as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,c as i,d as a,f as o,i as s,l as c,n as l,o as u,r as d,s as f}from"./command-CB6emP8m.js";import{i as p,n as m,r as h,t as g}from"./sun-BWiZFty0.js";import{l as _}from"./input-group-H0TG-mkU.js";var v=e(t(),1),y=n();function b({open:e,onOpenChange:t,onNewSession:n,onStop:b,onResumeSession:x,onSetRightPanel:S,onThemeChange:C,sessions:w,isStreaming:T,themePreference:E}){let[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(e);e!==k&&(A(e),e&&O(``));let j=e=>{e(),t(!1)};return(0,y.jsxs)(l,{open:e,onOpenChange:t,children:[(0,y.jsx)(r,{placeholder:`Type a command or search…`,value:D,onValueChange:O}),(0,y.jsxs)(f,{children:[(0,y.jsx)(d,{children:`No commands found.`}),(0,y.jsxs)(s,{heading:`Actions`,children:[(0,y.jsxs)(u,{onSelect:()=>j(n),keywords:[`new`,`session`,`chat`],children:[(0,y.jsx)(_,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`New session`})]}),T&&(0,y.jsxs)(u,{onSelect:()=>j(b),keywords:[`stop`,`abort`,`cancel`],children:[(0,y.jsx)(a,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Stop generation`})]})]}),(0,y.jsx)(i,{}),(0,y.jsx)(s,{heading:`Panels`,children:c.map(e=>{let t=e.icon;return(0,y.jsxs)(u,{onSelect:()=>j(()=>S(e.id)),keywords:e.commandKeywords,children:[(0,y.jsx)(t,{}),(0,y.jsx)(`span`,{children:e.commandLabel})]},e.id)})}),w.length>0&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(i,{}),(0,y.jsx)(s,{heading:`Sessions`,children:w.map(e=>{let t=e.title;return(0,y.jsxs)(u,{onSelect:()=>j(()=>x(e)),keywords:[`session`,t],children:[(0,y.jsx)(o,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{className:`truncate`,children:t})]},e.sessionId)})})]}),(0,y.jsx)(i,{}),(0,y.jsxs)(s,{heading:`Theme`,children:[(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`light`)),keywords:[`theme`,`light`],children:[(0,y.jsx)(g,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Light`}),E===`light`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]}),(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`dark`)),keywords:[`theme`,`dark`],children:[(0,y.jsx)(m,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`Dark`}),E===`dark`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]}),(0,y.jsxs)(u,{onSelect:()=>j(()=>C(`system`)),keywords:[`theme`,`system`],children:[(0,y.jsx)(h,{className:`mr-2 size-4`}),(0,y.jsx)(`span`,{children:`System`}),E===`system`&&(0,y.jsx)(p,{className:`ml-auto size-3 opacity-50`})]})]})]})]})}export{b as ChatCommandPalette};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{d as r,f as i,i as a,m as o,p as s,r as c,u as l}from"./ease-vFBiNFNK.js";import{D as u,F as d,M as f,N as p,O as m,T as h,W as g,_,it as v,j as y,k as b,n as x,p as S,rt as C,tt as w,w as T,y as E}from"./x-BgciQ7_C.js";import{n as D,r as O,t as k}from"./useBaseUiId-B9f7fokB.js";import{t as A}from"./utils-Eg7xtNmV.js";import{t as j}from"./createLucideIcon-DwxZHm0M.js";import{t as M}from"./useControlled-CoY1jSuL.js";var N=j(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),P=j(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),F=j(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),I=j(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),L=n();function R({open:e,openHeight:t=`auto`,className:n,style:r,transition:a,...o}){let l=s()??!1;return(0,L.jsx)(i.div,{...o,"aria-hidden":!e,inert:!e,initial:!1,animate:l?{opacity:+!!e}:{opacity:+!!e,clipPath:e?`inset(0 0 0% 0)`:`inset(0 0 100% 0)`,y:e?0:-4},transition:a??{duration:l?0:e?.22:.14,ease:c},className:A(`overflow-hidden`,n),style:{...r,height:e?t:0,pointerEvents:e?void 0:`none`,transformOrigin:`top`}})}var z=e(t(),1),B={duration:.2,ease:`easeInOut`},V=l,H={duration:.14,ease:c},U=`blur(8px)`,W=`blur(3px)`,G=.025,ee={initial:{opacity:0,y:`105%`,filter:W},animate:(e=0)=>({opacity:1,y:`0%`,filter:`blur(0px)`,transition:{...l,delay:e}}),exit:(e=0)=>({opacity:0,y:`-105%`,filter:W,transition:{duration:.16,ease:c,delay:e*.5}})},te={blur:{initial:{opacity:0,scale:.94,filter:U},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:B},exit:{opacity:0,scale:.94,filter:U,transition:B}},roll:{initial:{opacity:0,y:`90%`,filter:W},animate:{opacity:1,y:`0%`,filter:`blur(0px)`,transition:V},exit:{opacity:0,y:`-90%`,filter:W,transition:H}}};function ne({value:e,children:t,animation:n=`blur`,className:i}){let c=s(),l=(0,z.useRef)(null),[u,d]=(0,z.useState)();(0,z.useLayoutEffect)(()=>{let e=l.current?.offsetWidth;e&&d(t=>t===e?t:e)});let f=typeof t==`string`?t:null,p=n===`cascade`&&f!==null&&!c,m=n===`cascade`?`roll`:n;return(0,L.jsxs)(`span`,{className:A(`relative inline-block overflow-hidden whitespace-nowrap align-bottom`,i),style:{width:u,transition:c?void 0:`width 220ms ${a}`},children:[(0,L.jsx)(`span`,{ref:l,"aria-hidden":!0,className:`invisible inline-block whitespace-nowrap`,children:t}),p?(0,L.jsx)(`span`,{className:`sr-only`,children:f}):null,(0,L.jsx)(o,{initial:!1,children:p?(0,L.jsx)(r.span,{"aria-hidden":!0,initial:`initial`,animate:`animate`,exit:`exit`,className:`absolute left-0 top-0 inline-block whitespace-pre`,children:f.split(``).map((e,t)=>(0,L.jsx)(r.span,{custom:t*G,variants:ee,className:`inline-block whitespace-pre`,children:e},t))},`cascade-${e}`):(0,L.jsx)(r.span,{variants:te[m],initial:!c&&`initial`,animate:c?{opacity:1,filter:`blur(0px)`,scale:1,y:0}:`animate`,exit:c?void 0:`exit`,className:`absolute left-0 top-0 inline-block`,children:t},`${n}-${e}`)})]})}function re(e){return(0,L.jsx)(ne,{...e,animation:`roll`})}function ie(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,[a,o]=M({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=D(a,!0,!0),u=k(),[d,f]=z.useState(),p=d===null?void 0:d??u,m=w(e=>{let t=!a,n=x(_,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return z.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var K=z.createContext(void 0);function q(){let e=z.useContext(K);if(e===void 0)throw Error(C(15));return e}var J=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=u.startingStyle]=`startingStyle`,e[e.endingStyle=u.endingStyle]=`endingStyle`,e}({}),ae=function(e){return e.panelOpen=`data-panel-open`,e}({}),oe={[J.open]:``},se={[J.closed]:``},ce={open(e){return e?{[ae.panelOpen]:``}:null}},Y={open(e){return e?oe:se},...m},le=z.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=w(o),d=ie({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=z.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=z.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=b(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Y});return(0,L.jsx)(K.Provider,{value:p,children:m})}),ue={...ce,...m},de=z.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=q(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=E({disabled:c,focusableWhenDisabled:!0,native:u});return b(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:ue})}),X={height:void 0,width:void 0};function fe(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,m=z.useRef(null),g=z.useRef(null),[_,y]=z.useState(X),b=z.useRef(X),C=z.useRef(!1),E=z.useRef(s),D=z.useRef(!1),[k,A]=z.useState(!1),j=z.useRef(null),M=f(t,m),N=O(s),P=h(m),F=!s&&!a,I=k?`idle`:u,L=s&&(E.current||D.current),R=!s&&a&&g.current===`css-animation`&&_.height===void 0&&_.width===void 0?b.current:_,B=n&&F&&g.current!==`css-animation`,V=w((e,t=!0)=>{t&&(b.current=e),y(e)}),H=w(()=>{j.current?.(),j.current=null}),U=w(e=>{H(),j.current=()=>{j.current=null,e()}}),W=w(()=>{s&&a&&g.current===`css-animation`&&(D.current=!0)});v(()=>{!k||u===`starting`||A(!1)},[k,u]),z.useEffect(()=>()=>{W(),H()},[W,H]),v(()=>{let e=m.current;if(!e)return;!s&&j.current&&H();let t=pe(e,L);if(g.current=t,s&&u===`idle`&&E.current&&t===`css-animation`){b.current=Z(e);return}if(s&&u===`starting`){let n=C.current;if(C.current=!1,t===`none`){V(Z(e)),A(!0);return}if(t===`css-transition`){let t=me(e);if(V(Z(e)),!n)return t;let r=$(e,`transition-duration`,`0s`);return U(r),A(!0),t}V(Z(e));let r=$(e,`animation-name`,`none`);if(!n){r();return}let i=$(e,`animation-duration`,`0s`);r(),U(i),A(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(E.current=!1,D.current=!1,t===`none`){V(X,!1),c(!1);return}V(Z(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Z(e);if(!(n.height>0||n.width>0)){c(!1);return}V(n),t===`css-animation`&&$(e,`animation-name`,`none`)()},[a,s,H,V,c,U,L,u]),T({enabled:s&&a&&I===`idle`,open:!0,ref:m,onComplete(){s&&V(X,!1)}}),z.useEffect(()=>{if(s||!a||I!==`ending`||!m.current)return;let e=new AbortController,t=-1;function n(){N.current||(c(!1),V(X,!1))}return t=p.request(()=>{P(n,e.signal)}),()=>{p.cancel(t),e.abort()}},[N,a,s,I,P,V,c]),v(()=>{let e=m.current;!e||!n||!F||e.setAttribute(`hidden`,`until-found`)},[F,n]),z.useEffect(function(){let e=m.current;if(!e)return;function t(e){let t=x(S,e);o(!0,t),!t.isCanceled&&(C.current=!0,l(!0))}return d(e,`beforematch`,t)},[o,l]);let G=i||n||a||s;return{height:R.height,props:{...B?{[J.startingStyle]:``}:void 0,hidden:F,id:r},ref:M,shouldPreventOpenAnimation:L,shouldRender:G,transitionStatus:I,width:R.width}}function Z(e){return{height:e.scrollHeight,width:e.scrollWidth}}function pe(e,t){let n=g(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Q(n.animationDuration),i=Q(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Q(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function $(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===``){e.style.removeProperty(t);return}e.style.setProperty(t,r,i)}}function me(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{if(n===``){e.style.removeProperty(t);return}e.style.setProperty(t,n)})}let r=p.request(n);return()=>{p.cancel(r),n()}}var he=function(e){return e.collapsiblePanelHeight=`--collapsible-panel-height`,e.collapsiblePanelWidth=`--collapsible-panel-width`,e}({}),ge=z.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=q(),x=r??!1,S=i??!1,C=o||void 0,w=C??l;v(()=>(m(e=>C??(e===null?void 0:e)),()=>{m(e=>e===C?null:e)}),[C,m]);let{height:T,props:E,ref:D,shouldPreventOpenAnimation:O,shouldRender:k,transitionStatus:A,width:j}=fe({externalRef:t,hiddenUntilFound:x,id:w,keepMounted:S,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),M={...g,transitionStatus:A},N=y(s,M),P=b(`div`,{...e,style:void 0},{state:M,ref:D,props:[E,{style:{[he.collapsiblePanelHeight]:T===void 0?`auto`:`${T}px`,[he.collapsiblePanelWidth]:j===void 0?`auto`:`${j}px`}},c,N?{style:N}:void 0,O?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Y});return k?P:null});function _e({...e}){return(0,L.jsx)(le,{"data-slot":`collapsible`,...e})}function ve({...e}){return(0,L.jsx)(de,{"data-slot":`collapsible-trigger`,...e})}function ye({...e}){return(0,L.jsx)(ge,{"data-slot":`collapsible-content`,...e})}export{R as a,P as c,re as i,N as l,ye as n,I as o,ve as r,F as s,_e as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/artifacts-panel-CX62LQ13.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/jsx-runtime-NZYk81nU.js","assets/button-0At5xSyU.js","assets/react-dom-Bwxum3ti.js","assets/x-BgciQ7_C.js","assets/createLucideIcon-DwxZHm0M.js","assets/utils-Eg7xtNmV.js","assets/tool-result-CBzwwUE9.js","assets/ease-vFBiNFNK.js","assets/layout-gyLzPvVv.js","assets/useControlled-CoY1jSuL.js","assets/chevron-down-BEVGmnSb.js","assets/loader-circle-6JG5RwxH.js","assets/collapsible-DmyYcezk.js","assets/useBaseUiId-B9f7fokB.js","assets/rotate-ccw-WNFNkKQD.js","assets/square-terminal-BYTN_I86.js","assets/preload-helper-Czpn1I53.js","assets/chevron-right-DrJxToLs.js","assets/package-CdcJFPf2.js","assets/openui-renderer-DlUo6ehT.js","assets/dialog-DZ44tBtH.js","assets/provider-catalog-BZhZuKSz.js","assets/input-CqC82Agz.js","assets/safe-external-url-Bl_78dpZ.js","assets/card-BKl76a3R.js","assets/chunk-BO2N2NFS-BnzHCiyQ.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/chat-CsepBQwy.js","assets/openui-utils-DawGoQNp.js","assets/switch-BFEBpUEU.js","assets/dist-MNgIFxqY.js","assets/markdown-DG7pUdsX.js","assets/cn-C8c0S2mI.js","assets/artifacts-utils-N_kUFbz2.js","assets/prime-agent-artifacts-CHGb5V_j.js","assets/resources-panel-DSU7VGX2.js","assets/resource-helpers-ULlyU8qK.js","assets/file-text-BhQ0ZnoU.js","assets/plug-Dt6VN0zF.js","assets/skeleton-loaders-fStjEeRP.js","assets/skeleton-CkR2VmWc.js","assets/session-insights-panel-DwmwiikS.js","assets/repl-panel-DiGS6uCw.js","assets/ipython-tool-BfeIa0nK.js","assets/subagents-panel-DGnsK6Nx.js","assets/range-vSJ7Ux_5.js","assets/sparkles-C5H3Jtgf.js","assets/bot-Bs7QWJ2q.js","assets/conversation-turns-ByFoWPXe.js","assets/notify-Duj26eeZ.js","assets/toast-C4s7FYYa.js","assets/fleet-pi-tool-renderer-BD_ZAjlG.js","assets/eye-B0DFz5hL.js","assets/search-eWVnAJsb.js","assets/dist-H-qlGkmT.js","assets/workspace-path-nav-C0AQNZyy.js","assets/workspace-panel-CjdXlEvd.js","assets/horizontal-resize-C1TpRLNC.js","assets/folder-BC5p7qK7.js","assets/hard-drive-CHqgr7VQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{a as r,n as i,o as a,r as o,t as s}from"./dialog-DZ44tBtH.js";import{t as c}from"./utils-Eg7xtNmV.js";import{t as l}from"./createLucideIcon-DwxZHm0M.js";import{t as u}from"./bot-Bs7QWJ2q.js";import{n as d}from"./useControlled-CoY1jSuL.js";import{t as f}from"./folder-BC5p7qK7.js";import{t as p}from"./package-CdcJFPf2.js";import{c as m,n as ee,o as h,t as g}from"./input-group-H0TG-mkU.js";import{t as _}from"./search-eWVnAJsb.js";import{t as v}from"./square-terminal-BYTN_I86.js";import{t as y}from"./preload-helper-Czpn1I53.js";import{t as b}from"./skeleton-CkR2VmWc.js";import{S as x,T as S,h as C,i as w,n as T,r as te,t as E}from"./dist-MNgIFxqY.js";var D=l(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),O=l(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),k=l(`rotate-ccw-clock`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),A=l(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),j=e(t(),1),M=n(),N=(0,j.lazy)(()=>y(async()=>{let{ArtifactsPanelContent:e}=await import(`./artifacts-panel-CX62LQ13.js`);return{ArtifactsPanelContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38])).then(({ArtifactsPanelContent:e})=>({default:e}))),P=(0,j.lazy)(()=>y(async()=>{let{ResourcesPanelContent:e}=await import(`./resources-panel-DSU7VGX2.js`);return{ResourcesPanelContent:e}},__vite__mapDeps([39,3,1,40,7,2,41,21,42,43,44,8])).then(({ResourcesPanelContent:e})=>({default:e}))),F=(0,j.lazy)(()=>y(async()=>{let{SessionInsightsPanel:e}=await import(`./session-insights-panel-DwmwiikS.js`);return{SessionInsightsPanel:e}},__vite__mapDeps([45,3,1])).then(({SessionInsightsPanel:e})=>({default:e}))),I=(0,j.lazy)(()=>y(async()=>{let{ReplPanelContent:e}=await import(`./repl-panel-DiGS6uCw.js`);return{ReplPanelContent:e}},__vite__mapDeps([46,1,2,3,47,8,7,36,18])).then(({ReplPanelContent:e})=>({default:e}))),L=(0,j.lazy)(()=>y(async()=>{let{SubagentsPanelContent:e}=await import(`./subagents-panel-DGnsK6Nx.js`);return{SubagentsPanelContent:e}},__vite__mapDeps([48,1,2,3,4,5,6,7,8,49,10,11,13,26,15,16,12,50,19,51,20,52,41,14,53,54,32,36,38,55,9,17,18,47,56,57,58,29,30,59])).then(({SubagentsPanelContent:e})=>({default:e}))),R=(0,j.lazy)(()=>y(async()=>{let{WorkspacePanelContent:e}=await import(`./workspace-panel-CjdXlEvd.js`);return{WorkspacePanelContent:e}},__vite__mapDeps([60,1,2,3,10,11,8,40,7,41,21,42,20,61,62,63,59,35,19,28,5,29,36,43,44])).then(({WorkspacePanelContent:e})=>({default:e})));function z(){return(0,M.jsxs)(`div`,{className:`flex min-h-32 flex-col gap-3 p-4`,"aria-label":`Loading panel`,children:[(0,M.jsx)(b,{className:`h-5 w-32`}),(0,M.jsx)(b,{className:`h-20 w-full`})]})}function ne(){let e=h();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(F,{activityLabel:e.activityLabel,artifactRuns:e.artifactRuns,chatMode:e.chatMode,messages:e.messages,planLabel:e.planLabel,presentation:e.presentation,queue:e.queue,selectedModelKey:e.selectedModelKey,sessionId:e.sessionId,status:e.status,thinkingLevel:e.thinkingLevel})})}function re(){let e=h(),t=m();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(P,{error:e.resourcesError,loading:e.resourcesLoading,resources:e.resources,workspace:t.workspaceTree})})}function ie(){let e=m();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(R,{error:e.workspaceError,loadWorkspaceFile:e.loadWorkspaceFile,loading:e.workspaceLoading,onSelectedPathChange:e.setSelectedWorkspacePath,selectedPath:e.selectedWorkspacePath,workspace:e.workspaceTree})})}function ae(){let e=h();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(N,{artifactRuns:e.artifactRuns,messages:e.messages,onOpenUIAction:e.onOpenUIAction,selectedArtifactId:e.selectedArtifactId,status:e.status})})}function oe(){let e=h();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(I,{artifactRuns:e.artifactRuns,selectedArtifactId:e.selectedArtifactId})})}function se(){let e=h();return(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(z,{}),children:(0,M.jsx)(L,{agents:e.presentation.rlmChildren,loadSession:e.loadSubagentSession,parentSessionId:e.sessionId,tree:e.presentation.rlmTree})})}var ce={resources:{id:`resources`,order:0,title:`Resources`,ariaLabel:`Resources`,commandLabel:`Open Resources`,commandKeywords:[`resources`,`skills`,`panels`],icon:O,dataTestid:`pi-resources-canvas`,mobileDataTestid:`pi-resources-mobile-panel`,badgeSource:`resources`,loadingSource:`resources`,refreshSource:`resources`,component:re},workspace:{id:`workspace`,order:1,title:`Workspace`,ariaLabel:`Workspace`,commandLabel:`Open Workspace`,commandKeywords:[`workspace`,`files`,`panels`],icon:f,dataTestid:`pi-workspace-canvas`,mobileDataTestid:`pi-workspace-mobile-panel`,badgeSource:void 0,loadingSource:`workspace`,refreshSource:`workspace`,component:ie},artifacts:{id:`artifacts`,order:2,title:`Artifacts`,ariaLabel:`Artifacts`,commandLabel:`Open Artifacts`,commandKeywords:[`artifacts`,`reports`,`datasets`,`panels`],icon:p,dataTestid:`pi-artifacts-canvas`,mobileDataTestid:`pi-artifacts-mobile-panel`,badgeSource:`artifacts`,loadingSource:void 0,refreshSource:void 0,component:ae},repl:{id:`repl`,order:3,title:`REPL`,ariaLabel:`REPL runs`,commandLabel:`Open REPL`,commandKeywords:[`repl`,`ipython`,`python`,`cells`,`panels`],icon:v,dataTestid:`pi-repl-canvas`,mobileDataTestid:`pi-repl-mobile-panel`,badgeSource:`repl`,loadingSource:void 0,refreshSource:void 0,component:oe},subagents:{id:`subagents`,order:4,title:`Subagents`,ariaLabel:`Subagents`,commandLabel:`Open Subagents`,commandKeywords:[`subagents`,`agents`,`threads`,`delegation`,`panels`],icon:u,dataTestid:`pi-subagents-canvas`,mobileDataTestid:`pi-subagents-mobile-panel`,badgeSource:`subagents`,loadingSource:void 0,refreshSource:void 0,component:se},"session-insights":{id:`session-insights`,order:5,title:`Session insights`,ariaLabel:`Session insights`,commandLabel:`Open Session Insights`,commandKeywords:[`session`,`insights`,`activity`,`panels`],icon:D,dataTestid:`pi-session-insights-canvas`,mobileDataTestid:`pi-session-insights-mobile-panel`,badgeSource:void 0,loadingSource:void 0,refreshSource:void 0,component:ne}},le=Object.values(ce).sort((e,t)=>e.order-t.order);function ue(e){return ce[e]}var de=1,fe=.9,pe=.8,me=.17,B=.1,V=.999,he=.9999,ge=.99,_e=/[\\\/_+.#"@\[\(\{&]/,ve=/[\\\/_+.#"@\[\(\{&]/g,ye=/[\s-]/,be=/[\s-]/g;function H(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?de:ge;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=H(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=de:_e.test(e.charAt(l-1))?(d*=pe,p=e.slice(i,l-1).match(ve),p&&i>0&&(d*=V**+p.length)):ye.test(e.charAt(l-1))?(d*=fe,m=e.slice(i,l-1).match(be),m&&i>0&&(d*=V**+m.length)):(d*=me,i>0&&(d*=V**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=he)),(d<B&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=H(e,t,n,r,l+1,a+2,o),f*B>d&&(d=f*B)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function xe(e){return e.toLowerCase().replace(be,` `)}function Se(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,H(e,t,xe(e),xe(t),0,0,{})}var U=`[cmdk-group=""]`,W=`[cmdk-group-items=""]`,Ce=`[cmdk-group-heading=""]`,we=`[cmdk-item=""]`,Te=`${we}:not([aria-disabled="true"])`,G=`cmdk-item-select`,K=`data-value`,Ee=(e,t,n)=>Se(e,t,n),De=j.createContext(void 0),q=()=>j.useContext(De),Oe=j.createContext(void 0),J=()=>j.useContext(Oe),ke=j.createContext(void 0),Ae=j.forwardRef((e,t)=>{let n=Z(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Z(()=>new Set),i=Z(()=>new Map),a=Z(()=>new Map),o=Z(()=>new Set),s=Ve(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:ee=!1,vimBindings:h=!0,...g}=e,_=x(),v=x(),y=x(),b=j.useRef(null),S=Ue();X(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),X(()=>{S(6,k)},[]);let w=j.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(y);e?e.focus():(i=document.getElementById(_))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=j.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,te(t,r)),S(2,()=>{E(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:_,inputId:y,labelId:v,listInnerRef:b}),[]);function te(e,t){let r=s.current?.filter??Ee;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=b.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(W);t?t.appendChild(e.parentElement===t?e:e.closest(`${W} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${W} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=b.current?.querySelector(`${U}[${K}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(K);w.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=te(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(U)?.querySelector(Ce))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return b.current?.querySelector(`${we}[aria-selected="true"]`)}function M(){return Array.from(b.current?.querySelectorAll(Te)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(K))}function P(e){var t;let n=A(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(K))}function F(e){let t=A()?.closest(U),n;for(;t&&!n;)t=e>0?ze(t,U):Be(t,U),n=t?.querySelector(Te);n?w.setState(`value`,n.getAttribute(K)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return j.createElement(C.div,{ref:t,tabIndex:-1,...g,"cmdk-root":``,onKeyDown:e=>{var t;(t=g.onKeyDown)==null||t.call(g,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:h&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:h&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(G);t.dispatchEvent(e)}}}}},j.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Ge},c),$(e,e=>j.createElement(Oe.Provider,{value:w},j.createElement(De.Provider,{value:T},e))))}),je=j.forwardRef((e,t)=>{let n=x(),r=j.useRef(null),i=j.useContext(ke),a=q(),o=Ve(e),s=o.current?.forceMount??i?.forceMount;X(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=He(n,r,[e.value,e.children,r],e.keywords),l=J(),u=Q(e=>e.value&&e.value===c.current),d=Q(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);j.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(G,f),()=>t.removeEventListener(G,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:ee,onSelect:h,forceMount:g,keywords:_,...v}=e;return j.createElement(C.div,{ref:S(r,t),...v,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),Me=j.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=x(),s=j.useRef(null),c=j.useRef(null),l=x(),u=q(),d=Q(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));X(()=>u.group(o),[]),He(o,s,[e.value,e.heading,c]);let f=j.useMemo(()=>({id:o,forceMount:i}),[i]);return j.createElement(C.div,{ref:S(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&j.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),$(e,e=>j.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},j.createElement(ke.Provider,{value:f},e))))}),Ne=j.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=j.useRef(null),a=Q(e=>!e.search);return!n&&!a?null:j.createElement(C.div,{ref:S(i,t),...r,"cmdk-separator":``,role:`separator`})}),Pe=j.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=J(),o=Q(e=>e.search),s=Q(e=>e.selectedItemId),c=q();return j.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),j.createElement(C.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Fe=j.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=j.useRef(null),o=j.useRef(null),s=Q(e=>e.selectedItemId),c=q();return j.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),j.createElement(C.div,{ref:S(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},$(e,e=>j.createElement(`div`,{ref:S(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Ie=j.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return j.createElement(E,{open:n,onOpenChange:r},j.createElement(w,{container:o},j.createElement(te,{"cmdk-overlay":``,className:i}),j.createElement(T,{"aria-label":e.label,"cmdk-dialog":``,className:a},j.createElement(Ae,{ref:t,...s}))))}),Le=j.forwardRef((e,t)=>Q(e=>e.filtered.count===0)?j.createElement(C.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Re=j.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return j.createElement(C.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$(e,e=>j.createElement(`div`,{"aria-hidden":!0},e)))}),Y=Object.assign(Ae,{List:Fe,Item:je,Input:Pe,Group:Me,Separator:Ne,Dialog:Ie,Empty:Le,Loading:Re});function ze(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Be(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Ve(e){let t=j.useRef(e);return X(()=>{t.current=e}),t}var X=typeof window>`u`?j.useEffect:j.useLayoutEffect;function Z(e){let t=j.useRef();return t.current===void 0&&(t.current=e()),t}function Q(e){let t=J(),n=()=>e(t.snapshot());return j.useSyncExternalStore(t.subscribe,n,n)}function He(e,t,n,r=[]){let i=j.useRef(),a=q();return X(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(K,s),i.current=s}),i}var Ue=()=>{let[e,t]=j.useState(),n=Z(()=>new Map);return X(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function We(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function $({asChild:e,children:t},n){return e&&j.isValidElement(t)?j.cloneElement(We(t),{ref:t.ref},n(t.props.children)):n(t)}var Ge={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Ke({className:e,...t}){return(0,M.jsx)(Y,{"data-slot":`command`,className:c(`flex size-full flex-col overflow-hidden !rounded-xl p-1 text-popover-foreground`,e),...t})}function qe({title:e=`Command Palette`,description:t=`Search for a command to run...`,children:n,className:l,showCloseButton:u=!1,...d}){return(0,M.jsx)(s,{...d,children:(0,M.jsxs)(i,{className:c(`top-1/3 translate-y-0 overflow-hidden !rounded-xl p-0`,l),showCloseButton:u,children:[(0,M.jsxs)(r,{className:`sr-only`,children:[(0,M.jsx)(a,{children:e}),(0,M.jsx)(o,{children:t})]}),(0,M.jsx)(Ke,{children:n})]})})}function Je({className:e,...t}){return(0,M.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pb-0`,children:(0,M.jsxs)(g,{className:`!h-8 !rounded-lg border-input/30 bg-input/30 !shadow-none *:data-[slot=input-group-addon]:!pl-2`,children:[(0,M.jsx)(Y.Input,{"data-slot":`command-input`,className:c(`w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t}),(0,M.jsx)(ee,{children:(0,M.jsx)(_,{className:`size-4 shrink-0 opacity-50`})})]})})}function Ye({className:e,...t}){return(0,M.jsx)(Y.List,{"data-slot":`command-list`,className:c(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,e),...t})}function Xe({className:e,...t}){return(0,M.jsx)(Y.Empty,{"data-slot":`command-empty`,className:c(`py-6 text-center text-sm`,e),...t})}function Ze({className:e,...t}){return(0,M.jsx)(Y.Group,{"data-slot":`command-group`,className:c(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,M.jsx)(Y.Separator,{"data-slot":`command-separator`,className:c(`-mx-1 h-px bg-border`,e),...t})}function $e({className:e,children:t,...n}){return(0,M.jsxs)(Y.Item,{"data-slot":`command-item`,className:c(`group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:!rounded-lg data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground`,e),...n,children:[t,(0,M.jsx)(d,{className:`ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100`})]})}export{Je as a,Qe as c,A as d,k as f,Ze as i,le as l,qe as n,$e as o,O as p,Xe as r,Ye as s,Ke as t,ue as u};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/openui-renderer-DlUo6ehT.js","assets/rolldown-runtime-hePW80VL.js","assets/bundle-mjs-DKHVkVWu.js","assets/react-dom-Bwxum3ti.js","assets/jsx-runtime-NZYk81nU.js","assets/button-0At5xSyU.js","assets/x-BgciQ7_C.js","assets/createLucideIcon-DwxZHm0M.js","assets/utils-Eg7xtNmV.js","assets/dialog-DZ44tBtH.js","assets/useBaseUiId-B9f7fokB.js","assets/provider-catalog-BZhZuKSz.js","assets/useControlled-CoY1jSuL.js","assets/chevron-down-BEVGmnSb.js","assets/input-CqC82Agz.js","assets/safe-external-url-Bl_78dpZ.js","assets/card-BKl76a3R.js","assets/chunk-BO2N2NFS-BnzHCiyQ.js","assets/preload-helper-Czpn1I53.js","assets/lib-ChrQ49PO.js","assets/character-entities-legacy-Wut6vMuj.js","assets/chat-CsepBQwy.js","assets/openui-utils-DawGoQNp.js","assets/switch-BFEBpUEU.js","assets/dist-MNgIFxqY.js","assets/markdown-DG7pUdsX.js","assets/cn-C8c0S2mI.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t}from"./bundle-mjs-DKHVkVWu.js";import{t as n}from"./react-dom-Bwxum3ti.js";import{t as r}from"./jsx-runtime-NZYk81nU.js";import{d as i,m as a,o,p as s,r as c}from"./ease-vFBiNFNK.js";import{t as l}from"./x-BgciQ7_C.js";import{t as u}from"./utils-Eg7xtNmV.js";import{t as d}from"./createLucideIcon-DwxZHm0M.js";import{_ as f,a as p,l as m}from"./range-vSJ7Ux_5.js";import{n as h}from"./useControlled-CoY1jSuL.js";import{t as g}from"./chevron-down-BEVGmnSb.js";import{t as _}from"./chevron-right-DrJxToLs.js";import{n as v,t as y}from"./file-text-BhQ0ZnoU.js";import{n as b,t as x}from"./loader-circle-6JG5RwxH.js";import{c as S,l as C,o as w}from"./collapsible-DmyYcezk.js";import{t as T}from"./notify-Duj26eeZ.js";import{t as E}from"./preload-helper-Czpn1I53.js";import{t as D}from"./openui-utils-DawGoQNp.js";import"./cn-C8c0S2mI.js";var O=d(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),k=d(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),A=d(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),j=d(`file-pen-line`,[[`path`,{d:`M14.364 13.634a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506l4.013-4.009a1 1 0 0 0-3.004-3.004z`,key:`ukzhwg`}],[`path`,{d:`M14.487 7.858A1 1 0 0 1 14 7V2`,key:`1klhew`}],[`path`,{d:`M20 19.645V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l2.516 2.516`,key:`rxaxab`}],[`path`,{d:`M8 18h1`,key:`13wk12`}]]),M=d(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),N=d(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),P=e(t(),1),F=(0,P.createContext)(void 0),I=r(),L=(0,P.createContext)({animateIn:!0,variant:`soft`}),R=(0,P.createContext)(()=>{});function z(...e){return t=>{for(let n of e)typeof n==`function`?n(t):n&&(n.current=t)}}var B={duration:.12,ease:c,delay:.04},V={type:`spring`,stiffness:520,damping:27,mass:.52};function H({variant:e=`soft`,align:t,animateIn:n=!1,className:r,children:a,initial:c,animate:l,exit:d,transition:f,layout:p,...m}){let h=s()??!1,g=(0,P.useContext)(F),_=t??g??`start`,v=(0,P.useMemo)(()=>({align:_,animateIn:n,variant:e}),[n,_,e]);return(0,I.jsx)(L.Provider,{value:v,children:(0,I.jsx)(i.div,{"data-slot":`message-bubble`,"data-align":_,"data-variant":e,layout:p,initial:c??!1,animate:l,exit:d??(h?{opacity:0}:{opacity:0,y:-3,scale:.99}),transition:f??(h?{duration:.12}:o),className:u(`group/bubble flex w-full flex-col`,_===`end`?`items-end`:`items-start`,r),...m,children:a})})}function U(e,t){return u(`relative z-0 min-w-9 max-w-[82%] rounded-2xl px-3.5 py-2.5 text-sm leading-6 text-foreground`,`[&_a]:font-medium [&_a]:underline [&_a]:underline-offset-4 [&_code]:rounded [&_code]:bg-background/60 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-[0.9em] [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-5 [&_p+p]:mt-2 [&_pre]:my-2 [&_pre]:overflow-x-auto [&_pre]:rounded-xl [&_pre]:bg-background/60 [&_pre]:p-3 [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-5`,e===`solid`&&`text-background`,e===`ghost`&&`w-full max-w-none rounded-none px-0 py-0`,e===`danger`&&`text-destructive`,t&&`cursor-pointer text-left outline-none transition-[background-color,color,transform] duration-150 hover:brightness-[0.98] focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.99]`)}function ee(e,t){return u(`pointer-events-none absolute inset-0 -z-10 rounded-[inherit]`,t===`end`?`origin-bottom-right`:`origin-bottom-left`,e===`solid`&&`bg-foreground`,e===`soft`&&`bg-muted`,e===`tint`&&`bg-primary/10`,e===`outline`&&`border border-border/70 bg-background`,e===`danger`&&`bg-destructive/10`)}function W({render:e,className:t,children:n,ref:r,...a}){let l=s()??!1,{align:d=`start`,animateIn:f,variant:p}=(0,P.useContext)(L),[m,h]=(0,P.useState)(0),g=(0,P.useCallback)(()=>h(e=>e+1),[]),_=e?.type===`button`||e?.type===`a`,v=u(U(p,_),t),y=(0,I.jsxs)(I.Fragment,{children:[p===`ghost`?null:(0,I.jsx)(i.span,{"aria-hidden":`true`,layout:!l&&`size`,layoutDependency:m,initial:f&&!l?{opacity:0,scale:.92}:!1,animate:{opacity:1,scale:1},transition:l?{duration:0}:{opacity:{duration:.12,ease:c},scale:V,layout:o},className:ee(p,d)}),(0,I.jsx)(R.Provider,{value:g,children:(0,I.jsx)(i.div,{initial:f?{opacity:0}:!1,animate:{opacity:1},transition:l?{duration:.12,ease:c}:B,className:`relative`,children:n})})]});if(e){let t=e;return(0,P.cloneElement)(t,{...a,ref:z(t.props.ref,r),className:u(v,t.props.className),children:y,"data-slot":`message-bubble-content`})}return(0,I.jsx)(`div`,{ref:r,"data-slot":`message-bubble-content`,className:v,...a,children:y})}function G({item:e}){return(0,I.jsxs)(`div`,{"data-slot":`preview-rail-card`,className:`rounded-2xl border border-border bg-card p-4 shadow-sm`,children:[(0,I.jsx)(`p`,{"data-slot":`preview-rail-title`,className:`font-medium text-card-foreground`,children:e.label}),e.description?(0,I.jsx)(`div`,{"data-slot":`preview-rail-description`,className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.description}):null]})}function te({items:e,label:t=`Section navigation`,orientation:n=`vertical`,activeId:r,defaultActiveId:l,onActiveChange:d,onItemSelect:f,renderPreview:p,showPreview:h=!0,previewSide:g=`after`,highlightActive:_=!1,itemSize:v=24,children:y,className:b,railClassName:x,previewContainerClassName:S,previewClassName:C}){let w=(0,P.useId)(),T=s(),E=m(),[D,O]=(0,P.useState)(l??e[0]?.id??``),[k,A]=(0,P.useState)(null),[j,M]=(0,P.useState)(null),N=r??D,F=e.some(e=>e.id===N)?N:e[0]?.id??``,L=k??j??``,R=L||(_?F:``),z=e.findIndex(e=>e.id===R),B=e.length?`repeat(${e.length}, ${v}px)`:void 0,V=n===`horizontal`,H=e=>{r===void 0&&O(e),d?.(e)};return(0,I.jsxs)(i.div,{layoutRoot:!0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||M(null)},className:u(`isolate relative flex w-full overflow-visible`,V?`min-h-64 flex-col items-center justify-center`:`min-h-80`,b),children:[(0,I.jsx)(`nav`,{"aria-label":t,onPointerLeave:()=>A(null),style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:u(`relative z-10 grid shrink-0`,V?`h-12 w-fit max-w-full self-center justify-center`:`w-12 content-center`,x),children:e.map((e,t)=>{let n=e.id===F,r=e.id===R,a=z<0?1/0:Math.abs(t-z),s=r?1:a===1?.68:a===2?.44:.25,c=(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(i.span,{"data-slot":`preview-rail-tick`,"aria-hidden":`true`,animate:V?{scaleY:s}:{scaleX:s},transition:T?{duration:0}:o,className:u(`block bg-current`,V?`h-12 w-0.5 origin-bottom`:`h-0.5 w-12 origin-left`,r?`text-foreground`:void 0)})}),l=u(`relative flex text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background`,V?`h-12 w-6 items-end justify-center`:`h-6 w-12 items-center`),d=V?{width:v}:{height:v},p=()=>{E&&A(e.id)},m=t=>{t.matches(`:focus-visible`)&&M(e.id)},h=()=>{H(e.id),f?.(e)};return e.href?(0,I.jsx)(`a`,{"data-slot":`preview-rail-item`,href:e.href,target:e.target,rel:e.rel??(e.target===`_blank`?`noreferrer noopener`:void 0),"aria-label":e.ariaLabel??e.label,"aria-current":n?`page`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:l,children:c},e.id):(0,I.jsx)(`button`,{"data-slot":`preview-rail-item`,type:`button`,"aria-label":e.ariaLabel??e.label,"aria-current":n?`location`:void 0,onPointerEnter:p,onMouseEnter:p,onPointerDown:()=>M(null),onFocus:e=>m(e.currentTarget),onClick:h,style:d,className:l,children:c},e.id)})}),h?(0,I.jsx)(`div`,{"aria-hidden":`true`,style:V?{gridTemplateColumns:B}:{gridTemplateRows:B},className:u(`pointer-events-none absolute z-50 grid`,V?`top-1/2 left-1/2 h-5 w-fit max-w-full -translate-x-1/2 -translate-y-1/2 justify-center`:g===`before`?`inset-y-0 right-16 left-4 content-center`:`inset-y-0 right-4 left-16 content-center`,S),children:e.map(e=>(0,I.jsx)(`div`,{style:V?{width:v}:{height:v},className:u(`relative flex items-center`,V?`justify-center`:void 0),children:(0,I.jsx)(a,{mode:`wait`,initial:!1,children:e.id===L?(0,I.jsx)(i.div,{initial:T?{opacity:0}:{opacity:0,y:4,filter:`blur(6px)`},animate:T?{opacity:1}:{opacity:1,y:0,filter:`blur(0px)`},exit:T?{opacity:0}:{opacity:0,y:-2,filter:`blur(4px)`,transition:{duration:.12,ease:c}},transition:{duration:T?0:.18,ease:c},className:u(V?`absolute bottom-12 left-1/2 w-72 -translate-x-1/2`:u(`w-full max-w-sm`,g===`before`&&`ml-auto`),C),children:(0,I.jsx)(i.div,{layoutId:`preview-rail-card-${w}`,transition:T?{duration:0}:o,children:p?p(e):(0,I.jsx)(G,{item:e})})},e.id):null})},e.id))}):null,y?(0,I.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`,children:y}):null]})}var K=56,ne=88;function re(e,t){if(e.length<=t)return e;let n=e.slice(0,t),r=n.lastIndexOf(` `);return`${n.slice(0,r>t*.65?r:t).trim()}…`}function q(e){return((e.querySelector(`[data-slot="message-bubble-content"]`)??e.querySelector(`[data-slot="message-content"]`)??e).textContent??``).replace(/\s+/g,` `).trim()}function ie(e,t){let n=q(e);if(!n)return{label:`Message`,description:void 0};if(n.length<=K){let e=t?q(t):``;return{label:n,description:e?re(e,ne):void 0}}let r=n.slice(0,K).lastIndexOf(` `),i=r>K*.65?r:K,a=`${n.slice(0,i).trim()}…`,o=t?q(t):n.slice(i).trim();return{label:a,description:o?re(o,ne):void 0}}function ae({navigation:e,followThreshold:t,contentRef:n,viewportRef:r,reduce:i,smooth:a,scrollToEnd:o,setFollowing:s,markProgrammaticScroll:c}){let l=(0,P.useRef)(void 0),u=(0,P.useRef)(new WeakMap),d=(0,P.useRef)(0),f=(0,P.useRef)(new Map),[p,m]=(0,P.useState)([]),[h,g]=(0,P.useState)(``),[_,v]=(0,P.useState)(!1),y=(0,P.useCallback)(()=>{if(e!==`rail`)return;let n=r.current,i=[...f.current.entries()];if(!n||i.length===0)return;let a=n.getBoundingClientRect();if(n.scrollTop<=t){let e=i[0]?.[0]??``;g(t=>t===e?t:e);return}if(n.scrollHeight-n.scrollTop-n.clientHeight<=t){let e=i.at(-1)?.[0]??``;g(t=>t===e?t:e);return}let o=a.top+a.height/2,s=i[0]?.[0]??``,c=1/0;for(let[e,t]of i){let n=t.getBoundingClientRect(),r=Math.abs(n.top+n.height/2-o);r<c&&(c=r,s=e)}g(e=>e===s?e:s)},[t,e,r]),b=(0,P.useCallback)(()=>{if(e!==`rail`)return;let t=n.current,i=r.current;if(!t||!i)return;let a=Array.from(t.querySelectorAll(`[data-slot="message"]`)),o=new Map,s=a.map((e,t)=>{let n=u.current.get(e);n||(d.current+=1,n=`message-rail-${d.current}`,u.current.set(e,n)),o.set(n,e);let r=e.dataset.from??`conversation`,i=ie(e,r===`user`?a.slice(t+1).find(e=>e.dataset.from===`assistant`):void 0);return{id:n,label:i.label,description:i.description,ariaLabel:`Go to ${r} message ${t+1} of ${a.length}`}});f.current=o,m(e=>e.length===s.length&&e.every((e,t)=>e.id===s[t]?.id&&e.label===s[t]?.label&&e.description===s[t]?.description&&e.ariaLabel===s[t]?.ariaLabel)?e:s),v(i.scrollHeight>i.clientHeight+1&&a.length>1)},[n,e,r]),x=(0,P.useCallback)(()=>{e===`rail`&&(l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{b(),y()}))},[e,b,y]);return(0,P.useEffect)(()=>{if(e!==`rail`){f.current.clear(),m([]),v(!1);return}let t=n.current,i=r.current;if(!t||!i)return;x();let a=typeof MutationObserver>`u`?null:new MutationObserver(x);a?.observe(t,{childList:!0,characterData:!0,subtree:!0});let o=typeof ResizeObserver>`u`?null:new ResizeObserver(x);return o?.observe(t),o?.observe(i),()=>{a?.disconnect(),o?.disconnect()}},[n,e,x,r]),(0,P.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]),{activeRailId:h,railItems:p,railOverflowing:_,scheduleRailSync:x,scrollToRailItem:(0,P.useCallback)(e=>{let t=r.current,n=f.current.get(e.id);if(!t||!n)return;let l=p.at(-1)?.id===e.id;if(g(e.id),l){s(!0),o(i||!a?`auto`:`smooth`);return}s(!1),c(i||!a?`auto`:`smooth`);let u=t.getBoundingClientRect(),d=n.getBoundingClientRect(),m=t.scrollTop+d.top-u.top-(t.clientHeight-d.height)/2,h=i||!a?`auto`:`smooth`;typeof t.scrollTo==`function`?t.scrollTo({top:m,behavior:h}):t.scrollTop=m},[c,p,i,o,s,a,r])}}function oe({followOutput:e=!0,followThreshold:t=56,smooth:n=!0,onFollowChange:r,label:i=`Conversation`,busy:a,navigation:o,navigationLabel:c=`Message navigation`,viewportClassName:l,contentClassName:d,railClassName:f,viewportRef:p,viewportProps:m,contentProps:h,className:g,children:_,...v}){let y=s()??!1,b=(0,P.useRef)(null),x=(0,P.useRef)(null),S=(0,P.useRef)(e),C=(0,P.useRef)(!1),w=(0,P.useRef)(void 0),T=(0,P.useRef)(void 0),{onScroll:E,onWheel:D,onTouchStart:O,onKeyDown:k,...A}=m??{},j=(0,P.useCallback)(e=>{b.current=e,typeof p==`function`?p(e):p&&(p.current=e)},[p]),M=(0,P.useCallback)(e=>{S.current!==e&&(S.current=e,r?.(e))},[r]),N=(0,P.useCallback)(e=>{C.current=!0,w.current&&window.clearTimeout(w.current),w.current=window.setTimeout(()=>{C.current=!1},e===`smooth`?320:0)},[]),F=(0,P.useCallback)(e=>{let t=b.current;t&&(N(e),typeof t.scrollTo==`function`?t.scrollTo({top:t.scrollHeight,behavior:e}):t.scrollTop=t.scrollHeight)},[N]),{activeRailId:L,railItems:R,railOverflowing:z,scheduleRailSync:B,scrollToRailItem:V}=ae({navigation:o,followThreshold:t,contentRef:x,viewportRef:b,reduce:y,smooth:n,scrollToEnd:F,setFollowing:M,markProgrammaticScroll:N}),H=(0,P.useEffectEvent)(B),U=(0,P.useEffectEvent)(F),ee=(0,P.useCallback)(()=>{let e=b.current;if(!e||C.current)return;let n=e.scrollHeight-e.scrollTop-e.clientHeight;M(n<=t),B()},[t,B,M]),W=(0,P.useCallback)(()=>{C.current=!1},[]);(0,P.useLayoutEffect)(()=>{if(S.current=e,e)return T.current=requestAnimationFrame(()=>U(`auto`)),()=>{T.current&&cancelAnimationFrame(T.current)}},[e]),(0,P.useEffect)(()=>{let t=x.current;if(!t||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{H(),!(!e||!S.current)&&U(y||!n?`auto`:`smooth`)});return r.observe(t),()=>r.disconnect()},[e,y,n]),(0,P.useEffect)(()=>()=>{w.current&&window.clearTimeout(w.current),T.current&&cancelAnimationFrame(T.current)},[]);let G=(0,I.jsx)(`section`,{ref:j,"aria-label":i,...A,onScroll:e=>{ee(),E?.(e)},onWheel:e=>{W(),D?.(e)},onTouchStart:e=>{W(),O?.(e)},onKeyDown:e=>{[`ArrowUp`,`PageUp`,`Home`].includes(e.key)&&W(),k?.(e)},className:u(`h-full overflow-y-auto overscroll-contain outline-none [overflow-anchor:none] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring`,o===`rail`?`[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`:`[scrollbar-gutter:stable]`,l,o===`rail`&&z&&`pr-10`),children:(0,I.jsx)(`div`,{ref:x,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-busy":a,className:d,...h,children:_})});return(0,I.jsx)(`div`,{"data-slot":`message-scroller`,className:u(`min-h-0`,g),...v,children:o===`rail`?(0,I.jsx)(te,{items:z?R:[],label:c,activeId:L,onItemSelect:V,previewSide:`before`,highlightActive:!0,itemSize:14,className:`h-full min-h-0 overflow-hidden`,previewContainerClassName:`right-8 left-3`,previewClassName:`mr-1 w-64 max-w-full [&_[data-slot=preview-rail-card]]:h-20 [&_[data-slot=preview-rail-card]]:overflow-hidden [&_[data-slot=preview-rail-card]]:p-3 [&_[data-slot=preview-rail-title]]:line-clamp-1 [&_[data-slot=preview-rail-title]]:text-xs [&_[data-slot=preview-rail-title]]:leading-4 [&_[data-slot=preview-rail-description]]:line-clamp-2 [&_[data-slot=preview-rail-description]]:text-xs [&_[data-slot=preview-rail-description]]:leading-4`,railClassName:u(`absolute inset-y-3 right-1 w-7 content-center py-1 [&_[data-slot=preview-rail-item]]:w-7 [&_[data-slot=preview-rail-item]]:justify-end [&_[data-slot=preview-rail-tick]]:h-px [&_[data-slot=preview-rail-tick]]:w-4 [&_[data-slot=preview-rail-tick]]:origin-right`,z?`pointer-events-auto opacity-100`:`pointer-events-none opacity-0`,f),children:G}):G})}var se=(0,P.createContext)({from:`assistant`}),ce={type:`spring`,stiffness:480,damping:32,mass:.62};function le({from:e,animateIn:t=!1,children:n,className:r,initial:a,animate:o,transition:c,exit:l,style:d,...f}){let p=s()??!1,m=(0,P.useMemo)(()=>({from:e}),[e]);return(0,I.jsx)(F.Provider,{value:e===`user`?`end`:`start`,children:(0,I.jsx)(se.Provider,{value:m,children:(0,I.jsx)(i.article,{"data-slot":`message`,"data-from":e,"aria-label":f[`aria-label`]??`${e} message`,initial:a??(t&&!p?{opacity:0,transform:`translateY(8px) scale(0.95)`}:!1),animate:o??(t&&!p?{opacity:1,transform:`translateY(0px) scale(1)`}:{opacity:1}),exit:l??(p?{opacity:0}:{opacity:0,transform:`translateY(-3px) scale(0.99)`}),transition:c??(p?{duration:.12}:ce),style:{transformOrigin:e===`user`?`100% 100%`:`0% 100%`,...d},className:u(`group/message flex w-full items-start gap-2`,e===`user`?`flex-row-reverse`:`flex-row`,r),...f,children:n})})})}function ue({className:e,...t}){let{from:n}=(0,P.useContext)(se);return(0,I.jsx)(`div`,{"data-slot":`message-content`,className:u(`flex min-w-0 flex-1 flex-col gap-1.5`,n===`user`?`items-end`:`items-start`,e),...t})}var de=(0,P.memo)(function({title:e=`Something went wrong`,message:t,className:n}){return(0,I.jsx)(`div`,{className:u(`flex justify-start`,n),children:(0,I.jsxs)(`div`,{className:`rounded-[8px] border border-red-500/30 bg-red-500/10 px-4 py-2.5 text-sm text-an-foreground`,children:[(0,I.jsx)(`div`,{className:`font-medium text-an-foreground`,children:e}),(0,I.jsx)(`div`,{className:`mt-0.5 text-an-foreground-muted`,children:t})]})})});function fe(e){if(typeof e==`string`)return e;if(e===void 0)return``;try{return JSON.stringify(e,null,2)??``}catch{return String(e)}}function pe({part:e}){let t=fe(e.payload);return(0,I.jsxs)(`section`,{"data-payload-kind":e.kind,className:`w-full min-w-0 overflow-hidden rounded-xl border border-border/60 bg-muted/40 text-sm`,children:[(0,I.jsx)(`div`,{className:`border-b border-border/50 px-3 py-2 text-xs font-medium text-muted-foreground`,children:e.title}),e.text?(0,I.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words px-3 py-3 font-mono text-xs leading-5 text-foreground/80`,children:e.text}):null,t?(0,I.jsxs)(`details`,{open:!0,className:`border-t border-border/50 px-3 py-2`,children:[(0,I.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-muted-foreground`,children:`Payload`}),(0,I.jsx)(`pre`,{className:`m-0 mt-2 max-w-full whitespace-pre-wrap break-words font-mono text-xs leading-5 text-foreground/70`,children:t})]}):null]})}function me(e){return typeof e==`object`&&!!e}function J(e){if(typeof e!=`string`)return e;let t=e.trim();if(!t)return e;try{let n=JSON.parse(t);return me(n)||Array.isArray(n)?n:e}catch{return e}}function he(e){if(!me(e)||typeof e.type!=`string`||!e.type.startsWith(`tool-`))return e;let t=J(e.input),n=J(e.output),r=J(e.result),i=t!==e.input,a=n!==e.output,o=r!==e.result;if(!i&&!a&&!o)return e;let s={...e};return i&&(s.input=t),a&&(s.output=n),o&&(s.result=r),s}function ge(e){let t=!1,n=e.map(e=>{let n=he(e);return n!==e&&(t=!0),n});return t?n:e}var _e=new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}),ve=new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`});function ye(e){let t=new Date;return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()?_e.format(e):ve.format(e)}function be({text:e,onCopied:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>()=>{i.current&&window.clearTimeout(i.current)},[]),(0,I.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":n?`Copied`:`Copy message`,onClick:async()=>{try{await navigator.clipboard.writeText(e),r(!0),i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{r(!1),i.current=null},2e3),T.success(`Copied to clipboard`),t?.()}catch{T.error(`Failed to copy to clipboard`)}},onPointerDown:e=>{e.stopPropagation()},onMouseDown:e=>e.stopPropagation(),className:u(`flex size-6 items-center justify-center rounded-md transition-[background-color,opacity,transform] duration-150 ease-out active:scale-[0.97]`,`bg-transparent opacity-50 hover:bg-an-foreground/10 hover:opacity-100`),children:(0,I.jsxs)(`div`,{className:`relative h-3.5 w-3.5`,children:[(0,I.jsx)(S,{className:u(`absolute inset-0 h-3.5 w-3.5 text-an-foreground-muted transition-[opacity,transform] duration-150 ease-out`,n?`scale-50 opacity-0`:`scale-100 opacity-100`)}),(0,I.jsx)(h,{className:u(`absolute inset-0 h-3.5 w-3.5 text-an-foreground-muted transition-[opacity,transform] duration-150 ease-out`,n?`scale-100 opacity-100`:`scale-50 opacity-0`)})]})})}function xe({text:e,timestamp:t,heightClass:n,hoverClass:r,isVisible:i,alignClass:a,onCopied:o}){return(0,I.jsxs)(`div`,{className:u(`pointer-events-none flex items-center gap-1 pt-1 text-xs text-an-foreground-muted/70 opacity-0 transition-opacity duration-100`,n,a,r,i&&`pointer-events-auto opacity-100`),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:[t&&(0,I.jsx)(`span`,{children:t}),e&&(0,I.jsx)(be,{text:e,onCopied:o})]})}function Y(e){return typeof e==`object`&&!!e}function X(e){return Y(e)&&e.type===`text`&&typeof e.text==`string`}function Se(e){return Y(e)&&e.type===`error`&&typeof e.message==`string`}function Ce(e){return Y(e)&&e.type===`payload`&&typeof e.kind==`string`&&typeof e.title==`string`}function Z(e){if(!Y(e))return!1;let t=e.type;return t===`dynamic-tool`||typeof t==`string`&&t.startsWith(`tool-`)}function we(e,t){let n=[];for(let t of e)X(t)&&n.push(t.text);return n.join(t)}(0,P.memo)(function(e){let{message:t,UserMessageComponent:n,userMessageClassName:r,onCopied:i,display:a}=e,{enableImagePreview:o,showCopyToolbar:s,isMounted:c,isCopyVisible:l}=a,u=we(t.parts??[],``),d=(t.parts??[]).length>0;if(!u&&!d)return null;let f=t?.createdAt,p=`user-${t.id}`,m=c&&f?ye(new Date(f)):void 0;return(0,I.jsxs)(`div`,{className:`group/user-message`,children:[(0,I.jsx)(n,{message:t,className:r,enableImagePreview:o}),(s&&!!u||!!m)&&(0,I.jsx)(xe,{text:s?u:``,timestamp:m,heightClass:`h-[28px]`,hoverClass:`group-hover/user-message:opacity-100 group-hover/user-message:pointer-events-auto`,isVisible:l,alignClass:`justify-end`,onCopied:()=>i(p)})]})}),(0,P.memo)(function(e){let{assistantMsgs:t,turnKey:n,ToolRendererComponent:r,TextRendererComponent:i,toolRenderers:a,onOpenUIAction:o,onOpenUIArtifactReady:s,onOpenArtifact:c,onCopied:l,stream:u,copy:d,display:f}=e,{isLast:p,isStreaming:m}=u,{enabled:h,isVisible:g}=d,{suppressQuestionTool:_}=f,v=we(t.flatMap(e=>e.parts??[]),`
|
|
3
|
-
|
|
4
|
-
`),y=m&&p,b=h&&!!v.trim()&&!y,x=`assistant-${n}-all`,S=h?v:``;return(0,I.jsxs)(`div`,{className:`group/assistant-turn`,children:[(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:t.map((e,n)=>{let l=p&&n===t.length-1;return(0,I.jsx)(ke,{msg:e,isLast:l,isStreaming:m,suppressQuestionTool:_,ToolRendererComponent:r,TextRendererComponent:i,toolRenderers:a,onOpenUIAction:o,onOpenUIArtifactReady:s,onOpenArtifact:c},e.id)})}),(b||g)&&(0,I.jsx)(xe,{text:S,heightClass:`h-[48px] flex items-start w-full`,hoverClass:`group-hover/assistant-turn:opacity-100 group-hover/assistant-turn:pointer-events-auto`,isVisible:g,alignClass:`justify-start`,onCopied:()=>l(x)})]})});var Te=`tool-call:`,Ee=`unkeyed-tool:`;function De(e,t,n){return t.toolCallId?`${Te}${t.toolCallId}`:`${Ee}${e}:${t.type}:${n}`}function Oe(e,t){let{messageId:n,isLast:r,isStreaming:i,suppressQuestionTool:a,suppressTextWhenPlanWrite:o=!1,ToolRendererComponent:s,TextRendererComponent:c,toolRenderers:l,onOpenUIAction:u,onOpenUIArtifactReady:d,onOpenArtifact:f}=t,p=[],m=[],h=o&&e.some(e=>Z(e)&&e.type===`tool-PlanWrite`),g=new Set(e.filter(e=>Z(e)&&(e.type===`tool-Task`||e.type===`tool-Agent`)&&typeof e.toolCallId==`string`).map(e=>e.toolCallId)),_=new Map,v=new Set,y=new Map;for(let t of e){if(!Z(t)||t.type===`tool-TaskOutput`||!t.toolCallId||!t.toolCallId.includes(`:`))continue;let e=t.toolCallId.split(`:`)[0];g.has(e)&&(_.has(e)||_.set(e,[]),_.get(e).push(t),v.add(t.toolCallId))}let b=0;for(;b<e.length;){let t=e[b];if(Z(t)&&t.type===`tool-TaskOutput`){b++;continue}if(X(t)){let e=t.text;e&&!h&&m.push(e),b++;continue}if(Se(t)){p.push((0,I.jsx)(de,{title:t.title,message:t.message},`${n}-error-${t.title}-${t.message}`)),b++;continue}if(Ce(t)){p.push((0,I.jsx)(pe,{part:t},`${n}-payload-${b}`)),b++;continue}if(Z(t)){if(a&&t.type===`tool-Question`){b++;continue}if(t.toolCallId&&v.has(t.toolCallId)){b++;continue}let e=r&&i?`streaming`:void 0,o=t.toolCallId,c=(t.type===`tool-Task`||t.type===`tool-Agent`)&&o?_.get(o)||[]:void 0,u=t.toolCallId?0:y.get(t.type)??0;t.toolCallId||y.set(t.type,u+1),p.push((0,I.jsx)(s,{part:t,nestedTools:c,chatStatus:e,toolRenderers:l},De(n,t,u))),b++;continue}b++}let x=m.join(`
|
|
5
|
-
|
|
6
|
-
`);return x&&p.push((0,I.jsx)(`div`,{className:`group/assistant-text text-[14px]`,children:(0,I.jsx)(c,{content:x,isStreaming:i,messageId:n,onOpenUIAction:u,onOpenUIArtifactReady:d,onOpenArtifact:f,className:`leading-relaxed [&_p]:leading-relaxed`})},`${n}-text-final`)),p}function ke({msg:e,isLast:t,isStreaming:n,suppressQuestionTool:r,ToolRendererComponent:i,TextRendererComponent:a,toolRenderers:o,onOpenUIAction:s,onOpenUIArtifactReady:c,onOpenArtifact:l}){let u=(0,P.useMemo)(()=>ge(e.parts??[]),[e.parts]),d=(0,P.useMemo)(()=>Oe(u,{messageId:e.id,isLast:t,isStreaming:n,suppressQuestionTool:r,ToolRendererComponent:i,TextRendererComponent:a,toolRenderers:o,onOpenUIAction:s,onOpenUIArtifactReady:c,onOpenArtifact:l}),[u,e.id,t,n,r,i,a,o,s,c,l]);return d.length>1?(0,I.jsx)(`div`,{className:`group/assistant-turn flex flex-col gap-3`,children:d}):(0,I.jsx)(`div`,{className:`group/assistant-turn`,children:d})}var Ae=e(n(),1);function je({open:e,onClose:t,images:n,initialIndex:r=0}){let[i,a]=(0,P.useState)(r),o=n.length>1;(0,P.useEffect)(()=>{e&&a(r)},[e,r]);let s=(0,P.useCallback)(e=>{e?.stopPropagation(),a(e=>e>0?e-1:n.length-1)},[n.length]),c=(0,P.useCallback)(e=>{e?.stopPropagation(),a(e=>e<n.length-1?e+1:0)},[n.length]),d=(0,P.useEffectEvent)(e=>{switch(e.key){case`ArrowLeft`:e.preventDefault(),o&&s();break;case`ArrowRight`:e.preventDefault(),o&&c()}});(0,P.useEffect)(()=>{if(!e)return;let t=e=>d(e);return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[e]),(0,P.useEffect)(()=>{if(!e)return;let t=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=t}},[e]);let f=(0,P.useRef)(null),p=(0,P.useEffectEvent)(e=>{f.current&&e.target===f.current&&t()});if((0,P.useEffect)(()=>{if(!e)return;let t=f.current;if(!t)return;t.open||t.showModal();let n=e=>p(e);return t.addEventListener(`click`,n),()=>{t.removeEventListener(`click`,n),t.open&&t.close()}},[e]),typeof document>`u`||!e)return null;let m=n[i]??n[0];return m?.url?(0,Ae.createPortal)((0,I.jsxs)(`dialog`,{ref:f,"aria-label":`Image viewer`,onClose:()=>t(),className:`fixed inset-0 z-50 m-0 flex h-full max-h-none w-full max-w-none items-center justify-center border-0 bg-black/90 p-0 backdrop:bg-transparent`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close fullscreen (Esc)`,className:`absolute top-4 right-4 z-10 inline-flex size-9 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,I.jsx)(l,{className:`size-5`})}),o&&(0,I.jsx)(`button`,{type:`button`,onClick:s,"aria-label":`Previous image (←)`,className:`absolute top-1/2 left-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,I.jsx)(O,{className:`size-6`})}),(0,I.jsx)(`img`,{src:m.url,alt:m.filename??`Image preview`,className:`max-h-[85vh] max-w-[90vw] object-contain select-none`,onClick:e=>e.stopPropagation(),draggable:!1}),o&&(0,I.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Next image (→)`,className:`absolute top-1/2 right-4 z-10 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-full bg-black/50 text-white transition-colors hover:bg-black/70`,children:(0,I.jsx)(_,{className:`size-6`})}),o&&(0,I.jsxs)(`div`,{className:`absolute bottom-6 left-1/2 flex -translate-x-1/2 flex-col items-center gap-3`,children:[(0,I.jsx)(`div`,{className:`flex gap-2`,children:n.map((e,t)=>(0,I.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),a(t)},"aria-label":`Go to image ${t+1}`,className:u(`size-2 rounded-full transition-all`,t===i?`scale-125 bg-white`:`bg-white/40 hover:bg-white/60`)},e.url))}),(0,I.jsxs)(`span`,{className:`text-sm text-white/70`,children:[i+1,` / `,n.length]})]})]}),document.body):null}function Me(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}function Ne(e,t){if(t)return`image`;let n=e.split(`.`).pop()?.toLowerCase();return[`js`,`ts`,`jsx`,`tsx`,`py`,`rb`,`go`,`rs`,`java`,`kt`,`swift`,`c`,`cpp`,`h`,`hpp`,`cs`,`php`].includes(n||``)?`code`:[`json`,`yaml`,`yml`,`xml`].includes(n||``)?`data`:`text`}function Pe(e){switch(e){case`image`:return(0,I.jsx)(N,{className:`size-4 text-muted-foreground`});case`code`:return(0,I.jsx)(A,{className:`size-4 text-muted-foreground`});case`data`:return(0,I.jsx)(k,{className:`size-4 text-muted-foreground`});default:return(0,I.jsx)(y,{className:`size-4 text-muted-foreground`})}}function Fe({id:e,filename:t,size:n,isImage:r,url:i,onRemove:a,className:o,display:s=`chip`,enableImagePreview:c=!0}){let[d,f]=(0,P.useState)(!1),[p,m]=(0,P.useState)(!1),h=Ne(t,r),g=s===`image-only`&&r&&!!i,_=!!(c&&r&&i),v=e=>{e?.stopPropagation(),m(!0)};return(0,I.jsxs)(`div`,{className:u(`relative rounded-[calc(var(--an-input-border-radius)-var(--an-context-padding))] bg-muted/50`,g?`flex size-10 items-center justify-center`:`flex max-w-[200px] min-w-[120px] items-center gap-2 py-1 pr-2 pl-1`,o),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),children:[g?(0,I.jsx)(`div`,{className:u(`size-8 shrink-0 overflow-hidden rounded-[calc(var(--an-input-border-radius)-var(--an-context-padding)-2px)]`,_&&`cursor-pointer`),onClick:_?v:void 0,role:_?`button`:void 0,tabIndex:_?0:void 0,"aria-label":_?`Preview ${t}`:void 0,onKeyDown:_?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v())}:void 0,children:(0,I.jsx)(`img`,{src:i,alt:t,className:`h-full w-full object-cover`})}):(0,I.jsxs)(I.Fragment,{children:[r&&i?(0,I.jsx)(`div`,{className:u(`w-8 shrink-0 self-stretch overflow-hidden rounded-[calc(var(--an-input-border-radius)-var(--an-context-padding)-2px)]`,_&&`cursor-pointer`),onClick:_?v:void 0,role:_?`button`:void 0,tabIndex:_?0:void 0,"aria-label":_?`Preview ${t}`:void 0,onKeyDown:_?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v())}:void 0,children:(0,I.jsx)(`img`,{src:i,alt:t,className:`aspect-square h-full w-full object-cover`})}):(0,I.jsx)(`div`,{className:`flex w-8 shrink-0 items-center justify-center self-stretch rounded-[calc(var(--an-input-border-radius)-var(--an-context-padding)-2px)] bg-muted`,children:Pe(h)}),(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,I.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,title:t,children:t}),n!==void 0&&(0,I.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:Me(n)})]})]}),a&&(0,I.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},"aria-label":`Remove ${t}`,className:`absolute -top-1.5 -right-1.5 z-10 flex size-4 items-center justify-center rounded-full border border-border bg-background text-muted-foreground transition-[opacity,transform] duration-150 ease-out hover:text-foreground active:scale-[0.97] ${d?`opacity-100`:`opacity-0`}`,type:`button`,children:(0,I.jsx)(l,{className:`size-3`})}),_&&i&&(0,I.jsx)(je,{open:p,onClose:()=>m(!1),images:[{id:e,url:i,filename:t}]})]})}function Q(e){return typeof e==`object`&&!!e}function Ie(e){if(!Q(e))return null;let t=e.type;if(typeof t!=`string`)return null;if(t===`image`){let t=e;return t.url??t.image??null}if(t===`data-image`)return e.data?.url??null;if(t===`file`){let t=e;if(t.mimeType?.startsWith(`image/`)){if(t.url)return t.url;if(t.data)return`data:${t.mimeType};base64,${t.data}`}}return null}function Le(e){if(!Q(e)||e.type!==`file`)return null;let t=e,n=t.filename||t.name||t.fileName||`Attachment`;return t.mimeType?.startsWith(`image/`)??!1?null:{filename:n,size:t.size}}var Re=(0,P.memo)(function({message:e,className:t,enableImagePreview:n=!0}){let[r,i]=(0,P.useState)(null),a=(e.parts?.filter(X)??[]).map(e=>e.text).join(``),o=[],s=[];for(let t of e.parts??[]){let e=Ie(t);e&&o.push(e);let n=Le(t);n&&s.push(n)}if(Q(e)&&Array.isArray(e.experimental_attachments))for(let t of e.experimental_attachments)t.contentType?.startsWith(`image/`)&&t.url&&o.push(t.url);if(!a&&o.length===0&&s.length===0)return null;let c=o.map((t,n)=>({id:`${e.id}-img-${n}`,url:t,filename:`image-${n+1}`}));return(0,I.jsxs)(`div`,{className:u(`flex flex-col items-end gap-1`,t),children:[o.length>0&&o.map((e,t)=>(0,I.jsx)(`div`,{className:u(`max-w-[200px] rounded-an-message bg-an-foreground/4 p-1.5`,n&&`cursor-pointer`),onClick:n?()=>i(t):void 0,role:n?`button`:void 0,tabIndex:n?0:void 0,onKeyDown:n?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i(t))}:void 0,children:(0,I.jsx)(`img`,{src:e,alt:`attachment`,className:`block max-h-[120px] max-w-[184px] rounded-an-message-inner object-cover`})},e)),n&&c.length>0&&(0,I.jsx)(je,{open:r!==null,onClose:()=>i(null),images:c,initialIndex:r??0}),s.length>0&&(0,I.jsx)(`div`,{className:`flex flex-col items-end gap-2`,children:s.map((e,t)=>(0,I.jsx)(Fe,{id:`${e.filename}-${t}`,filename:e.filename,size:e.size},`${e.filename}-${e.size}`))}),a&&(0,I.jsx)(`div`,{className:`ms-[70px] max-w-[calc(95%-40px)]`,children:(0,I.jsx)(`div`,{className:`rounded-an-message bg-an-user-message-bg px-3.5 py-1.5 text-sm text-an-user-message-text transition-colors`,children:(0,I.jsx)(`p`,{className:`leading-5 wrap-break-word whitespace-pre-wrap`,children:a})})})]})}),ze=(0,P.lazy)(()=>E(async()=>{let{GenerativeTextRenderer:e}=await import(`./openui-renderer-DlUo6ehT.js`).then(e=>e.n);return{GenerativeTextRenderer:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])).then(({GenerativeTextRenderer:e})=>({default:e})));function Be({className:e,content:t}){return(0,I.jsx)(`div`,{className:e?`${e} whitespace-pre-wrap`:`whitespace-pre-wrap`,children:t})}function Ve(e){return(0,P.useMemo)(()=>D(e.content).some(e=>e.type===`openui`),[e.content])?(0,I.jsx)(P.Suspense,{fallback:(0,I.jsx)(Be,{className:e.className,content:e.content}),children:(0,I.jsx)(ze,{...e})}):(0,I.jsx)(p,{className:e.className,content:e.content})}function $(e,t){let n=new Map(e.map(e=>[e.id,e])),r=new Set,i=[],a=e=>{if(r.has(e))return;r.add(e);let o=n.get(e);o&&i.push(o);for(let n of t?.nodes[e]?.childrenIds??[])a(n)};for(let e of t?.rootChildrenIds??[])a(e);for(let t of e)a(t.id);return i}function He(e){return e===`done`?(0,I.jsx)(b,{className:`size-3.5 text-emerald-600 dark:text-emerald-400`}):e===`error`?(0,I.jsx)(v,{className:`size-3.5 text-destructive`}):e===`cancelled`?(0,I.jsx)(C,{className:`size-3.5 text-muted-foreground`}):(0,I.jsx)(x,{className:`size-3.5 animate-spin text-blue-600 dark:text-blue-400`})}function Ue({children:e,tree:t,className:n}){let r=(0,P.useMemo)(()=>$(e,t),[e,t]),i=r.some(e=>e.status===`queued`||e.status===`running`),[a,o]=(0,P.useState)(i);return r.length===0?null:(0,I.jsxs)(`section`,{className:u(`mt-2 rounded-xl border border-border/60 bg-muted/20`,n),children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":a||i,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[i?(0,I.jsx)(x,{className:`size-3.5 animate-spin text-blue-600 dark:text-blue-400`}):(0,I.jsx)(b,{className:`size-3.5 text-emerald-600 dark:text-emerald-400`}),(0,I.jsx)(`span`,{className:`flex-1 font-medium`,children:i?`Subagents working`:`Subagents completed`}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r.length}),(0,I.jsx)(g,{className:u(`size-3.5 text-muted-foreground transition-transform`,(a||i)&&`rotate-180`)})]}),a||i?(0,I.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-3 py-2`,children:r.map(e=>(0,I.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,style:{paddingLeft:`${Math.max(0,e.depth??0)*12}px`},children:[(0,I.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:He(e.status)}),(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate text-sm text-foreground/85`,children:e.label}),e.model?(0,I.jsx)(`span`,{className:`truncate font-mono text-[10px] text-muted-foreground`,children:e.model}):null]}),e.answerPreview||e.activity?.toolName||e.error?(0,I.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,children:e.error??e.answerPreview??e.activity?.toolName}):null]}),(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] capitalize text-muted-foreground`,children:e.status})]},e.id))}):null]})}function We(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Ge(e,t){let n=We(e);for(let e of[`path`,`filePath`,`command`,`cmd`,`query`,`pattern`,`code`])if(typeof n?.[e]==`string`&&n[e])return n[e];return t}function Ke(e,t){let n=e.state;return n===`output-error`||n===`error`?`error`:n===`cancelled`||n===`canceled`||n===`aborted`?`cancelled`:n===`input-streaming`||n===`streaming`?t?`running`:`cancelled`:t&&e.output===void 0&&e.result===void 0?`running`:`complete`}function qe(e,t,n){let r=e.type;if(typeof r!=`string`||!r.startsWith(`tool-`)||r===`tool-FleetReasoning`||r===`tool-Thinking`)return;let i=r.slice(5),a=i.toLowerCase(),o=a.includes(`edit`)||a.includes(`write`)||a.includes(`patch`)?j:a.includes(`read`)||a.includes(`search`)||a.includes(`grep`)||a.includes(`glob`)?M:a.includes(`bash`)||a.includes(`shell`)||a.includes(`python`)||a.includes(`ipython`)?f:w,s=a.includes(`edit`)||a.includes(`write`)||a.includes(`patch`)?`Edited`:a.includes(`read`)?`Read`:a.includes(`search`)||a.includes(`grep`)||a.includes(`glob`)?`Searched`:a.includes(`bash`)||a.includes(`shell`)||a.includes(`python`)||a.includes(`ipython`)?`Ran`:i;return{id:typeof e.toolCallId==`string`?e.toolCallId:t,icon:o,verb:s,target:Ge(e.input??e.args,i),status:Ke(e,n)}}function Je(e){let t=e.kind===`diff`?j:e.kind===`bash`||e.kind===`ipython`?f:w;return{id:`artifact:${e.id}`,icon:t,verb:e.kind===`compaction`?`Compacted`:e.kind===`refinement`?`Refined`:e.kind===`recap`?`Recapped`:e.kind===`rlm`?`Delegated`:e.kind===`diff`?`Edited`:`Completed`,target:e.title,status:e.status===`success`?`complete`:e.status}}function Ye(e){return e===`running`?`text-blue-600 dark:text-blue-400`:e===`error`?`text-destructive`:e===`cancelled`?`text-muted-foreground`:`text-emerald-600 dark:text-emerald-400`}function Xe({messages:e,artifacts:t=[],streaming:n,className:r}){let i=(0,P.useMemo)(()=>{let r=new Set,i=e.flatMap(e=>e.parts.flatMap((t,i)=>{let a=qe(We(t)??{},`${e.id}:${i}`,n);return!a||r.has(a.id)?[]:(r.add(a.id),[a])})),a=t.flatMap(e=>{if(e.sourceToolCallId&&r.has(e.sourceToolCallId))return[];let t=Je(e);return r.has(t.id)?[]:(r.add(t.id),[t])});return[...i,...a]},[t,e,n]),[a,o]=(0,P.useState)(!0);if(i.length===0)return null;let s=i.at(-1),c=s?.icon;return(0,I.jsxs)(`section`,{className:u(`mb-2 rounded-xl border border-border/60 bg-muted/20`,r),children:[(0,I.jsxs)(`button`,{type:`button`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[s&&c?(0,I.jsx)(c,{className:u(`size-3.5 shrink-0`,Ye(s.status),s.status===`running`&&`animate-pulse`)}):null,(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:n&&s?`${s.verb} ${s.target}`:`${i.length} tool ${i.length===1?`action`:`actions`}`}),(0,I.jsx)(g,{className:u(`size-3.5 text-muted-foreground transition-transform`,a&&`rotate-180`)})]}),a?(0,I.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-3 py-2`,children:i.map(e=>{let t=e.icon;return(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs`,children:[(0,I.jsx)(t,{className:u(`size-3.5 shrink-0`,Ye(e.status))}),(0,I.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e.verb}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-foreground/75`,children:e.target})]},e.id)})}):null]})}function Ze(e){let t=[],n;for(let r of e){if(r.role===`user`){n&&t.push(n),n={user:r,assistants:[]};continue}if(r.role===`assistant`){if(!n||r.source===`local`){n&&t.push(n),n={assistants:[r]};continue}n.assistants.push(r)}}return n&&t.push(n),t}export{O as _,He as a,Fe as c,le as d,ue as f,N as g,W as h,$ as i,Oe as l,H as m,Xe as n,Ve as o,oe as p,Ue as r,Re as s,Ze as t,ge as u};
|