pisper 0.6.9 → 0.6.10
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/lib/npm-platform.mjs +0 -1
- package/lib/platform.mjs +2 -1
- package/package.json +6 -7
- package/web/.vite/manifest.json +943 -844
- package/web/assets/{AppDialog-DJZWnxzH.js → AppDialog-1E6olv_T.js} +1 -1
- package/web/assets/{AppOverlays-DICzFYsW.js → AppOverlays-BV_gIt77.js} +1 -1
- package/web/assets/AppSelect-BGVBQRP1.js +1 -0
- package/web/assets/AssetsPage-6HTR2IpQ.js +1 -0
- package/web/assets/{BoardPage-DKjz8Sj_.js → BoardPage-CL2e-8j4.js} +3 -3
- package/web/assets/BrandLogo-k3CvJjd4.js +1 -0
- package/web/assets/ChannelsPage-CmczBcSA.js +1 -0
- package/web/assets/{ChatAppearancePage-6Mq1uFuU.js → ChatAppearancePage-DMAnYGNb.js} +1 -1
- package/web/assets/{ChatHistoryPage-j-_vMM-M.js → ChatHistoryPage-DedOh6aO.js} +1 -1
- package/web/assets/ChatPage-b16p3qWl.js +553 -0
- package/web/assets/ConfigPage-BYB0rL_V.js +5 -0
- package/web/assets/{DesktopWindowControls-BOrn8KGA.js → DesktopWindowControls-DAuHMZFO.js} +1 -1
- package/web/assets/DispatchOverlay-CEbzXIct.js +1 -0
- package/web/assets/{FeaturePage-1MUXz3Y-.js → FeaturePage-BJGDVZ_u.js} +1 -1
- package/web/assets/{FileAttachmentPreview-B17OgdVi.js → FileAttachmentPreview-Cw5-ApIr.js} +1 -1
- package/web/assets/{FloatingWidgets-CcPNUEFB.js → FloatingWidgets-BQXBxVDd.js} +1 -1
- package/web/assets/FocusRuntimeControls-C7b1I2L5.js +1 -0
- package/web/assets/{GitDiffViewer-CSl-SGa1.js → GitDiffViewer-BAZTiiDo.js} +1 -1
- package/web/assets/{HoldToConfirmButton-CVyju89W.js → HoldToConfirmButton-BxdJ7icc.js} +1 -1
- package/web/assets/LaunchConsole-uKHKx4h0.js +2 -0
- package/web/assets/{ManageProjectsDialog-DSN8QUPg.js → ManageProjectsDialog-03d7p6Td.js} +1 -1
- package/web/assets/{MarkdownMessage-BPZcFjyR.js → MarkdownMessage-B_9d8KI-.js} +1 -1
- package/web/assets/McpPage-7NEAc3Rv.js +1 -0
- package/web/assets/MemoryPage-_mnn45jY.js +1 -0
- package/web/assets/{MobileNavigation-Cc4zcU3a.js → MobileNavigation-IXJN0OuM.js} +1 -1
- package/web/assets/{MorePage-B-qsYMAv.js → MorePage-DtqJlHAA.js} +1 -1
- package/web/assets/{PageHeader-mUKoAR30.js → PageHeader-6KRCT1j1.js} +1 -1
- package/web/assets/{PageState-aWHrkE1D.js → PageState-Cz6vFMXv.js} +1 -1
- package/web/assets/{PhoneDrawer-qES4OwMx.js → PhoneDrawer-Cp6X4_ei.js} +1 -1
- package/web/assets/{PhoneMenuButton-DEbqHUUP.js → PhoneMenuButton-Cl7FEYYw.js} +1 -1
- package/web/assets/{PhoneTopBar-CLPmKZ4Q.js → PhoneTopBar-CR1m9vf3.js} +1 -1
- package/web/assets/{PluginsPage-B53DParo.js → PluginsPage-CNddCaYt.js} +1 -1
- package/web/assets/{QuickPromptIdeas-gKobqAO3.js → QuickPromptIdeas-C7X4T7kx.js} +1 -1
- package/web/assets/{SafeModePrompt-Dlq8rlix.js → SafeModePrompt-jSCZVMGa.js} +1 -1
- package/web/assets/SchedulesPage-BRqBCtCf.js +1 -0
- package/web/assets/SessionBrowserPane-maCbfzXl.js +2 -0
- package/web/assets/SessionContextPanel-BSY6NaRx.js +2 -0
- package/web/assets/{SessionHome-CVdMY-bT.js → SessionHome-Wu8JWsto.js} +1 -1
- package/web/assets/SessionInspector-BRIFfuiZ.js +1 -0
- package/web/assets/{SessionShell-Vv2oGR0M.js → SessionShell-Dp94FUuk.js} +1 -1
- package/web/assets/{SettingsSidebar-cG_oKSWN.js → SettingsSidebar-CP1qDAcx.js} +1 -1
- package/web/assets/{ShortcutHelpDialog-C5KKKBZd.js → ShortcutHelpDialog-C5f_x4XG.js} +1 -1
- package/web/assets/{ShortcutKeys-zuzmq8eW.js → ShortcutKeys-Cx8hNJ62.js} +1 -1
- package/web/assets/{SidebarUpdateStatus-BXimwZ77.js → SidebarUpdateStatus-YxE_hT2l.js} +1 -1
- package/web/assets/{SkillsPage-AhmayxVl.js → SkillsPage-z6rTYJ8Z.js} +1 -1
- package/web/assets/TaskProcessesPane-yhEsHe1N.js +1 -0
- package/web/assets/TaskTerminalView-CT6V8AGR.js +18 -0
- package/web/assets/{TerminalPanel-wvzi7jBd.js → TerminalPanel-598uzwoB.js} +1 -1
- package/web/assets/{WebDesktopPet-qREBG08n.js → WebDesktopPet-D6bkGOwL.js} +1 -1
- package/web/assets/WorkflowsPage-DrltlXh1.js +1 -0
- package/web/assets/{WorkspacePicker-B68VTV5x.js → WorkspacePicker-DPwlN6KA.js} +1 -1
- package/web/assets/{api-DVgYxLec.js → api-45iTnFjN.js} +1 -1
- package/web/assets/{app-primitives-Cmdj4cIW.js → app-primitives-Drz_SjnR.js} +1 -1
- package/web/assets/{app-update-BEymQxyl.js → app-update-kStNhVOh.js} +1 -1
- package/web/assets/{approval-confirm-JevCpyyv.js → approval-confirm-CCo7v8Ln.js} +1 -1
- package/web/assets/{badge-Dk1N1mVf.js → badge-CWB3lj2H.js} +1 -1
- package/web/assets/{board-launch-CUV0KEKT.js → board-launch-YigjCnZf.js} +1 -1
- package/web/assets/board-messages-xFeTO3o6.js +1 -0
- package/web/assets/{board-projects-VBEGB9VD.js → board-projects-LnEYyP4h.js} +1 -1
- package/web/assets/{button-Bu_vuij9.js → button-CCcCN8tE.js} +1 -1
- package/web/assets/{chat-api-CQ9MShHZ.js → chat-api-BBuYjxwz.js} +1 -1
- package/web/assets/checkbox-BrEHgFV0.js +1 -0
- package/web/assets/client-store-CAhvptv1.js +1 -0
- package/web/assets/{collapsible-C__hRcbA.js → collapsible-DMaUQRX4.js} +1 -1
- package/web/assets/{config-search-ClE5BFDz.js → config-search-C1YtwJAQ.js} +1 -1
- package/web/assets/{dialog-Kx6RCn3A.js → dialog-2cmY5V75.js} +1 -1
- package/web/assets/{dist-Cfh4kzCK.js → dist-41X0pdUs.js} +1 -1
- package/web/assets/{dist-BdkTa5R3.js → dist-BHkR6BLP.js} +1 -1
- package/web/assets/dist-BRjj4UeB.js +1 -0
- package/web/assets/dist-BaBySQmo.js +1 -0
- package/web/assets/{dist-BlIIpW6W.js → dist-BiRPwy4W.js} +1 -1
- package/web/assets/{dist-B_a0oV4U.js → dist-BsRXXcSL.js} +1 -1
- package/web/assets/dist-DzGQ7sLi.js +1 -0
- package/web/assets/{dist-TksYpDID.js → dist-OB2r6Xsr.js} +1 -1
- package/web/assets/dist-V8chnW6-.js +1 -0
- package/web/assets/dropdown-menu-CFIFNaKO.js +1 -0
- package/web/assets/es2015-DTZdOI9P.js +41 -0
- package/web/assets/{events-ulSEiNKt.js → events-n27XPFgs.js} +1 -1
- package/web/assets/{field-Bnm9KAi2.js → field-DaxtcBBA.js} +1 -1
- package/web/assets/{hosts-B-POTAmu.js → hosts-CmK7Yt82.js} +1 -1
- package/web/assets/i18n-DfsxGeh5.js +1 -0
- package/web/assets/{index-C4CqzQNY.js → index-BDgCJ4Fs.js} +2 -2
- package/web/assets/index-CfTBR7Rs.css +2 -0
- package/web/assets/input-CPw-zkYh.js +1 -0
- package/web/assets/input-group-CDEyjyK4.js +1 -0
- package/web/assets/{label-BzlNatZM.js → label-CVWjEcfV.js} +1 -1
- package/web/assets/{launch-defaults-store-7CojCPDE.js → launch-defaults-store-CGeglXDI.js} +1 -1
- package/web/assets/model-display-kDwvtxrW.js +1 -0
- package/web/assets/mount-app-Bxa7xF8d.js +9 -0
- package/web/assets/{permission-rules-api-BQlSNrYK.js → permission-rules-api-BvKOF7rS.js} +1 -1
- package/web/assets/{pick-system-directory-BgN7vwKS.js → pick-system-directory-DSupTk88.js} +1 -1
- package/web/assets/placements--Zk5njsN.js +2 -0
- package/web/assets/{popover-DT3PkPcL.js → popover-BtcdIPRz.js} +1 -1
- package/web/assets/{progress-YhljaYNy.js → progress-5odAz3B9.js} +1 -1
- package/web/assets/public--8F2_oqP.js +1 -0
- package/web/assets/public-CgydVZuV.js +2 -0
- package/web/assets/public-components-CeIuV0FY.js +1 -0
- package/web/assets/public-diff-DWbitsnS.js +1 -0
- package/web/assets/public-launch-DtVwSANs.js +1 -0
- package/web/assets/run-activity-CwfO0cui.js +1 -0
- package/web/assets/{runtime-capabilities-store--7mKyYAM.js → runtime-capabilities-store-D1FwQXKw.js} +1 -1
- package/web/assets/{safe-mode-instance-fnZLVjjd.js → safe-mode-instance-TonxlRrq.js} +1 -1
- package/web/assets/safe-mode-sentinel-BG78O0yJ.js +1 -0
- package/web/assets/segmented-control-BlM_GKV6.js +1 -0
- package/web/assets/select-DD_WO-gs.js +1 -0
- package/web/assets/{separator-cVAjxx3U.js → separator-BPh_qxvc.js} +1 -1
- package/web/assets/{session-change-summary-api-3216hpjE.js → session-change-summary-api-B9M9m1C0.js} +1 -1
- package/web/assets/{session-home-CM2_V5SZ.js → session-home-BDT4lMMJ.js} +1 -1
- package/web/assets/{session-organization-api-KZqrJZdA.js → session-organization-api-BgCoIi2X.js} +1 -1
- package/web/assets/{session-scope-Bw40iOXx.js → session-scope-t_l7TRH5.js} +1 -1
- package/web/assets/{session-tree-actions-oMnZOFG4.js → session-tree-actions-7q68B3e-.js} +1 -1
- package/web/assets/{session-tree-summary-PpU7AyqE.js → session-tree-summary-CMgz9Uf-.js} +1 -1
- package/web/assets/{sheet-CASx5kBt.js → sheet-BTaIEX4w.js} +1 -1
- package/web/assets/{shortcuts-BOeaPAvF.js → shortcuts-BGzXmClx.js} +1 -1
- package/web/assets/{side-chat-context-BcCF9VZz.js → side-chat-context-D36twdWd.js} +7 -7
- package/web/assets/{sidebar-4xAUV3YP.js → sidebar-BIagLnrN.js} +2 -2
- package/web/assets/{sidebar-store-we4gMwQq.js → sidebar-store-DztdHlUn.js} +1 -1
- package/web/assets/slider-DTmAZl-R.js +1 -0
- package/web/assets/{speech-session-ClA_5hmd.js → speech-session-D0GE-Pym.js} +1 -1
- package/web/assets/{startup-queries--JqGB_Cp.js → startup-queries-BAWDaQY5.js} +1 -1
- package/web/assets/{switch-DRkmP9uM.js → switch-D_G8wFhs.js} +1 -1
- package/web/assets/tabs-DsgBuvJv.js +1 -0
- package/web/assets/{tooltip-EomUbN9-.js → tooltip-D4MFbqcG.js} +1 -1
- package/web/assets/{use-i18n-D2P6OO3w.js → use-i18n-CVZdp2ZN.js} +1 -1
- package/web/assets/use-mobile-DauOEda6.js +1 -0
- package/web/assets/{use-studio-actions-CIA2TwfZ.js → use-studio-actions-C4Zh15Vx.js} +2 -2
- package/web/assets/{useBoardItems-BU9aonpg.js → useBoardItems-DCo-4he0.js} +1 -1
- package/web/assets/{useFleetSystemInfo-BMpdQSqr.js → useFleetSystemInfo-BbQQId7X.js} +1 -1
- package/web/assets/{useNow-DAVNVxdo.js → useNow-CxO2FUQY.js} +1 -1
- package/web/assets/usePhoneShell-m3H_98m_.js +1 -0
- package/web/assets/{useSessionListQuery-DqZ3m8O9.js → useSessionListQuery-CJ-BYuqu.js} +1 -1
- package/web/assets/{useSessionRowActions-DTxXBruc.js → useSessionRowActions-D0GKtBhg.js} +1 -1
- package/web/assets/{useSidebarModel-DtY4PopW.js → useSidebarModel-b5cdTj9-.js} +1 -1
- package/web/assets/{web-preview-tGGVFpDI.js → web-preview-Bdrxyj-l.js} +1 -1
- package/web/assets/{web-preview-events-Bl80SpFF.js → web-preview-events-BBbAgfr4.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/AppSelect-fH3gqflO.js +0 -1
- package/web/assets/AssetsPage-BhrkErwt.js +0 -1
- package/web/assets/BrandLogo-C6O8cv-b.js +0 -1
- package/web/assets/ChannelsPage-C6A-ClM6.js +0 -1
- package/web/assets/ChatPage-B1V00hUs.js +0 -553
- package/web/assets/ComposerCommandMenu-BnwvT15Y.js +0 -1
- package/web/assets/ConfigPage-DwVhvmWL.js +0 -3
- package/web/assets/DispatchOverlay-ByJYJO36.js +0 -1
- package/web/assets/LaunchConsole-DRnR4Irg.js +0 -2
- package/web/assets/McpPage-DeuJ0HzI.js +0 -1
- package/web/assets/MemoryPage-CxFJYVZs.js +0 -1
- package/web/assets/SchedulesPage-BUDQGrHe.js +0 -1
- package/web/assets/SessionBrowserPane-Bq_U_5i9.js +0 -2
- package/web/assets/SessionContextPanel-V4QZj7xu.js +0 -2
- package/web/assets/SessionInspector-C14ilfNC.js +0 -1
- package/web/assets/TaskProcessesPane-hcChPVpA.js +0 -1
- package/web/assets/TaskTerminalView-DcFp0oHH.js +0 -18
- package/web/assets/WorkflowsPage-Dg9Mh9ND.js +0 -1
- package/web/assets/board-messages-CcVs4aSw.js +0 -1
- package/web/assets/checkbox-CG2AnYPm.js +0 -1
- package/web/assets/client-store-B-3_7075.js +0 -1
- package/web/assets/dist-DAs5KRGl.js +0 -1
- package/web/assets/dist-alOyD2Bh.js +0 -1
- package/web/assets/dropdown-menu-gZkWDhaR.js +0 -1
- package/web/assets/es2015-0QT3KgdC.js +0 -41
- package/web/assets/i18n-DPvJ0T4T.js +0 -1
- package/web/assets/index-DbL8igcD.css +0 -2
- package/web/assets/input-DIwJDpj9.js +0 -1
- package/web/assets/mount-app-CxpqEKPV.js +0 -9
- package/web/assets/placements-5xDVBdPk.js +0 -2
- package/web/assets/public-CyIfRdzo.js +0 -1
- package/web/assets/public-DwUlE0fE.js +0 -2
- package/web/assets/public-components-Cv7X4fW8.js +0 -1
- package/web/assets/public-diff-1bDiNGBB.js +0 -1
- package/web/assets/public-launch-D8n5o2kS.js +0 -1
- package/web/assets/safe-mode-sentinel-DEJ0ZBB_.js +0 -1
- package/web/assets/segmented-control-BOJt5SLj.js +0 -1
- package/web/assets/select-JC5m2BRQ.js +0 -1
- package/web/assets/tabs-C4VeYYS2.js +0 -1
- package/web/assets/usePhoneShell-w7JLYU3H.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{f as t,m as n,u as r}from"./vendor-router-CSN_DGvx.js";import{i,r as a}from"./vendor-react-DwNgTV1j.js";import{p as o,r as s}from"./routes-Da0OHSy6.js";import{d as c}from"./i18n-DPvJ0T4T.js";import{t as l}from"./use-i18n-D2P6OO3w.js";import{r as u,t as d}from"./useQuery-Bg3cTjsY.js";import{a as f,i as p,l as m,t as h,u as g}from"./api-DVgYxLec.js";import{t as _}from"./usePhoneShell-w7JLYU3H.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./arrow-down-CDGua-ue.js";import{t as b}from"./arrow-up-DST6-qVQ.js";import{t as x}from"./bell-BjONAtgH.js";import{t as S}from"./bot-B3TaBp_T.js";import{t as C}from"./braces-DQcXLGFF.js";import{t as w}from"./check-2vYc6QaP.js";import{t as T}from"./chevron-down-CxtxIjiP.js";import{t as E}from"./chevron-left-BAtyp3_6.js";import{t as ee}from"./chevron-right-C3t2Rckj.js";import{t as D}from"./circle-check-iEdCm3Pw.js";import{n as O,t as k}from"./image-plus-D7bzZog0.js";import{t as A}from"./code-xml-BrUXrBax.js";import{t as j}from"./copy-DHmIFc52.js";import{t as M}from"./download-BCfIiuaL.js";import{t as N}from"./ellipsis-CfGKfbq6.js";import{t as P}from"./file-code-corner-BnE1ljT0.js";import{t as F}from"./file-Bllajneu.js";import{t as te}from"./git-branch-N7LGjtzt.js";import{t as ne}from"./grip-vertical-B__LYT0s.js";import{t as I}from"./image-BY_c3FYU.js";import{t as re}from"./loader-circle-BOwQzHB-.js";import{n as ie,t as ae}from"./send-QxBfLFo-.js";import{n as oe,r as se,t as ce}from"./zap-DZHw5afO.js";import{t as le}from"./panel-right-BSUtqUd8.js";import{t as ue}from"./paperclip-BCXrwYpb.js";import{t as de}from"./pencil-U08v_vV9.js";import{t as fe}from"./play-DNDjDNGn.js";import{t as pe}from"./plus-fQbSqB1n.js";import{t as me}from"./refresh-cw-TbWxTY4K.js";import{t as he}from"./rocket-BgLSjoHY.js";import{t as ge}from"./save-CHBB52P8.js";import{t as _e}from"./search-D0mqDaf_.js";import{t as ve}from"./server-BgNvmqwJ.js";import{t as ye}from"./settings-2-CXJjXJS9.js";import{t as be}from"./square-bHHVTT3G.js";import{t as xe}from"./trash-2-CNrPOoPR.js";import{t as Se}from"./triangle-alert-CE1q54ci.js";import{t as Ce}from"./workflow-Bg94dy8I.js";import{t as we}from"./x-07u4-129.js";import{t as Te}from"./more-pages-D_PnxLN0.js";import{n as Ee,r as De,t as Oe}from"./collapsible-C__hRcbA.js";import{c as ke,i as Ae,p as je,r as Me,t as Ne}from"./dropdown-menu-gZkWDhaR.js";import{t as L}from"./label-BzlNatZM.js";import{i as Pe,n as Fe,t as Ie}from"./popover-DT3PkPcL.js";import{t as Le}from"./progress-YhljaYNy.js";import{t as R}from"./switch-DRkmP9uM.js";import{i as Re,r as ze,t as Be}from"./tabs-C4VeYYS2.js";import{t as z}from"./utils-C8uzG5AZ.js";import{n as Ve,t as B}from"./button-Bu_vuij9.js";import{s as He}from"./shortcuts-BOeaPAvF.js";import{a as Ue,n as We,o as Ge,r as Ke,t as qe}from"./sheet-CASx5kBt.js";import{a as Je}from"./format-DMJQzoZ7.js";import{n as Ye,t as Xe}from"./PageState-aWHrkE1D.js";import{n as Ze,t as Qe}from"./alert-firawb0H.js";import{a as $e,i as et,l as tt,o as nt,s as rt,t as it,u as at}from"./dialog-Kx6RCn3A.js";import{t as V}from"./input-DIwJDpj9.js";import{a as ot,i as st,n as ct,o as lt,r as ut,s as dt}from"./FeaturePage-1MUXz3Y-.js";import{t as H}from"./field-Bnm9KAi2.js";import{t as ft}from"./StatusGlyph-1KgitlUg.js";import{t as U}from"./AppSelect-fH3gqflO.js";import{n as pt,r as mt,t as ht}from"./browser-notifications-DBS0oXqN.js";import{t as gt}from"./textarea-DmATpOqT.js";import{t as _t}from"./PageFrame-DNwGZ-Dz.js";import{a as vt,c as yt,d as bt,f as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as kt}from"./vendor-xyflow-hxQFvEHK.js";import{n as At}from"./navigation-EoDz3gT8.js";var jt=v(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),Mt=v(`file-up`,[[`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:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]),Nt=v(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),W=e(i(),1),Pt=new Set([`__proto__`,`constructor`,`prototype`]),Ft=/^[A-Za-z_][A-Za-z0-9_]{0,79}$/,G=class extends Error{constructor(e,t=``,n=``){super(e===`workflow_template_unknown`?`工作流模板引用了未知或不可用的变量。`:`工作流输入无效,请检查字段名称、类型和必填值。`),this.code=e,this.inputName=t,this.label=n,this.statusCode=400}};function It(e){if(!e||typeof e!=`object`||Array.isArray(e))throw new G(`workflow_input_type`);return e}function Lt(e){let t=It(e);if(Object.keys(t).some(e=>![`id`,`name`,`mimeType`,`size`].includes(e))||typeof t.id!=`string`||!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,79}$/.test(t.id)||typeof t.name!=`string`||!t.name.trim()||t.name.length>160||/[\\/]/.test(t.name)||typeof t.mimeType!=`string`||![`image/png`,`image/jpeg`,`image/webp`,`video/mp4`,`video/webm`].includes(t.mimeType)||typeof t.size!=`number`||!Number.isSafeInteger(t.size)||t.size<=0||t.size>(t.mimeType.startsWith(`image/`)?8:64)*1024*1024)throw new G(`workflow_input_type`);return{id:t.id,name:t.name,mimeType:t.mimeType,size:t.size}}function Rt(e,t,n){let r=t==null||typeof t==`string`&&!t.trim();if(n&&r)throw new G(`workflow_input_required`,e.name,e.label);if(r)return e.type===`boolean`?!1:e.type===`image`||e.type===`video`?null:``;if(typeof t==`string`&&t.length>16e3)throw new G(`workflow_input_too_long`,e.name,e.label);if(e.type===`number`){if(typeof t!=`number`&&typeof t!=`string`||typeof t==`string`&&!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(t.trim())||!Number.isFinite(Number(t)))throw new G(`workflow_input_type`,e.name,e.label);return Number(t)}if(e.type===`boolean`){if(t!==!0&&t!==!1&&t!==`true`&&t!==`false`)throw new G(`workflow_input_type`,e.name,e.label);return t===!0||t===`true`}if(e.type===`image`||e.type===`video`){let n=Lt(t);if(!n.mimeType.startsWith(`${e.type}/`))throw new G(`workflow_input_type`,e.name,e.label);return n}if(typeof t!=`string`)throw new G(`workflow_input_type`,e.name,e.label);return t}function zt(e){if(e===void 0)return[];if(!Array.isArray(e)||e.length>30)throw new G(`workflow_input_invalid_definition`);let t=new Set,n=new Set;return e.map((e,r)=>{let i=It(e),a=i.name;if(typeof a!=`string`||!Ft.test(a)||Pt.has(a))throw new G(`workflow_input_unsafe_name`);let o=i.id===void 0?`input-${r+1}`:i.id,s=i.label===void 0?a:i.label;if(typeof o!=`string`||!o||o.length>80||typeof s!=`string`||!s.trim()||s.length>120||i.description!==void 0&&(typeof i.description!=`string`||i.description.length>300)||i.required!==void 0&&typeof i.required!=`boolean`)throw new G(`workflow_input_invalid_definition`,a);if(t.has(a)||n.has(o))throw new G(`workflow_input_duplicate_name`,a,s);t.add(a),n.add(o);let c=i.type===void 0?`string`:i.type;if(c!==`string`&&c!==`text`&&c!==`number`&&c!==`boolean`&&c!==`image`&&c!==`video`)throw new G(`workflow_input_invalid_definition`,a,s);let l={id:o,name:a,label:s.trim(),type:c,required:i.required===!0,defaultValue:``,description:typeof i.description==`string`?i.description:``};return l.defaultValue=i.defaultValue==null||i.defaultValue===``?c===`image`||c===`video`?null:``:Rt(l,i.defaultValue,!1),l})}function Bt(e,t={}){let n=zt(e),r=It(t),i=n.length?n:[{id:`task`,name:`task`,label:`Task`,type:`text`,required:!1,defaultValue:``,description:``}],a=new Set(i.map(e=>e.name));for(let e of Object.keys(r))if(!a.has(e)||Pt.has(e))throw new G(`workflow_input_unknown`,e);let o={};for(let e of i){if(!n.length&&!Object.hasOwn(r,e.name))continue;let t=Object.hasOwn(r,e.name)?r[e.name]:e.defaultValue;o[e.name]=Rt(e,t,e.required)}return o}var Vt=Object.freeze([`S`,`SW`,`W`,`NW`,`N`,`NE`,`E`,`SE`]);function K(e){return Object.assign(Error(e),{code:e,statusCode:400})}function q(e){if(!e||typeof e!=`object`||Array.isArray(e))throw K(`workflow_image_invalid`);return e}function J(e,t,n,r){if(e===void 0)return t;if(typeof e!=`number`||!Number.isFinite(e)||e<n||e>r)throw K(`workflow_image_invalid`);return e}function Y(e,t,n){if(e===void 0)return t;if(typeof e!=`string`||e.length>n)throw K(`workflow_image_invalid`);return e.trim()}function Ht(e={}){let t=q(e),n=t.colors??[],r=t.directions??[`S`],i=t.frameOrder??[],a=t.transforms??[],o=q(t.region??{});if(!Array.isArray(n)||n.length>8||n.some(e=>typeof e!=`string`||!/^#[0-9a-f]{6}$/i.test(e))||!Array.isArray(r)||r.length<1||r.length>8||r.some(e=>!Vt.some(t=>t===e))||new Set(r).size!==r.length||!Array.isArray(i)||i.length>512||i.some(e=>!Number.isSafeInteger(e)||e<0||e>=512)||new Set(i).size!==i.length||!Array.isArray(a)||a.length>512)throw K(`workflow_image_invalid`);let s=t.method??`color`,c=t.align??`bottom-center`;if(s!==`color`&&s!==`model`||c!==`center`&&c!==`bottom-center`&&c!==`none`)throw K(`workflow_image_invalid`);let l=Y(t.inputName,`reference`,80);if(!/^[a-zA-Z][a-zA-Z0-9_]{0,79}$/.test(l)||[`constructor`,`prototype`,`__proto__`].includes(l))throw K(`workflow_image_invalid`);let u={inputName:l,method:s,colors:n.map(e=>String(e)),tolerance:J(t.tolerance,24,0,255),softness:J(t.softness,8,0,64),edgeConnected:t.edgeConnected!==!1,region:{x:J(o.x,25,0,99),y:J(o.y,25,0,99),width:J(o.width,20,1,100),height:J(o.height,10,1,100)},action:Y(t.action,`idle`,160),frameCount:Math.round(J(t.frameCount,4,1,16)),directions:[...r],columns:Math.round(J(t.columns,4,1,16)),rows:Math.round(J(t.rows,1,1,16)),durationMs:Math.round(J(t.durationMs,125,16,1e4)),trim:t.trim!==!1,align:c,padding:Math.round(J(t.padding,4,0,64)),maxFrameSize:Math.round(J(t.maxFrameSize,256,16,1024)),frameOrder:i.map(e=>Number(e)),transforms:a.map(e=>{let t=q(e);return{index:Math.round(J(t.index,0,0,511)),x:J(t.x,0,-4096,4096),y:J(t.y,0,-4096,4096),rotation:J(t.rotation,0,-360,360),scale:J(t.scale,1,.05,8),opacity:J(t.opacity,1,0,1),durationMs:Math.round(J(t.durationMs,125,16,1e4)),enabled:t.enabled!==!1}}),filename:Y(t.filename,`animation`,100)};if(new Set(u.transforms.map(e=>e.index)).size!==u.transforms.length)throw K(`workflow_image_invalid`);return u}function Ut(e){let t=q(e);if(t.type!==`workflow-images`||t.version!==1||!Array.isArray(t.frames)||t.frames.length>512)throw K(`workflow_image_invalid`);let n={type:`workflow-images`,version:1,frames:t.frames.map(e=>{let t=q(e),n=Lt(t.media);if(!n.mimeType.startsWith(`image/`))throw K(`workflow_image_invalid`);return{media:n,width:J(t.width,1,1,4096),height:J(t.height,1,1,4096),durationMs:J(t.durationMs,125,16,1e4),action:Y(t.action,``,160),direction:Y(t.direction,``,16),columns:J(t.columns,1,1,16),rows:J(t.rows,1,1,16),frameCount:J(t.frameCount,1,1,256)}})};if(t.atlas!==void 0){let e=q(t.atlas);if(!Array.isArray(e.frames)||e.frames.length>512)throw K(`workflow_image_invalid`);n.atlas={media:Lt(e.media),width:J(e.width,1,1,4096),height:J(e.height,1,1,4096),frames:e.frames.map(e=>{let t=q(e);return{x:J(t.x,0,0,4096),y:J(t.y,0,0,4096),width:J(t.width,1,1,4096),height:J(t.height,1,1,4096),durationMs:J(t.durationMs,125,16,1e4),action:Y(t.action,``,160),direction:Y(t.direction,``,16)}})}}return n}var Wt=Object.freeze([`media-input`,`media-background`,`media-inpaint`,`media-generate`,`media-frames`,`media-transform`,`media-preview`,`media-export`]);function Gt(e){return typeof e==`string`&&Wt.some(t=>t===e)}var X=a(),Kt=({className:e,...t})=>(0,X.jsx)(Et,{className:z(`gap-px overflow-hidden rounded-md border bg-card p-1 shadow-none!`,`[&>button]:rounded-md [&>button]:border-none! [&>button]:bg-transparent! [&>button]:hover:bg-secondary!`,e),...t}),qt=[`trigger`,`prompt`,`skill`,`file`,`mcp`,`notification`,`condition`,`parallel`,`approval`,...Wt];function Jt(e){return new Map(e.map((e,t)=>[e.id,t]))}function Yt(e=[],t){return e.slice(1).map((n,r)=>{let i=e[r];return{id:t?.(r,i.id,n.id)||`edge-${r}-${i.id}-${n.id}`,source:i.id,sourcePort:`output`,target:n.id,targetPort:`input`}})}function Xt(e=[],t=[]){let n=e.filter(e=>e.enabled!==!1),r=new Set(n.map(e=>e.id)),i=t.filter(e=>r.has(e.source)&&r.has(e.target)),a=new Map(n.map(e=>[e.id,[]])),o=new Map(n.map(e=>[e.id,[]])),s=new Map(n.map(e=>[e.id,0])),c=Jt(n);for(let e of i)a.get(e.target)?.push(e),o.get(e.source)?.push(e),s.set(e.target,(s.get(e.target)||0)+1);let l=n.filter(e=>s.get(e.id)===0),u=[];for(;l.length;){l.sort((e,t)=>c.get(e.id)-c.get(t.id));let e=l.shift();u.push(e);for(let t of o.get(e.id)||[]){let e=(s.get(t.target)||0)-1;s.set(t.target,e),e===0&&l.push(n.find(e=>e.id===t.target))}}let d=n.filter(e=>(a.get(e.id)||[]).length===0),f=d.find(e=>e.kind===`trigger`)||d[0];return{nodes:n,edges:i,incoming:a,outgoing:o,order:u,roots:d,unconnected:n.filter(e=>e.id!==f?.id&&(a.get(e.id)||[]).length===0),invalidTriggerTargets:n.filter(e=>e.kind===`trigger`&&(a.get(e.id)||[]).length>0),hasCycle:u.length!==n.length}}function Zt(e,t,n,r,i=`output`){return Xt(e,[...t,{id:`__candidate__`,source:n,sourcePort:i,target:r,targetPort:`input`}]).hasCycle}var Qt={trigger:`触发器`,prompt:`任务`,skill:`Skill`,file:`文件`,mcp:`MCP`,notification:`通知`,condition:`判断`,parallel:`并行`,approval:`审批`,"media-input":`图片输入`,"media-inpaint":`区域修补`,"media-background":`去背景`,"media-generate":`动作生成`,"media-frames":`拆分帧`,"media-transform":`帧处理`,"media-preview":`动画预览`,"media-export":`图集输出`},$t=[{kind:`trigger`,label:`手动触发`,Icon:ce},{kind:`prompt`,label:`运行 Prompt`,Icon:S},{kind:`skill`,label:`调用 Skill`,Icon:C},{kind:`file`,label:`读写文件`,Icon:P},{kind:`mcp`,label:`调用 MCP`,Icon:ve},{kind:`condition`,label:`条件分支`,Icon:te},{kind:`parallel`,label:`并行汇合`,Icon:se},{kind:`approval`,label:`人工审批`,Icon:D},{kind:`notification`,label:`发送通知`,Icon:x},{kind:`media-inpaint`,label:`区域修补`,Icon:I},{kind:`media-input`,label:`图片输入`,Icon:I},{kind:`media-background`,label:`去背景`,Icon:I},{kind:`media-generate`,label:`动作生成`,Icon:I},{kind:`media-frames`,label:`拆分帧`,Icon:I},{kind:`media-transform`,label:`帧处理`,Icon:I},{kind:`media-preview`,label:`动画预览`,Icon:I},{kind:`media-export`,label:`图集输出`,Icon:I}];function en(e,t){return t(e===`media-inpaint`?`workflows:imageNodes.inpaint`:e===`media-input`?`workflows:imageNodes.input`:e===`media-background`?`workflows:imageNodes.background`:e===`media-generate`?`workflows:imageNodes.generate`:e===`media-frames`?`workflows:imageNodes.frames`:e===`media-transform`?`workflows:imageNodes.transform`:e===`media-preview`?`workflows:imageNodes.preview`:e===`media-export`?`workflows:imageNodes.export`:e===`trigger`?`workflows:workflowsPage.triggerNode`:e===`skill`?`workflows:workflowsPage.skillNode`:e===`file`?`workflows:workflowsPage.fileNode`:e===`mcp`?`workflows:workflowsPage.mcpNode`:e===`notification`?`workflows:workflowsPage.notificationNode`:e===`condition`?`workflows:workflowsPage.conditionNode`:e===`parallel`?`workflows:workflowsPage.parallelNode`:e===`approval`?`workflows:workflowsPage.approvalNode`:`workflows:workflowsPage.task`)}function tn(e,t){return Gt(e)?en(e,t):t(e===`trigger`?`workflows:workflowsPage.manualTrigger`:e===`skill`?`workflows:workflowsPage.callSkill`:e===`file`?`workflows:workflowsPage.readWriteFiles`:e===`mcp`?`workflows:workflowsPage.callMcp`:e===`condition`?`workflows:workflowsPage.conditionBranch`:e===`parallel`?`workflows:workflowsPage.parallelJoin`:e===`approval`?`workflows:workflowsPage.humanApproval`:e===`notification`?`workflows:workflowsPage.sendNotification`:`workflows:workflowsPage.runPrompt`)}function nn(e,t){return t(e===`sprite`?`workflows:imageNodes.templateName`:e===`pr-fix`?`workflows:workflowsPage.prFix`:e===`research`?`workflows:workflowsPage.research`:e===`report`?`workflows:workflowsPage.dailyWeeklyReport`:e===`asset`?`workflows:workflowsPage.assetGeneration`:e===`release`?`workflows:workflowsPage.releasePreparation`:`workflows:workflowsPage.codeReview`)}function rn(e,t){return t(e===`sprite`?`workflows:imageNodes.templateDescription`:e===`pr-fix`?`workflows:workflowsPage.prFixDescription`:e===`research`?`workflows:workflowsPage.researchDescription`:e===`report`?`workflows:workflowsPage.reportDescription`:e===`asset`?`workflows:workflowsPage.assetDescription`:e===`release`?`workflows:workflowsPage.releaseDescription`:`workflows:workflowsPage.codeReviewDescription`)}function Z(e,t,n,r,i,a,o={}){return{id:e,kind:t,label:n,prompt:r,x:i,y:a,model:null,executionMode:`full-access`,retries:0,timeoutMinutes:20,failurePolicy:`stop`,enabled:!0,outputFormat:`text`,skillName:``,requestedToolNames:[],condition:{source:`previous`,operator:`exists`,value:``},approval:{message:``,timeoutMinutes:60},notification:{title:``,content:``},notificationTargets:[],...Gt(t)?{image:Ht()}:{},...o}}function an(e){return Yt(e,()=>crypto.randomUUID())}function on(e){return[{id:`input-task`,name:`task`,label:e?e(`workflows:inputs.task`):`本次任务`,description:e?e(`workflows:inputs.taskHint`):`描述这次运行需要完成的目标。`,type:`text`,required:!0,defaultValue:``},{id:`input-materials`,name:`materials`,label:e?e(`workflows:inputs.materials`):`参考材料`,description:e?e(`workflows:inputs.materialsHint`):`填写文件路径、链接、代码片段或需要处理的内容。`,type:`text`,required:!1,defaultValue:``},{id:`input-constraints`,name:`constraints`,label:e?e(`workflows:inputs.constraints`):`约束与输出要求`,description:e?e(`workflows:inputs.constraintsHint`):`说明范围、格式、禁止操作及验收条件。`,type:`text`,required:!1,defaultValue:``}]}function sn(e){return`${e}\n\n本次任务:{{inputs.task}}\n参考材料:{{inputs.materials}}\n约束与输出要求:{{inputs.constraints}}\n以本次运行输入限定任务范围,节点只规定处理方法;不要把节点示例或工作流名称当作本次任务。`}var cn=[{id:`code-review`,name:`代码审查`,description:`读取 diff → 运行测试 → 生成 review`,Icon:A,nodes:[Z(`review-trigger`,`trigger`,`手动触发`,``,65,45),Z(`review-diff`,`file`,`读取 diff`,`读取当前工作区的 git diff,识别改动范围与高风险文件。`,235,45),Z(`review-test`,`prompt`,`运行检查`,`运行适合当前项目的测试与 lint,记录失败原因。`,405,45),Z(`review-report`,`prompt`,`生成 review`,`结合 diff 和验证结果,输出按严重度排序的代码审查结论。`,235,180),Z(`review-notify`,`notification`,`发送结果`,``,405,180)]},{id:`pr-fix`,name:`PR 修复`,description:`定位失败 → 修改代码 → 回归测试`,Icon:te,nodes:[Z(`fix-trigger`,`trigger`,`手动触发`,``,65,45),Z(`fix-find`,`prompt`,`定位失败`,`检查项目状态与失败信息,定位最可能的根因。`,235,45),Z(`fix-code`,`prompt`,`修改代码`,`修复已定位的问题,保留用户已有改动,不执行破坏性命令。`,405,45),Z(`fix-test`,`prompt`,`回归测试`,`运行针对性测试和构建,确认修复没有引入回归。`,235,180),Z(`fix-notify`,`notification`,`通知结果`,``,405,180)]},{id:`research`,name:`资料调研`,description:`搜索资料 → 提取引用 → 点亮星忆`,Icon:_e,nodes:[Z(`research-trigger`,`trigger`,`手动输入`,``,65,45),Z(`research-search`,`prompt`,`搜索资料`,`围绕工作流描述中的主题检索项目内资料与可用信息源。`,235,45),Z(`research-summary`,`prompt`,`整理引用`,`整理关键结论、证据、限制和下一步建议。`,405,45),Z(`research-memory`,`prompt`,`保存星忆`,`把适合长期保留的结论写入 Agent 记忆。`,320,180)]},{id:`report`,name:`日报周报`,description:`汇总会话 → 生成摘要 → 渠道通知`,Icon:F,nodes:[Z(`report-trigger`,`trigger`,`手动触发`,``,65,45),Z(`report-collect`,`prompt`,`汇总进展`,`汇总当前项目近期完成事项、风险与待办。`,235,45),Z(`report-write`,`prompt`,`生成报告`,`将汇总内容整理为清晰的日报或周报。`,405,45),Z(`report-notify`,`notification`,`渠道通知`,``,320,180)]},{id:`asset`,name:`资产生成`,description:`生成图片 → 存入资产库 → 通知验收`,Icon:I,nodes:[Z(`asset-trigger`,`trigger`,`手动输入`,``,65,45),Z(`asset-generate`,`prompt`,`生成视觉资产`,`根据工作流描述生成需要的视觉资产,并保存生成文件。`,235,45),Z(`asset-check`,`prompt`,`检查产物`,`检查生成资产是否完整、可访问并符合需求。`,405,45),Z(`asset-notify`,`notification`,`通知验收`,``,320,180)]},{id:`release`,name:`发布准备`,description:`版本检查 → changelog → 创建发布单`,Icon:he,nodes:[Z(`release-trigger`,`trigger`,`手动触发`,``,65,45),Z(`release-check`,`prompt`,`版本检查`,`检查工作区、测试、构建和版本信息是否满足发布要求。`,235,45),Z(`release-log`,`prompt`,`生成 changelog`,`根据近期提交和改动生成 changelog 与发布说明。`,405,45),Z(`release-report`,`prompt`,`发布清单`,`生成最终发布检查清单并标记阻塞项。`,320,180)]}].map(e=>({...e,inputs:on(),nodes:e.nodes.map(e=>[`prompt`,`file`,`skill`,`mcp`].includes(e.kind)?{...e,prompt:sn(e.prompt)}:e)}));function ln(){let e=[Z(`sprite-trigger`,`trigger`,`手动触发`,``,0,180),Z(`sprite-source`,`media-input`,`参考图片`,``,180,180)],t=[{id:`sprite-input`,source:`sprite-trigger`,target:`sprite-source`,sourcePort:`output`,targetPort:`input`}];return[{id:`idle`,label:`待机呼吸`,prompt:`Subtle breathing idle cycle. Preserve the reference style; the feet stay planted.`},{id:`walk`,label:`走路`,prompt:`Walking cycle: alternating foot contact, passing pose and opposite contact. Keep the character in place.`},{id:`run`,label:`跑步`,prompt:`Running cycle: contact, compression, passing and flight. Preserve proportions and keep the character in place.`},{id:`attack`,label:`攻击`,prompt:`Attack sequence: anticipation, wind-up, strike and recovery. Use only the equipment visible in the reference.`}].forEach((n,r)=>{let i=r*140,a=[Z(`${n.id}-generate`,`media-generate`,n.label,`${n.prompt}\n{{inputs.task}}`,380,i,{image:Ht({action:n.id,frameCount:4,directions:[...Vt]})}),Z(`${n.id}-background`,`media-background`,`色键去背景`,``,560,i),Z(`${n.id}-frames`,`media-frames`,`拆分连续帧`,``,740,i),Z(`${n.id}-align`,`media-transform`,`裁边与脚底对齐`,``,920,i)];e.push(...a);let o=[`sprite-source`,...a.map(e=>e.id),`sprite-preview`];for(let e=1;e<o.length;e++)t.push({id:`${n.id}-edge-${e}`,source:o[e-1],target:o[e],sourcePort:`output`,targetPort:`input`})}),e.push(Z(`sprite-preview`,`media-preview`,`动画预览`,``,1100,180),Z(`sprite-export`,`media-export`,`输出精灵图集`,``,1280,180)),t.push({id:`sprite-output`,source:`sprite-preview`,target:`sprite-export`,sourcePort:`output`,targetPort:`input`}),{id:`sprite`,name:`游戏精灵图生成`,description:`参考图 → 分方向动作 → 去背景 → 拆帧对齐 → 动画预览 → 图集`,Icon:I,nodes:e,edges:t,inputs:[{id:`sprite-reference`,name:`reference`,type:`image`,required:!0,label:`角色参考图`,description:`上传图片并保留原图风格。`,defaultValue:null},{id:`sprite-task`,name:`task`,type:`text`,required:!1,label:`角色与动作要求`,description:`本次运行的角色特征、动作及其他要求。`,defaultValue:``}]}}var un=ln(),dn=[...cn,un];function fn(e){return dn.find(t=>t.id===e)}function pn(e){return e.nodes.reduce((e,t)=>e+(t.enabled&&t.kind===`media-generate`?Ht(t.image).directions.length:0),0)}function mn(e=``,t){let n=[Z(crypto.randomUUID(),`trigger`,`手动触发`,``,65,45),Z(crypto.randomUUID(),`prompt`,`运行 Prompt`,sn(`按本次输入完成任务,结合材料执行所需步骤,验证产物并报告结果。`),235,45)];return{id:``,name:`未命名工作流`,description:``,status:`draft`,revision:1,cwd:e,model:null,inputs:on(t),tags:[],visibility:`private`,notifications:[],nodes:n,edges:an(n)}}function hn(e,t){if(e.kind===`media-generate`){if(e.image?.action===`idle`)return t(`workflows:imageNodes.idle`);if(e.image?.action===`walk`)return t(`workflows:imageNodes.walk`);if(e.image?.action===`run`)return t(`workflows:imageNodes.run`);if(e.image?.action===`attack`)return t(`workflows:imageNodes.attack`)}return tn(e.kind,t)}function gn(e,t=``,n){let r=e.nodes.map(t=>({...structuredClone(t),...e.id===`sprite`&&n?{label:hn(t,n)}:{},id:crypto.randomUUID()})),i=dn.includes(e)?on(n):[],a=new Map(e.nodes.map((e,t)=>[e.id,r[t].id]));return{...mn(t,n),name:n&&dn.includes(e)?nn(e.id,n):e.name,description:n&&dn.includes(e)?rn(e.id,n):e.description,inputs:e.inputs.map(t=>{let r=i.find(e=>e.name===t.name);return{...structuredClone(t),...r?{label:r.label,description:r.description}:{},...e.id===`sprite`&&t.name===`reference`&&n?{label:n(`workflows:imageNodes.reference`),description:n(`workflows:imageNodes.referenceHint`)}:{},id:crypto.randomUUID()}}),nodes:r,edges:e.edges?e.edges.map(e=>({...e,id:crypto.randomUUID(),source:a.get(e.source)??``,target:a.get(e.target)??``})):an(r)}}var _n=new Map($t.map(({kind:e,Icon:t})=>[e,t])),vn=`flow-port size-2.5! rounded-full! border-[1.5px]! border-control! bg-panel! cursor-crosshair after:absolute after:-inset-2 hover:border-focus!`;function yn({status:e}){return e===`running`?(0,X.jsx)(Ve,{className:`ml-auto size-3.5`}):e===`completed`?(0,X.jsx)(w,{className:`ml-auto size-3.5 text-success`,strokeWidth:2.25}):e===`failed`?(0,X.jsx)(we,{className:`ml-auto size-3.5 text-danger`,strokeWidth:2.25}):e===`waiting_approval`?(0,X.jsx)(jt,{className:`ml-auto size-3.5 text-warning-strong`}):null}function bn({data:e,selected:t}){let n=_n.get(e.kind);return(0,X.jsxs)(`div`,{className:z(`flow-node relative flex w-36 min-h-14 cursor-grab flex-col justify-center gap-0.5 rounded-md border border-stroke bg-panel px-3 py-2 text-left transition-[border-color,box-shadow] duration-(--d-fast) ease-precise [:focus-visible>&]:outline-2 [:focus-visible>&]:outline-offset-2 [:focus-visible>&]:outline-focus`,`type-${e.kind}`,t&&`active border-stroke-strong bg-key shadow-key`,e.status===`running`&&`border-star-border`),children:[t&&(0,X.jsx)(`i`,{"aria-hidden":`true`,className:`absolute inset-y-2 -left-px w-[3px] rounded-r-[3px] bg-star`}),e.kind!==`trigger`&&(0,X.jsx)(St,{id:`input`,className:`${vn} input`,type:`target`,position:xt.Left,title:e.inputLabel,"aria-label":e.inputLabel}),e.kind===`condition`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(St,{id:`true`,className:`${vn} output condition-true`,type:`source`,position:xt.Right,title:`true`,"aria-label":`true`}),(0,X.jsx)(St,{id:`false`,className:`${vn} output condition-false`,type:`source`,position:xt.Bottom,title:`false`,"aria-label":`false`})]}):(0,X.jsx)(St,{id:`output`,className:`${vn} output`,type:`source`,position:xt.Right,title:e.outputLabel,"aria-label":e.outputLabel}),(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5 text-xs text-content-muted`,children:[n&&(0,X.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.typeLabel}),(0,X.jsx)(yn,{status:e.status})]}),(0,X.jsx)(`strong`,{className:`truncate text-sm font-medium text-content`,title:e.label,children:e.label})]})}var xn={workflow:bn};function Sn(e){return typeof e==`string`&&qt.includes(e)}function Cn(e){return e.data.status===`running`?`var(--star)`:`var(--stroke-strong)`}function wn({nodes:e,edges:t,selectedNodeId:n,selectedEdgeId:r,nodeStatus:i,hint:a,inputLabel:o,outputLabel:s,nodeTypeLabel:c,onAddNode:l,onConnect:u,onMoveNode:d,onSelectNode:f,onSelectEdge:p,onClearSelection:m,onDeleteNodes:h,onDeleteEdges:g}){let{screenToFlowPosition:_}=Ct(),v=(0,W.useMemo)(()=>e.map(e=>({id:e.id,type:`workflow`,position:{x:e.x,y:e.y},selected:e.id===n,data:{kind:e.kind,label:e.label,typeLabel:c(e.kind),inputLabel:o,outputLabel:s,status:i?.get(e.id)}})),[o,i,c,e,s,n]),y=(0,W.useRef)(new Set),b=(0,W.useRef)(new Map),x=(0,W.useRef)(null),[S,C,w]=yt(v);(0,W.useEffect)(()=>{C(e=>{let t=new Map(e.map(e=>[e.id,e])),n=e.length!==v.length,r=v.map(e=>{let r=t.get(e.id);if(!r)return n=!0,e;let i=y.current.has(e.id)?r.position:e.position,a=r.data.kind===e.data.kind&&r.data.label===e.data.label&&r.data.typeLabel===e.data.typeLabel&&r.data.inputLabel===e.data.inputLabel&&r.data.outputLabel===e.data.outputLabel&&r.data.status===e.data.status;return i.x===r.position.x&&i.y===r.position.y&&r.selected===e.selected&&a?r:(n=!0,{...r,position:i,selected:e.selected,data:e.data})});return n?r:e})},[v,C]);let T=(0,W.useCallback)(()=>{x.current=null,b.current.forEach((e,t)=>d(t,e)),b.current.clear()},[d]),E=(0,W.useCallback)((e,t)=>{b.current.set(e,t),x.current??=requestAnimationFrame(T)},[T]);(0,W.useEffect)(()=>()=>{x.current!==null&&cancelAnimationFrame(x.current)},[]);let ee=(0,W.useMemo)(()=>t.map(e=>({id:e.id,source:e.source,sourceHandle:e.sourcePort,target:e.target,targetHandle:e.targetPort,selected:e.id===r,markerEnd:{type:bt.ArrowClosed,width:14,height:14,color:`var(--canvas-edge)`}})),[t,r]),D=(0,W.useCallback)(e=>{!e.source||!e.target||u(e.source,e.target,e.sourceHandle||`output`)},[u]),O=(0,W.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`},[]),k=(0,W.useCallback)(e=>{e.preventDefault();let t={};try{t=JSON.parse(e.dataTransfer.getData(`text/plain`)||`{}`)}catch{return}if(!Sn(t.kind))return;let n=_({x:e.clientX,y:e.clientY});l(t.kind,typeof t.label==`string`?t.label:c(t.kind),n)},[c,l,_]);return(0,X.jsxs)(`div`,{className:`workflow-react-flow absolute inset-0`,children:[(0,X.jsxs)(Dt,{nodes:S,edges:ee,nodeTypes:xn,onNodesChange:w,connectionMode:kt.Strict,deleteKeyCode:[`Backspace`,`Delete`],fitView:!0,fitViewOptions:{padding:.18,minZoom:.6,maxZoom:1,nodes:S.length>8?S.slice(0,3).map(({id:e})=>({id:e})):void 0},minZoom:.15,maxZoom:1.8,snapToGrid:!0,snapGrid:[20,20],panOnDrag:!0,zoomOnDoubleClick:!1,onConnect:D,onNodeClick:(e,t)=>f(t.id),onEdgeClick:(e,t)=>p(t.id),onPaneClick:m,onNodeDragStart:(e,t)=>y.current.add(t.id),onNodeDrag:(e,t)=>E(t.id,t.position),onNodeDragStop:(e,t)=>{y.current.delete(t.id),b.current.delete(t.id),d(t.id,t.position)},onNodesDelete:e=>h(e.map(e=>e.id)),onEdgesDelete:e=>g(e.map(e=>e.id)),onDragOver:O,onDrop:k,children:[(0,X.jsx)(Ot,{variant:wt.Dots,gap:20,size:1,color:`var(--canvas-grid)`}),(0,X.jsx)(vt,{className:`workflow-react-flow-minimap m-3! h-24! w-36! overflow-hidden rounded-md border border-stroke [&_svg]:h-full [&_svg]:w-full @max-[640px]/workflow:hidden`,nodeColor:Cn,nodeBorderRadius:4,pannable:!0,zoomable:!0}),(0,X.jsx)(Kt,{position:`top-left`,showInteractive:!1,className:`border-stroke bg-panel p-0.5 [&>button]:size-7! [&>button]:rounded-sm! [&>button]:hover:bg-surface-hover! max-[650px]:[&>button]:size-11! pointer-coarse:[&>button]:size-11!`})]}),(0,X.jsx)(`div`,{className:`pointer-events-none absolute bottom-3 left-3 z-[5] hidden max-w-[calc(100%-180px)] text-xs text-content-muted @min-[640px]/workflow:block`,children:a})]})}function Tn(e){return(0,X.jsx)(Tt,{children:(0,X.jsx)(wn,{...e})})}function En({nodeCount:e,t,onAddNode:n}){let[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(``),s=[{label:t(`workflows:editor.flowNodes`),match:e=>[`trigger`,`condition`,`parallel`,`approval`].includes(e)},{label:t(`workflows:editor.agentNodes`),match:e=>[`prompt`,`skill`,`file`,`mcp`,`notification`].includes(e)},{label:t(`workflows:editor.imageNodes`),match:Gt}],c=$t.filter(({kind:e})=>tn(e,t).toLocaleLowerCase().includes(a.trim().toLocaleLowerCase()));return(0,X.jsxs)(Ie,{open:r,onOpenChange:i,children:[(0,X.jsx)(Pe,{asChild:!0,children:(0,X.jsxs)(B,{variant:`outline`,size:`sm`,title:t(`workflows:editor.addNode`),children:[(0,X.jsx)(pe,{}),(0,X.jsx)(`span`,{className:`max-[650px]:sr-only @max-[760px]/workflow-header:sr-only`,children:t(`workflows:editor.addNode`)})]})}),(0,X.jsxs)(Fe,{align:`end`,className:`w-72 max-w-[calc(100vw-2rem)] p-1.5`,"aria-label":t(`workflows:workflowsPage.nodeLibrary`),children:[(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(_e,{className:`pointer-events-none absolute top-2.5 left-2.5 size-4 text-content-muted`}),(0,X.jsx)(V,{value:a,onChange:e=>o(e.target.value),className:`pl-8`,placeholder:t(`workflows:editor.searchNodes`),"aria-label":t(`workflows:editor.searchNodes`)})]}),(0,X.jsxs)(`div`,{className:`node-library max-h-[min(420px,60vh)] overflow-y-auto overscroll-contain supports-[height:100dvh]:max-h-[min(420px,60dvh)]`,children:[s.map(r=>{let a=c.filter(({kind:e})=>r.match(e));return a.length===0?null:(0,X.jsxs)(`section`,{className:`py-1`,children:[(0,X.jsx)(`h3`,{className:`px-2 py-1.5 text-xs font-medium text-content-muted`,children:r.label}),a.map(({kind:r,Icon:a})=>(0,X.jsxs)(`button`,{type:`button`,draggable:!0,className:`flex min-h-[30px] w-full cursor-grab items-center gap-2 rounded-sm px-2 text-left text-sm text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:-outline-offset-2 max-[650px]:min-h-11 pointer-coarse:min-h-11`,onClick:()=>{n(r,tn(r,t),{x:160+e%4*180,y:100+Math.floor(e/4)*100}),i(!1)},onDragStart:e=>e.dataTransfer.setData(`text/plain`,JSON.stringify({kind:r,label:tn(r,t)})),onDragEnd:()=>i(!1),children:[(0,X.jsx)(a,{className:`size-4 shrink-0 text-content-muted`}),(0,X.jsx)(`span`,{className:`flex-1`,children:tn(r,t)}),(0,X.jsx)(ne,{className:`size-3.5 text-content-faint`,"aria-hidden":`true`})]},r))]},r.label)}),c.length===0&&(0,X.jsx)(`p`,{className:`p-3 text-xs text-content-muted`,children:t(`workflows:editor.noMatchingNodes`)})]})]})]})}function Dn({draft:e,selectedNodeId:t,selectedEdgeId:n,nodeStatus:r,t:i,onAddNode:a,onConnect:o,onMoveNode:s,onSelectNode:c,onSelectEdge:l,onClearSelection:u,onDeleteNodes:d,onDeleteEdges:f}){return(0,X.jsx)(`section`,{className:`builder-canvas relative h-full min-h-0 min-w-0 overflow-hidden bg-panel`,"aria-label":i(`workflows:editor.canvas`),children:(0,X.jsx)(Tn,{nodes:e.nodes,edges:e.edges,selectedNodeId:t,selectedEdgeId:n,nodeStatus:r,hint:i(`workflows:workflowsPage.dragFromANodeOutputToTheTargetInputToConnectThem`),inputLabel:i(`workflows:workflowsPage.inputPort`),outputLabel:i(`workflows:workflowsPage.outputPort`),nodeTypeLabel:e=>en(e,i),onAddNode:a,onConnect:o,onMoveNode:s,onSelectNode:c,onSelectEdge:l,onClearSelection:u,onDeleteNodes:d,onDeleteEdges:f})})}function On(e){if(e.size>134217728)throw new g(`Workflow package exceeds 128 MiB`,{kind:`protocol`,data:{code:`workflow_bundle_too_large`}})}function kn(e){return e instanceof g&&e.data?.code===`workflow_bundle_too_large`}function An(e,t){return p(`/api/workflows/${encodeURIComponent(e)}/bundle`,{signal:t,timeout:12e4})}async function jn(e,t){return On(e),f(`/api/workflows/import-bundle`,{method:`POST`,data:e,signal:t,timeout:12e4,parse:e=>{if(!e||typeof e!=`object`||!(`workflow`in e))throw m();let t=e.workflow;if(!t||typeof t!=`object`||!(`id`in t)||typeof t.id!=`string`)throw m()}})}var Mn={workflows:[],runs:[],limits:{maxConcurrent:4,running:0},notificationTargets:{browser:{enabled:!1},feishu:{enabled:!1},weixin:{enabled:!1},qq:{enabled:!1},telegram:{enabled:!1}},models:[],skills:[],cwd:``};function Q(e){let t=e instanceof g?e.data?.code:typeof e==`string`?e:e&&typeof e==`object`&&`code`in e?e.code:``;return t===`workflow_image_source_stale`?c(`workflows:imageNodes.sourceStale`):t===`workflow_image_source_required`?c(`workflows:imageNodes.sourceRequired`):t===`workflow_image_engine_missing`?c(`workflows:imageNodes.engineMissing`):t===`workflow_image_generation_failed`?c(`workflows:imageNodes.generationFailed`):t===`workflow_image_too_large`?c(`workflows:imageNodes.tooLarge`):t===`workflow_image_timeout`?c(`workflows:imageNodes.timeout`):typeof t==`string`&&t.startsWith(`workflow_image_`)?c(`workflows:imageNodes.invalidOutput`):e instanceof Error?e.message:String(e)}function Nn({notify:e,requestConfirm:t,query:n}){let{t:r}=l(),[i,a]=(0,W.useState)(Mn),[o,s]=(0,W.useState)(`all`),[c,u]=(0,W.useState)(!0),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),v=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>v.current?.abort(),[]);let y=(0,W.useCallback)(async()=>{try{a(await h(`/api/workflows`)),f(!0),_(``)}catch(e){_(Q(e))}finally{u(!1)}},[]);(0,W.useEffect)(()=>{y()},[y]),(0,W.useEffect)(()=>{let e=window.setInterval(()=>{y()},i.limits.running?1500:8e3);return()=>window.clearInterval(e)},[i.limits.running,y]);let b=(0,W.useCallback)(e=>i.runs.filter(t=>t.workflowId===e).sort((e,t)=>Date.parse(t.startedAt)-Date.parse(e.startedAt))[0],[i.runs]),x=(0,W.useMemo)(()=>i.workflows.filter(e=>{let t=b(e.id);return`${e.name} ${e.description}`.toLowerCase().includes(n.toLowerCase())?o===`running`?t?.status===`running`:o===`failed`?t?.status===`failed`:o===`draft`?e.status===`draft`:o!==`presets`:!1}),[i.workflows,o,b,n]),S=(0,W.useCallback)(async(t,n={})=>{m(t.id),_(``);try{return await h(`/api/workflows/${encodeURIComponent(t.id)}/run`,{method:`POST`,body:JSON.stringify({inputs:n})}),await y(),e(r(`workflows:workflowsPage.workflowStarted`)),!0}catch(t){let n=Q(t);return _(n),e(n,`error`),!1}finally{m(``)}},[y,e,r]),C=(0,W.useCallback)(async t=>{m(t.id),_(``);try{await h(`/api/workflow-runs/${encodeURIComponent(t.id)}/stop`,{method:`POST`,body:`{}`}),await y(),e(r(`workflows:workflowsPage.stoppingWorkflow`),`info`)}catch(t){let n=Q(t);_(n),e(n,`error`)}finally{m(``)}},[y,e,r]),w=(0,W.useCallback)(async t=>{m(t.id);try{await h(`/api/workflow-runs/${encodeURIComponent(t.id)}/retry`,{method:`POST`,body:`{}`}),await y(),e(r(`workflows:workflowsPage.workflowStarted`))}catch(t){let n=Q(t);_(n),e(n,`error`)}finally{m(``)}},[y,e,r]),T=(0,W.useCallback)(async(t,n,r)=>{m(n);try{await h(`/api/workflow-runs/${encodeURIComponent(t.id)}/approvals/${encodeURIComponent(n)}`,{method:`POST`,body:JSON.stringify({approved:r})}),await y()}catch(t){let n=Q(t);_(n),e(n,`error`)}finally{m(``)}},[y,e]),E=(0,W.useCallback)(async t=>{m(t.id);try{await h(`/api/workflows/${encodeURIComponent(t.id)}/duplicate`,{method:`POST`,body:`{}`}),await y(),e(r(`workflows:workflowsPage.workflowDuplicated`))}catch(t){let n=Q(t);_(n),e(n,`error`)}finally{m(``)}},[y,e,r]),ee=(0,W.useCallback)(async t=>{if(v.current)return;let n=new AbortController;v.current=n,m(t.id);try{let e=await An(t.id,n.signal);if(n.signal.aborted)return;let r=URL.createObjectURL(e),i=document.createElement(`a`);i.href=r,i.download=`${t.name.replace(/[\\/:*?"<>|]/g,`-`)}.pisper-workflow.zip`,i.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}catch{n.signal.aborted||e(r(`workflows:workflowsPage.packageFailed`),`error`)}finally{v.current=null,n.signal.aborted||m(``)}},[e,r]),D=(0,W.useCallback)(async t=>{if(v.current)return;let n=new AbortController;v.current=n,m(`import`);try{if(await jn(t,n.signal),n.signal.aborted||(await y(),n.signal.aborted))return;e(r(`workflows:workflowsPage.workflowImported`))}catch(t){if(n.signal.aborted)return;let i=kn(t)?r(`workflows:workflowsPage.packageTooLarge`):r(`workflows:workflowsPage.packageFailed`);_(i),e(i,`error`)}finally{v.current=null,n.signal.aborted||m(``)}},[y,e,r]),O=(0,W.useCallback)(async n=>{if(await t?.({title:r(`workflows:workflowsPage.deleteWorkflow`),message:r(`workflows:workflowsPage.deleteWorkflowNameAndItsRunHistory`,{name:n.name}),confirmLabel:r(`workflows:workflowsPage.delete`),tone:`danger`})){m(n.id);try{await h(`/api/workflows/${encodeURIComponent(n.id)}`,{method:`DELETE`}),await y(),e(r(`workflows:workflowsPage.workflowDeleted`))}catch(t){let n=Q(t);_(n),e(n,`error`)}finally{m(``)}}},[y,e,t,r]);return{data:i,filter:o,setFilter:s,loading:c,loaded:d,reload:(0,W.useCallback)(async()=>{u(!0),await y()},[y]),busyId:p,error:g,visibleWorkflows:x,latestRun:b,runWorkflow:S,stopRun:C,retryRun:w,resolveApproval:T,duplicateWorkflow:E,exportWorkflow:ee,importWorkflow:D,removeWorkflow:O}}function Pn(e){return e===`running`?`run`:e===`waiting_approval`?`attention`:e===`completed`?`done`:e===`failed`||e===`interrupted`?`failed`:e===`cancelled`?`stopped`:null}function Fn({status:e,className:t}){let n=Pn(e);return(0,X.jsx)(`span`,{"aria-hidden":`true`,className:z(`grid size-[18px] flex-none place-items-center rounded-xs`,!n&&`bg-surface-muted`,t),children:n&&(0,X.jsx)(ft,{status:n,className:`size-3.5`})})}function In(e){return e===`running`?`bg-st-run`:e===`waiting_approval`?`bg-st-attn-fill`:e===`completed`?`bg-content-muted`:e===`failed`||e===`interrupted`?`bg-content-secondary`:`bg-stroke-strong`}function Ln({nodes:e,className:t}){return e.length?(0,X.jsx)(`span`,{"aria-hidden":`true`,className:z(`flex h-1 min-w-0 gap-0.5`,t),children:e.map(e=>(0,X.jsx)(`i`,{className:`h-full w-[18px] min-w-0.5 shrink rounded-full ${In(e.status)}`},e.id))}):null}function Rn({status:e,label:t}){let n=Pn(e);return(0,X.jsxs)(`span`,{"data-run-status":e,className:z(`inline-flex min-w-0 items-center gap-1 whitespace-nowrap`,e===`waiting_approval`?`font-medium text-st-attn`:`text-content-secondary`),children:[n&&(0,X.jsx)(ft,{status:n,className:`size-3.5`}),(0,X.jsx)(`span`,{className:`min-w-0 truncate`,children:t})]})}function zn(e){let t=Math.max(0,Math.round((Number(e)||0)/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function Bn(e,t){return t(e===`running`?`workflows:workflowsPage.running`:e===`waiting_approval`?`workflows:workflowsPage.waitingApproval`:e===`completed`?`workflows:workflowsPage.completed`:e===`failed`?`workflows:workflowsPage.failed`:e===`cancelled`?`workflows:workflowsPage.stopped`:e===`interrupted`?`workflows:workflowsPage.interrupted`:`workflows:workflowsPage.draft`)}var Vn=[`running`,`waiting_approval`];function Hn({value:e,onChange:t,t:n}){let r=`min-w-14 flex-none px-3 max-[650px]:flex-1`;return(0,X.jsx)(Be,{value:e,onValueChange:e=>t(e),className:`max-[650px]:w-full`,children:(0,X.jsxs)(ze,{className:`max-w-full justify-start overflow-x-auto overflow-y-hidden [scrollbar-width:none] max-[650px]:min-h-11 max-[650px]:w-full pointer-coarse:min-h-11 [&::-webkit-scrollbar]:hidden`,children:[(0,X.jsx)(Re,{className:r,value:`workflows`,children:n(`workflows:workflowsPage.workflows`)}),(0,X.jsx)(Re,{className:r,value:`runs`,children:n(`workflows:workflowsPage.runHistory`)}),(0,X.jsx)(Re,{className:r,value:`templates`,children:n(`workflows:workflowsPage.templates`)})]})})}function Un({workflows:e,runs:t,busyId:n,query:r,language:i,t:a,onRun:o,onEdit:s,onDuplicate:c,onExport:l,onDelete:u}){let d=e=>t.filter(t=>t.workflowId===e).sort((e,t)=>Date.parse(t.startedAt)-Date.parse(e.startedAt))[0],f=e.filter(e=>e.status===`published`).length;return(0,X.jsx)(lt,{title:a(`workflows:workflowsPage.workflows`),count:e.length,meta:e.length?a(`workflows:workflowsPage.publishedCount`,{count:f}):void 0,children:e.length?(0,X.jsx)(ct,{children:e.map(e=>{let t=d(e.id),r=Vn.includes(t?.status||``),f=r||n===e.id;return(0,X.jsx)(st,{"data-workflow-id":e.id,icon:(0,X.jsx)(Ce,{}),name:e.name,nameMeta:`v${e.revision}`,description:e.description||(0,X.jsx)(`span`,{className:`font-mono`,children:e.cwd}),meta:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{children:e.status===`published`?a(`workflows:workflowsPage.published`):a(`workflows:workflowsPage.draft`)}),(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,X.jsx)(`span`,{className:`truncate`,children:e.visibility===`shared`?a(`workflows:workflowsPage.shared`):a(`workflows:workflowsPage.private`)})]}),status:t?(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(Rn,{status:t.status,label:Bn(t.status,a)}),(0,X.jsx)(`span`,{className:`whitespace-nowrap`,children:Je(t.startedAt,i)})]}):a(`workflows:workflowsPage.neverRun`),onOpen:()=>s(e.id),openLabel:`${a(`workflows:workflowsPage.edit`)}: ${e.name}`,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(B,{size:`icon-sm`,variant:`outline`,disabled:f,title:a(`workflows:workflowsPage.run`),"aria-label":`${a(`workflows:workflowsPage.run`)}: ${e.name}`,className:`max-[650px]:size-11 pointer-coarse:size-11`,onClick:()=>o(e),children:n===e.id?(0,X.jsx)(me,{className:`animate-spin`}):(0,X.jsx)(fe,{})}),(0,X.jsxs)(Ne,{children:[(0,X.jsx)(je,{asChild:!0,children:(0,X.jsx)(B,{size:`icon-sm`,variant:`ghost`,className:`text-content-muted max-[650px]:size-11 pointer-coarse:size-11`,"aria-label":a(`workflows:workflowsPage.moreActionsFor`,{name:e.name}),children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(Me,{align:`end`,className:`min-w-44`,children:[(0,X.jsxs)(Ae,{className:`pointer-coarse:min-h-11 max-[650px]:min-h-11`,onSelect:()=>c(e),children:[(0,X.jsx)(j,{}),a(`workflows:workflowsPage.duplicateWorkflow`)]}),(0,X.jsxs)(Ae,{className:`pointer-coarse:min-h-11 max-[650px]:min-h-11`,onSelect:()=>l(e),children:[(0,X.jsx)(M,{}),a(`workflows:workflowsPage.export`)]}),(0,X.jsx)(ke,{}),(0,X.jsxs)(Ae,{className:`pointer-coarse:min-h-11 max-[650px]:min-h-11`,variant:`destructive`,disabled:r,onSelect:()=>u(e),children:[(0,X.jsx)(xe,{}),a(`workflows:workflowsPage.delete`)]})]})]})]})},e.id)})}):(0,X.jsx)(Xe,{title:a(r?`workflows:workflowsPage.noMatchingWorkflows`:`workflows:workflowsPage.noWorkflowsYet`),description:r?void 0:a(`workflows:workflowsPage.emptyHint`)})})}function Wn({runs:e,busyId:t,language:n,t:r,onStop:i,onRetry:a,onApproval:o}){let s=[...e].sort((e,t)=>Date.parse(t.startedAt)-Date.parse(e.startedAt)),[c,l]=(0,W.useState)(s[0]?.id||``),u=s.filter(e=>e.status===`waiting_approval`).length;return(0,X.jsx)(lt,{title:r(`workflows:workflowsPage.runHistory`),count:s.length,meta:u?(0,X.jsx)(`span`,{className:`font-medium text-st-attn`,children:r(`workflows:workflowsPage.waitingApprovalCount`,{count:u})}):void 0,children:s.length?(0,X.jsx)(ct,{children:s.map(e=>{let s=c===e.id,u=Math.round((Number(e.completedNodes)||0)/Math.max(1,Number(e.totalNodes)||1)*100),d=e.workflowName||e.workflowId;return(0,X.jsx)(st,{"data-workflow-run":e.id,icon:(0,X.jsx)(Fn,{status:e.status,className:`bg-transparent`}),name:d,nameMeta:`v${e.workflowRevision||1}`,description:(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(Rn,{status:e.status,label:Bn(e.status,r)}),(0,X.jsx)(`span`,{className:`truncate tabular-nums`,children:Je(e.startedAt,n)})]}),status:(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`flex w-24 min-w-0 items-center max-[650px]:hidden`,children:e.nodes?.length?(0,X.jsx)(Ln,{nodes:e.nodes,className:`flex-1`}):(0,X.jsx)(Le,{value:e.status===`completed`?100:u,className:`h-1 flex-1`})}),(0,X.jsxs)(`span`,{className:`font-mono`,children:[Number(e.completedNodes)||0,`/`,Number(e.totalNodes)||0]}),(0,X.jsx)(`span`,{className:`font-mono`,children:zn(e.durationMs)})]}),expanded:s,onExpandedChange:t=>l(t?e.id:``),toggleLabel:r(`workflows:workflowsPage.toggleRunDetails`,{name:d}),detail:(0,X.jsxs)(`div`,{className:`workflow-run-detail flex flex-col gap-2.5`,children:[(e.summary||e.error)&&(0,X.jsxs)(`p`,{className:`workflow-run-result flex items-start gap-1.5 text-xs leading-relaxed whitespace-pre-wrap text-content-secondary`,children:[e.error&&(0,X.jsx)(ft,{status:`failed`,className:`mt-px size-3.5 text-content`}),e.error?Q(e.error):e.summary]}),!!e.nodes?.length&&(0,X.jsx)(`ul`,{className:`divide-y divide-stroke-soft overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:(e.nodes||[]).map(n=>(0,X.jsxs)(`li`,{className:`workflow-run-node grid min-h-[34px] grid-cols-[18px_minmax(0,1fr)_auto] items-center gap-2.5 px-3 py-1.5 max-[650px]:min-h-11 max-[650px]:grid-cols-[18px_minmax(0,1fr)] ${n.status}`,children:[(0,X.jsx)(Fn,{status:n.status}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,X.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,X.jsx)(`strong`,{className:`truncate text-sm font-medium text-content`,children:n.label}),(0,X.jsx)(`small`,{className:`shrink-0 text-xs text-content-muted tabular-nums`,children:r(`workflows:workflowsPage.countAttempts`,{count:n.attempts||0})})]}),(n.error||n.summary)&&(0,X.jsx)(`p`,{className:`text-xs leading-relaxed whitespace-pre-wrap text-content-muted`,children:n.error?Q(n.error):n.summary})]}),n.status===`waiting_approval`?(0,X.jsxs)(`div`,{className:`workflow-approval-actions flex gap-1.5 max-[650px]:col-span-2 max-[650px]:justify-end`,children:[(0,X.jsxs)(B,{size:`xs`,variant:`outline`,className:`max-[650px]:h-11`,disabled:t===n.id,onClick:()=>o(e,n.id,!1),children:[(0,X.jsx)(O,{"data-icon":`inline-start`}),r(`workflows:workflowsPage.reject`)]}),(0,X.jsxs)(B,{size:`xs`,className:`max-[650px]:h-11`,disabled:t===n.id,onClick:()=>o(e,n.id,!0),children:[(0,X.jsx)(w,{"data-icon":`inline-start`}),r(`workflows:workflowsPage.approve`)]})]}):(0,X.jsx)(`span`,{className:`font-mono text-xs text-content-muted tabular-nums max-[650px]:hidden`,children:n.status===`running`?`…`:zn(n.durationMs)})]},n.id))}),(0,X.jsx)(`div`,{className:`workflow-run-detail-actions flex gap-1.5 empty:hidden max-[650px]:[&>button]:h-11`,children:Vn.includes(e.status)?(0,X.jsxs)(B,{size:`sm`,variant:`outline`,onClick:()=>i(e),children:[(0,X.jsx)(be,{"data-icon":`inline-start`}),r(`workflows:workflowsPage.stop`)]}):[`failed`,`cancelled`,`interrupted`].includes(e.status)?(0,X.jsxs)(B,{size:`sm`,variant:`outline`,onClick:()=>a(e),children:[(0,X.jsx)(me,{"data-icon":`inline-start`}),r(`workflows:workflowsPage.retryRun`)]}):null})]})},e.id)})}):(0,X.jsx)(Xe,{title:r(`workflows:workflowsPage.noRunHistory`)})})}function Gn({query:e,t,onOpenTemplate:n}){let r=e.trim().toLocaleLowerCase(),i=cn.filter(e=>`${nn(e.id,t)} ${rn(e.id,t)}`.toLocaleLowerCase().includes(r));return(0,X.jsx)(lt,{title:t(`workflows:workflowsPage.templates`),count:i.length,description:t(`workflows:workflowsPage.templatesHint`),children:i.length?(0,X.jsx)(ct,{className:`workflow-template-gallery`,children:i.map(e=>{let r=e.Icon,i=nn(e.id,t);return(0,X.jsx)(st,{"data-workflow-template":e.id,icon:(0,X.jsx)(r,{}),name:i,description:rn(e.id,t),onOpen:()=>n(e.id),openLabel:t(`workflows:workflowsPage.useTemplate`,{name:i})},e.id)})}):(0,X.jsx)(Xe,{title:t(`workflows:workflowsPage.noMatchingTemplates`)})})}function Kn({data:e,t}){let n=e.runs.filter(e=>e.status===`failed`).length,r=e.runs.filter(e=>e.status===`waiting_approval`).length,i=e.runs.filter(e=>e.status===`completed`),a=i.length?i.reduce((e,t)=>e+(t.durationMs||0),0)/i.length:0,o=`inline-flex items-baseline gap-1.5 whitespace-nowrap`,s=`text-sm font-medium text-content tabular-nums`;return(0,X.jsxs)(`div`,{className:`workflow-operations-strip flex min-w-0 flex-wrap items-center gap-x-5 gap-y-1 text-xs text-content-muted max-[650px]:w-full max-[650px]:justify-between max-[650px]:gap-x-3`,children:[(0,X.jsxs)(`span`,{className:o,children:[e.limits.running>0&&(0,X.jsx)(ft,{status:`run`,className:`size-3 self-center text-st-run`}),(0,X.jsx)(`strong`,{className:s,children:e.limits.running}),t(`workflows:workflowsPage.running`)]}),(0,X.jsxs)(`span`,{className:z(o,r>0&&`text-st-attn`),children:[(0,X.jsx)(`strong`,{className:z(s,r>0&&`text-st-attn`),children:r}),t(`workflows:workflowsPage.waitingApproval`)]}),(0,X.jsxs)(`span`,{className:o,children:[(0,X.jsx)(`strong`,{className:s,children:n}),t(`workflows:workflowsPage.failed`)]}),(0,X.jsxs)(`span`,{className:o,children:[(0,X.jsx)(`strong`,{className:z(s,`font-mono`),children:zn(a)}),t(`workflows:workflowsPage.averageDuration`)]})]})}function qn({value:e=``,onValueChange:t,files:n=[],onFilesSelected:r,onRemoveFile:i,accept:a=`media`,allowFiles:o=!0,allowText:s=!0,multiple:c=!1,disabled:l=!1,label:u,placeholder:d,attachmentLabel:f,removeLabel:p,children:m,className:h,maxLength:g}){let _=(0,W.useId)(),v=(0,W.useRef)(null),y=a===`image`?`image/png,image/jpeg,image/webp`:a===`video`?`video/mp4,video/webm`:`image/png,image/jpeg,image/webp,video/mp4,video/webm`;return(0,X.jsxs)(`div`,{className:z(`flex min-w-0 flex-col gap-2`,h),children:[(0,X.jsx)(L,{htmlFor:s?`${_}-text`:`${_}-picker`,children:u}),(0,X.jsxs)(`div`,{className:`min-w-0 rounded-md border border-control bg-panel transition-colors duration-[var(--d-fast)] focus-within:border-focus focus-within:ring-3 focus-within:ring-focus-ring`,onDragOver:e=>{o&&e.preventDefault()},onDrop:e=>{o&&(e.preventDefault(),!l&&e.dataTransfer.files.length&&r?.(Array.from(e.dataTransfer.files)))},children:[s&&(0,X.jsx)(gt,{id:`${_}-text`,value:e,onChange:e=>t?.(e.target.value),placeholder:d,disabled:l,maxLength:g,className:`min-h-28 resize-y border-0 bg-transparent shadow-none focus-visible:ring-0`}),n.length>0&&(0,X.jsx)(`ul`,{className:z(`grid min-w-0 gap-2 p-3`,n.length>1&&`sm:grid-cols-2`),children:n.map(e=>(0,X.jsxs)(`li`,{className:`relative min-w-0 rounded-md border border-stroke bg-surface-subtle p-2`,children:[e.url&&e.mimeType.startsWith(`image/`)?(0,X.jsx)(`img`,{src:e.url,alt:e.name,className:`h-32 w-full rounded object-contain`}):e.url&&e.mimeType.startsWith(`video/`)?(0,X.jsx)(`video`,{src:e.url,controls:!0,preload:`metadata`,className:`h-32 w-full rounded object-contain`,"aria-label":e.name}):(0,X.jsx)(`div`,{className:`flex h-12 items-center justify-center text-muted-foreground`,children:e.mimeType.startsWith(`video/`)?(0,X.jsx)(oe,{}):(0,X.jsx)(k,{})}),(0,X.jsx)(`p`,{className:`mt-2 truncate pr-8 text-xs`,title:e.name,children:e.name}),i&&(0,X.jsx)(B,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:l,className:`absolute right-1 bottom-1`,"aria-label":`${p} ${e.name}`,onClick:()=>i(e.id),children:(0,X.jsx)(we,{className:`size-3.5`})})]},e.id))}),o&&(0,X.jsxs)(`div`,{className:`p-2`,children:[(0,X.jsx)(`input`,{id:`${_}-picker`,ref:v,className:`sr-only`,type:`file`,accept:y,multiple:c,disabled:l,"aria-label":f,onChange:e=>{let t=Array.from(e.currentTarget.files??[]);e.currentTarget.value=``,t.length&&r?.(t)}}),(0,X.jsxs)(B,{type:`button`,variant:`ghost`,size:`sm`,disabled:l,onClick:()=>v.current?.click(),children:[(0,X.jsx)(ue,{className:`size-4`}),f]})]})]}),m]})}function Jn(e){if(!e||typeof e!=`object`||!(`models`in e)||!Array.isArray(e.models))throw m();return e.models.map(e=>{if(!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||!(`name`in e)||typeof e.name!=`string`||!(`providerId`in e)||typeof e.providerId!=`string`||!(`providerName`in e)||typeof e.providerName!=`string`||!e.id.startsWith(`${e.providerId}/`))throw m();return{id:e.id,name:e.name,providerId:e.providerId,providerName:e.providerName}})}function Yn(e){if(!e||typeof e!=`object`||!(`started`in e)||e.started!==!0||!(`run`in e)||!e.run||typeof e.run!=`object`||!(`id`in e.run)||typeof e.run.id!=`string`||!(`workflowId`in e.run)||typeof e.run.workflowId!=`string`)throw m();return{started:!0,run:{id:e.run.id,workflowId:e.run.workflowId}}}var Xn={runNode:(e,t,n,r)=>f(`/api/workflows/${encodeURIComponent(e)}/nodes/${encodeURIComponent(t)}/run`,{method:`POST`,data:{sourceRunId:n},signal:r,parse:Yn}),models:e=>f(`/api/workflow-image-models`,{signal:e,parse:Jn})};Object.freeze([{id:`background`,name:`U²-Net small + ONNX Runtime Web`,version:`ort-1.20.1_u2netp-v0.0.0`,licenses:[{name:`ONNX Runtime — MIT`,url:`https://github.com/microsoft/onnxruntime/blob/v1.20.1/LICENSE`},{name:`U²-Net — Apache-2.0`,url:`https://github.com/xuebinqin/U-2-Net/blob/ac7e1c817ecab7c7dff5ce6b1abba61cd213ff29/LICENSE`}],files:[{name:`ort.wasm.min.js`,url:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.20.1/dist/ort.wasm.min.js`,bytes:49026,sha256:`e66568724f8848e57cc2a56e4bea3a5b86ce3ff81b2da11eac8ed7ab02b27bd4`,mimeType:`text/javascript`},{name:`ort-wasm-simd-threaded.mjs`,url:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.20.1/dist/ort-wasm-simd-threaded.mjs`,bytes:24618,sha256:`745eb7c0ce6f18a6aa521971b2877babc7ffb27eecb58ab3bc6e5ef4692672e8`,mimeType:`text/javascript`},{name:`ort-wasm-simd-threaded.wasm`,url:`https://cdn.jsdelivr.net/npm/onnxruntime-web@1.20.1/dist/ort-wasm-simd-threaded.wasm`,bytes:11246032,sha256:`207d02be4591c156b0a98f024f3d58005b5b04c92274d759fb390338c63559ea`,mimeType:`application/wasm`},{name:`u2netp.onnx`,url:`https://gh-proxy.com/https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2netp.onnx`,fallbackUrls:[`https://ghfast.top/https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2netp.onnx`],bytes:4574861,sha256:`309c8469258dda742793dce0ebea8e6dd393174f89934733ecc8b14c76f4ddd8`,mimeType:`application/octet-stream`},{name:`LICENSE-ORT.txt`,url:`https://cdn.jsdelivr.net/gh/microsoft/onnxruntime@v1.20.1/LICENSE`,bytes:1073,sha256:`2f07c72751aed99790b8a4869cf2311df85a860b22ded05fa22803587a48922c`,mimeType:`text/plain; charset=utf-8`},{name:`LICENSE-U2NET.txt`,url:`https://cdn.jsdelivr.net/gh/xuebinqin/U-2-Net@ac7e1c817ecab7c7dff5ce6b1abba61cd213ff29/LICENSE`,bytes:11357,sha256:`c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4`,mimeType:`text/plain; charset=utf-8`}]},{id:`inpaint`,name:`OpenCV.js inpainting`,version:`5.0.0-release.1`,licenses:[{name:`OpenCV — Apache-2.0`,url:`https://github.com/opencv/opencv/blob/5.0.0/LICENSE`},{name:`TechStark OpenCV.js — Apache-2.0`,url:`https://github.com/TechStark/opencv-js/blob/v5.0.0-release.1/LICENSE`}],files:[{name:`opencv.js`,url:`https://cdn.jsdelivr.net/npm/@techstark/opencv-js@5.0.0-release.1/dist/opencv.js`,bytes:13298869,sha256:`b873c8211421da7b9bf41ae157a923f05a46a0b8d3e5904c44c6f3ad6d39a1bd`,mimeType:`text/javascript`},{name:`LICENSE-OpenCV.txt`,url:`https://cdn.jsdelivr.net/gh/opencv/opencv@5.0.0/LICENSE`,bytes:11358,sha256:`cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30`,mimeType:`text/plain; charset=utf-8`},{name:`LICENSE-OpenCV-JS.txt`,url:`https://cdn.jsdelivr.net/gh/TechStark/opencv-js@v5.0.0-release.1/LICENSE`,bytes:11357,sha256:`c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4`,mimeType:`text/plain; charset=utf-8`}]}]);function Zn(e){let t=()=>Error(`Invalid sprite engine catalog`);if(!e||typeof e!=`object`||!(`engines`in e)||!Array.isArray(e.engines)||e.engines.length>2)throw t();let n=e.engines.map(e=>{if(!e||typeof e!=`object`)throw t();let n=e.id,r=e.status;if(n!==`background`&&n!==`inpaint`||![`missing`,`downloading`,`ready`,`failed`].includes(r))throw t();for(let n of[`name`,`version`,`error`])if(typeof e[n]!=`string`||e[n].length>500)throw t();if(e.file!==void 0&&(typeof e.file!=`string`||!/^[a-zA-Z0-9._-]{0,160}$/.test(e.file)))throw t();for(let n of[`bytes`,`received`,`total`])if(!Number.isSafeInteger(e[n])||e[n]<0)throw t();if(e.received>e.total)throw t();return{id:n,name:e.name,version:e.version,bytes:e.bytes,status:r,received:e.received,total:e.total,error:e.error,file:e.file??``}});if(new Set(n.map(e=>e.id)).size!==n.length)throw t();return{engines:n}}var Qn=[`workflows`,`sprite-engines`];function $n(e){try{return Zn(e)}catch{throw m()}}var er={catalog:e=>f(`/api/sprite-engines`,{signal:e,parse:$n}),download:(e,t)=>f(`/api/sprite-engines/${e}/download`,{method:`POST`,data:{},signal:t,parse:$n}),cancel:(e,t)=>f(`/api/sprite-engines/${e}/cancel`,{method:`POST`,data:{},signal:t,parse:$n}),remove:(e,t)=>f(`/api/sprite-engines/${e}`,{method:`DELETE`,signal:t,parse:$n})};function $({label:e,value:t,min:n,max:r,step:i=1,onChange:a}){return(0,X.jsxs)(H,{variant:`control`,children:[e,(0,X.jsx)(V,{type:`number`,value:t,min:n,max:r,step:i,onChange:e=>{if(!e.target.value)return;let t=e.target.valueAsNumber;Number.isFinite(t)&&a(Math.max(n,Math.min(r,t)))}})]})}function tr({t:e,id:t=`background`}){let n=u(),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),s=(0,W.useRef)(null);(0,W.useEffect)(()=>()=>s.current?.abort(),[]);let c=d({queryKey:Qn,queryFn:({signal:e})=>er.catalog(e),refetchInterval:e=>e.state.data?.engines.some(e=>e.status===`downloading`)?1e3:!1}),l=c.data?.engines.find(e=>e.id===t),f=async()=>{if(s.current)return;let e=new AbortController;s.current=e,o(!0),i(!1);try{n.setQueryData(Qn,await er.download(t,e.signal))}catch{e.signal.aborted||i(!0)}finally{e.signal.aborted||o(!1),s.current===e&&(s.current=null)}};return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3 text-xs`,children:[(0,X.jsx)(`p`,{children:e(`workflows:imageNodes.modelHint`)}),(0,X.jsx)(`p`,{children:l?.status===`ready`?e(`workflows:imageNodes.engineReady`):l?.status===`downloading`?e(`workflows:imageNodes.engineDownloading`,{percent:Math.round(l.total?100*l.received/l.total:0)}):e(`workflows:imageNodes.engineMissing`)}),(r||c.isError||l?.status===`failed`)&&(0,X.jsx)(`p`,{role:`alert`,children:e(`workflows:imageNodes.engineFailed`)}),l?.status!==`ready`&&(0,X.jsxs)(B,{size:`sm`,variant:`outline`,disabled:a||l?.status===`downloading`,onClick:()=>void f(),children:[a||l?.status===`downloading`?(0,X.jsx)(re,{className:`animate-spin`}):(0,X.jsx)(M,{}),e(`workflows:imageNodes.download`)]})]})}function nr({node:e,inputs:t,t:n,onChange:r}){let i=Ht(e.image),a=e=>r({image:{...i,...e}}),o=d({queryKey:[`workflows`,`image-models`],queryFn:({signal:e})=>Xn.models(e),enabled:e.kind===`media-generate`}),[s,c]=(0,W.useState)(0);(0,W.useEffect)(()=>c(0),[e.id]);let l=i.transforms.find(e=>e.index===s)??{index:s,x:0,y:0,rotation:0,scale:1,opacity:1,durationMs:i.durationMs,enabled:!0},u=e=>a({transforms:[...i.transforms.filter(e=>e.index!==s),{...l,...e}]}),f=i.frameOrder,p=(e,t)=>{let n=[...f],r=e+t;r<0||r>=n.length||([n[e],n[r]]=[n[r],n[e]],a({frameOrder:n}))};return(0,X.jsxs)(`div`,{className:`my-3 space-y-3 border-y py-3`,children:[e.kind===`media-input`&&(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.inputField`),(0,X.jsxs)(U,{value:i.inputName,onChange:e=>a({inputName:e.target.value}),children:[!t.some(e=>e.type===`image`&&e.name===i.inputName)&&(0,X.jsx)(`option`,{value:i.inputName,children:n(`workflows:imageNodes.chooseInput`)}),t.filter(e=>e.type===`image`).map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.label},e.id))]}),(0,X.jsx)(`small`,{children:n(`workflows:imageNodes.inputHint`)})]}),e.kind===`media-generate`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.imageModel`),(0,X.jsxs)(U,{value:e.model?`${e.model.provider}/${e.model.model}`:``,onChange:e=>{let t=o.data?.find(t=>t.id===e.target.value);r({model:t?{provider:t.providerId,model:t.id.slice(t.providerId.length+1)}:null})},children:[(0,X.jsx)(`option`,{value:``,children:n(`workflows:imageNodes.defaultImageModel`)}),o.data?.map(e=>(0,X.jsxs)(`option`,{value:e.id,children:[e.providerName,` / `,e.name]},e.id))]}),o.isError&&(0,X.jsx)(`small`,{role:`alert`,children:n(`workflows:imageNodes.modelsFailed`)})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.action`),(0,X.jsx)(V,{value:i.action,maxLength:160,onChange:e=>a({action:e.target.value})})]}),(0,X.jsx)(qn,{label:n(`workflows:imageNodes.prompt`),value:e.prompt,onValueChange:e=>r({prompt:e}),allowFiles:!1,maxLength:16e3,attachmentLabel:n(`workflows:inputs.chooseImage`),removeLabel:n(`workflows:inputs.removeMedia`)}),(0,X.jsx)($,{label:n(`workflows:imageNodes.frameCount`),value:i.frameCount,min:1,max:16,onChange:e=>a({frameCount:e})}),(0,X.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,X.jsx)(`legend`,{className:`text-sm`,children:n(`workflows:imageNodes.directions`)}),(0,X.jsx)(`div`,{className:`grid grid-cols-4 gap-1`,children:Vt.map(e=>(0,X.jsx)(B,{size:`sm`,variant:i.directions.includes(e)?`secondary`:`outline`,"aria-pressed":i.directions.includes(e),disabled:i.directions.length===1&&i.directions[0]===e,onClick:()=>a({directions:i.directions.includes(e)?i.directions.filter(t=>t!==e):Vt.filter(t=>i.directions.includes(t)||t===e)}),children:e},e))})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.generateHint`,{count:i.directions.length})})]}),e.kind===`media-background`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.method`),(0,X.jsxs)(U,{value:i.method,onChange:e=>a({method:e.target.value===`model`?`model`:`color`}),children:[(0,X.jsx)(`option`,{value:`color`,children:n(`workflows:imageNodes.colorKey`)}),(0,X.jsx)(`option`,{value:`model`,children:n(`workflows:imageNodes.localModel`)})]})]}),i.method===`model`?(0,X.jsx)(tr,{t:n}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-sm`,children:n(`workflows:imageNodes.colors`)}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.colorsHint`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.colors.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`input`,{className:`h-8 w-10 cursor-pointer rounded border`,type:`color`,value:e,"aria-label":n(`workflows:imageNodes.colorAt`,{index:t+1}),onChange:e=>a({colors:i.colors.map((n,r)=>r===t?e.target.value:n)})}),(0,X.jsx)(B,{size:`icon-xs`,variant:`ghost`,"aria-label":n(`workflows:imageNodes.removeColor`),onClick:()=>a({colors:i.colors.filter((e,n)=>n!==t)}),children:(0,X.jsx)(xe,{})})]},t))}),(0,X.jsxs)(B,{size:`sm`,variant:`outline`,disabled:i.colors.length>=8,onClick:()=>a({colors:[...i.colors,`#00ff00`]}),children:[(0,X.jsx)(pe,{}),n(`workflows:imageNodes.addColor`)]})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsx)($,{label:n(`workflows:imageNodes.tolerance`),value:i.tolerance,min:0,max:255,onChange:e=>a({tolerance:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.softness`),value:i.softness,min:0,max:64,onChange:e=>a({softness:e})})]}),(0,X.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-sm`,children:[n(`workflows:imageNodes.edgeConnected`),(0,X.jsx)(R,{checked:i.edgeConnected,onCheckedChange:e=>a({edgeConnected:e})})]})]})]}),e.kind===`media-inpaint`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.regionHint`)}),(0,X.jsx)(tr,{t:n,id:`inpaint`}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsx)($,{label:n(`workflows:imageNodes.regionX`),value:i.region.x,min:0,max:99,onChange:e=>a({region:{...i.region,x:e}})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.regionY`),value:i.region.y,min:0,max:99,onChange:e=>a({region:{...i.region,y:e}})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.regionWidth`),value:i.region.width,min:1,max:100,onChange:e=>a({region:{...i.region,width:e}})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.regionHeight`),value:i.region.height,min:1,max:100,onChange:e=>a({region:{...i.region,height:e}})})]})]}),e.kind===`media-frames`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.gridHint`)}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsx)($,{label:n(`workflows:imageNodes.columns`),value:i.columns,min:1,max:16,onChange:e=>a({columns:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.rows`),value:i.rows,min:1,max:16,onChange:e=>a({rows:e})})]}),(0,X.jsx)($,{label:n(`workflows:imageNodes.duration`),value:i.durationMs,min:16,max:1e4,onChange:e=>a({durationMs:e})})]}),e.kind===`media-transform`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`label`,{className:`flex items-center justify-between gap-3 text-sm`,children:[n(`workflows:imageNodes.trim`),(0,X.jsx)(R,{checked:i.trim,onCheckedChange:e=>a({trim:e})})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.align`),(0,X.jsxs)(U,{value:i.align,onChange:e=>a({align:e.target.value===`center`?`center`:e.target.value===`none`?`none`:`bottom-center`}),children:[(0,X.jsx)(`option`,{value:`bottom-center`,children:n(`workflows:imageNodes.bottomCenter`)}),(0,X.jsx)(`option`,{value:`center`,children:n(`workflows:imageNodes.center`)}),(0,X.jsx)(`option`,{value:`none`,children:n(`workflows:imageNodes.noAlign`)})]})]}),(0,X.jsx)($,{label:n(`workflows:imageNodes.maxFrameSize`),value:i.maxFrameSize,min:16,max:1024,onChange:e=>a({maxFrameSize:Math.round(e)})}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.maxFrameSizeHint`,{size:i.maxFrameSize})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.padding`),value:i.padding,min:0,max:64,onChange:e=>a({padding:e})}),(0,X.jsxs)(`details`,{className:`rounded-md border p-3`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer text-sm`,children:n(`workflows:imageNodes.frameEdits`)}),(0,X.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,X.jsx)($,{label:n(`workflows:imageNodes.frameNumber`),value:s+1,min:1,max:512,onChange:e=>c(Math.round(e)-1)}),(0,X.jsxs)(`label`,{className:`flex justify-between text-sm`,children:[n(`workflows:imageNodes.frameEnabled`),(0,X.jsx)(R,{checked:l.enabled,onCheckedChange:e=>u({enabled:e})})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,X.jsx)($,{label:`X`,value:l.x,min:-4096,max:4096,onChange:e=>u({x:e})}),(0,X.jsx)($,{label:`Y`,value:l.y,min:-4096,max:4096,onChange:e=>u({y:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.rotation`),value:l.rotation,min:-360,max:360,onChange:e=>u({rotation:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.scale`),value:l.scale,min:.05,max:8,step:.05,onChange:e=>u({scale:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.opacity`),value:l.opacity,min:0,max:1,step:.05,onChange:e=>u({opacity:e})}),(0,X.jsx)($,{label:n(`workflows:imageNodes.duration`),value:l.durationMs,min:16,max:1e4,onChange:e=>u({durationMs:e})})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.orderHint`)}),(0,X.jsx)(B,{size:`sm`,variant:`outline`,disabled:f.includes(s),onClick:()=>a({frameOrder:[...f,s]}),children:n(`workflows:imageNodes.addToOrder`)}),f.map((e,t)=>(0,X.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`mr-auto text-xs`,children:n(`workflows:imageNodes.frameAt`,{index:e+1})}),(0,X.jsx)(B,{size:`icon-xs`,variant:`ghost`,"aria-label":n(`workflows:imageNodes.earlier`),disabled:t===0,onClick:()=>p(t,-1),children:(0,X.jsx)(b,{})}),(0,X.jsx)(B,{size:`icon-xs`,variant:`ghost`,"aria-label":n(`workflows:imageNodes.later`),disabled:t===f.length-1,onClick:()=>p(t,1),children:(0,X.jsx)(y,{})}),(0,X.jsx)(B,{size:`icon-xs`,variant:`ghost`,"aria-label":n(`workflows:imageNodes.resetOrder`),onClick:()=>a({frameOrder:f.filter(t=>t!==e)}),children:(0,X.jsx)(xe,{})})]},e))]})]})]}),e.kind===`media-preview`&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:imageNodes.previewHint`)}),e.kind===`media-export`&&(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:imageNodes.filename`),(0,X.jsx)(V,{value:i.filename,maxLength:100,onChange:e=>a({filename:e.target.value})}),(0,X.jsx)(`small`,{children:n(`workflows:imageNodes.exportHint`)})]})]})}var rr={upload:(e,t)=>f(`/api/workflow-media?name=${encodeURIComponent(e.name)}`,{method:`POST`,data:e,headers:{"Content-Type":e.type},signal:t,timeout:12e4,parse:e=>{try{return Lt(e)}catch{throw m()}}}),preview:(e,t)=>p(`/api/workflow-media/${encodeURIComponent(e)}/content`,{signal:t})};function ir(e){try{return Ut(e)}catch{return null}}function ar(e){let[t,n]=(0,W.useState)({id:``,image:null,error:!1}),r=e?.media.id;return(0,W.useEffect)(()=>{if(n({id:r??``,image:null,error:!1}),!r)return;let e=new AbortController,t=``,i=null;return rr.preview(r,e.signal).then(a=>{if(e.signal.aborted)return;t=URL.createObjectURL(a),i=new Image;let o=i;i.onload=()=>{e.signal.aborted||n({id:r,image:o,error:!1})},i.onerror=()=>{e.signal.aborted||n({id:r,image:null,error:!0})},i.src=t}).catch(()=>{e.signal.aborted||n({id:r,image:null,error:!0})}),()=>{e.abort(),i&&(i.onload=null,i.onerror=null,i.src=``),t&&URL.revokeObjectURL(t)}},[r]),t.id===r?t:{id:r??``,image:null,error:!1}}function or(e,t){return t(e===`workflow_image_source_stale`?`workflows:imageNodes.sourceStale`:e===`workflow_image_source_required`?`workflows:imageNodes.sourceRequired`:e===`workflow_image_engine_missing`?`workflows:imageNodes.engineMissing`:e===`workflow_image_decode_failed`?`workflows:imageNodes.decodeFailed`:e===`workflow_image_generation_failed`?`workflows:imageNodes.generationFailed`:e===`workflow_image_too_large`?`workflows:imageNodes.tooLarge`:e===`workflow_image_cancelled`?`workflows:imageNodes.cancelled`:e===`workflow_image_timeout`?`workflows:imageNodes.timeout`:`workflows:imageNodes.invalidOutput`)}function sr({value:e,previousValue:t,error:n,t:r}){let i=(0,W.useMemo)(()=>ir(e),[e]),a=(0,W.useMemo)(()=>ir(t),[t]),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(``),[u,d]=(0,W.useState)(0),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(!1),[g,_]=(0,W.useState)(!1),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(!1),S=(0,W.useRef)(null),C=(0,W.useRef)(null),w=[...new Set(i?.frames.map(e=>e.action).filter(Boolean)??[])],T=[...new Set(i?.frames.map(e=>e.direction).filter(Boolean)??[])],D=w.includes(o)?o:w[0]??``,O=T.includes(c)?c:T[0]??``,k=(0,W.useMemo)(()=>i?.frames.filter(e=>(!D||e.action===D)&&(!O||e.direction===O))??[],[i,D,O]),A=Math.min(u,Math.max(0,k.length-1)),j=a?.frames.filter(e=>e.action===k[A]?.action&&e.direction===k[A]?.direction),N=j?.[A]??j?.[0]??a?.frames[0],P=ar(g?N:k[A]),F=ar(m&&!g?k[(A+k.length-1)%k.length]:void 0),te=ar(m&&!g?k[(A+1)%k.length]:void 0);(0,W.useEffect)(()=>{d(0),p(!1),_(!1)},[D,O,e]),(0,W.useEffect)(()=>()=>S.current?.abort(),[]),(0,W.useEffect)(()=>{if(!f||k.length<2)return;let e=window.setTimeout(()=>{document.hidden||d((A+1)%k.length)},k[A]?.durationMs??125),t=()=>{document.hidden&&p(!1)};return document.addEventListener(`visibilitychange`,t),()=>{window.clearTimeout(e),document.removeEventListener(`visibilitychange`,t)}},[f,k,A]),(0,W.useEffect)(()=>{let e=C.current?.getContext(`2d`);if(!e)return;e.clearRect(0,0,512,384);let t=[F.image,P.image,te.image].filter(e=>!!e),n=Math.min(1,512/Math.max(1,...t.map(e=>e.naturalWidth)),384/Math.max(1,...t.map(e=>e.naturalHeight)))*.9,r=(t,r)=>{if(!t)return;e.save(),e.imageSmoothingEnabled=!1,e.globalAlpha=r;let i=t.naturalWidth*n,a=t.naturalHeight*n;e.drawImage(t,(512-i)/2,384*.95-a,i,a),e.restore()};r(F.image,.2),r(te.image,.15),r(P.image,1)},[P.image,F.image,te.image]);let ne=async e=>{if(!i||S.current)return;let t=new AbortController;S.current=t,x(!0),y(!1);let n=``;try{let r=e===`atlas`?i.atlas?.media:k[A]?.media,a=e===`json`?new Blob([JSON.stringify(i.atlas??i,null,2)],{type:`application/json`}):r?await rr.preview(r.id,t.signal):null;if(!a||t.signal.aborted)return;n=URL.createObjectURL(a);let o=document.createElement(`a`);o.href=n,o.download=e===`json`?`animation.frames.json`:(r?.name??`animation.png`).replace(/[\\/:*?"<>|\p{Cc}]/gu,`_`),o.click()}catch{t.signal.aborted||y(!0)}finally{n&&URL.revokeObjectURL(n),t.signal.aborted||x(!1),S.current===t&&(S.current=null)}};return!i&&!n?(0,X.jsx)(`p`,{className:`my-3 text-xs text-muted-foreground`,children:r(`workflows:imageNodes.noResult`)}):(0,X.jsxs)(`section`,{className:`my-3 space-y-3 rounded-md border p-3`,"aria-label":r(`workflows:imageNodes.result`),children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:r(`workflows:imageNodes.result`)}),n&&(0,X.jsx)(`p`,{role:`alert`,className:`text-xs text-muted-foreground`,children:or(n,r)}),k.length>0&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[w.length>0&&(0,X.jsx)(U,{"aria-label":r(`workflows:imageNodes.action`),value:D,onChange:e=>s(e.target.value),children:w.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))}),T.length>0&&(0,X.jsx)(U,{"aria-label":r(`workflows:imageNodes.directions`),value:O,onChange:e=>l(e.target.value),children:T.map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]}),(0,X.jsxs)(`div`,{className:`relative overflow-hidden rounded-md border bg-[repeating-conic-gradient(var(--surface-active)_0%_25%,var(--surface-muted)_0%_50%)] bg-size-[16px_16px]`,children:[(0,X.jsx)(`canvas`,{width:512,height:384,ref:C,className:`w-full`,role:`img`,"aria-label":r(`workflows:imageNodes.frameAt`,{index:A+1})}),!P.image&&!P.error&&(0,X.jsx)(re,{className:`absolute top-1/2 left-1/2 size-5 animate-spin`})]}),P.error&&(0,X.jsx)(`p`,{role:`alert`,className:`text-xs`,children:r(`workflows:inputs.previewFailed`)}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-1`,children:[(0,X.jsx)(B,{size:`icon-sm`,variant:`outline`,"aria-label":r(`workflows:imageNodes.previousFrame`),disabled:k.length<2,onClick:()=>{p(!1),d((A+k.length-1)%k.length)},children:(0,X.jsx)(E,{})}),(0,X.jsx)(B,{size:`icon-sm`,variant:`outline`,"aria-label":r(f?`workflows:imageNodes.pause`:`workflows:imageNodes.play`),disabled:k.length<2,onClick:()=>p(!f),children:f?(0,X.jsx)(Nt,{}):(0,X.jsx)(fe,{})}),(0,X.jsx)(B,{size:`icon-sm`,variant:`outline`,"aria-label":r(`workflows:imageNodes.nextFrame`),disabled:k.length<2,onClick:()=>{p(!1),d((A+1)%k.length)},children:(0,X.jsx)(ee,{})}),(0,X.jsxs)(`span`,{className:`px-1 text-xs tabular-nums`,children:[A+1,` / `,k.length]})]}),(0,X.jsx)(`input`,{className:`w-full`,type:`range`,min:0,max:Math.max(0,k.length-1),value:A,"aria-label":r(`workflows:imageNodes.frameNumber`),onChange:e=>{p(!1),d(Number(e.target.value))}}),(0,X.jsxs)(`label`,{className:`flex items-center justify-between text-xs`,children:[r(`workflows:imageNodes.onionSkin`),(0,X.jsx)(R,{checked:m,onCheckedChange:h})]}),N&&(0,X.jsxs)(`label`,{className:`flex items-center justify-between text-xs`,children:[r(`workflows:imageNodes.showInput`),(0,X.jsx)(R,{checked:g,onCheckedChange:_})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsxs)(B,{size:`sm`,variant:`outline`,disabled:b,onClick:()=>void ne(`frame`),children:[(0,X.jsx)(M,{}),r(`workflows:imageNodes.saveFrame`)]}),i?.atlas&&(0,X.jsxs)(B,{size:`sm`,variant:`outline`,disabled:b,onClick:()=>void ne(`atlas`),children:[(0,X.jsx)(M,{}),`PNG`]}),(0,X.jsxs)(B,{size:`sm`,variant:`outline`,disabled:b,onClick:()=>void ne(`json`),children:[(0,X.jsx)(M,{}),`JSON`]})]})]}),v&&(0,X.jsx)(`p`,{role:`alert`,className:`text-xs`,children:r(`workflows:imageNodes.downloadFailed`)})]})}function cr(e){return e?e.status===`completed`?100:Math.round((Number(e.completedNodes)||0)/Math.max(1,Number(e.totalNodes)||1)*100):0}function lr(e){let t=Math.max(0,Math.round((Number(e)||0)/1e3));return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function ur({run:e,t}){let n=e.status===`waiting_approval`,r=cr(e);return(0,X.jsxs)(`div`,{role:`status`,className:z(`relative flex min-h-9 shrink-0 items-center gap-2 overflow-hidden border-b border-stroke-soft px-3 text-sm max-[650px]:min-h-11`,n?`bg-warning-soft`:`bg-star-soft`),children:[n?(0,X.jsx)(jt,{className:`size-4 shrink-0 text-warning-strong`,"aria-hidden":`true`}):(0,X.jsx)(Ve,{}),(0,X.jsx)(`strong`,{className:z(`shrink-0 font-medium`,n?`text-warning-strong`:`text-accent-fg`),children:t(n?`workflows:workflowsPage.waitingApproval`:`workflows:workflowsPage.workflowRunning`)}),(0,X.jsx)(`span`,{className:`min-w-0 truncate text-content-secondary tabular-nums`,children:t(`workflows:workflowsPage.runningNodeCompletedTotalCompleted`,{node:e.currentNodeLabel||t(`workflows:workflowsPage.preparing`),completed:e.completedNodes,total:e.totalNodes})}),(0,X.jsx)(`span`,{className:`ml-auto shrink-0 font-mono text-xs text-content-muted tabular-nums`,children:lr(e.durationMs)}),(0,X.jsx)(`i`,{"aria-hidden":`true`,className:`absolute inset-x-0 bottom-0 h-0.5 origin-left bg-star transition-transform duration-(--d-base) ease-precise`,style:{transform:`scaleX(${r/100})`}})]})}function dr({run:e,language:t,t:n}){return e?(0,X.jsxs)(`div`,{className:`activity-row flex min-w-0 items-start gap-2.5 text-sm ${e.status}`,children:[(0,X.jsx)(Fn,{status:e.status,className:`mt-px`}),(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,X.jsx)(`strong`,{className:z(`font-medium break-words`,e.status===`failed`?`text-danger`:`text-content`),children:e.status===`completed`?e.summary||n(`workflows:workflowsPage.workflowCompleted`):e.status===`waiting_approval`?n(`workflows:workflowsPage.waitingApproval`):e.status===`running`?e.currentNodeLabel||n(`workflows:workflowsPage.running`):e.error?Q(e.error):n(`workflows:workflowsPage.workflowFailed`)}),(0,X.jsxs)(`small`,{className:`text-xs text-content-muted tabular-nums`,children:[Je(e.startedAt,t),` · `,lr(e.durationMs)]})]})]}):(0,X.jsx)(`p`,{className:`text-xs text-content-muted`,children:n(`workflows:workflowsPage.noRunHistory`)})}function fr({input:e,value:t,onChange:n,label:r,disabled:i=!1,onBusyChange:a}){let{t:o}=l(),[s,c]=(0,W.useState)({id:``,url:``}),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(``),m=(0,W.useRef)(null),h=(0,W.useRef)(!0),g=(0,W.useRef)(a);g.current=a;let _=(0,W.useRef)({onChange:n,id:e.id,type:e.type});_.current={onChange:n,id:e.id,type:e.type};let v=e.type,y=(()=>{try{return Lt(t)}catch{return null}})(),b=y?.id;(0,W.useEffect)(()=>(h.current=!0,d(!1),p(``),()=>{h.current=!1,m.current?.abort(),m.current=null,g.current?.(e.id,!1)}),[e.id,v]),(0,W.useEffect)(()=>{if(c({id:``,url:``}),!b)return;let e=new AbortController,t=``;return rr.preview(b,e.signal).then(n=>{e.signal.aborted||(t=URL.createObjectURL(n),c({id:b,url:t}))}).catch(()=>{e.signal.aborted||p(o(`workflows:inputs.previewFailed`))}),()=>{e.abort(),t&&URL.revokeObjectURL(t)}},[b,o]);let x=async(t,n)=>{if(!t.length||i||m.current||n!==`image`&&n!==`video`)return;if(t.length!==1){p(o(`workflows:inputs.oneFile`));return}let r=t[0];if(!(n===`image`?[`image/png`,`image/jpeg`,`image/webp`]:[`video/mp4`,`video/webm`]).includes(r.type)){p(o(`workflows:inputs.mediaType`));return}if(r.size>(n===`image`?8:64)*1024*1024){p(o(n===`image`?`workflows:inputs.imageLimit`:`workflows:inputs.videoLimit`));return}let a=new AbortController;m.current=a,d(!0),g.current?.(e.id,!0),p(``);try{let t=await rr.upload(r,a.signal);h.current&&!a.signal.aborted&&m.current===a&&_.current.id===e.id&&_.current.type===n&&_.current.onChange(t)}catch{h.current&&!a.signal.aborted&&p(o(`workflows:inputs.uploadFailed`))}finally{m.current===a&&(m.current=null,h.current&&(d(!1),g.current?.(e.id,!1)))}};return(0,X.jsxs)(qn,{label:r,value:typeof t==`string`?t:``,onValueChange:n,files:y?[{...y,url:s.id===y.id?s.url:void 0}]:[],onFilesSelected:e=>void x(e,v),onRemoveFile:()=>n(``),accept:v===`image`?`image`:`video`,allowFiles:v===`image`||v===`video`,allowText:v!==`image`&&v!==`video`,disabled:i||u,maxLength:16e3,attachmentLabel:o(v===`image`?`workflows:inputs.chooseImage`:`workflows:inputs.chooseVideo`),removeLabel:o(`workflows:inputs.removeMedia`),children:[u&&(0,X.jsxs)(`p`,{role:`status`,className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,X.jsx)(re,{className:`size-3 animate-spin`}),o(`workflows:inputs.uploading`)]}),f&&(0,X.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:f})]})}function pr(e){return e===`number`||e===`boolean`||e===`text`||e===`image`||e===`video`?e:`string`}function mr(e){if(e.type===`image`||e.type===`video`)try{return Lt(e.defaultValue)}catch{return null}return e.type===`boolean`?e.defaultValue===!0||e.defaultValue===`true`:typeof e.defaultValue==`number`||typeof e.defaultValue==`string`?e.defaultValue:``}function hr(e,t){if(!(e instanceof G))return t(`workflows:inputs.invalidDefinition`);let n=e.label||e.inputName;return e.code===`workflow_input_unsafe_name`?t(`workflows:inputs.invalidName`):e.code===`workflow_input_duplicate_name`?t(`workflows:inputs.duplicateName`,{name:n}):e.code===`workflow_input_required`?t(`workflows:inputs.requiredValue`,{name:n}):e.code===`workflow_input_type`?t(`workflows:inputs.invalidValue`,{name:n}):e.code===`workflow_input_too_long`?t(`workflows:inputs.valueTooLong`,{name:n}):e.code===`workflow_input_unknown`?t(`workflows:inputs.unknownInput`,{name:n}):t(`workflows:inputs.invalidDefinition`)}function gr(e,t){try{return zt(e),``}catch(e){return hr(e,t)}}function _r(e,t,n){try{return Bt(e,t),``}catch(e){return hr(e,n)}}function vr(e,t){return Bt(e,t)}function yr(e,t){return e.type===`text`?t(`workflows:inputs.longText`):e.type===`number`?t(`workflows:inputs.number`):e.type===`boolean`?t(`workflows:inputs.boolean`):e.type===`image`?t(`workflows:inputs.image`):e.type===`video`?t(`workflows:inputs.video`):t(`workflows:inputs.shortText`)}function br({inputs:e,onChange:t,t:n,onUploadBusy:r}){let i=(0,W.useId)(),[a,o]=(0,W.useState)(null),s=gr(e,n),c=(n,r)=>t(e.map(e=>e.id===n?{...e,...r}:e));return(0,X.jsxs)(`section`,{className:`mt-4 min-w-0 space-y-3`,"aria-labelledby":`${i}-title`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h3`,{id:`${i}-title`,className:`text-sm font-medium`,children:n(`workflows:workflowsPage.inputParameters`)}),(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,disabled:e.length>=30,onClick:()=>{let r=e.length+1;for(;e.some(e=>e.name===`input_${r}`);)r+=1;let i=crypto.randomUUID();t([...e,{id:i,name:`input_${r}`,label:n(`workflows:workflowsPage.newInput`),type:`string`,required:!1,defaultValue:``,description:``}]),o(i)},children:[(0,X.jsx)(pe,{}),n(`workflows:workflowsPage.addInput`)]})]}),(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:n(`workflows:inputs.definitionHint`)}),s&&(0,X.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:s}),e.length===0&&(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`workflows:inputs.emptyDefinition`)}),e.map(s=>(0,X.jsxs)(Oe,{className:`min-w-0 rounded-md border`,open:a===s.id,onOpenChange:e=>o(e?s.id:null),children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 p-3`,children:[(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,X.jsx)(`p`,{className:`truncate text-sm font-medium`,children:s.label||s.name}),(0,X.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[yr(s,n),` ·`,` `,s.required?n(`workflows:workflowsPage.required`):n(`workflows:inputs.optional`)]})]}),(0,X.jsx)(De,{asChild:!0,children:(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-label":n(`workflows:inputs.editNamedInput`,{name:s.label||s.name}),children:[(0,X.jsx)(de,{}),n(`workflows:inputs.editInput`)]})})]}),(0,X.jsxs)(Ee,{className:`space-y-3 border-t p-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{htmlFor:`${i}-${s.id}-label`,className:`text-xs`,children:n(`workflows:inputs.label`)}),(0,X.jsx)(V,{id:`${i}-${s.id}-label`,value:s.label,maxLength:120,onChange:e=>c(s.id,{label:e.target.value})})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{id:`${i}-${s.id}-type`,className:`text-xs`,children:n(`workflows:workflowsPage.parameterType`)}),(0,X.jsxs)(U,{"aria-labelledby":`${i}-${s.id}-type`,value:s.type,onChange:e=>{let t=pr(e.target.value);c(s.id,{type:t,defaultValue:t!==`boolean`&&``})},children:[(0,X.jsx)(`option`,{value:`string`,children:n(`workflows:inputs.shortText`)}),(0,X.jsx)(`option`,{value:`text`,children:n(`workflows:inputs.longText`)}),(0,X.jsx)(`option`,{value:`number`,children:n(`workflows:inputs.number`)}),(0,X.jsx)(`option`,{value:`boolean`,children:n(`workflows:inputs.boolean`)}),(0,X.jsx)(`option`,{value:`image`,children:n(`workflows:inputs.image`)}),(0,X.jsx)(`option`,{value:`video`,children:n(`workflows:inputs.video`)})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{htmlFor:`${i}-${s.id}-description`,className:`text-xs`,children:n(`workflows:inputs.description`)}),(0,X.jsx)(gt,{id:`${i}-${s.id}-description`,value:s.description,maxLength:300,rows:2,className:`min-h-14`,onChange:e=>c(s.id,{description:e.target.value})})]}),(0,X.jsxs)(`details`,{className:`group rounded-md border p-2`,children:[(0,X.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-2 text-xs font-medium [&::-webkit-details-marker]:hidden`,children:[n(`workflows:inputs.advancedSettings`),(0,X.jsx)(T,{className:`size-3.5 transition-transform group-open:rotate-180`})]}),(0,X.jsxs)(`div`,{className:`space-y-3 pt-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{htmlFor:`${i}-${s.id}-name`,className:`text-xs`,children:n(`workflows:workflowsPage.parameterName`)}),(0,X.jsx)(V,{id:`${i}-${s.id}-name`,value:s.name,maxLength:80,onChange:e=>c(s.id,{name:e.target.value})}),(0,X.jsx)(`code`,{className:`block break-all text-xs text-muted-foreground`,children:`{{inputs.`+s.name+`}}`})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[s.type!==`text`&&s.type!==`image`&&s.type!==`video`&&(0,X.jsx)(L,{htmlFor:`${i}-${s.id}-default`,className:`text-xs`,children:n(`workflows:inputs.defaultValue`)}),s.type===`boolean`?(0,X.jsx)(R,{id:`${i}-${s.id}-default`,checked:mr(s)===!0,onCheckedChange:e=>c(s.id,{defaultValue:e})}):s.type===`text`||s.type===`image`||s.type===`video`?(0,X.jsx)(fr,{input:s,value:s.defaultValue,label:n(`workflows:inputs.defaultValue`),onBusyChange:r,onChange:e=>c(s.id,{defaultValue:e})}):(0,X.jsx)(V,{id:`${i}-${s.id}-default`,type:s.type===`number`?`number`:`text`,value:String(mr(s)),onChange:e=>c(s.id,{defaultValue:e.target.value})})]}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,X.jsx)(L,{htmlFor:`${i}-${s.id}-required`,className:`text-xs`,children:n(`workflows:workflowsPage.required`)}),(0,X.jsx)(R,{id:`${i}-${s.id}-required`,checked:s.required,onCheckedChange:e=>c(s.id,{required:e})})]})]})]}),(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,"aria-label":n(`workflows:inputs.deleteInput`,{name:s.label}),onClick:()=>{t(e.filter(e=>e.id!==s.id)),o(null)},children:[(0,X.jsx)(xe,{}),n(`workflows:inputs.removeInput`)]})]})]},s.id))]})}var xr={browser:{Icon:x},feishu:{Icon:S},weixin:{Icon:ie},qq:{Icon:ie},telegram:{Icon:ae}},Sr=[`workspace-write`,`full-access`],Cr=`workflow-notification-alert mt-2.5 mb-1.5 border-(--warning-border) bg-warning-soft text-content-secondary *:[svg]:text-warning-strong [&_[data-slot=alert-description]]:flex [&_[data-slot=alert-description]]:flex-wrap [&_[data-slot=alert-description]]:items-center [&_[data-slot=alert-description]]:gap-1 [&_[data-slot=alert-description]]:text-xs`,wr=`rounded-md bg-surface-subtle p-3 text-xs leading-relaxed text-content-muted`;function Tr(e,t){return t(e===`workspace-write`?`workflows:workflowsPage.workspaceWrite`:`workflows:workflowsPage.fullAccess`)}function Er(e,t){return t(e===`workspace-write`?`workflows:workflowsPage.workspaceWriteHelp`:`workflows:workflowsPage.fullAccessHelp`)}function Dr(e,t){return t(e===`feishu`?`workflows:workflowsPage.feishu`:e===`weixin`?`workflows:workflowsPage.weChat`:e===`qq`?`workflows:workflowsPage.qq`:e===`telegram`?`workflows:workflowsPage.telegram`:`workflows:workflowsPage.browserNotification`)}function Or({draft:e,catalog:t,t:n,onUpdateDraft:r,onInputUploadBusy:i}){return(0,X.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.name`),(0,X.jsx)(V,{value:e.name,onChange:e=>r({name:e.target.value})})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.description`),(0,X.jsx)(gt,{value:e.description,onChange:e=>r({description:e.target.value})})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.workingDirectory`),(0,X.jsx)(V,{value:e.cwd,onChange:e=>r({cwd:e.target.value})})]}),(0,X.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.visibility`),(0,X.jsxs)(U,{value:e.visibility,onChange:e=>r({visibility:e.target.value===`shared`?`shared`:`private`}),children:[(0,X.jsx)(`option`,{value:`private`,children:n(`workflows:workflowsPage.private`)}),(0,X.jsx)(`option`,{value:`shared`,children:n(`workflows:workflowsPage.shared`)})]})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.tags`),(0,X.jsx)(V,{value:e.tags.join(`, `),onChange:e=>r({tags:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.revision`),(0,X.jsx)(V,{value:`v${e.revision}`,disabled:!0})]})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.defaultModel`),(0,X.jsxs)(U,{value:e.model?`${e.model.provider}/${e.model.model}`:``,onChange:e=>{let n=t.models.find(t=>`${t.provider}/${t.model}`===e.target.value);r({model:n?{provider:n.provider,model:n.model}:null})},children:[(0,X.jsx)(`option`,{value:``,children:n(`workflows:workflowsPage.useSystemDefault`)}),t.models.map(e=>(0,X.jsx)(`option`,{value:`${e.provider}/${e.model}`,children:e.label},`${e.provider}/${e.model}`))]})]}),(0,X.jsx)(br,{inputs:e.inputs,t:n,onUploadBusy:i,onChange:e=>r({inputs:e})})]})}function kr({node:e,catalog:t,t:n,systemNotificationPermission:r,onUpdateNode:i,onToggleNotification:a,onOpenChannels:o,onOpenSystemNotificationSettings:s}){let c=[`feishu`,`weixin`,`qq`,`telegram`].some(e=>t.notificationTargets[e]?.enabled),l=r==="default"||r===`granted`;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.notificationTitle`),(0,X.jsx)(V,{value:e.notification.title,onChange:t=>i({notification:{...e.notification,title:t.target.value}}),placeholder:`{{workflow.name}}`})]}),(0,X.jsxs)(H,{variant:`control`,children:[n(`workflows:workflowsPage.notificationContent`),(0,X.jsx)(gt,{value:e.notification.content,onChange:t=>i({notification:{...e.notification,content:t.target.value}}),placeholder:`{{inputs.name}} · {{previous.summary}}`})]}),(0,X.jsx)(`strong`,{className:`mt-3 block text-xs font-medium text-content-secondary`,children:n(`workflows:workflowsPage.notificationChannels`)}),!c&&(0,X.jsxs)(Qe,{className:Cr,children:[(0,X.jsx)(Se,{}),(0,X.jsxs)(Ze,{children:[n(`workflows:workflowsPage.noExternalNotificationChannelsEnabled`),(0,X.jsx)(B,{type:`button`,variant:`link`,size:`sm`,onClick:o,children:n(`workflows:workflowsPage.openChannelSettings`)})]})]}),(r===`denied`||r===`unsupported`)&&(0,X.jsxs)(Qe,{className:Cr,children:[(0,X.jsx)(Se,{}),(0,X.jsxs)(Ze,{children:[n(r===`unsupported`?`workflows:workflowsPage.systemNotificationsUnsupported`:`workflows:workflowsPage.systemNotificationPermissionRequired`),(0,X.jsx)(B,{type:`button`,variant:`link`,size:`sm`,onClick:s,children:n(`workflows:workflowsPage.openSystemNotificationSettings`)})]})]}),Object.entries(xr).map(([i,o])=>{let s=o.Icon,c=i===`browser`?l:!!t.notificationTargets[i]?.enabled;return(0,X.jsxs)(`div`,{className:`toggle-line flex min-h-[34px] items-center justify-between gap-3 border-t border-stroke-soft text-sm max-[650px]:min-h-11 [&>span]:flex [&>span]:items-center [&>span]:gap-2 [&>span]:text-content-secondary`,children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(s,{size:15}),Dr(i,n)]}),(0,X.jsx)(R,{checked:c&&(i!==`browser`||r===`granted`&&t.notificationTargets.browser.enabled)&&e.notificationTargets.includes(i),disabled:!c,"aria-label":Dr(i,n),title:i===`browser`?c?t.notificationTargets.browser.enabled?n(`workflows:workflowsPage.systemNotificationsEnabled`):n(`workflows:workflowsPage.systemNotificationReady`):n(`workflows:workflowsPage.systemNotificationPermissionRequired`):n(c?`workflows:workflowsPage.notificationChannelEnabled`:`workflows:workflowsPage.notificationChannelNotEnabled`),onCheckedChange:()=>void a(i)})]},i)})]})}function Ar({edge:e,nodes:t,t:n,onDelete:r}){let i=new Map(t.map(e=>[e.id,e]));return(0,X.jsxs)(`section`,{className:`min-w-0 space-y-3`,children:[(0,X.jsxs)(`div`,{className:`workflow-edge-summary my-2.5 grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2 text-sm [&_strong]:truncate [&_strong]:font-medium [&>span]:text-content-faint`,children:[(0,X.jsx)(`strong`,{children:i.get(e.source)?.label||n(`workflows:workflowsPage.unknownNode`)}),(0,X.jsx)(`span`,{children:`→`}),(0,X.jsx)(`strong`,{children:i.get(e.target)?.label||n(`workflows:workflowsPage.unknownNode`)})]}),(0,X.jsx)(`p`,{className:`muted-copy text-xs leading-relaxed text-content-muted`,children:n(`workflows:workflowsPage.pressDeleteOrBackspaceToRemoveThisConnection`)}),(0,X.jsxs)(B,{size:`sm`,variant:`destructive`,onClick:r,children:[(0,X.jsx)(xe,{"data-icon":`inline-start`}),n(`workflows:workflowsPage.deleteConnection`)]})]})}function jr({node:e,inputs:t,selectedEdge:n,catalog:r,t:i,onUpdateNode:a,systemNotificationPermission:o,onToggleNotification:s,onCopy:c,onDelete:l,onOpenChannels:u,onOpenSystemNotificationSettings:d}){let f=(0,W.useRef)(null);return(0,X.jsx)(`section`,{className:`min-w-0 space-y-3`,children:e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.nodeName`),(0,X.jsx)(V,{value:e.label,onChange:e=>a({label:e.target.value})})]}),[`prompt`,`skill`,`file`,`mcp`].includes(e.kind)&&(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.nodeModel`),(0,X.jsxs)(U,{value:e.model?`${e.model.provider}/${e.model.model}`:``,onChange:e=>{let t=r.models.find(t=>`${t.provider}/${t.model}`===e.target.value);a({model:t?{provider:t.provider,model:t.model}:null})},children:[(0,X.jsx)(`option`,{value:``,children:i(`workflows:workflowsPage.inheritWorkflowDefaultModel`)}),r.models.map(e=>(0,X.jsx)(`option`,{value:`${e.provider}/${e.model}`,children:e.label},`${e.provider}/${e.model}`))]})]}),e.kind===`trigger`&&(0,X.jsx)(`p`,{className:wr,children:i(`workflows:editor.manualTriggerHint`)}),e.kind===`parallel`&&(0,X.jsx)(`p`,{className:wr,children:i(`workflows:editor.parallelHint`)}),![`trigger`,`parallel`,`condition`,`approval`].includes(e.kind)&&(0,X.jsxs)(`details`,{className:`rounded-md border border-stroke p-3`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium text-content-secondary`,children:i(`workflows:editor.executionSettings`)}),(0,X.jsxs)(`div`,{className:`grid gap-3 pt-3`,children:[(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.retryCount`),(0,X.jsx)(V,{type:`number`,min:`0`,max:`3`,value:e.retries,onChange:e=>a({retries:Number(e.target.value)})})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.timeoutMinutes`),(0,X.jsx)(V,{type:`number`,min:`1`,max:`240`,value:e.timeoutMinutes,onChange:e=>a({timeoutMinutes:Number(e.target.value)})})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.failureHandling`),(0,X.jsxs)(U,{value:e.failurePolicy,onChange:e=>a({failurePolicy:e.target.value===`skip`?`skip`:`stop`}),children:[(0,X.jsx)(`option`,{value:`stop`,children:i(`workflows:workflowsPage.stopImmediately`)}),(0,X.jsx)(`option`,{value:`skip`,children:i(`workflows:workflowsPage.skipThisNode`)})]})]})]})]}),Gt(e.kind)&&(0,X.jsx)(nr,{node:e,inputs:t,t:i,onChange:a}),[`prompt`,`skill`,`file`,`mcp`].includes(e.kind)&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.executionMode`),(0,X.jsx)(U,{value:e.executionMode,onChange:e=>a({executionMode:e.target.value}),children:Sr.map(e=>(0,X.jsx)(`option`,{value:e,children:Tr(e,i)},e))}),(0,X.jsx)(`small`,{children:Er(e.executionMode,i)})]}),e.kind===`skill`&&(0,X.jsxs)(H,{variant:`control`,children:[`Skill`,(0,X.jsxs)(U,{value:e.skillName,onChange:e=>a({skillName:e.target.value}),children:[(0,X.jsx)(`option`,{value:``,children:i(`workflows:workflowsPage.chooseSkill`)}),r.skills.map(e=>(0,X.jsx)(`option`,{value:e.name,children:e.name},e.id))]})]}),e.kind===`mcp`&&(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.mcpToolNames`),(0,X.jsx)(V,{value:e.requestedToolNames.join(`, `),onChange:e=>a({requestedToolNames:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),placeholder:`server.tool_name`})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:inputs.nodeRules`),(0,X.jsx)(gt,{ref:f,value:e.prompt,onChange:e=>a({prompt:e.target.value}),placeholder:i(`workflows:workflowsPage.describeTheWorkTheAgentShouldCompleteInThisNode`)})]}),(0,X.jsxs)(`div`,{className:`space-y-2 py-2`,children:[(0,X.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:i(`workflows:inputs.nodeRulesHint`)}),(0,X.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:t.map(t=>(0,X.jsx)(B,{type:`button`,variant:`outline`,size:`xs`,title:i(`workflows:inputs.insertVariable`,{name:t.label}),onClick:()=>{let n=f.current,r=n?.selectionStart??e.prompt.length,i=n?.selectionEnd??r,o=`{{inputs.`+t.name+`}}`;a({prompt:e.prompt.slice(0,r)+o+e.prompt.slice(i)}),requestAnimationFrame(()=>{n?.focus(),n?.setSelectionRange(r+o.length,r+o.length)})},children:(0,X.jsx)(`code`,{children:`{{inputs.`+t.name+`}}`})},t.id))})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.outputFormat`),(0,X.jsxs)(U,{value:e.outputFormat,onChange:e=>a({outputFormat:e.target.value===`json`?`json`:`text`}),children:[(0,X.jsx)(`option`,{value:`text`,children:`Text`}),(0,X.jsx)(`option`,{value:`json`,children:`JSON`})]})]})]}),e.kind===`condition`&&(0,X.jsxs)(`div`,{className:`grid gap-3`,children:[(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.dataPath`),(0,X.jsx)(V,{value:e.condition.source,onChange:t=>a({condition:{...e.condition,source:t.target.value}}),placeholder:`inputs.approved`})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.operator`),(0,X.jsx)(U,{value:e.condition.operator,onChange:t=>a({condition:{...e.condition,operator:t.target.value}}),children:[`exists`,`not_exists`,`equals`,`not_equals`,`contains`,`greater_than`,`less_than`].map(e=>(0,X.jsx)(`option`,{value:e,children:e},e))})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.comparisonValue`),(0,X.jsx)(V,{value:String(e.condition.value??``),onChange:t=>a({condition:{...e.condition,value:t.target.value}})})]})]}),e.kind===`notification`&&(0,X.jsx)(kr,{node:e,catalog:r,t:i,systemNotificationPermission:o,onUpdateNode:a,onToggleNotification:s,onOpenChannels:u,onOpenSystemNotificationSettings:d}),e.kind===`approval`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.approvalMessage`),(0,X.jsx)(gt,{value:e.approval.message,onChange:t=>a({approval:{...e.approval,message:t.target.value}})})]}),(0,X.jsxs)(H,{variant:`control`,children:[i(`workflows:workflowsPage.approvalTimeout`),(0,X.jsx)(V,{type:`number`,min:`1`,max:`10080`,value:e.approval.timeoutMinutes,onChange:t=>a({approval:{...e.approval,timeoutMinutes:Number(t.target.value)}})})]})]}),(0,X.jsxs)(`div`,{className:`mt-4 flex gap-2 max-[650px]:flex-wrap`,children:[(0,X.jsxs)(B,{size:`sm`,variant:`secondary`,onClick:c,children:[(0,X.jsx)(j,{"data-icon":`inline-start`}),i(`workflows:workflowsPage.duplicateNode`)]}),(0,X.jsxs)(B,{size:`sm`,variant:`destructive`,onClick:l,children:[(0,X.jsx)(xe,{"data-icon":`inline-start`}),i(`workflows:workflowsPage.deleteNode`)]})]})]}):(0,X.jsx)(`p`,{className:`muted-copy text-xs leading-relaxed text-content-muted`,children:i(n?`workflows:workflowsPage.aConnectionIsCurrentlySelected`:`workflows:workflowsPage.dragNodesFromTheLeftToStartBuildingTheWorkflow`)})})}function Mr({draft:e,catalog:t,selectedNode:n,selectedEdge:r,currentRun:i,language:a,t:o,onUpdateNode:s,systemNotificationPermission:c,onToggleNotification:l,onDeleteEdge:u,onCopyNode:d,onDeleteNode:f,onOpenChannels:p,onOpenSystemNotificationSettings:m,onRunImageNode:h,imageRunBusy:g=!1}){let _=e.edges.filter(e=>e.target===n?.id).map(e=>e.source),v=(i?[i]:[]).find(t=>t.workflowId===e.id&&(n?.kind===`media-input`?!!t.inputs:_.length>0&&_.every(e=>t.nodes?.some(t=>t.id===e&&t.status===`completed`&&t.output)))),y=i;return(0,X.jsxs)(`div`,{className:`detail-stack min-w-0 space-y-5`,children:[r&&(0,X.jsx)(Ar,{edge:r,nodes:e.nodes,t:o,onDelete:u}),!r&&(0,X.jsx)(jr,{node:n,inputs:e.inputs,selectedEdge:r,catalog:t,t:o,onUpdateNode:s,systemNotificationPermission:c,onToggleNotification:l,onCopy:d,onDelete:f,onOpenChannels:p,onOpenSystemNotificationSettings:m}),n&&Gt(n.kind)&&h&&(0,X.jsxs)(`div`,{className:`space-y-2 rounded-md border border-stroke p-3`,children:[(0,X.jsxs)(B,{className:`w-full`,variant:`outline`,disabled:!e.id||!v||g,onClick:()=>{v&&h(n.id,v.id)},children:[(0,X.jsx)(fe,{}),o(`workflows:imageNodes.runNode`)]}),(0,X.jsx)(`p`,{className:`text-xs text-content-muted`,children:o(`workflows:imageNodes.runNodeHint`)})]}),n&&Gt(n.kind)&&(0,X.jsx)(sr,{value:y?.nodes?.find(e=>e.id===n.id)?.output,previousValue:v?.nodes?.find(t=>t.id===e.edges.find(e=>e.target===n.id)?.source)?.output,error:y?.nodes?.find(e=>e.id===n.id)?.error,t:o},n.id),e.id&&i&&(0,X.jsxs)(`details`,{className:`overflow-hidden rounded-md border border-stroke`,children:[(0,X.jsx)(`summary`,{className:`cursor-pointer px-3 py-2 text-sm font-medium hover:bg-surface-subtle focus-visible:-outline-offset-2 max-[650px]:py-3`,children:o(`workflows:workflowsPage.latestRun`)}),(0,X.jsx)(`div`,{className:`border-t border-stroke-soft px-3 py-2.5`,children:(0,X.jsx)(dr,{run:i,language:a,t:o})})]})]})}function Nr({workflowId:e,templateId:t,notify:n,onCreated:r}){let{t:i}=l(),[a,o]=(0,W.useState)(Mn),[s,c]=(0,W.useState)(null),[u,d]=(0,W.useState)(``),[f,p]=(0,W.useState)(``),[m,g]=(0,W.useState)(!0),[_,v]=(0,W.useState)(!1),[y,b]=(0,W.useState)(``),x=(0,W.useRef)(null),S=(0,W.useRef)(new Set),[C,w]=(0,W.useState)(!1),T=(0,W.useRef)(null),E=(0,W.useRef)(!0);(0,W.useEffect)(()=>{let e=S.current;return E.current=!0,v(!1),w(!1),()=>{E.current=!1,T.current?.abort(),T.current=null,e.clear()}},[e,t]);let ee=(0,W.useCallback)((e,t)=>{t?S.current.add(e):S.current.delete(e),E.current&&w(S.current.size>0)},[]),D=!!window.pisperDesktop?.showNotification,[O,k]=(0,W.useState)(()=>D?`checking`:ht()),A=(0,W.useCallback)(async()=>{if(!D){k(ht());return}let e=window.pisperDesktop?.getNotificationStatus;if(!e){k(`granted`);return}try{let t=await e(),n=t?.permission;k(n==="default"||n===`denied`||n===`granted`||n===`checking`||n===`unsupported`?n:t?.supported===!1?`unsupported`:`granted`)}catch{k(`unsupported`)}},[D]),j=(0,W.useCallback)(async n=>{try{let r=await h(`/api/workflows`,{signal:n});if(n.aborted)return;o(r);let a=e===`new`?null:r.workflows.find(t=>t.id===e),s=fn(t),l=a?structuredClone(a):s?gn(s,r.cwd,i):mn(r.cwd,i);c(l),d(e=>l.nodes.some(t=>t.id===e)?e:l.nodes[0]?.id||``),p(``),b(a||e===`new`?``:i(`workflows:workflowsPage.workflowNotFoundABlankEditorWasOpened`))}catch(e){n.aborted||b(Q(e))}finally{n.aborted||g(!1)}},[i,t,e]),M=(0,W.useCallback)(()=>{x.current?.abort();let e=new AbortController;x.current=e,g(!0),b(``),j(e.signal)},[j]);(0,W.useEffect)(()=>(M(),()=>x.current?.abort()),[M]),(0,W.useEffect)(()=>{A();let e=()=>void A();return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},[A]);let N=(0,W.useMemo)(()=>a.runs.filter(e=>e.workflowId===s?.id).sort((e,t)=>Date.parse(t.startedAt)-Date.parse(e.startedAt))[0],[a.runs,s?.id]),P=N?.status===`running`||N?.status===`waiting_approval`;(0,W.useEffect)(()=>{if(!P)return;let e=new AbortController,t=!1,n=window.setInterval(async()=>{if(!t){t=!0;try{let t=await h(`/api/workflows`,{signal:e.signal});e.signal.aborted||o(t)}catch{}finally{t=!1}}},1500);return()=>{e.abort(),window.clearInterval(n)}},[P,e]);let F=(0,W.useMemo)(()=>s?.nodes.find(e=>e.id===u)||null,[s?.nodes,u]),te=(0,W.useMemo)(()=>s?.edges.find(e=>e.id===f)||null,[s?.edges,f]),ne=(0,W.useCallback)(e=>{c(t=>t&&{...t,...e})},[]),I=(0,W.useCallback)(e=>{c(t=>t&&{...t,nodes:t.nodes.map(t=>t.id===u?{...t,...e}:t)})},[u]),re=(0,W.useCallback)(e=>{d(e),p(``)},[]),ie=(0,W.useCallback)(e=>{p(e),d(``)},[]),ae=(0,W.useCallback)(()=>{d(``),p(``)},[]),oe=(0,W.useCallback)((e,t,r=`output`)=>{if(!s||e===t)return;let a=s.nodes.find(e=>e.id===t);if(!a||a.kind===`trigger`){n(i(`workflows:workflowsPage.aTriggerCannotHaveAnUpstreamConnection`),`error`);return}if(s.edges.some(n=>n.source===e&&n.target===t&&n.sourcePort===r)){n(i(`workflows:workflowsPage.thisConnectionAlreadyExists`),`info`);return}if(Zt(s.nodes,s.edges,e,t,r)){n(i(`workflows:workflowsPage.aWorkflowCannotContainCyclicConnections`),`error`);return}let o={id:crypto.randomUUID(),source:e,sourcePort:r,target:t,targetPort:`input`};c(e=>e&&{...e,edges:[...e.edges,o]}),p(o.id),d(``),n(i(`workflows:workflowsPage.connectionCreated`),`info`)},[s,n,i]),se=(0,W.useCallback)(e=>{if(!e.length)return;let t=new Set(e);c(e=>e&&{...e,edges:e.edges.filter(e=>!t.has(e.id))}),p(``),n(i(`workflows:workflowsPage.connectionDeleted`),`info`)},[n,i]),ce=(0,W.useCallback)(()=>{f&&se([f])},[se,f]),le=(0,W.useCallback)(e=>{if(!e.length)return;let t=new Set(e);c(e=>e&&{...e,nodes:e.nodes.filter(e=>!t.has(e.id)),edges:e.edges.filter(e=>!t.has(e.source)&&!t.has(e.target))}),ae(),n(i(`workflows:workflowsPage.nodeDeleted`),`info`)},[ae,n,i]),ue=(0,W.useCallback)((e,t,n)=>{let r=crypto.randomUUID();c(i=>i&&{...i,nodes:[...i.nodes,Z(r,e,t||Qt[e],``,n.x,n.y)]}),d(r),p(``)},[]),de=(0,W.useCallback)((e,t)=>{c(n=>n&&{...n,nodes:n.nodes.map(n=>n.id===e&&(n.x!==t.x||n.y!==t.y)?{...n,x:t.x,y:t.y}:n)})},[]),fe=(0,W.useCallback)(()=>{if(!F)return;let e=crypto.randomUUID();c(t=>t&&{...t,nodes:[...t.nodes,{...F,id:e,label:`${F.label} 副本`,x:F.x+25,y:F.y+25}]}),d(e),p(``),n(i(`workflows:workflowsPage.nodeDuplicated`),`info`)},[n,F,i]),pe=(0,W.useCallback)(()=>{F&&le([F.id])},[le,F]),me=(0,W.useCallback)(async e=>{if(!F||F.kind!==`notification`)return;let t=F.notificationTargets;if(e!==`browser`){if(t.includes(e)){I({notificationTargets:t.filter(t=>t!==e)});return}if(!a.notificationTargets[e]?.enabled)return;I({notificationTargets:[...t,e]});return}if(t.includes(e)&&a.notificationTargets.browser.enabled&&O===`granted`){I({notificationTargets:t.filter(t=>t!==e)});return}let r=O;if(D){await A();let e=await window.pisperDesktop?.getNotificationStatus?.();r=e?.permission||(e?.supported===!1?`unsupported`:`granted`)}else if(r=await mt(),k(r),r===`granted`)try{await pt()}catch(e){n(Q(e),`error`);return}if(r!==`granted`){n(i(r===`unsupported`?`workflows:workflowsPage.systemNotificationsUnsupported`:`workflows:workflowsPage.systemNotificationPermissionRequired`),`error`);return}try{let r=await h(`/api/settings/notifications/browser`,{method:`PATCH`,body:JSON.stringify({enabled:!0})});o(e=>({...e,notificationTargets:{...e.notificationTargets,browser:{enabled:r.browser.enabled}}})),I({notificationTargets:t.includes(e)?t:[...t,e]}),n(i(`workflows:workflowsPage.systemNotificationsEnabled`))}catch(e){n(Q(e),`error`)}},[a.notificationTargets,D,n,A,F,O,i,I]),he=(0,W.useCallback)(async(t=`draft`,l=!1)=>{if(!s||!E.current||T.current)return null;if(S.current.size)return n(i(`workflows:inputs.uploading`),`info`),null;let u=gr(s.inputs,i);if(u)return b(u),n(u,`error`),null;v(!0),b(``);let d=new AbortController;T.current=d;try{let u=new Set(Object.entries(a.notificationTargets).filter(([e,t])=>t.enabled&&(e!==`browser`||O===`granted`||O===`checking`)).map(([e])=>e)),f={...s,status:t,notifications:s.notifications.filter(e=>u.has(e)),nodes:s.nodes.map(e=>({...e,notificationTargets:e.notificationTargets.filter(e=>u.has(e))}))},p=s.id?await h(`/api/workflows/${encodeURIComponent(s.id)}`,{method:`PATCH`,body:JSON.stringify(f),signal:d.signal}):await h(`/api/workflows`,{method:`POST`,body:JSON.stringify(f),signal:d.signal});return d.signal.throwIfAborted(),o(p.state),c(e=>e===s?structuredClone(p.workflow):e&&{...e,id:p.workflow.id,revision:p.workflow.revision}),e===`new`&&!l&&r(p.workflow.id,!1),l||n(i(t===`published`?`workflows:workflowsPage.workflowPublished`:`workflows:workflowsPage.workflowDraftSaved`)),p.workflow}catch(e){if(d.signal.aborted)return null;let t=Q(e);return b(t),n(t,`error`),null}finally{T.current===d&&(T.current=null,E.current&&v(!1))}},[a.notificationTargets,s,n,r,O,i,e]),ge=(0,W.useCallback)(async(t,a)=>{let c=await he(s?.status||`draft`,!0);if(!c||!E.current)return!1;if(S.current.size)return n(i(`workflows:inputs.uploading`),`info`),!1;let l=new AbortController;T.current=l,v(!0);try{a?await Xn.runNode(c.id,a.nodeId,a.sourceRunId,l.signal):await h(`/api/workflows/${encodeURIComponent(c.id)}/run`,{method:`POST`,body:JSON.stringify({inputs:t}),signal:l.signal}),l.signal.throwIfAborted();let e=await h(`/api/workflows`,{signal:l.signal});return l.signal.throwIfAborted(),o(e),n(i(`workflows:workflowsPage.workflowStarted`)),!0}catch(e){if(l.signal.aborted)return!1;let t=Q(e);return b(t),n(t,`error`),!1}finally{T.current===l&&(T.current=null,E.current&&v(!1)),E.current&&!l.signal.aborted&&e===`new`&&r(c.id,!0)}},[s?.status,n,r,he,i,e]),_e=(0,W.useCallback)(e=>ge(e),[ge]),ve=(0,W.useCallback)((e,t)=>ge(void 0,{nodeId:e,sourceRunId:t}),[ge]),ye=(0,W.useCallback)(async()=>{if(!E.current||T.current||!N||![`running`,`waiting_approval`].includes(N.status))return;let e=new AbortController;T.current=e,v(!0);try{await h(`/api/workflow-runs/${encodeURIComponent(N.id)}/stop`,{method:`POST`,body:`{}`,signal:e.signal}),e.signal.throwIfAborted();let t=await h(`/api/workflows`,{signal:e.signal});e.signal.throwIfAborted(),o(t),n(i(`workflows:workflowsPage.stoppingWorkflow`),`info`)}catch(t){if(e.signal.aborted)return;let r=Q(t);b(r),n(r,`error`)}finally{T.current===e&&(T.current=null,E.current&&v(!1))}},[N,n,i]),be=(0,W.useCallback)(()=>he(`published`),[he]);return{catalog:a,draft:s,selectedNode:F,selectedEdge:te,selectedNodeId:u,selectedEdgeId:f,currentRun:N,loading:m,retryLoad:M,busy:_||C,inputUploadsPending:C,onInputUploadBusy:ee,running:P,error:y,systemNotificationPermission:O,updateDraft:ne,updateNode:I,addEdge:oe,removeEdges:se,removeSelectedEdge:ce,removeNodes:le,addNode:ue,moveNode:de,copyNode:fe,deleteNode:pe,toggleNotification:me,selectNode:re,selectEdge:ie,clearSelection:ae,saveWorkflow:he,runWorkflow:_e,runImageNode:ve,stopWorkflow:ye,publishWorkflow:be}}function Pr({workflow:e,onClose:t,onRun:n}){let{t:r}=l(),i=(0,W.useId)(),a={id:`task`,name:`task`,label:r(`workflows:inputs.task`),description:r(`workflows:inputs.contextHint`),type:`text`,required:!1,defaultValue:``},o=e.inputs.length?e.inputs:[a],[s,c]=(0,W.useState)(()=>Object.fromEntries(o.map(e=>[e.name,mr(e)]))),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(``),[m,h]=(0,W.useState)([]),g=(0,W.useRef)(new Set),_=(0,W.useRef)(s);_.current=s;let v=(0,W.useRef)(!0);(0,W.useEffect)(()=>(v.current=!0,()=>{v.current=!1}),[]);let y=(e,t)=>{let n={..._.current,[e]:t};_.current=n,c(n)},b=(0,W.useCallback)((e,t)=>{t?g.current.add(e):g.current.delete(e),v.current&&h([...g.current])},[]),x=(0,W.useRef)(!1),S=async()=>{if(x.current||g.current.size)return;let e=_.current,i=_r(o,e,r);if(i){p(i);return}x.current=!0,d(!0),p(``);try{let i=await n(vr(o,e));if(!v.current)return;i?t():p(r(`workflows:inputs.startFailed`))}catch{v.current&&p(r(`workflows:inputs.startFailed`))}finally{x.current=!1,v.current&&d(!1)}};return(0,X.jsx)(it,{open:!0,onOpenChange:e=>{!e&&!x.current&&t()},children:(0,X.jsxs)(et,{className:`max-h-[85vh] overflow-y-auto supports-[height:100dvh]:max-h-[85dvh] sm:max-w-xl`,showCloseButton:!u,children:[(0,X.jsxs)(rt,{children:[(0,X.jsx)(tt,{children:r(`workflows:inputs.runTitle`,{name:e.name})}),(0,X.jsx)($e,{children:r(`workflows:inputs.runHint`)})]}),(0,X.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),S()},children:[pn(e)>0&&(0,X.jsx)(`p`,{className:`rounded-md bg-surface-subtle p-3 text-sm tabular-nums`,children:r(`workflows:imageNodes.requestEstimate`,{count:pn(e)})}),o.map(e=>(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[e.type!==`text`&&e.type!==`image`&&e.type!==`video`&&(0,X.jsxs)(L,{htmlFor:`${i}-${e.id}`,className:`flex items-center gap-1`,children:[e.label,e.required&&(0,X.jsx)(`span`,{className:`text-destructive`,"aria-hidden":`true`,children:`*`})]}),e.type===`boolean`?(0,X.jsx)(R,{id:`${i}-${e.id}`,checked:s[e.name]===!0,disabled:u,onCheckedChange:t=>y(e.name,t)}):e.type===`text`||e.type===`image`||e.type===`video`?(0,X.jsx)(fr,{input:e,value:s[e.name],disabled:u,label:`${e.label}${e.required?` *`:``}`,onBusyChange:b,onChange:t=>y(e.name,t)}):(0,X.jsx)(V,{id:`${i}-${e.id}`,type:e.type===`number`?`number`:`text`,step:e.type===`number`?`any`:void 0,value:String(s[e.name]??``),required:e.required,disabled:u,"aria-describedby":e.description?`${i}-${e.id}-description`:void 0,onChange:t=>y(e.name,t.target.value)}),e.description&&(0,X.jsx)(`p`,{id:`${i}-${e.id}-description`,className:`text-xs leading-relaxed text-muted-foreground`,children:e.description})]},e.id)),f&&(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:f}),(0,X.jsxs)(nt,{children:[(0,X.jsx)(B,{type:`button`,variant:`outline`,disabled:u,onClick:()=>{x.current||t()},children:r(`workflows:sprite.cancel`)}),(0,X.jsxs)(B,{type:`submit`,disabled:u||m.length>0,children:[u?(0,X.jsx)(re,{className:`animate-spin`}):(0,X.jsx)(fe,{}),r(`workflows:workflowsPage.run`)]})]})]})]})})}function Fr({message:e}){return e?(0,X.jsxs)(Qe,{variant:`destructive`,children:[(0,X.jsx)(Se,{}),(0,X.jsx)(Ze,{children:e})]}):null}var Ir=`max-[650px]:h-11 pointer-coarse:h-11`;function Lr({notify:e,requestConfirm:t,onBack:i}){let{t:a,language:s}=l(),c=r(),u=He(`focusSearch`),[d,f]=n(),p=d.get(`view`),m=p===`runs`||p===`templates`?p:`workflows`,h=e=>f(t=>{let n=new URLSearchParams(t);return e===`workflows`?n.delete(`view`):n.set(`view`,e),n}),[g,_]=(0,W.useState)(``),v=Nn({notify:e,requestConfirm:t,query:g}),[y,b]=(0,W.useState)(null),x=(0,W.useRef)(null),S=g.trim().toLocaleLowerCase(),C=S?v.data.runs.filter(e=>`${e.workflowName||e.workflowId}`.toLocaleLowerCase().includes(S)):v.data.runs,w=a(`navigation:navigation.workflows`);return(0,X.jsxs)(ut,{title:w,description:a(`workflows:workflowsPage.lede`),back:i&&{label:a(`navigation:sidebar.features`),ariaLabel:a(`navigation:shell.backToFeaturesLabel`),onBack:i},toolbar:(0,X.jsx)(dt,{search:(0,X.jsx)(ot,{id:Te,value:g,onValueChange:_,placeholder:a(`navigation:pageHeader.searchPage`,{page:w}),shortcut:u,clearLabel:a(`navigation:more.clearSearch`)}),actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(B,{type:`button`,variant:`secondary`,className:`h-9`,onClick:()=>x.current?.click(),children:[(0,X.jsx)(Mt,{}),a(`workflows:workflowsPage.import`)]}),(0,X.jsx)(`input`,{ref:x,hidden:!0,type:`file`,accept:`application/zip,.zip`,onChange:e=>{let t=e.target.files?.[0];e.currentTarget.value=``,t&&v.importWorkflow(t)}}),(0,X.jsxs)(B,{type:`button`,className:`h-9`,onClick:()=>c(o(`new`)),children:[(0,X.jsx)(pe,{}),a(`workflows:workflowsPage.newWorkflow`)]})]}),filters:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,X.jsx)(Hn,{value:m,t:a,onChange:h}),!v.loading&&(0,X.jsx)(Kn,{data:v.data,t:a})]})}),children:[y&&(0,X.jsx)(Pr,{workflow:y,onClose:()=>b(null),onRun:e=>v.runWorkflow(y,e)}),v.loading?(0,X.jsx)(Ye,{kind:`loading`,title:a(`workflows:workflowsPage.loadingWorkflows`)}):v.error&&!v.loaded?(0,X.jsx)(Ye,{kind:`error`,title:a(`workflows:workflowsPage.loadFailed`),description:v.error,action:(0,X.jsxs)(B,{variant:`secondary`,className:`max-[650px]:h-11`,onClick:()=>void v.reload(),children:[(0,X.jsx)(me,{}),a(`workflows:workflowsPage.retryLoading`)]})}):(0,X.jsxs)(X.Fragment,{children:[v.error&&(0,X.jsx)(`div`,{className:`mt-4`,children:(0,X.jsx)(Fr,{message:v.error})}),m===`workflows`?(0,X.jsx)(Un,{workflows:v.visibleWorkflows,runs:v.data.runs,busyId:v.busyId,query:g,language:s,t:a,onRun:b,onEdit:e=>c(o(e)),onDuplicate:e=>void v.duplicateWorkflow(e),onExport:e=>void v.exportWorkflow(e),onDelete:e=>void v.removeWorkflow(e)}):m===`runs`?(0,X.jsx)(Wn,{runs:C,busyId:v.busyId,language:s,t:a,onStop:e=>void v.stopRun(e),onRetry:e=>void v.retryRun(e),onApproval:(e,t,n)=>void v.resolveApproval(e,t,n)}):(0,X.jsx)(Gn,{query:g,t:a,onOpenTemplate:e=>c(`${o(`new`)}?template=${encodeURIComponent(e)}`)})]})]})}function Rr({title:e,name:t,tools:n,commands:r,onBack:i,t:a}){let o=_();return(0,X.jsxs)(`header`,{"data-workflow-editor-header":!0,"data-focus-region":`header`,"data-window-drag-region":!0,className:`@container/workflow-header flex min-h-[52px] min-w-0 shrink-0 flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-stroke-soft py-2 pr-3 pl-3 [[data-custom-titlebar]_&]:pr-[144px] max-[650px]:pb-2.5 max-[650px]:pt-0`,children:[(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 basis-56 items-center gap-1 max-[650px]:basis-0`,"data-window-drag-region":!0,children:[(0,X.jsx)(`nav`,{"aria-label":a(`workflows:workflowsPage.editorNavigation`),className:`flex-none`,children:(0,X.jsxs)(`button`,{type:`button`,"data-back-to-workflows":!0,"aria-label":a(`workflows:workflowsPage.backToWorkflows`),onClick:i,className:`inline-flex h-7 items-center gap-0.5 rounded-[var(--r-sm)] pr-1.5 pl-0.5 text-[13px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus max-[650px]:-ml-1.5 max-[650px]:h-11 max-[650px]:min-w-11 max-[650px]:pr-2 max-[650px]:text-sm max-[650px]:text-content-secondary pointer-coarse:h-11`,children:[(0,X.jsx)(E,{className:`size-4 max-[650px]:size-5`,"aria-hidden":`true`}),(0,X.jsx)(`span`,{children:a(`workflows:workflowsPage.workflows`)})]})}),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:z(`text-content-faint`,o&&`hidden`),children:`/`}),(0,X.jsx)(`h1`,{className:z(`flex-none text-[13px] leading-5 font-medium text-content`,o&&`sr-only`),children:e}),t&&(0,X.jsx)(`p`,{"data-workflow-name":!0,className:`min-w-0 truncate pl-1 text-[13px] text-content-muted max-[650px]:text-sm max-[650px]:text-content`,title:t,children:t})]}),n&&(0,X.jsx)(`div`,{className:`flex flex-none items-center gap-1 max-[650px]:[&_button]:h-11 max-[650px]:[&_button]:min-w-11 max-[650px]:[&_button]:px-2.5 pointer-coarse:[&_button]:h-11`,children:n}),r&&(0,X.jsxs)(X.Fragment,{children:[n&&(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`mx-0.5 h-4 w-px bg-stroke max-[650px]:hidden`}),(0,X.jsx)(`div`,{className:`flex flex-none items-center gap-1.5 max-[650px]:grid max-[650px]:w-full max-[650px]:grid-cols-3 max-[650px]:[&_button]:h-11 pointer-coarse:[&_button]:h-11`,children:r})]})]})}function zr({children:e}){return(0,X.jsx)(`span`,{className:`max-[650px]:sr-only @max-[760px]/workflow-header:sr-only`,children:e})}function Br({notify:e,registerWorkflowActions:i}){let{t:a,language:c}=l(),u=r(),{workflowId:d=`new`}=t(),[f]=n(),p=(0,W.useCallback)(e=>{u(o(e),{replace:!0})},[u]),m=Nr({workflowId:d,templateId:f.get(`template`),notify:e,onCreated:p}),{busy:h,publishWorkflow:g,runWorkflow:_,running:v,saveWorkflow:y,stopWorkflow:b}=m,[x,S]=(0,W.useState)(!1),[C,w]=(0,W.useState)(!1),[T,E]=(0,W.useState)(null),ee=(0,W.useRef)(null);(0,W.useLayoutEffect)(()=>{let e=ee.current;if(!e)return;let t=()=>E(e.clientWidth>=1e3);t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[m.loading]);let D=(0,W.useCallback)(()=>{!h&&!v&&S(!0)},[h,v]),O=m.draft?!!m.draft.id:d!==`new`;(0,W.useEffect)(()=>i?.({editing:O}),[O,i]);let k=At(a,O)[0],A=()=>u(s.workflows),j=m.running?m.currentRun?.nodes:void 0,M=(0,W.useMemo)(()=>j?new Map(j.map(e=>[e.id,e.status])):void 0,[j]);if(m.loading||!m.draft)return(0,X.jsx)(_t,{variant:`workbench`,children:(0,X.jsxs)(`div`,{className:`workflow-editor-page flex h-full min-h-0 min-w-0 flex-col`,children:[(0,X.jsx)(Rr,{title:k,onBack:A,t:a}),m.loading?(0,X.jsx)(Ye,{kind:`loading`,title:a(`workflows:workflowsPage.loadingWorkflowEditor`)}):(0,X.jsx)(Ye,{kind:`error`,title:a(`workflows:workflowsPage.workflowEditorLoadFailed`),description:m.error,action:(0,X.jsxs)(`div`,{className:`flex flex-wrap justify-center gap-2 max-[650px]:[&>button]:h-11`,children:[(0,X.jsxs)(B,{onClick:m.retryLoad,children:[(0,X.jsx)(me,{className:`size-4`}),a(`workflows:workflowsPage.retryLoading`)]}),(0,X.jsx)(B,{variant:`outline`,onClick:A,children:a(`workflows:workflowsPage.backToWorkflows`)})]})})]})});let N=m.draft,P=(0,X.jsx)(Mr,{draft:N,catalog:m.catalog,selectedNode:m.selectedNode,selectedEdge:m.selectedEdge,currentRun:m.currentRun,onRunImageNode:(e,t)=>{m.runImageNode(e,t)},imageRunBusy:m.busy||m.running,language:c,t:a,systemNotificationPermission:m.systemNotificationPermission,onUpdateNode:m.updateNode,onToggleNotification:m.toggleNotification,onDeleteEdge:m.removeSelectedEdge,onCopyNode:m.copyNode,onDeleteNode:m.deleteNode,onOpenChannels:()=>u(s.channels),onOpenSystemNotificationSettings:()=>{if(window.pisperDesktop?.openNotificationSettings){window.pisperDesktop.openNotificationSettings();return}u(`/config/notifications`)}}),F=m.selectedEdge?a(`workflows:workflowsPage.selectedConnection`):a(`workflows:editor.nodeProperties`);return(0,X.jsx)(_t,{variant:`workbench`,children:(0,X.jsxs)(`div`,{ref:ee,className:`workflow-editor-page @container/workflow flex h-full min-h-0 min-w-0 flex-col`,children:[x&&(0,X.jsx)(Pr,{workflow:N,onClose:()=>S(!1),onRun:_}),(0,X.jsx)(Rr,{title:k,name:N.name,onBack:A,t:a,tools:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(En,{nodeCount:N.nodes.length,t:a,onAddNode:m.addNode}),(0,X.jsxs)(it,{children:[(0,X.jsx)(at,{asChild:!0,children:(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,className:Ir,title:a(`workflows:workflowsPage.workflowSettings`),children:[(0,X.jsx)(ye,{}),(0,X.jsx)(zr,{children:a(`workflows:workflowsPage.workflowSettings`)})]})}),(0,X.jsxs)(et,{className:`sm:max-w-xl`,children:[(0,X.jsxs)(rt,{children:[(0,X.jsx)(tt,{children:a(`workflows:workflowsPage.workflowSettings`)}),(0,X.jsx)($e,{children:a(`workflows:editor.settingsDescription`)})]}),(0,X.jsx)(Or,{draft:N,catalog:m.catalog,t:a,onUpdateDraft:m.updateDraft,onInputUploadBusy:m.onInputUploadBusy})]})]}),T===!1&&(0,X.jsxs)(B,{variant:`ghost`,size:`sm`,className:Ir,title:a(`workflows:editor.nodeProperties`),onClick:()=>w(!0),children:[(0,X.jsx)(le,{}),(0,X.jsx)(zr,{children:a(`workflows:editor.nodeProperties`)})]})]}),commands:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(B,{variant:`outline`,size:`sm`,disabled:h||v,onClick:()=>void y(`draft`),children:[(0,X.jsx)(ge,{}),a(`workflows:editor.saveDraft`)]}),(0,X.jsxs)(B,{size:`sm`,disabled:h,onClick:()=>v?void b():D(),children:[v?(0,X.jsx)(be,{}):(0,X.jsx)(fe,{}),a(v?`workflows:workflowsPage.stop`:`workflows:editor.testRun`)]}),(0,X.jsxs)(B,{variant:`outline`,size:`sm`,disabled:h,onClick:()=>void g(),children:[(0,X.jsx)(he,{}),a(`workflows:editor.publish`)]})]})}),m.error&&(0,X.jsx)(`div`,{className:`shrink-0 px-3 pt-3`,children:(0,X.jsx)(Fr,{message:m.error})}),m.running&&m.currentRun&&(0,X.jsx)(ur,{run:m.currentRun,t:a}),(0,X.jsxs)(`div`,{className:z(`builder-layout grid min-h-0 min-w-0 flex-1 overflow-hidden`,T?`grid-cols-[minmax(0,1fr)_320px]`:`grid-cols-1`),children:[T!==null&&(0,X.jsx)(Dn,{draft:N,selectedNodeId:m.selectedNodeId,selectedEdgeId:m.selectedEdgeId,nodeStatus:M,t:a,onAddNode:m.addNode,onConnect:m.addEdge,onMoveNode:m.moveNode,onSelectNode:e=>{m.selectNode(e),w(!0)},onSelectEdge:e=>{m.selectEdge(e),w(!0)},onClearSelection:m.clearSelection,onDeleteNodes:m.removeNodes,onDeleteEdges:m.removeEdges}),T&&(0,X.jsxs)(`aside`,{className:`flex min-h-0 min-w-0 flex-col border-l border-stroke-soft bg-panel`,"aria-label":F,children:[(0,X.jsx)(`header`,{className:`flex h-11 shrink-0 items-center border-b border-stroke-soft px-4`,children:(0,X.jsx)(`h2`,{className:`text-sm font-medium`,children:F})}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:P})]})]}),T===!1&&(0,X.jsx)(qe,{open:C,onOpenChange:w,children:(0,X.jsxs)(We,{className:`gap-0 data-[side=right]:w-[min(400px,100vw)] data-[side=right]:sm:max-w-[400px]`,children:[(0,X.jsxs)(Ue,{className:`border-b border-stroke-soft pr-12`,children:[(0,X.jsx)(Ge,{children:F}),(0,X.jsx)(Ke,{className:`sr-only`,children:a(`workflows:editor.inspectorDescription`)})]}),(0,X.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:P})]})})]})})}export{Br as WorkflowBuilder,Lr as WorkflowsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={zh:{"page.title":`全部代理`,"page.summary":`{agents} 个代理 · {projects} 个项目 · {running} 个在运行`,"page.loading":`正在读取代理…`,"page.error":`暂时无法读取会话`,"page.errorHint":`检查本机运行时是否在线,然后重试。`,"page.retry":`重试`,"lane.attention":`需要你`,"lane.running":`运行中`,"lane.queued":`排队`,"lane.done":`已完成`,"lane.orderAttention":`按等待时长`,"lane.orderRunning":`按开始时间`,"lane.orderQueued":`按队列顺序`,"lane.orderDone":`最新的在前`,"lane.history":`全部历史会话`,"status.approval":`等待批准`,"status.failed":`失败`,"status.failedHandled":`失败 · 已查看`,"status.running":`运行中`,"status.queued":`排队中`,"status.done":`已完成`,"status.stopped":`已停止`,"filter.projects":`项目`,"filter.projectsTitle":`项目:{projects}`,"filter.listSeparator":`、`,"filter.statuses":`状态`,"filter.statusTitle":`状态:{statuses}`,"filter.noProject":`无项目`,"filter.emptyTitle":`筛选后没有卡片`,"filter.emptyHint":`换一个项目或状态,或者清除筛选。`,"filter.clear":`清除筛选`,"group.label":`分组方式`,"group.lane":`按状态`,"group.project":`按项目`,"card.label":`{title},{status}`,"card.more":`“{title}”的更多操作`,"card.pinned":`已置顶`,"card.standard":`常规操作`,"card.critical":`高风险`,"card.criticalWithReason":`高风险 · {reason}`,"card.approvalLoading":`正在读取审批详情…`,"card.approvalUnavailable":`暂时读不到审批详情,请在会话里查看。`,"card.moreApprovals":`还有 {count} 条审批等你处理`,"card.moreApprovalsCritical":`还有 {count} 条审批等你处理,其中有高风险`,"card.deny":`拒绝`,"card.approve":`允许`,"card.approveCritical":`允许…`,"card.retry":`重试`,"card.archive":`归档`,"card.files":`{count} 个文件`,"card.expand":`展开完整命令`,"card.expandArgs":`展开完整参数`,"card.collapse":`收起`,"card.subAgent":`子代理`,"card.subAgentProgress":`子代理 {running} 个运行中,共 {total} 个`,"activity.starting":`启动中`,"activity.thinking":`思考中`,"activity.responding":`回复中`,"activity.working":`处理中`,"activity.compacting":`压缩上下文中`,"menu.open":`打开会话`,"menu.pin":`置顶`,"menu.unpin":`取消置顶`,"menu.markHandled":`标记已处理`,"menu.copyLink":`复制会话链接`,"menu.archive":`归档`,"action.failed":`操作没有完成,请稍后重试。`,"action.archived":`已归档:{title}`,"action.copied":`已复制会话链接`,"action.copyFailed":`无法复制链接`,"confirm.title":`确认高风险操作`,"confirm.titleStandard":`确认批准`,"confirm.description":`这条审批被命令守卫标记为高风险,批准前请核对完整参数。`,"confirm.descriptionCritical":`这是高风险操作(例如安装全局插件或提交表单),批准前请核对完整参数。`,"confirm.descriptionStandard":`批准前请核对完整参数。`,"confirm.descriptionLoading":`正在读取审批详情…`,"confirm.session":`会话`,"confirm.tool":`工具`,"confirm.cwd":`工作目录`,"confirm.fullArgs":`完整参数`,"confirm.loading":`正在读取审批详情,读取完成前不能批准。`,"confirm.hint":`按住确认按钮 0.6 秒,或按`,"confirm.hintTouch":`按住确认按钮 0.6 秒`,"confirm.hold":`按住确认`,"confirm.approving":`正在批准…`,"confirm.cancel":`取消`,"triage.progress":`逐个处理 {index}/{total}`,"triage.approve":`允许`,"triage.deny":`拒绝`,"triage.retry":`重试`,"triage.open":`打开`,"triage.exit":`退出`,"triage.finished":`全部处理完`,"triage.nothing":`没有需要你处理的事项`,"announce.moved":`{title} 进入 {lane}`,"launch.title":`新任务`,"launch.inputLabel":`任务描述`,"launch.placeholder":`描述任务…(Tab 切换项目)`,"launch.placeholderTouch":`描述任务…`,"launch.projects":`最近的项目`,"launch.projectLabel":`项目:{project}`,"launch.defaultProject":`默认目录`,"launch.noProject":`不选项目`,"launch.model":`模型`,"launch.modelTitle":`模型:{model}`,"launch.defaultModel":`默认模型`,"launch.loadingModels":`正在读取模型…`,"launch.thinking":`思考档位`,"launch.thinkingDefault":`模型默认`,"launch.dispatch":`派发`,"launch.sending":`派发中 {count}`,"launch.noModel":`还没有可用的模型`,"launch.configureModels":`配置模型`,"launch.failed":`派发失败,草稿已保留。`,"launch.failedWithReason":`派发失败:{reason}(草稿已保留)`,"launch.dispatched":`已派发,可在全部代理查看进度`,"launch.fullAccessOnce":`仅本次派发,不会被记住`,"launch.startNowChip":`立即开始`,"launch.startAfterChip":`排在 {title} 之后`,"launch.startAfterShort":`等「{title}」`,"launch.startAfterNote":`排在「{title}」之后:它这一轮结束时自动开始。`,"launch.startAfterGone":`已结束的会话`,"launch.startAfterLabel":`什么时候开始`,"launch.startAfterRunning":`运行中`,"launch.startAfterQueued":`排队中`,"launch.startAfterHint":`等它这一轮结束(完成、失败或停止都算)再开始;排队后也可以在全部代理里“立即开始”。`,"dispatch.title":`新任务`,"dispatch.description":`派发后留在当前页面,新代理会出现在侧栏「运行中」。`,"dispatch.descriptionPhone":`派发后留在当前页面,新代理会出现在抽屉的「运行中」。`,"dispatch.hint":`↵ 派发 · ⌘/Ctrl+↵ 派发并打开 · ⇧↵ 换行`,"dispatch.reopen":`重新打开`,"project.actionsFor":`{project} 的操作`,"project.new":`新建项目…`,"project.manage":`管理项目…`,"project.newTaskHere":`在此项目新建任务`,"project.rename":`重命名…`,"project.resetName":`恢复目录名`,"project.delete":`删除项目…`,"project.chosen":`已选择项目「{project}」,描述第一个任务即可派发`,"project.pickerDescription":`选择项目所在的文件夹,它会成为启动台的派发目标。`,"project.renameDescription":`自定义全部代理与派发对话框里显示的项目名称,工作目录保持不变。`,"project.manageTitle":`管理项目`,"project.manageDescription":`调整项目的显示顺序与名称。还没有会话的项目可以直接移除,不影响目录与文件;有会话的项目删除时会连同其中的全部会话一起删除。`,"project.sessions":`{count} 个会话`,"project.folderName":`目录名:{name}`,"project.moveUp":`上移 {project}`,"project.moveDown":`下移 {project}`,"project.renameNamed":`重命名 {project}`,"project.resetNamed":`{project} 恢复目录名`,"project.deleteWithChatsNamed":`连同会话一起删除 {project}`,"project.removeNamed":`移除项目 {project}`,"project.listLabel":`项目列表`,"project.empty":`还没有项目`,"project.emptyHint":`新建项目后,在启动台描述第一个任务即可派发。`,"project.loading":`正在读取项目…`,"project.error":`读取项目失败`,"project.deleting":`正在删除…`,"project.done":`完成`,"phone.openSession":`打开会话`,"phone.running":`运行中 {elapsed}`,"phone.changes":`+{count} 改动`,"phone.changesLabel":`查看本会话的 {count} 个改动`,"phone.openInspector":`改动、终端、文件与预览`,"phone.inspectorDescription":`本会话的改动、终端、资料来源与网页预览`,"phone.earlierTurns":`展开更早的对话:{summary}`,"phone.previousTurn":`上一轮`,"session.moveWorkspace":`移动工作区…`,"session.goalMode":`目标模式`,"session.workflowRuns":`工作流运行记录`,"session.workflowRunsEmpty":`这个会话还没有工作流运行记录`,"session.plan":`计划 {done}/{total}`,"session.planLabel":`计划进度:已完成 {done} 项,共 {total} 项`,"session.titleMenu":`{title}:会话操作`,"session.tree":`会话树`,"session.treeBranches":`会话树:{count} 个分支`,"session.changedFiles":`{count} 个文件`,"session.changes":`{count} 个文件 +{added} −{removed}`,"session.contextUsage":`上下文已用 {percent}%`,"session.withShortcut":`{label}({shortcut})`,"session.planOpen":`{plan}:在检查器里查看`,"inspector.label":`检查器`,"inspector.tabs":`检查器标签`,"inspector.changes":`改动`,"inspector.changesCount":`改动 {count}`,"inspector.changesScope":`改动范围`,"inspector.scopeSession":`本会话`,"inspector.scopeWorkspace":`工作区`,"inspector.terminal":`终端`,"inspector.terminalScope":`终端视图`,"inspector.processes":`进程`,"inspector.terminalUnavailable":`这台设备或当前运行时不提供终端`,"inspector.files":`文件`,"inspector.preview":`预览`,"inspector.plan":`计划`,"inspector.sideChat":`侧聊`,"inspector.closeTab":`关闭“{tab}”`,"inspector.add":`添加组件标签`,"inspector.addHint":`组件放到“会话面板”位置后,会作为标签出现在这里。`,"inspector.openComponents":`打开组件页`,"inspector.close":`收起检查器`,"transcript.operations":`{count} 个操作`,"transcript.running":`{count} 运行中`,"transcript.failed":`{count} 失败`,"transcript.turn":`第 {count} 轮`,"composer.placeholder":`回复代理,或用 / 调用命令`,"composer.tokens":`{tokens} tok`,"composer.queuedFollowUp":`排队`,"composer.queuedSteer":`插话`,"composer.steerNow":`插话发送`,"composer.steerHint":`代理在下一步就读到,不必等这一轮结束`,"composer.longPressSteer":`运行中长按可插话`,"changes.sessionSummary":`本会话改动 {count} 个文件`,"changes.workspaceSummary":`工作区改动 {count} 个文件`,"changes.revertAll":`全部还原`,"changes.more":`更多改动操作`,"changes.pending":`{count} 个待批准`,"changes.revertFile":`还原此文件`,"changes.files":`改动的文件`,"changes.diffView":`差异视图`,"changes.unified":`统一`,"changes.split":`并排`,"changes.splitTooNarrow":`检查器不足 600 像素宽,放不下并排视图;把检查器拖宽后可用。`,"changes.approvedAt":`已批准写入 · {time}`,"changes.pendingAt":`待批准 · {time}`,"changes.revertedAt":`已还原 · {time}`,"changes.statusModified":`已修改`,"changes.statusCreated":`新建`,"changes.statusDeleted":`已删除`,"changes.statusRenamed":`已重命名`,"inspector.goal":`目标`,"inspector.team":`团队`,"inspector.subAgents":`子代理`,"shortcuts.agentPanel":`聚焦侧栏会话列表`,"shortcuts.toggleInspector":`显示 / 隐藏检查器`,"shortcuts.previousAgent":`按侧栏顺序切换到上一个会话`,"shortcuts.nextAgent":`按侧栏顺序切换到下一个会话`,"shortcuts.steerMessage":`运行中插话`,"shortcuts.shortcutHelp":`快捷键速查`,"shortcuts.sendMessage":`发送(运行中排队)`,"shortcuts.focusSearch":`聚焦筛选 / 搜索`,"shortcuts.groupGlobal":`全局`,"shortcuts.groupBoard":`全部代理`,"shortcuts.groupSession":`会话`,"shortcuts.globalHint":`带修饰键的组合在输入框内同样生效。`,"shortcuts.boardHint":`只在全部代理页生效;单字母键在焦点不在输入框时生效,只能改成不带修饰键的字母。`,"shortcuts.sessionHint":`只在会话页生效;Esc 永远不用于返回。`,"shortcuts.fixed":`固定`,"shortcuts.boardMove":`在代理之间移动(焦点在行上)`,"shortcuts.boardOpen":`打开会话`,"shortcuts.boardExitTriage":`退出逐个处理`,"shortcuts.newline":`换行`,"shortcuts.stopRun":`停止运行(有打开的浮层时先关闭浮层)`,"shortcuts.helpDescription":`当前设备上的绑定。改绑后这里立即更新。`,"shortcuts.helpCustomize":`在设置中改绑`,"home.draftTitle":`新任务`,"home.draftSubtitle":`发出第一条消息时才会创建会话`,"home.draftHeading":`从一个新任务开始`,"home.draftHint":`选好项目,描述要做的事。发出第一条消息后,这里就是它的会话;其他代理都在“全部代理”里。`,"home.composerLabel":`新任务输入框`,"home.placeholder":`描述要做的事…({send} 发送,Tab 切换项目)`,"home.placeholderUnbound":`描述要做的事…(Tab 切换项目)`,"home.placeholderTouch":`描述要做的事…`,"home.send":`发送`,"home.sending":`正在创建会话…`,"home.loading":`正在打开上次的会话…`,"home.loadFailed":`无法读取会话列表`,"home.loadFailedHint":`暂时无法确认上次停留的会话。可以重试,或直接开始一个新任务。`,"home.startDraft":`开始新任务`,"home.goHome":`回到主页`,"shortcuts.openSession":`打开会话主页`,"shortcuts.sessionTree":`会话树(分支与标记)`,"shortcuts.sideChat":`侧聊`,"shortcuts.cycleFocusRegion":`在侧栏、顶栏、对话、输入框之间切换焦点`,"shortcuts.groupSidebar":`侧栏`,"shortcuts.sidebarHint":`焦点在侧栏会话行上时生效;A / D 跟随“全部代理”的允许 / 拒绝键,只处理普通批准。`,"shortcuts.sidebarMove":`在会话行之间移动`,"shortcuts.sidebarOpen":`打开会话`,"sidebar.reason.failed":`运行失败`,"sidebar.reason.approval":`等你批准`,"sidebar.reason.criticalApproval":`高风险批准`,"sidebar.reason.question":`等你回答`,"sidebar.reason.questions":`等你回答 · {count} 个问题`,"sidebar.reason.questionCount":`{count} 个问题`,"sidebar.group.attention":`需要你`,"sidebar.group.running":`运行中`,"sidebar.group.queued":`排队`,"sidebar.group.pinned":`置顶`,"sidebar.group.done":`今天完成`,"sidebar.loading":`正在加载会话`,"sidebar.error":`会话列表加载失败`,"sidebar.retry":`重试`,"sidebar.empty":`还没有代理在运行。用“新任务”派出第一个。`,"sidebar.emptyAttention":`没有等你处理的事`,"sidebar.emptyRunning":`没有在运行的代理`,"sidebar.moreRunning":`还有 {count} 个 →`,"sidebar.allDone":`全部 →`,"sidebar.history":`历史会话`,"sidebar.announce":`{title} 需要你:{reason}`,"sidebar.announceSeparator":`;`,"sidebar.attentionRow":`{title},{reason},已等 {wait}`,"sidebar.attentionRowNoWait":`{title},{reason}`,"sidebar.unread":`未读`,"sidebar.deny":`拒绝`,"sidebar.approve":`允许`,"sidebar.open":`打开`,"sidebar.denyNamed":`拒绝 {title} 的请求`,"sidebar.approveNamed":`允许 {title} 的请求`,"sidebar.openNamed":`打开 {title} 处理`,"sidebar.rowMenu":`{title} 的更多操作`,"sidebar.renameTitle":`重命名会话`,"sidebar.renameLabel":`会话标题`,"sidebar.renameSave":`保存`,"sidebar.renamed":`会话标题已更新`,"sidebar.railAttention":`{count} 个代理需要你,打开全部代理`,"sidebar.railRunning":`{count} 个代理运行中,打开全部代理`,"sidebar.filter.all":`全部`,"sidebar.filter.projectActions":`项目操作`,"sidebar.filter.addProject":`添加项目…`,"sidebar.filter.noProjects":`还没有项目`,"sidebar.fleet.attention":`{count} 个需要你`,"sidebar.fleet.running":`{count} 个运行中`,"sidebar.fleet.label":`{attention} 个代理需要你,{running} 个运行中,打开全部代理`,"menu.rename":`重命名`,"composer.placeholderRunning":`运行中:{queue} 排队,{steer} 插话`,"composer.placeholderRunningQueueOnly":`运行中:{queue} 排队`,"composer.placeholderRunningTouch":`运行中:点发送排队,长按发送插话`,"composer.editQueued":`编辑排队消息`,"composer.cancelQueued":`取消排队`,"composer.plusMenu":`添加附件、技能或语音输入`,"composer.modeChip":`审批与执行方式`,"composer.goalShort":`Goal`,"composer.teamShort":`Team`,"composer.cycleRunMode":`切换`,"composer.contextUsage":`上下文`,"composer.sessionTokens":`本会话`,"composer.cacheHitLabel":`缓存命中`,"transcript.allDone":`全部完成`,"transcript.copyMarkdown":`复制为 Markdown`,"card.holdToApprove":`按住允许`,"card.holdHint":`高风险操作需按住 0.6 秒`,"card.moreWaiting":`还有 {count} 项等你处理`,"shortcuts.cycleRunMode":`切换执行方式(Plan / Goal / Team)`,"project.moveUpShort":`上移`,"project.moveDownShort":`下移`,"triage.answer":`回答`,"overview.doneUnread":`已完成 · 未读`,"overview.waited":`已等 {wait}`,"overview.ran":`已运行 {time}`,"overview.finishedAt":`{time} 完成`,"overview.openToHandle":`打开处理`,"overview.log":`日志`,"overview.retryNamed":`重试 {title}`,"overview.subAgents":`子代理 {running}/{total}`,"overview.startNow":`立即开始`,"overview.queuedAfter":`排在「{title}」之后`,"overview.queuedAfterUnknown":`等前一个任务结束`,"overview.queuePosition":`第 {n} 位`,"overview.empty":`还没有代理在运行`,"overview.newTask":`新任务`,"overview.widgets":`已放置的组件`,"overview.subAgentSlots":`子代理 {running}/{max}`,"overview.todayTokens":`今日 {tokens} tok`,"overview.memory":`内存 {memory}`,"overview.systemLoading":`正在读取系统信息…`,"overview.systemUnavailable":`暂时读不到系统信息`,"overview.projectAttention":`{count} 个需要你`,"overview.projectRunning":`{count} 个运行中`,"overview.projectQueued":`{count} 个排队`,"overview.projectDone":`{count} 个今天完成`,"question.title":`代理在问你`,"question.label":`代理的提问`,"question.waiting":`还有 {count} 个提问等你回答`,"question.moreAfter":`之后还有 {count} 个`,"question.failed":`没能提交回答,请再试一次(可能已经在别处回答过)`,"question.other":`其他…`,"question.otherLabel":`其他回答:{question}`,"question.otherPlaceholder":`写下你的回答`,"question.skip":`跳过`,"question.submit":`提交`,"question.answerNamed":`回答“{title}”:{option}`,"question.open":`打开回答`},en:{"page.title":`All agents`,"page.summary":`{agents} agents · {projects} projects · {running} running`,"page.loading":`Loading agents…`,"page.error":`Sessions could not be loaded`,"page.errorHint":`Check that the local runtime is online, then retry.`,"page.retry":`Retry`,"lane.attention":`Needs you`,"lane.running":`Running`,"lane.queued":`Queued`,"lane.done":`Done`,"lane.orderAttention":`Longest wait first`,"lane.orderRunning":`By start time`,"lane.orderQueued":`Queue order`,"lane.orderDone":`Newest first`,"lane.history":`All sessions`,"status.approval":`Awaiting approval`,"status.failed":`Failed`,"status.failedHandled":`Failed · seen`,"status.running":`Running`,"status.queued":`Queued`,"status.done":`Done`,"status.stopped":`Stopped`,"filter.projects":`Projects`,"filter.projectsTitle":`Project: {projects}`,"filter.listSeparator":`, `,"filter.statuses":`Status`,"filter.statusTitle":`Status: {statuses}`,"filter.noProject":`No project`,"filter.emptyTitle":`No cards match these filters`,"filter.emptyHint":`Pick another project or status, or clear the filters.`,"filter.clear":`Clear filters`,"group.label":`Group by`,"group.lane":`By status`,"group.project":`By project`,"card.label":`{title}, {status}`,"card.more":`More actions for “{title}”`,"card.pinned":`Pinned`,"card.standard":`Routine`,"card.critical":`High risk`,"card.criticalWithReason":`High risk · {reason}`,"card.approvalLoading":`Loading approval details…`,"card.approvalUnavailable":`Approval details are unavailable; check them in the session.`,"card.moreApprovals":`{count} more approvals waiting`,"card.moreApprovalsCritical":`{count} more approvals waiting, including high-risk ones`,"card.deny":`Deny`,"card.approve":`Allow`,"card.approveCritical":`Allow…`,"card.retry":`Retry`,"card.archive":`Archive`,"card.files":`{count} files`,"card.expand":`Show full command`,"card.expandArgs":`Show all arguments`,"card.collapse":`Collapse`,"card.subAgent":`Sub-agent`,"card.subAgentProgress":`Sub-agents: {running} of {total} running`,"activity.starting":`Starting`,"activity.thinking":`Thinking`,"activity.responding":`Responding`,"activity.working":`Working`,"activity.compacting":`Compacting context`,"menu.open":`Open session`,"menu.pin":`Pin`,"menu.unpin":`Unpin`,"menu.markHandled":`Mark as handled`,"menu.copyLink":`Copy session link`,"menu.archive":`Archive`,"action.failed":`That didn't go through. Try again shortly.`,"action.archived":`Archived: {title}`,"action.copied":`Session link copied`,"action.copyFailed":`Couldn't copy the link`,"confirm.title":`Confirm high-risk action`,"confirm.titleStandard":`Confirm approval`,"confirm.description":`The command guard flagged this approval as high risk. Check the full arguments before allowing it.`,"confirm.descriptionCritical":`This is a high-risk action, such as installing a global plugin or submitting a form. Check the full arguments before allowing it.`,"confirm.descriptionStandard":`Check the full arguments before allowing it.`,"confirm.descriptionLoading":`Loading approval details…`,"confirm.session":`Session`,"confirm.tool":`Tool`,"confirm.cwd":`Working folder`,"confirm.fullArgs":`Full arguments`,"confirm.loading":`Loading approval details. You can allow it once they arrive.`,"confirm.hint":`Hold the confirm button for 0.6 s, or press`,"confirm.hintTouch":`Hold the confirm button for 0.6 s`,"confirm.hold":`Hold to confirm`,"confirm.approving":`Allowing…`,"confirm.cancel":`Cancel`,"triage.progress":`Triage {index}/{total}`,"triage.approve":`Allow`,"triage.deny":`Deny`,"triage.retry":`Retry`,"triage.open":`Open`,"triage.exit":`Exit`,"triage.finished":`All handled`,"triage.nothing":`Nothing needs you`,"announce.moved":`{title} moved to {lane}`,"launch.title":`New task`,"launch.inputLabel":`Task description`,"launch.placeholder":`Describe the task… (Tab switches project)`,"launch.placeholderTouch":`Describe the task…`,"launch.projects":`Recent projects`,"launch.projectLabel":`Project: {project}`,"launch.defaultProject":`Default folder`,"launch.noProject":`No project`,"launch.model":`Model`,"launch.modelTitle":`Model: {model}`,"launch.defaultModel":`Default model`,"launch.loadingModels":`Loading models…`,"launch.thinking":`Thinking level`,"launch.thinkingDefault":`Model default`,"launch.dispatch":`Dispatch`,"launch.sending":`Dispatching {count}`,"launch.noModel":`No model is available yet`,"launch.configureModels":`Set up models`,"launch.failed":`Dispatch failed. Your draft was kept.`,"launch.failedWithReason":`Dispatch failed: {reason} (draft kept)`,"launch.dispatched":`Dispatched. Follow its progress in All agents.`,"launch.fullAccessOnce":`This dispatch only, not remembered`,"launch.startNowChip":`Start now`,"launch.startAfterChip":`After {title}`,"launch.startAfterShort":`After “{title}”`,"launch.startAfterNote":`Queued after “{title}”: starts when that run ends.`,"launch.startAfterGone":`a finished session`,"launch.startAfterLabel":`When to start`,"launch.startAfterRunning":`Running`,"launch.startAfterQueued":`Queued`,"launch.startAfterHint":`Starts when that run ends, whether it finishes, fails or is stopped. You can still start it from All agents.`,"dispatch.title":`New task`,"dispatch.description":`You stay on this page; the new agent shows up under Running in the sidebar.`,"dispatch.descriptionPhone":`You stay on this page; the new agent shows up under Running in the drawer.`,"dispatch.hint":`↵ dispatch · ⌘/Ctrl+↵ dispatch and open · ⇧↵ new line`,"dispatch.reopen":`Reopen`,"project.actionsFor":`Actions for {project}`,"project.new":`New project…`,"project.manage":`Manage projects…`,"project.newTaskHere":`New task in this project`,"project.rename":`Rename…`,"project.resetName":`Use folder name`,"project.delete":`Delete project…`,"project.chosen":`Project "{project}" selected. Describe the first task to dispatch it.`,"project.pickerDescription":`Choose the project folder. It becomes the launch console target.`,"project.renameDescription":`Customize the project name shown in All agents and the dispatch dialog. The working directory stays the same.`,"project.manageTitle":`Manage projects`,"project.manageDescription":`Change the order and names of your projects. Projects without chats can be removed without touching their folders or files. Deleting a project with chats also deletes all of its chats.`,"project.sessions":`{count} chats`,"project.folderName":`Folder: {name}`,"project.moveUp":`Move {project} up`,"project.moveDown":`Move {project} down`,"project.renameNamed":`Rename {project}`,"project.resetNamed":`Use folder name for {project}`,"project.deleteWithChatsNamed":`Delete {project} and its chats`,"project.removeNamed":`Remove project {project}`,"project.listLabel":`Projects`,"project.empty":`No projects yet`,"project.emptyHint":`Create a project, then describe its first task in the launch console.`,"project.loading":`Loading projects…`,"project.error":`Couldn't load projects`,"project.deleting":`Deleting…`,"project.done":`Done`,"phone.openSession":`Open session`,"phone.running":`Running {elapsed}`,"phone.changes":`+{count} changes`,"phone.changesLabel":`View the {count} files changed in this session`,"phone.openInspector":`Changes, terminal, files and preview`,"phone.inspectorDescription":`Changes, terminal, sources and web preview for this session`,"phone.earlierTurns":`Show earlier conversation: {summary}`,"phone.previousTurn":`Previous turn`,"session.moveWorkspace":`Move workspace…`,"session.goalMode":`Goal mode`,"session.workflowRuns":`Workflow runs`,"session.workflowRunsEmpty":`This session has no workflow runs yet`,"session.plan":`Plan {done}/{total}`,"session.planLabel":`Plan progress: {done} of {total} done`,"session.titleMenu":`{title}: session actions`,"session.tree":`Session tree`,"session.treeBranches":`Session tree: {count} branches`,"session.treeBranches_one":`Session tree: {count} branch`,"session.changedFiles":`{count} files`,"session.changedFiles_one":`{count} file`,"session.changes":`{count} files +{added} −{removed}`,"session.changes_one":`{count} file +{added} −{removed}`,"session.contextUsage":`Context used {percent}%`,"session.withShortcut":`{label} ({shortcut})`,"session.planOpen":`{plan}: view in the inspector`,"inspector.label":`Inspector`,"inspector.tabs":`Inspector tabs`,"inspector.changes":`Changes`,"inspector.changesCount":`Changes {count}`,"inspector.changesScope":`Change scope`,"inspector.scopeSession":`This session`,"inspector.scopeWorkspace":`Workspace`,"inspector.terminal":`Terminal`,"inspector.terminalScope":`Terminal view`,"inspector.processes":`Processes`,"inspector.terminalUnavailable":`This device or runtime does not provide a terminal`,"inspector.files":`Files`,"inspector.preview":`Preview`,"inspector.plan":`Plan`,"inspector.sideChat":`Side chat`,"inspector.closeTab":`Close “{tab}”`,"inspector.add":`Add component tab`,"inspector.addHint":`Components placed in the “session panel” slot show up here as tabs.`,"inspector.openComponents":`Open Components`,"inspector.close":`Hide inspector`,"transcript.operations":`{count} operations`,"transcript.operations_one":`{count} operation`,"transcript.running":`{count} running`,"transcript.failed":`{count} failed`,"transcript.turn":`Turn {count}`,"composer.placeholder":`Reply to the agent, or use / for commands`,"composer.tokens":`{tokens} tok`,"composer.queuedFollowUp":`Queued`,"composer.queuedSteer":`Steer`,"composer.steerNow":`Send as steer`,"composer.steerHint":`The agent reads it at its next step instead of after this run`,"composer.longPressSteer":`While running, press and hold to steer`,"changes.sessionSummary":`{count} files changed in this session`,"changes.workspaceSummary":`{count} uncommitted files in the workspace`,"changes.revertAll":`Revert all`,"changes.more":`More change actions`,"changes.pending":`{count} pending approval`,"changes.revertFile":`Revert this file`,"changes.files":`Changed files`,"changes.diffView":`Diff view`,"changes.unified":`Unified`,"changes.split":`Split`,"changes.splitTooNarrow":`The inspector is narrower than 600 px, too narrow for side by side. Widen it to use this view.`,"changes.approvedAt":`Write approved · {time}`,"changes.pendingAt":`Awaiting approval · {time}`,"changes.revertedAt":`Reverted · {time}`,"changes.statusModified":`Modified`,"changes.statusCreated":`Added`,"changes.statusDeleted":`Deleted`,"changes.statusRenamed":`Renamed`,"inspector.goal":`Goal`,"inspector.team":`Team`,"inspector.subAgents":`Sub-agents`,"shortcuts.agentPanel":`Focus the sidebar session list`,"shortcuts.toggleInspector":`Show / hide inspector`,"shortcuts.previousAgent":`Previous session in sidebar order`,"shortcuts.nextAgent":`Next session in sidebar order`,"shortcuts.steerMessage":`Steer while running`,"shortcuts.shortcutHelp":`Keyboard shortcuts`,"shortcuts.sendMessage":`Send (queues while running)`,"shortcuts.focusSearch":`Focus filter / search`,"shortcuts.groupGlobal":`Global`,"shortcuts.groupBoard":`All agents`,"shortcuts.groupSession":`Session`,"shortcuts.globalHint":`Chords with a modifier also work while typing.`,"shortcuts.boardHint":`All agents page only. Single-letter keys work when focus is not in a text field and can only be letters without modifiers.`,"shortcuts.sessionHint":`Session page only. Esc never navigates back.`,"shortcuts.fixed":`Fixed`,"shortcuts.boardMove":`Move between agents (row focused)`,"shortcuts.boardOpen":`Open the session`,"shortcuts.boardExitTriage":`Leave triage`,"shortcuts.newline":`New line`,"shortcuts.stopRun":`Stop the run (closes an open overlay first)`,"shortcuts.helpDescription":`Bindings on this device. Changes show up here right away.`,"shortcuts.helpCustomize":`Customize in Settings`,"home.draftTitle":`New task`,"home.draftSubtitle":`A session is created when you send the first message`,"home.draftHeading":`Start a new task`,"home.draftHint":`Pick a project and describe the task. After the first message this becomes its session; other agents stay in All agents.`,"home.composerLabel":`New task composer`,"home.placeholder":`Describe the task… ({send} sends, Tab switches project)`,"home.placeholderUnbound":`Describe the task… (Tab switches project)`,"home.placeholderTouch":`Describe the task…`,"home.send":`Send`,"home.sending":`Creating the session…`,"home.loading":`Opening your last session…`,"home.loadFailed":`Couldn't load sessions`,"home.loadFailedHint":`Your last session can't be confirmed right now. Retry, or start a new task instead.`,"home.startDraft":`Start a new task`,"home.goHome":`Go to home`,"shortcuts.openSession":`Open session home`,"shortcuts.sessionTree":`Session tree (branches and marks)`,"shortcuts.sideChat":`Side chat`,"shortcuts.cycleFocusRegion":`Move focus between sidebar, top bar, conversation and composer`,"shortcuts.groupSidebar":`Sidebar`,"shortcuts.sidebarHint":`When a session row in the sidebar has focus. A / D follow the All agents allow / deny keys and only handle standard approvals.`,"shortcuts.sidebarMove":`Move between session rows`,"shortcuts.sidebarOpen":`Open session`,"sidebar.reason.failed":`Run failed`,"sidebar.reason.approval":`Waiting for your approval`,"sidebar.reason.criticalApproval":`High-risk approval`,"sidebar.reason.question":`Waiting for your answer`,"sidebar.reason.questions":`Waiting for your answer · {count} questions`,"sidebar.reason.questions_one":`Waiting for your answer · {count} question`,"sidebar.reason.questionCount":`{count} questions`,"sidebar.reason.questionCount_one":`{count} question`,"sidebar.group.attention":`Needs you`,"sidebar.group.running":`Running`,"sidebar.group.queued":`Queued`,"sidebar.group.pinned":`Pinned`,"sidebar.group.done":`Done today`,"sidebar.loading":`Loading sessions`,"sidebar.error":`Couldn't load sessions`,"sidebar.retry":`Retry`,"sidebar.empty":`No agents running yet. Start one with New task.`,"sidebar.emptyAttention":`Nothing needs you`,"sidebar.emptyRunning":`No agents running`,"sidebar.moreRunning":`{count} more →`,"sidebar.allDone":`All →`,"sidebar.history":`History`,"sidebar.announce":`{title} needs you: {reason}`,"sidebar.announceSeparator":`; `,"sidebar.attentionRow":`{title}, {reason}, waiting {wait}`,"sidebar.attentionRowNoWait":`{title}, {reason}`,"sidebar.unread":`Unread`,"sidebar.deny":`Deny`,"sidebar.approve":`Allow`,"sidebar.open":`Open`,"sidebar.denyNamed":`Deny the request from {title}`,"sidebar.approveNamed":`Allow the request from {title}`,"sidebar.openNamed":`Open {title} to handle it`,"sidebar.rowMenu":`More actions for {title}`,"sidebar.renameTitle":`Rename session`,"sidebar.renameLabel":`Session title`,"sidebar.renameSave":`Save`,"sidebar.renamed":`Session title updated`,"sidebar.railAttention":`{count} agents need you, open all agents`,"sidebar.railAttention_one":`{count} agent needs you, open all agents`,"sidebar.railRunning":`{count} agents running, open all agents`,"sidebar.railRunning_one":`{count} agent running, open all agents`,"sidebar.filter.all":`All`,"sidebar.filter.projectActions":`Project actions`,"sidebar.filter.addProject":`Add project…`,"sidebar.filter.noProjects":`No projects yet`,"sidebar.fleet.attention":`{count} need you`,"sidebar.fleet.running":`{count} running`,"sidebar.fleet.label":`{attention} need you, {running} running, open all agents`,"menu.rename":`Rename`,"composer.placeholderRunning":`Running: {queue} to queue, {steer} to steer`,"composer.placeholderRunningQueueOnly":`Running: {queue} to queue`,"composer.placeholderRunningTouch":`Running: tap send to queue, hold send to steer`,"composer.editQueued":`Edit queued message`,"composer.cancelQueued":`Cancel queued message`,"composer.plusMenu":`Add attachments, skills or voice input`,"composer.modeChip":`Approval and run mode`,"composer.goalShort":`Goal`,"composer.teamShort":`Team`,"composer.cycleRunMode":`Cycle`,"composer.contextUsage":`Context`,"composer.sessionTokens":`This session`,"composer.cacheHitLabel":`Cache hits`,"transcript.allDone":`all done`,"transcript.copyMarkdown":`Copy as Markdown`,"card.holdToApprove":`Hold to allow`,"card.holdHint":`High-risk: hold for 0.6 s`,"card.moreWaiting":`{count} more waiting for you`,"shortcuts.cycleRunMode":`Cycle run mode (Plan / Goal / Team)`,"project.moveUpShort":`Move up`,"project.moveDownShort":`Move down`,"triage.answer":`Answer`,"overview.doneUnread":`Done · unread`,"overview.waited":`waited {wait}`,"overview.ran":`running for {time}`,"overview.finishedAt":`finished at {time}`,"overview.openToHandle":`Open to handle`,"overview.log":`Log`,"overview.retryNamed":`Retry {title}`,"overview.subAgents":`Sub-agents {running}/{total}`,"overview.startNow":`Start now`,"overview.queuedAfter":`After “{title}”`,"overview.queuedAfterUnknown":`Waiting for an earlier task`,"overview.queuePosition":`No. {n} in queue`,"overview.empty":`No agents are running yet`,"overview.newTask":`New task`,"overview.widgets":`Placed components`,"overview.subAgentSlots":`Sub-agents {running}/{max}`,"overview.todayTokens":`{tokens} tok today`,"overview.memory":`Memory {memory}`,"overview.systemLoading":`Reading system info…`,"overview.systemUnavailable":`System info is unavailable right now`,"overview.projectAttention":`{count} need you`,"overview.projectAttention_one":`{count} needs you`,"overview.projectRunning":`{count} running`,"overview.projectQueued":`{count} queued`,"overview.projectDone":`{count} done today`,"question.title":`The agent is asking you`,"question.label":`Agent question`,"question.waiting":`{count} more questions are waiting for you`,"question.moreAfter":`{count} more after this`,"question.failed":`Couldn't send the answer. Try again (it may have been answered elsewhere).`,"question.other":`Other…`,"question.otherLabel":`Other answer: {question}`,"question.otherPlaceholder":`Write your answer`,"question.skip":`Skip`,"question.submit":`Submit`,"question.answerNamed":`Answer “{title}”: {option}`,"question.open":`Open to answer`}};export{e as boardMessages};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./check-2vYc6QaP.js";import{i}from"./dist-Cfh4kzCK.js";import{c as a,i as o,o as s,r as c,s as l}from"./dist-B_a0oV4U.js";import{t as u}from"./dist-TksYpDID.js";import{t as d}from"./utils-C8uzG5AZ.js";var f=e(t(),1),p=n(),m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0}),g=`Checkbox`,[_,v]=l(g),[y,b]=_(g);function x(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:s,name:c,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:m}=e,[h,_]=o({prop:n,defaultProp:i??!1,onChange:l,caller:g}),[v,b]=f.useState(null),[x,S]=f.useState(null),C=f.useRef(!1),[w,T]=f.useReducer(e=>e+1,0),E=!v||!!s||!!v.closest(`form`),D={checked:h,disabled:a,setChecked:_,control:v,setControl:b,name:c,form:s,value:d,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:u,defaultChecked:!A(i)&&i,isFormControl:E,bubbleInput:x,setBubbleInput:S};return(0,p.jsx)(y,{scope:t,...D,children:k(m)?m(D):r})}h(x,`CheckboxProvider`);var S=`CheckboxTrigger`,C=f.forwardRef(h(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o){let{control:c,value:l,disabled:u,checked:d,required:m,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:v,onUserInteraction:y,isFormControl:x,bubbleInput:C}=b(S,e),w=i(o,g),T=f.useRef(d);return f.useEffect(()=>{let e=c?.form;if(e){let t=h(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[c,_]),(0,p.jsx)(a.button,{type:`button`,role:`checkbox`,"aria-checked":A(d)?`mixed`:d,"aria-required":m,"data-state":j(d),"data-disabled":u?``:void 0,disabled:u,value:l,...r,ref:w,onKeyDown:s(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:s(n,e=>{y(),_(e=>A(e)?!0:!e),C&&x&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})})},`CheckboxTrigger`)),w=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,p.jsx)(x,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(C,{...d,ref:t,__scopeCheckbox:n}),e&&(0,p.jsx)(O,{__scopeCheckbox:n})]})})},`Checkbox`)),T=`CheckboxIndicator`,E=f.forwardRef(h(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,o=b(T,n);return(0,p.jsx)(c,{present:r||A(o.checked)||o.checked===!0,children:(0,p.jsx)(a.span,{"data-state":j(o.checked),"data-disabled":o.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),D=`CheckboxBubbleInput`,O=f.forwardRef(h(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:o,hasConsumerStoppedPropagationRef:c,userInteractionCount:l,checked:d,defaultChecked:m,required:h,disabled:g,name:_,value:v,form:y,bubbleInput:x,setBubbleInput:S}=b(D,e),C=i(r,S),w=u(o),T=f.useRef(!1),E=f.useRef(d),O=f.useRef(l);f.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=l!==O.current;O.current=l;let i=E.current!==d;E.current=d;let a=!(r&&c.current);if(i&&n){T.current=!r;let t=new Event(`click`,{bubbles:a});e.indeterminate=A(d),n.call(e,!A(d)&&d),e.dispatchEvent(t),T.current=!1}},[x,d,c,l]);let k=f.useRef(!A(d)&&d);return(0,p.jsx)(a.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:v,form:y,...n,tabIndex:-1,ref:C,onClick:s(t,e=>{T.current&&e.stopPropagation()}),style:{...n.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function k(e){return typeof e==`function`}h(k,`isFunction`);function A(e){return e===`indeterminate`}h(A,`isIndeterminate`);function j(e){return A(e)?`indeterminate`:e?`checked`:`unchecked`}h(j,`getState`);function M({className:e,...t}){return(0,p.jsx)(w,{"data-slot":`checkbox`,className:d(`peer relative flex size-4 shrink-0 items-center justify-center rounded-xs border border-input bg-panel transition-colors group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive data-checked:border-star data-checked:bg-star data-checked:text-on-accent`,e),...t,children:(0,p.jsx)(E,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,p.jsx)(r,{})})})}export{M as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{o as n}from"./vendor-state-GkUciC5H.js";import{t as r}from"./api-DVgYxLec.js";var i=e(t(),1),a=`(min-width: 960px) and (min-height: 640px)`;function o(e){let[t,n]=i.useState(()=>window.matchMedia(e).matches);return i.useEffect(()=>{let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function s(){return o(`(max-width: 650px)`)}function c(){return o(a)}function l(){return o(`(pointer: coarse)`)}function u(){return typeof window<`u`&&window.__PISPER_MOBILE_APP__===!0}var d=null,f=!1,p=n()(e=>({client:u()?`mobile-app`:`web`,loaded:u(),load:({refresh:t=!0}={})=>d||(!t&&f?Promise.resolve():(d=(async()=>{let t=u();t&&e({client:`mobile-app`,loaded:!0});try{let n=await r(`/api/client-info`);e({client:t||n.client===`mobile-app`?`mobile-app`:`web`,loaded:!0})}catch{e({client:t?`mobile-app`:`web`,loaded:!0})}})().finally(()=>{f=!0,d=null}),d))}));function m(){return p(e=>e.client===`mobile-app`)}export{c as a,s as i,m as n,o,l as r,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{i as r,n as i}from"./dist-Cfh4kzCK.js";import{a,c as o,i as s,n as c,o as l,s as u,t as d}from"./dist-B_a0oV4U.js";var f=e(t(),1),p=n(),m=Object.defineProperty,h=(e,t)=>m(e,`name`,{value:t,configurable:!0});function g(e){let t=e+`CollectionProvider`,[n,a]=u(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=h(e=>{let{scope:t,children:n}=e,r=f.useRef(null),i=f.useRef(new Map).current;return(0,p.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);c.displayName=t;let l=e+`CollectionSlot`,d=i(l),m=f.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=s(l,n),o=r(t,a.collectionRef);return(0,p.jsx)(d,{ref:o,children:i})});m.displayName=l;let g=e+`CollectionItemSlot`,_=`data-radix-collection-item`,v=i(g),y=f.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=f.useRef(null),c=r(t,o),l=s(g,n);return f.useEffect(()=>(l.itemMap.set(o,{ref:o,...a}),()=>void l.itemMap.delete(o))),(0,p.jsx)(v,{[_]:``,ref:c,children:i})});y.displayName=g;function b(t){let n=s(e+`CollectionConsumer`,t);return f.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return h(b,`useCollection`),[{Provider:c,Slot:m,ItemSlot:y},b,a]}h(g,`createCollection`);var _=new WeakMap,v=class e extends Map{static#e=h(this,`OrderedDict`);#t;constructor(e){super(e),this.#t=[...super.keys()],_.set(this,!0)}set(e,t){return _.get(this)&&(this.has(e)?this.#t[this.#t.indexOf(e)]=e:this.#t.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#t.length,a=x(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#t],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#t.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#t.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#t.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#t.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#t=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#t.splice(this.#t.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=y(this.#t,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=y(this.#t,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#t.indexOf(e)}keyAt(e){return y(this.#t,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function y(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=b(e,t);return n===-1?void 0:e[n]}h(y,`at`);function b(e,t){let n=e.length,r=x(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}h(b,`toSafeIndex`);function x(e){return e!==e||e===0?0:Math.trunc(e)}h(x,`toSafeInteger`);function S(e){let t=e+`CollectionProvider`,[n,a]=u(t),[o,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new v,setItemMap:h(()=>void 0,`setItemMap`)}),c=h(({state:e,...t})=>e?(0,p.jsx)(d,{...t,state:e}):(0,p.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=h(e=>{let t=S();return(0,p.jsx)(d,{...e,state:t})},`CollectionInit`);l.displayName=t+`Init`;let d=h(e=>{let{scope:t,children:n,state:i}=e,a=f.useRef(null),[s,c]=f.useState(null),l=r(a,c),[u,d]=i;return f.useEffect(()=>{if(!s)return;let e=E(()=>{});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s]),(0,p.jsx)(o,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:a,collectionElement:s,children:n})},`CollectionProviderImpl`);d.displayName=t+`Impl`;let m=e+`CollectionSlot`,g=i(m),_=f.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=s(m,n),o=r(t,a.collectionRef);return(0,p.jsx)(g,{ref:o,children:i})});_.displayName=m;let y=e+`CollectionItemSlot`,b=i(y),x=f.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=f.useRef(null),[c,l]=f.useState(null),u=r(t,o,l),{setItemMap:d}=s(y,n),m=f.useRef(a);C(m.current,a)||(m.current=a);let h=m.current;return f.useEffect(()=>{let e=h;return d(t=>c?t.has(c)?t.set(c,{...e,element:c}).toSorted(T):(t.set(c,{...e,element:c}),t.toSorted(T)):t),()=>{d(e=>!c||!e.has(c)?e:(e.delete(c),new v(e)))}},[c,h,d]),(0,p.jsx)(b,{"data-radix-collection-item":``,ref:u,children:i})});x.displayName=y;function S(){return f.useState(new v)}h(S,`useInitCollection`);function w(t){let{itemMap:n}=s(e+`CollectionConsumer`,t);return n}return h(w,`useCollection`),[{Provider:c,Slot:_,ItemSlot:x},{createCollectionScope:a,useCollection:w,useInitCollection:S}]}h(S,`createCollection`);function C(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}h(C,`shallowEqual`);function w(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}h(w,`isElementPreceding`);function T(e,t){return!e[1].element||!t[1].element?0:w(e[1].element,t[1].element)?-1:1}h(T,`sortByDocumentPosition`);function E(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}h(E,`getChildListObserver`);var D=Object.defineProperty,O=(e,t)=>D(e,`name`,{value:t,configurable:!0}),k=f.createContext(void 0);function A(e){let t=f.useContext(k);return e||t||`ltr`}O(A,`useDirection`);var j=Object.defineProperty,M=(e,t)=>j(e,`name`,{value:t,configurable:!0}),N=!1;function P(){let[e,t]=f.useState(N);return f.useEffect(()=>{N||(N=!0,t(!0))},[]),e}M(P,`useIsHydrated`);var F=f.useSyncExternalStore;function I(){return()=>{}}M(I,`subscribe`);function L(){return F(I,()=>!0,()=>!1)}M(L,`useIsHydratedModern`);var R=typeof F==`function`?L:P,z=Object.defineProperty,B=(e,t)=>z(e,`name`,{value:t,configurable:!0}),V=`rovingFocusGroup.onEntryFocus`,H={bubbles:!1,cancelable:!0},U=`RovingFocusGroup`,[W,G,K]=g(U),[q,J]=u(U,[K]),[Y,ee]=q(U),te=f.forwardRef(B(function(e,t){return(0,p.jsx)(W.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(W.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(ne,{...e,ref:t})})})},`RovingFocusGroup`)),ne=f.forwardRef(B(function(e,t){let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:h,onEntryFocus:g,preventScrollOnEntryFocus:_=!1,...v}=e,y=f.useRef(null),b=r(t,y),x=A(c),[S,C]=s({prop:u,defaultProp:m??null,onChange:h,caller:U}),[w,T]=f.useState(!1),E=d(g),D=G(n),O=f.useRef(!1),[k,j]=f.useState(0);return f.useEffect(()=>{let e=y.current;if(e)return e.addEventListener(V,E),()=>e.removeEventListener(V,E)},[E]),(0,p.jsx)(Y,{scope:n,orientation:i,dir:x,loop:a,currentTabStopId:S,onItemFocus:f.useCallback(e=>C(e),[C]),onItemShiftTab:f.useCallback(()=>T(!0),[]),onFocusableItemAdd:f.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>j(e=>e-1),[]),children:(0,p.jsx)(o.div,{tabIndex:w||k===0?-1:0,"data-orientation":i,...v,ref:b,style:{outline:`none`,...e.style},onMouseDown:l(e.onMouseDown,()=>{O.current=!0}),onFocus:l(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!w){let t=new CustomEvent(V,H);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Q([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),_)}}O.current=!1}),onBlur:l(e.onBlur,()=>T(!1))})})},`RovingFocusGroupImpl`)),re=`RovingFocusGroupItem`,ie=f.forwardRef(B(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:u,...d}=e,m=c(),h=s||m,g=ee(re,n),_=g.currentTabStopId===h,v=G(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:x}=g,S=R();return a(()=>{if(!(!S||!r))return y(),()=>b()},[S,r,y,b]),f.useEffect(()=>{if(!(S||!r))return y(),()=>b()},[S,r,y,b]),(0,p.jsx)(W.ItemSlot,{scope:n,id:h,focusable:r,active:i,children:(0,p.jsx)(o.span,{tabIndex:_?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:l(e.onMouseDown,e=>{r?g.onItemFocus(h):e.preventDefault()}),onFocus:l(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:l(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){g.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Z(e,g.orientation,g.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=v().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=g.loop?$(n,r+1):n.slice(r+1)}setTimeout(()=>Q(n))}}),children:typeof u==`function`?u({isCurrentTabStop:_,hasTabStop:x!=null}):u})})},`RovingFocusGroupItem`)),ae={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function X(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}B(X,`getDirectionAwareKey`);function Z(e,t,n){let r=X(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return ae[r]}B(Z,`getFocusIntent`);function Q(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}B(Q,`focusFirst`);function $(e,t){return e.map((n,r)=>e[(t+r)%e.length])}B($,`wrapArray`);var oe=te,se=ie;export{g as a,A as i,oe as n,J as r,se as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,n,r}from"./vendor-react-DwNgTV1j.js";import{i}from"./dist-Cfh4kzCK.js";import{a,c as o,s,t as c}from"./dist-B_a0oV4U.js";import{t as l}from"./dist-TksYpDID.js";var u=e(t(),1),d=[`top`,`right`,`bottom`,`left`],f=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=e=>({x:e,y:e}),_={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function v(e,t,n){return p(e,f(t,n))}function y(e,t){return typeof e==`function`?e(t):e}function b(e){return e.split(`-`)[0]}function x(e){return e.split(`-`)[1]}function S(e){return e===`x`?`y`:`x`}function C(e){return e===`y`?`height`:`width`}function w(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function T(e){return S(w(e))}function E(e,t,n){n===void 0&&(n=!1);let r=x(e),i=T(e),a=C(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=F(o)),[o,F(o)]}function D(e){let t=F(e);return[O(e),t,O(t)]}function O(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var k=[`left`,`right`],A=[`right`,`left`],j=[`top`,`bottom`],M=[`bottom`,`top`];function N(e,t,n){switch(e){case`top`:case`bottom`:return n?t?A:k:t?k:A;case`left`:case`right`:return t?j:M;default:return[]}}function P(e,t,n,r){let i=x(e),a=N(b(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(O)))),a}function F(e){let t=b(e);return _[t]+e.slice(t.length)}function I(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:I(e)}function L(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function R(e,t,n){let{reference:r,floating:i}=e,a=w(t),o=T(t),s=C(o),c=b(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=x(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function z(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=y(t,e),p=ee(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=L(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=L(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/v.y,bottom:(b.bottom-h.bottom+p.bottom)/v.y,left:(h.left-b.left+p.left)/v.x,right:(b.right-h.right+p.right)/v.x}}var te=50,ne=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:z},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=R(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<te&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=R(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},re=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=y(e,t)||{};if(l==null)return{};let d=ee(u),p={x:n,y:r},m=T(i),h=C(m),g=await o.getDimensions(l),_=m===`y`,b=_?`top`:`left`,S=_?`bottom`:`right`,w=_?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],D=p[m]-a.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),k=O?O[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(O)))&&(k=s.floating[w]||a.floating[h]);let A=E/2-D/2,j=k/2-g[h]/2-1,M=f(d[b],j),N=f(d[S],j),P=k-g[h]-N,F=k/2-g[h]/2+A,I=v(M,F,P),L=!c.arrow&&x(i)!=null&&F!==I&&a.reference[h]/2-(F<M?M:N)-g[h]/2<0,R=L?F<M?F-M:F-P:0;return{[m]:p[m]+R,data:{[m]:I,centerOffset:F-I-R,...L&&{alignmentOffset:R}},reset:L}}}),ie=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=y(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=b(r),_=w(o),v=b(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(v||!m?[F(o)]:D(o)),C=p!==`none`;!d&&C&&S.push(...P(o,m,p,x));let T=[o,...S],O=await s.detectOverflow(t,h),k=[],A=i.flip?.overflows||[];if(l&&k.push(O[g]),u){let e=E(r,a,x);k.push(O[e[0]],O[e[1]])}if(A=[...A,{placement:r,overflows:k}],!k.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=T[e];if(t&&(u!==`alignment`||_===w(t)||A.every(e=>w(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:A},reset:{placement:t}};let n=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=A.filter(e=>{if(C){let t=w(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function oe(e){return d.some(t=>e[t]>=0)}var se=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=y(e,t);switch(i){case`referenceHidden`:{let e=ae(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:oe(e)}}}case`escaped`:{let e=ae(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:oe(e)}}}default:return{}}}}},ce=new Set([`left`,`top`]);async function le(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=b(n),s=x(n),c=w(n)===`y`,l=ce.has(o)?-1:1,u=a&&c?-1:1,d=y(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ue=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await le(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},de=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=y(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=w(i),p=S(f),m=u[p],h=u[f],g=(e,t)=>v(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},fe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=y(e,t),u={x:n,y:r},d=w(i),f=S(d),p=u[f],m=u[d],h=y(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ce.has(b(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},pe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=y(e,t),c=await i.detectOverflow(t,s),l=b(n),u=x(n),d=w(n)===`y`,{width:m,height:h}=r.floating,g,_;l===`top`||l===`bottom`?(g=l,_=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(_=l,g=u===`end`?`top`:`bottom`);let v=h-c.top-c.bottom,S=m-c.left-c.right,C=f(h-c[g],v),T=f(m-c[_],S),E=t.middlewareData.shift,D=!E,O=C,k=T;E!=null&&E.enabled.x&&(k=S),E!=null&&E.enabled.y&&(O=v),D&&!u&&(d?k=m-2*p(c.left,c.right):O=h-2*p(c.top,c.bottom)),await o({...t,availableWidth:k,availableHeight:O});let A=await i.getDimensions(a.floating);return m!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function me(){return typeof window<`u`}function B(e){return he(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((he(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function he(e){return me()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return me()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return me()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function ge(e){return!me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function _e(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ve(e){return/^(table|td|th)$/.test(B(e))}function ye(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var be=/transform|translate|scale|rotate|perspective|filter/,xe=/paint|layout|strict|content/,G=e=>!!e&&e!==`none`,Se;function Ce(e){let t=U(e)?q(e):e;return G(t.transform)||G(t.translate)||G(t.scale)||G(t.rotate)||G(t.perspective)||!Te()&&(G(t.backdropFilter)||G(t.filter))||be.test(t.willChange||``)||xe.test(t.contain||``)}function we(e){let t=J(e);for(;W(t)&&!K(t);){if(Ce(t))return t;if(ye(t))return null;t=J(t)}return null}function Te(){return Se??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Se}function K(e){return/^(html|body|#document)$/.test(B(e))}function q(e){return V(e).getComputedStyle(e)}function Ee(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(B(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ge(e)&&e.host||H(e);return ge(t)?t.host:t}function De(e){let t=J(e);return K(t)?(e.ownerDocument||e).body:W(t)&&_e(t)?t:De(t)}function Y(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=De(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=Oe(a);return t.concat(a,a.visualViewport||[],_e(r)?r:[],e&&n?Y(e):[])}return t.concat(r,Y(r,[],n))}function Oe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ke(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=m(n)!==a||m(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ae(e){return U(e)?e:e.contextElement}function X(e){let t=Ae(e);if(!W(t))return g(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ke(t),o=(a?m(n.width):n.width)/r,s=(a?m(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var je=g(0);function Me(e){let t=V(e);return!Te()||!t.visualViewport?je:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ne(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function Z(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ae(e),o=g(1);t&&(r?U(r)&&(o=X(r)):o=X(e));let s=Ne(a,n,r)?Me(a):g(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=Oe(n);for(;i&&t!==n;){let e=X(i),t=i.getBoundingClientRect(),r=q(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=Oe(n)}}return L({width:u,height:d,x:c,y:l})}function Pe(e,t){let n=Ee(e).scrollLeft;return t?t.left+n:Z(H(e)).left+n}function Fe(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pe(e,n),y:n.top+t.scrollTop}}function Ie(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ye(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=g(1),u=g(0),d=W(r);if((d||!a)&&((B(r)!==`body`||_e(o))&&(c=Ee(r)),d)){let e=Z(r);l=X(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Fe(o,c):g(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Le(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Re(e){let t=Ee(e),n=e.ownerDocument.body,r=p(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=p(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Pe(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=p(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ze=25;function Be(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Te()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Pe(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ze&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ve(e,t){let n=Z(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=X(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function He(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Be(e,n,t);else if(t===`document`)r=Re(H(e));else if(U(t))r=Ve(t,n);else{let n=Me(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return L(r)}function Ue(e,t){let n=t.get(e);if(n)return n;let r=Y(e,[],!1).filter(e=>U(e)&&B(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;U(o)&&!K(o);){let e=q(o),t=Ce(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function We(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ye(t)?[]:Ue(t,this._c):[].concat(n),r],o=He(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=He(t,a[e],i);s=p(n.top,s),c=f(n.right,c),l=f(n.bottom,l),u=p(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ge(e){let{width:t,height:n}=ke(e);return{width:t,height:n}}function Ke(e,t,n){let r=W(t),i=H(t),a=n===`fixed`,o=Z(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=g(0);if((r||!a)&&((B(t)!==`body`||_e(i))&&(s=Ee(t)),r)){let e=Z(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Pe(i));let l=i&&!r&&!a?Fe(i,s):g(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function qe(e){return q(e).position===`static`}function Je(e,t){if(!W(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return H(e)===n&&(n=n.ownerDocument.body),n}function Ye(e,t){let n=V(e);if(ye(e))return n;if(!W(e)){let t=J(e);for(;t&&!K(t);){if(U(t)&&!qe(t))return t;t=J(t)}return n}let r=Je(e,t);for(;r&&ve(r)&&qe(r);)r=Je(r,t);return r&&K(r)&&qe(r)&&!Ce(r)?n:r||we(e)||n}var Xe=async function(e){let t=this.getOffsetParent||Ye,n=this.getDimensions,r=await n(e.floating);return{reference:Ke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ze(e){return q(e).direction===`rtl`}var Qe={convertOffsetParentRelativeRectToViewportRelativeRect:Ie,getDocumentElement:H,getClippingRect:We,getOffsetParent:Ye,getElementRects:Xe,getClientRects:Le,getDimensions:Ge,getScale:X,isElement:U,isRTL:Ze};function $e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function et(e,t,n){let r=null,i,a=H(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:m,height:g}=l;if(n||t(),!m||!g)return;let _=h(d),v=h(a.clientWidth-(u+m)),y=h(a.clientHeight-(d+g)),b=h(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:p(0,f(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(!$e(l,e.getBoundingClientRect()))return s();if(n!==c){if(!S)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(C,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function tt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ae(e),u=i||a?[...l?Y(l):[],...t?Y(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?et(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Z(e):null;c&&g();function g(){let t=Z(e);h&&!$e(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var nt=ue,rt=de,it=ie,at=pe,ot=se,st=re,ct=fe,lt=(e,t,n)=>{let r=new Map,i=n??{},a={...Qe,...i.platform,_c:r};return ne(e,t,{...i,platform:a})},ut=e(n(),1),dt=typeof document<`u`?u.useLayoutEffect:function(){};function ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ft(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function mt(e,t){let n=pt(e);return Math.round(t*n)/n}function ht(e){let t=u.useRef(e);return dt(()=>{t.current=e}),t}function gt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);ft(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=u.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=u.useRef(null),w=u.useRef(null),T=u.useRef(d),E=c!=null,D=ht(c),O=ht(i),k=ht(l),A=u.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),lt(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!ft(T.current,t)&&(T.current=t,ut.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);dt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let j=u.useRef(!1);dt(()=>(j.current=!0,()=>{j.current=!1}),[]),dt(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=u.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=u.useMemo(()=>({reference:x,floating:S}),[x,S]),P=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=mt(N.floating,d.x),r=mt(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...pt(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var _t=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:st({element:r.current,padding:i}).fn(n):r?st({element:r,padding:i}).fn(n):{}}}},vt=(e,t)=>{let n=nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},yt=(e,t)=>{let n=rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},bt=(e,t)=>({fn:ct(e).fn,options:[e,t]}),xt=(e,t)=>{let n=it(e);return{name:n.name,fn:n.fn,options:[e,t]}},St=(e,t)=>{let n=at(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ct=(e,t)=>{let n=ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},wt=(e,t)=>{let n=_t(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q=r(),Tt=Object.defineProperty,Et=u.forwardRef(((e,t)=>Tt(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,Q.jsx)(o.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,Q.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Dt=Object.defineProperty,$=(e,t)=>Dt(e,`name`,{value:t,configurable:!0}),Ot=`Popper`,[kt,At]=s(Ot),[jt,Mt]=kt(Ot),Nt=$(e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null),[a,o]=u.useState(void 0);return(0,Q.jsx)(jt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Pt=`PopperAnchor`,Ft=u.forwardRef($(function(e,t){let{__scopePopper:n,virtualRef:r,...a}=e,s=Mt(Pt,n),c=u.useRef(null),l=s.onAnchorChange,d=u.useCallback(e=>{c.current=e,e&&l(e)},[l]),f=i(t,d),p=u.useRef(null);u.useEffect(()=>{if(!r)return;let e=p.current;p.current=r.current,e!==p.current&&l(p.current)});let m=s.placementState&&Gt(s.placementState),h=m?.[0],g=m?.[1];return r?null:(0,Q.jsx)(o.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...a,ref:f})},`PopperAnchor`)),It=`PopperContent`,[Lt,Rt]=kt(It),zt=u.forwardRef($(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:s=0,align:d=`center`,alignOffset:f=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:_=`partial`,hideWhenDetached:v=!1,updatePositionStrategy:y=`optimized`,onPlaced:b,...x}=e,S=Mt(It,n),[C,w]=u.useState(null),T=i(t,w),[E,D]=u.useState(null),O=l(E),k=O?.width??0,A=O?.height??0,j=r+(d===`center`?``:`-`+d),M=typeof g==`number`?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(h)?h:[h],P=N.length>0,F={padding:M,boundary:N.filter(Ut),altBoundary:P},{refs:I,floatingStyles:ee,placement:L,isPositioned:R,middlewareData:z}=gt({strategy:`fixed`,placement:j,whileElementsMounted:$((...e)=>tt(...e,{animationFrame:y===`always`}),`whileElementsMounted`),elements:{reference:S.anchor},middleware:[vt({mainAxis:s+A,alignmentAxis:f}),m&&yt({mainAxis:!0,crossAxis:!1,limiter:_===`partial`?bt():void 0,...F}),m&&xt({...F}),St({...F,apply:$(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),E&&wt({element:E,padding:p}),Wt({arrowWidth:k,arrowHeight:A}),v&&Ct({strategy:`referenceHidden`,...F,boundary:P?F.boundary:void 0})]}),te=S.setPlacementState;a(()=>(te(L),()=>{te(void 0)}),[L,te]);let[ne,re]=Gt(L),ie=c(b);a(()=>{R&&ie?.()},[R,ie]);let ae=z.arrow?.x,oe=z.arrow?.y,se=z.arrow?.centerOffset!==0,[ce,le]=u.useState();return a(()=>{C&&le(window.getComputedStyle(C).zIndex)},[C]),(0,Q.jsx)(`div`,{ref:I.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:R?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ce,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,Q.jsx)(Lt,{scope:n,placedSide:ne,placedAlign:re,onArrowChange:D,arrowX:ae,arrowY:oe,shouldHideArrow:se,children:(0,Q.jsx)(o.div,{"data-side":ne,"data-align":re,...x,ref:T,style:{...x.style,animation:R?x.style?.animation:`none`}})})})},`PopperContent`)),Bt=`PopperArrow`,Vt={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ht=u.forwardRef($(function(e,t){let{__scopePopper:n,...r}=e,i=Rt(Bt,n),a=Vt[i.placedSide];return(0,Q.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,Q.jsx)(Et,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Ut(e){return e!==null}$(Ut,`isNotNull`);var Wt=$(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Gt(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Gt(e){let[t,n=`center`]=e.split(`-`);return[t,n]}$(Gt,`getSideAndAlignFromPlacement`);var Kt=Nt,qt=Ft,Jt=zt,Yt=Ht;export{At as a,Kt as i,Yt as n,Jt as r,qt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{t as r}from"./check-2vYc6QaP.js";import{t as i}from"./chevron-right-C3t2Rckj.js";import{i as a,n as o}from"./dist-Cfh4kzCK.js";import{c as s,i as c,l,n as u,o as d,r as f,s as p,t as m}from"./dist-B_a0oV4U.js";import{a as h,i as g,n as ee,r as _,t as v}from"./dist-DAs5KRGl.js";import{a as te,i as y,n as ne,r as re,s as ie,t as ae}from"./es2015-0QT3KgdC.js";import{a as b,i as x,r as oe,t as se}from"./dist-alOyD2Bh.js";import{t as S}from"./utils-C8uzG5AZ.js";var C=e(t(),1),w=n(),T=Object.defineProperty,E=(e,t)=>T(e,`name`,{value:t,configurable:!0}),D=[`Enter`,` `],O=[`ArrowDown`,`PageUp`,`Home`],ce=[`ArrowUp`,`PageDown`,`End`],le=[...O,...ce],k={ltr:[...D,`ArrowRight`],rtl:[...D,`ArrowLeft`]},ue={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},A=`Menu`,[j,de,M]=h(A),[N,P]=p(A,[M,b,_]),F=b(),fe=_(),[I,L]=N(A),[R,z]=N(A),pe=E(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=F(t),[c,l]=C.useState(null),u=C.useRef(!1),d=m(a),f=g(i);return C.useEffect(()=>{let e=E(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=E(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),C.useEffect(()=>{if(!n)return;let e=E(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,w.jsx)(x,{...s,children:(0,w.jsx)(I,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,w.jsx)(R,{scope:t,onClose:C.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),me=C.forwardRef(E(function(e,t){let{__scopeMenu:n,...r}=e,i=F(n);return(0,w.jsx)(se,{...i,...r,ref:t})},`MenuAnchor`)),he=`MenuPortal`,[ge,_e]=N(he,{forceMount:void 0}),ve=E(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=L(he,t);return(0,w.jsx)(ge,{scope:t,forceMount:n,children:(0,w.jsx)(f,{present:n||a.open,children:(0,w.jsx)(y,{asChild:!0,container:i,children:r})})})},`MenuPortal`),B=`MenuContent`,[ye,V]=N(B),be=C.forwardRef(E(function(e,t){let n=_e(B,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=L(B,e.__scopeMenu),o=z(B,e.__scopeMenu);return(0,w.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,w.jsx)(f,{present:r||a.open,children:(0,w.jsx)(j.Slot,{scope:e.__scopeMenu,children:o.modal?(0,w.jsx)(xe,{...i,ref:t}):(0,w.jsx)(Se,{...i,ref:t})})})})},`MenuContent`)),xe=C.forwardRef(E(function(e,t){let n=L(B,e.__scopeMenu),r=C.useRef(null),i=a(t,r);return C.useEffect(()=>{let e=r.current;if(e)return ae(e)},[]),(0,w.jsx)(H,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:d(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Se=C.forwardRef(E(function(e,t){let n=L(B,e.__scopeMenu);return(0,w.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Ce=o(`MenuContent.ScrollLock`),H=C.forwardRef(E(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=L(B,n),y=z(B,n),ae=F(n),b=fe(n),x=de(n),[se,S]=C.useState(null),T=C.useRef(null),D=a(t,T,v.onContentChange),O=C.useRef(0),k=C.useRef(``),ue=C.useRef(0),A=C.useRef(null),j=C.useRef(`right`),M=C.useRef(0),N=g?ne:C.Fragment,P=g?{as:Ce,allowPinchZoom:!0}:void 0,I=E(e=>{let t=k.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Je(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;E((function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);C.useEffect(()=>()=>window.clearTimeout(O.current),[]),re();let R=C.useCallback(e=>j.current===A.current?.side&&Xe(e,A.current?.area),[]);return(0,w.jsx)(ye,{scope:n,searchRef:k,onItemEnter:C.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:C.useCallback(e=>{R(e)||(T.current?.focus(),S(null))},[R]),onTriggerLeave:C.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:ue,onPointerGraceIntentChange:C.useCallback(e=>{A.current=e},[]),children:(0,w.jsx)(N,{...P,children:(0,w.jsx)(te,{asChild:!0,trapped:i,onMountAutoFocus:d(o,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,w.jsx)(ie,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,w.jsx)(ee,{asChild:!0,...b,dir:y.dir,orientation:`vertical`,loop:r,currentTabStopId:se,onCurrentTabStopIdChange:S,onEntryFocus:d(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,w.jsx)(oe,{role:`menu`,"aria-orientation":`vertical`,"data-state":K(v.open),"data-radix-menu-content":``,dir:y.dir,...ae,..._,ref:D,style:{outline:`none`,..._.style},onKeyDown:d(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&I(e.key));let i=T.current;if(e.target!==i||!le.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);ce.includes(e.key)&&a.reverse(),Ke(a)}),onBlur:d(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:d(e.onPointerMove,Y(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;j.current=t,M.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),we=C.forwardRef(E(function(e,t){let{__scopeMenu:n,...r}=e;return(0,w.jsx)(s.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Te=C.forwardRef(E(function(e,t){let{__scopeMenu:n,...r}=e;return(0,w.jsx)(s.div,{...r,ref:t})},`MenuLabel`)),U=`MenuItem`,Ee=`menu.itemSelect`,W=C.forwardRef(E(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,o=C.useRef(null),s=z(U,e.__scopeMenu),c=V(U,e.__scopeMenu),u=a(t,o),f=C.useRef(!1),p=E(()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Ee,{bubbles:!0,cancelable:!0});e.addEventListener(Ee,e=>r?.(e),{once:!0}),l(e,t),t.defaultPrevented?f.current=!1:s.onClose()}},`handleSelect`);return(0,w.jsx)(De,{...i,ref:u,disabled:n,onClick:d(e.onClick,p),onPointerDown:t=>{e.onPointerDown?.(t),f.current=!0},onPointerUp:d(e.onPointerUp,e=>{f.current||e.currentTarget?.click()}),onKeyDown:d(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(c.searchRef.current===``||e.key!==` `)&&D.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),De=C.forwardRef(E(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,c=V(U,n),l=fe(n),u=C.useRef(null),f=a(t,u),[p,m]=C.useState(!1),[h,g]=C.useState(``);return C.useEffect(()=>{let e=u.current;e&&g((e.textContent??``).trim())},[o.children]),(0,w.jsx)(j.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:(0,w.jsx)(v,{asChild:!0,...l,focusable:!r,children:(0,w.jsx)(s.div,{role:`menuitem`,"data-highlighted":p?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...o,ref:f,onPointerMove:d(e.onPointerMove,Y(e=>{r?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:d(e.onPointerLeave,Y(e=>c.onItemLeave(e))),onFocus:d(e.onFocus,()=>m(!0)),onBlur:d(e.onBlur,()=>m(!1))})})})},`MenuItemImpl`)),Oe=C.forwardRef(E(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,w.jsx)(Fe,{scope:e.__scopeMenu,checked:n,children:(0,w.jsx)(W,{role:`menuitemcheckbox`,"aria-checked":q(n)?`mixed`:n,...i,ref:t,"data-state":J(n),onSelect:d(i.onSelect,()=>r?.(q(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[ke,Ae]=N(`MenuRadioGroup`,{value:void 0,onValueChange:E(()=>{},`onValueChange`)}),je=C.forwardRef(E(function(e,t){let{value:n,onValueChange:r,...i}=e,a=m(r);return(0,w.jsx)(ke,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,w.jsx)(we,{...i,ref:t})})},`MenuRadioGroup`)),Me=`MenuRadioItem`,Ne=C.forwardRef(E(function(e,t){let{value:n,...r}=e,i=Ae(Me,e.__scopeMenu),a=n===i.value;return(0,w.jsx)(Fe,{scope:e.__scopeMenu,checked:a,children:(0,w.jsx)(W,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":J(a),onSelect:d(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Pe=`MenuItemIndicator`,[Fe,Ie]=N(Pe,{checked:!1}),Le=C.forwardRef(E(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Ie(Pe,n);return(0,w.jsx)(f,{present:r||q(a.checked)||a.checked===!0,children:(0,w.jsx)(s.span,{...i,ref:t,"data-state":J(a.checked)})})},`MenuItemIndicator`)),Re=C.forwardRef(E(function(e,t){let{__scopeMenu:n,...r}=e;return(0,w.jsx)(s.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),ze=`MenuSub`,[Be,Ve]=N(ze),He=E(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=L(ze,t),o=F(t),[s,c]=C.useState(null),[l,d]=C.useState(null),f=m(i);return C.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,w.jsx)(x,{...o,children:(0,w.jsx)(I,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:d,children:(0,w.jsx)(Be,{scope:t,contentId:u(),triggerId:u(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),G=`MenuSubTrigger`,Ue=C.forwardRef(E(function(e,t){let n=L(G,e.__scopeMenu),r=z(G,e.__scopeMenu),i=Ve(G,e.__scopeMenu),o=V(G,e.__scopeMenu),s=C.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},f=C.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);C.useEffect(()=>f,[f]),C.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let p=a(t,i.onTriggerChange);return(0,w.jsx)(me,{asChild:!0,...u,children:(0,w.jsx)(De,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":K(n.open),...e,ref:p,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:d(e.onPointerMove,Y(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:d(e.onPointerLeave,Y(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:d(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(o.searchRef.current===``||t.key!==` `)&&k[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),We=`MenuSubContent`,Ge=C.forwardRef(E(function(e,t){let n=_e(B,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...o}=e,s=L(B,e.__scopeMenu),c=z(B,e.__scopeMenu),l=Ve(We,e.__scopeMenu),u=C.useRef(null),p=a(t,u);return(0,w.jsx)(j.Provider,{scope:e.__scopeMenu,children:(0,w.jsx)(f,{present:r||s.open,children:(0,w.jsx)(j.Slot,{scope:e.__scopeMenu,children:(0,w.jsx)(H,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:p,align:i,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:d(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:d(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:d(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ue[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function K(e){return e?`open`:`closed`}E(K,`getOpenState`);function q(e){return e===`indeterminate`}E(q,`isIndeterminate`);function J(e){return q(e)?`indeterminate`:e?`checked`:`unchecked`}E(J,`getCheckedState`);function Ke(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}E(Ke,`focusFirst`);function qe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}E(qe,`wrapArray`);function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=qe(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}E(Je,`getNextMatch`);function Ye(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}E(Ye,`isPointInPolygon`);function Xe(e,t){return t?Ye({x:e.clientX,y:e.clientY},t):!1}E(Xe,`isPointerInGraceArea`);function Y(e){return t=>t.pointerType===`mouse`?e(t):void 0}E(Y,`whenMouse`);var Ze=pe,Qe=me,$e=ve,et=be,tt=Te,nt=W,rt=Oe,it=je,at=Ne,ot=Le,st=Re,ct=He,lt=Ue,ut=Ge,dt=Object.defineProperty,X=(e,t)=>dt(e,`name`,{value:t,configurable:!0}),Z=`DropdownMenu`,[ft,pt]=p(Z,[P]),Q=P(),[mt,ht]=ft(Z),gt=X(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,l=Q(t),d=C.useRef(null),[f,p]=c({prop:i,defaultProp:a??!1,onChange:o,caller:Z});return(0,w.jsx)(mt,{scope:t,triggerId:u(),triggerRef:d,contentId:u(),open:f,onOpenChange:p,onOpenToggle:C.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,w.jsx)(Ze,{...l,open:f,onOpenChange:p,dir:r,modal:s,children:n})})},`DropdownMenu`),_t=`DropdownMenuTrigger`,vt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=ht(_t,n),c=Q(n),l=a(t,o.triggerRef);return(0,w.jsx)(Qe,{asChild:!0,...c,children:(0,w.jsx)(s.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:l,onPointerDown:d(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:d(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),yt=X(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Q(t);return(0,w.jsx)($e,{...r,...n})},`DropdownMenuPortal`),bt=`DropdownMenuContent`,xt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ht(bt,n),a=Q(n),o=C.useRef(!1);return(0,w.jsx)(et,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:d(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:d(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),St=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(tt,{...i,...r,ref:t})},`DropdownMenuLabel`)),Ct=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(nt,{...i,...r,ref:t})},`DropdownMenuItem`)),wt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(rt,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Tt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(it,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Et=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(at,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Dt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(ot,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Ot=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(st,{...i,...r,ref:t})},`DropdownMenuSeparator`)),kt=X(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Q(t),[s,l]=c({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,w.jsx)(ct,{...o,open:s,onOpenChange:l,children:n})},`DropdownMenuSub`),At=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(lt,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),jt=C.forwardRef(X(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Q(n);return(0,w.jsx)(ut,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),Mt=gt,Nt=vt,Pt=yt,Ft=xt,It=St,Lt=Ct,Rt=wt,zt=Tt,Bt=Et,Vt=Dt,Ht=Ot,Ut=kt,Wt=At,Gt=jt,$=C.createContext(null);function Kt(e,t){return C.useCallback(n=>{if(e.current=n,typeof t==`function`){let r=t(n);if(typeof r==`function`)return()=>{e.current=null,r()}}else t&&(t.current=n)},[e,t])}function qt({modal:e=!1,...t}){let n=C.useRef(null);return(0,w.jsx)($.Provider,{value:n,children:(0,w.jsx)(Mt,{"data-slot":`dropdown-menu`,modal:e,...t})})}function Jt({ref:e,...t}){let n=C.useContext($),r=C.useRef(null),i=Kt(n??r,e);return(0,w.jsx)(Nt,{"data-slot":`dropdown-menu-trigger`,ref:i,...t})}function Yt({className:e,align:t=`start`,sideOffset:n=1,matchTriggerWidth:r=!1,collisionPadding:i=8,ref:a,onInteractOutside:o,...s}){let c=C.useContext($),l=C.useRef(null),u=Kt(l,a);return(0,w.jsx)(Pt,{children:(0,w.jsx)(Ft,{ref:u,onInteractOutside:e=>{o?.(e);let t=e.detail.originalEvent,n=c?.current,r=t.target instanceof Node&&n?.contains(t.target);!e.defaultPrevented&&r&&(t instanceof PointerEvent&&t.type===`pointerdown`&&t.button===0&&!t.ctrlKey||t.type===`focusin`&&l.current?.getAttribute(`data-state`)===`closed`)&&e.preventDefault()},"data-slot":`dropdown-menu-content`,sideOffset:n,align:t,collisionPadding:i,className:S(`z-[200] max-h-(--radix-dropdown-menu-content-available-height) w-max max-w-[calc(100vw-16px)] min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-float duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,r&&`w-(--radix-dropdown-menu-trigger-width)`,e),...s})})}function Xt({className:e,inset:t,variant:n=`default`,...r}){return(0,w.jsx)(Lt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:S(`group/dropdown-menu-item relative flex min-h-7.5 cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm pointer-coarse:min-h-11 outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-danger-soft data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Zt({className:e,children:t,checked:n,inset:i,closeOnSelect:a=!1,onSelect:o,...s}){return(0,w.jsxs)(Rt,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":i,className:S(`relative flex min-h-7.5 cursor-default items-center gap-2 rounded-sm py-1 pr-8 pl-2 text-sm pointer-coarse:min-h-11 outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,onSelect:e=>{o?.(e),a||e.preventDefault()},...s,children:[(0,w.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,w.jsx)(Vt,{children:(0,w.jsx)(r,{className:`text-accent-fg`})})}),t]})}function Qt({...e}){return(0,w.jsx)(zt,{"data-slot":`dropdown-menu-radio-group`,...e})}function $t({className:e,children:t,inset:n,...i}){return(0,w.jsxs)(Bt,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:S(`relative flex min-h-7.5 cursor-default items-center gap-2 rounded-sm py-1 pr-8 pl-2 text-sm pointer-coarse:min-h-11 outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...i,children:[(0,w.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,w.jsx)(Vt,{children:(0,w.jsx)(r,{className:`text-accent-fg`})})}),t]})}function en({className:e,inset:t,...n}){return(0,w.jsx)(It,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:S(`px-2 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function tn({className:e,...t}){return(0,w.jsx)(Ht,{"data-slot":`dropdown-menu-separator`,className:S(`-mx-1 my-1 h-px bg-stroke-soft`,e),...t})}function nn({className:e,...t}){return(0,w.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:S(`ml-auto pl-3 text-xs text-muted-foreground tabular-nums group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}function rn({...e}){return(0,w.jsx)(Ut,{"data-slot":`dropdown-menu-sub`,...e})}function an({className:e,inset:t,children:n,...r}){return(0,w.jsxs)(Wt,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:S(`flex min-h-7.5 cursor-default items-center gap-2 rounded-sm px-2 py-1 text-sm pointer-coarse:min-h-11 outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,w.jsx)(i,{className:`ml-auto`})]})}function on({className:e,...t}){return(0,w.jsx)(Gt,{"data-slot":`dropdown-menu-sub-content`,className:S(`z-[200] min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md bg-popover p-1 text-popover-foreground shadow-float duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}export{en as a,tn as c,on as d,an as f,Xt as i,nn as l,Zt as n,Qt as o,Jt as p,Yt as r,$t as s,qt as t,rn as u};
|