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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ManageProjectsDialog-
|
|
2
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,h as n}from"./vendor-router-CSN_DGvx.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{f as a}from"./routes-Da0OHSy6.js";import{t as o}from"./use-i18n-D2P6OO3w.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{t as c}from"./chevron-down-CxtxIjiP.js";import{t as l}from"./chevron-right-C3t2Rckj.js";import{t as u}from"./ellipsis-CfGKfbq6.js";import{_ as d,a as f,c as p,d as m,g as h,i as g,l as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w}from"./useSessionRowActions-DTxXBruc.js";import{t as T}from"./folder-plus-OPHZsJho.js";import{r as E}from"./launch-defaults-store-7CojCPDE.js";import{t as D}from"./pin-CU0FG0lI.js";import{t as O}from"./rotate-ccw-clock-CO6Bw-sF.js";import{i as k,p as A,r as j,t as M}from"./dropdown-menu-gZkWDhaR.js";import{t as N}from"./utils-C8uzG5AZ.js";import{c as P,g as F}from"./shortcuts-BOeaPAvF.js";import{t as I}from"./sidebar-store-we4gMwQq.js";import{n as ee}from"./useSessionListQuery-DqZ3m8O9.js";import{c as L,l as te,n as R,r as z,t as B}from"./useNow-DAVNVxdo.js";import{t as V}from"./useBoardItems-BU9aonpg.js";import{t as H}from"./useSidebarModel-DtY4PopW.js";import{t as U}from"./new-task-C3wuHTor.js";import{t as W}from"./shortcut-aria-jHRmld9z.js";import{t as G}from"./StatusGlyph-1KgitlUg.js";import{t as K}from"./sidebar-commands-ZA1UOA_F.js";var ne=s(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),q=e(r(),1),J=i(),Y=160,X=600;function re(e,t){switch(t){case`attention`:return e(`board:sidebar.group.attention`);case`running`:return e(`board:sidebar.group.running`);case`queued`:return e(`board:sidebar.group.queued`);case`pinned`:return e(`board:sidebar.group.pinned`);default:return e(`board:sidebar.group.done`)}}function Z(e){return e?[...e.querySelectorAll(`[data-sidebar-row]`)]:[]}function Q(e,t={}){$(()=>e(Z(document.querySelector(`[data-sidebar-groups]`))),t)}function $(e,{unclaimed:t=!1}={}){let n=0,r=()=>{let i=document.activeElement;if(t&&i&&i!==document.body&&!i.closest(`[data-shell-sidebar]`))return;let a=e();if(a){a.focus(),a.scrollIntoView?.({block:`nearest`});return}(n+=1)<20&&requestAnimationFrame(r)};requestAnimationFrame(r)}function ie({resolveCurrentId:e,renderedSessionId:t,onOpenSession:n,onWaiting:r}){let{t:i}=o(),{model:a,isLoading:s}=H(),c=(0,q.useRef)(a);c.current=a;let l=(0,q.useRef)({resolveCurrentId:e,onOpenSession:n});l.current={resolveCurrentId:e,onOpenSession:n},(0,q.useEffect)(()=>{let e=e=>{let t=e.detail;if(!t)return;let n=c.current;if(t.kind===`adjacent`){let e=I.getState().doneCollapsed?n.groups.flatMap(e=>e.id===`done`?[]:e.rows.map(e=>e.id)):n.order,r=z(e,l.current.resolveCurrentId()||null,t.direction);r&&l.current.onOpenSession(r);return}let r=I.getState();if(document.documentElement.hasAttribute(`data-phone-shell`)){let e=t.kind===`focus-attention`?n.longestWaitingId:l.current.resolveCurrentId();if(t.kind===`focus-attention`&&!e)return;r.setDrawerOpen(!0),Q(n=>n.find(t=>t.dataset.sidebarRow===e)??(t.kind===`focus-list`?n[0]:void 0));return}let i=document.querySelector(`[data-settings-sidebar]`);if(i){let e=t.kind===`focus-attention`?`[data-sidebar-fleet-line]`:`[data-settings-section][aria-current="page"]`;$(()=>i.querySelector(e)??void 0);return}let a=document.querySelector(`[data-overview]`);if(t.kind===`focus-attention`){let e=n.longestWaitingId;if(!e)return;if(a){h(e);return}r.collapsed&&r.setPeeking(!0),Q(t=>t.find(t=>t.dataset.sidebarRow===e));return}if(r.collapsed&&r.setPeeking(!0),a){$(()=>{let e=document.querySelector(`[data-shell-sidebar] [data-sidebar-filters]`);return e?.querySelector(`[data-sidebar-filter][aria-pressed="true"]`)??e?.querySelector(`[data-sidebar-filter]`)??void 0});return}let o=l.current.resolveCurrentId();Q(e=>e.find(e=>e.dataset.sidebarRow===o)??e[0])};return window.addEventListener(K,e),()=>window.removeEventListener(K,e)},[]);let u=(0,q.useRef)(t),d=(0,q.useRef)(null);(0,q.useEffect)(()=>{let e=u.current;if(u.current=t,t===null){e&&(d.current=e);return}if(e!==null)return;let n=d.current;d.current=null,!(!n||n!==t||I.getState().collapsed)&&Q(e=>e.find(e=>e.dataset.sidebarRow===n),{unclaimed:!0})},[t]);let f=(0,q.useRef)(r);f.current=r;let p=(0,q.useRef)(null),[m,g]=(0,q.useState)(``);return(0,q.useEffect)(()=>{if(s)return;let e=a.groups.find(e=>e.id===`attention`)?.rows??[],t=p.current;if(p.current=new Set(e.map(e=>e.id)),!t)return;let n=e.filter(e=>!t.has(e.id));if(n.length){for(let e of n)e.reasons.some(e=>e.kind===`approval`||e.kind===`question`)&&f.current?.({title:e.title,reason:w(i,e.reasons)});g(n.map(e=>i(`board:sidebar.announce`,{title:e.title,reason:w(i,e.reasons)})).join(i(`board:sidebar.announceSeparator`)))}},[a.groups,s,i]),(0,J.jsx)(`p`,{"data-sidebar-announce":!0,"aria-live":`polite`,role:`status`,className:`sr-only`,children:m})}function ae({onOpenBoard:e}){let{t}=o(),{model:n,isLoading:r}=H(),i=L(e=>e.setLaneFilter),a=t=>{i([t]),e()},s=n.counts.attention,c=n.counts.running,l=`grid size-10 place-items-center rounded-[var(--r-md)] text-xs font-semibold tabular-nums transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`;return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,"aria-busy":r||void 0,children:[(0,J.jsx)(`button`,{type:`button`,"data-rail-count":`attention`,"aria-label":t(`board:sidebar.railAttention`,{count:s}),title:t(`board:sidebar.railAttention`,{count:s}),className:N(l,s>0?`bg-warning-soft text-warning-strong ring-1 ring-st-attn-border ring-inset hover:brightness-[.98]`:`text-content-muted hover:bg-surface-hover`),onClick:()=>a(`attention`),children:(0,J.jsxs)(`span`,{className:`flex flex-col items-center gap-0.5 leading-none`,children:[(0,J.jsx)(G,{status:`attention`,className:N(`size-3.5`,s===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{children:s})]})}),(0,J.jsx)(`button`,{type:`button`,"data-rail-count":`running`,"aria-label":t(`board:sidebar.railRunning`,{count:c}),title:t(`board:sidebar.railRunning`,{count:c}),className:N(l,`hover:bg-surface-hover`,c>0?`text-content-secondary`:`text-content-muted`),onClick:()=>a(`running`),children:(0,J.jsxs)(`span`,{className:`flex flex-col items-center gap-0.5 leading-none`,children:[(0,J.jsx)(G,{status:`run`,spin:c>0,className:N(`size-3.5`,c===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{children:c})]})})]})}function oe({onOpenBoard:e}){let{t}=o(),{model:n,isLoading:r}=H(),i=L(e=>e.setLaneFilter),a=n.counts.attention,s=n.counts.running;return(0,J.jsxs)(`button`,{type:`button`,"data-sidebar-fleet-line":!0,"aria-busy":r||void 0,"aria-label":t(`board:sidebar.fleet.label`,{attention:a,running:s}),className:`flex h-10 w-full min-w-0 items-center gap-1.5 rounded-[var(--r-md)] px-2.5 text-left text-[12.5px] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:()=>{i([]),e()},children:[(0,J.jsx)(G,{status:`attention`,className:N(`size-3.5 flex-none`,a===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{"data-sidebar-fleet":`attention`,className:N(`truncate`,a>0&&`font-medium text-warning-strong`),children:t(`board:sidebar.fleet.attention`,{count:a})}),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`text-content-faint`,children:`·`}),(0,J.jsx)(G,{status:`run`,spin:s>0,className:`size-3.5 flex-none`}),(0,J.jsx)(`span`,{"data-sidebar-fleet":`running`,className:`truncate`,children:t(`board:sidebar.fleet.running`,{count:s})}),(0,J.jsx)(l,{className:`ml-auto size-3.5 flex-none text-content-muted`,"aria-hidden":`true`})]})}function se({currentId:e,notify:n,requestText:r,onOpenSession:i,onOpenBoard:s,onOpenHistory:c,onArchived:l,drawer:u=!1}){let{t:d}=o(),{model:f,isLoading:p,error:m,refetch:h}=H(),_=te(),v=(0,q.useRef)(_);v.current=_;let y=I(e=>e.doneCollapsed),b=I(e=>e.setDoneCollapsed),x=L(e=>e.setLaneFilter),S=P(e=>e.boardBindings),w=t(`/`),T=(0,q.useCallback)(e=>w.replace(/\/$/,``)+a(e),[w]),E=f.counts.attention+f.counts.running>0,D=R(E),k=(0,q.useRef)(null),[A,j]=(0,q.useState)(()=>new Set),M=(e,t)=>j(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),N=(0,q.useRef)(null),[ee,z]=(0,q.useState)(()=>new Set),B=(0,q.useMemo)(()=>f.groups.find(e=>e.id===`attention`)?.rows??[],[f.groups]),V=(0,q.useRef)(new Set);V.current=new Set(B.map(e=>e.id)),(0,q.useEffect)(()=>{if(p)return;let e=new Set(B.map(e=>e.id)),t=N.current;if(N.current=e,!t)return;let n=B.filter(e=>!t.has(e.id));n.length&&z(new Set(n.map(e=>e.id)))},[B,p]);let U=C({notify:n,requestText:r,onOpenSession:i,onArchived:l}),W=U.report,G=(0,q.useCallback)(async(e,t,n)=>{if(e.quickAction.kind!==`decide`){i(e.id);return}let{approvalId:r,remaining:a}=e.quickAction,o=a===0,s=!!n?.contains(document.activeElement),c=Z(k.current),l=c.findIndex(t=>t.dataset.sidebarRow===e.id),u=c[l+1]??c[l-1];s&&o&&u?.focus();let d=!1,f=o?g(n,{duration:160,scale:.6}).then(()=>{d||M(e.id,!0)}):Promise.resolve(),p=t?await v.current.approve(e.id,r,{confirmCritical:!1}):await v.current.deny(e.id,r);if(p.ok){if(!o||(await f,!V.current.has(e.id)))return;M(e.id,!1),n?.getAnimations?.().forEach(e=>e.cancel());return}d=!0,await f,M(e.id,!1),n?.getAnimations?.().forEach(e=>e.cancel()),p.reason===`confirmation-required`?i(e.id):W(p)},[i,W]);(0,q.useEffect)(()=>{j(e=>{if(!e.size)return e;let t=new Set(B.map(e=>e.id)),n=new Set([...e].filter(e=>t.has(e)));return n.size===e.size?e:n})},[B]);let K=(0,q.useMemo)(()=>({...U,decide:(e,t,n)=>void G(e,t,n)}),[G,U]),ne=(e,t)=>{if(e.altKey||e.metaKey||e.ctrlKey)return;if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Z(k.current);t[t.indexOf(e.currentTarget)+(e.key===`ArrowDown`?1:-1)]?.focus();return}if(t.group!==`attention`||e.shiftKey)return;let n=F(e.nativeEvent,S.boardApprove),r=!n&&F(e.nativeEvent,S.boardDeny);!n&&!r||(e.preventDefault(),t.quickAction.kind===`decide`&&K.decide(t,n,e.currentTarget.closest(`[data-sidebar-item]`)))},Y=()=>{x([`running`]),s()};if(p)return(0,J.jsx)(le,{label:d(`board:sidebar.loading`)});let X=!m&&f.groups.every(e=>e.count===0)&&f.groups.length<=2;return(0,J.jsxs)(`div`,{ref:k,"data-sidebar-groups":!0,className:`flex flex-col gap-3 pb-2`,children:[m&&f.groups.every(e=>e.count===0)?(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 px-2.5 py-2 text-xs text-content-muted`,children:[(0,J.jsx)(`p`,{children:d(`board:sidebar.error`)}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-sm text-content-secondary underline underline-offset-2 hover:text-content focus-visible:outline-2 focus-visible:outline-focus`,onClick:h,children:d(`board:sidebar.retry`)})]}):X?(0,J.jsx)(`p`,{className:`px-2.5 py-2 text-xs leading-5 text-content-muted`,children:d(`board:sidebar.empty`)}):f.groups.map(t=>(0,J.jsx)(de,{group:t,title:re(d,t.id),collapsed:t.id===`done`&&y,onToggle:t.id===`done`?()=>b(!y):void 0,footer:t.id===`running`&&t.hidden>0?(0,J.jsx)(ue,{onClick:Y,children:d(`board:sidebar.moreRunning`,{count:t.hidden})}):t.id===`done`&&t.hidden>0?(0,J.jsx)(ue,{onClick:c,children:d(`board:sidebar.allDone`)}):null,emptyText:t.id===`attention`?d(`board:sidebar.emptyAttention`):t.id===`running`?d(`board:sidebar.emptyRunning`):``,children:t.rows.map(t=>(0,J.jsx)(fe,{row:t,href:T(t.id),current:t.id===e,now:D,hidden:A.has(t.id),fresh:ee.has(t.id),handlers:K,approveBinding:S.boardApprove,denyBinding:S.boardDeny,onKeyDown:ne,drawer:u},t.id))},t.id)),(0,J.jsxs)(`a`,{href:w.replace(/\/$/,``)+`/chat/history`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] px-2.5 text-[13px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:e=>{ce(e)&&(e.preventDefault(),c())},children:[(0,J.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":`true`}),d(`board:sidebar.history`)]})]})}function ce(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function le({label:e}){return(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":e,className:`flex flex-col gap-1 px-1 pt-1`,children:[64,48,72,56].map(e=>(0,J.jsxs)(`div`,{className:`flex h-9 items-center gap-2.5 px-1.5`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{className:`size-4 flex-none rounded-full bg-surface-hover`}),(0,J.jsx)(`span`,{className:`h-3 rounded-sm bg-surface-hover`,style:{width:`${e}%`}})]},e))})}function ue({children:e,onClick:t}){return(0,J.jsx)(`button`,{type:`button`,className:`flex h-7 w-full items-center gap-1 rounded-[var(--r-md)] px-2.5 pl-[34px] text-left text-xs text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:t,children:e})}function de({group:e,title:t,collapsed:n,onToggle:r,footer:i,emptyText:a,children:o}){let s=`sidebar-group-${e.id}`,u=e.id===`attention`,d=(0,J.jsx)(`span`,{"data-sidebar-count":!0,className:N(`tabular-nums`,u&&e.count>0&&`inline-grid h-[18px] min-w-[18px] place-items-center rounded-full bg-warning-soft px-1.5 text-[11.5px] font-semibold ring-1 ring-st-attn-border ring-inset`),children:e.count}),f=N(`flex h-7 items-center gap-1.5 px-2.5 text-xs font-medium`,u&&e.count>0?`text-warning-strong`:`text-content-muted`);return(0,J.jsxs)(`section`,{"aria-labelledby":s,"data-sidebar-group":e.id,children:[(0,J.jsx)(`h2`,{id:s,className:`m-0`,children:r?(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":!n,className:N(f,`w-full rounded-[var(--r-md)] text-left hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`),onClick:r,children:[t,d,n?(0,J.jsx)(l,{className:`size-3`,"aria-hidden":`true`}):(0,J.jsx)(c,{className:`size-3`,"aria-hidden":`true`})]}):(0,J.jsxs)(`span`,{className:f,children:[t,d]})}),!n&&(e.rows.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:o}):a?(0,J.jsx)(`p`,{className:`px-2.5 pl-[34px] text-xs leading-7 text-content-faint`,children:a}):null),!n&&i]})}function fe({row:e,href:t,current:n,now:r,hidden:i,fresh:a,handlers:s,approveBinding:c,denyBinding:l,onKeyDown:u,drawer:d=!1}){let{t:h}=o(),g=(0,q.useRef)(null),v=(0,q.useRef)(null),b=(0,q.useRef)(null),[x,C]=(0,q.useState)(!1),T=e.group===`attention`;(0,q.useLayoutEffect)(()=>{if(!a||!f())return;let e=g.current,t=v.current;e&&typeof e.animate==`function`&&(e.style.transformOrigin=`top center`,e.animate([{transform:`scaleY(.6)`,opacity:0},{transform:`scaleY(1)`,opacity:1}],{duration:Y,easing:`ease-out`})),t&&typeof t.animate==`function`&&t.animate([{transform:`scale(1)`,opacity:.55},{transform:`scale(2.6)`,opacity:0}],{duration:X,easing:`ease-out`})},[a]),(0,q.useLayoutEffect)(()=>{let e=g.current,t=b.current;if(!e||!t)return;let n=()=>e.style.setProperty(`--quick-w`,`${t.offsetWidth+12}px`);if(n(),typeof ResizeObserver!=`function`)return;let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[]);let E=``,O=``;e.group===`attention`?(E=_(e.waitingSince===null?null:r-e.waitingSince),O=w(h,e.reasons)):E=e.group===`running`?y(e.startedAt===null?null:r-e.startedAt):e.group===`queued`?`#${e.position}`:e.group===`pinned`?S(e.at,r):p(e.finishedAt);let k=e.group===`attention`?E?h(`board:sidebar.attentionRow`,{title:e.title,reason:O,wait:E}):h(`board:sidebar.attentionRowNoWait`,{title:e.title,reason:O}):void 0,A=`flex h-[26px] flex-none items-center gap-1 rounded-[var(--r-sm)] px-2 text-[12.5px] leading-none font-medium transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus`;return(0,J.jsxs)(`li`,{ref:g,"data-sidebar-item":e.id,"data-menu-open":x||void 0,hidden:i,className:`group/row relative`,children:[(0,J.jsxs)(`a`,{href:t,"data-sidebar-row":e.id,"data-sidebar-group-row":e.group,"aria-current":n?`page`:void 0,"aria-label":k,className:N(`flex min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-base text-content [transition:color_var(--d-fast),background-color_var(--d-fast),padding-right_0s_80ms] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,T?d?`h-14`:`h-12 pointer-coarse:h-14`:d?`h-11`:`h-9 pointer-coarse:h-11`,`group-hover/row:pr-[max(10px,var(--quick-w,0px))] group-focus-within/row:pr-[max(10px,var(--quick-w,0px))] group-data-[menu-open]/row:pr-[max(10px,var(--quick-w,0px))]`,n?`bg-surface-active`:`group-hover/row:bg-surface-hover`),onClick:t=>{ce(t)&&(t.preventDefault(),s.open(e))},onKeyDown:t=>u(t,e),children:[(0,J.jsxs)(`span`,{className:N(`relative grid size-4 flex-none place-items-center`,T&&`self-start mt-[7px]`),children:[e.group===`pinned`?(0,J.jsx)(D,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,role:`img`,"aria-label":h(`board:sidebar.group.pinned`)}):(0,J.jsx)(G,{status:e.glyph,phase:e.group===`running`?e.phase:void 0,label:T?void 0:me(h,e)}),T&&(0,J.jsx)(`span`,{ref:v,"aria-hidden":`true`,className:`pointer-events-none absolute inset-1 rounded-full bg-st-attn-fill opacity-0`})]}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:N(`min-w-0 truncate leading-5`,e.group===`done`&&`text-content-secondary`),children:e.title}),e.group===`done`&&e.unread&&(0,J.jsx)(`span`,{role:`img`,"aria-label":h(`board:sidebar.unread`),className:`size-1.5 flex-none translate-y-[-1px] self-center rounded-full bg-content-secondary`})]}),T&&(0,J.jsx)(`span`,{className:`truncate text-xs leading-[17px] text-warning-strong`,children:O})]}),E&&(0,J.jsx)(`span`,{"aria-hidden":T||void 0,className:N(`flex-none text-xs tabular-nums`,e.group===`running`?`font-mono text-content-secondary`:n?`text-content-secondary`:`text-content-muted`,T&&`self-start mt-[7px]`,`max-w-24 overflow-hidden whitespace-nowrap [transition:opacity_120ms_80ms,max-width_0s_80ms] group-hover/row:max-w-0 group-hover/row:opacity-0 group-focus-within/row:max-w-0 group-focus-within/row:opacity-0 group-data-[menu-open]/row:max-w-0 group-data-[menu-open]/row:opacity-0 pointer-coarse:group-hover/row:max-w-24 pointer-coarse:group-hover/row:opacity-100`),children:E})]}),d&&e.group===`attention`&&e.quickAction.kind===`decide`&&(0,J.jsxs)(`div`,{"data-sidebar-drawer-actions":!0,className:`flex gap-2 pr-2.5 pb-1.5 pl-[36px]`,children:[(0,J.jsx)(`button`,{type:`button`,className:`flex h-11 min-w-0 flex-1 items-center justify-center rounded-[var(--r-md)] bg-solid text-sm font-medium text-content ring-1 ring-stroke-strong ring-inset focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus active:bg-surface-hover`,"aria-label":h(`board:sidebar.denyNamed`,{title:e.title}),onClick:t=>s.decide(e,!1,t.currentTarget.closest(`[data-sidebar-item]`)),children:h(`board:sidebar.deny`)}),(0,J.jsx)(`button`,{type:`button`,className:`flex h-11 min-w-0 flex-1 items-center justify-center rounded-[var(--r-md)] bg-star text-sm font-medium text-on-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus active:bg-star-hover`,"aria-label":h(`board:sidebar.approveNamed`,{title:e.title}),onClick:t=>s.decide(e,!0,t.currentTarget.closest(`[data-sidebar-item]`)),children:h(`board:sidebar.approve`)})]}),(0,J.jsxs)(`div`,{ref:b,"data-sidebar-quick":!0,className:N(`absolute top-1/2 right-1.5 flex -translate-y-1/2 items-center gap-1`,`invisible opacity-0 transition-[opacity,visibility] delay-[80ms] duration-[120ms] group-hover/row:visible group-hover/row:opacity-100 group-focus-within/row:visible group-focus-within/row:opacity-100 group-data-[menu-open]/row:visible group-data-[menu-open]/row:opacity-100 pointer-coarse:hidden`,d&&`hidden`),children:[e.group===`attention`&&(e.quickAction.kind===`decide`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-solid text-content ring-1 ring-stroke-strong ring-inset hover:bg-surface-hover`),"aria-label":h(`board:sidebar.denyNamed`,{title:e.title}),"aria-keyshortcuts":W(l),onClick:t=>s.decide(e,!1,t.currentTarget.closest(`[data-sidebar-item]`)),children:[h(`board:sidebar.deny`),(0,J.jsx)(pe,{binding:l})]}),(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-star text-on-accent hover:bg-star-hover`),"aria-label":h(`board:sidebar.approveNamed`,{title:e.title}),"aria-keyshortcuts":W(c),onClick:t=>s.decide(e,!0,t.currentTarget.closest(`[data-sidebar-item]`)),children:[h(`board:sidebar.approve`),(0,J.jsx)(pe,{binding:c})]})]}):(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-solid text-content ring-1 ring-stroke-strong ring-inset hover:bg-surface-hover`),"aria-label":h(`board:sidebar.openNamed`,{title:e.title}),onClick:()=>s.open(e),children:[h(`board:sidebar.open`),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`text-content-faint`,children:`↵`})]})),(0,J.jsx)(m,{row:e,actions:s,canMarkHandled:e.group===`attention`&&e.status===`failed`,open:x,onOpenChange:C,side:`right`})]})]})}function pe({binding:e}){let t=e&&/^Key[A-Z]$/.test(e)?e.slice(3):``;return t?(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`font-normal opacity-60`,children:t}):null}function me(e,t){switch(t.glyph){case`run`:return e(`common:statusGlyph.run`);case`queued`:return e(`common:statusGlyph.queued`);case`failed`:return e(`common:statusGlyph.failed`);case`stopped`:return e(`common:statusGlyph.stopped`);case`attention`:return e(`common:statusGlyph.attention`);default:return e(`common:statusGlyph.done`)}}var he=(0,q.lazy)(()=>n(()=>import(`./ManageProjectsDialog-DSN8QUPg.js`).then(e=>({default:e.ManageProjectsDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]))),ge=(0,q.lazy)(()=>n(()=>import(`./WorkspacePicker-B68VTV5x.js`).then(e=>({default:e.WorkspacePicker})),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,10,43,44,19,18,20,17,45,37,38,39,40,41,46]))),_e=[{lane:`attention`,glyph:`attention`},{lane:`running`,glyph:`run`},{lane:`queued`,glyph:`queued`},{lane:`done`,glyph:`done`}],ve=`flex h-8 w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-left text-[13.5px] text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,ye=`flex h-7 min-w-0 flex-1 items-center px-2.5 text-xs font-medium text-content-muted`;function be(e){return e?[...e.querySelectorAll(`[data-sidebar-filter]`)]:[]}function xe({notify:e,requestConfirm:n,requestText:r,onNewTask:i,onOpenHistory:a}){let{t:s}=o(),{items:c,capabilities:l,isLoading:f}=V(`today`),p=B(),m=L(e=>e.lanes),h=L(e=>e.projects),g=L(e=>e.setLaneFilter),_=L(e=>e.setProjectFilter),y=L(e=>e.clearFilters),S=(0,q.useMemo)(()=>b(c,{now:p,capabilities:l}),[l,c,p]),C=x((0,q.useMemo)(()=>ee(c),[c])),w=(0,q.useRef)(null),D=t(`/`),P=v({notify:e,requestConfirm:n,requestText:r,onProjectChosen:i,announceChoice:!0}),[F,I]=(0,q.useState)(!1),[te,R]=(0,q.useState)(!1),z=(0,q.useRef)(null),{mounted:H,...W}=P.picker,K={attention:s(`board:sidebar.group.attention`),running:s(`board:sidebar.group.running`),queued:s(`board:sidebar.group.queued`),done:s(`board:sidebar.group.done`)},Y=e=>g(m.length===1&&m[0]===e?[]:[e]),X=e=>_(h.length===1&&h[0]===e?[]:[e]),re=e=>{if(e.altKey||e.metaKey||e.ctrlKey||e.shiftKey)return;let t=e.target;if(!t.hasAttribute(`data-sidebar-filter`))return;let n=be(w.current),r=n.indexOf(t),i=e.key===`ArrowDown`?n[r+1]:e.key===`ArrowUp`?n[r-1]:e.key===`Home`?n[0]:e.key===`End`?n.at(-1):void 0;i&&(e.preventDefault(),i.focus())};if(f)return(0,J.jsx)(le,{label:s(`board:sidebar.loading`)});let Z=_e.filter(({lane:e})=>e!==`queued`||l.sessionQueue===!0&&S.lanes.queued>0),Q=s(`board:filter.projects`);return(0,J.jsxs)(`div`,{ref:w,"data-sidebar-filters":!0,className:`flex flex-col gap-3 pb-2`,onKeyDown:re,children:[(0,J.jsxs)(`section`,{"aria-labelledby":`sidebar-filter-status`,children:[(0,J.jsx)(`h2`,{id:`sidebar-filter-status`,className:ye,children:s(`board:filter.statuses`)}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:[(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{id:U,filter:`all`,pressed:m.length===0&&h.length===0,label:s(`board:sidebar.filter.all`),count:S.total,icon:(0,J.jsx)(ne,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,"aria-hidden":`true`}),onClick:y})}),Z.map(({lane:e,glyph:t})=>{let n=S.lanes[e],r=e===`attention`&&n>0;return(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{filter:e,pressed:m.includes(e),label:K[e],count:n,attention:r,icon:(0,J.jsx)(G,{status:t,spin:!1,className:N(`size-4`,n===0&&e===`attention`&&`text-content-faint`)}),onClick:()=>Y(e)})},e)})]})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`sidebar-filter-projects`,children:[(0,J.jsxs)(`div`,{className:`flex items-center pr-1`,children:[(0,J.jsx)(`h2`,{id:`sidebar-filter-projects`,className:ye,children:Q}),(0,J.jsxs)(M,{children:[(0,J.jsx)(A,{asChild:!0,children:(0,J.jsx)(`button`,{type:`button`,"data-sidebar-projects-menu":!0,"aria-label":s(`board:sidebar.filter.projectActions`),title:s(`board:sidebar.filter.projectActions`),className:`grid size-6 flex-none place-items-center rounded-[var(--r-sm)] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-focus pointer-coarse:size-11`,children:(0,J.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,J.jsxs)(j,{align:`end`,className:`w-48`,onCloseAutoFocus:e=>{let t=z.current;t&&(z.current=null,e.preventDefault(),t())},children:[(0,J.jsxs)(k,{disabled:P.picking,onSelect:()=>z.current=()=>void P.newProject(),children:[(0,J.jsx)(T,{"aria-hidden":`true`}),s(`board:sidebar.filter.addProject`)]}),(0,J.jsxs)(k,{onSelect:()=>z.current=()=>{I(!0),R(!0)},children:[(0,J.jsx)(d,{"aria-hidden":`true`}),s(`board:project.manage`)]})]})]})]}),C.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:C.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{filter:`project:${e.key}`,pressed:h.includes(e.key),label:e.label,mono:!!e.cwd&&!e.custom,count:S.projects[e.key]??0,icon:(0,J.jsx)(E,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,"aria-hidden":`true`}),onClick:()=>X(e.key)})},e.key))}):(0,J.jsx)(`p`,{className:`px-2.5 text-xs leading-7 text-content-faint`,children:s(`board:sidebar.filter.noProjects`)})]}),(0,J.jsxs)(`a`,{href:D.replace(/\/$/,``)+`/chat/history`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] px-2.5 text-[13px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:e=>{e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),a())},children:[(0,J.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":`true`}),s(`board:sidebar.history`)]}),H&&(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(ge,{...W})}),F&&(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(he,{open:te,onOpenChange:R,commands:P})})]})}function Se({id:e,filter:t,pressed:n,label:r,count:i,icon:a,attention:o=!1,mono:s=!1,onClick:c}){return(0,J.jsxs)(`button`,{type:`button`,id:e,"data-sidebar-filter":t,"aria-pressed":n,title:r,className:N(ve,n&&`bg-surface-active font-medium hover:bg-surface-active`,o&&`text-warning-strong`),onClick:c,children:[(0,J.jsx)(`span`,{className:`grid size-4 flex-none place-items-center`,children:a}),(0,J.jsx)(`span`,{className:N(`min-w-0 flex-1 truncate`,s&&`font-mono text-[12.5px]`),children:r}),(0,J.jsx)(`span`,{"data-sidebar-filter-count":!0,className:N(`flex-none text-xs tabular-nums`,o?`font-semibold`:`text-content-muted`),children:i})]})}export{xe as SidebarBoardFilters,ie as SidebarCommands,oe as SidebarFleetLine,ae as SidebarRailCounts,se as SidebarSessions};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ManageProjectsDialog-03d7p6Td.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-react-DwNgTV1j.js","assets/use-i18n-CVZdp2ZN.js","assets/i18n-DfsxGeh5.js","assets/vendor-router-CSN_DGvx.js","assets/index-BDgCJ4Fs.js","assets/index-CfTBR7Rs.css","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/arrow-down-CDGua-ue.js","assets/arrow-up-DST6-qVQ.js","assets/folder-plus-OPHZsJho.js","assets/pencil-U08v_vV9.js","assets/rotate-ccw-C0v8V77_.js","assets/trash-2-CNrPOoPR.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/useSessionListQuery-CJ-BYuqu.js","assets/useQuery-Bg3cTjsY.js","assets/startup-queries-BAWDaQY5.js","assets/mutation-Difliohy.js","assets/api-45iTnFjN.js","assets/abort-signal-f4JsiYKX.js","assets/component-changes-Q9Bf64Ob.js","assets/runtime-capabilities-store-D1FwQXKw.js","assets/runtime-capabilities-BhAMiYhG.js","assets/session-board-status-D2lpFPiI.js","assets/chat-api-BBuYjxwz.js","assets/session-organization-api-BgCoIi2X.js","assets/events-n27XPFgs.js","assets/session-questions-Cf-1g85h.js","assets/card-presentation-1oph2b8P.js","assets/dialog-2cmY5V75.js","assets/x-07u4-129.js","assets/dist-BHkR6BLP.js","assets/dist-BsRXXcSL.js","assets/es2015-DTZdOI9P.js","assets/board-projects-LnEYyP4h.js","assets/WorkspacePicker-DPwlN6KA.js","assets/check-2vYc6QaP.js","assets/triangle-alert-CE1q54ci.js","assets/input-CPw-zkYh.js","assets/alert-firawb0H.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{c as t,h as n}from"./vendor-router-CSN_DGvx.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{f as a}from"./routes-Da0OHSy6.js";import{t as o}from"./use-i18n-CVZdp2ZN.js";import{t as s}from"./createLucideIcon-Cd-3GVxJ.js";import{t as c}from"./chevron-down-CxtxIjiP.js";import{t as l}from"./chevron-right-C3t2Rckj.js";import{t as u}from"./ellipsis-CfGKfbq6.js";import{_ as d,a as f,c as p,d as m,g as h,i as g,l as _,n as v,o as y,p as b,r as x,s as S,t as C,u as w}from"./useSessionRowActions-D0GKtBhg.js";import{t as T}from"./folder-plus-OPHZsJho.js";import{r as E}from"./launch-defaults-store-CGeglXDI.js";import{t as D}from"./pin-CU0FG0lI.js";import{t as O}from"./rotate-ccw-clock-CO6Bw-sF.js";import{i as k,p as A,r as j,t as M}from"./dropdown-menu-CFIFNaKO.js";import{t as N}from"./utils-C8uzG5AZ.js";import{c as P,g as F}from"./shortcuts-BGzXmClx.js";import{t as I}from"./sidebar-store-DztdHlUn.js";import{n as ee}from"./useSessionListQuery-CJ-BYuqu.js";import{c as L,l as te,n as R,r as z,t as B}from"./useNow-CxO2FUQY.js";import{t as V}from"./useBoardItems-DCo-4he0.js";import{t as H}from"./useSidebarModel-b5cdTj9-.js";import{t as U}from"./new-task-C3wuHTor.js";import{t as W}from"./shortcut-aria-jHRmld9z.js";import{t as G}from"./StatusGlyph-1KgitlUg.js";import{t as K}from"./sidebar-commands-ZA1UOA_F.js";var ne=s(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),q=e(r(),1),J=i(),Y=160,X=600;function re(e,t){switch(t){case`attention`:return e(`board:sidebar.group.attention`);case`running`:return e(`board:sidebar.group.running`);case`queued`:return e(`board:sidebar.group.queued`);case`pinned`:return e(`board:sidebar.group.pinned`);default:return e(`board:sidebar.group.done`)}}function Z(e){return e?[...e.querySelectorAll(`[data-sidebar-row]`)]:[]}function Q(e,t={}){$(()=>e(Z(document.querySelector(`[data-sidebar-groups]`))),t)}function $(e,{unclaimed:t=!1}={}){let n=0,r=()=>{let i=document.activeElement;if(t&&i&&i!==document.body&&!i.closest(`[data-shell-sidebar]`))return;let a=e();if(a){a.focus(),a.scrollIntoView?.({block:`nearest`});return}(n+=1)<20&&requestAnimationFrame(r)};requestAnimationFrame(r)}function ie({resolveCurrentId:e,renderedSessionId:t,onOpenSession:n,onWaiting:r}){let{t:i}=o(),{model:a,isLoading:s}=H(),c=(0,q.useRef)(a);c.current=a;let l=(0,q.useRef)({resolveCurrentId:e,onOpenSession:n});l.current={resolveCurrentId:e,onOpenSession:n},(0,q.useEffect)(()=>{let e=e=>{let t=e.detail;if(!t)return;let n=c.current;if(t.kind===`adjacent`){let e=I.getState().doneCollapsed?n.groups.flatMap(e=>e.id===`done`?[]:e.rows.map(e=>e.id)):n.order,r=z(e,l.current.resolveCurrentId()||null,t.direction);r&&l.current.onOpenSession(r);return}let r=I.getState();if(document.documentElement.hasAttribute(`data-phone-shell`)){let e=t.kind===`focus-attention`?n.longestWaitingId:l.current.resolveCurrentId();if(t.kind===`focus-attention`&&!e)return;r.setDrawerOpen(!0),Q(n=>n.find(t=>t.dataset.sidebarRow===e)??(t.kind===`focus-list`?n[0]:void 0));return}let i=document.querySelector(`[data-settings-sidebar]`);if(i){let e=t.kind===`focus-attention`?`[data-sidebar-fleet-line]`:`[data-settings-section][aria-current="page"]`;$(()=>i.querySelector(e)??void 0);return}let a=document.querySelector(`[data-overview]`);if(t.kind===`focus-attention`){let e=n.longestWaitingId;if(!e)return;if(a){h(e);return}r.collapsed&&r.setPeeking(!0),Q(t=>t.find(t=>t.dataset.sidebarRow===e));return}if(r.collapsed&&r.setPeeking(!0),a){$(()=>{let e=document.querySelector(`[data-shell-sidebar] [data-sidebar-filters]`);return e?.querySelector(`[data-sidebar-filter][aria-pressed="true"]`)??e?.querySelector(`[data-sidebar-filter]`)??void 0});return}let o=l.current.resolveCurrentId();Q(e=>e.find(e=>e.dataset.sidebarRow===o)??e[0])};return window.addEventListener(K,e),()=>window.removeEventListener(K,e)},[]);let u=(0,q.useRef)(t),d=(0,q.useRef)(null);(0,q.useEffect)(()=>{let e=u.current;if(u.current=t,t===null){e&&(d.current=e);return}if(e!==null)return;let n=d.current;d.current=null,!(!n||n!==t||I.getState().collapsed)&&Q(e=>e.find(e=>e.dataset.sidebarRow===n),{unclaimed:!0})},[t]);let f=(0,q.useRef)(r);f.current=r;let p=(0,q.useRef)(null),[m,g]=(0,q.useState)(``);return(0,q.useEffect)(()=>{if(s)return;let e=a.groups.find(e=>e.id===`attention`)?.rows??[],t=p.current;if(p.current=new Set(e.map(e=>e.id)),!t)return;let n=e.filter(e=>!t.has(e.id));if(n.length){for(let e of n)e.reasons.some(e=>e.kind===`approval`||e.kind===`question`)&&f.current?.({title:e.title,reason:w(i,e.reasons)});g(n.map(e=>i(`board:sidebar.announce`,{title:e.title,reason:w(i,e.reasons)})).join(i(`board:sidebar.announceSeparator`)))}},[a.groups,s,i]),(0,J.jsx)(`p`,{"data-sidebar-announce":!0,"aria-live":`polite`,role:`status`,className:`sr-only`,children:m})}function ae({onOpenBoard:e}){let{t}=o(),{model:n,isLoading:r}=H(),i=L(e=>e.setLaneFilter),a=t=>{i([t]),e()},s=n.counts.attention,c=n.counts.running,l=`grid size-10 place-items-center rounded-[var(--r-md)] text-xs font-semibold tabular-nums transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`;return(0,J.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,"aria-busy":r||void 0,children:[(0,J.jsx)(`button`,{type:`button`,"data-rail-count":`attention`,"aria-label":t(`board:sidebar.railAttention`,{count:s}),title:t(`board:sidebar.railAttention`,{count:s}),className:N(l,s>0?`bg-warning-soft text-warning-strong ring-1 ring-st-attn-border ring-inset hover:brightness-[.98]`:`text-content-muted hover:bg-surface-hover`),onClick:()=>a(`attention`),children:(0,J.jsxs)(`span`,{className:`flex flex-col items-center gap-0.5 leading-none`,children:[(0,J.jsx)(G,{status:`attention`,className:N(`size-3.5`,s===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{children:s})]})}),(0,J.jsx)(`button`,{type:`button`,"data-rail-count":`running`,"aria-label":t(`board:sidebar.railRunning`,{count:c}),title:t(`board:sidebar.railRunning`,{count:c}),className:N(l,`hover:bg-surface-hover`,c>0?`text-content-secondary`:`text-content-muted`),onClick:()=>a(`running`),children:(0,J.jsxs)(`span`,{className:`flex flex-col items-center gap-0.5 leading-none`,children:[(0,J.jsx)(G,{status:`run`,spin:c>0,className:N(`size-3.5`,c===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{children:c})]})})]})}function oe({onOpenBoard:e}){let{t}=o(),{model:n,isLoading:r}=H(),i=L(e=>e.setLaneFilter),a=n.counts.attention,s=n.counts.running;return(0,J.jsxs)(`button`,{type:`button`,"data-sidebar-fleet-line":!0,"aria-busy":r||void 0,"aria-label":t(`board:sidebar.fleet.label`,{attention:a,running:s}),className:`flex h-10 w-full min-w-0 items-center gap-1.5 rounded-[var(--r-md)] px-2.5 text-left text-[12.5px] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:()=>{i([]),e()},children:[(0,J.jsx)(G,{status:`attention`,className:N(`size-3.5 flex-none`,a===0&&`text-content-faint`)}),(0,J.jsx)(`span`,{"data-sidebar-fleet":`attention`,className:N(`truncate`,a>0&&`font-medium text-warning-strong`),children:t(`board:sidebar.fleet.attention`,{count:a})}),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`text-content-faint`,children:`·`}),(0,J.jsx)(G,{status:`run`,spin:s>0,className:`size-3.5 flex-none`}),(0,J.jsx)(`span`,{"data-sidebar-fleet":`running`,className:`truncate`,children:t(`board:sidebar.fleet.running`,{count:s})}),(0,J.jsx)(l,{className:`ml-auto size-3.5 flex-none text-content-muted`,"aria-hidden":`true`})]})}function se({currentId:e,notify:n,requestText:r,onOpenSession:i,onOpenBoard:s,onOpenHistory:c,onArchived:l,drawer:u=!1}){let{t:d}=o(),{model:f,isLoading:p,error:m,refetch:h}=H(),_=te(),v=(0,q.useRef)(_);v.current=_;let y=I(e=>e.doneCollapsed),b=I(e=>e.setDoneCollapsed),x=L(e=>e.setLaneFilter),S=P(e=>e.boardBindings),w=t(`/`),T=(0,q.useCallback)(e=>w.replace(/\/$/,``)+a(e),[w]),E=f.counts.attention+f.counts.running>0,D=R(E),k=(0,q.useRef)(null),[A,j]=(0,q.useState)(()=>new Set),M=(e,t)=>j(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r}),N=(0,q.useRef)(null),[ee,z]=(0,q.useState)(()=>new Set),B=(0,q.useMemo)(()=>f.groups.find(e=>e.id===`attention`)?.rows??[],[f.groups]),V=(0,q.useRef)(new Set);V.current=new Set(B.map(e=>e.id)),(0,q.useEffect)(()=>{if(p)return;let e=new Set(B.map(e=>e.id)),t=N.current;if(N.current=e,!t)return;let n=B.filter(e=>!t.has(e.id));n.length&&z(new Set(n.map(e=>e.id)))},[B,p]);let U=C({notify:n,requestText:r,onOpenSession:i,onArchived:l}),W=U.report,G=(0,q.useCallback)(async(e,t,n)=>{if(e.quickAction.kind!==`decide`){i(e.id);return}let{approvalId:r,remaining:a}=e.quickAction,o=a===0,s=!!n?.contains(document.activeElement),c=Z(k.current),l=c.findIndex(t=>t.dataset.sidebarRow===e.id),u=c[l+1]??c[l-1];s&&o&&u?.focus();let d=!1,f=o?g(n,{duration:160,scale:.6}).then(()=>{d||M(e.id,!0)}):Promise.resolve(),p=t?await v.current.approve(e.id,r,{confirmCritical:!1}):await v.current.deny(e.id,r);if(p.ok){if(!o||(await f,!V.current.has(e.id)))return;M(e.id,!1),n?.getAnimations?.().forEach(e=>e.cancel());return}d=!0,await f,M(e.id,!1),n?.getAnimations?.().forEach(e=>e.cancel()),p.reason===`confirmation-required`?i(e.id):W(p)},[i,W]);(0,q.useEffect)(()=>{j(e=>{if(!e.size)return e;let t=new Set(B.map(e=>e.id)),n=new Set([...e].filter(e=>t.has(e)));return n.size===e.size?e:n})},[B]);let K=(0,q.useMemo)(()=>({...U,decide:(e,t,n)=>void G(e,t,n)}),[G,U]),ne=(e,t)=>{if(e.altKey||e.metaKey||e.ctrlKey)return;if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=Z(k.current);t[t.indexOf(e.currentTarget)+(e.key===`ArrowDown`?1:-1)]?.focus();return}if(t.group!==`attention`||e.shiftKey)return;let n=F(e.nativeEvent,S.boardApprove),r=!n&&F(e.nativeEvent,S.boardDeny);!n&&!r||(e.preventDefault(),t.quickAction.kind===`decide`&&K.decide(t,n,e.currentTarget.closest(`[data-sidebar-item]`)))},Y=()=>{x([`running`]),s()};if(p)return(0,J.jsx)(le,{label:d(`board:sidebar.loading`)});let X=!m&&f.groups.every(e=>e.count===0)&&f.groups.length<=2;return(0,J.jsxs)(`div`,{ref:k,"data-sidebar-groups":!0,className:`flex flex-col gap-3 pb-2`,children:[m&&f.groups.every(e=>e.count===0)?(0,J.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 px-2.5 py-2 text-xs text-content-muted`,children:[(0,J.jsx)(`p`,{children:d(`board:sidebar.error`)}),(0,J.jsx)(`button`,{type:`button`,className:`rounded-sm text-content-secondary underline underline-offset-2 hover:text-content focus-visible:outline-2 focus-visible:outline-focus`,onClick:h,children:d(`board:sidebar.retry`)})]}):X?(0,J.jsx)(`p`,{className:`px-2.5 py-2 text-xs leading-5 text-content-muted`,children:d(`board:sidebar.empty`)}):f.groups.map(t=>(0,J.jsx)(de,{group:t,title:re(d,t.id),collapsed:t.id===`done`&&y,onToggle:t.id===`done`?()=>b(!y):void 0,footer:t.id===`running`&&t.hidden>0?(0,J.jsx)(ue,{onClick:Y,children:d(`board:sidebar.moreRunning`,{count:t.hidden})}):t.id===`done`&&t.hidden>0?(0,J.jsx)(ue,{onClick:c,children:d(`board:sidebar.allDone`)}):null,emptyText:t.id===`attention`?d(`board:sidebar.emptyAttention`):t.id===`running`?d(`board:sidebar.emptyRunning`):``,children:t.rows.map(t=>(0,J.jsx)(fe,{row:t,href:T(t.id),current:t.id===e,now:D,hidden:A.has(t.id),fresh:ee.has(t.id),handlers:K,approveBinding:S.boardApprove,denyBinding:S.boardDeny,onKeyDown:ne,drawer:u},t.id))},t.id)),(0,J.jsxs)(`a`,{href:w.replace(/\/$/,``)+`/chat/history`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] px-2.5 text-[13px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:e=>{ce(e)&&(e.preventDefault(),c())},children:[(0,J.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":`true`}),d(`board:sidebar.history`)]})]})}function ce(e){return e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey}function le({label:e}){return(0,J.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":e,className:`flex flex-col gap-1 px-1 pt-1`,children:[64,48,72,56].map(e=>(0,J.jsxs)(`div`,{className:`flex h-9 items-center gap-2.5 px-1.5`,"aria-hidden":`true`,children:[(0,J.jsx)(`span`,{className:`size-4 flex-none rounded-full bg-surface-hover`}),(0,J.jsx)(`span`,{className:`h-3 rounded-sm bg-surface-hover`,style:{width:`${e}%`}})]},e))})}function ue({children:e,onClick:t}){return(0,J.jsx)(`button`,{type:`button`,className:`flex h-7 w-full items-center gap-1 rounded-[var(--r-md)] px-2.5 pl-[34px] text-left text-xs text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:t,children:e})}function de({group:e,title:t,collapsed:n,onToggle:r,footer:i,emptyText:a,children:o}){let s=`sidebar-group-${e.id}`,u=e.id===`attention`,d=(0,J.jsx)(`span`,{"data-sidebar-count":!0,className:N(`tabular-nums`,u&&e.count>0&&`inline-grid h-[18px] min-w-[18px] place-items-center rounded-full bg-warning-soft px-1.5 text-[11.5px] font-semibold ring-1 ring-st-attn-border ring-inset`),children:e.count}),f=N(`flex h-7 items-center gap-1.5 px-2.5 text-xs font-medium`,u&&e.count>0?`text-warning-strong`:`text-content-muted`);return(0,J.jsxs)(`section`,{"aria-labelledby":s,"data-sidebar-group":e.id,children:[(0,J.jsx)(`h2`,{id:s,className:`m-0`,children:r?(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":!n,className:N(f,`w-full rounded-[var(--r-md)] text-left hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`),onClick:r,children:[t,d,n?(0,J.jsx)(l,{className:`size-3`,"aria-hidden":`true`}):(0,J.jsx)(c,{className:`size-3`,"aria-hidden":`true`})]}):(0,J.jsxs)(`span`,{className:f,children:[t,d]})}),!n&&(e.rows.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:o}):a?(0,J.jsx)(`p`,{className:`px-2.5 pl-[34px] text-xs leading-7 text-content-faint`,children:a}):null),!n&&i]})}function fe({row:e,href:t,current:n,now:r,hidden:i,fresh:a,handlers:s,approveBinding:c,denyBinding:l,onKeyDown:u,drawer:d=!1}){let{t:h}=o(),g=(0,q.useRef)(null),v=(0,q.useRef)(null),b=(0,q.useRef)(null),[x,C]=(0,q.useState)(!1),T=e.group===`attention`;(0,q.useLayoutEffect)(()=>{if(!a||!f())return;let e=g.current,t=v.current;e&&typeof e.animate==`function`&&(e.style.transformOrigin=`top center`,e.animate([{transform:`scaleY(.6)`,opacity:0},{transform:`scaleY(1)`,opacity:1}],{duration:Y,easing:`ease-out`})),t&&typeof t.animate==`function`&&t.animate([{transform:`scale(1)`,opacity:.55},{transform:`scale(2.6)`,opacity:0}],{duration:X,easing:`ease-out`})},[a]),(0,q.useLayoutEffect)(()=>{let e=g.current,t=b.current;if(!e||!t)return;let n=()=>e.style.setProperty(`--quick-w`,`${t.offsetWidth+12}px`);if(n(),typeof ResizeObserver!=`function`)return;let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[]);let E=``,O=``;e.group===`attention`?(E=_(e.waitingSince===null?null:r-e.waitingSince),O=w(h,e.reasons)):E=e.group===`running`?y(e.startedAt===null?null:r-e.startedAt):e.group===`queued`?`#${e.position}`:e.group===`pinned`?S(e.at,r):p(e.finishedAt);let k=e.group===`attention`?E?h(`board:sidebar.attentionRow`,{title:e.title,reason:O,wait:E}):h(`board:sidebar.attentionRowNoWait`,{title:e.title,reason:O}):void 0,A=`flex h-[26px] flex-none items-center gap-1 rounded-[var(--r-sm)] px-2 text-[12.5px] leading-none font-medium transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus`;return(0,J.jsxs)(`li`,{ref:g,"data-sidebar-item":e.id,"data-menu-open":x||void 0,hidden:i,className:`group/row relative`,children:[(0,J.jsxs)(`a`,{href:t,"data-sidebar-row":e.id,"data-sidebar-group-row":e.group,"aria-current":n?`page`:void 0,"aria-label":k,className:N(`flex min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-base text-content [transition:color_var(--d-fast),background-color_var(--d-fast),padding-right_0s_80ms] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,T?d?`h-14`:`h-12 pointer-coarse:h-14`:d?`h-11`:`h-9 pointer-coarse:h-11`,`group-hover/row:pr-[max(10px,var(--quick-w,0px))] group-focus-within/row:pr-[max(10px,var(--quick-w,0px))] group-data-[menu-open]/row:pr-[max(10px,var(--quick-w,0px))]`,n?`bg-surface-active`:`group-hover/row:bg-surface-hover`),onClick:t=>{ce(t)&&(t.preventDefault(),s.open(e))},onKeyDown:t=>u(t,e),children:[(0,J.jsxs)(`span`,{className:N(`relative grid size-4 flex-none place-items-center`,T&&`self-start mt-[7px]`),children:[e.group===`pinned`?(0,J.jsx)(D,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,role:`img`,"aria-label":h(`board:sidebar.group.pinned`)}):(0,J.jsx)(G,{status:e.glyph,phase:e.group===`running`?e.phase:void 0,label:T?void 0:me(h,e)}),T&&(0,J.jsx)(`span`,{ref:v,"aria-hidden":`true`,className:`pointer-events-none absolute inset-1 rounded-full bg-st-attn-fill opacity-0`})]}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,J.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5`,children:[(0,J.jsx)(`span`,{className:N(`min-w-0 truncate leading-5`,e.group===`done`&&`text-content-secondary`),children:e.title}),e.group===`done`&&e.unread&&(0,J.jsx)(`span`,{role:`img`,"aria-label":h(`board:sidebar.unread`),className:`size-1.5 flex-none translate-y-[-1px] self-center rounded-full bg-content-secondary`})]}),T&&(0,J.jsx)(`span`,{className:`truncate text-xs leading-[17px] text-warning-strong`,children:O})]}),E&&(0,J.jsx)(`span`,{"aria-hidden":T||void 0,className:N(`flex-none text-xs tabular-nums`,e.group===`running`?`font-mono text-content-secondary`:n?`text-content-secondary`:`text-content-muted`,T&&`self-start mt-[7px]`,`max-w-24 overflow-hidden whitespace-nowrap [transition:opacity_120ms_80ms,max-width_0s_80ms] group-hover/row:max-w-0 group-hover/row:opacity-0 group-focus-within/row:max-w-0 group-focus-within/row:opacity-0 group-data-[menu-open]/row:max-w-0 group-data-[menu-open]/row:opacity-0 pointer-coarse:group-hover/row:max-w-24 pointer-coarse:group-hover/row:opacity-100`),children:E})]}),d&&e.group===`attention`&&e.quickAction.kind===`decide`&&(0,J.jsxs)(`div`,{"data-sidebar-drawer-actions":!0,className:`flex gap-2 pr-2.5 pb-1.5 pl-[36px]`,children:[(0,J.jsx)(`button`,{type:`button`,className:`flex h-11 min-w-0 flex-1 items-center justify-center rounded-[var(--r-md)] bg-solid text-sm font-medium text-content ring-1 ring-stroke-strong ring-inset focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus active:bg-surface-hover`,"aria-label":h(`board:sidebar.denyNamed`,{title:e.title}),onClick:t=>s.decide(e,!1,t.currentTarget.closest(`[data-sidebar-item]`)),children:h(`board:sidebar.deny`)}),(0,J.jsx)(`button`,{type:`button`,className:`flex h-11 min-w-0 flex-1 items-center justify-center rounded-[var(--r-md)] bg-star text-sm font-medium text-on-accent focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus active:bg-star-hover`,"aria-label":h(`board:sidebar.approveNamed`,{title:e.title}),onClick:t=>s.decide(e,!0,t.currentTarget.closest(`[data-sidebar-item]`)),children:h(`board:sidebar.approve`)})]}),(0,J.jsxs)(`div`,{ref:b,"data-sidebar-quick":!0,className:N(`absolute top-1/2 right-1.5 flex -translate-y-1/2 items-center gap-1`,`invisible opacity-0 transition-[opacity,visibility] delay-[80ms] duration-[120ms] group-hover/row:visible group-hover/row:opacity-100 group-focus-within/row:visible group-focus-within/row:opacity-100 group-data-[menu-open]/row:visible group-data-[menu-open]/row:opacity-100 pointer-coarse:hidden`,d&&`hidden`),children:[e.group===`attention`&&(e.quickAction.kind===`decide`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-solid text-content ring-1 ring-stroke-strong ring-inset hover:bg-surface-hover`),"aria-label":h(`board:sidebar.denyNamed`,{title:e.title}),"aria-keyshortcuts":W(l),onClick:t=>s.decide(e,!1,t.currentTarget.closest(`[data-sidebar-item]`)),children:[h(`board:sidebar.deny`),(0,J.jsx)(pe,{binding:l})]}),(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-star text-on-accent hover:bg-star-hover`),"aria-label":h(`board:sidebar.approveNamed`,{title:e.title}),"aria-keyshortcuts":W(c),onClick:t=>s.decide(e,!0,t.currentTarget.closest(`[data-sidebar-item]`)),children:[h(`board:sidebar.approve`),(0,J.jsx)(pe,{binding:c})]})]}):(0,J.jsxs)(`button`,{type:`button`,className:N(A,`bg-solid text-content ring-1 ring-stroke-strong ring-inset hover:bg-surface-hover`),"aria-label":h(`board:sidebar.openNamed`,{title:e.title}),onClick:()=>s.open(e),children:[h(`board:sidebar.open`),(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`text-content-faint`,children:`↵`})]})),(0,J.jsx)(m,{row:e,actions:s,canMarkHandled:e.group===`attention`&&e.status===`failed`,open:x,onOpenChange:C,side:`right`})]})]})}function pe({binding:e}){let t=e&&/^Key[A-Z]$/.test(e)?e.slice(3):``;return t?(0,J.jsx)(`span`,{"aria-hidden":`true`,className:`font-normal opacity-60`,children:t}):null}function me(e,t){switch(t.glyph){case`run`:return e(`common:statusGlyph.run`);case`queued`:return e(`common:statusGlyph.queued`);case`failed`:return e(`common:statusGlyph.failed`);case`stopped`:return e(`common:statusGlyph.stopped`);case`attention`:return e(`common:statusGlyph.attention`);default:return e(`common:statusGlyph.done`)}}var he=(0,q.lazy)(()=>n(()=>import(`./ManageProjectsDialog-03d7p6Td.js`).then(e=>({default:e.ManageProjectsDialog})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]))),ge=(0,q.lazy)(()=>n(()=>import(`./WorkspacePicker-DPwlN6KA.js`).then(e=>({default:e.WorkspacePicker})),__vite__mapDeps([42,1,2,3,4,5,6,7,8,9,10,43,44,19,18,20,17,36,37,38,39,40,45,46]))),_e=[{lane:`attention`,glyph:`attention`},{lane:`running`,glyph:`run`},{lane:`queued`,glyph:`queued`},{lane:`done`,glyph:`done`}],ve=`flex h-8 w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-left text-[13.5px] text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,ye=`flex h-7 min-w-0 flex-1 items-center px-2.5 text-xs font-medium text-content-muted`;function be(e){return e?[...e.querySelectorAll(`[data-sidebar-filter]`)]:[]}function xe({notify:e,requestConfirm:n,requestText:r,onNewTask:i,onOpenHistory:a}){let{t:s}=o(),{items:c,capabilities:l,isLoading:f}=V(`today`),p=B(),m=L(e=>e.lanes),h=L(e=>e.projects),g=L(e=>e.setLaneFilter),_=L(e=>e.setProjectFilter),y=L(e=>e.clearFilters),S=(0,q.useMemo)(()=>b(c,{now:p,capabilities:l}),[l,c,p]),C=x((0,q.useMemo)(()=>ee(c),[c])),w=(0,q.useRef)(null),D=t(`/`),P=v({notify:e,requestConfirm:n,requestText:r,onProjectChosen:i,announceChoice:!0}),[F,I]=(0,q.useState)(!1),[te,R]=(0,q.useState)(!1),z=(0,q.useRef)(null),{mounted:H,...W}=P.picker,K={attention:s(`board:sidebar.group.attention`),running:s(`board:sidebar.group.running`),queued:s(`board:sidebar.group.queued`),done:s(`board:sidebar.group.done`)},Y=e=>g(m.length===1&&m[0]===e?[]:[e]),X=e=>_(h.length===1&&h[0]===e?[]:[e]),re=e=>{if(e.altKey||e.metaKey||e.ctrlKey||e.shiftKey)return;let t=e.target;if(!t.hasAttribute(`data-sidebar-filter`))return;let n=be(w.current),r=n.indexOf(t),i=e.key===`ArrowDown`?n[r+1]:e.key===`ArrowUp`?n[r-1]:e.key===`Home`?n[0]:e.key===`End`?n.at(-1):void 0;i&&(e.preventDefault(),i.focus())};if(f)return(0,J.jsx)(le,{label:s(`board:sidebar.loading`)});let Z=_e.filter(({lane:e})=>e!==`queued`||l.sessionQueue===!0&&S.lanes.queued>0),Q=s(`board:filter.projects`);return(0,J.jsxs)(`div`,{ref:w,"data-sidebar-filters":!0,className:`flex flex-col gap-3 pb-2`,onKeyDown:re,children:[(0,J.jsxs)(`section`,{"aria-labelledby":`sidebar-filter-status`,children:[(0,J.jsx)(`h2`,{id:`sidebar-filter-status`,className:ye,children:s(`board:filter.statuses`)}),(0,J.jsxs)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:[(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{id:U,filter:`all`,pressed:m.length===0&&h.length===0,label:s(`board:sidebar.filter.all`),count:S.total,icon:(0,J.jsx)(ne,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,"aria-hidden":`true`}),onClick:y})}),Z.map(({lane:e,glyph:t})=>{let n=S.lanes[e],r=e===`attention`&&n>0;return(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{filter:e,pressed:m.includes(e),label:K[e],count:n,attention:r,icon:(0,J.jsx)(G,{status:t,spin:!1,className:N(`size-4`,n===0&&e===`attention`&&`text-content-faint`)}),onClick:()=>Y(e)})},e)})]})]}),(0,J.jsxs)(`section`,{"aria-labelledby":`sidebar-filter-projects`,children:[(0,J.jsxs)(`div`,{className:`flex items-center pr-1`,children:[(0,J.jsx)(`h2`,{id:`sidebar-filter-projects`,className:ye,children:Q}),(0,J.jsxs)(M,{children:[(0,J.jsx)(A,{asChild:!0,children:(0,J.jsx)(`button`,{type:`button`,"data-sidebar-projects-menu":!0,"aria-label":s(`board:sidebar.filter.projectActions`),title:s(`board:sidebar.filter.projectActions`),className:`grid size-6 flex-none place-items-center rounded-[var(--r-sm)] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-focus pointer-coarse:size-11`,children:(0,J.jsx)(u,{className:`size-3.5`,"aria-hidden":`true`})})}),(0,J.jsxs)(j,{align:`end`,className:`w-48`,onCloseAutoFocus:e=>{let t=z.current;t&&(z.current=null,e.preventDefault(),t())},children:[(0,J.jsxs)(k,{disabled:P.picking,onSelect:()=>z.current=()=>void P.newProject(),children:[(0,J.jsx)(T,{"aria-hidden":`true`}),s(`board:sidebar.filter.addProject`)]}),(0,J.jsxs)(k,{onSelect:()=>z.current=()=>{I(!0),R(!0)},children:[(0,J.jsx)(d,{"aria-hidden":`true`}),s(`board:project.manage`)]})]})]})]}),C.length?(0,J.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-px p-0`,children:C.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(Se,{filter:`project:${e.key}`,pressed:h.includes(e.key),label:e.label,mono:!!e.cwd&&!e.custom,count:S.projects[e.key]??0,icon:(0,J.jsx)(E,{className:`size-3.5 text-content-muted`,strokeWidth:1.75,"aria-hidden":`true`}),onClick:()=>X(e.key)})},e.key))}):(0,J.jsx)(`p`,{className:`px-2.5 text-xs leading-7 text-content-faint`,children:s(`board:sidebar.filter.noProjects`)})]}),(0,J.jsxs)(`a`,{href:D.replace(/\/$/,``)+`/chat/history`,className:`flex h-8 items-center gap-2 rounded-[var(--r-md)] px-2.5 text-[13px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content-secondary focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,onClick:e=>{e.button===0&&!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey&&(e.preventDefault(),a())},children:[(0,J.jsx)(O,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":`true`}),s(`board:sidebar.history`)]}),H&&(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(ge,{...W})}),F&&(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(he,{open:te,onOpenChange:R,commands:P})})]})}function Se({id:e,filter:t,pressed:n,label:r,count:i,icon:a,attention:o=!1,mono:s=!1,onClick:c}){return(0,J.jsxs)(`button`,{type:`button`,id:e,"data-sidebar-filter":t,"aria-pressed":n,title:r,className:N(ve,n&&`bg-surface-active font-medium hover:bg-surface-active`,o&&`text-warning-strong`),onClick:c,children:[(0,J.jsx)(`span`,{className:`grid size-4 flex-none place-items-center`,children:a}),(0,J.jsx)(`span`,{className:N(`min-w-0 flex-1 truncate`,s&&`font-mono text-[12.5px]`),children:r}),(0,J.jsx)(`span`,{"data-sidebar-filter-count":!0,className:N(`flex-none text-xs tabular-nums`,o?`font-semibold`:`text-content-muted`),children:i})]})}export{xe as SidebarBoardFilters,ie as SidebarCommands,oe as SidebarFleetLine,ae as SidebarRailCounts,se as SidebarSessions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-BDgCJ4Fs.js";import{o as t}from"./vendor-state-GkUciC5H.js";import{t as n}from"./storage-BY6wEHPw.js";var r=Object.freeze({collapsed:!1,doneCollapsed:!1});function i(e){let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return{...r}}if(!t||typeof t!=`object`||Array.isArray(t))return{...r};let n=t;return{collapsed:n.collapsed===!0,doneCollapsed:n.doneCollapsed===!0}}function a(e){return JSON.stringify({collapsed:e.collapsed===!0,doneCollapsed:e.doneCollapsed===!0})}function o(){try{return i(e.getItem(n.sidebar))}catch{return{...r}}}var s=t((t,r)=>{let i=i=>{let o=r(),s={...o,collapsed:o.preferenceCollapsed,...i};try{e.setItem(n.sidebar,a(s))}catch{}t(i.collapsed===void 0?i:{...i,preferenceCollapsed:i.collapsed})},s=e=>{t({peeking:!1}),r().routeRail?t({collapsed:e}):i({collapsed:e})},c=o();return{...c,preferenceCollapsed:c.collapsed,routeRail:!1,peeking:!1,drawerOpen:!1,setCollapsed:e=>s(e),toggleCollapsed:()=>s(!r().collapsed),enterRouteRail:()=>t({routeRail:!0,collapsed:!0,peeking:!1}),leaveRouteRail:()=>{r().routeRail&&t({routeRail:!1,collapsed:r().preferenceCollapsed,peeking:!1})},setDoneCollapsed:e=>i({doneCollapsed:e}),setPeeking:e=>t({peeking:e}),setDrawerOpen:e=>t({drawerOpen:e})}});typeof window<`u`&&window.addEventListener(`storage`,e=>{if(e.key!==n.sidebar&&e.key!==null)return;let t=o();s.setState(e=>e.routeRail?{doneCollapsed:t.doneCollapsed,preferenceCollapsed:t.collapsed}:{...t,preferenceCollapsed:t.collapsed})});export{s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{n as r,t as i}from"./dist-V8chnW6-.js";import{a}from"./dist-41X0pdUs.js";import{c as o,i as s,o as c,s as l}from"./dist-BsRXXcSL.js";import{n as u,t as d}from"./dist-DzGQ7sLi.js";import{t as f}from"./dist-OB2r6Xsr.js";import{t as p}from"./utils-C8uzG5AZ.js";var m=e(t(),1),h=n(),g=Object.defineProperty,_=(e,t)=>g(e,`name`,{value:t,configurable:!0}),v=[`PageUp`,`PageDown`],y=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],b={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},x=`Slider`,[S,C,w]=u(x),[T,E]=l(x,[w]),[D,O]=T(x),k=m.forwardRef(_(function(e,t){let{name:n,min:r=0,max:o=100,step:l=1,orientation:u=`horizontal`,disabled:d=!1,minStepsBetweenThumbs:f=0,defaultValue:p=[r],value:g,onValueChange:b=_(()=>{},`onValueChange`),onValueCommit:x=_(()=>{},`onValueCommit`),inverted:C=!1,form:w,...T}=e,E=m.useRef(new Set),O=m.useRef(0),k=m.useRef(!1),A=u===`horizontal`?ee:te,[j,M]=m.useState(null),N=a(t,M),[P=[],F]=s({prop:g,defaultProp:p,onChange:_(e=>{[...E.current][O.current]?.focus({preventScroll:!0,focusVisible:k.current}),k.current=!1,b(e)},`onChange`)}),I=m.useRef(P),L=m.useRef(P);m.useEffect(()=>{let e=w?j?.ownerDocument.getElementById(w):j?.closest(`form`);if(e instanceof HTMLFormElement){let t=_(()=>F(L.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[j,w,F]);function R(e){V(e,G(P,e))}_(R,`handleSlideStart`);function z(e){V(e,O.current)}_(z,`handleSlideMove`);function B(){String(P)!==String(I.current)&&x(P)}_(B,`handleSlideEnd`);function V(e,t,{commit:n}={commit:!1}){let a=X(l),s=Z(Math.round((e-r)/l)*l+r,a),c=i(s,[r,o]);F((e=[])=>{let r=H(e,c,t);if(J(r,f*l)){O.current=r.indexOf(c);let t=String(r)!==String(e);return t&&n&&x(r),t?r:e}return e})}return _(V,`updateValues`),(0,h.jsx)(D,{scope:e.__scopeSlider,name:n,disabled:d,min:r,max:o,valueIndexToChangeRef:O,thumbs:E.current,values:P,orientation:u,form:w,children:(0,h.jsx)(S.Provider,{scope:e.__scopeSlider,children:(0,h.jsx)(S.Slot,{scope:e.__scopeSlider,children:(0,h.jsx)(A,{"aria-disabled":d,"data-disabled":d?``:void 0,...T,ref:N,onPointerDown:c(T.onPointerDown,()=>{d||(I.current=P,k.current=!1)}),min:r,max:o,inverted:C,onSlideStart:d?void 0:R,onSlideMove:d?void 0:z,onSlideEnd:d?void 0:B,onHomeKeyDown:()=>{d||(k.current=!0,V(r,0,{commit:!0}))},onEndKeyDown:()=>{d||(k.current=!0,V(o,P.length-1,{commit:!0}))},onStepKeyDown:({event:e,direction:t})=>{if(!d){k.current=!0;let n=v.includes(e.key)||e.shiftKey&&y.includes(e.key)?10:1,i=O.current,a=P[i];V(Q(a,{min:r,step:l,direction:t,multiplier:n}),i,{commit:!0})}}})})})})},`Slider`)),[A,j]=T(x,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),ee=m.forwardRef(_(function(e,t){let{min:n,max:r,dir:i,inverted:o,onSlideStart:s,onSlideMove:c,onSlideEnd:l,onStepKeyDown:u,...f}=e,[p,g]=m.useState(null),v=a(t,g),y=m.useRef(void 0),x=d(i),S=x===`ltr`,C=S&&!o||!S&&o;function w(e){let t=y.current||p.getBoundingClientRect(),i=Y([0,t.width],C?[n,r]:[r,n]);return y.current=t,i(e-t.left)}return _(w,`getValueFromPointer`),(0,h.jsx)(A,{scope:e.__scopeSlider,startEdge:C?`left`:`right`,endEdge:C?`right`:`left`,direction:C?1:-1,size:`width`,children:(0,h.jsx)(M,{dir:x,"data-orientation":`horizontal`,...f,ref:v,style:{...f.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=w(e.clientX);s?.(t)},onSlideMove:e=>{let t=w(e.clientX);c?.(t)},onSlideEnd:()=>{y.current=void 0,l?.()},onStepKeyDown:e=>{let t=b[C?`from-left`:`from-right`].includes(e.key);u?.({event:e,direction:t?-1:1})}})})},`SliderHorizontal`)),te=m.forwardRef(_(function(e,t){let{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...u}=e,d=m.useRef(null),f=a(t,d),p=m.useRef(void 0),g=!i;function v(e){let t=p.current||d.current.getBoundingClientRect(),i=Y([0,t.height],g?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return _(v,`getValueFromPointer`),(0,h.jsx)(A,{scope:e.__scopeSlider,startEdge:g?`bottom`:`top`,endEdge:g?`top`:`bottom`,size:`height`,direction:g?1:-1,children:(0,h.jsx)(M,{"data-orientation":`vertical`,...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=v(e.clientY);o?.(t)},onSlideMove:e=>{let t=v(e.clientY);s?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{let t=b[g?`from-bottom`:`from-top`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})},`SliderVertical`)),M=m.forwardRef(_(function(e,t){let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...d}=e,f=O(x,n);return(0,h.jsx)(o.span,{...d,ref:t,onKeyDown:c(e.onKeyDown,e=>{e.key===`Home`?(s(e),e.preventDefault()):e.key===`End`?(l(e),e.preventDefault()):v.concat(y).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:c(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),f.thumbs.has(t)?t.focus({preventScroll:!0,focusVisible:!1}):r(e)}),onPointerMove:c(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:c(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})},`SliderImpl`)),N=`SliderTrack`,P=m.forwardRef(_(function(e,t){let{__scopeSlider:n,...r}=e,i=O(N,n);return(0,h.jsx)(o.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})},`SliderTrack`)),F=`SliderRange`,I=m.forwardRef(_(function(e,t){let{__scopeSlider:n,...r}=e,i=O(F,n),s=j(F,n),c=m.useRef(null),l=a(t,c),u=i.values.length,d=i.values.map(e=>U(e,i.min,i.max)),f=u>1?Math.min(...d):0,p=100-Math.max(...d);return(0,h.jsx)(o.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:l,style:{...e.style,[s.startEdge]:f+`%`,[s.endEdge]:p+`%`}})},`SliderRange`)),[L,R]=T(`SliderThumb`),z=`SliderThumbProvider`;function B(e){let{__scopeSlider:t,name:n,children:r,internal_do_not_use_render:i}=e,a=O(z,t),o=C(t),[s,c]=m.useState(null),l=m.useMemo(()=>s?o().findIndex(e=>e.ref.current===s):-1,[o,s]),u=f(s),d=!s||!!a.form||!!s.closest(`form`),p=a.values[l],g=n??(a.name?a.name+(a.values.length>1?`[]`:``):void 0),_=p===void 0?0:U(p,a.min,a.max);m.useEffect(()=>{if(s)return a.thumbs.add(s),()=>{a.thumbs.delete(s)}},[s,a.thumbs]);let v={value:p,name:g,form:a.form,isFormControl:d,index:l,thumb:s,onThumbChange:c,percent:_,size:u};return(0,h.jsx)(L,{scope:t,...v,children:$(i)?i(v):r})}_(B,`SliderThumbProvider`);var V=`SliderThumbTrigger`,ne=m.forwardRef(_(function(e,t){let{__scopeSlider:n,...r}=e,i=O(V,n),s=j(V,n),{index:l,value:u,percent:d,size:f,onThumbChange:p}=R(V,n),m=a(t,p),g=W(l,i.values.length),_=f?.[s.size],v=_?K(_,d,s.direction):0;return(0,h.jsx)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${d}% + ${v}px)`},children:(0,h.jsx)(S.ItemSlot,{scope:n,children:(0,h.jsx)(o.span,{role:`slider`,"aria-label":e[`aria-label`]||g,"aria-valuemin":i.min,"aria-valuenow":u,"aria-valuemax":i.max,"aria-orientation":i.orientation,"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,tabIndex:i.disabled?void 0:0,...r,ref:m,style:u===void 0?{display:`none`}:e.style,onFocus:c(e.onFocus,()=>{i.valueIndexToChangeRef.current=l})})})})},`SliderThumbTrigger`)),re=m.forwardRef(_(function(e,t){let{__scopeSlider:n,name:r,...i}=e;return(0,h.jsx)(B,{__scopeSlider:n,name:r,internal_do_not_use_render:({index:e,isFormControl:r})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ne,{...i,ref:t,__scopeSlider:n}),r?(0,h.jsx)(ae,{__scopeSlider:n},e):null]})})},`SliderThumb`)),ie=`SliderBubbleInput`,ae=m.forwardRef(_(function({__scopeSlider:e,...t},n){let{value:i,name:s,form:c}=R(ie,e),l=m.useRef(null),u=a(l,n),d=r(i);return m.useEffect(()=>{let e=l.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(d!==i&&n){let t=new Event(`input`,{bubbles:!0});n.call(e,i),e.dispatchEvent(t)}},[d,i]),(0,h.jsx)(o.input,{style:{display:`none`},name:s,form:c,...t,ref:u,defaultValue:i})},`SliderBubbleInput`));function H(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}_(H,`getNextSortedValues`);function U(e,t,n){let r=100/(n-t)*(e-t);return i(r,[0,100])}_(U,`convertValueToPercentage`);function W(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}_(W,`getLabel`);function G(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}_(G,`getClosestValueIndex`);function K(e,t,n){let r=e/2;return(r-Y([0,50],[0,r])(t)*n)*n}_(K,`getThumbInBoundsOffset`);function q(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}_(q,`getStepsBetweenValues`);function J(e,t){if(t>0){let n=q(e);return Math.min(...n)>=t}return!0}_(J,`hasMinStepsBetweenValues`);function Y(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}_(Y,`linearScale`);function X(e){if(!Number.isFinite(e))return 0;let t=e.toString();if(t.includes(`e`)){let[e,n]=t.split(`e`),r=e.split(`.`)[1]||``,i=Number(n);return Math.max(0,r.length-i)}let n=t.split(`.`)[1];return n?n.length:0}_(X,`getDecimalCount`);function Z(e,t){let n=10**t;return Math.round(e*n)/n}_(Z,`roundValue`);function Q(e,{min:t,step:n,direction:r,multiplier:i}){let a=X(n),o=(e-t)/n,s=Math.round(o),c=Z(s*n+t,a)===Z(e,a),l;return l=c?s+i*r:r>0?Math.ceil(o):Math.floor(o),Z(l*n+t,a)}_(Q,`getNextStepValue`);function $(e){return typeof e==`function`}_($,`isFunction`);function oe({className:e,defaultValue:t,value:n,min:r=0,max:i=100,step:a=1,showSteps:o=!1,valueText:s,"aria-label":c,...l}){let u=m.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return(0,h.jsxs)(k,{"data-slot":`slider`,defaultValue:t,value:n,min:r,max:i,step:a,className:p(`relative flex w-full touch-none items-center select-none data-disabled:opacity-50 data-vertical:h-full data-vertical:min-h-40 data-vertical:w-auto data-vertical:flex-col`,e),...l,children:[(0,h.jsxs)(P,{"data-slot":`slider-track`,className:`relative grow overflow-hidden rounded-full bg-surface-active data-horizontal:h-1 data-horizontal:w-full data-vertical:h-full data-vertical:w-1`,children:[(0,h.jsx)(I,{"data-slot":`slider-range`,className:`absolute bg-star select-none data-horizontal:h-full data-vertical:w-full`}),o&&i>r&&Array.from({length:Math.max(0,Math.round((i-r)/a)-1)},(e,t)=>(0,h.jsx)(`span`,{"data-slot":`slider-step`,"aria-hidden":`true`,className:`absolute top-0 h-full w-0.5 -translate-x-1/2 bg-popover`,style:{left:`${(t+1)*a/(i-r)*100}%`}},t))]}),Array.from({length:u.length},(e,t)=>(0,h.jsx)(re,{"data-slot":`slider-thumb`,"aria-label":c,"aria-valuetext":s,className:`relative block size-3.5 shrink-0 rounded-full border border-control bg-key shadow-key ring-focus-ring transition-shadow select-none after:absolute after:-inset-2 hover:ring-3 focus-visible:border-focus focus-visible:ring-3 focus-visible:outline-hidden active:ring-3 disabled:pointer-events-none disabled:opacity-50`},t))]})}export{oe as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/speech-text-BTwYi9Sb.js","assets/vendor-markdown-CT6Z4fh8.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-router-CSN_DGvx.js","assets/vendor-react-DwNgTV1j.js","assets/vendor-markdown-plugins-CT5L3KA9.js","assets/vendor-shiki-runtime-DM7fm4Bl.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-ui-DvrYggeS.js","assets/speech-stream-text-DF6aAUVb.js","assets/abort-signal-f4JsiYKX.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{n,r,t as i}from"./abort-signal-f4JsiYKX.js";import{c as a,t as o}from"./api-
|
|
2
|
+
import{r as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{n,r,t as i}from"./abort-signal-f4JsiYKX.js";import{c as a,t as o}from"./api-45iTnFjN.js";function s(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`Local speech bridge is unavailable.`))}function c(e,t=256){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\uD800-\uDFFF]/u.test(e)}function l(e){if(e===void 0)return!0;if(!e||!c(e.name)||!c(e.url,2048))return!1;try{let t=new URL(e.url);return t.protocol===`https:`&&!t.username&&!t.password}catch{return!1}}function u(e){let t=new Set([`not-installed`,`downloading`,`verifying`,`installed`,`cancelled`,`error`]);if(!e||!e.defaults||!Array.isArray(e.models)||e.models.length>16||e.models.some(e=>!e||!c(e.id,128)||!c(e.name)||![`asr`,`tts`].includes(e.kind)||!t.has(e.status)||!Array.isArray(e.languages)||e.languages.length>16||e.languages.some(e=>!c(e,40))||!l(e.license)||!Number.isSafeInteger(e.totalBytes)||e.totalBytes<0||!Number.isSafeInteger(e.filesBytes)||e.filesBytes<0||!Number.isSafeInteger(e.downloadedBytes)||e.downloadedBytes<0||e.downloadedBytes>e.totalBytes||e.voices!==void 0&&(!Array.isArray(e.voices)||e.voices.length>256||e.voices.some(e=>!e||!c(e.id,128)||!c(e.name)||!c(e.language,40))))||new Set(e.models.map(e=>e.id)).size!==e.models.length||![`asr`,`tts`].every(t=>e.models.some(n=>n.id===e.defaults[t]&&n.kind===t)))throw Error(`Invalid local speech model catalog.`);let n=e.models.flatMap(e=>e.voices||[]);if(new Set(n.map(e=>e.id)).size!==n.length||!e.models.find(t=>t.id===e.defaults.tts)?.voices?.some(t=>t.id===e.defaults.voice))throw Error(`Invalid local speech model catalog.`);return e}async function d(e){e?.throwIfAborted();let t=window.__PISPER_MOBILE_APP__?await s(`mobile_speech_models`):await o(`/api/speech/models`,{signal:e});return e?.throwIfAborted(),u(t)}async function f(e){return window.__PISPER_MOBILE_APP__?s(`mobile_download_speech_model`,{modelId:e}):o(`/api/speech/models/download`,{method:`POST`,body:{modelId:e}})}async function p(e){return window.__PISPER_MOBILE_APP__?s(`mobile_cancel_speech_model_download`,{modelId:e}):o(`/api/speech/models/cancel`,{method:`POST`,body:{modelId:e}})}function m(e,t){return e.models.filter(n=>t.some(t=>n.id===e.defaults[t]))}function h(e){return String(e).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/([A-Z])([A-Z][a-z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().toLowerCase()}function g(e){return[...new Set(e.map(h).filter(Boolean))].join(`
|
|
3
3
|
`)}var _;function v(){if(_===void 0)try{RegExp(`(?<=a)`),_=!0}catch{_=!1}return _}var y=/[A-Za-z0-9_./\\-]/;function b(e,t){let n=new Map;for(let e of t){let t=h(e);if(!(!/[A-Z]/.test(e)&&!e.includes(` `)||!/^[A-Za-z][A-Za-z0-9 ]*$/.test(e)))for(let r of[t,e.toLowerCase()])r.length>=3&&!n.has(r)&&n.set(r,e)}if(!n.size)return e;let r=`(?:${[...n.keys()].sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`).replace(/ /g,`[ \\t]+`)).join(`|`)})`,i=`(?![A-Za-z0-9_/\\\\-]|\\.[A-Za-z0-9_])`,a=v(),o=RegExp(a?`(?<![A-Za-z0-9_./\\\\-])${r}${i}`:`${r}${i}`,`gi`);return e.replace(o,(e,...t)=>{if(!a){let n=t[t.length-2],r=t[t.length-1];if(n>0&&y.test(r[n-1]))return e}return n.get(e.toLowerCase().replace(/[ \t]+/g,` `))||e})}var x=e({loadSpeechHotwords:()=>S,prepareSpeechSession:()=>C});async function S(e,t){let i=n(t,3e4);try{let t=await o(`/api/speech/terms?sessionId=${encodeURIComponent(e)}`,{signal:i.signal});if(r(i.signal),!Array.isArray(t.terms)||t.terms.some(e=>typeof e!=`string`))throw Error(`语音术语响应无效。`);return{terms:t.terms,hotwords:g(t.terms)}}finally{i.dispose()}}async function C(e,o){r(o);let c=crypto.randomUUID(),l={requestId:c,...e,kinds:[...e.kinds]},u=!!window.__PISPER_MOBILE_APP__,d=!e.kinds.includes(`tts`),f=n(o),p=n(f.signal,6e4),m=!1,h=!1,g,_,v=new Promise((e,t)=>{g=e,_=t}),y=()=>{s(`mobile_release_speech_session`,{requestId:c}).catch(()=>{})},b=()=>{p.signal.removeEventListener(`abort`,S),f.signal.removeEventListener(`abort`,x),p.dispose(),f.dispose()},x=()=>{_(i(f.signal)),b(),u&&y()},S=()=>f.abort(i(p.signal));p.signal.addEventListener(`abort`,S,{once:!0}),f.signal.addEventListener(`abort`,x,{once:!0});let C=()=>{r(f.signal),!(!h||!d||m)&&(m=!0,p.signal.removeEventListener(`abort`,S),p.dispose(),g())},w=e=>{f.signal.aborted||(_(e),f.abort(e),m&&window.dispatchEvent(new Event(`pisper:speech-interrupted`)))},T=e=>{if(!e||typeof e!=`object`||!(`ready`in e)||e.ready!==!0)throw Error(`Invalid speech session readiness.`);h=!0,C()};d||Promise.all([t(()=>import(`./speech-text-BTwYi9Sb.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),t(()=>import(`./speech-stream-text-DF6aAUVb.js`),__vite__mapDeps([9,1,2,3,4,5,6,7,8,10,0]))]).then(()=>{d=!0,C()}).catch(w),(async()=>{if(u){try{T(await s(`mobile_prepare_speech_session`,l))}finally{f.signal.aborted&&y()}return}let e=await fetch(`/api/speech/session`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(l),signal:f.signal});throw await a(e,(e,t)=>{if(r(f.signal),e===`ready`)T(t);else if(e===`error`)throw Error(t.error||`Speech session failed.`)}),Error(`Speech session connection was interrupted.`)})().catch(w);try{return await v,r(f.signal),{requestId:c,signal:f.signal}}catch(e){throw f.abort(e),b(),e}}export{g as a,d as c,b as i,s as l,C as n,p as o,x as r,f as s,S as t,m as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,_ as t,b as n,c as r,d as i,f as a,h as o,i as s,l as c,m as l,p as u,s as d,u as f,x as p}from"./useQuery-Bg3cTjsY.js";import{t as m}from"./mutation-Difliohy.js";import{t as h}from"./api-
|
|
1
|
+
import{S as e,_ as t,b as n,c as r,d as i,f as a,h as o,i as s,l as c,m as l,p as u,s as d,u as f,x as p}from"./useQuery-Bg3cTjsY.js";import{t as m}from"./mutation-Difliohy.js";import{t as h}from"./api-45iTnFjN.js";var g=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new m({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=_(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=_(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){r.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>a(t,e))}findAll(e={}){return this.getAll().filter(t=>a(e,t))}notify(e){r.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.batch(()=>Promise.all(e.map(e=>e.continue().catch(l))))}};function _(e){return e.options.scope?.id}var v=class extends e{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,a=t.queryHash??i(r,t),o=this.get(a);return o||(o=new s({client:e,queryKey:r,queryHash:a,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){r.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>u(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>u(e,t)):t}notify(e){r.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},y=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new v,this.#t=e.mutationCache||new g,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=p.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=d.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let n=this.defaultQueryOptions(e),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(t(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=c(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return r.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;r.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return r.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},i=r.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(i).then(l).catch(l)}invalidateQueries(e,t={}){return r.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},i=r.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(l)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(i).then(l)}fetchQuery(e){let n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);let r=this.#e.build(this,n);return r.isStaleByTime(t(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(l).catch(l)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(l).catch(l)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return d.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(f(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{o(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(f(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{o(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=i(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===n&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},b=new Set;function x(e){if(!(typeof window>`u`)){try{if(window.localStorage.getItem(`pisper:startup-diagnostics`)!==`1`)return}catch{return}b.has(e)||(b.add(e),performance.mark(`pisper-${e}`),console.debug(`[startup]`,e,Math.round(performance.now())))}}var S=new y({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:15e3},mutations:{retry:0}}}),C={config:`/api/config`,sessions:`/api/sessions`,"notification-settings":`/api/settings/notifications`,plugins:`/api/plugins`},w=new Map,T=[`sessions`,`board`];function E(e){return e===`sessions`?T:[e]}function D(e){return{queryKey:E(e),queryFn:async()=>{for(;;){let t=w.get(e);try{let n=await h(C[e]);if(t!==w.get(e))continue;return e===`sessions`&&x(`sessions-loaded`),n}catch(n){if(t!==w.get(e))continue;throw n}}},staleTime:15e3}}function O(e,t=!1){return S.fetchQuery({...D(e),...t?{staleTime:0}:{}})}function k(e){return w.set(e,(w.get(e)??0)+1),S.invalidateQueries({queryKey:E(e),exact:!0},{cancelRefetch:!1})}function A(e){let t=()=>{k(`sessions`)};return e.addEventListener(`pisper:sessions-updated`,t),()=>e.removeEventListener(`pisper:sessions-updated`,t)}export{S as a,k as i,O as n,D as o,A as r,x as s,T as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{a as r}from"./dist-41X0pdUs.js";import{c as i,i as a,o,s}from"./dist-BsRXXcSL.js";import{t as c}from"./dist-OB2r6Xsr.js";import{t as l}from"./utils-C8uzG5AZ.js";var u=e(t(),1),d=n(),f=Object.defineProperty,p=(e,t)=>f(e,`name`,{value:t,configurable:!0}),m=`Switch`,[h,g]=s(m),[_,v]=h(m);function y(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:o,form:s,name:c,onCheckedChange:l,required:f,value:p=`on`,internal_do_not_use_render:h}=e,[g,v]=a({prop:n,defaultProp:i??!1,onChange:l,caller:m}),[y,b]=u.useState(null),[x,S]=u.useState(null),C=u.useRef(!1),[w,T]=u.useReducer(e=>e+1,0),E={checked:g,setChecked:v,disabled:o,control:y,setControl:b,name:c,form:s,value:p,hasConsumerStoppedPropagationRef:C,userInteractionCount:w,onUserInteraction:T,required:f,defaultChecked:i,isFormControl:!y||!!s||!!y.closest(`form`),bubbleInput:x,setBubbleInput:S};return(0,d.jsx)(_,{scope:t,...E,children:D(h)?h(E):r})}p(y,`SwitchProvider`);var b=`SwitchTrigger`,x=u.forwardRef(p(function({__scopeSwitch:e,onClick:t,...n},a){let{control:s,form:c,value:l,disabled:f,checked:m,required:h,setControl:g,setChecked:_,hasConsumerStoppedPropagationRef:y,onUserInteraction:x,isFormControl:S,bubbleInput:C}=v(b,e),w=r(a,g),T=u.useRef(m);return u.useEffect(()=>{let e=c?s?.ownerDocument.getElementById(c):s?.form;if(e instanceof HTMLFormElement){let t=p(()=>_(T.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[s,c,_]),(0,d.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":m,"aria-required":h,"data-state":O(m),"data-disabled":f?``:void 0,disabled:f,value:l,...n,ref:w,onClick:o(t,e=>{x(),_(e=>!e),C&&S&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})})},`SwitchTrigger`)),S=u.forwardRef(p(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...f}=e;return(0,d.jsx)(y,{__scopeSwitch: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,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(x,{...f,ref:t,__scopeSwitch:n}),e&&(0,d.jsx)(E,{__scopeSwitch:n})]})})},`Switch`)),C=`SwitchThumb`,w=u.forwardRef(p(function(e,t){let{__scopeSwitch:n,...r}=e,a=v(C,n);return(0,d.jsx)(i.span,{"data-state":O(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),T=`SwitchBubbleInput`,E=u.forwardRef(p(function({__scopeSwitch:e,onClick:t,...n},a){let{control:s,hasConsumerStoppedPropagationRef:l,userInteractionCount:f,checked:p,defaultChecked:m,required:h,disabled:g,name:_,value:y,form:b,bubbleInput:x,setBubbleInput:S}=v(T,e),C=r(a,S),w=c(s),E=u.useRef(!1),D=u.useRef(p),O=u.useRef(f);u.useEffect(()=>{let e=x;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=f!==O.current;O.current=f;let i=D.current!==p;D.current=p;let a=!(r&&l.current);if(i&&n){E.current=!r;let t=new Event(`click`,{bubbles:a});n.call(e,p),e.dispatchEvent(t),E.current=!1}},[x,p,l,f]);let k=u.useRef(p);return(0,d.jsx)(i.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:m??k.current,required:h,disabled:g,name:_,value:y,form:b,...n,tabIndex:-1,ref:C,onClick:o(t,e=>{E.current&&e.stopPropagation()}),style:{...n.style,...w,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function D(e){return typeof e==`function`}p(D,`isFunction`);function O(e){return e?`checked`:`unchecked`}p(O,`getState`);function k({className:e,size:t=`default`,...n}){return(0,d.jsx)(S,{"data-slot":`switch`,"data-size":t,className:l(`peer group/switch relative inline-flex min-h-0! shrink-0 items-center rounded-full border border-control bg-surface-active transition-colors duration-(--d-fast) after:absolute after:-inset-x-3 after:-inset-y-[13px] aria-invalid:border-destructive data-[size=default]:h-5 data-[size=default]:w-[34px] data-[size=sm]:h-4 data-[size=sm]:w-[26px] data-checked:border-star data-checked:bg-star data-disabled:cursor-not-allowed data-disabled:opacity-50`,e),...n,children:(0,d.jsx)(w,{"data-slot":`switch-thumb`,className:`pointer-events-none block translate-x-0.5 rounded-full bg-content-muted transition-transform duration-(--d-base) ease-(--ease) group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-2.5 data-checked:bg-on-accent data-checked:shadow-xs group-data-[size=default]/switch:data-checked:translate-x-4 group-data-[size=sm]/switch:data-checked:translate-x-3`})})}export{k as t};
|
|
@@ -0,0 +1 @@
|
|
|
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"./vendor-ui-DvrYggeS.js";import{c as i,i as a,n as o,o as s,r as c,s as l}from"./dist-BsRXXcSL.js";import{t as u}from"./dist-DzGQ7sLi.js";import{n as d,r as f,t as p}from"./dist-BaBySQmo.js";import{t as m}from"./utils-C8uzG5AZ.js";var h=e(t(),1),g=n(),_=Object.defineProperty,v=(e,t)=>_(e,`name`,{value:t,configurable:!0}),y=`Tabs`,[b,x]=l(y,[f]),S=f(),[C,w]=b(y),T=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,onValueChange:s,defaultValue:c,orientation:l=`horizontal`,dir:d,activationMode:f=`automatic`,...p}=e,m=u(d),[h,_]=a({prop:r,onChange:s,defaultProp:c??``,caller:y});return(0,g.jsx)(C,{scope:n,baseId:o(),value:h,onValueChange:_,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(i.div,{dir:m,"data-orientation":l,...p,ref:t})})},`Tabs`)),E=`TabsList`,D=h.forwardRef(v(function(e,t){let{__scopeTabs:n,loop:r=!0,...a}=e,o=w(E,n),s=S(n);return(0,g.jsx)(d,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:r,children:(0,g.jsx)(i.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:t})})},`TabsList`)),O=`TabsTrigger`,k=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,c=w(O,n),l=S(n),u=M(c.baseId,r),d=N(c.baseId,r),f=r===c.value;return(0,g.jsx)(p,{asChild:!0,...l,focusable:!a,active:f,children:(0,g.jsx)(i.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:u,...o,ref:t,onMouseDown:s(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:s(e.onKeyDown,e=>{a||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:s(e.onFocus,()=>{let e=c.activationMode!==`manual`;!f&&!a&&e&&c.onValueChange(r)})})})},`TabsTrigger`)),A=`TabsContent`,j=h.forwardRef(v(function(e,t){let{__scopeTabs:n,value:r,forceMount:a,children:o,...s}=e,l=w(A,n),u=M(l.baseId,r),d=N(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(c,{present:a||f,children:({present:n})=>(0,g.jsx)(i.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})},`TabsContent`));function M(e,t){return`${e}-trigger-${t}`}v(M,`makeTriggerId`);function N(e,t){return`${e}-content-${t}`}v(N,`makeContentId`);var P=T,F=D,I=k,L=j;function R({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(P,{"data-slot":`tabs`,"data-orientation":t,className:m(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var z=r(`group/tabs-list inline-flex w-fit max-w-full items-center justify-center gap-0.5 rounded-md p-0.5 text-content-secondary group-data-horizontal/tabs:h-8 pointer-coarse:group-data-horizontal/tabs:h-11 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-surface-muted shadow-[inset_0_0_0_1px_var(--stroke)]`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function B({className:e,variant:t=`default`,...n}){return(0,g.jsx)(F,{"data-slot":`tabs-list`,"data-variant":t,className:m(z({variant:t}),e),...n})}function V({className:e,...t}){return(0,g.jsx)(I,{"data-slot":`tabs-trigger`,className:m(`relative inline-flex h-full flex-1 items-center justify-center gap-1.5 rounded-sm px-2.5 py-0.5 text-sm whitespace-nowrap transition-colors group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`data-active:font-medium data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:bg-solid group-data-[variant=default]/tabs-list:data-active:shadow-[inset_0_0_0_1px_var(--stroke-strong),var(--sh-1)]`,`after:absolute after:bg-star after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function H({className:e,...t}){return(0,g.jsx)(L,{"data-slot":`tabs-content`,className:m(`flex-1 text-sm outline-none`,e),...t})}export{V as i,H as n,B as r,R as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{a as r,r as i}from"./dist-41X0pdUs.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d}from"./dist-BsRXXcSL.js";import{t as f}from"./dist-BiRPwy4W.js";import{i as p,s as m}from"./es2015-DTZdOI9P.js";import{a as h,i as g,n as _,r as v,t as y}from"./dist-BRjj4UeB.js";import{t as b}from"./utils-C8uzG5AZ.js";var x=e(t(),1),S=n(),C=Object.defineProperty,w=(e,t)=>C(e,`name`,{value:t,configurable:!0}),[T,E]=d(`Tooltip`,[h]),D=h(),O=`TooltipProvider`,k=700,A=`tooltip.open`,[j,M]=T(O),N=w(e=>{let{__scopeTooltip:t,delayDuration:n=k,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=x.useRef(!0),s=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,S.jsx)(j,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),P=`Tooltip`,[F,I]=T(P),ee=w(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:l}=e,u=M(P,e.__scopeTooltip),d=D(t),[f,p]=x.useState(null),[m,h]=x.useState(void 0),_=c(),v=x.useRef(0),y=o??u.disableHoverableContent,b=l??u.delayDuration,C=x.useRef(!1),[T,E]=s({prop:r,defaultProp:i??!1,onChange:w(e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(A))):u.onClose(),a?.(e)},`onChange`),caller:P}),O=x.useMemo(()=>T?C.current?`delayed-open`:`instant-open`:`closed`,[T]),k=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,C.current=!1,E(!0)},[E]),j=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,E(!1)},[E]),N=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{C.current=!0,E(!0),v.current=0},b)},[b,E]);x.useEffect(()=>()=>{v.current&&=(window.clearTimeout(v.current),0)},[]);let I=m??_;return(0,S.jsx)(g,{...d,children:(0,S.jsx)(F,{scope:t,contentId:I,setContentId:h,open:T,stateAttribute:O,trigger:f,onTriggerChange:p,onTriggerEnter:x.useCallback(()=>{u.isOpenDelayedRef.current?N():k()},[u.isOpenDelayedRef,N,k]),onTriggerLeave:x.useCallback(()=>{y?j():(window.clearTimeout(v.current),v.current=0)},[j,y]),onOpen:k,onClose:j,disableHoverableContent:y,children:n})})},`Tooltip`),L=`TooltipTrigger`,R=x.forwardRef(w(function(e,t){let{__scopeTooltip:n,...i}=e,a=I(L,n),s=M(L,n),c=D(n),u=x.useRef(null),d=r(t,u,a.onTriggerChange),f=x.useRef(!1),p=x.useRef(!1),m=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener(`pointerup`,m),[m]),(0,S.jsx)(y,{asChild:!0,...c,children:(0,S.jsx)(o.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...i,ref:d,onPointerMove:l(e.onPointerMove,e=>{e.pointerType!==`touch`&&!p.current&&!s.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:l(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:l(e.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener(`pointerup`,m,{once:!0})}),onFocus:l(e.onFocus,()=>{f.current||a.onOpen()}),onBlur:l(e.onBlur,a.onClose),onClick:l(e.onClick,a.onClose)})})},`TooltipTrigger`)),z=`TooltipPortal`,[B,V]=T(z,{forceMount:void 0}),te=w(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=I(z,t);return(0,S.jsx)(B,{scope:t,forceMount:n,children:(0,S.jsx)(u,{present:n||a.open,children:(0,S.jsx)(p,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),H=`TooltipContent`,ne=x.forwardRef(w(function(e,t){let n=V(H,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=I(H,e.__scopeTooltip);return(0,S.jsx)(u,{present:r||o.open,children:o.disableHoverableContent?(0,S.jsx)(G,{side:i,...a,ref:t}):(0,S.jsx)(U,{side:i,...a,ref:t})})},`TooltipContent`)),U=x.forwardRef(w(function(e,t){let n=I(H,e.__scopeTooltip),i=M(H,e.__scopeTooltip),a=x.useRef(null),o=r(t,a),[s,c]=x.useState(null),{trigger:l,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=i,p=x.useCallback(()=>{c(null),f(!1)},[f]),m=x.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=J(r,q(r,n.getBoundingClientRect())),a=Y(t.getBoundingClientRect()),o=Z([...i,...a]);c(o),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(l&&d){let e=w(e=>m(e,d),`handleTriggerLeave`),t=w(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),x.useEffect(()=>{if(s){let e=w(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!X(n,s);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,s,u,p]),(0,S.jsx)(G,{...e,ref:o})},`TooltipContentHoverable`)),W=i(`TooltipContent`),G=x.forwardRef(w(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:o,onEscapeKeyDown:s,onPointerDownOutside:c,...l}=e,u=I(H,n),d=D(n),{onClose:p}=u;x.useEffect(()=>(document.addEventListener(A,p),()=>document.removeEventListener(A,p)),[p]),x.useEffect(()=>{if(u.trigger){let e=w(e=>{e.target instanceof Node&&e.target.contains(u.trigger)&&p()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[u.trigger,p]);let{setContentId:h}=u;return a(()=>(h(o),()=>{h(void 0)}),[o,h]),(0,S.jsx)(m,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:(0,S.jsxs)(v,{"data-state":u.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:u.contentId,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,S.jsx)(W,{children:r}),i?(0,S.jsx)(f,{id:u.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),K=x.forwardRef(w(function(e,t){let{__scopeTooltip:n,...r}=e,i=D(n);return(0,S.jsx)(_,{...i,...r,ref:t})},`TooltipArrow`));function q(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}w(q,`getExitSideFromRect`);function J(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}w(J,`getPaddedExitPoints`);function Y(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}w(Y,`getPointsFromRect`);function X(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}w(X,`isPointInPolygon`);function Z(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Q(t)}w(Z,`getHull`);function Q(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}w(Q,`getHullPresorted`);var re=N,ie=ee,$=R,ae=te,oe=ne,se=K;function ce({delayDuration:e=200,...t}){return(0,S.jsx)(re,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function le({...e}){return(0,S.jsx)(ie,{"data-slot":`tooltip`,...e})}function ue({...e}){return(0,S.jsx)($,{"data-slot":`tooltip-trigger`,...e})}function de({className:e,sideOffset:t=0,children:n,showArrow:r=!1,...i}){return(0,S.jsx)(ae,{children:(0,S.jsxs)(oe,{"data-slot":`tooltip-content`,sideOffset:t,className:b(`z-[200] inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-popover px-2 py-1 text-xs text-popover-foreground shadow-float has-data-[slot=kbd]:pr-1 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=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...i,children:[n,r&&(0,S.jsx)(se,{className:`z-[200] size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover`})]})})}export{ue as i,de as n,ce as r,le as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{d as n,f as r,l as i,p as a,t as o}from"./i18n-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";import{d as n,f as r,l as i,p as a,t as o}from"./i18n-DfsxGeh5.js";import{s}from"./vendor-state-GkUciC5H.js";var c=e(t()),l=(e,t,n,r)=>{let i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,`warn`,`react-i18next::`,!0);g(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},u={},d=(e,t,n,r)=>{g(n)&&u[n]||(g(n)&&(u[n]=new Date),l(e,t,n,r))},f=(e,t)=>()=>{if(e.isInitialized)t();else{let n=()=>{setTimeout(()=>{e.off(`initialized`,n)},0),t()};e.on(`initialized`,n)}},p=(e,t,n)=>{e.loadNamespaces(t,f(e,n))},m=(e,t,n,r)=>{if(g(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return p(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,f(e,r))},h=(e,t,n={})=>!t.languages||!t.languages.length?(d(t,`NO_LANGUAGES`,`i18n.languages were undefined or empty`,{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf(`languageChanging`)>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}),g=e=>typeof e==`string`,_=e=>typeof e==`object`&&!!e,v=(0,c.createContext)(),y=class{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}},b=s(),x={t:(e,t)=>{if(g(t))return t;if(_(t)&&g(t.defaultValue))return t.defaultValue;if(typeof e==`function`)return``;if(Array.isArray(e)){let t=e[e.length-1];return typeof t==`function`?``:t}return e},ready:!1},S=()=>()=>{},C=(e,t={})=>{let{i18n:n}=t,{i18n:i,defaultNS:o}=(0,c.useContext)(v)||{},s=n||i||r();s&&!s.reportNamespaces&&(s.reportNamespaces=new y),s||d(s,`NO_I18NEXT_INSTANCE`,`useTranslation: You will need to pass in an i18next instance by using initReactI18next or by passing it via props or context. In monorepo setups, make sure there is only one instance of react-i18next.`);let l=(0,c.useMemo)(()=>({...a(),...s?.options?.react,...t}),[s,t]),{useSuspense:u,keyPrefix:f}=l,_=e||o||s?.options?.defaultNS,C=g(_)?[_]:_||[`translation`],w=(0,c.useMemo)(()=>C,C);s?.reportNamespaces?.addUsedNamespaces?.(w);let T=(0,c.useRef)(0),E=(0,c.useCallback)(e=>{if(!s)return S;let{bindI18n:t,bindI18nStore:n}=l,r=()=>{T.current+=1,e()};return t&&s.on(t,r),n&&s.store.on(n,r),()=>{t&&t.split(` `).forEach(e=>s.off(e,r)),n&&n.split(` `).forEach(e=>s.store.off(e,r))}},[s,l]),D=(0,c.useRef)(),O=(0,c.useCallback)(()=>{if(!s)return x;let e=!!(s.isInitialized||s.initializedStoreOnce)&&w.every(e=>h(e,s,l)),n=t.lng||s.language,r=T.current,i=D.current;if(i&&i.ready===e&&i.lng===n&&i.keyPrefix===f&&i.revision===r)return i;let a={t:s.getFixedT(n,l.nsMode===`fallback`?w:w[0],f,{scopeNs:w}),ready:e,lng:n,keyPrefix:f,revision:r};return D.current=a,a},[s,w,f,l,t.lng]),[k,A]=(0,c.useState)(0),{t:j,ready:M}=(0,b.useSyncExternalStore)(E,O,O);(0,c.useEffect)(()=>{if(s&&!M&&!u){let e=()=>A(e=>e+1);t.lng?m(s,t.lng,w,e):p(s,w,e)}},[s,t.lng,w,M,u,k]);let N=s||{},P=(0,c.useRef)(null),F=(0,c.useRef)(),I=e=>{let t=Object.getOwnPropertyDescriptors(e);t.__original&&delete t.__original;let n=Object.create(Object.getPrototypeOf(e),t);if(!Object.prototype.hasOwnProperty.call(n,`__original`))try{Object.defineProperty(n,"__original",{value:e,writable:!1,enumerable:!1,configurable:!1})}catch{}return n},L=(0,c.useMemo)(()=>{let e=N,t=e?.language,n=e;e&&(P.current&&P.current.__original===e&&F.current===t?n=P.current:(n=I(e),P.current=n,F.current=t));let r=!M&&!u?(...e)=>(d(s,`USE_T_BEFORE_READY`,`useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t.`),j(...e)):j,i=[r,n,M];return i.t=r,i.i18n=n,i.ready=M,i},[j,N,M,N.resolvedLanguage,N.language,N.languages]);if(s&&u&&!M){let e=!1;try{e=!1}catch{}throw e&&d(s,`SUSPENDED_WHILE_LOADING`,`useTranslation: suspended while translations are loading (useSuspense is true by default). Add a <Suspense> boundary above this component, or set react.useSuspense: false in the i18next init options. https://react.i18next.com/latest/usetranslation-hook`),new Promise(e=>{let n=()=>e();t.lng?m(s,t.lng,w,n):p(s,w,n)})}return L};function w(){let{i18n:e}=C(),t=i(e.resolvedLanguage)?e.resolvedLanguage:o;return{language:t,locale:t,setLanguage:(0,c.useCallback)(t=>{i(t)&&e.changeLanguage(t)},[e]),t:(0,c.useCallback)((e,r)=>n(e,t,r),[t])}}export{C as n,v as r,w as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t}from"./vendor-react-DwNgTV1j.js";var n=e(t(),1),r=`(min-width: 960px) and (min-height: 640px)`;function i(e){let[t,r]=n.useState(()=>window.matchMedia(e).matches);return n.useEffect(()=>{let t=window.matchMedia(e),n=()=>r(t.matches);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),t}function a(){return i(`(max-width: 650px)`)}function o(){return i(r)}function s(){return i(`(pointer: coarse)`)}export{i,a as n,o as r,s as t};
|