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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./utils-C8uzG5AZ.js";e();var r=t();function i({className:e,type:t,...i}){return(0,r.jsx)(`input`,{type:t,"data-slot":`input`,className:n(`h-8 max-[650px]:h-11 pointer-coarse:h-11 w-full min-w-0 rounded-sm border border-input bg-panel px-2.5 py-1 text-base caret-focus transition-[border-color,box-shadow] outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-focus focus-visible:ring-3 focus-visible:ring-focus-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-surface-muted disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm`,e),...i})}export{i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-B0Z9INg1.js";import{i as e,r as t}from"./vendor-react-DwNgTV1j.js";import{t as n}from"./vendor-ui-DvrYggeS.js";import{t as r}from"./utils-C8uzG5AZ.js";import"./button-CCcCN8tE.js";import{t as i}from"./input-CPw-zkYh.js";import"./textarea-DmATpOqT.js";e();var a=t();function o({className:e,...t}){return(0,a.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:r(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-sm border border-input bg-panel transition-[border-color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-surface-muted has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-focus has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-focus-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,e),...t})}var s=n(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function c({className:e,align:t=`inline-start`,...n}){return(0,a.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:r(s({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}n(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-xs px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6.5 rounded-xs p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function l({className:e,...t}){return(0,a.jsx)(i,{"data-slot":`input-group-control`,className:r(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0`,e),...t})}export{c as n,l as r,o 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{c as r}from"./dist-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{c as r}from"./dist-BsRXXcSL.js";import{t as i}from"./utils-C8uzG5AZ.js";var a=e(t(),1),o=n(),s=Object.defineProperty,c=a.forwardRef(((e,t)=>s(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,o.jsx)(r.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function l({className:e,...t}){return(0,o.jsx)(c,{"data-slot":`label`,className:i(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}export{l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,o as t}from"./vendor-state-GkUciC5H.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{n as r,r as i}from"./useBoardItems-
|
|
1
|
+
import{a as e,o as t}from"./vendor-state-GkUciC5H.js";import{t as n}from"./createLucideIcon-Cd-3GVxJ.js";import{n as r,r as i}from"./useBoardItems-DCo-4he0.js";var a=n(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),o=`pisper-launch-defaults`,s=[`approval-required`,`workspace-write`,`full-access`],c=[`plan`,`goal`,`team`],l=s.filter(e=>e!==`full-access`);function u(e){return l.includes(e)?e:``}var d={cwd:``,projectless:!1,model:``,thinkingLevel:``,executionMode:``,runMode:`plan`};function f(e,t,n){if(typeof e!=`string`)return``;let r=e.trim();return r.length<=t&&(!n||n.test(r))?r:``}function p(e){let t=i(e);return{cwd:f(t.cwd,4096),projectless:t.projectless===!0,model:f(t.model,256),thinkingLevel:f(t.thinkingLevel,32,/^[a-z][a-z0-9_-]*$/),executionMode:u(t.executionMode),runMode:c.includes(t.runMode)?t.runMode:`plan`}}function m(e,t){let n=t.projectless??(t.cwd===void 0&&e.projectless),r=p({...e,...t,projectless:n});return t.executionMode===`full-access`?{...r,executionMode:u(e.executionMode)}:r}var h=t()(e((e,t)=>({...d,rememberLaunch:n=>{let{cwd:r,projectless:i,model:a,thinkingLevel:o,executionMode:s,runMode:c}=t();e(m({cwd:r,projectless:i,model:a,thinkingLevel:o,executionMode:s,runMode:c},n))},resetLaunchDefaults:()=>e({...d})}),{name:o,storage:r(),version:1,partialize:({cwd:e,projectless:t,model:n,thinkingLevel:r,executionMode:i,runMode:a})=>({cwd:e,projectless:t,model:n,thinkingLevel:r,executionMode:i,runMode:a}),merge:(e,t)=>({...t,...p(e)})}));export{h as n,a as r,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new Set([`accounts`,`models`,`model`,`publishers`,`projects`,`locations`]);function t(t){let n=t.split(`/`).map(e=>e.trim()).filter(Boolean);return n.filter((t,r)=>r===n.length-1||!e.has(t.toLowerCase()))}function n(e,t){return e.slice(-t).join(`/`)}function r(e,r=[]){let i=t(e);if(i.length<=1)return i[0]??e;let a=r.filter(t=>t!==e).map(t);for(let e=1;e<i.length;e+=1){let t=n(i,e);if(!a.some(r=>n(r,e)===t))return t}return i.join(`/`)}export{r as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MobileNavigation-IXJN0OuM.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/runtime-capabilities-store-D1FwQXKw.js","assets/api-45iTnFjN.js","assets/abort-signal-f4JsiYKX.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chevron-left-BAtyp3_6.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/chevron-right-C3t2Rckj.js","assets/settings-navigation-DV3N_utl.js","assets/bell-BjONAtgH.js","assets/bot-B3TaBp_T.js","assets/info-DATxy0fb.js","assets/monitor-ORxecA9m.js","assets/refresh-cw-TbWxTY4K.js","assets/DesktopWindowControls-DAuHMZFO.js","assets/minus-BuutOHSj.js","assets/square-bHHVTT3G.js","assets/x-07u4-129.js","assets/FloatingWidgets-BQXBxVDd.js","assets/routes-Da0OHSy6.js","assets/placements--Zk5njsN.js","assets/useQuery-Bg3cTjsY.js","assets/component-changes-Q9Bf64Ob.js","assets/session-scope-t_l7TRH5.js","assets/session-board-status-D2lpFPiI.js","assets/safe-mode-sentinel-BG78O0yJ.js","assets/usePhoneShell-m3H_98m_.js","assets/use-mobile-DauOEda6.js","assets/client-store-CAhvptv1.js","assets/AppOverlays-BV_gIt77.js","assets/startup-queries-BAWDaQY5.js","assets/mutation-Difliohy.js","assets/circle-alert-DCChabnT.js","assets/loader-circle-BOwQzHB-.js","assets/message-square-SKjZyY3v.js","assets/plus-fQbSqB1n.js","assets/search-D0mqDaf_.js","assets/square-terminal-BVG6cUT1.js","assets/tag-CqkeJlBf.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/kbd-CAufZTkl.js","assets/events-n27XPFgs.js","assets/shortcuts-BGzXmClx.js","assets/chat-api-BBuYjxwz.js","assets/format-DMJQzoZ7.js","assets/dialog-2cmY5V75.js","assets/dist-BHkR6BLP.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/es2015-DTZdOI9P.js","assets/button-CCcCN8tE.js","assets/useOverlayFocusReturn-NkxBSSjb.js","assets/palette-navigation-Bni8Mp34.js","assets/blocks-Olsdp5Lp.js","assets/brain-qxhnKqYP.js","assets/calendar-clock-VIxTaqqy.js","assets/folder-open-FIShC5Qk.js","assets/list-T5PqlpS2.js","assets/plug-BsIeHRwC.js","assets/radio-tower-jGQwrFWB.js","assets/rotate-ccw-clock-CO6Bw-sF.js","assets/server-BgNvmqwJ.js","assets/settings-QX0oWnVK.js","assets/sparkles-S_eeuqn9.js","assets/workflow-Bg94dy8I.js","assets/AppDialog-1E6olv_T.js","assets/label-CVWjEcfV.js","assets/input-CPw-zkYh.js","assets/WebDesktopPet-D6bkGOwL.js","assets/public-components-CeIuV0FY.js","assets/arrow-right-DqLOhpA2.js","assets/download-BCfIiuaL.js","assets/key-round-C29uZbsf.js","assets/config-search-C1YtwJAQ.js","assets/BrandLogo-k3CvJjd4.js","assets/sidebar-BIagLnrN.js","assets/chevron-down-CxtxIjiP.js","assets/ellipsis-CfGKfbq6.js","assets/useSessionRowActions-D0GKtBhg.js","assets/launch-defaults-store-CGeglXDI.js","assets/useBoardItems-DCo-4he0.js","assets/useSessionListQuery-CJ-BYuqu.js","assets/session-organization-api-BgCoIi2X.js","assets/session-questions-Cf-1g85h.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/dist-DzGQ7sLi.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/useNow-CxO2FUQY.js","assets/card-presentation-1oph2b8P.js","assets/board-projects-LnEYyP4h.js","assets/session-home-BDT4lMMJ.js","assets/motion-DTR4ZVle.js","assets/pick-system-directory-DSupTk88.js","assets/folder-plus-OPHZsJho.js","assets/pin-CU0FG0lI.js","assets/sidebar-store-DztdHlUn.js","assets/useSidebarModel-b5cdTj9-.js","assets/new-task-C3wuHTor.js","assets/shortcut-aria-jHRmld9z.js","assets/StatusGlyph-1KgitlUg.js","assets/sidebar-commands-ZA1UOA_F.js","assets/PhoneTopBar-CR1m9vf3.js","assets/PhoneMenuButton-Cl7FEYYw.js","assets/public--8F2_oqP.js","assets/useFleetSystemInfo-BbQQId7X.js","assets/square-pen-hYbjKh6A.js","assets/PhoneDrawer-Cp6X4_ei.js","assets/sheet-BTaIEX4w.js","assets/SidebarUpdateStatus-YxE_hT2l.js","assets/external-link-CEQqPcqc.js","assets/rocket-BgLSjoHY.js","assets/SettingsSidebar-CP1qDAcx.js","assets/arrow-left-B8oVrQ2S.js","assets/back-navigation-CK7X_5Bc.js","assets/DispatchOverlay-CEbzXIct.js","assets/LaunchConsole-uKHKx4h0.js","assets/arrow-up-DST6-qVQ.js","assets/shield-alert-oZqX6MNu.js","assets/shield-B1ruzHd0.js","assets/FocusRuntimeControls-C7b1I2L5.js","assets/braces-DQcXLGFF.js","assets/dist-V8chnW6-.js","assets/file-text-N9JICX6E.js","assets/popover-BtcdIPRz.js","assets/slider-DTmAZl-R.js","assets/input-group-CDEyjyK4.js","assets/textarea-DmATpOqT.js","assets/model-display-kDwvtxrW.js","assets/run-activity-CwfO0cui.js","assets/board-launch-YigjCnZf.js","assets/public-launch-DtVwSANs.js","assets/QuickPromptIdeas-C7X4T7kx.js","assets/code-xml-BrUXrBax.js","assets/wand-sparkles-CvEBNUFz.js","assets/list-checks-B5Jl4aiO.js","assets/session-change-summary-api-B9M9m1C0.js","assets/touch-target-BsyCgjR5.js","assets/ShortcutHelpDialog-C5f_x4XG.js","assets/ShortcutKeys-Cx8hNJ62.js","assets/PageHeader-6KRCT1j1.js","assets/more-pages-D_PnxLN0.js","assets/TerminalPanel-598uzwoB.js","assets/terminal-context-aIsIJPn8.js","assets/TaskTerminalView-CT6V8AGR.js","assets/PageState-Cz6vFMXv.js","assets/AppSelect-BGVBQRP1.js","assets/select-DD_WO-gs.js","assets/chevron-up-D_ZcXjqr.js","assets/dist-BiRPwy4W.js","assets/TaskTerminalView-BrP-ENHg.css","assets/MobileViewportStabilizer-OtwVmIPm.js","assets/session-tree-actions-7q68B3e-.js","assets/session-tree-summary-CMgz9Uf-.js","assets/BoardPage-CL2e-8j4.js","assets/arrow-down-CDGua-ue.js","assets/corner-down-right--hxi-Ihy.js","assets/rotate-ccw-C0v8V77_.js","assets/trash-2-CNrPOoPR.js","assets/brand-DIEc3fK8.js","assets/segmented-control-BlM_GKV6.js","assets/tooltip-D4MFbqcG.js","assets/esm-DCV8yILT.js","assets/ChatPage-b16p3qWl.js","assets/permission-rules-api-BvKOF7rS.js","assets/session-list-BeyOEzyU.js","assets/circle-check-iEdCm3Pw.js","assets/image-plus-D7bzZog0.js","assets/GitDiffViewer-BAZTiiDo.js","assets/file-Bllajneu.js","assets/side-chat-context-D36twdWd.js","assets/copy-DHmIFc52.js","assets/eye-uWAPXNzJ.js","assets/shield-check-Gvek4RJ7.js","assets/collapsible-DMaUQRX4.js","assets/alert-firawb0H.js","assets/vendor-motion-DSW3wzXK.js","assets/MarkdownMessage-B_9d8KI-.js","assets/vendor-markdown-plugins-CT5L3KA9.js","assets/vendor-shiki-runtime-DM7fm4Bl.js","assets/vendor-markdown-plugins-DEcVZfaU.css","assets/vendor-markdown-CT6Z4fh8.js","assets/route-context-DvWDul4T.js","assets/HoldToConfirmButton-BxdJ7icc.js","assets/card-C3A0b5KR.js","assets/FileAttachmentPreview-Cw5-ApIr.js","assets/tabs-DsgBuvJv.js","assets/git-branch-N7LGjtzt.js","assets/link-2-mgasYn21.js","assets/panel-right-BSUtqUd8.js","assets/paperclip-BCXrwYpb.js","assets/pencil-U08v_vV9.js","assets/play-DNDjDNGn.js","assets/triangle-alert-CE1q54ci.js","assets/wrench-6pg6_bqI.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/switch-D_G8wFhs.js","assets/WorkspacePicker-DPwlN6KA.js","assets/app-primitives-Drz_SjnR.js","assets/badge-CWB3lj2H.js","assets/usePagePrimaryAction-CWPC0C_f.js","assets/web-preview-Bdrxyj-l.js","assets/tool-labels-BUEvdohv.js","assets/speech-session-D0GE-Pym.js","assets/web-preview-events-BBbAgfr4.js","assets/SessionShell-Dp94FUuk.js","assets/SessionHome-Wu8JWsto.js","assets/MorePage-DtqJlHAA.js","assets/app-window-CPNdvYNt.js","assets/image-BY_c3FYU.js","assets/monitor-smartphone-B1gIjItA.js","assets/ChatHistoryPage-DedOh6aO.js","assets/FeaturePage-BJGDVZ_u.js","assets/AssetsPage-6HTR2IpQ.js","assets/queryOptions-Dfvzj6n2.js","assets/mobile-runtime-recovery-tbTyacip.js","assets/field-DaxtcBBA.js","assets/separator-BPh_qxvc.js","assets/ChannelsPage-CmczBcSA.js","assets/send-QxBfLFo-.js","assets/SchedulesPage-BRqBCtCf.js","assets/ConfigPage-BYB0rL_V.js","assets/arrow-up-right-B6l8qFZz.js","assets/zap-DZHw5afO.js","assets/app-update-kStNhVOh.js","assets/browser-notifications-DBS0oXqN.js","assets/ChatAppearancePage-DMAnYGNb.js","assets/PluginsPage-CNddCaYt.js","assets/earth-Ddy13fHh.js","assets/file-code-corner-BnE1ljT0.js","assets/package-BOmkLaKS.js","assets/save-CHBB52P8.js","assets/MemoryPage-_mnn45jY.js","assets/McpPage-7NEAc3Rv.js","assets/SkillsPage-z6rTYJ8Z.js","assets/public-CgydVZuV.js","assets/settings-2-CXJjXJS9.js","assets/use-studio-actions-C4Zh15Vx.js","assets/safe-mode-instance-TonxlRrq.js","assets/PageFrame-DNwGZ-Dz.js","assets/WorkflowsPage-DrltlXh1.js","assets/grip-vertical-B__LYT0s.js","assets/vendor-xyflow-hxQFvEHK.js","assets/vendor-xyflow-DLioOiRN.css","assets/navigation-EoDz3gT8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{a as t,d as n,f as r,h as i,i as a,l as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./vendor-router-CSN_DGvx.js";import{t as p}from"./index-BDgCJ4Fs.js";import{i as m,n as h,r as g,t as _}from"./vendor-react-DwNgTV1j.js";import{t as v}from"./vendor-ui-DvrYggeS.js";import{a as y,c as b,d as x,f as S,i as ee,l as C,n as w,o as te,r as T,s as ne,t as re,u as ie}from"./routes-Da0OHSy6.js";import{a as E,c as ae,i as oe,l as se,o as ce,r as D,s as le,t as O}from"./i18n-DfsxGeh5.js";import{n as ue,r as k,t as A}from"./use-i18n-CVZdp2ZN.js";import{t as j}from"./storage-BY6wEHPw.js";import{n as de,t as fe}from"./useQuery-Bg3cTjsY.js";import{a as pe,i as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./startup-queries-BAWDaQY5.js";import{s as be,t as xe}from"./api-45iTnFjN.js";import{a as Se,i as Ce,r as we}from"./runtime-capabilities-BhAMiYhG.js";import{t as Te}from"./runtime-capabilities-store-D1FwQXKw.js";import{n as Ee,r as De}from"./use-mobile-DauOEda6.js";import{t as Oe}from"./client-store-CAhvptv1.js";import{t as M}from"./createLucideIcon-Cd-3GVxJ.js";import{t as ke}from"./circle-check-iEdCm3Pw.js";import{t as Ae}from"./info-DATxy0fb.js";import{a as je,i as Me,n as Ne,o as Pe,t as Fe}from"./settings-navigation-DV3N_utl.js";import{n as Ie,t as Le}from"./list-T5PqlpS2.js";import{t as Re}from"./search-D0mqDaf_.js";import{t as ze}from"./settings-QX0oWnVK.js";import{t as Be}from"./square-pen-hYbjKh6A.js";import{t as Ve}from"./triangle-alert-CE1q54ci.js";import{t as He}from"./x-07u4-129.js";import{i as Ue,n as We,r as Ge,t as Ke}from"./more-pages-D_PnxLN0.js";import{a as qe}from"./dist-41X0pdUs.js";import{a as Je,c as N,i as Ye,l as Xe,o as P,r as Ze,s as Qe,t as F}from"./dist-BsRXXcSL.js";import{r as $e}from"./dist-BiRPwy4W.js";import{n as et}from"./dist-DzGQ7sLi.js";import{c as tt,i as nt,o as rt}from"./es2015-DTZdOI9P.js";import{r as it}from"./tooltip-D4MFbqcG.js";import{t as I}from"./utils-C8uzG5AZ.js";import{n as at,t as ot}from"./button-CCcCN8tE.js";import{t as st}from"./kbd-CAufZTkl.js";import{_ as ct,h as lt,n as ut,t as dt,v as ft}from"./events-n27XPFgs.js";import{a as pt,c as L,i as mt,n as ht,r as R,s as z}from"./shortcuts-BGzXmClx.js";import{t as B}from"./sidebar-store-DztdHlUn.js";import{n as gt,t as _t}from"./new-task-C3wuHTor.js";import{a as vt,i as yt,l as bt,o as xt,s as St,t as V}from"./dialog-2cmY5V75.js";import{t as Ct}from"./shortcut-aria-jHRmld9z.js";import{i as wt,t as Tt}from"./back-navigation-CK7X_5Bc.js";import{t as Et}from"./route-context-DvWDul4T.js";import{n as Dt}from"./sidebar-commands-ZA1UOA_F.js";import{r as H}from"./app-primitives-Drz_SjnR.js";import{n as U,r as Ot}from"./web-preview-Bdrxyj-l.js";import{t as kt}from"./BrandLogo-k3CvJjd4.js";import{r as W}from"./web-preview-events-BBbAgfr4.js";import{_ as At,a as jt,c as Mt,f as G,h as Nt,l as Pt,n as Ft,r as It,s as Lt,u as K,v as q}from"./app-update-kStNhVOh.js";import{i as Rt}from"./browser-notifications-DBS0oXqN.js";import{n as zt,t as Bt}from"./navigation-EoDz3gT8.js";var J=e(m());function Vt({i18n:e,defaultNS:t,children:n}){let r=(0,J.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,J.createElement)(k.Provider,{value:r},n)}var Y=M(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),Ht=M(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ut=e(h(),1),X=g(),Z=Object.defineProperty,Q=(e,t)=>Z(e,`name`,{value:t,configurable:!0}),Wt=`ToastProvider`,[Gt,Kt,qt]=et(`Toast`),[Jt,Yt]=Qe(`Toast`,[qt]),[Xt,Zt]=Jt(Wt),Qt=Q(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=J.useState(null),[u,d]=J.useState(0),f=J.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Wt}\`. Expected non-empty \`string\`.`),(0,X.jsx)(Gt.Provider,{scope:t,children:(0,X.jsx)(Xt,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:J.useCallback(()=>d(e=>e+1),[]),onToastRemove:J.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),$t=`ToastViewport`,en=[`F8`],tn=`toast.viewportPause`,nn=`toast.viewportResume`,rn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,hotkey:r=en,label:i=`Notifications ({hotkey})`,...a}=e,o=Zt($t,n),s=Kt(n),c=J.useRef(null),l=J.useRef(null),u=J.useRef(null),d=J.useRef(null),f=qe(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;J.useEffect(()=>{let e=Q(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),J.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=Q(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(tn);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=Q(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(nn);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=Q(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=Q(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=J.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...On(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return J.useEffect(()=>{let e=d.current;if(e){let t=Q(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);kn(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,X.jsxs)(rt,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,X.jsx)(on,{ref:l,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`forwards`}))}}),(0,X.jsx)(Gt.Slot,{scope:n,children:(0,X.jsx)(N.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,X.jsx)(on,{ref:u,onFocusFromOutsideViewport:()=>{kn(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),an=`ToastFocusProxy`,on=J.forwardRef(Q(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Zt(an,n);return(0,X.jsx)($e,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),sn=`Toast`,cn=`toast.swipeStart`,ln=`toast.swipeMove`,un=`toast.swipeCancel`,dn=`toast.swipeEnd`,fn=J.forwardRef(Q(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Ye({prop:r,defaultProp:i??!0,onChange:a,caller:sn});return(0,X.jsx)(Ze,{present:n||s,children:(0,X.jsx)(hn,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:F(e.onPause),onResume:F(e.onResume),onSwipeStart:P(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:P(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:P(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:P(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[pn,mn]=Jt(sn,{onClose(){}}),hn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Zt(sn,n),g=Kt(n),[_,v]=J.useState(null),y=qe(t,v),b=J.useRef(null),x=J.useRef(null),S=i||h.duration,ee=J.useRef(0),C=J.useRef(S),w=J.useRef(0),{onToastAdd:te,onToastRemove:T}=h,ne=F(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),re=J.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),ee.current=new Date().getTime(),w.current=window.setTimeout(ne,e))},[ne]);J.useEffect(()=>{let e=h.viewport;if(e){let t=Q(()=>{re(C.current),l?.()},`handleResume`),n=Q(()=>{let e=new Date().getTime()-ee.current;C.current-=e,window.clearTimeout(w.current),c?.()},`handlePause`);return e.addEventListener(tn,n),e.addEventListener(nn,t),()=>{e.removeEventListener(tn,n),e.removeEventListener(nn,t)}}},[h.viewport,S,c,l,re]),J.useEffect(()=>{a&&!h.isClosePausedRef.current&&re(S)},[a,S,h.isClosePausedRef,re]),J.useEffect(()=>()=>{window.clearTimeout(w.current)},[]),J.useEffect(()=>(te(),()=>T()),[te,T]);let ie=J.useMemo(()=>_?Cn(_):null,[_]);return h.viewport?(0,X.jsxs)(X.Fragment,{children:[ie&&(0,X.jsx)(gn,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ie}),(0,X.jsx)(pn,{scope:n,onClose:ne,children:Ut.createPortal((0,X.jsx)(Gt.ItemSlot,{scope:n,children:(0,X.jsx)(tt,{asChild:!0,onEscapeKeyDown:P(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||ne()}),children:(0,X.jsx)(N.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:P(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||ne())}),onPointerDown:P(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:P(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,wn(ln,d,f,{discrete:!1})):Tn(l,h.swipeDirection,c)?(x.current=l,wn(cn,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:P(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Tn(t,h.swipeDirection,h.swipeThreshold)?wn(dn,p,r,{discrete:!0}):wn(un,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),gn=Q(e=>{let{__scopeToast:t,children:n,...r}=e,i=Zt(sn,t),[a,o]=J.useState(!1),[s,c]=J.useState(!1);return En(()=>o(!0)),J.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,X.jsx)(nt,{asChild:!0,container:i.announcerContainer||void 0,children:(0,X.jsx)($e,{...r,children:a&&(0,X.jsxs)(X.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),_n=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e;return(0,X.jsx)(N.div,{...r,ref:t})},`ToastDescription`)),vn=`ToastAction`,yn=J.forwardRef(Q(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,X.jsx)(Sn,{altText:n,asChild:!0,children:(0,X.jsx)(xn,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${vn}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),bn=`ToastClose`,xn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,...r}=e,i=mn(bn,n);return(0,X.jsx)(Sn,{asChild:!0,children:(0,X.jsx)(N.button,{type:`button`,...r,ref:t,onClick:P(e.onClick,i.onClose)})})},`ToastClose`)),Sn=J.forwardRef(Q(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,X.jsx)(N.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Cn(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Dn(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Cn(e))}}}),t}Q(Cn,`getAnnounceTextContent`);function wn(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Xe(i,a):i.dispatchEvent(a)}Q(wn,`handleAndDispatchCustomEvent`);var Tn=Q((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function En(e=()=>{}){let t=F(e);Je(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}Q(En,`useNextFrame`);function Dn(e){return e.nodeType===e.ELEMENT_NODE}Q(Dn,`isHTMLElement`);function On(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Q(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Q(On,`getTabbableCandidates`);function kn(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}Q(kn,`focusFirst`);var An=Qt,jn=rn,Mn=fn,Nn=_n,Pn=yn,Fn=xn,In=_();function Ln({children:e}){let{i18n:t}=ue(),n=se(t.resolvedLanguage)?t.resolvedLanguage:O;return(0,J.useEffect)(()=>{document.documentElement.lang=n;try{p.setItem(j.language,n)}catch{}window.pisperDesktop?.setLanguage?.(n)},[n]),e}function Rn({children:e}){return(0,X.jsx)(Vt,{i18n:ae,children:(0,X.jsx)(Ln,{children:e})})}function zn({children:e}){return(0,J.useEffect)(()=>_e(window),[]),(0,X.jsx)(de,{client:pe,children:(0,X.jsx)(Rn,{children:(0,X.jsx)(it,{delayDuration:200,children:e})})})}function Bn(){return[...document.querySelectorAll(`[role="dialog"], [role="alertdialog"], [role="menu"], [data-slot="popover-content"]`)].some(e=>e.dataset.state!==`closed`&&e.getAttribute(`aria-hidden`)!==`true`&&e.getClientRects().length>0)}function Vn({onRouteBack:e}){let t=(0,J.useRef)(e);return t.current=e,(0,J.useEffect)(()=>{let e=new WeakSet,n=t=>{t.key===`Escape`&&Bn()&&e.add(t)},r=t=>{t.key!==`Escape`||t.defaultPrevented||t.isComposing||e.has(t)||Tt.dismiss()&&t.preventDefault()},i=()=>{let e=Bn(),n=new KeyboardEvent(`keydown`,{key:`Escape`,bubbles:!0,cancelable:!0});return wt(n),(document.activeElement||document.body).dispatchEvent(n),e||n.defaultPrevented?!0:t.current?.()??!1},a=window;return a.__pisperRequestBack=i,window.addEventListener(`keydown`,n,!0),window.addEventListener(`keydown`,r),()=>{a.__pisperRequestBack===i&&delete a.__pisperRequestBack,window.removeEventListener(`keydown`,n,!0),window.removeEventListener(`keydown`,r)}},[]),null}function Hn(){let e=null,t=!1;return{register(n){return e=n,t&&(t=!1,n()),()=>{e===n&&(e=null)}},invoke(){if(e)return e();t=!0},clear(){e=null}}}Object.freeze([`session`,`board`,`more`,`settings`]);var Un=Object.freeze({board:`board`,more:`more`,settings:`config`});function Wn(e,t){return t?`settings`:e===`session`||e===`chat`?`session`:e===`board`?`board`:e===`components`||e===`more`||e===`config`||Ge.has(e)?`more`:null}function Gn({location:e,navigation:t}){return t.state!==`idle`&&t.location?.pathname||e.pathname}function Kn({location:e,navigation:t}){return C(Gn({location:e,navigation:t}))===`session`?null:t.state!==`idle`&&C(e.pathname)===`session`?{to:e.pathname+(e.search||``),replace:!0,state:e.state}:{to:`/`}}var qn=/^\/components\/([^/]+)\/?$/;function Jn(e,t,n,{phone:r=!1,homeEntry:i=!1,canGoBack:a=!1}={}){return e===`session`?i||t===`/`||t===``?null:a?-1:null:e===`components`&&qn.test(t)?`/components`:r&&n&&/^\/config\/[^/]+/.test(t)?ee:Wn(e,n)===`more`&&e!==`more`?`/more`:`/`}var Yn=`flex w-full min-w-0 items-center gap-2.5 rounded-[var(--r-md)] px-2.5 text-base text-content transition-colors duration-(--d-fast) hover:bg-surface-hover focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,Xn=`grid size-8 flex-none place-items-center rounded-[var(--r-sm)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`,Zn=`grid size-10 place-items-center rounded-[var(--r-md)] text-content-secondary transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-focus pointer-coarse:size-11`;function Qn(e){let t=e.takeover,n=B(e=>e.collapsed)&&!t,r=B(e=>e.peeking),i=B(e=>e.setPeeking),a=(0,J.useRef)(null),o=(0,J.useRef)(null),s=(0,J.useRef)(!1);return(0,J.useLayoutEffect)(()=>{if(!s.current)return;let e=document.activeElement;e&&e!==document.body&&o.current?.contains(e)||o.current?.querySelector(`[data-sidebar-toggle]`)?.focus()},[n]),(0,J.useEffect)(()=>{t&&r&&i(!1)},[r,i,t]),(0,J.useEffect)(()=>{if(!n||!r)return;let e=e=>e instanceof Element&&!!(a.current?.contains(e)||e.closest(`[role="menu"], [role="dialog"], [data-radix-popper-content-wrapper]`)),t=t=>{e(t.target)||i(!1)},o=t=>{e(t.target)||i(!1)},s=t=>{t.key!==`Escape`||t.defaultPrevented||!e(t.target)||(t.preventDefault(),i(!1))};return document.addEventListener(`focusin`,t),document.addEventListener(`pointerdown`,o),document.addEventListener(`keydown`,s),()=>{document.removeEventListener(`focusin`,t),document.removeEventListener(`pointerdown`,o),document.removeEventListener(`keydown`,s)}},[n,r,i]),(0,X.jsxs)(`div`,{ref:o,"data-shell-sidebar":t?`settings`:n?`rail`:`expanded`,"data-focus-region":`sidebar`,onFocus:()=>{s.current=!0},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s.current=!1)},className:I(`relative z-20 flex h-full flex-none flex-col bg-sidebar transition-[width] duration-(--d-base) ease-out motion-reduce:transition-none`,n?`w-[60px]`:`w-[268px]`,`dark:border-r dark:border-stroke-soft`),children:[t??(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col animate-in fade-in duration-(--d-fast) motion-reduce:animate-none`,children:n?(0,X.jsx)(nr,{...e}):(0,X.jsx)(tr,{...e})},n?`rail`:`expanded`),n&&r&&(0,X.jsx)(`div`,{ref:a,"data-shell-sidebar-peek":!0,className:`absolute inset-y-0 left-0 z-40 flex w-[268px] flex-col bg-sidebar shadow-float`,children:(0,X.jsx)(tr,{...e,peek:!0})})]})}var $n={newTask:`primaryAction`,search:`commandPalette`,board:`openBoard`,features:`openMore`,settings:`openSettings`};function er(){let{t:e}=A();return{newTask:e(`navigation:shell.newTask`),search:e(`navigation:sidebar.search`),board:e(`navigation:sidebar.allAgents`),features:e(`navigation:sidebar.features`),settings:e(`navigation:navigation.settings`)}}function tr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,content:o,update:s,peek:c=!1}){let{t:l}=A(),u=er(),d=B(e=>e.toggleCollapsed),f=B(e=>e.setPeeking),p=L(e=>e.bindings),m=p.toggleSidebar,h=z(`toggleSidebar`),g={newTask:z(`primaryAction`),search:z(`commandPalette`),board:z(`openBoard`),features:z(`openMore`),settings:z(`openSettings`)},_=l(c?`navigation:sidebar.expand`:`navigation:sidebar.collapse`),v=(t,n,r)=>{let i=t===`board`?u.board:t===`features`?u.features:u[t],a=g[t],o=t===e;return(0,X.jsxs)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-current":o?`page`:void 0,"aria-keyshortcuts":Ct(p[$n[t]]),className:I(Yn,`h-9 pointer-coarse:h-11`,o&&`bg-surface-active font-medium hover:bg-surface-active`),onClick:r,children:[(0,X.jsx)(n,{className:`size-[18px] flex-none text-content-secondary`,strokeWidth:1.75,"aria-hidden":`true`}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:i}),a&&(0,X.jsx)(st,{"aria-hidden":`true`,className:`border-transparent bg-transparent text-content-faint shadow-none pointer-coarse:hidden`,children:a})]})};return(0,X.jsxs)(`nav`,{"aria-label":l(`navigation:sidebar.label`),className:`flex min-h-0 flex-1 flex-col`,children:[(0,X.jsxs)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center gap-2 pr-2.5 pl-4`,children:[(0,X.jsx)(kt,{size:22}),(0,X.jsx)(`span`,{className:`text-[15px] font-semibold tracking-[-.01em] text-content`,children:`Pisper`}),(0,X.jsx)(`span`,{className:`flex-1`}),(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":c?void 0:`collapse`,"aria-expanded":!c||void 0,className:Xn,"aria-label":_,"aria-keyshortcuts":c?void 0:Ct(m),title:!c&&h?`${_} (${h})`:_,onClick:()=>c?f(!1):d(),children:c?(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`}):(0,X.jsx)(Y,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,X.jsxs)(`div`,{className:`flex flex-none flex-col gap-px px-2 pt-0.5 pb-1.5`,children:[v(`newTask`,Be,t),v(`search`,Re,n),v(`board`,Le,r),v(`features`,Ie,i)]}),(0,X.jsx)(`div`,{"data-sidebar-scroll":!0,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain px-2 pt-1.5`,children:o}),(0,X.jsxs)(`div`,{className:`flex flex-none items-center gap-1 p-2`,children:[(0,X.jsx)(`div`,{className:`min-w-0 flex-1`,children:v(`settings`,ze,a)}),s]})]})}function nr({active:e,onNewTask:t,onSearch:n,onOpenBoard:r,onOpenFeatures:i,onOpenSettings:a,railCounts:o,update:s}){let{t:c}=A(),l=er(),u=B(e=>e.toggleCollapsed),d=L(e=>e.bindings),f=d.toggleSidebar,p=z(`toggleSidebar`),m=c(`navigation:sidebar.expand`),h=(t,n,r)=>{let i=t===`board`?l.board:t===`features`?l.features:l[t],a=t===e;return(0,X.jsx)(`button`,{type:`button`,"data-sidebar-entry":t,"aria-keyshortcuts":Ct(d[$n[t]]),"aria-label":i,"aria-current":a?`page`:void 0,title:i,className:I(Zn,a&&`bg-surface-active text-content`),onClick:r,children:(0,X.jsx)(n,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})};return(0,X.jsxs)(`nav`,{"aria-label":c(`navigation:sidebar.labelCollapsed`),className:`flex min-h-0 flex-1 flex-col items-center gap-1 pb-2`,children:[(0,X.jsx)(`div`,{"data-window-drag-region":!0,className:`flex h-[52px] flex-none items-center`,children:(0,X.jsx)(`button`,{type:`button`,"data-sidebar-toggle":`expand`,"aria-expanded":!1,className:Zn,"aria-label":m,"aria-keyshortcuts":Ct(f),title:p?`${m} (${p})`:m,onClick:u,children:(0,X.jsx)(Ht,{className:`size-[18px]`,strokeWidth:1.75,"aria-hidden":`true`})})}),h(`newTask`,Be,t),h(`search`,Re,n),(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),o,(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`my-1.5 h-px w-6 bg-stroke-strong`}),h(`board`,Le,r),h(`features`,Ie,i),(0,X.jsx)(`span`,{className:`flex-1`}),s,h(`settings`,ze,a)]})}function rr({collapsed:e=!1}){let{t}=A();return e?(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex flex-col items-center gap-1`,children:[(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`}),(0,X.jsx)(`span`,{className:`size-10 rounded-[var(--r-md)] bg-surface-hover`})]}):(0,X.jsx)(`div`,{role:`status`,"aria-busy":`true`,"aria-label":t(`navigation:sidebar.loading`),children:[60,44,70].map(e=>(0,X.jsxs)(`div`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-2.5 px-2.5`,children:[(0,X.jsx)(`span`,{className:`size-4 rounded-full bg-surface-hover`}),(0,X.jsx)(`span`,{className:`h-3 rounded-sm bg-surface-hover`,style:{width:`${e}%`}})]},e))})}var ir=`pisper-custom-accent-style`,ar=[`xs`,`sm`,`base`,`lg`,`xl`,`2xl`,`3xl`],or=[12,13,14,16,20,24,28];function sr(e){let{uiFontSize:t}=Nt(typeof e==`number`?{uiFontSize:e}:{fontScale:e});return or.map(e=>Math.round(e*t/14))}function cr(e,t,n=new Date().getHours()){return e===`dark`?!0:e===`light`?!1:e===`system`?t:n>=18||n<8}function lr(e){let t=document.documentElement;t.dataset.accent=e.accent,t.dataset.density=e.density,t.dataset.fontScale=e.fontScale,t.dataset.motion=e.motion,t.dataset.radius=e.radius;let n=Nt(e.uiFontSize===void 0?{fontScale:e.fontScale,codeFontSize:e.codeFontSize}:e);t.style.setProperty(`--ui-font-size`,`${n.uiFontSize}px`),t.style.setProperty(`--font-code-size`,`${n.codeFontSize}px`),sr(n.uiFontSize).forEach((e,n)=>{t.style.setProperty(`--font-ui-${ar[n]}`,`${e}px`)});let r=e.accent===`custom`?q(e.customAccent||``):null,i=document.getElementById(ir);r?(i||(i=document.createElement(`style`),i.id=ir,document.head.append(i)),i.textContent=At(r)):i?.remove()}function ur(e,t){if(!e)return``;let n=t?.sessions?.find(t=>t?.id===e);return n&&n.archived!==!0?e:``}function dr(){let e=o(),t=f();return(0,J.useEffect)(()=>{let n=n=>{if(n.defaultPrevented)return;let r=(n.target instanceof Element?n.target:null)?.closest(`a[href]`);if(!r)return;let i=U({href:r.href,baseUrl:window.location.href,button:n.button,download:r.hasAttribute(`download`),altKey:n.altKey,ctrlKey:n.ctrlKey,metaKey:n.metaKey,shiftKey:n.shiftKey,behavior:r.dataset.webPreview});if(!i)return;if(n.preventDefault(),n.stopPropagation(),x(e.pathname)){W(i);return}let a=ur(p.getItem(j.activeSession),pe.getQueryData(ye));if(!a){window.open(i,`_blank`,`noopener,noreferrer`);return}W(i),t(S(a))};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)},[e.pathname,t]),null}function fr({blocked:e,onCommandPalette:t,onPrimary:n,onSearch:r,onToggleTerminal:i,onToggleSidebar:a,onAgentPanel:o,onPreviousAgent:s,onNextAgent:c,onSettings:l,onOpenSession:u,onOpenBoard:d,onOpenComponents:f,onOpenMore:p,onJumpToAttention:m,onSessionTree:h,onSideChat:g,onCycleFocusRegion:_,onShortcutHelp:v}){let y=L(e=>e.bindings);return(0,J.useLayoutEffect)(()=>{let b=b=>{if(e||pt(b)||mt(b)&&!b.key.startsWith(`Arrow`))return;let x;R(b,y.commandPalette)?x=t:R(b,y.primaryAction)?x=n:R(b,y.openSession)?x=u:R(b,y.openBoard)?x=d:R(b,y.openComponents)?x=f:R(b,y.openMore)?x=p:R(b,y.jumpToAttention)?x=m:R(b,y.sessionTree)?x=h:R(b,y.sideChat)?x=g:R(b,y.cycleFocusRegion)?x=_:R(b,y.toggleSidebar)?x=a:R(b,y.agentPanel)?x=o:R(b,y.previousAgent)?x=s:R(b,y.nextAgent)?x=c:R(b,y.toggleTerminal)?x=i:R(b,y.openSettings)?x=l:R(b,y.shortcutHelp)?x=v:!ht(b.target)&&R(b,y.focusSearch)&&(x=r),x&&(b.preventDefault(),x())};return window.addEventListener(`keydown`,b),()=>window.removeEventListener(`keydown`,b)},[y,e,o,t,_,m,c,d,f,p,u,s,n,r,h,l,v,g,i,a]),null}var pr=v(`group pointer-events-auto relative flex min-h-11 w-full items-center gap-2 overflow-hidden rounded-md border px-3.5 py-2.5 pr-10 text-[13px] leading-5 font-medium tracking-[0] shadow-float transition data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-right-full data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none`,{variants:{tone:{success:`border-success-border bg-success-soft text-success-strong`,error:`border-danger-border bg-danger-soft text-danger`,info:`border-stroke bg-popover text-foreground`}},defaultVariants:{tone:`success`}});function mr({className:e,tone:t,...n}){return(0,X.jsx)(Mn,{"data-slot":`toast`,className:I(pr({tone:t}),e),...n})}function hr({...e}){return(0,X.jsx)(An,{"data-slot":`toast-provider`,...e})}function gr({className:e,...t}){return(0,X.jsx)(jn,{"data-slot":`toast-viewport`,className:I(`fixed right-5 bottom-5 z-[80] flex w-[min(420px,calc(100vw-40px))] max-w-full flex-col gap-2 outline-none max-sm:right-3 max-sm:bottom-3 max-sm:left-3 max-sm:w-auto`,e),...t})}function _r({className:e,...t}){return(0,X.jsx)(Nn,{"data-slot":`toast-description`,className:I(`min-w-0 flex-1 [overflow-wrap:anywhere]`,e),...t})}function vr({className:e,...t}){return(0,X.jsx)(Fn,{"data-slot":`toast-close`,className:I(`absolute top-1/2 right-1.5 grid size-7 -translate-y-1/2 place-items-center rounded-sm text-current opacity-70 transition hover:bg-black/5 hover:opacity-100 dark:hover:bg-white/10`,e),...t})}var yr={success:ke,error:Ve,info:Ae};function br({message:e,tone:t,closeLabel:n,action:r,...i}){let a=yr[t];return(0,X.jsxs)(mr,{tone:t,type:t===`error`?`foreground`:`background`,...i,children:[(0,X.jsx)(a,{className:`size-[18px] shrink-0`}),(0,X.jsx)(_r,{children:e}),r&&(0,X.jsx)(Pn,{altText:r.label,asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:`h-7 shrink-0 rounded-sm border border-current/30 px-2 text-xs font-semibold hover:bg-current/10`,onClick:r.onAction,children:r.label})}),(0,X.jsx)(vr,{"aria-label":n,title:n,children:(0,X.jsx)(He,{className:`size-4`})})]})}function xr(){let{t:e}=A(),[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null),i=(0,J.useCallback)(e=>{r.current?.(e),r.current=null,n(null)},[]),a=(0,J.useCallback)(e=>new Promise(t=>{r.current?.(null),r.current=t,n(e)}),[]),o=(0,J.useCallback)((t={})=>a({type:`confirm`,title:e(`common:useAppDialog.confirmAction`),confirmLabel:e(`common:useAppDialog.confirm`),tone:`danger`,...t}).then(e=>e===!0),[a,e]),s=(0,J.useCallback)((t={})=>a({type:`prompt`,title:e(`common:useAppDialog.enterContent`),confirmLabel:e(`common:useAppDialog.save`),tone:`primary`,value:``,...t}).then(e=>typeof e==`string`?e:null),[a,e]),c=(0,J.useCallback)(()=>i(null),[i]);return(0,J.useEffect)(()=>()=>r.current?.(null),[]),{dialog:t,confirm:o,prompt:s,close:c,finish:i}}var Sr=15e3,Cr=216e5,wr=new Set([`checking`,`downloading`,`downloaded`]);function Tr(e){return!wr.has(e)}function Er(e,t=window){let n=!1,r=!1,i=()=>{n||r||(n=!0,Promise.resolve().then(e).catch(()=>{}).finally(()=>{n=!1}))},a=t.setTimeout(i,Sr),o=t.setInterval(i,Cr);return()=>{r=!0,t.clearTimeout(a),t.clearInterval(o)}}var Dr=new Set([`available`,`downloading`,`installed`,`error`]);function Or(e,t){return t?.find(e=>e.component===`desktop`)?.currentVersion.trim()||e}function kr(e){return e.filter(e=>e.size>0&&(Dr.has(e.state)||e.canInstall))}function Ar(e){return e.replace(/\r/g,``).split(`
|
|
3
|
+
`).filter(e=>!/^\s*#{1,6}\s+Pisper\s+(?:Desktop|TUI|Runtime)\s+v?\d+\.\d+\.\d+\s*$/i.test(e)&&!/^\s*#{1,6}\s+What['’]?s Changed\s*$/i.test(e)&&!/^\s*(?:\*\*)?(?:Full Changelog|完整变更)(?:\*\*)?\s*[::].*$/i.test(e)).join(`
|
|
4
|
+
`).replace(/\n{3,}/g,`
|
|
5
|
+
|
|
6
|
+
`).trim()}function jr(e){let t=e.filter(e=>e.state===`available`||e.state===`downloading`).map(e=>Ar(e.notes)).filter((e,t,n)=>e&&n.indexOf(e)===t);return t.length?`## What's Changed\n\n${t.join(`
|
|
7
|
+
|
|
8
|
+
`)}`:``}function Mr(e,t=new Date().toISOString()){let n=e.filter(e=>e.state===`error`),r=e.filter(e=>e.state===`available`),i=e.some(e=>e.state===`checking`),a=e.filter(e=>e.state===`downloading`),o=e.some(e=>e.state===`installed`),s=a[0]||r[0]||n[0]||e[0],c=jr(e),l=kr(e),u=l.reduce((e,t)=>e+t.size,0),d=l.reduce((e,t)=>t.state===`installed`?e+t.size:t.state===`downloading`?e+Math.min(t.size,Math.max(0,t.transferred||0)):e,0);return{state:a.length?`downloading`:i?`checking`:n.length?`error`:r.length?`available`:o?`installed`:e.length?`current`:`idle`,checkedAt:t,message:n.map(e=>`${e.component}: ${e.message}`).join(`
|
|
9
|
+
`),releaseUrl:s?.releaseUrl,canDownload:r.length>0,availableVersion:s?.availableVersion,notes:c,total:u,transferred:d,percent:u>0?Math.min(100,d/u*100):0}}async function Nr({refresh:e=!1,fetcher:t=fetch}={}){let n=await t(`/api/app-update${e?`?refresh=1`:``}`,{cache:`no-store`}),r=await n.json().catch(()=>null);if(!n.ok){let e=r&&`error`in r&&typeof r.error==`string`?r.error.trim():``;throw Error(e||`更新检查失败:HTTP ${n.status}`)}return r}var Pr=Object.freeze({desktop:!1,packaged:!1,version:`0.6.7`,platform:`browser`,arch:``,releasesUrl:Ft});function Fr(){let e=window.pisperDesktop,t=e?void 0:window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke,[n,r]=(0,J.useState)(Pr),[i,a]=(0,J.useState)({state:`idle`,checkedAt:null}),[o,s]=(0,J.useState)([]),c=(0,J.useRef)(i),l=(0,J.useRef)(null),u=(0,J.useRef)(!1),d=(0,J.useRef)(!1),f=(0,J.useCallback)(e=>{c.current=e,a(e)},[]),p=(0,J.useCallback)(({refresh:n=!0}={})=>{if(l.current)return l.current;f({...c.current,state:`checking`,message:``});let r=(async()=>{try{if(u.current=!1,e?.checkForUpdates)try{let t=await e.checkForUpdates();if(t.state===`available`&&t.canDownload)return u.current=!0,f(t),t}catch{}if(e?.checkComponentUpdates){let t=await e.checkComponentUpdates();s(t);let n=Mr(t);return f(n),!t.some(e=>e.state===`error`||e.state===`available`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),n}if(d.current&&t){let e=await t(`mobile_check_app_update`,{refresh:n});return f(e),e}let r=await Nr({refresh:n});return f(r),r}catch(e){let t={state:`error`,message:e instanceof Error?e.message:String(e),checkedAt:new Date().toISOString()};return f(t),t}})();return l.current=r,r.finally(()=>{l.current===r&&(l.current=null)}),r},[f,e,t]);(0,J.useEffect)(()=>{let n=!0,i=()=>{},a=()=>{},o=()=>{i=Er(()=>{if(Tr(c.current.state))return p({refresh:!1})})};if(!e){let e=()=>{n&&p({refresh:!1})};return t?(t(`mobile_app_info`).then(t=>{if(!n)return;if(!t.mobile){e();return}d.current=!0,r(t),s([]),t.update&&f(t.update),p({refresh:!1}),o();let i=()=>{document.visibilityState===`visible`&&Tr(c.current.state)&&p({refresh:!1})};document.addEventListener(`visibilitychange`,i),a=()=>document.removeEventListener(`visibilitychange`,i)}).catch(e),()=>{n=!1,i(),a()}):(e(),()=>{n=!1})}return e.getAppInfo().then(t=>{n&&(r({...t,hostVersion:t.version}),e.componentUpdateStatus?.().then(e=>{n&&(s(e),f(Mr(e)))}).catch(()=>{}),t.packaged&&o())}).catch(()=>{}),()=>{n=!1,i()}},[f,e,p,t]);let m=(0,J.useCallback)(async()=>{if(u.current&&e?.downloadUpdate){f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=e.onUpdateStatus?.(f);try{let t=await e.downloadUpdate();f(t),t.state===`downloaded`&&t.canInstall&&await e.installUpdate?.()}finally{t?.()}return[]}if(!e?.installComponentUpdates)return[];f({...c.current,state:`downloading`,message:``,transferred:0,percent:0});let t=!1,n=!1,r=async()=>{if(!(n||t||!e.componentUpdateStatus)){t=!0;try{let t=await e.componentUpdateStatus();if(n)return;s(t);let r=Mr(t);r.state!==`available`&&f(r)}catch{}finally{t=!1}}},i=window.setInterval(()=>void r(),250);try{let t=await e.installComponentUpdates();return n=!0,s(t),f(Mr(t)),!t.some(e=>e.state===`error`)&&t.some(e=>e.restartRequired)&&await e.restartForComponentUpdate?.(),t}finally{n=!0,window.clearInterval(i)}},[f,e]),h=(0,J.useCallback)(async()=>{if(e)return e.openReleases();let r=i.releaseUrl||n.releasesUrl||`https://github.com/ling-kong-ran/pisper/releases`;return d.current&&t?t(`mobile_open_app_update`,{url:r}):(window.open(r,`_blank`,`noopener,noreferrer`),!0)},[e,n.releasesUrl,t,i.releaseUrl]),g=(0,J.useCallback)(()=>e?.openUpdateLog?.(),[e]),_=(0,J.useCallback)(()=>d.current&&t&&i.downloadUrl?t(`mobile_open_app_update`,{url:i.downloadUrl}):h(),[t,h,i.downloadUrl]),v=(0,J.useCallback)(()=>_(),[_]);return{info:(0,J.useMemo)(()=>({...n,version:n.desktop?Or(n.hostVersion||n.version,o):n.version}),[o,n]),status:i,components:o,check:p,installComponents:m,download:_,install:v,openReleases:h,openUpdateLog:g}}function Ir(e){return!!e.providers?.some(e=>e.configured&&e.models?.some(e=>e.kind===`chat`))}function Lr(e,t){return!t&&!Ir(e)}function Rr(){try{return JSON.parse(p.getItem(j.terminalPanel)||`{}`)}catch{return{}}}var zr=()=>i(()=>import(`./MobileNavigation-IXJN0OuM.js`),__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])),Br=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsBack}))),Vr=(0,J.lazy)(()=>zr().then(e=>({default:e.MobileSettingsList}))),Hr=(0,J.lazy)(()=>i(()=>import(`./DesktopWindowControls-DAuHMZFO.js`).then(e=>({default:e.DesktopWindowControls})),__vite__mapDeps([23,1,2,3,4,5,6,7,8,9,24,15,25,26]))),Ur=(0,J.lazy)(()=>i(()=>import(`./FloatingWidgets-BQXBxVDd.js`).then(e=>({default:e.FloatingWidgets})),__vite__mapDeps([27,1,5,2,6,7,28,29,4,8,3,9,30,31,10,11,12,13,32,33,34,35,36,37]))),Wr=(0,J.lazy)(async()=>{let[{CommandPalette:e},{getNavigation:t}]=await Promise.all([i(()=>import(`./AppOverlays-BV_gIt77.js`),__vite__mapDeps([38,1,2,3,4,5,6,7,8,9,30,39,40,11,12,13,10,15,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,26,56,57,58,59,60,61])),i(()=>import(`./palette-navigation-Bni8Mp34.js`),__vite__mapDeps([62,13,63,15,1,2,64,65,66,67,43,68,69,70,71,72,73,74]))]);function n(n){let{t:r}=A(),i=Te(e=>e.capabilities),a=(0,J.useMemo)(()=>t(r,i),[i,r]);return(0,X.jsx)(e,{...n,navigation:a})}return{default:n}}),Gr=(0,J.lazy)(()=>i(()=>import(`./AppDialog-1E6olv_T.js`).then(e=>({default:e.AppDialog})),__vite__mapDeps([75,1,2,3,4,5,6,7,8,9,26,15,76,58,57,48,49,60,55,56,59,77]))),Kr=(0,J.lazy)(()=>i(()=>import(`./WebDesktopPet-D6bkGOwL.js`).then(e=>({default:e.WebDesktopPet})),__vite__mapDeps([78,1,6,5,2,7,3,4,8,9,11,12]))),qr=(0,J.lazy)(()=>i(()=>import(`./public-components-CeIuV0FY.js`).then(e=>({default:e.ConfigSearchBox})),__vite__mapDeps([79,1,2,3,4,5,6,7,8,9,10,11,12,13,80,15,81,82,45,71,26,48,49,60,57,50,83,52,55,56,58,59,77,84]))),Jr=(0,J.lazy)(()=>i(()=>import(`./public-components-CeIuV0FY.js`).then(e=>({default:e.ModelOnboardingDialog})),__vite__mapDeps([79,1,2,3,4,5,6,7,8,9,10,11,12,13,80,15,81,82,45,71,26,48,49,60,57,50,83,52,55,56,58,59,77,84]))),Yr=()=>Promise.all([i(()=>import(`./sidebar-BIagLnrN.js`),__vite__mapDeps([85,1,5,2,28,3,4,6,7,8,9,15,86,16,87,88,39,30,40,11,12,33,89,90,10,13,91,31,53,92,51,93,94,95,57,58,96,59,97,98,99,48,49,100,101,102,103,104,105,106,107,70,52,108,109,110,111,112,113])),D()]).then(([e])=>e),Xr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarSessions}))),Zr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarRailCounts}))),Qr=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarCommands}))),$r=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarBoardFilters}))),ei=(0,J.lazy)(()=>Yr().then(e=>({default:e.SidebarFleetLine}))),ti=(0,J.lazy)(()=>Promise.all([i(()=>import(`./PhoneTopBar-CR1m9vf3.js`),__vite__mapDeps([114,2,1,3,4,5,6,7,8,9,115,15,48,49,108,109,100,39,30,40,11,12,33,51,53,91,31,10,13,92,93,90,101,116,117,54,110,45,118])),D()]).then(([e])=>({default:e.PhoneTopBar}))),ni=(0,J.lazy)(()=>i(()=>import(`./PhoneDrawer-Cp6X4_ei.js`).then(e=>({default:e.PhoneDrawer})),__vite__mapDeps([119,2,1,3,4,5,6,7,8,9,67,15,45,72,118,48,49,120,26,56,57,58,59,60,108]))),ri=(0,J.lazy)(()=>i(()=>import(`./SidebarUpdateStatus-YxE_hT2l.js`),__vite__mapDeps([121,2,1,3,4,5,6,7,8,9,81,15,122,22,123]))),ii=(0,J.lazy)(()=>i(()=>import(`./SettingsSidebar-CP1qDAcx.js`).then(e=>({default:e.SettingsSidebar})),__vite__mapDeps([124,1,2,3,4,5,6,7,8,9,10,11,12,13,125,15,80,17,18,19,20,21,22,48,49,50,52,126]))),ai=(0,J.lazy)(async()=>{let[{DispatchOverlay:e}]=await Promise.all([i(()=>import(`./DispatchOverlay-CEbzXIct.js`),__vite__mapDeps([127,2,1,3,4,5,6,7,8,9,128,30,39,40,11,12,10,13,15,80,129,86,89,90,91,31,33,53,92,51,93,130,131,132,133,95,16,134,135,45,57,58,56,59,136,97,98,48,49,55,26,60,137,96,120,54,138,77,139,140,141,94,99,52,101,142,143,144,14,145,146,147,148,111,149,102,20,61])),D()]);return{default:e}}),oi=(0,J.lazy)(async()=>{let[{ShortcutHelpDialog:e}]=await Promise.all([i(()=>import(`./ShortcutHelpDialog-C5f_x4XG.js`),__vite__mapDeps([150,1,2,3,4,5,6,7,8,9,72,15,60,49,57,48,52,55,26,56,58,59,151,50])),D()]);return{default:e}}),si=(0,J.lazy)(()=>i(()=>import(`./PageHeader-6KRCT1j1.js`).then(e=>({default:e.PageHeader})),__vite__mapDeps([152,2,1,3,4,5,6,7,8,9,14,15,46,153,48,49,60,57,52]))),ci=(0,J.lazy)(()=>i(()=>import(`./TerminalPanel-598uzwoB.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([154,1,2,3,4,5,6,7,8,9,15,24,44,46,26,60,49,57,48,155,156,25,157,158,36,159,95,86,160,134,58,161,96,59,97,98,162]))),li=(0,J.lazy)(()=>i(()=>import(`./MobileViewportStabilizer-OtwVmIPm.js`).then(e=>({default:e.MobileViewportStabilizer})),__vite__mapDeps([163,1,2])));function ui(e,t){return String(e||``).replace(/\{\{\s*([\w.]+)\s*\}\}/g,(e,n)=>{let r=n.split(`.`).reduce((e,t)=>{if(!(!e||typeof e!=`object`))return e[t]},t);return r==null?`{{${n}}}`:String(r)})}function di(e){try{return decodeURIComponent(e)}catch{return``}}function fi(e,t){let n=window.__TAURI__?.core?.invoke??window.__TAURI_INTERNALS__?.invoke;return n?n(e,t):Promise.reject(Error(`native bridge unavailable`))}function pi({routerState:e}){let{t}=A();(0,J.useEffect)(()=>ve(`react-app-mounted`),[]);let n=o(),r=f(),s=(0,J.useCallback)(()=>e?.()??{location:n,navigation:{state:`idle`}},[n,e]),c=Te(e=>e.capabilities),l=Te(e=>e.loaded),u=Te(e=>e.load),d=(0,J.useMemo)(()=>Bt(t),[t]),m=C(n.pathname)||`board`,h=!!x(n.pathname),g=m===`config`?di(n.pathname.split(`/`)[2]||`models`):`models`,_=Fe.has(g)&&we(c,g)?g:`models`,v=je(m,_),b=(0,J.useRef)(m),[te,E]=(0,J.useState)(``),[ae,oe]=(0,J.useState)(()=>p.getItem(j.activeSession)||``),se=y(n.pathname,ae),ce=Oe(e=>e.client===`mobile-app`),D=Oe(e=>e.loaded),le=Ee(),O=ce||le,ue=De()&&ce,k=O&&!window.pisperDesktop&&!ue,de=Wn(m,v),_e=de===`board`?`board`:de===`more`?`features`:de===`settings`?`settings`:null,ye=B(e=>e.toggleCollapsed);(0,J.useEffect)(()=>{document.documentElement.toggleAttribute(`data-phone-shell`,k)},[k]),(0,J.useEffect)(()=>{B.getState().setDrawerOpen(!1)},[n.pathname,k]);let[be,M]=(0,J.useState)(!1),[ke,Ae]=(0,J.useState)(!1),[Ie,Le]=(0,J.useState)(!1),Re=G(e=>e.theme),ze=G(e=>e.cycleTheme),Be=G(e=>e.density),Ve=G(e=>e.accent),He=G(e=>e.customAccent),Ge=G(e=>e.fontScale),qe=G(e=>e.uiFontSize),Je=G(e=>e.codeFontSize),N=G(e=>e.radius),Ye=G(e=>e.motion),[Xe,P]=(0,J.useState)([]),[Ze,Qe]=(0,J.useState)(!1),F=Ze?void 0:Xe[0],$e=(0,J.useRef)(F);$e.current=F;let[et,tt]=(0,J.useState)(!1),[nt,rt]=(0,J.useState)(null),{data:it,isPending:I,isSuccess:at}=fe(ge(`config`)),{data:ot}=fe(ge(`notification-settings`)),[st,pt]=(0,J.useState)(!1),[L,mt]=(0,J.useState)({browser:{enabled:!1},connections:{},scopes:[],templates:[]}),[ht,R]=(0,J.useState)(null),z=(0,J.useMemo)(()=>({terminal:t(`terminal:terminalPanel.terminal`),resizeTerminal:t(`terminal:terminalPanel.resizeTerminal`),hideTerminal:t(`terminal:terminalPanel.hideTerminal`),showTerminal:t(`terminal:terminalPanel.showTerminal`),newTerminal:t(`terminal:terminalPanel.newTerminal`),closeTerminal:t(`terminal:terminalPanel.closeTerminal`),maximizeTerminal:t(`terminal:terminalPanel.maximizeTerminal`),openTerminal:t(`terminal:terminalPanel.openTerminal`),usesActiveSessionWorkspace:t(`terminal:terminalPanel.usesActiveSessionWorkspace`),orphanedTerminal:t(`terminal:terminalPanel.orphanedTerminal`),starting:t(`terminal:terminalPanel.starting`),processExited:e=>t(`terminal:terminalPanel.processExited`,{code:e??`-`})}),[t]),[vt,yt]=(0,J.useState)(()=>!!Rr().open),[bt,xt]=(0,J.useState)(()=>Math.max(180,Math.min(640,Number(Rr().height)||300)));(0,J.useEffect)(()=>{let e=()=>{window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&yt(e=>!e)};return window.addEventListener(`pisper:toggle-terminal`,e),()=>window.removeEventListener(`pisper:toggle-terminal`,e)},[c]);let St=(0,J.useRef)(``),[V]=(0,J.useState)(Hn),Ct=(0,J.useRef)(null),wt=(0,J.useRef)(null),Tt=(0,J.useRef)(0),H=xr(),U=Fr();(0,J.useEffect)(()=>{lr({accent:Ve,density:Be,fontScale:Ge,motion:Ye,radius:N,customAccent:He,uiFontSize:qe,codeFontSize:Je})},[Ve,Be,Ge,Ye,N,He,qe,Je]),(0,J.useEffect)(()=>{p.setItem(j.terminalPanel,JSON.stringify({open:vt,height:bt}))},[bt,vt]),(0,J.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>{let t=cr(Re,e.matches);document.documentElement.dataset.theme=t?`dark`:`light`,document.documentElement.classList.toggle(`dark`,t)};if(t(),Re===`system`)return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t);if(Re===`scheduled`){let e=window.setInterval(t,6e4);return()=>window.clearInterval(e)}},[Re]);let W=(0,J.useCallback)((e,t=`success`,n)=>{Tt.current+=1;let r={id:Tt.current,message:e,tone:t,action:n?.action};P(e=>[...e,r])},[]);(0,J.useEffect)(()=>{let e=e=>{let t=$e.current;if(e.key!==`Escape`||!e.isTrusted||!t||!document.querySelector(`[data-radix-popper-content-wrapper], [role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"]`))return;e.stopImmediatePropagation(),e.preventDefault();let n=document.activeElement instanceof HTMLElement?document.activeElement:document.body;Qe(!0),P(e=>e.filter(e=>e.id!==t.id)),requestAnimationFrame(()=>requestAnimationFrame(()=>{n.dispatchEvent(new KeyboardEvent(`keydown`,{key:`Escape`,code:`Escape`,bubbles:!0,cancelable:!0})),Qe(!1)}))};return document.addEventListener(`keydown`,e,{capture:!0}),()=>document.removeEventListener(`keydown`,e,{capture:!0})},[]),(0,J.useEffect)(()=>{let e=e=>{let t=e.detail?.id;oe(t??p.getItem(j.activeSession)??``)};window.addEventListener(dt,e);let t=e=>{let t=e.detail;t?.message&&W(t.message,t.tone===`error`?`error`:`info`)};return window.addEventListener(Et,t),Oe.getState().load({refresh:!1}).then(()=>ve(`client-info-loaded`)),u({refresh:!1}).then(()=>ve(`capabilities-loaded`)),()=>{window.removeEventListener(dt,e),window.removeEventListener(Et,t)}},[u,W]);let At=(0,J.useRef)(!1);(0,J.useEffect)(()=>{!D||!ce||At.current||(At.current=!0,(async()=>{await fi(`mobile_ensure_local_network_permission`).catch(()=>void 0)})())},[D,ce]);let Mt=(0,J.useCallback)((e,t,{force:n=!1}={})=>{if(L.browser?.enabled&&!(!n&&document.visibilityState===`visible`&&document.hasFocus())){if(window.pisperDesktop?.showNotification){window.pisperDesktop.showNotification({title:e,body:t}).catch(()=>{});return}if(It()){jt(e,t).catch(()=>{});return}Rt({title:e,body:t,tag:`pisper-${e}`,url:window.location.href}).catch(()=>{})}},[L.browser?.enabled]),Nt=(0,J.useCallback)((e,t,n)=>{let r=L.templates?.find(t=>t.id===e),i=r?.channels?.browser?.content;!r?.enabled||r.channels?.browser?.enabled===!1||!i||Mt(r.name,ui(i,t||{}),n)},[L.templates,Mt]),Pt=(0,J.useCallback)(e=>V.register(e),[V]),Ft=(0,J.useCallback)(()=>{V.invoke()},[V]),Lt=(0,J.useCallback)(e=>(R(e),()=>R(t=>t===e?null:t)),[]),K=(0,J.useCallback)((e,t)=>{if(!(!w.has(e)||!Se(c,e))){if(e===`chat`){if(!h){let e=lt();r(e?.type===`create`?S():e?.type===`open`?S(e.sessionId):`/`,t)}}else r(ie(e),t);E(``)}},[c,r,h]),q=(0,J.useCallback)((e,t=``)=>{e&&(ft(e,`open`,t),h||r(S(e)),E(``))},[r,h]),Vt=(0,J.useRef)(null),Y=(0,J.useCallback)(e=>{if(Gn(s())!==n.pathname){Vt.current=e;return}(m===`board`||m===`session`)&>(e)||Ae(!0)},[n.pathname,m,s]);(0,J.useEffect)(()=>{let e=Vt.current;!e||Gn(s())!==n.pathname||(Vt.current=null,Y(e))},[n,s,Y]);let Ht=(0,J.useCallback)((e,{open:n})=>{Ae(!1),n?q(e):W(t(`board:launch.dispatched`))},[W,q,t]),Ut=(0,J.useCallback)(e=>W(e,`error`,{action:{label:t(`board:dispatch.reopen`),onAction:()=>Ae(!0)}}),[W,t]);(0,J.useEffect)(()=>{if(l&&!Se(c,m)){r(`/`,{replace:!0});return}m===`config`&&g!==_&&r(`/config/${_}`,{replace:!0})},[c,l,_,m,g,r]);let Z=(0,J.useCallback)((e,t)=>{let n=Fe.has(e)&&we(c,e)?e:`models`;r(n===`interface`&&t===`widgets`?T.components:`/config/${n}`),E(``)},[c,r]),Q=(0,J.useCallback)(e=>{if(e===`session`){let e=Kn(s());e&&r(e.to,{replace:e.replace,state:e.state}),E(``)}else e===`settings`?k?r(ee):Z(`models`):K(Un[e])},[K,k,s,r,Z]),Wt=(0,J.useCallback)(()=>x(Gn(s())),[s]),Gt=(0,J.useCallback)(e=>{if(!e)return;let t=s(),n=Gn(t);if(x(n)===e)return;if(E(``),C(n)!==`session`){r(S(e));return}let i=n===`/`?re:t.location.state;r(S(e),{replace:!0,state:i})},[s,r]),Kt=(0,J.useCallback)(e=>{Wt()===e&&r(`/`,{replace:!0})},[Wt,r]),qt=(0,J.useCallback)(()=>{try{p.setItem(j.modelOnboardingDismissed,`1`)}catch{}tt(!1)},[]),Jt=(0,J.useCallback)(()=>{qt(),V.clear(),V.invoke(),Z(`models`)},[qt,V,Z]),Yt=(0,J.useCallback)(()=>{qt(),r(`/config/models?import=1`),E(``)},[qt,r]),Xt=(0,J.useCallback)(()=>Z(`updates`),[Z]),Zt=(0,J.useCallback)(()=>Z(`notifications`),[Z]),Qt=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!v){Qt.current=null;return}if(Qt.current!==null)return;let e=window.history.state?.idx;Qt.current=typeof e==`number`?e:0},[n.key,v]);let $t=(0,J.useCallback)(()=>{let e=Qt.current,t=window.history.state?.idx;r(e!==null&&e>0&&typeof t==`number`&&t>=e?-(t-e+1):`/`)},[r]),en=(0,J.useCallback)(async e=>e&&(await he(`sessions`)).sessions?.find(t=>t.id===e)?.cwd||``,[]),tn=(0,J.useCallback)(e=>{let t=p.getItem(j.activeSession)||``;rt({asset:e,targetSessionId:t}),t?q(t):r(S())},[q,r]);(0,J.useEffect)(()=>{let e=()=>{!H.dialog&&!et&&M(!0)},t=e=>{if(!(e.defaultPrevented||e.isComposing||e.keyCode===229)&&e.key===`Escape`&&!H.dialog){be&&(M(!1),e.preventDefault());return}};return window.addEventListener(`keydown`,t),window.addEventListener(ut,e),()=>{window.removeEventListener(`keydown`,t),window.removeEventListener(ut,e)}},[H.dialog,et,be]);let nn=(0,J.useRef)(!1);(0,J.useEffect)(()=>{if(I||nn.current||(nn.current=!0,pt(!0),!at||!it))return;ve(`config-loaded`);let e=!1;try{e=p.getItem(j.modelOnboardingDismissed)===`1`}catch{}b.current!==`config`&&Lr(it,e)&&tt(!0)},[it,I,at]),(0,J.useEffect)(()=>{st&&l&&(m===`board`||m===`session`)&&ve(`chat-shell-ready`)},[l,m,st]);let rn=(0,J.useRef)(m);(0,J.useLayoutEffect)(()=>{rn.current===`config`&&m!==`config`&&(me(`config`),me(`notification-settings`)),rn.current=m},[m]),(0,J.useEffect)(()=>{ot&&mt(ot)},[ot]),(0,J.useEffect)(()=>{let e=!0,t=async()=>{try{let t=St.current,n=await pe.fetchQuery({queryKey:[`browser-notification-events`,t],queryFn:()=>xe(`/api/settings/notifications/browser/events?after=${encodeURIComponent(t)}`),staleTime:0,retry:!1});if(!e)return;for(let e of n.events||[])Mt(e.title,e.body,{force:!0});St.current=n.latestId||St.current}catch{}};t();let n=window.setInterval(t,3e3);return()=>{e=!1,window.clearInterval(n)}},[Mt]);let an=m===`chat`?[t(`common:app.sessions`),O?``:t(`common:app.dragTabsOrSplitChatsInAnyDirectionFromTheSessionList`)]:m===`config`?[v&&Me(_)?Pe(t,_):Ne(t,_),``]:m===`workflowCreate`?zt(t,ht?ht.editing:di(n.pathname.split(`/`)[2]||`new`)!==`new`):d[m]||[t(`common:app.sessions`),``],on=(0,J.useCallback)(e=>{pe.cancelQueries({queryKey:[`notification-settings`],exact:!0}),pe.setQueryData([`notification-settings`],e),mt(e)},[]),sn=de===`more`&&m!==`more`,cn=(0,J.useCallback)(()=>r(T.more),[r]),ln={activeSessionId:se,navigate:K,notify:W,browserNotify:Nt,registerPrimaryAction:Pt,invokePrimaryAction:Ft,pendingAsset:nt,onAssetConsumed:()=>rt(null),onUseAsset:tn,requestText:H.prompt,requestConfirm:H.confirm,openNotificationSettings:Zt,configSection:_,setConfigSection:Z,setNotificationSettings:on,appUpdate:U,registerWorkflowActions:Lt,startNewTask:()=>Y(`board`),onBackToFeatures:sn?cn:void 0},un=(0,J.useCallback)(()=>{let e=window.history.state?.idx,t=Jn(m,n.pathname,v,{phone:k,homeEntry:ne(n.state),canGoBack:typeof e==`number`&&e>0});return t===-1?r(-1):t&&r(t),t!==null},[n.pathname,n.state,m,k,r,v]),dn=(0,J.useCallback)(()=>{if(m===`more`)document.getElementById(Ue)?.focus();else if(We.has(m))document.getElementById(Ke)?.focus();else if(m===`board`){let e=document.getElementById(_t);if(e)e.focus();else if(!k&&B.getState().collapsed){B.getState().setPeeking(!0);let e=0,t=()=>{let n=document.getElementById(_t);n?n.focus():(e+=1)<20&&requestAnimationFrame(t)};requestAnimationFrame(t)}}else Ct.current?.focus()},[m,k]),fn=k&&m!==`session`,pn=k&&v&&/^\/config\/?$/.test(n.pathname),mn=![`board`,`session`,`more`,`chat`,`workflowCreate`,`config`].includes(m)&&!We.has(m),hn=v&&!k;if(!st||!l)return(0,X.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,children:[(0,X.jsx)(kt,{size:30,className:`startup-logo`}),(0,X.jsx)(`strong`,{className:`font-medium`,children:t(`common:app.wakingPisper`)})]});let gn=e=>(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(qr,{query:te,onQueryChange:E,onSelect:Z,inputRef:Ct,placement:e})});return(0,X.jsx)(hr,{duration:2800,swipeDirection:`right`,children:(0,X.jsx)(Ot,{bridge:window.pisperDesktop,children:(0,X.jsxs)(`div`,{ref:wt,className:`app-shell flex w-full h-full min-h-0 flex-col overflow-hidden bg-chrome text-content [&[data-phone-shell]]:bg-panel [&[data-phone-shell][data-shell-canvas]]:bg-background [&[data-phone-shell][data-shell-chrome]]:bg-chrome pt-[var(--pisper-safe-area-top)] pr-[var(--pisper-safe-area-right)] pb-[var(--pisper-safe-area-bottom)] pl-[var(--pisper-safe-area-left)] [&[data-mobile-app]]:h-[100dvh] [&[data-mobile-app]]:min-h-0 [&[data-mobile-app]]:overflow-hidden [&[data-mobile-keyboard='open']]:pb-0 [&[data-phone-shell]]:pb-0`,"data-mobile-app":O||void 0,"data-phone-shell":k||void 0,"data-shell-canvas":m===`board`||m===`more`||void 0,"data-shell-chrome":m===`session`||void 0,"data-custom-titlebar":window.pisperDesktop?.customTitlebar||void 0,children:[window.pisperDesktop?.customTitlebar&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Hr,{})}),(0,X.jsx)(dr,{}),O&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(li,{enabled:D&&st,shellRef:wt})}),Ce(c,`desktopPet`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Kr,{})}),(0,X.jsx)(Vn,{onRouteBack:O?un:void 0}),(0,X.jsx)(fr,{blocked:!!(H.dialog||et||be||ke),onCommandPalette:()=>M(!0),onPrimary:()=>Y(`shortcut`),onSearch:dn,onToggleTerminal:window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)?()=>yt(e=>!e):void 0,onSettings:()=>Q(`settings`),onOpenSession:()=>Q(`session`),onOpenBoard:()=>Q(`board`),onOpenComponents:()=>K(`components`),onOpenMore:()=>Q(`more`),onToggleSidebar:k?void 0:ye,onAgentPanel:()=>Dt({kind:`focus-list`}),onPreviousAgent:()=>Dt({kind:`adjacent`,direction:-1}),onNextAgent:()=>Dt({kind:`adjacent`,direction:1}),onJumpToAttention:()=>Dt({kind:`focus-attention`}),onSessionTree:m===`session`?()=>ct(`tree`):void 0,onSideChat:m===`session`?()=>ct(`side-chat`):void 0,onCycleFocusRegion:()=>void i(()=>import(`./focus-regions-B9MkPSKC.js`).then(e=>e.cycleFocusRegion()),[]),onShortcutHelp:()=>Le(!0)}),(0,X.jsxs)(`div`,{className:`app-body flex min-h-0 flex-1 overflow-hidden`,"data-mobile-app":O||void 0,children:[!k&&(0,X.jsx)(Qn,{active:_e,onNewTask:()=>Y(`sidebar`),onSearch:()=>M(!0),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:m===`board`?(0,X.jsx)($r,{notify:W,requestConfirm:H.confirm,requestText:H.prompt,onNewTask:()=>Y(`sidebar`),onOpenHistory:()=>K(`chatHistory`)}):(0,X.jsx)(Xr,{currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),takeover:hn?(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`nav`,{"aria-busy":`true`,"aria-label":t(`config:settingsShell.settingsNavigation`),className:`flex-1`}),children:(0,X.jsx)(ii,{configSection:_,onSelectSection:Z,onBack:$t,onOpenFeatures:()=>Q(`more`),search:gn(`sidebar`),version:U.info?.version,footer:(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ei,{onOpenBoard:()=>Q(`board`)})})})}):void 0,railCounts:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{collapsed:!0}),children:(0,X.jsx)(Zr,{onOpenBoard:()=>Q(`board`)})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-8 [&>button]:min-h-0 pointer-coarse:[&>button]:size-11`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Qr,{resolveCurrentId:Wt,renderedSessionId:m===`session`?x(n.pathname):null,onOpenSession:Gt,onWaiting:({title:e,reason:t})=>Nt(`chat.waiting`,{chat:{title:e,tool:t,reason:t}})})}),(0,X.jsxs)(`main`,{"data-focus-region":`main`,className:`main-surface relative flex min-w-0 flex-1 flex-col overflow-hidden bg-panel`,children:[fn&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`div`,{className:`h-14 flex-none bg-panel`,"aria-hidden":`true`}),children:(0,X.jsx)(ti,{title:pn?t(`navigation:navigation.settings`):an[0],onNewTask:()=>Y(`topbar`),onSearch:m===`board`?()=>M(!0):void 0})}),k&&v&&!pn&&(0,X.jsxs)(J.Suspense,{fallback:null,children:[(0,X.jsx)(Br,{onBack:()=>r(`/config`)}),(0,X.jsx)(`div`,{"data-mobile-settings-search":!0,className:`flex-none px-4 pb-1`,children:gn()})]}),mn&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(si,{meta:an,page:m,desktopPlatform:window.pisperDesktop?.platform||``,terminalOpen:vt,onToggleTerminal:()=>yt(e=>!e),onBackToMore:sn?cn:void 0,phoneShell:k})}),(0,X.jsx)(`div`,{className:`page-content flex-1 min-h-0 overflow-auto ${m===`session`||m===`chat`?`page-chat flex overflow-hidden p-0`:w.has(m)?`page-${m} overflow-hidden p-0`:`page-${m} px-6 pt-5 pb-5 max-[650px]:px-3 max-[650px]:pt-0`}`,children:pn?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Vr,{onNavigate:Z,onOpenFeatures:()=>Q(`more`)})}):(0,X.jsx)(a,{context:ln})},m),window.pisperDesktop?.terminalProfiles&&Ce(c,`terminal`)&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ci,{open:vt,height:bt,labels:z,activeSessionId:se,resolveSessionCwd:en,onOpenChange:yt,onHeightChange:xt})})]})]}),k&&(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(ni,{active:_e,onSearch:()=>M(!0),onNewTask:()=>Y(`sidebar`),onOpenBoard:()=>Q(`board`),onOpenFeatures:()=>Q(`more`),onOpenSettings:()=>Q(`settings`),content:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(rr,{}),children:(0,X.jsx)(Xr,{drawer:!0,currentId:x(n.pathname),notify:W,requestText:H.prompt,onOpenSession:Gt,onOpenBoard:()=>Q(`board`),onOpenHistory:()=>K(`chatHistory`),onArchived:Kt})}),update:U.status&&[`available`,`downloading`,`downloaded`].includes(U.status.state)?(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(`div`,{className:`flex-none [&>button]:size-11 [&>button]:min-h-0`,children:(0,X.jsx)(ri,{update:U,collapsed:!0,onOpen:Xt})})}):void 0})}),(0,X.jsx)(J.Suspense,{fallback:null,children:(0,X.jsx)(Ur,{activeSessionId:se,notify:W})}),F&&(0,X.jsx)(br,{open:!0,message:F.message,tone:F.tone,action:F.action,duration:F.action?1e4:void 0,closeLabel:t(`common:ui.closeDialog`),onOpenChange:e=>!e&&P(e=>e.filter(e=>e.id!==F.id))},F.id),(0,X.jsx)(gr,{hotkey:[],label:t(`common:ui.notifications`)}),H.dialog&&(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(`span`,{role:`status`,className:`sr-only`,children:t(`common:pageTemplate.loading`)}),children:(0,X.jsx)(Gr,{dialog:H.dialog,onClose:H.close,onFinish:H.finish})}),(0,X.jsx)(J.Suspense,{fallback:null,children:et&&(0,X.jsx)(Jr,{open:!0,onDismiss:qt,onOpenImport:Yt,onOpenSettings:Jt})}),(0,X.jsxs)(J.Suspense,{fallback:null,children:[be&&(0,X.jsx)(Wr,{onClose:()=>M(!1),onNavigate:K,onOpenSession:async(e,n,r)=>{try{if(n&&!r){let{switchToTurnOnOtherBranch:r}=await i(async()=>{let{switchToTurnOnOtherBranch:e}=await import(`./session-tree-actions-7q68B3e-.js`);return{switchToTurnOnOtherBranch:e}},__vite__mapDeps([164,51,6,5,1,2,7,8,53,39,30,40,11,4,12,165]));await r({sessionId:e,entryId:n,confirm:H.confirm,open:q,notify:W,t});return}q(e,n)}catch(e){throw W(t(`navigation:appOverlays.openLabeledTurnFailed`),`error`),e}},onNewChat:()=>Y(`palette`),onToggleTheme:ze}),Ie&&(0,X.jsx)(oi,{open:!0,onOpenChange:Le,onCustomize:()=>r(`/config/shortcuts`)})]}),(0,X.jsx)(J.Suspense,{fallback:null,children:ke&&(0,X.jsx)(ai,{open:!0,phone:k,onOpenChange:Ae,onDispatched:Ht,onDetachedFailure:Ut,onConfigureModels:()=>r(`/config/models`)})})]})})})}function mi({children:e}){let{t}=A(),n=f(),r=o(),i=(0,J.useRef)(new Map),a=(0,J.useRef)(new Map),s=(0,J.useRef)(0),[c,l]=(0,J.useState)(0),[d,p]=(0,J.useState)(null),m=(0,J.useRef)(null),[h,g]=(0,J.useState)(!1),_=u(({currentLocation:e,nextLocation:t})=>Pt(e,t)&&Object.values(K(i.current.values())).some(Boolean)),v=(0,J.useRef)(_);v.current=_;let y=(0,J.useCallback)(e=>{m.current=e,p(e)},[]),b=(0,J.useCallback)(e=>{let t=i.current.get(e.id);i.current.set(e.id,e),(!t||t.dirty!==e.dirty||t.saving!==e.saving)&&l(e=>e+1)},[]),x=(0,J.useCallback)(e=>{i.current.delete(e)&&l(e=>e+1)},[]),S=(0,J.useCallback)(()=>{y(null),a.current.clear(),v.current.state===`blocked`&&v.current.reset()},[y]),ee=(0,J.useCallback)((e,t,r)=>{a.current.clear();let i=`navigation-${++s.current}`;r&&a.current.set(i,r),n(e,{...t,state:{...t?.state,[Lt]:i}})},[n]),C=(0,J.useCallback)((e,t)=>{let n=i.current.get(e);if(n?.saving){S(),g(!0);return}if(v.current.state===`blocked`&&v.current.reset(),a.current.clear(),!n?.dirty){y(null),t();return}g(!1),y({kind:`close`,id:e,close:t})},[S,y]);(0,J.useLayoutEffect)(()=>{let e=K(i.current.values());if(_.state===`blocked`)e.saving||!e.dirty?(S(),g(e.saving)):(g(!1),y({kind:`route`}));else if(m.current?.kind===`close`){let e=i.current.get(m.current.id);(!e||e.saving||!e.dirty)&&(y(null),g(!!e?.saving))}},[_,c,S,y]),(0,J.useLayoutEffect)(()=>{let e=r.state?.[Lt],t=typeof e==`string`?a.current.get(e):void 0;t&&(a.current.delete(e),t())},[r]);let w=K(i.current.values());(0,J.useEffect)(()=>{if(!w.dirty&&!w.saving)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[w.dirty,w.saving]);let te=()=>{let e=m.current;if(!e)return;let t=e.kind===`close`?[i.current.get(e.id)].filter(e=>!!e):[...i.current.values()];if(t.some(e=>e.saving)){S(),g(!0);return}y(null);for(let e of t)e.dirty&&e.discard();e.kind===`close`?e.close():v.current.state===`blocked`&&v.current.proceed()},T=(0,J.useMemo)(()=>({update:b,remove:x,requestClose:C,navigate:ee}),[b,x,C,ee]);return(0,X.jsxs)(Mt.Provider,{value:T,children:[e,h&&(0,X.jsx)(`p`,{role:`status`,className:`fixed right-4 bottom-4 z-[300] rounded-lg border bg-popover p-3 text-sm text-popover-foreground shadow-md`,children:t(`common:unsaved.saving`)}),(0,X.jsx)(V,{open:!!d,onOpenChange:e=>{e||S()},children:(0,X.jsxs)(yt,{size:`compact`,surface:`confirmation`,showCloseButton:!1,className:`z-[400]`,overlayClassName:`z-[400]`,children:[(0,X.jsxs)(St,{children:[(0,X.jsx)(bt,{children:t(`common:unsaved.title`)}),(0,X.jsx)(vt,{children:t(`common:unsaved.description`)})]}),(0,X.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),te()},children:(0,X.jsxs)(xt,{children:[(0,X.jsx)(ot,{type:`button`,variant:`outline`,size:`dialogAction`,onClick:S,autoFocus:!0,children:t(`common:unsaved.keepEditing`)}),(0,X.jsx)(ot,{type:`submit`,variant:`destructive`,size:`dialogAction`,children:t(`common:unsaved.discard`)})]})})]})})]})}function hi(){let{t:e}=A();return(0,X.jsxs)(H,{children:[(0,X.jsx)(`span`,{className:`grid place-items-center`,children:(0,X.jsx)(at,{className:`size-6`})}),(0,X.jsx)(`h2`,{children:e(`navigation:pageLoader.lightingUpThisPage`)}),(0,X.jsx)(`p`,{children:e(`navigation:pageLoader.bringingTheNeededCapabilitiesIntoPlace`)})]})}async function gi(){window.__PISPER_MOBILE_APP__&&await be().catch(()=>void 0);let e=new URL(window.location.href);window.__PISPER_MOBILE_APP__&&e.protocol===`http:`&&e.hostname===`127.0.0.1`&&e.searchParams.set(`_pisper_recovery`,String(Date.now())),window.location.replace(e.href)}function _i(){let e=c(),t=s(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:`页面加载失败`;return(0,X.jsxs)(`main`,{className:`app-startup flex min-h-[100vh] w-full items-center justify-center gap-2.5 bg-chrome text-[13px] text-content-muted`,role:`alert`,children:[(0,X.jsx)(`strong`,{className:`font-medium`,children:t}),(0,X.jsx)(ot,{variant:`secondary`,type:`button`,onClick:()=>void gi(),children:`重新加载`})]})}function $(){return n()}async function vi(){let[{BoardPage:e}]=await Promise.all([i(()=>import(`./BoardPage-CL2e-8j4.js`),__vite__mapDeps([166,1,5,2,3,4,6,7,8,9,30,29,31,10,11,12,13,32,33,34,36,35,37,15,167,80,129,86,16,168,87,88,28,39,40,89,90,91,53,92,51,93,94,95,57,58,96,59,97,98,99,48,49,100,101,102,103,104,105,107,44,169,118,170,26,171,172,149,173,161,60,50,52,108,117,54,157,148,143,144,14,145,135,146,147,132,133,134,45,56,136,55,137,120,138,77,139,140,141,174,112])),D()]);function t(e){let{origin:t,pathname:n,search:r,hash:i}=window.location;return i.startsWith(`#/`)?`${t}${n}${r}#${S(e)}`:`${t}${S(e)}`}function n(){let n=$(),r=f();return(0,X.jsx)(e,{activeSessionId:n.activeSessionId,onOpenSession:e=>r(S(e)),onOpenHistory:()=>n.navigate(`chatHistory`),onConfigureModels:()=>r(`/config/models`),sessionHref:t,notify:n.notify,requestConfirm:n.requestConfirm,requestText:n.requestText,onNewTask:n.startNewTask})}return{Component:n}}async function yi(){let[{ChatPage:e},{SessionShell:t}]=await Promise.all([i(()=>import(`./ChatPage-b16p3qWl.js`),__vite__mapDeps([175,1,5,2,6,7,3,4,8,9,30,39,40,11,12,13,10,36,37,15,176,177,129,19,133,95,86,14,16,178,179,168,81,180,26,48,49,60,57,51,174,135,181,182,28,33,35,167,160,183,87,184,66,20,42,21,22,70,169,130,185,47,170,186,58,94,96,59,97,98,99,136,55,56,173,161,52,53,54,157,77,141,187,188,189,190,191,192,193,194,112,104,195,196,84,165,197,198,199,200,43,201,202,203,204,44,45,72,131,118,132,134,137,120,138,139,140,25,205,74,206,171,207,208,209,50,92,93,148,111,149,126,210,105,211,212,213,214,155,215,164,216,217])),i(()=>import(`./SessionShell-Dp94FUuk.js`),__vite__mapDeps([218,1,5,2,28,3,4,6,7,8,9,29,30,31,10,11,12,13,32,33,34,37,35,36,115,15,48,49,108,109,100,39,40,51,53,91,92,93,90,101,116,117,54,110,103])),D()]);function n(){return(0,X.jsx)(t,{context:$(),ChatPage:e})}return{Component:n}}async function bi(){yi().catch(()=>void 0);let[{SessionHome:e}]=await Promise.all([i(()=>import(`./SessionHome-Wu8JWsto.js`),__vite__mapDeps([219,1,5,2,28,3,4,6,7,8,9,35,36,37,11,12,128,30,39,40,10,13,15,80,129,86,89,90,91,31,33,53,92,51,93,130,131,132,133,95,16,134,135,45,57,58,56,59,136,97,98,48,49,55,26,60,137,96,120,54,138,77,139,140,141,94,99,52,101,142,143,144,14,145,146,147,148,111,149,102,115,108,109,100,116,117,110,43,157,103])),D()]);function t(){return(0,X.jsx)(e,{context:$()})}return{Component:t}}async function xi(){let{MorePage:e}=await i(async()=>{let{MorePage:e}=await import(`./MorePage-DtqJlHAA.js`);return{MorePage:e}},__vite__mapDeps([220,1,2,3,4,5,6,7,8,9,30,11,12,13,10,29,31,32,33,34,37,35,36,15,221,63,19,64,65,16,222,223,68,44,69,70,45,71,73,74,26,171,153,48,49,60,57,50,51,83,52]));function t(){let t=$(),n=f();return(0,X.jsx)(e,{onOpen:e=>{e.type===`page`?n(ie(e.id)):e.type===`config`?t.setConfigSection(e.id):n(`/tools/components/${encodeURIComponent(e.id)}`)}})}return{Component:t}}async function Si(){let{ChatHistoryPage:e}=await i(async()=>{let{ChatHistoryPage:e}=await import(`./ChatHistoryPage-DedOh6aO.js`);return{ChatHistoryPage:e}},__vite__mapDeps([224,1,6,5,2,7,3,4,8,9,30,39,40,11,12,35,36,37,15,177,87,203,107,22,118,170,171,153,94,95,16,57,58,96,59,97,98,99,48,49,60,51,52,92,54,157,148,225,86,14,45,205,26,50,112,212]));function t(){let t=$();return(0,X.jsx)(e,{navigate:t.navigate,onBack:t.onBackToFeatures,onNewTask:t.startNewTask,notify:t.notify,requestConfirm:t.requestConfirm,requestText:t.requestText})}return{Component:t}}async function Ci(){let{AssetsPage:e}=await i(async()=>{let{AssetsPage:e}=await import(`./AssetsPage-6HTR2IpQ.js`);return{AssetsPage:e}},__vite__mapDeps([226,1,2,4,5,6,7,8,3,9,30,227,11,12,15,81,122,181,200,202,44,22,170,205,26,153,94,95,16,57,58,96,59,97,98,99,48,49,60,52,54,157,55,56,77,225,35,36,37,86,14,45,50,228,229,76,230,189,190,191,192,193,183,194]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm,onUse:t.onUseAsset})}return{Component:t}}async function wi(){let[{ChannelsPage:e}]=await Promise.all([i(()=>import(`./ChannelsPage-CmczBcSA.js`),__vite__mapDeps([231,1,2,3,4,5,6,7,8,9,11,12,15,19,122,66,232,43,44,22,185,170,205,26,171,153,48,49,60,57,52,54,157,77,138,139,225,35,36,37,86,14,45,50,229,76,58,230,112,211,209,98,198,96,99,212,196,158,159,95,160,134,161,59,97])),oe()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ti(){let{SchedulesPage:e}=await i(async()=>{let{SchedulesPage:e}=await import(`./SchedulesPage-BRqBCtCf.js`);return{SchedulesPage:e}},__vite__mapDeps([233,1,2,3,4,5,6,7,8,9,11,12,18,15,19,65,178,66,232,204,44,170,205,153,209,57,58,98,48,49,60,52,54,157,55,26,56,59,77,139,210,95,187,225,35,36,37,86,14,45,50,229,76,230,112,105,211,198,96,99,212,196,158,159,160,134,161,97]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm,openNotificationSettings:t.openNotificationSettings})}return{Component:t}}async function Ei(){let[{ConfigPage:e},{ChatAppearancePage:t}]=await Promise.all([i(()=>import(`./ConfigPage-BYB0rL_V.js`),__vite__mapDeps([234,1,5,2,6,7,4,8,3,9,11,12,13,10,37,15,176,125,80,235,18,19,64,95,86,14,41,178,145,183,81,87,122,146,222,17,20,21,22,42,43,223,236,44,123,169,45,71,185,73,46,170,205,206,26,171,57,58,96,186,98,99,94,16,59,97,48,49,136,55,56,60,159,160,134,161,230,137,209,50,83,52,54,157,77,139,140,61,225,35,36,229,76,189,190,191,192,193,194,112,212,211,198,196,158,213,84,237,151,238])),i(()=>import(`./ChatAppearancePage-DMAnYGNb.js`),__vite__mapDeps([239,5,1,2,28,3,4,6,7,8,9])),D(),E()]);function n(){let n=$();return(0,X.jsx)(e,{notify:n.notify,registerPrimaryAction:n.registerPrimaryAction,invokePrimaryAction:n.invokePrimaryAction,section:n.configSection,onBackToFeatures:n.onBackToFeatures,onBrowserNotificationChange:n.setNotificationSettings,requestConfirm:n.requestConfirm,update:n.appUpdate,renderInterfaceSettings:e=>(0,X.jsx)(t,{appearance:e})})}return{Component:n}}async function Di(){let{PluginsPage:e}=await i(async()=>{let{PluginsPage:e}=await import(`./PluginsPage-CNddCaYt.js`);return{PluginsPage:e}},__vite__mapDeps([240,1,2,3,4,5,6,7,8,9,11,12,13,10,15,178,241,122,184,242,66,222,243,68,244,45,71,130,170,205,153,57,58,56,59,48,49,60,52,157,55,26,77,225,35,36,37,86,14,50,105,211,209,98,198,96,99,212,196,158,159,95,160,134,161,97,215]));function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Oi(){let{MemoryPage:e}=await i(async()=>{let{MemoryPage:e}=await import(`./MemoryPage-_mnn45jY.js`);return{MemoryPage:e}},__vite__mapDeps([245,1,2,3,4,5,6,7,8,9,11,12,15,95,242,20,203,44,22,73,170,26,153,173,57,58,161,59,97,98,48,49,60,52,157,77,139,225,35,36,37,86,14,45,205,50,229,76,230,211,209,198,96,99,212,196,158,159,160,134]));function t(){let t=$();return(0,X.jsx)(e,{onBack:t.onBackToFeatures,notify:t.notify,requestConfirm:t.requestConfirm})}return{Component:t}}async function ki(){let[{McpPage:e}]=await Promise.all([i(()=>import(`./McpPage-7NEAc3Rv.js`),__vite__mapDeps([246,1,2,3,4,5,6,7,8,9,30,40,227,11,12,95,15,183,82,44,22,70,71,170,206,26,153,209,57,58,98,48,49,60,52,54,157,55,56,59,139,187,225,35,36,37,86,14,45,205,50])),ce()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ai(){let{SkillsPage:e}=await i(async()=>{let{SkillsPage:e}=await import(`./SkillsPage-z6rTYJ8Z.js`);return{SkillsPage:e}},__vite__mapDeps([247,1,2,3,4,5,6,7,8,9,11,12,242,15,222,243,44,244,73,170,206,153,207,95,57,58,98,48,49,60,52,157,225,35,36,37,86,14,45,205,26,50,211,209,198,96,99,212,196]));function t(){let t=$();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,onBack:t.onBackToFeatures,requestText:t.requestText,requestConfirm:t.requestConfirm})}return{Component:t}}var ji=Object.freeze({componentFromList:!0});function Mi(e){return typeof e==`object`&&!!e&&e.componentFromList===!0}async function Ni(){let[{CustomUiPage:e}]=await Promise.all([i(()=>import(`./public-CgydVZuV.js`),__vite__mapDeps([248,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,37,15,221,235,63,95,86,14,16,145,183,81,87,201,44,70,45,249,130,73,170,26,207,57,58,98,48,49,94,96,59,97,99,76,159,160,134,161,209,172,149,60,50,52,120,56,108,117,91,39,40,53,92,51,93,100,90,101,54,116,109,110,157,142,55,77,139,61,212,250,208,230,173,112,251,252])),E()]);function t(){let t=$(),n=f(),i=o(),{componentId:a=``}=r();return(0,X.jsx)(e,{activeSessionId:t.activeSessionId,notify:t.notify,selectedId:a,onSelect:(e,t)=>{!e&&!t&&Mi(i.state)?n(-1):n(te(e),{replace:t||!e,state:e&&!t?ji:void 0})}})}return{Component:t}}async function Pi(){let[{CustomUiToolPage:e}]=await Promise.all([i(()=>import(`./public-CgydVZuV.js`),__vite__mapDeps([248,1,5,2,28,3,4,6,7,8,9,30,31,32,11,12,33,29,10,13,34,35,36,37,15,221,235,63,95,86,14,16,145,183,81,87,201,44,70,45,249,130,73,170,26,207,57,58,98,48,49,94,96,59,97,99,76,159,160,134,161,209,172,149,60,50,52,120,56,108,117,91,39,40,53,92,51,93,100,90,101,54,116,109,110,157,142,55,77,139,61,212,250,208,230,173,112,251,252])),E()]);function t(){let t=$(),{componentId:n=``}=r();return(0,X.jsx)(e,{componentId:n,activeSessionId:t.activeSessionId,notify:t.notify})}return{Component:t}}async function Fi(){let[{WorkflowsPage:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-DrltlXh1.js`),__vite__mapDeps([253,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,37,15,167,129,18,19,133,95,86,14,16,178,179,145,183,81,87,242,181,199,254,222,42,232,236,201,202,203,204,44,22,123,244,45,71,249,25,170,205,74,26,153,186,57,58,94,96,59,97,98,99,48,49,76,136,55,56,60,208,137,134,209,198,52,120,54,157,77,139,187,225,50,229,230,112,158,159,160,161,238,252,255,256,257])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,onBack:t.onBackToFeatures,requestConfirm:t.requestConfirm})}return{Component:t}}async function Ii(){let[{WorkflowBuilder:e}]=await Promise.all([i(()=>import(`./WorkflowsPage-DrltlXh1.js`),__vite__mapDeps([253,1,5,2,28,4,6,7,8,3,9,30,11,12,35,36,37,15,167,129,18,19,133,95,86,14,16,178,179,145,183,81,87,242,181,199,254,222,42,232,236,201,202,203,204,44,22,123,244,45,71,249,25,170,205,74,26,153,186,57,58,94,96,59,97,98,99,48,49,76,136,55,56,60,208,137,134,209,198,52,120,54,157,77,139,187,225,50,229,230,112,158,159,160,161,238,252,255,256,257])),le()]);function t(){let t=$();return(0,X.jsx)(e,{notify:t.notify,registerWorkflowActions:t.registerWorkflowActions})}return{Component:t}}var Li=t([{element:(0,X.jsx)(mi,{children:(0,X.jsx)(pi,{routerState:()=>Li.state})}),errorElement:(0,X.jsx)(_i,{}),hydrateFallbackElement:(0,X.jsx)(hi,{}),children:[{index:!0,lazy:bi},{path:T.board,lazy:vi},{path:`/board/:sessionId`,lazy:yi},{path:T.more,lazy:xi},{path:T.chat,element:(0,X.jsx)(l,{to:`/`,replace:!0})},{path:T.chatHistory,lazy:Si},{path:T.assets,lazy:Ci},{path:T.channels,lazy:wi},{path:T.schedules,lazy:Ti},{path:T.config,lazy:Ei},{path:`/config/:configSection`,lazy:Ei},{path:`/config`,element:(0,X.jsx)(l,{to:T.config,replace:!0})},{path:T.plugins,lazy:Di},{path:T.memory,lazy:Oi},{path:T.mcp,lazy:ki},{path:T.skills,lazy:Ai},{path:`/components/:componentId?`,lazy:Ni},{path:`/tools/components/:componentId`,lazy:Pi},{path:T.workflows,lazy:Fi},{path:T.workflowCreate,lazy:Ii},{path:`/workflows/:workflowId`,lazy:Ii},{path:`*`,element:(0,X.jsx)(l,{to:`/`,replace:!0})}]}]),Ri=()=>{document.documentElement.dataset.pageVisibility=document.visibilityState};Ri(),document.addEventListener(`visibilitychange`,Ri);var zi=b(window.location.hash);zi&&window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${zi}`);var Bi=document.getElementById(`root`);if(!Bi)throw Error(`Missing #root application mount point`);(0,In.createRoot)(Bi).render((0,X.jsx)(J.StrictMode,{children:(0,X.jsx)(zn,{children:(0,X.jsx)(d,{router:Li})})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./index-
|
|
1
|
+
import{t as e}from"./index-BDgCJ4Fs.js";import{a as t,i as n,o as r}from"./vendor-state-GkUciC5H.js";import{t as i}from"./api-45iTnFjN.js";import{t as a}from"./createLucideIcon-Cd-3GVxJ.js";var o=a(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),s=[`changes`,`terminal`,`files`,`preview`,`plan`,`side-chat`];function c(e){return typeof e!=`number`||!Number.isFinite(e)?456:Math.min(720,Math.max(360,Math.round(e)))}function l(e,t){let n=Math.max(360,Math.min(720,t-480-8));return Math.min(n,c(e))}function u(e){let t=e&&typeof e==`object`&&!Array.isArray(e)?e:{},n=s.find(e=>e===t.tab)??`changes`,r=t.pinned===!0;return{open:r&&t.open!==!1,pinned:r,tab:n===`side-chat`?`changes`:n,width:c(t.width),terminalView:t.terminalView===`processes`?`processes`:`terminal`,changesView:t.changesView===`workspace`?`workspace`:`session`,diffMode:t.diffMode===`split`?`split`:`unified`}}var d=n(()=>({getItem:t=>{try{return e.getItem(t)}catch{return null}},setItem:(t,n)=>{try{e.setItem(t,n)}catch{}},removeItem:t=>{try{e.removeItem(t)}catch{}}})),f=r()(t((e,t)=>({...u(void 0),setOpen:n=>{t().open!==n&&e({open:n})},setPinned:t=>e(t?{pinned:t,open:!0}:{pinned:t}),setTab:n=>{t().tab!==n&&e({tab:n})},setWidth:n=>{let r=c(n);t().width!==r&&e({width:r})},setTerminalView:t=>e({terminalView:t}),setChangesView:t=>e({changesView:t}),setDiffMode:t=>e({diffMode:t})}),{name:`pisper-session-inspector`,version:1,storage:d,partialize:({open:e,pinned:t,tab:n,width:r,terminalView:i,changesView:a,diffMode:o})=>({open:e,pinned:t,tab:n,width:r,terminalView:i,changesView:a,diffMode:o}),migrate:e=>u(e),merge:(e,t)=>({...t,...u(e)})})),p={list(){return i(`/api/permission-rules`)},add(e){return i(`/api/permission-rules`,{method:`POST`,body:JSON.stringify(e)})},remove(e){return i(`/api/permission-rules/`+encodeURIComponent(e),{method:`DELETE`})}},m=/[;&|`$<>\n\r\\(){}]/;function h(e){let t=e.trim().replace(/[ \t]+/g,` `);if(!t||m.test(t))return``;let[n,r]=t.split(` `);return n?r&&/^[a-z][\w:-]*$/i.test(r)?`${n} ${r}`:n:``}export{o as a,f as i,h as n,l as r,p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./api-
|
|
1
|
+
import{t as e}from"./api-45iTnFjN.js";async function t(t=``,n=``){let r=window.pisperDesktop?.pickDirectory;if(r){let e=await r(t||void 0);return e?{status:`picked`,path:e}:{status:`cancelled`}}let i;try{i=await e(`/api/local/directory-picker`,{method:`POST`,body:JSON.stringify({initialDirectory:t,title:n})})}catch{return{status:`unavailable`}}return i.status===`picked`&&i.path?{status:`picked`,path:i.path}:i.status===`cancelled`||i.status===`busy`?{status:`cancelled`}:{status:`unavailable`}}export{t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hosts-CmK7Yt82.js","assets/rolldown-runtime-B0Z9INg1.js","assets/vendor-router-CSN_DGvx.js","assets/vendor-react-DwNgTV1j.js","assets/index-BDgCJ4Fs.js","assets/index-CfTBR7Rs.css","assets/routes-Da0OHSy6.js","assets/use-i18n-CVZdp2ZN.js","assets/i18n-DfsxGeh5.js","assets/storage-BY6wEHPw.js","assets/vendor-state-GkUciC5H.js","assets/useQuery-Bg3cTjsY.js","assets/session-scope-t_l7TRH5.js","assets/api-45iTnFjN.js","assets/abort-signal-f4JsiYKX.js","assets/session-board-status-D2lpFPiI.js","assets/createLucideIcon-Cd-3GVxJ.js","assets/ellipsis-CfGKfbq6.js","assets/grip-vertical-B__LYT0s.js","assets/plus-fQbSqB1n.js","assets/rotate-ccw-C0v8V77_.js","assets/settings-2-CXJjXJS9.js","assets/x-07u4-129.js","assets/dropdown-menu-CFIFNaKO.js","assets/check-2vYc6QaP.js","assets/chevron-right-C3t2Rckj.js","assets/dist-41X0pdUs.js","assets/dist-BsRXXcSL.js","assets/dist-DzGQ7sLi.js","assets/es2015-DTZdOI9P.js","assets/dist-BRjj4UeB.js","assets/dist-OB2r6Xsr.js","assets/dist-BaBySQmo.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/popover-BtcdIPRz.js","assets/dialog-2cmY5V75.js","assets/dist-BHkR6BLP.js","assets/button-CCcCN8tE.js","assets/use-studio-actions-C4Zh15Vx.js","assets/checkbox-BrEHgFV0.js","assets/progress-5odAz3B9.js","assets/separator-BPh_qxvc.js","assets/switch-D_G8wFhs.js","assets/segmented-control-BlM_GKV6.js","assets/touch-target-BsyCgjR5.js","assets/tooltip-D4MFbqcG.js","assets/dist-BiRPwy4W.js","assets/kbd-CAufZTkl.js","assets/useSessionListQuery-CJ-BYuqu.js","assets/startup-queries-BAWDaQY5.js","assets/mutation-Difliohy.js","assets/component-changes-Q9Bf64Ob.js","assets/runtime-capabilities-store-D1FwQXKw.js","assets/runtime-capabilities-BhAMiYhG.js","assets/chat-api-BBuYjxwz.js","assets/session-organization-api-BgCoIi2X.js","assets/events-n27XPFgs.js","assets/session-questions-Cf-1g85h.js","assets/useFleetSystemInfo-BbQQId7X.js","assets/useNow-CxO2FUQY.js","assets/useBoardItems-DCo-4he0.js","assets/card-presentation-1oph2b8P.js","assets/format-DMJQzoZ7.js","assets/public--8F2_oqP.js","assets/useSidebarModel-b5cdTj9-.js","assets/new-task-C3wuHTor.js","assets/board-launch-YigjCnZf.js","assets/input-CPw-zkYh.js","assets/textarea-DmATpOqT.js","assets/StatusGlyph-1KgitlUg.js","assets/badge-CWB3lj2H.js","assets/safe-mode-instance-TonxlRrq.js","assets/safe-mode-sentinel-BG78O0yJ.js","assets/SafeModePrompt-jSCZVMGa.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t}from"./vendor-router-CSN_DGvx.js";import{i as n}from"./vendor-react-DwNgTV1j.js";import{a as r}from"./i18n-DfsxGeh5.js";import{t as i}from"./use-i18n-CVZdp2ZN.js";import{r as a,t as o}from"./useQuery-Bg3cTjsY.js";import{n as s}from"./component-changes-Q9Bf64Ob.js";import{t as c}from"./runtime-capabilities-store-D1FwQXKw.js";import{_ as l,j as u,k as d,n as f,r as p,t as m}from"./session-scope-t_l7TRH5.js";import"./safe-mode-sentinel-BG78O0yJ.js";var h=e(n(),1);function g(e){return e.id===`*`?[u.all]:e.reason===`instances`?[u.instances()]:[u.catalog(),u.describe(e.id),u.errors(e.id),u.versions(e.id),u.trash(),u.instances()]}function _(e){let t=0,n=null,r=null;return{retain(i){r=i,t+=1,n??=e(e=>{for(let t of g(e))Promise.resolve(r?.invalidateQueries({queryKey:t})).catch(()=>void 0)});let a=!1;return()=>{a||(a=!0,--t,!(t>0)&&(n?.(),n=null,r=null))}},users:()=>t}}var v=_(s);function y(e){let t=a();(0,h.useEffect)(()=>e?v.retain(t):void 0,[t,e])}function b(){return c(e=>e.capabilities.features[`components.native`])}function x(){let e=b();return y(e),o(f(e))}function S(e){return y(e),o(p(e))}function C(){return S(b())}function w(e){let t=b(),n=S(t),r=(0,h.useMemo)(()=>(n.data?.instances??[]).filter(t=>t.surface===e&&t.enabled),[n.data,e]),i=o(f(t&&r.length>0));return{available:t,placed:(0,h.useMemo)(()=>{if(!i.data)return[];let e=new Map(i.data.components.map(e=>[e.id,e])),t=[];for(let n of r){let r=e.get(n.componentId);r?.kind===`native`&&r.status===`ready`&&r.enabled&&t.push({instance:n,component:r})}return t},[r,i.data]),revision:n.data?.revision??null,isLoading:t&&(n.isPending||r.length>0&&i.isPending),error:n.error??i.error??null,refetch:()=>{n.refetch(),r.length&&i.refetch()}}}function T(e,t,n){return e.filter(({instance:e})=>m(e.scope,t)).map(({instance:e,component:t})=>({id:e.instanceId,label:e.title||t.manifest?.i18n[n]?.name||t.name}))}function E(){let e=S(b());return(0,h.useMemo)(()=>(e.data?.instances??[]).filter(e=>e.enabled).length,[e.data])}function D(){let{language:e}=i(),t=w(`feature-page`),n=(0,h.useMemo)(()=>t.placed.map(({instance:t,component:n})=>({instanceId:t.instanceId,componentId:n.id,name:n.manifest?.i18n[e]?.name||n.name,description:n.manifest?.i18n[e]?.description||n.description,icon:n.manifest?.icon||``})),[e,t.placed]);return{...t,items:n}}var O=()=>Promise.all([t(()=>import(`./hosts-CmK7Yt82.js`),__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,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73])),r()]).then(([e])=>e),k=(0,h.lazy)(()=>O().then(e=>({default:e.ComponentHost}))),A=(0,h.lazy)(()=>O().then(e=>({default:e.FloatingComponents}))),j=(0,h.lazy)(()=>Promise.all([t(()=>import(`./SafeModePrompt-jSCZVMGa.js`),__vite__mapDeps([74,1,3,7,8,2,4,5,9,10,38,34,26,33,36,22,16,37,27,29,72,73])),r()]).then(([e])=>({default:e.SafeModePrompt})));function M(){let e=a();return async()=>{let t=(await l()).components.filter(e=>e.kind===`native`&&e.enabled),n=await Promise.allSettled(t.map(e=>d(e.id,!1)));return e.invalidateQueries({queryKey:u.all}),n.every(e=>e.status===`fulfilled`)}}var N=(0,h.lazy)(()=>O().then(e=>({default:e.OverviewComponents}))),P=(0,h.lazy)(()=>O().then(e=>({default:e.SessionPanelComponent}))),F=(0,h.lazy)(()=>O().then(e=>({default:e.SessionComponentAddMenu})));export{F as a,x as c,b as d,M as f,j as i,C as l,D as m,A as n,P as o,E as p,N as r,T as s,k as t,w as u};
|
|
@@ -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,n as i}from"./dist-41X0pdUs.js";import{c as a,i as o,n as s,o as c,r as l,s as u}from"./dist-BsRXXcSL.js";import{a as d,i as f,n as p,r as m,s as h,t as g}from"./es2015-DTZdOI9P.js";import{a as _,i as v,r as y,t as b}from"./dist-BRjj4UeB.js";import{t as x}from"./utils-C8uzG5AZ.js";import{c as S}from"./dialog-2cmY5V75.js";var C=e(t(),1),w=n(),T=Object.defineProperty,E=(e,t)=>T(e,`name`,{value:t,configurable:!0}),D=`Popover`,[O,ee]=u(D,[_]),k=_(),[A,j]=O(D),M=E(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:c=!1}=e,l=k(t),u=C.useRef(null),[d,f]=C.useState(!1),[p,m]=o({prop:r,defaultProp:i??!1,onChange:a,caller:D});return(0,w.jsx)(v,{...l,children:(0,w.jsx)(A,{scope:t,contentId:s(),triggerRef:u,open:p,onOpenChange:m,onOpenToggle:C.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:C.useCallback(()=>f(!0),[]),onCustomAnchorRemove:C.useCallback(()=>f(!1),[]),modal:c,children:n})})},`Popover`),N=`PopoverTrigger`,P=C.forwardRef(E(function(e,t){let{__scopePopover:n,...i}=e,o=j(N,n),s=k(n),l=r(t,o.triggerRef),u=(0,w.jsx)(a.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":G(o.open),...i,ref:l,onClick:c(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?u:(0,w.jsx)(b,{asChild:!0,...s,children:u})},`PopoverTrigger`)),F=`PopoverPortal`,[I,L]=O(F,{forceMount:void 0}),R=E(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=j(F,t);return(0,w.jsx)(I,{scope:t,forceMount:n,children:(0,w.jsx)(l,{present:n||a.open,children:(0,w.jsx)(f,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),z=`PopoverContent`,B=C.forwardRef(E(function(e,t){let n=L(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=j(z,e.__scopePopover);return(0,w.jsx)(l,{present:r||a.open,children:a.modal?(0,w.jsx)(H,{...i,ref:t}):(0,w.jsx)(U,{...i,ref:t})})},`PopoverContent`)),V=i(`PopoverContent.RemoveScroll`),H=C.forwardRef(E(function(e,t){let n=j(z,e.__scopePopover),i=C.useRef(null),a=r(t,i),o=C.useRef(!1);return C.useEffect(()=>{let e=i.current;if(e)return g(e)},[]),(0,w.jsx)(p,{as:V,allowPinchZoom:!0,children:(0,w.jsx)(W,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:c(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:c(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;o.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:c(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),U=C.forwardRef(E(function(e,t){let n=j(z,e.__scopePopover),r=C.useRef(!1),i=C.useRef(!1);return(0,w.jsx)(W,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),W=C.forwardRef(E(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=e,p=j(z,n),g=k(n);return m(),(0,w.jsx)(d,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,w.jsx)(h,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,w.jsx)(y,{"data-state":G(p.open),role:`dialog`,id:p.contentId,...g,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function G(e){return e?`open`:`closed`}E(G,`getState`);var K=M,q=P,J=R,Y=B;function X({modal:e=!1,...t}){return(0,w.jsx)(K,{"data-slot":`popover`,modal:e,...t})}function Z({...e}){return(0,w.jsx)(q,{"data-slot":`popover-trigger`,...e})}function Q({className:e,align:t=`center`,sideOffset:n=8,alignOffset:r=t===`center`?0:-5,collisionPadding:i=20,portalContainer:a,...o}){let s=C.useContext(S);return(0,w.jsx)(J,{container:a===void 0?s??void 0:a,children:(0,w.jsx)(Y,{"data-slot":`popover-content`,align:t,sideOffset:n,alignOffset:r,collisionPadding:i,className:x(`z-[200] flex max-h-(--radix-popover-content-available-height) w-72 max-w-[calc(100vw-40px)] origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 overflow-y-auto overscroll-contain rounded-md bg-popover p-2.5 text-sm text-popover-foreground shadow-float outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...o})})}function $({className:e,...t}){return(0,w.jsx)(`div`,{"data-slot":`popover-title`,className:x(`font-medium`,e),...t})}export{Z as i,Q as n,$ as r,X as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{c as r,s as i}from"./dist-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{i as t,r as n}from"./vendor-react-DwNgTV1j.js";import{c as r,s as i}from"./dist-BsRXXcSL.js";import{t as a}from"./utils-C8uzG5AZ.js";var o=e(t(),1),s=n(),c=Object.defineProperty,l=(e,t)=>c(e,`name`,{value:t,configurable:!0}),u=`Progress`,d=100,[f,p]=i(u),[m,h]=f(u),g=o.forwardRef(l(function(e,t){let{__scopeProgress:n,value:i=null,max:a,getValueLabel:o=y,...c}=e;(a||a===0)&&!S(a)&&console.error(w(`${a}`,`Progress`));let l=S(a)?a:d;i!==null&&!C(i,l)&&console.error(T(`${i}`,`Progress`));let u=C(i,l)?i:null,f=x(u)?o(u,l):void 0;return(0,s.jsx)(m,{scope:n,value:u,max:l,children:(0,s.jsx)(r.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":x(u)?u:void 0,"aria-valuetext":f,role:`progressbar`,"data-state":b(u,l),"data-value":u??void 0,"data-max":l,...c,ref:t})})},`Progress`)),_=`ProgressIndicator`,v=o.forwardRef(l(function(e,t){let{__scopeProgress:n,...i}=e,a=h(_,n);return(0,s.jsx)(r.div,{"data-state":b(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...i,ref:t})},`ProgressIndicator`));function y(e,t){return`${Math.round(e/t*100)}%`}l(y,`defaultGetValueLabel`);function b(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}l(b,`getProgressState`);function x(e){return typeof e==`number`}l(x,`isNumber`);function S(e){return x(e)&&!isNaN(e)&&e>0}l(S,`isValidMaxNumber`);function C(e,t){return x(e)&&!isNaN(e)&&e<=t&&e>=0}l(C,`isValidValueNumber`);function w(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${d}\`.`}l(w,`getInvalidMaxError`);function T(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
2
2
|
- a positive number
|
|
3
3
|
- less than the value passed to \`max\` (or ${d} if no \`max\` prop is set)
|
|
4
4
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./useSessionListQuery-CJ-BYuqu.js";import"./useNow-CxO2FUQY.js";import"./useFleetSystemInfo-BbQQId7X.js";import"./useSidebarModel-b5cdTj9-.js";import"./new-task-C3wuHTor.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-diff-DWbitsnS.js","assets/GitDiffViewer-BAZTiiDo.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/x-07u4-129.js","assets/utils-C8uzG5AZ.js","assets/vendor-ui-DvrYggeS.js","assets/button-CCcCN8tE.js","assets/dist-41X0pdUs.js","assets/events-n27XPFgs.js","assets/esm-DCV8yILT.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{h as t,l as n,n as r,u as i}from"./vendor-router-CSN_DGvx.js";import{i as a,r as o}from"./vendor-react-DwNgTV1j.js";import{f as s,o as c,r as l}from"./routes-Da0OHSy6.js";import{t as u}from"./use-i18n-CVZdp2ZN.js";import{r as d,t as f}from"./useQuery-Bg3cTjsY.js";import{n as p}from"./component-changes-Q9Bf64Ob.js";import{T as m,g as h,i as g,j as _,n as v,o as y,v as b}from"./session-scope-t_l7TRH5.js";import{c as x,d as S,l as C,t as w,u as T}from"./placements--Zk5njsN.js";import{t as ee}from"./usePhoneShell-m3H_98m_.js";import{t as E}from"./createLucideIcon-Cd-3GVxJ.js";import{t as te}from"./app-window-CPNdvYNt.js";import{t as D}from"./arrow-up-right-B6l8qFZz.js";import{t as O}from"./blocks-Olsdp5Lp.js";import{t as ne}from"./check-2vYc6QaP.js";import{t as re}from"./chevron-down-CxtxIjiP.js";import{t as ie}from"./chevron-left-BAtyp3_6.js";import{t as ae}from"./chevron-right-C3t2Rckj.js";import{t as k}from"./code-xml-BrUXrBax.js";import{t as oe}from"./copy-DHmIFc52.js";import{t as se}from"./download-BCfIiuaL.js";import{t as ce}from"./ellipsis-CfGKfbq6.js";import{t as le}from"./panel-right-BSUtqUd8.js";import{t as ue}from"./plus-fQbSqB1n.js";import{t as de}from"./rotate-ccw-clock-CO6Bw-sF.js";import{t as fe}from"./search-D0mqDaf_.js";import{t as A}from"./settings-2-CXJjXJS9.js";import{t as pe}from"./shield-alert-oZqX6MNu.js";import{t as me}from"./sparkles-S_eeuqn9.js";import{t as j}from"./trash-2-CNrPOoPR.js";import{t as he}from"./x-07u4-129.js";import{t as ge}from"./checkbox-BrEHgFV0.js";import{a as _e,c as ve,i as M,p as ye,r as N,t as be}from"./dropdown-menu-CFIFNaKO.js";import{t as xe}from"./label-CVWjEcfV.js";import{a as Se,i as Ce,n as we,r as Te,t as Ee}from"./select-DD_WO-gs.js";import{t as De}from"./switch-D_G8wFhs.js";import{t as P}from"./segmented-control-BlM_GKV6.js";import{t as F}from"./utils-C8uzG5AZ.js";import{r as Oe,t as I}from"./button-CCcCN8tE.js";import{t as ke}from"./kbd-CAufZTkl.js";import{t as Ae}from"./shortcuts-BGzXmClx.js";import{a as je,i as Me,n as Ne,o as Pe,r as Fe,t as Ie}from"./sheet-BTaIEX4w.js";import{t as Le}from"./sidebar-store-DztdHlUn.js";import{n as Re}from"./useFleetSystemInfo-BbQQId7X.js";import{a as ze,n as Be}from"./format-DMJQzoZ7.js";import"./public--8F2_oqP.js";import{n as L,t as R}from"./PageState-Cz6vFMXv.js";import{i as Ve}from"./board-launch-YigjCnZf.js";import{a as z,i as B,l as V,n as He,o as H,s as U,t as W}from"./dialog-2cmY5V75.js";import{t as G}from"./input-CPw-zkYh.js";import{t as Ue}from"./textarea-DmATpOqT.js";import{t as K}from"./useOverlayFocusReturn-NkxBSSjb.js";import{t as We}from"./badge-CWB3lj2H.js";import{A as Ge,B as Ke,C as qe,F as Je,G as Ye,H as Xe,I as q,J as Ze,K as Qe,L as $e,M as et,N as tt,O as nt,R as rt,S as it,U as at,V as ot,W as st,X as ct,Y as lt,_ as ut,a as dt,b as ft,c as pt,d as mt,f as J,g as ht,h as gt,i as _t,j as vt,k as yt,l as bt,m as xt,n as St,o as Ct,p as wt,q as Tt,r as Y,s as Et,t as Dt,v as Ot,w as kt,x as At,y as jt,z as Mt}from"./use-studio-actions-C4Zh15Vx.js";import{t as X}from"./PageFrame-DNwGZ-Dz.js";var Nt=E(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Pt=E(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),Ft=E(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Z=e(a(),1);function It(){let e=null,t=new Set;return{set(n){let r=Math.round(n*10)/10;if(r!==e){e=r;for(let e of[...t])e()}},get:()=>e,subscribe(e){return t.add(e),()=>{t.delete(e)}}}}var Q=o();function Lt({manifest:e,target:t,window:n,phone:r=!1,onTarget:i,onWindow:a}){let{t:o}=u(),s=Ot(e);return(0,Q.jsxs)(`div`,{"data-studio-preview-bar":!0,className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{className:F(r&&`sr-only`),children:o(`custom-ui:studio.previewPlacement`)}),(0,Q.jsx)(P,{size:`sm`,"aria-label":o(`custom-ui:studio.previewPlacement`),value:t,onValueChange:i,className:F(`max-w-full overflow-x-auto`,r&&`w-full`),options:s.map(e=>({value:e,label:_t(e,o)}))}),!r&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`ml-auto`,children:o(`custom-ui:studio.previewWindow`)}),(0,Q.jsx)(P,{size:`sm`,"aria-label":o(`custom-ui:studio.previewWindow`),value:n,onValueChange:a,options:[{value:`standard`,label:o(`custom-ui:studio.windowStandard`)},{value:`min`,label:o(`custom-ui:studio.windowMin`)}]}),(0,Q.jsx)(`span`,{className:`rounded-sm border border-stroke px-2 py-1 text-content-secondary`,title:o(`custom-ui:studio.themeFollowHint`),children:o(`custom-ui:studio.themeFollow`)})]})]})}function Rt({activeSessionId:e=``,row:t,target:n,window:r,instanceId:i,title:a,props:o,phone:s=!1,notify:c,commits:l}){let{t:d}=u(),f=bt(t,c),p=ut(n,t.manifest,s?`standard`:r),m=qe(n),h=p.width===`fill`||s?`100%`:p.width,g=p.width===`fill`||s&&m===`overview-card`?`100%`:p.width,_=p.height===`fill`;return(0,Q.jsxs)(`div`,{"data-component-preview":!0,"data-component-preview-target":n,className:F(`flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto rounded-[var(--r-lg)] border border-stroke bg-surface-subtle bg-[radial-gradient(var(--stroke-strong)_1px,transparent_1px)] [background-size:16px_16px]`,s?`min-h-[min(420px,55dvh)] p-3`:`p-5`),children:[(0,Q.jsxs)(`p`,{className:`flex flex-none items-baseline gap-2 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{className:`text-content-secondary`,children:Y(m,d)}),p.label&&(0,Q.jsx)(`span`,{"data-component-preview-size":!0,className:`font-mono tabular-nums`,children:s&&m===`overview-card`?p.label.split(` · `)[0]:p.label})]}),(0,Q.jsx)(`div`,{"data-component-preview-frame":!0,className:F(`flex min-w-0 flex-col overflow-hidden rounded-[var(--r-lg)] bg-panel shadow-edge ring-1 ring-stroke`,_?`min-h-[320px] flex-1`:`flex-none`),style:{width:h,maxWidth:g,minWidth:s||p.width===`fill`?void 0:p.width,height:_?void 0:p.height},children:(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(yt,{component:t,instance:{instanceId:i??`preview:${t.id}`,surface:m,title:a,props:o,size:it(n)},preview:!0,session:e?{id:e,title:``,cwd:``,status:`idle`}:void 0,notify:e=>c(e),onRequestFix:f,onCommitSample:e=>l.set(e),className:`h-full animate-[fade-in_120ms_var(--ease-enter)] [:root[data-motion=reduced]_&]:animate-none motion-reduce:[:root:not([data-motion=full])_&]:animate-none`},`${t.id}@${t.rev}:${n}:${i??``}`)})})]})}function zt({componentId:e,errors:t,commits:n}){let{t:r}=u(),i=(0,Z.useSyncExternalStore)(n.subscribe,n.get,n.get),a=tt(),o=(0,Z.useSyncExternalStore)(a.subscribe,()=>a.reloadRecommended(e),()=>!1),s=(0,Z.useMemo)(()=>t?.entries.filter(e=>e.level===`error`).length??0,[t]),c=Object.keys(t?.network.hosts??{});return(0,Q.jsxs)(`p`,{"data-studio-status":!0,className:`flex min-w-0 flex-none flex-wrap items-center gap-x-3 gap-y-1 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{"data-studio-status-errors":!0,className:F(s>0&&`text-content`),children:r(`custom-ui:studio.statusErrors`,{count:s})}),(0,Q.jsx)(`span`,{className:`font-mono tabular-nums`,children:i===null?r(`custom-ui:studio.statusRenderNone`):r(`custom-ui:studio.statusRender`,{ms:i})}),(0,Q.jsxs)(`span`,{className:`min-w-0 truncate`,children:[r(`custom-ui:studio.statusNetwork`,{count:t?.network.count??0}),c.length>0&&(0,Q.jsxs)(`span`,{className:`font-mono`,children:[` · `,c.slice(0,3).join(`, `)]})]}),o&&(0,Q.jsx)(`span`,{className:`text-content`,children:r(`custom-ui:studio.reloadRecommended`)}),(0,Q.jsx)(`span`,{className:`ml-auto`,children:r(`custom-ui:studio.statusHotReload`)})]})}function Bt({onCreate:e,phone:t=!1,className:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[d,f]=(0,Z.useState)(!1),p=(0,Z.useRef)(null),m=K(i,p),h=(0,Z.useId)(),g=(0,Z.useId)(),_=async(t,n,r)=>{f(!0);try{await e(t,n,r)&&(a(!1),s(``),l(``))}finally{f(!1)}},v=o.trim(),y=c.trim(),b=()=>{v&&_(`blank`,v,y||void 0)},x=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(xe,{htmlFor:h,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:studio.componentName`)}),(0,Q.jsx)(G,{id:h,autoFocus:!0,value:o,maxLength:120,placeholder:r(`custom-ui:studio.componentNamePlaceholder`),"data-component-new-name":!0,className:t?`min-h-11`:void 0,onChange:e=>s(e.target.value)}),(0,Q.jsx)(xe,{htmlFor:g,className:`-mb-1.5 text-xs text-content-secondary`,children:r(`custom-ui:agent.newPromptLabel`)}),(0,Q.jsx)(Ue,{id:g,rows:3,value:c,maxLength:Ct,placeholder:r(`custom-ui:agent.newPromptPlaceholder`),"data-component-new-prompt":!0,className:`max-h-48 resize-none`,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key!==`Enter`||!(e.metaKey||e.ctrlKey)||e.nativeEvent.isComposing||(e.preventDefault(),b())}})]}),S=r(y?`custom-ui:agent.createAndGenerate`:`custom-ui:studio.create`);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsxs)(I,{ref:p,size:`sm`,variant:`secondary`,disabled:d,"data-component-new":!0,className:F(n),children:[(0,Q.jsx)(ue,{}),r(`custom-ui:studio.new`),(0,Q.jsx)(re,{className:`text-content-muted`})]})}),(0,Q.jsxs)(N,{align:`end`,className:`w-56`,children:[(0,Q.jsx)(M,{"data-component-new-blank":!0,onSelect:()=>a(!0),children:r(`custom-ui:studio.newBlank`)}),(0,Q.jsx)(ve,{}),(0,Q.jsx)(_e,{className:`text-xs font-normal text-content-muted`,children:r(`custom-ui:studio.fromTemplate`)}),(0,Q.jsx)(M,{"data-component-new-template":`usage-today`,onSelect:()=>void _(`usage-today`),children:r(`custom-ui:studio.templateUsageToday`)}),(0,Q.jsx)(M,{"data-component-new-template":`notes`,onSelect:()=>void _(`notes`),children:r(`custom-ui:studio.templateNotes`)})]})]}),t?(0,Q.jsx)(Ie,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(Ne,{side:`bottom`,onCloseAutoFocus:m,"data-component-new-sheet":!0,className:`gap-0 rounded-t-[var(--r-lg)] p-0`,children:(0,Q.jsxs)(`form`,{className:`flex flex-col gap-3 px-4 pt-4 pb-[max(16px,env(safe-area-inset-bottom))]`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsxs)(je,{className:`p-0`,children:[(0,Q.jsx)(Pe,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(Fe,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(Me,{className:`flex-row p-0`,children:[(0,Q.jsx)(I,{type:`button`,variant:`outline`,className:`min-h-11 flex-1`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{type:`submit`,className:`min-h-11 flex-1`,disabled:d||!v,children:S})]})]})})}):(0,Q.jsx)(W,{open:i,onOpenChange:e=>!d&&a(e),children:(0,Q.jsx)(B,{onCloseAutoFocus:m,children:(0,Q.jsxs)(`form`,{className:`contents`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:r(`custom-ui:studio.newBlankTitle`)}),(0,Q.jsx)(z,{children:r(`custom-ui:studio.newBlankHint`)})]}),x,(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{type:`button`,variant:`outline`,disabled:d,onClick:()=>a(!1),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{type:`submit`,disabled:d||!v,children:S})]})]})})})]})}function Vt(e,t){return e.length?e.map(e=>{let n=Y(e.surface,t);if(e.surface!==`overview-card`)return n;let r=e.sizes.join(`/`),i=r?`${n} ${r}`:n;return e.count>1?`${i} ×${e.count}`:i}).join(` · `):t(`custom-ui:studio.notPlaced`)}function Ht(e,t,n){if(e.kind===`broken`||e.status!==`ready`){let t=e.errors[0];return t?q(t.code,n,t.params):n(`custom-ui:studio.statusInvalid`)}return Vt(ht(e.id,t),n)}function Ut(e,t){return e.kind===`broken`?t(`custom-ui:studio.statusBroken`):e.status===`ready`?e.enabled?null:t(`custom-ui:studio.statusDisabled`):t(`custom-ui:studio.statusInvalid`)}function Wt({row:e,instances:t,active:n,phone:r=!1,onSelect:i}){let{t:a,language:o}=u(),s=Ut(e,a);return(0,Q.jsxs)(`button`,{type:`button`,"data-component-row":e.id,"data-component-kind":e.kind,"aria-current":n||void 0,onClick:i,className:F(`flex w-full min-w-0 items-center gap-3 text-left transition-colors duration-(--d-fast) focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-focus`,r?`min-h-14 px-3.5 py-2 hover:bg-surface-hover active:bg-surface-hover`:F(`rounded-[var(--r-md)] px-2.5 py-2`,n?`bg-surface-active`:`hover:bg-surface-hover`)),children:[(0,Q.jsx)(`span`,{className:F(`grid flex-none place-items-center rounded-[var(--r-md)] border border-stroke bg-solid text-content-secondary`,r?`size-9`:`size-8`),children:(0,Q.jsx)(O,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsx)(`strong`,{className:`min-w-0 truncate text-sm font-medium text-content`,children:J(e,o)}),e.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:[`v`,e.version]}),s&&(0,Q.jsx)(We,{className:`ml-auto flex-none text-content-secondary`,children:s})]}),(0,Q.jsx)(`small`,{className:`truncate text-xs text-content-muted`,"data-component-row-detail":!0,children:Ht(e,t,a)})]}),r&&(0,Q.jsx)(ae,{className:`size-4 flex-none text-content-muted`,"aria-hidden":`true`})]})}function Gt({componentId:e,onOpenLogs:t,onReload:n,onRequestFix:r}){let{t:i}=u(),a=et(),o=(0,Z.useSyncExternalStore)(e=>a.subscribe(e),()=>{let t=a.read(e);for(let e=t.length-1;e>=0;--e)if(t[e].level===`error`)return t[e];return null}),s=o?.message??``;return(0,Q.jsxs)(`div`,{role:`status`,"data-component-crash":e,className:`mx-1 mt-1 mb-1.5 flex flex-col gap-1.5 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-2.5 py-2`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-medium text-st-fail`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-st-fail`}),i(`custom-ui:host.renderErrorTitle`)]}),s&&(0,Q.jsx)(`p`,{className:`truncate font-mono text-xs text-content-secondary`,title:s,children:s}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,onClick:t,children:i(`custom-ui:host.viewError`)}),(0,Q.jsx)(I,{size:`xs`,variant:`secondary`,onClick:n,children:i(`custom-ui:host.reload`)}),r&&s&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,"data-component-crash-fix":e,onClick:()=>r(Je(s,o?.stack)),children:i(`custom-ui:host.askAgentFix`)})]})]})}function Kt({rows:e,allCount:t,counts:n,instances:r,selectedId:i,troubled:a,filter:o,query:s,root:c,onFilter:l,onQuery:d,onSelect:f,onCreate:p,onOpenLogs:m,onReload:h,onRequestFix:g,importButton:_,staged:v,footer:y}){let{t:b}=u();return(0,Q.jsxs)(`section`,{"data-studio-library":!0,"aria-label":b(`custom-ui:studio.library`),className:`flex min-h-0 min-w-0 flex-col border-r border-stroke`,children:[(0,Q.jsxs)(`header`,{className:`flex flex-col gap-2.5 px-3 pt-3.5 pb-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,Q.jsxs)(`h2`,{className:`mr-auto flex min-w-0 items-baseline gap-1.5 truncate text-base font-semibold`,children:[b(`custom-ui:studio.libraryTitle`),(0,Q.jsx)(`span`,{className:`text-sm font-normal text-content-muted tabular-nums`,children:t})]}),_,(0,Q.jsx)(Bt,{onCreate:p})]}),(0,Q.jsxs)(`label`,{className:`relative block`,children:[(0,Q.jsx)(fe,{"aria-hidden":!0,className:`pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-content-muted`}),(0,Q.jsx)(G,{type:`search`,value:s,placeholder:b(`custom-ui:studio.search`),"aria-label":b(`custom-ui:studio.search`),className:`pl-8`,onChange:e=>d(e.target.value)})]}),(0,Q.jsx)(P,{size:`sm`,"aria-label":b(`custom-ui:studio.filter`),value:o,onValueChange:l,className:`w-full [&>*]:flex-1`,options:[{value:`all`,label:b(`custom-ui:studio.filterAll`)},{value:`enabled`,label:b(`custom-ui:studio.filterEnabled`),count:n.enabled},{value:`attention`,label:b(`custom-ui:studio.filterAttention`),count:n.attention}]})]}),(0,Q.jsxs)(`ul`,{className:`flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pb-2`,children:[v&&(0,Q.jsx)(`li`,{className:`flex flex-col gap-1.5 pb-1`,children:v}),e.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(Wt,{row:e,instances:r,active:e.id===i,onSelect:()=>f(e.id)}),a.has(e.id)&&(0,Q.jsx)(Gt,{componentId:e.id,onOpenLogs:()=>m(e.id),onReload:()=>h(e.id),onRequestFix:g&&(t=>g(e,t))})]},e.id)),!e.length&&!v&&(0,Q.jsx)(`li`,{className:`px-2.5 py-6 text-center text-sm text-content-muted`,children:b(`custom-ui:studio.noMatches`)})]}),y,(0,Q.jsxs)(`p`,{"data-studio-hot-reload":!0,className:`flex flex-none flex-col gap-0.5 border-t border-stroke px-3.5 py-2.5 text-xs text-content-muted`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-content-secondary`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 rounded-full bg-content-muted`}),b(`custom-ui:studio.hotReloadOn`)]}),(0,Q.jsx)(`span`,{className:`break-all`,children:b(`custom-ui:studio.directory`,{path:c})})]})]})}function qt(e,t,n){let r=e.i18n?.[n];return{label:r?.title||e.title||t,description:r?.description||e.description||``}}function Jt(e,t){if(!e||typeof e.properties!=`object`||!e.properties)return[];let n=new Set(Array.isArray(e.required)?e.required:[]),r=[];for(let[i,a]of Object.entries(e.properties)){if(!a||typeof a!=`object`)continue;let e={key:i,...qt(a,i,t),required:n.has(i)};switch(a.type){case`string`:Array.isArray(a.enum)&&a.enum.length?r.push({...e,kind:a.enum.length<=4?`segmented`:`select`,options:[...a.enum],...a.default===void 0?{}:{defaultValue:a.default}}):r.push({...e,kind:a.format===`textarea`||a.format===`url`||a.format===`color`?a.format:`text`,maxLength:a.maxLength,...a.default===void 0?{}:{defaultValue:a.default}});break;case`number`:case`integer`:r.push({...e,kind:`number`,integer:a.type===`integer`,...a.minimum===void 0?{}:{min:a.minimum},...a.maximum===void 0?{}:{max:a.maximum},...a.step===void 0?{}:{step:a.step},unit:a.unit||``,...a.default===void 0?{}:{defaultValue:a.default}});break;case`boolean`:r.push({...e,kind:`switch`,...a.default===void 0?{}:{defaultValue:a.default}});break;case`array`:r.push({...e,kind:`tags`,maxItems:a.maxItems,itemMaxLength:a.itemMaxLength,...a.default===void 0?{}:{defaultValue:[...a.default]}})}}return r}function Yt(e,t){let n={};for(let r of e){let e=t&&Object.hasOwn(t,r.key)?t[r.key]:r.defaultValue;switch(r.kind){case`switch`:n[r.key]=e===!0;break;case`tags`:n[r.key]=Array.isArray(e)?e.filter(e=>typeof e==`string`):[];break;case`number`:n[r.key]=typeof e==`number`&&Number.isFinite(e)?String(e):``;break;default:n[r.key]=typeof e==`string`?e:``}}return n}function Xt(e,t){let n={};for(let r of e){let e=t[r.key];switch(r.kind){case`switch`:n[r.key]=e===!0;break;case`tags`:Array.isArray(e)&&e.length&&(n[r.key]=[...e]);break;case`number`:{let t=typeof e==`string`?e.trim():``;if(!t)break;let i=Number(t);n[r.key]=Number.isFinite(i)?i:t;break}case`segmented`:case`select`:typeof e==`string`&&e&&(n[r.key]=e);break;default:typeof e==`string`&&e&&(n[r.key]=e)}}return n}function Zt(e,t){let n=[...e];for(let e of t.split(/[,,\n]/)){let t=e.trim();t&&!n.includes(t)&&n.push(t)}return n}function Qt(e){let t={};for(let n of e){let e=/^props(?:\.([^.]+))?/.exec(n.path||``),r=e?e[1]??``:``;Object.hasOwn(t,r)||(t[r]=n.params?{code:n.code,params:n.params}:{code:n.code})}return t}function $t(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n){let n=e[r],i=t[r];if(Array.isArray(n)||Array.isArray(i)){if(!Array.isArray(n)||!Array.isArray(i)||n.length!==i.length||n.some((e,t)=>e!==i[t]))return!1}else if(n!==i)return!1}return!0}function en({id:e,label:t,description:n,error:r,required:i,children:a,inline:o=!1}){return(0,Q.jsxs)(`div`,{className:F(`flex min-w-0 gap-1.5`,o?`items-center justify-between`:`flex-col`),"data-props-field":e,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsxs)(`label`,{htmlFor:e,className:`text-sm text-content`,children:[t,i&&(0,Q.jsx)(`span`,{className:`ml-0.5 text-content-muted`,children:`*`})]}),n&&(0,Q.jsx)(`span`,{id:`${e}-hint`,className:`text-xs text-content-muted`,children:n})]}),a,r&&(0,Q.jsx)(`p`,{id:`${e}-error`,role:`alert`,"data-props-error":!0,className:`text-xs text-danger`,children:r})]})}function tn({id:e,value:t,invalid:n,disabled:r,describedBy:i,onChange:a}){let{t:o}=u(),[s,c]=(0,Z.useState)(``),l=()=>{s.trim()&&(a(Zt(t,s)),c(``))};return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[t.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-wrap gap-1`,children:t.map(e=>(0,Q.jsxs)(`li`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke-strong bg-solid py-0.5 pr-0.5 pl-2 text-xs`,children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e}),(0,Q.jsx)(`button`,{type:`button`,disabled:r,"aria-label":o(`custom-ui:studio.removeTag`,{tag:e}),className:`grid size-5 place-items-center rounded-xs text-content-muted hover:bg-surface-hover hover:text-content`,onClick:()=>a(t.filter(t=>t!==e)),children:(0,Q.jsx)(he,{className:`size-3`})})]},e))}),(0,Q.jsx)(G,{id:e,value:s,disabled:r,"aria-invalid":n||void 0,"aria-describedby":i,placeholder:o(`custom-ui:studio.tagsPlaceholder`),onChange:e=>c(e.target.value),onBlur:l,onKeyDown:e=>{e.key===`Enter`||e.key===`,`?(e.preventDefault(),l()):e.key===`Backspace`&&!s&&t.length&&a(t.slice(0,-1))}})]})}function nn({field:e,id:t,value:n,error:r,disabled:i,onChange:a}){let{t:o}=u(),s=[e.description?`${t}-hint`:``,r?`${t}-error`:``].filter(Boolean).join(` `)||void 0,c={id:t,disabled:i,"aria-invalid":r?!0:void 0,"aria-describedby":s};switch(e.kind){case`switch`:return(0,Q.jsx)(De,{...c,checked:n===!0,onCheckedChange:e=>a(e)});case`segmented`:return(0,Q.jsx)(P,{size:`sm`,"aria-label":e.label,disabled:i,value:typeof n==`string`&&n?n:e.defaultValue??``,onValueChange:e=>a(e),options:e.options.map(e=>({value:e,label:e}))});case`select`:return(0,Q.jsxs)(Ee,{value:typeof n==`string`&&n?n:void 0,disabled:i,onValueChange:e=>a(e),children:[(0,Q.jsx)(Ce,{...c,className:`w-full`,children:(0,Q.jsx)(Se,{placeholder:o(`custom-ui:studio.selectPlaceholder`)})}),(0,Q.jsx)(we,{children:e.options.map(e=>(0,Q.jsx)(Te,{value:e,children:e},e))})]});case`tags`:return(0,Q.jsx)(tn,{id:t,value:Array.isArray(n)?n:[],invalid:!!r,disabled:i,describedBy:s,onChange:a});case`textarea`:return(0,Q.jsx)(Ue,{...c,rows:3,maxLength:e.maxLength,value:typeof n==`string`?n:``,onChange:e=>a(e.target.value)});case`number`:return(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(G,{...c,inputMode:e.integer?`numeric`:`decimal`,value:typeof n==`string`?n:``,placeholder:e.defaultValue===void 0?void 0:String(e.defaultValue),className:`font-mono tabular-nums`,onChange:e=>a(e.target.value)}),e.unit&&(0,Q.jsx)(`span`,{className:`flex-none text-xs text-content-muted`,children:e.unit})]});case`color`:return(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-6 flex-none rounded-sm border border-stroke-strong`,style:{background:typeof n==`string`&&n?n:`transparent`}}),(0,Q.jsx)(G,{...c,maxLength:e.maxLength,value:typeof n==`string`?n:``,placeholder:`#RRGGBB`,className:`font-mono`,onChange:e=>a(e.target.value)})]});default:return(0,Q.jsx)(G,{...c,type:e.kind===`url`?`url`:`text`,maxLength:e.maxLength,value:typeof n==`string`?n:``,className:F(e.kind===`url`&&`font-mono`),onChange:e=>a(e.target.value)})}}function rn({row:e,instance:t,notify:n,onPreview:r,onSave:i}){let{t:a,language:o}=u(),s=(0,Z.useId)(),c=e.manifest?.props,l=(0,Z.useMemo)(()=>Jt(c,o),[o,c]),d=(0,Z.useMemo)(()=>Yt(l,t?.props),[l,t]),[f,p]=(0,Z.useState)(d),[m,h]=(0,Z.useState)(t?.title??``),[_,v]=(0,Z.useState)({}),[b,x]=(0,Z.useState)(``),[S,C]=(0,Z.useState)(!1),w=!$t(f,d)||m!==(t?.title??``);(0,Z.useEffect)(()=>{let e=nt(c,Xt(l,f));e.errors.length||r({title:m,props:e.value})},[l,r,c,m,f]);let T=(e,t)=>{p(n=>({...n,[e]:t})),v(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},ee=async()=>{if(t){C(!0),v({}),x(``);try{await i(t,{title:m.trim(),props:Xt(l,f)}),n(a(`custom-ui:studio.propsSaved`))}catch(e){let t=g(e);if(t===`component_props_invalid`){let t=Qt(y(e));v(t);let n=l.find(e=>Object.hasOwn(t,e.key));n&&document.getElementById(`${s}-${n.key}`)?.focus()}else t===`component_title_invalid`?x(q(t,a)):n(t?`${a(`custom-ui:studio.saveFailed`)} ${q(t,a)}`:a(`custom-ui:studio.saveFailed`))}finally{C(!1)}}},E=e=>{let t=_[e];return t?q(t.code,a,t.params):void 0},te=l.some(e=>e.kind===`url`||e.kind===`textarea`),D=`${s}-title`;return(0,Q.jsxs)(`form`,{"data-props-form":t?.instanceId??`preview`,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),ee()},children:[!t&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:a(`custom-ui:studio.previewPropsHint`)}),(0,Q.jsx)(en,{id:D,label:a(`custom-ui:studio.cardTitle`),error:b,children:(0,Q.jsx)(G,{id:D,value:m,maxLength:80,disabled:S,"aria-invalid":b?!0:void 0,placeholder:a(`custom-ui:studio.cardTitlePlaceholder`),onChange:e=>{h(e.target.value),x(``)}})}),l.map(e=>{let t=`${s}-${e.key}`,n=E(e.key);return(0,Q.jsx)(en,{id:t,label:e.label,description:e.description,required:e.required,error:n,inline:e.kind===`switch`,children:(0,Q.jsx)(nn,{field:e,id:t,value:f[e.key]??``,error:n,disabled:S,onChange:t=>T(e.key,t)})},e.key)}),_[``]&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-xs text-danger`,children:q(_[``].code,a,_[``].params)}),te&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:a(`custom-ui:studio.propsPlaintext`)}),t&&(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(I,{type:`button`,size:`sm`,variant:`ghost`,disabled:S||!w,onClick:()=>{p(d),h(t.title),v({}),x(``)},children:a(`custom-ui:studio.propsReset`)}),(0,Q.jsx)(I,{type:`submit`,size:`sm`,disabled:S||!w,"data-props-save":!0,children:a(`custom-ui:studio.propsSave`)})]})]})}function an({title:e,aside:t,children:n,className:r}){return(0,Q.jsxs)(`section`,{className:F(`flex flex-col gap-2.5`,r),children:[(0,Q.jsxs)(`header`,{className:`flex items-baseline justify-between gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-content`,children:e}),t&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:t})]}),n]})}function on(e,t){return f({queryKey:_.versions(e),queryFn:({signal:t})=>at(e,t),enabled:t&&!!e,retry:!1,staleTime:1e4,refetchOnWindowFocus:!1})}function sn(e,t){return f({queryKey:_.usage(e),queryFn:({signal:t})=>Ke(e,t),enabled:t&&!!e,retry:!1,refetchInterval:15e3,refetchOnWindowFocus:!1})}function cn(e){return f({queryKey:_.trash(),queryFn:({signal:e})=>Xe(e),enabled:e,retry:!1,refetchOnWindowFocus:!1})}function ln(e){return f({queryKey:_.staged(e),queryFn:({signal:t})=>ot(e,t),enabled:!!e,retry:!1,refetchOnWindowFocus:!1,staleTime:1/0})}function un(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}function dn(e){let t=d(),{t:n}=u();return(0,Z.useMemo)(()=>{let r=()=>t.invalidateQueries({queryKey:_.all}),i=async(t,i)=>{try{let e=await t();return await r(),e}catch(t){let r=g(t);return e(r?`${i} ${q(r,n)}`:i),null}};return{notify:e,restoreVersion:async(t,r)=>{let a=await i(()=>Qe(t.id,r),n(`custom-ui:versions.restoreFailed`));return a&&e(n(`custom-ui:versions.restored`,{n:r})),a},exportZip:async t=>{try{un(await Mt(t.id),`${t.id}.zip`),e(n(`custom-ui:exporting.done`,{name:t.name}))}catch(t){let r=g(t);e(r?`${n(`custom-ui:exporting.failed`)} ${q(r,n)}`:n(`custom-ui:exporting.failed`))}},stageImport:e=>i(()=>lt(e),n(`custom-ui:importing.stageFailed`)),trust:async t=>{let r=await i(()=>ct(t),n(`custom-ui:importing.trustFailed`));return r&&e(r.replaced?n(`custom-ui:importing.replaced`,{name:r.component.name}):n(`custom-ui:importing.trusted`,{name:r.component.name})),r},discard:async t=>{let r=await i(()=>rt(t).then(()=>!0),n(`custom-ui:importing.discardFailed`));return r&&e(n(`custom-ui:importing.discarded`)),r},restoreTrash:async t=>{let r=await i(()=>Tt(t.entry),n(`custom-ui:trash.restoreFailed`));return r&&e(n(`custom-ui:trash.restored`,{name:t.name})),r},purgeTrash:async t=>{let r=await i(()=>st(t.entry).then(()=>!0),n(`custom-ui:trash.purgeFailed`));return r&&e(n(`custom-ui:trash.purged`,{name:t.name})),r},setRevoked:(e,t)=>i(()=>Ze(e.id,t),n(`custom-ui:usage.revokeFailed`))}},[t,e,n])}var fn=(0,Z.lazy)(()=>t(()=>import(`./public-diff-DWbitsnS.js`).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])));function pn({version:e}){let{t}=u();return!e.files.length&&!e.deleted.length?null:(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-wrap gap-1`,"data-version-files":!0,children:[e.files.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke bg-surface-subtle px-1.5 font-mono text-[11px] text-content-secondary`,children:[(0,Q.jsx)(`span`,{className:`truncate`,children:e.path}),e.added>0&&(0,Q.jsxs)(`span`,{className:`text-st-done tabular-nums`,children:[`+`,e.added]}),e.removed>0&&(0,Q.jsxs)(`span`,{className:`text-st-fail tabular-nums`,children:[`−`,e.removed]})]},e.path)),e.deleted.map(e=>(0,Q.jsx)(`span`,{className:`inline-flex max-w-full items-center gap-1 rounded-sm border border-stroke px-1.5 font-mono text-[11px] text-content-muted line-through`,title:t(`custom-ui:versions.deletedFile`),children:e},`deleted:${e}`))]})}function mn(e,t,n){return[dt(e,t),e.summary,e.at?ze(e.at,n):``].filter(Boolean).join(` · `)}function hn({row:e,enabled:t,notify:n,actions:r}){let{t:i,language:a}=u(),o=on(e.id,t),[s,c]=(0,Z.useState)(null),[l,d]=(0,Z.useState)(0),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),_=(0,Z.useRef)(null),v=K(!!f);if(!t)return null;let y=o.data,b=async(t,r)=>{_.current=r,d(t.n);try{c({...await $e(e.id,t.n),n:t.n})}catch(e){let t=g(e);n(t?`${i(`custom-ui:versions.diffFailed`)} ${q(t,i)}`:i(`custom-ui:versions.diffFailed`))}finally{d(0)}},x=async()=>{if(!f)return;h(!0);let t=await r.restoreVersion(e,f.n);h(!1),t&&p(null)};return(0,Q.jsxs)(an,{title:i(`custom-ui:versions.title`),aside:y?i(`custom-ui:versions.keep`,{count:y.max}):void 0,children:[o.isPending?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:versions.loading`)}):o.error||!y?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:versions.failed`)}):(0,Q.jsxs)(`ol`,{"data-component-versions":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:[(0,Q.jsxs)(`li`,{"data-component-version":y.current.n,"data-version-current":!0,className:`flex min-w-0 flex-col gap-1 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 text-sm`,children:[(0,Q.jsxs)(`strong`,{className:`font-mono font-medium tabular-nums`,children:[`v`,y.current.n]}),(0,Q.jsx)(`span`,{className:`text-xs text-content-secondary`,children:i(`custom-ui:versions.current`)}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-xs text-content-muted`,children:mn(y.current,i,a)})]}),(0,Q.jsx)(pn,{version:y.current})]}),y.versions.map(e=>(0,Q.jsxs)(`li`,{"data-component-version":e.n,className:`flex min-w-0 items-center gap-2 border-b border-stroke px-3 py-1.5 last:border-b-0`,children:[(0,Q.jsxs)(`strong`,{className:`flex-none font-mono text-sm font-medium tabular-nums`,children:[`v`,e.n]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-content-muted`,children:mn(e,i,a)||i(`custom-ui:versions.noSummary`)}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,disabled:l===e.n,"data-version-compare":e.n,onClick:t=>void b(e,t.currentTarget),children:[(0,Q.jsx)(Pt,{}),i(`custom-ui:versions.compare`)]}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-version-restore":e.n,onClick:t=>{_.current=t.currentTarget,p(e)},children:[(0,Q.jsx)(de,{}),i(`custom-ui:versions.restore`)]})]},e.n)),!y.versions.length&&(0,Q.jsx)(`li`,{className:`px-3 py-2 text-xs text-content-muted`,children:i(`custom-ui:versions.onlyCurrent`)})]}),(0,Q.jsx)(W,{open:!!f,onOpenChange:e=>!e&&!m&&p(null),children:(0,Q.jsxs)(B,{onCloseAutoFocus:v,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:versions.restoreTitle`,{n:f?.n??0})}),(0,Q.jsx)(z,{children:i(`custom-ui:versions.restoreHint`,{n:f?.n??0,next:(y?.current.n??0)+1,current:y?.current.n??0})})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:m,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{disabled:m,"data-version-restore-confirm":!0,onClick:()=>void x(),children:i(`custom-ui:versions.restoreConfirm`,{n:f?.n??0})})]})]})}),(0,Q.jsx)(W,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,Q.jsxs)(B,{"data-version-diff":s?.n,scrollMode:`body`,className:`h-[min(760px,calc(100dvh-2rem))] max-w-[min(960px,calc(100vw-2rem))]`,onCloseAutoFocus:e=>{e.preventDefault(),_.current?.focus()},children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:versions.diffTitle`,{n:s?.n??0,current:y?.current.n??0})}),(0,Q.jsx)(z,{children:s?.files.length?s.files.map(e=>e.path).join(` · `):i(`custom-ui:versions.noDiff`)})]}),(0,Q.jsx)(He,{className:`-mx-4 border-t border-stroke`,children:s&&s.files.length>0&&(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(fn,{diff:s.diff,truncated:s.truncated,mode:`unified`})})})]})})]})}var gn=[`overview-card`,`session-panel`,`feature-page`,`floating`],_n={"overview-card":Ft,"session-panel":le,"feature-page":te,floating:O};function vn(e,t){return e.source===`agent`?t(`custom-ui:studio.sourceAgent`):e.source===`template`?t(`custom-ui:studio.sourceTemplate`):e.source===`import`?t(`custom-ui:studio.sourceImport`):t(`custom-ui:studio.sourceLocal`)}function yn(e,t){let n=Y(e.surface,t),r=e.size?`${n} ${e.size}`:n;return e.title?`${r} · ${e.title}`:r}function bn(e){let t=e.replace(/[\\/]+$/,``).split(/[\\/]/);return t[t.length-1]||e}function xn({row:e,actions:t}){let{t:n,language:r}=u(),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`grid size-10 flex-none place-items-center rounded-[var(--r-md)] border border-stroke bg-solid text-content-secondary`,children:(0,Q.jsx)(O,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0})}),(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsx)(`strong`,{className:`truncate text-[15px] font-semibold`,children:J(e,r)}),(0,Q.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:[e.version?`v${e.version}`:``,e.kind===`broken`?n(`custom-ui:studio.statusBroken`):n(`custom-ui:studio.nativeComponent`),e.kind===`native`?vn(e,n):``].filter(Boolean).join(` · `)})]}),e.kind===`native`&&(0,Q.jsxs)(`label`,{className:`inline-flex flex-none items-center gap-2 text-xs text-content-secondary`,children:[n(`custom-ui:studio.enable`),(0,Q.jsx)(De,{checked:e.enabled,disabled:i,"aria-label":n(`custom-ui:studio.enable`),"data-component-enable":!0,onCheckedChange:async n=>{a(!0),await t.setEnabled(e,n),a(!1)}})]})]})}function Sn({row:e}){let{t}=u();return e.errors.length?(0,Q.jsx)(`ul`,{"data-component-errors":!0,className:`flex flex-col gap-1 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-3 py-2 text-xs text-content-secondary`,children:e.errors.map(e=>(0,Q.jsxs)(`li`,{className:`min-w-0 break-all`,children:[e.path&&(0,Q.jsx)(`code`,{className:`mr-1.5 font-mono`,children:e.path}),q(e.code,t,e.params)]},`${e.path}:${e.code}`))}):null}function Cn({row:e,instances:t,selectedInstanceId:n,notify:r,actions:i,onSelectInstance:a,onPreview:o}){let{t:s}=u(),c=t.filter(t=>t.componentId===e.id),l=c.find(e=>e.instanceId===n)??null;return(0,Q.jsxs)(an,{title:s(`custom-ui:studio.props`),aside:s(`custom-ui:studio.propsPerInstance`),children:[c.length>0&&(0,Q.jsxs)(Ee,{value:l?.instanceId??`preview`,onValueChange:e=>a(e===`preview`?null:e),children:[(0,Q.jsx)(Ce,{className:`w-full`,"aria-label":s(`custom-ui:studio.editingInstance`),"data-props-instance":!0,children:(0,Q.jsx)(Se,{})}),(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Te,{value:`preview`,children:s(`custom-ui:studio.previewProps`)}),c.map(e=>(0,Q.jsxs)(Te,{value:e.instanceId,children:[yn(e,s),!e.enabled&&` · ${s(`custom-ui:studio.instanceClosed`)}`]},e.instanceId))]})]}),(0,Q.jsx)(rn,{row:e,instance:l,notify:r,onPreview:o,onSave:i.saveProps},l?.instanceId??`preview:${e.id}`)]})}function wn({row:e,usageEnabled:t=!1,canRevoke:n=!1,lifecycle:r}){let{t:i,language:a}=u(),o=e.manifest?.capabilities??{},s=sn(e.id,t),[c,l]=(0,Z.useState)(``),d=[`network`,`notify`,`sessions.read`,`sessions.open`,`storage`,`provider.request`].filter(e=>o[e]),f=[`sessions.read`,`notify`,`network`,`storage`,`provider.request`].filter(e=>!o[e]).map(e=>St(e,i)),p=r?.notify??(()=>void 0),m=async(t,n)=>{if(!r)return;l(t);let a=n?[...new Set([...e.revoked,t])]:e.revoked.filter(e=>e!==t),o=await r.setRevoked(e,a);l(``),o&&p(i(n?`custom-ui:usage.revoked`:`custom-ui:usage.unrevoked`,{capability:St(t,i)}))};return(0,Q.jsxs)(an,{title:i(`custom-ui:studio.capabilities`),children:[d.length?(0,Q.jsx)(`ul`,{"data-component-capabilities":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke`,children:d.map(l=>{let u=o[l],d=e.revoked.includes(l),f=s.data?.usage[l],p=l===`network`?o.network?.hosts.join(`, `):l===`storage`?i(`custom-ui:studio.capStorageQuota`,{kb:o.storage?.quotaKb??0}):l===`provider.request`?`${o[`provider.request`]?.methods.join(`/`)} ${o[`provider.request`]?.paths.join(`, `)}`:``;return(0,Q.jsxs)(`li`,{"data-component-capability":l,"data-capability-revoked":d||void 0,className:`flex min-w-0 items-start gap-2 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:F(d&&`text-content-muted line-through`),children:St(l,i)}),p&&(0,Q.jsx)(`code`,{title:p,className:`min-w-0 truncate font-mono text-xs text-content-secondary`,children:p}),d&&(0,Q.jsx)(We,{className:`flex-none text-content-secondary`,children:i(`custom-ui:usage.revokedBadge`)})]}),u?.reason&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:u.reason}),t&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,"data-capability-usage":!0,children:f?[i(`custom-ui:usage.last`,{time:ze(f.lastAt,a)}),f.target,i(`custom-ui:usage.today`,{count:f.today})].filter(Boolean).join(` · `):i(`custom-ui:usage.never`)})]}),n&&r&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,disabled:c===l,"data-capability-toggle":l,className:`flex-none`,onClick:()=>void m(l,!d),children:i(d?`custom-ui:usage.restore`:`custom-ui:usage.revoke`)})]},l)})}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capNone`)}),(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capUndeclared`,{list:[...f,i(`custom-ui:studio.capFiles`),i(`custom-ui:studio.capClipboard`)].join(` · `)})}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:i(`custom-ui:studio.capExplainer`)})]})}function Tn({value:e,disabled:t,onChange:n}){let{t:r}=u(),{projects:i}=Re(),a=i.filter(e=>e.cwd),o=e.type===`project`?e.cwd:`*`;return e.type===`project`&&!a.some(t=>t.cwd===e.cwd)&&a.push({key:e.cwd,cwd:e.cwd,count:0}),(0,Q.jsxs)(Ee,{value:o,disabled:t,onValueChange:e=>n(e===`*`?{type:`all`}:{type:`project`,cwd:e}),children:[(0,Q.jsx)(Ce,{size:`sm`,className:`w-full min-w-0`,"aria-label":r(`custom-ui:studio.scope`),"data-placement-scope":!0,children:(0,Q.jsx)(Se,{})}),(0,Q.jsxs)(we,{children:[(0,Q.jsx)(Te,{value:`*`,children:r(`custom-ui:studio.scopeAll`)}),a.map(e=>(0,Q.jsx)(Te,{value:e.cwd,children:r(`custom-ui:studio.scopeProject`,{name:bn(e.cwd)})},e.cwd))]})]})}function En({row:e,instances:t,actions:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1),[o,s]=(0,Z.useState)(wt(e.manifest)),[c,l]=(0,Z.useState)({type:`all`}),[d,f]=(0,Z.useState)(null),p=K(d!==null),m=mt(e),h=t.filter(t=>t.componentId===e.id),g=e.manifest?.placements.find(e=>e.surface===`overview-card`)?.sizes??[`S`,`M`],_=async e=>{a(!0);try{await e()}finally{a(!1)}};return(0,Q.jsxs)(an,{title:r(`custom-ui:studio.placements`),aside:!m&&e.kind===`native`?r(`custom-ui:studio.placeNeedsEnable`):void 0,children:[(0,Q.jsx)(`ul`,{className:`grid grid-cols-1 gap-2 min-[360px]:grid-cols-2`,"data-component-placements":!0,children:gn.map(a=>{let u=_n[a],d=h.filter(e=>e.surface===a),p=d.filter(e=>e.enabled),v=p.length>0,y=At(e.manifest,a),b=i||!m||!y,x=a===`overview-card`&&p.length===1?p[0]:null,S=()=>{v?p.length>1?f(p):_(()=>n.unplace(p[0])):_(()=>n.place(e,t,{surface:a,...a===`overview-card`?{size:o}:{},...a===`session-panel`?{scope:c}:{}}))},C=d[0];return(0,Q.jsxs)(`li`,{"data-placement-tile":a,"data-placement-checked":v||void 0,className:F(`flex min-w-0 flex-col gap-2 rounded-[var(--r-md)] border px-2.5 py-2`,v?`border-stroke-strong bg-surface-subtle`:`border-stroke`,!y&&`opacity-60`),children:[(0,Q.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm pointer-coarse:min-h-11`,children:[(0,Q.jsx)(ge,{checked:v,disabled:b,"aria-describedby":y?void 0:`placement-${a}-hint`,onCheckedChange:S}),(0,Q.jsx)(u,{className:`size-3.5 flex-none text-content-muted`,"aria-hidden":!0}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:Y(a,r)}),a===`overview-card`&&p.length>1&&(0,Q.jsxs)(We,{className:`flex-none`,children:[`×`,p.length]})]}),!y&&(0,Q.jsx)(`span`,{id:`placement-${a}-hint`,className:`text-xs text-content-muted`,children:r(`custom-ui:studio.placeUndeclared`)}),y&&a===`overview-card`&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[g.length>1&&(0,Q.jsx)(P,{size:`sm`,"aria-label":r(`custom-ui:studio.cardSize`),disabled:b,value:x?.size??o,onValueChange:e=>{s(e),x&&_(()=>n.patchInstance(x,{size:e}))},options:g.map(e=>({value:e,label:e}))}),v&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,disabled:b,title:r(`custom-ui:studio.addCard`),"aria-label":r(`custom-ui:studio.addCard`),onClick:()=>void _(()=>n.place(e,t,{surface:a,size:o})),children:(0,Q.jsx)(ue,{})})]}),y&&a===`session-panel`&&(0,Q.jsx)(Tn,{value:C?.scope??c,disabled:b,onChange:e=>{l(e),C&&_(()=>n.patchInstance(C,{scope:e}))}}),y&&a===`floating`&&(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.floatingPhoneHint`)})]},a)})}),(0,Q.jsx)(W,{open:d!==null,onOpenChange:e=>!e&&f(null),children:(0,Q.jsxs)(B,{onCloseAutoFocus:p,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:r(`custom-ui:studio.unplaceAllTitle`,{count:d?.length??0})}),(0,Q.jsx)(z,{children:r(`custom-ui:studio.unplaceAllHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,onClick:()=>f(null),children:r(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:i,onClick:()=>{let e=d??[];f(null),_(async()=>{for(let t of e)await n.unplace(t)})},children:r(`custom-ui:studio.unplaceAll`)})]})]})})]})}function Dn({row:e,instances:t,actions:n,className:r}){let{t:i}=u(),a=mt(e);return(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsxs)(I,{size:`sm`,disabled:!a,"data-component-place":!0,className:r,children:[i(`custom-ui:studio.placeTo`),(0,Q.jsx)(re,{})]})}),(0,Q.jsx)(N,{align:`start`,className:`w-56`,children:gn.map(r=>{let a=At(e.manifest,r),o=r!==`overview-card`&&t.some(t=>t.componentId===e.id&&t.surface===r&&t.enabled);return(0,Q.jsxs)(M,{disabled:!a||o,"data-component-place-item":r,onSelect:()=>void n.place(e,t,{surface:r,...r===`overview-card`?{size:wt(e.manifest)}:{}}),children:[Y(r,i),(0,Q.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:a?o?i(`custom-ui:studio.placed`):``:i(`custom-ui:studio.placeUndeclaredShort`)})]},r)})})]})}function On({row:e,actions:t,onDeleted:n,variant:r=`menu`}){let{t:i,language:a}=u(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),d=(0,Z.useRef)(null),f=K(o,d),p=J(e,a),m=async()=>{l(!0);let r=await t.remove(e);l(!1),r&&(s(!1),n())};return(0,Q.jsxs)(Q.Fragment,{children:[r===`menu`?(0,Q.jsxs)(be,{children:[(0,Q.jsx)(ye,{asChild:!0,children:(0,Q.jsx)(I,{ref:d,size:`icon-sm`,variant:`ghost`,"aria-label":i(`custom-ui:studio.more`),"data-component-more":!0,children:(0,Q.jsx)(ce,{})})}),(0,Q.jsx)(N,{align:`end`,children:(0,Q.jsxs)(M,{variant:`destructive`,"data-component-delete":!0,onSelect:()=>s(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:studio.deleteComponent`)]})})]}):(0,Q.jsxs)(I,{variant:`ghost`,size:`sm`,className:`text-danger`,"data-component-delete":!0,onClick:()=>s(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:studio.deleteComponent`)]}),(0,Q.jsx)(W,{open:o,onOpenChange:e=>!e&&!c&&s(!1),children:(0,Q.jsxs)(B,{onCloseAutoFocus:f,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:studio.deleteTitle`,{name:p})}),(0,Q.jsx)(z,{children:i(`custom-ui:studio.deleteHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:c,onClick:()=>s(!1),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:c,"data-component-delete-confirm":!0,onClick:()=>void m(),children:i(`custom-ui:studio.delete`)})]})]})})]})}function kn({row:e,lifecycle:t,className:n}){let{t:r}=u(),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,disabled:i,"data-component-export":!0,className:n,onClick:async()=>{a(!0),await t.exportZip(e),a(!1)},children:[(0,Q.jsx)(se,{}),r(`custom-ui:exporting.button`)]})}function An({row:e,instances:t,selectedInstanceId:n,canDelete:r,features:i,notify:a,actions:o,lifecycle:s,onSelectInstance:c,onPreview:l,onViewSource:d,onDeleted:f}){let{t:p}=u(),m=e.kind===`native`&&e.status===`ready`&&!!e.manifest;return(0,Q.jsxs)(`div`,{"data-studio-settings":!0,className:`flex h-full min-h-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-4 pt-4 pb-5`,children:[(0,Q.jsx)(xn,{row:e,actions:o}),(0,Q.jsx)(Sn,{row:e}),m&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Cn,{row:e,instances:t,selectedInstanceId:n,notify:a,actions:o,onSelectInstance:c,onPreview:l}),(0,Q.jsx)(wn,{row:e,usageEnabled:i.usage,canRevoke:i.revoke,lifecycle:s}),(0,Q.jsx)(En,{row:e,instances:t,actions:o})]}),e.kind===`native`&&(0,Q.jsx)(hn,{row:e,enabled:i.versions,notify:a,actions:s})]}),(0,Q.jsxs)(`footer`,{className:`flex flex-none items-center gap-2 border-t border-stroke bg-panel px-4 py-2.5`,children:[m&&(0,Q.jsx)(Dn,{row:e,instances:t,actions:o}),(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,onClick:d,"data-component-view-source":!0,children:[(0,Q.jsx)(k,{}),p(`custom-ui:studio.viewSource`)]}),i.export&&e.kind===`native`&&(0,Q.jsx)(kn,{row:e,lifecycle:s}),r&&(0,Q.jsx)(`span`,{className:`ml-auto`,children:(0,Q.jsx)(On,{row:e,actions:o,onDeleted:f})})]})]})}var jn=(0,Z.createContext)({code:``}),Mn=({code:e,language:t,className:n,showLineNumbers:r=!1,children:i,...a})=>{let o={code:e};return(0,Q.jsx)(jn.Provider,{value:o,children:(0,Q.jsxs)(`div`,{className:F(`group relative w-full overflow-hidden rounded-md border bg-background text-foreground`,n),"data-language":t,...a,children:[(0,Q.jsx)(`div`,{className:`relative overflow-auto`,children:(0,Q.jsx)(`pre`,{className:`m-0 p-4 text-sm leading-relaxed`,children:(0,Q.jsx)(`code`,{className:`font-mono whitespace-pre`,children:e})})}),i]})})},Nn=({onCopy:e,onError:t,timeout:n=2e3,children:r,className:i,...a})=>{let[o,s]=(0,Z.useState)(!1),{code:c}=(0,Z.useContext)(jn),l=async()=>{if(typeof window>`u`||!navigator?.clipboard?.writeText){t?.(Error(`Clipboard API not available`));return}try{await navigator.clipboard.writeText(c),s(!0),e?.(),setTimeout(()=>s(!1),n)}catch(e){t?.(e)}},u=o?ne:oe;return(0,Q.jsx)(I,{className:F(`shrink-0`,i),onClick:l,size:`icon`,variant:`ghost`,...a,children:r??(0,Q.jsx)(u,{size:14})})},Pn=(0,Z.lazy)(()=>t(()=>import(`./public-diff-DWbitsnS.js`).then(e=>({default:e.InlineGitDiff})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))),Fn=/\.(?:m?js|css|json|svg|md|txt)$/i;function In(e){return/\.m?js$/i.test(e)?`javascript`:/\.css$/i.test(e)?`css`:/\.json$/i.test(e)?`json`:/\.svg$/i.test(e)?`xml`:`text`}function Ln({enabled:e,lifecycle:t,onStaged:n,className:r}){let{t:i}=u(),a=(0,Z.useRef)(null),[o,s]=(0,Z.useState)(!1);return!e||!t?(0,Q.jsxs)(I,{size:`sm`,variant:`ghost`,"aria-disabled":`true`,title:i(`custom-ui:importing.unsupported`),"aria-label":`${i(`custom-ui:studio.importZip`)} · ${i(`custom-ui:importing.unsupported`)}`,"data-component-import":!0,className:r,onClick:e=>e.preventDefault(),children:[(0,Q.jsx)(Nt,{}),i(`custom-ui:studio.importZip`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{size:`sm`,variant:`ghost`,disabled:o,"data-component-import":!0,className:r,onClick:()=>a.current?.click(),children:[(0,Q.jsx)(Nt,{}),i(o?`custom-ui:importing.staging`:`custom-ui:studio.importZip`)]}),(0,Q.jsx)(`input`,{ref:a,type:`file`,accept:`.zip,application/zip`,hidden:!0,"data-component-import-input":!0,onChange:async e=>{let r=e.target.files?.[0];if(e.target.value=``,!r)return;s(!0);let i=await t.stageImport(r);s(!1),i&&n?.(i)}})]})}function Rn({staged:e,phone:t=!1,onReview:n}){let{t:r}=u();return(0,Q.jsxs)(`div`,{"data-staged-row":e.stageId,className:F(`flex flex-col gap-1.5 rounded-[var(--r-md)] border border-dashed border-st-attn-border bg-st-attn-soft px-2.5 py-2`,t&&`px-3.5 py-3`),children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:`size-1.5 flex-none rounded-full bg-st-attn-fill`}),(0,Q.jsx)(`strong`,{className:`min-w-0 truncate font-medium`,children:e.fileName}),(0,Q.jsx)(`span`,{className:`flex-none text-xs text-content-muted`,children:r(`custom-ui:importing.shared`)})]}),(0,Q.jsx)(`p`,{className:`text-xs text-content-secondary`,children:r(`custom-ui:importing.needsReview`)}),(0,Q.jsxs)(I,{size:t?`sm`:`xs`,variant:`secondary`,className:F(`w-fit`,t&&`min-h-11`),"data-staged-review":e.stageId,onClick:n,children:[(0,Q.jsx)(pe,{}),r(`custom-ui:importing.review`)]})]})}function zn(e){return e===`danger`?`text-st-fail`:`text-content-secondary`}function Bn(e,t){switch(e){case`fetch`:return t(`custom-ui:scan.ruleFetch`);case`xhr`:return t(`custom-ui:scan.ruleXhr`);case`websocket`:return t(`custom-ui:scan.ruleWebsocket`);case`eval`:return t(`custom-ui:scan.ruleEval`);case`function`:return t(`custom-ui:scan.ruleFunction`);case`cookie`:return t(`custom-ui:scan.ruleCookie`);case`local-storage`:return t(`custom-ui:scan.ruleLocalStorage`);case`app-api`:return t(`custom-ui:scan.ruleAppApi`);case`dynamic-import`:return t(`custom-ui:scan.ruleDynamicImport`);default:return e}}function Vn({scan:e}){let{t}=u();if(e.status!==`ok`)return(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:scan.unsupported`)});let n=!e.findings.length&&!e.summary.undeclaredHosts;return(0,Q.jsxs)(`div`,{"data-component-scan":!0,className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:F(`text-xs`,e.summary.danger||e.summary.undeclaredHosts?`text-st-fail`:`text-content-secondary`),"data-scan-summary":!0,children:n?t(`custom-ui:scan.clean`):t(`custom-ui:scan.summary`,{danger:e.summary.danger,warn:e.summary.warn+e.summary.info,hosts:e.summary.undeclaredHosts})}),e.hosts.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-0.5 text-xs`,"data-scan-hosts":!0,children:e.hosts.map(e=>(0,Q.jsxs)(`li`,{"data-scan-host":e.host,"data-declared":e.declared,className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`code`,{className:F(`min-w-0 truncate font-mono`,e.declared?`text-content-secondary`:`text-st-fail`),children:e.host}),(0,Q.jsx)(`span`,{className:e.declared?`text-content-muted`:`text-st-fail`,children:e.declared?t(`custom-ui:scan.hostDeclared`):t(`custom-ui:scan.hostUndeclared`)})]},e.host))}),e.findings.length>0&&(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1.5`,"data-scan-findings":!0,children:e.findings.map((e,n)=>(0,Q.jsxs)(`li`,{"data-scan-finding":e.rule,"data-severity":e.severity,className:`flex min-w-0 flex-col gap-0.5 text-xs`,children:[(0,Q.jsxs)(`span`,{className:F(`flex items-center gap-1.5`,zn(e.severity)),children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:F(`size-1.5 flex-none rounded-full`,e.severity===`danger`?`bg-st-fail`:`bg-content-muted`)}),Bn(e.rule,t),(0,Q.jsxs)(`code`,{className:`ml-auto flex-none font-mono text-content-muted`,children:[e.file,`:`,e.line]})]}),e.excerpt&&(0,Q.jsx)(`code`,{className:`block truncate rounded-sm bg-surface-subtle px-1.5 py-0.5 font-mono text-[11px] text-content-secondary`,children:e.excerpt})]},`${e.file}:${e.line}:${e.rule}:${n}`))}),e.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:scan.truncated`)})]})}function Hn({title:e,children:t}){return(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-semibold text-content-secondary`,children:e}),t]})}function Un({stageId:e,lifecycle:t,onClose:n,onTrusted:r}){let{t:i}=u(),a=ln(e),[o,s]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(``),[d,p]=(0,Z.useState)(!1),m=(0,Z.useId)(),h=a.data,g=(h?.files??[]).filter(e=>Fn.test(e.path)),v=h?.manifest?.entry??``,y=g.find(e=>e.path===o)?.path??g.find(e=>e.path===v)?.path??g[0]?.path??``;(0,Z.useEffect)(()=>{s(``),p(!1)},[e]);let b=f({queryKey:[..._.staged(e),`file`,y],queryFn:({signal:t})=>Ye(e,y,t),enabled:!!(e&&y),retry:!1,staleTime:1/0,refetchOnWindowFocus:!1}),x=h?.staged,S=h?.manifest?.capabilities??{},C=[`network`,`notify`,`sessions.read`,`sessions.open`,`storage`,`provider.request`].filter(e=>S[e]),w=async()=>{l(`trust`);let n=await t.trust(e);l(``),n&&r(n.component)},T=async()=>{l(`discard`);let r=await t.discard(e);l(``),r&&n()};return(0,Q.jsx)(W,{open:!!e,onOpenChange:e=>!e&&!c&&n(),children:(0,Q.jsxs)(B,{"data-trust-dialog":e,scrollMode:`body`,className:`h-[min(820px,calc(100dvh-2rem))] max-w-[min(1040px,calc(100vw-2rem))]`,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:x?i(`custom-ui:importing.reviewTitle`,{name:h?.manifest?.name||x.name,version:x.version?` v${x.version}`:``}):i(`custom-ui:importing.reviewLoading`)}),(0,Q.jsx)(z,{className:`flex flex-wrap gap-x-2 gap-y-0.5 font-mono text-xs`,children:x&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{children:x.fileName}),(0,Q.jsx)(`span`,{children:Be(x.bytes)}),(0,Q.jsxs)(`span`,{className:`break-all`,"data-trust-sha256":!0,children:[`sha256 `,x.sha256]})]})})]}),(0,Q.jsx)(He,{className:`-mx-4 border-y border-stroke`,children:a.isPending?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:importing.reviewLoading`)}):a.error||!h?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:importing.reviewFailed`)}):(0,Q.jsxs)(`div`,{className:`grid min-h-full grid-cols-1 md:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col gap-2 p-4 md:border-r md:border-stroke`,children:[(0,Q.jsx)(`div`,{role:`group`,id:m,"aria-label":i(`custom-ui:importing.files`),className:`flex flex-wrap gap-1`,"data-trust-files":!0,children:h.files.map(e=>Fn.test(e.path)?(0,Q.jsxs)(Ve,{size:`sm`,"aria-pressed":e.path===y,"data-trust-file":e.path,className:`font-mono`,onClick:()=>{p(!1),s(e.path)},children:[e.path,(0,Q.jsx)(`span`,{className:`text-content-muted`,children:Be(e.size)})]},e.path):(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 font-mono text-xs text-content-muted`,children:[e.path,` · `,Be(e.size)]},e.path))}),d&&h.diff?(0,Q.jsx)(`div`,{"data-trust-diff-view":!0,className:`min-h-[240px] flex-1 overflow-auto rounded-[var(--r-md)] border border-stroke`,children:(0,Q.jsx)(Z.Suspense,{fallback:null,children:(0,Q.jsx)(Pn,{diff:h.diff.diff,truncated:h.diff.truncated,mode:`unified`})})}):y&&b.data?(0,Q.jsx)(Mn,{code:b.data.content,language:In(y),"data-trust-source":y,className:`min-h-[240px] flex-1 overflow-auto bg-code [&>div]:h-full`}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:b.isPending&&y?i(`custom-ui:studio.sourceLoading`):i(`custom-ui:studio.sourceUnavailable`)}),b.data?.truncated&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:importing.truncated`)})]}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4 p-4`,children:[h.installed&&(0,Q.jsxs)(`div`,{"data-trust-replaces":!0,className:`flex flex-col gap-1.5 rounded-[var(--r-md)] border border-stroke bg-surface-subtle px-3 py-2 text-xs text-content-secondary`,children:[(0,Q.jsx)(`p`,{children:i(`custom-ui:importing.replaces`,{version:h.installed.version?`v${h.installed.version}`:``})}),h.diff&&h.diff.files.length>0&&(0,Q.jsxs)(I,{size:`xs`,variant:`secondary`,className:`w-fit`,"data-trust-diff":!0,"aria-pressed":d,onClick:()=>p(e=>!e),children:[(0,Q.jsx)(Pt,{}),d?i(`custom-ui:importing.hideDiff`):i(`custom-ui:importing.viewDiff`,{count:h.diff.files.length})]})]}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.manifest`),children:h.manifest?(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-0.5 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:`id`}),(0,Q.jsx)(`dd`,{className:`truncate font-mono`,children:h.manifest.id}),(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:i(`custom-ui:importing.entry`)}),(0,Q.jsx)(`dd`,{className:`truncate font-mono`,children:h.manifest.entry}),(0,Q.jsx)(`dt`,{className:`text-content-muted`,children:i(`custom-ui:studio.placements`)}),(0,Q.jsx)(`dd`,{children:h.manifest.placements.map(e=>Y(e.surface,i)).join(` · `)||`—`})]}):(0,Q.jsx)(`p`,{className:`text-xs text-st-fail`,children:i(`custom-ui:importing.manifestInvalid`)})}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.capabilities`),children:C.length?(0,Q.jsx)(`ul`,{className:`flex flex-col gap-1 text-xs`,"data-trust-capabilities":!0,children:C.map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col`,children:[(0,Q.jsxs)(`span`,{children:[St(e,i),e===`provider.request`&&(0,Q.jsxs)(`code`,{className:`ml-1 break-all font-mono text-content-secondary`,children:[S[`provider.request`]?.methods.join(`/`),` `,S[`provider.request`]?.paths.join(`, `)]}),e===`network`&&(0,Q.jsx)(`code`,{className:`ml-1.5 font-mono text-content-secondary`,children:S.network?.hosts.join(`, `)})]}),S[e]?.reason&&(0,Q.jsx)(`span`,{className:`text-content-muted`,children:S[e]?.reason})]},e))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:i(`custom-ui:studio.capNone`)})}),(0,Q.jsx)(Hn,{title:i(`custom-ui:importing.scan`),children:(0,Q.jsx)(Vn,{scan:h.scan})}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-content-muted`,children:i(`custom-ui:importing.explainer`)})]})]})}),(0,Q.jsxs)(H,{className:`flex-row flex-wrap items-center gap-2 sm:justify-between`,children:[(0,Q.jsx)(I,{variant:`ghost`,size:`sm`,className:`text-danger`,disabled:!!c,"data-trust-discard":!0,onClick:()=>void T(),children:i(`custom-ui:importing.discard`)}),(0,Q.jsxs)(`span`,{className:`ml-auto flex gap-2`,children:[(0,Q.jsx)(I,{variant:`outline`,size:`sm`,disabled:!!c,onClick:n,children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{size:`sm`,disabled:!!c||!h?.manifest,"data-trust-confirm":!0,onClick:()=>void w(),children:i(`custom-ui:importing.trust`)})]})]})]})})}var Wn=864e5;function Gn({enabled:e,lifecycle:t,onRestored:n,className:r}){let{t:i,language:a}=u(),o=cn(e),[s,c]=(0,Z.useState)(!1),[l,d]=(0,Z.useState)(``),[f,p]=(0,Z.useState)(null);if(!e)return null;let m=o.data?.entries??[],h=async e=>{d(e.entry);let r=await t.restoreTrash(e);d(``),r&&(c(!1),n?.(r.component))},g=async()=>{if(!f)return;d(f.entry);let e=await t.purgeTrash(f);d(``),e&&p(null)},_=e=>{if(!e.expiresAt)return i(`custom-ui:trash.keptLegacy`);let t=Math.max(0,Math.ceil((Date.parse(e.expiresAt)-Date.now())/Wn));return i(`custom-ui:trash.expiresIn`,{count:t})};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-component-trash":!0,className:r,onClick:()=>c(!0),children:[(0,Q.jsx)(j,{}),i(`custom-ui:trash.button`),m.length>0&&(0,Q.jsx)(`span`,{className:`tabular-nums`,children:m.length})]}),(0,Q.jsx)(W,{open:s,onOpenChange:e=>!l&&c(e),children:(0,Q.jsxs)(B,{size:`wide`,scrollMode:`body`,"data-trash-dialog":!0,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:trash.title`)}),(0,Q.jsx)(z,{children:i(`custom-ui:trash.hint`,{days:o.data?.retentionDays??7})})]}),(0,Q.jsx)(He,{className:`-mx-4 border-t border-stroke`,children:o.isPending?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.loading`)}):o.error?(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.failed`)}):m.length?(0,Q.jsx)(`ul`,{className:`flex flex-col`,children:m.map(e=>(0,Q.jsxs)(`li`,{"data-trash-entry":e.entry,className:`flex min-w-0 items-center gap-3 border-b border-stroke px-4 py-2.5 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-1.5 text-sm`,children:[(0,Q.jsx)(`strong`,{className:`min-w-0 truncate font-medium`,children:e.name}),e.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted`,children:[`v`,e.version]})]}),(0,Q.jsx)(`span`,{className:`truncate text-xs text-content-muted`,children:[e.reason===`legacy-retired`?i(`custom-ui:trash.legacyRetired`):i(`custom-ui:trash.deletedAt`,{time:ze(e.deletedAt,a)}),e.instances?i(`custom-ui:trash.instances`,{count:e.instances}):``,_(e)].filter(Boolean).join(` · `)})]}),e.kind===`native`&&(0,Q.jsx)(I,{size:`xs`,variant:`secondary`,disabled:!!l,"data-trash-restore":e.entry,onClick:()=>void h(e),children:i(`custom-ui:trash.restore`)}),(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,className:`text-danger`,disabled:!!l,"data-trash-purge":e.entry,onClick:()=>p(e),children:i(`custom-ui:trash.purge`)})]},e.entry))}):(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:i(`custom-ui:trash.empty`)})})]})}),(0,Q.jsx)(W,{open:!!f,onOpenChange:e=>!e&&!l&&p(null),children:(0,Q.jsxs)(B,{size:`compact`,surface:`confirmation`,children:[(0,Q.jsxs)(U,{children:[(0,Q.jsx)(V,{children:i(`custom-ui:trash.purgeTitle`,{name:f?.name??``})}),(0,Q.jsx)(z,{children:i(`custom-ui:trash.purgeHint`)})]}),(0,Q.jsxs)(H,{children:[(0,Q.jsx)(I,{variant:`outline`,disabled:!!l,onClick:()=>p(null),children:i(`custom-ui:studio.cancel`)}),(0,Q.jsx)(I,{variant:`destructive`,disabled:!!l,"data-trash-purge-confirm":!0,onClick:()=>void g(),children:i(`custom-ui:trash.purgeConfirm`)})]})]})})]})}function Kn(e){let t=et(),[n,r]=(0,Z.useState)(()=>t.read(e));return(0,Z.useEffect)(()=>(r(t.read(e)),t.subscribe(n=>{n===e&&r(t.read(e))})),[t,e]),n}function qn(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleTimeString(void 0,{hour12:!1})}function Jn({at:e,level:t,kind:n,message:r,stack:i}){return(0,Q.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-0.5 border-b border-stroke px-3 py-2 last:border-b-0`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2 font-mono text-xs`,children:[(0,Q.jsx)(`span`,{className:`flex-none text-content-muted tabular-nums`,children:qn(e)}),(0,Q.jsx)(`span`,{className:F(`flex-none uppercase`,t===`error`?`text-st-fail font-medium`:`text-content-muted`),children:t}),(0,Q.jsx)(`span`,{className:`flex-none text-content-muted`,children:n}),(0,Q.jsx)(`span`,{className:`min-w-0 break-all text-content`,children:r})]}),i&&(0,Q.jsx)(`pre`,{className:`max-h-28 overflow-auto font-mono text-xs whitespace-pre-wrap text-content-muted`,children:i})]})}function Yn({componentId:e,errors:t,errorsFailed:n}){let{t:r}=u(),i=et(),a=Kn(e),o=t?.entries??[];return(0,Q.jsxs)(`div`,{"data-studio-logs":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-medium text-content-secondary`,children:r(`custom-ui:studio.logsLocal`)}),a.length>0&&(0,Q.jsx)(I,{size:`xs`,variant:`ghost`,onClick:()=>i.clear(e),children:r(`custom-ui:studio.logsClear`)})]}),a.length?(0,Q.jsx)(`ul`,{className:`overflow-hidden rounded-[var(--r-md)] border border-stroke bg-panel`,children:[...a].reverse().map((e,t)=>(0,Q.jsx)(Jn,{...e},`${e.at}:${t}`))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsLocalEmpty`)})]}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsxs)(`h3`,{className:`text-xs font-medium text-content-secondary`,children:[r(`custom-ui:studio.logsRuntime`),t&&t.dropped>0&&(0,Q.jsx)(`span`,{className:`ml-2 font-normal text-content-muted`,children:r(`custom-ui:studio.logsDropped`,{count:t.dropped})})]}),n?(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsRuntimeFailed`)}):o.length?(0,Q.jsx)(`ul`,{"data-studio-runtime-logs":!0,className:`overflow-hidden rounded-[var(--r-md)] border border-stroke bg-panel`,children:[...o].reverse().map((e,t)=>(0,Q.jsx)(Jn,{...e},`${e.at}:${t}`))}):(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:r(`custom-ui:studio.logsRuntimeEmpty`)})]})]})}function Xn(e,t){let n=d(),r=f({queryKey:_.errors(e),queryFn:({signal:t})=>b(e,t),enabled:t,retry:!1,refetchInterval:15e3,refetchOnWindowFocus:!1});return(0,Z.useEffect)(()=>{if(!t)return;let r=null,i=et().subscribe(t=>{t===e&&r===null&&(r=window.setTimeout(()=>{r=null,n.invalidateQueries({queryKey:_.errors(e)})},800))});return()=>{i(),r!==null&&window.clearTimeout(r)}},[n,e,t]),r}var Zn=new Map;function Qn({sessionId:e,onOpen:t}){let{t:n}=u(),r=Re({doneWindow:`today`}).all.find(t=>t.id===e)?.lane,i=n(r===`running`?`custom-ui:agent.statusRunning`:r===`attention`?`custom-ui:agent.statusAttention`:r===`queued`?`custom-ui:agent.statusQueued`:r===`done`?`custom-ui:agent.statusDone`:`custom-ui:agent.statusSent`);return(0,Q.jsxs)(`span`,{"data-component-agent-status":r??`sent`,className:`flex min-w-0 items-center gap-1.5 text-xs text-content-muted`,children:[(0,Q.jsx)(`span`,{"aria-hidden":!0,className:F(`size-1.5 flex-none rounded-full`,r===`attention`?`bg-st-attn`:r===`running`?`bg-st-run`:`bg-st-done`)}),(0,Q.jsx)(`span`,{className:`truncate`,children:i}),(0,Q.jsxs)(I,{size:`xs`,variant:`ghost`,"data-component-agent-open":e,className:`flex-none`,onClick:t,children:[n(`custom-ui:agent.openSession`),(0,Q.jsx)(D,{})]})]})}function $n({row:e,notify:t,autoFocus:n=!1,onSent:r,className:a}){let{t:o,language:c}=u(),l=i(),d=(0,Z.useId)(),p=f(v()),m=on(e.id,p.data?.features.versions===!0).data?.current,h=m?.source===`agent`?m:null,g=Et(t),{pending:_,sessionId:y}=pt(e.id),[b,x]=(0,Z.useState)(()=>Zn.get(e.id)??``),S=t=>{t?Zn.set(e.id,t):Zn.delete(e.id),x(t)},C=b.trim(),w=async()=>{if(!C||_)return;let t=await g.generate(e,C);t&&(S(``),r?.(t))};return(0,Q.jsxs)(`form`,{"data-component-prompt":e.id,className:F(`flex flex-col gap-2 rounded-[var(--r-lg)] border border-stroke bg-panel p-3`,a),onSubmit:e=>{e.preventDefault(),w()},children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:d,className:`mr-auto text-xs font-medium text-content-secondary`,children:o(`custom-ui:agent.promptTitle`)}),m&&(0,Q.jsx)(Ve,{asChild:!0,size:`sm`,className:`hover:bg-solid hover:text-content-secondary`,children:(0,Q.jsx)(`span`,{"data-prompt-base":m.n,children:o(`custom-ui:agent.basedOn`,{n:m.n})})})]}),(0,Q.jsx)(Ue,{id:d,autoFocus:n,rows:2,value:b,maxLength:Ct,placeholder:o(`custom-ui:agent.promptPlaceholder`),"aria-keyshortcuts":`Meta+Enter Control+Enter`,"data-component-prompt-input":!0,className:`max-h-40 min-h-14 resize-none`,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key!==`Enter`||!(e.metaKey||e.ctrlKey)||e.nativeEvent.isComposing||(e.preventDefault(),w())}}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[y?(0,Q.jsx)(Qn,{sessionId:y,onOpen:()=>l(s(y))}):(0,Q.jsx)(`span`,{className:`text-xs text-content-muted`,children:o(`custom-ui:agent.promptHint`)}),(0,Q.jsxs)(I,{type:`submit`,size:`sm`,disabled:!C||_,"aria-keyshortcuts":`Meta+Enter Control+Enter`,"data-component-generate":!0,className:`ml-auto`,children:[_&&(0,Q.jsx)(Oe,{}),o(_?`custom-ui:agent.sending`:`custom-ui:agent.generate`),!_&&(0,Q.jsx)(ke,{className:`bg-transparent text-current`,children:Ae(`Mod+Enter`)})]})]}),h&&(0,Q.jsxs)(`div`,{"data-prompt-result":h.n,className:`flex min-w-0 flex-col gap-1`,children:[(0,Q.jsx)(`p`,{className:`truncate text-xs text-content-muted`,children:[o(`custom-ui:agent.generatedVersion`,{n:h.n}),h.files.length?o(`custom-ui:agent.wrote`,{files:h.files.map(e=>e.path).join(` `)}):``,o(`custom-ui:versions.sourceAgent`),h.at?ze(h.at,c):``].filter(Boolean).join(` · `)}),(0,Q.jsx)(pn,{version:h})]})]})}var $=`manifest.json`,er=/\.(?:m?js|css|json|svg|txt|md)$/i;function tr(e){return/\.m?js$/i.test(e)?`javascript`:/\.css$/i.test(e)?`css`:/\.json$/i.test(e)?`json`:/\.svg$/i.test(e)?`xml`:`text`}function nr({row:e}){let{t}=u(),n=f({queryKey:_.describe(e.id),queryFn:({signal:t})=>h(e.id,t),retry:!1,refetchOnWindowFocus:!1}),r=(n.data?.files??[]).map(e=>e.path).filter(e=>e===$||er.test(e)&&e.split(`/`).length<=3),i=[...r.filter(t=>t===e.entry),...r.filter(t=>t!==e.entry)],[a,o]=(0,Z.useState)(``),s=i.includes(a)?a:i[0]??``;(0,Z.useEffect)(()=>o(``),[e.id]);let c=f({queryKey:[..._.describe(e.id),`source`,e.rev??``,s],queryFn:({signal:t})=>m(e.id,e.rev??``,s,t),enabled:!!(s&&s!==$&&e.rev),retry:!1,refetchOnWindowFocus:!1,staleTime:1/0});if(n.isPending)return(0,Q.jsx)(`p`,{className:`p-4 text-sm text-content-muted`,children:t(`custom-ui:studio.sourceLoading`)});if(n.error||!i.length)return(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceUnavailable`)});let l=JSON.stringify(e.manifest??{errors:e.errors},null,2),d=s===$?l:c.data===void 0?``:c.data;return(0,Q.jsxs)(`div`,{"data-studio-source":!0,className:`flex min-h-0 min-w-0 flex-1 flex-col gap-2`,children:[(0,Q.jsx)(`div`,{role:`group`,"aria-label":t(`custom-ui:studio.sourceFiles`),className:`flex flex-none flex-wrap gap-1`,children:i.map(e=>(0,Q.jsx)(Ve,{size:`sm`,"aria-pressed":e===s,"data-studio-source-file":e,className:`font-mono`,onClick:()=>o(e),children:e},e))}),s===$&&(0,Q.jsx)(`p`,{className:`text-xs text-content-muted`,children:t(`custom-ui:studio.sourceManifestHint`)}),s!==$&&!e.rev?(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceNotReady`)}):c.error&&s!==$?(0,Q.jsx)(R,{className:`flex-1`,title:t(`custom-ui:studio.sourceUnavailable`)}):(0,Q.jsx)(Mn,{code:d,language:tr(s),"data-studio-source-code":s,className:`min-h-0 flex-1 overflow-auto bg-code [&>div]:h-full`,children:(0,Q.jsx)(Nn,{"aria-label":t(`custom-ui:studio.copySource`),title:t(`custom-ui:studio.copySource`),className:`absolute top-1.5 right-1.5`})})]})}function rr(e){let[t,n]=(0,Z.useState)(null);return(0,Z.useEffect)(()=>(n(null),p(t=>{t.id===e&&t.reason===`files`&&n(Date.now())})),[e]),t}function ir({at:e}){let{t}=u(),[n,r]=(0,Z.useState)(()=>Date.now());(0,Z.useEffect)(()=>{let e=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let i=Math.max(0,Math.round((n-e)/1e3));return(0,Q.jsxs)(`span`,{"data-studio-reloaded":!0,className:`flex items-center gap-1.5 text-xs text-content-muted`,children:[(0,Q.jsxs)(`span`,{"aria-hidden":!0,className:`relative flex size-1.5 flex-none`,children:[(0,Q.jsx)(`span`,{className:`absolute inset-0 rounded-full bg-content-muted animate-[ping_700ms_cubic-bezier(0,0,0.2,1)_1] [:root[data-motion=reduced]_&]:animate-none motion-reduce:[:root:not([data-motion=full])_&]:animate-none`},e),(0,Q.jsx)(`span`,{className:`relative size-1.5 rounded-full bg-content-muted`})]}),(0,Q.jsx)(`span`,{children:i<60?t(`custom-ui:studio.reloadedSeconds`,{count:i}):t(`custom-ui:studio.reloadedMinutes`,{count:Math.floor(i/60)})})]})}function ar({activeSessionId:e=``,row:t,tab:n,target:r,window:i,instanceId:a,draft:o,notify:s,commits:c,settingsButton:l,onTab:d,onTarget:f,onWindow:p}){let{t:m,language:h}=u(),g=t.kind===`native`&&t.status===`ready`&&!!(t.manifest&&t.rev),_=rr(t.id),v=Xn(t.id,t.kind===`native`);return(0,Q.jsxs)(`section`,{"data-studio-workbench":!0,"data-component-stage":t.id,"data-component-kind":t.kind,"aria-label":m(`custom-ui:studio.workbench`),className:`flex min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-2 border-b border-stroke px-5 py-3`,children:[(0,Q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-base font-semibold`,children:J(t,h)}),t.version&&(0,Q.jsxs)(`span`,{className:`flex-none font-mono text-xs text-content-muted tabular-nums`,children:[`v`,t.version]})]}),_!==null&&(0,Q.jsx)(ir,{at:_}),(0,Q.jsxs)(`span`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsx)(P,{size:`sm`,"aria-label":m(`custom-ui:studio.workbenchView`),value:n,onValueChange:d,options:[{value:`preview`,label:m(`custom-ui:studio.tabPreview`)},{value:`source`,label:m(`custom-ui:studio.tabSource`)},{value:`logs`,label:m(`custom-ui:studio.tabLogs`)}]}),l]})]}),(0,Q.jsxs)(`div`,{className:F(`flex min-h-0 flex-1 flex-col gap-3 px-5 pt-4 pb-3`),children:[t.kind===`native`&&(0,Q.jsx)($n,{row:t,notify:s,className:`flex-none`}),n===`source`?(0,Q.jsx)(nr,{row:t}):n===`logs`?(0,Q.jsx)(Yn,{componentId:t.id,errors:v.data,errorsFailed:!!v.error}):g?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Lt,{manifest:t.manifest,target:r,window:i,onTarget:f,onWindow:p}),(0,Q.jsx)(Rt,{activeSessionId:e,row:t,target:r,window:i,instanceId:a,title:o.title,props:o.props,notify:s,commits:c}),(0,Q.jsx)(zt,{componentId:t.id,errors:v.data,commits:c})]}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto`,children:[(0,Q.jsx)(Sn,{row:t}),(0,Q.jsx)(R,{className:`flex-1`,title:t.kind===`broken`?m(`custom-ui:studio.brokenTitle`):m(`custom-ui:studio.invalidTitle`),description:t.kind===`broken`?m(`custom-ui:studio.brokenHint`):m(`custom-ui:studio.invalidHint`)})]})]})]})}function or({onOpen:e}){let{t}=u();return(0,Q.jsxs)(I,{size:`sm`,variant:`secondary`,"data-studio-settings-open":!0,"aria-label":t(`custom-ui:studio.openSettings`),onClick:e,children:[(0,Q.jsx)(A,{}),t(`custom-ui:studio.settings`)]})}var sr=``,cr=[],lr=[],ur={import:!1,versions:!1,export:!1,trash:`none`,trashRestore:!1,usage:!1,revoke:!1};function dr({children:e}){let t=(0,Z.useRef)(null),n=Ge(t),r=n.measured&&n.width>=1360;return(0,Q.jsx)(X,{variant:`workbench`,children:(0,Q.jsx)(`div`,{ref:t,"data-component-studio":!0,"data-studio-settings-mode":r?`inline`:`drawer`,className:`h-full min-h-0`,children:e(r)})})}function fr(e){(0,Z.useLayoutEffect)(()=>{if(e)return Le.getState().enterRouteRail(),()=>Le.getState().leaveRouteRail()},[e])}function pr(e,t){let n=vt(),[r,i]=(0,Z.useState)(()=>n.version());(0,Z.useEffect)(()=>n.subscribe(()=>i(n.version())),[n]);let a=(0,Z.useRef)(new Map);return(0,Z.useEffect)(()=>{for(let t of e){let e=a.current.get(t.id);e&&t.rev&&e!==t.rev&&n.resume(`preview:${t.id}`),t.rev&&a.current.set(t.id,t.rev)}},[n,e]),(0,Z.useMemo)(()=>{let r=new Set;for(let i of e)(n.hasTrouble(`preview:${i.id}`,i.rev)||t.some(e=>e.componentId===i.id&&n.hasTrouble(e.instanceId,i.rev)))&&r.add(i.id);return r},[n,t,e,r])}function mr(e){if(typeof e!=`object`||!e)return``;let t=e.componentInstanceId;return typeof t==`string`&&t.length<=64?t:``}function hr(e,t,n){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)({id:``,instanceId:null}),[s,c]=(0,Z.useState)(`standard`),l=e?.id??``;(0,Z.useEffect)(()=>{!l||!n||(o({id:l,instanceId:n}),i(null))},[n,l]);let u=Ot(e?.manifest),d=e?t.filter(t=>t.componentId===e.id):[],f=e&&a.id===e.id?a.instanceId:void 0,p=f===null?null:f&&d.some(e=>e.instanceId===f)?f:d[0]?.instanceId??null,m=d.find(e=>e.instanceId===p)??null,h=e&&r?.id===e.id&&u.includes(r.target)?r.target:m&&u.includes(gt(m))?gt(m):u[0]??`feature-page`,g=`${e?.id??``}:${p??`preview`}`,[_,v]=(0,Z.useState)({key:``,title:``,props:{}}),y=(0,Z.useCallback)(e=>v({key:g,...e}),[g]);return{target:h,window:s,instanceId:p,draft:_.key===g?_:{title:m?.title??``,props:m?.props??{}},onPreview:y,setWindow:c,setTarget:t=>e&&i({id:e.id,target:t}),selectInstance:t=>{if(!e)return;o({id:e.id,instanceId:t});let n=d.find(e=>e.instanceId===t);n&&u.includes(gt(n))&&i({id:e.id,target:gt(n)})}}}function gr({activeSessionId:e=``,notify:t,selectedId:r=``,onSelect:i}){let{t:a,language:o}=u(),s=ee(),c=S(),l=x(),d=C().data?.instances??cr,f=Dt(t),p=dn(t),m=Et(t),[h,g]=(0,Z.useState)(``),[_,v]=(0,Z.useState)(!1),y=K(_),b=(0,Z.useMemo)(()=>kt(l.data?.components??[]),[l.data]),w=l.data?.root||``,T=l.data?.features??ur,E=T.trash===`move`,te=l.data?.staged??lr,[D,O]=(0,Z.useState)(`all`),[ne,re]=(0,Z.useState)(``),[ae,k]=(0,Z.useState)(`preview`),[oe,se]=(0,Z.useState)(!1),ce=K(oe),[le,ue]=(0,Z.useState)(0),[de]=(0,Z.useState)(It),fe=pr(b,d),A=s?b.find(e=>e.id===r)??null:jt(b,r,sr),pe=A?.id??``;(0,Z.useEffect)(()=>{pe&&(sr=pe)},[pe]);let j=hr(A,d,mr(n().state));fr(!s&&c&&!l.data?.legacyShape);let ge=e=>{k(`preview`),i(e,!0)},_e=async(e,n,r)=>{let c=await f.createFromTemplate(e,n);return c&&(O(`all`),re(``),i(c.id,!s),r?.trim()?m.generate(c,r):t(a(`custom-ui:studio.created`,{name:J(c,o)}))),c};if(!c||l.data?.legacyShape)return(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsx)(L,{kind:`empty`,title:a(`custom-ui:studio.unsupportedTitle`),description:a(`custom-ui:studio.unsupportedHint`)})});if(l.isPending)return(0,Q.jsx)(L,{kind:`loading`,title:a(`custom-ui:customUiPage.loading`)});if(l.error&&!l.data)return(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsx)(L,{kind:`error`,title:a(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(I,{variant:`secondary`,size:`sm`,onClick:()=>void l.refetch(),children:a(`custom-ui:widget.retry`)})})});let ve=ft(b,fe),M={...ve,attention:ve.attention+te.length},ye=xt(b,{filter:D,query:ne,language:o,troubled:fe}),N=te.length>0&&D!==`enabled`,be=e=>N?te.map(t=>(0,Q.jsx)(Rn,{staged:t,phone:e,onReview:()=>g(t.stageId)},t.stageId)):null,xe=e=>(0,Q.jsx)(Ln,{enabled:T.import,lifecycle:p,className:e,onStaged:e=>g(e.stageId)}),Se=(0,Q.jsx)(Un,{stageId:h,lifecycle:p,onClose:()=>g(``),onTrusted:e=>{g(``),O(`all`),re(``),i(e.id,!s)}}),Ce=(0,Q.jsxs)(Q.Fragment,{children:[a(`custom-ui:customUiPage.emptyHint`),w&&(0,Q.jsx)(`code`,{className:`mx-auto mt-2 block max-w-full rounded-xs bg-inline-code px-2 py-1 font-mono text-xs break-all text-content-secondary`,children:w}),(0,Q.jsx)(`span`,{className:`mt-2 block`,children:a(`custom-ui:customUiPage.directoryLocationHint`)})]});if(s){let n=()=>i(``,!1);return r?(0,Q.jsx)(X,{variant:`collection`,children:(0,Q.jsxs)(`div`,{"data-components-phone":`detail`,className:`flex min-w-0 flex-col gap-4`,children:[(0,Q.jsxs)(I,{variant:`ghost`,className:`-ml-2 min-h-11 w-fit px-2 text-content-secondary`,onClick:n,children:[(0,Q.jsx)(ie,{"aria-hidden":`true`}),a(`custom-ui:phone.allComponents`)]}),A?(0,Q.jsxs)(`div`,{"data-component-stage":A.id,"data-component-kind":A.kind,className:`flex min-w-0 flex-col gap-5`,children:[(0,Q.jsx)(xn,{row:A,actions:f}),(0,Q.jsx)(Sn,{row:A}),A.kind===`native`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(I,{variant:`secondary`,"data-component-prompt-open":!0,className:`min-h-11 w-full`,onClick:()=>v(!0),children:[(0,Q.jsx)(me,{}),a(`custom-ui:agent.editWithPrompt`)]}),(0,Q.jsx)(Ie,{open:_,onOpenChange:v,children:(0,Q.jsxs)(Ne,{side:`bottom`,onCloseAutoFocus:y,"data-component-prompt-sheet":!0,className:`gap-0 rounded-t-[var(--r-lg)] p-0`,children:[(0,Q.jsxs)(je,{className:`px-4 pt-4 pb-0`,children:[(0,Q.jsx)(Pe,{children:J(A,o)}),(0,Q.jsx)(Fe,{className:`sr-only`,children:a(`custom-ui:agent.promptTitle`)})]}),(0,Q.jsx)(`div`,{className:`px-4 pt-3 pb-[max(16px,env(safe-area-inset-bottom))]`,children:(0,Q.jsx)($n,{row:A,notify:t,autoFocus:!0,className:`border-0 bg-transparent p-0`,onSent:()=>v(!1)})})]})})]}),A.kind===`native`&&A.status===`ready`&&A.manifest&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(Lt,{manifest:A.manifest,target:j.target,window:`standard`,phone:!0,onTarget:j.setTarget,onWindow:j.setWindow}),(0,Q.jsx)(Rt,{activeSessionId:e,row:A,target:j.target,window:`standard`,instanceId:j.instanceId,title:j.draft.title,props:j.draft.props,phone:!0,notify:t,commits:de},le)]}),(0,Q.jsx)(Cn,{row:A,instances:d,selectedInstanceId:j.instanceId,notify:t,actions:f,onSelectInstance:j.selectInstance,onPreview:j.onPreview}),(0,Q.jsx)(wn,{row:A,usageEnabled:T.usage,canRevoke:T.revoke,lifecycle:p}),(0,Q.jsx)(En,{row:A,instances:d,actions:f})]}),A.kind===`native`&&(0,Q.jsx)(hn,{row:A,enabled:T.versions,notify:t,actions:p}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[T.export&&A.kind===`native`&&(0,Q.jsx)(kn,{row:A,lifecycle:p,className:`min-h-11`}),E&&(0,Q.jsx)(On,{row:A,actions:f,variant:`button`,onDeleted:n})]})]}):(0,Q.jsx)(L,{kind:`empty`,title:a(`custom-ui:phone.missingTitle`),description:a(`custom-ui:phone.missingHint`),action:(0,Q.jsx)(I,{variant:`secondary`,className:`min-h-11`,onClick:n,children:a(`custom-ui:phone.allComponents`)})})]})}):(0,Q.jsxs)(X,{variant:`collection`,children:[(0,Q.jsxs)(`div`,{"data-components-phone":`list`,className:`flex min-w-0 flex-col gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`mr-auto text-sm font-medium text-content-secondary tabular-nums`,children:a(`custom-ui:customUiPage.installedComponents`,{count:b.length})}),xe(`min-h-11`),(0,Q.jsx)(Bt,{onCreate:_e,phone:!0,className:`min-h-11`})]}),N&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-2`,children:be(!0)}),b.length?(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-stroke overflow-hidden rounded-[var(--r-lg)] border border-stroke bg-panel`,children:b.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(Wt,{row:e,instances:d,active:!1,phone:!0,onSelect:()=>i(e.id,!1)})},e.id))}):(0,Q.jsx)(R,{title:a(`custom-ui:customUiPage.emptyTitle`),description:Ce}),(0,Q.jsx)(Gn,{enabled:T.trashRestore,lifecycle:p,className:`min-h-11 w-fit`,onRestored:e=>i(e.id,!1)}),(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed break-all text-content-muted`,children:a(`custom-ui:customUiPage.directoryHint`,{path:w})})]}),Se]})}let we=A&&(0,Q.jsx)(An,{row:A,instances:d,selectedInstanceId:j.instanceId,canDelete:E,features:T,notify:t,actions:f,lifecycle:p,onSelectInstance:j.selectInstance,onPreview:j.onPreview,onViewSource:()=>{k(`source`),se(!1)},onDeleted:()=>i(``,!0)},A.id);return(0,Q.jsx)(dr,{children:n=>(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-studio-columns":!0,className:n?`grid h-full min-h-0 grid-cols-[284px_minmax(0,1fr)_372px]`:`grid h-full min-h-0 grid-cols-[284px_minmax(0,1fr)]`,children:[(0,Q.jsx)(Kt,{rows:ye,allCount:b.length,counts:M,instances:d,selectedId:A?.id??``,troubled:fe,filter:D,query:ne,root:w,onFilter:O,onQuery:re,onSelect:ge,onCreate:_e,importButton:xe(),staged:be(!1),footer:T.trashRestore?(0,Q.jsx)(`div`,{className:`flex flex-none border-t border-stroke px-2 py-1.5`,children:(0,Q.jsx)(Gn,{enabled:!0,lifecycle:p,onRestored:e=>i(e.id,!0)})}):void 0,onOpenLogs:e=>{i(e,!0),k(`logs`)},onRequestFix:(e,t)=>void m.fix(e,t),onReload:e=>{vt().resume(`preview:${e}`),ue(e=>e+1),k(`preview`),i(e,!0)}}),A?(0,Q.jsx)(ar,{activeSessionId:e,row:A,tab:ae,target:j.target,window:j.window,instanceId:j.instanceId,draft:j.draft,notify:t,commits:de,settingsButton:!n&&(0,Q.jsx)(or,{onOpen:()=>se(!0)}),onTab:k,onTarget:j.setTarget,onWindow:j.setWindow},`${A.id}#${le}`):(0,Q.jsx)(R,{className:`min-h-0`,title:b.length?a(`custom-ui:phone.missingTitle`):a(`custom-ui:customUiPage.emptyTitle`),description:b.length?a(`custom-ui:phone.missingHint`):Ce}),n&&A&&(0,Q.jsx)(`aside`,{"aria-label":a(`custom-ui:studio.settings`),className:`flex min-h-0 min-w-0 flex-col border-l border-stroke`,children:we})]}),!n&&(0,Q.jsx)(Ie,{open:oe&&!!A,onOpenChange:se,children:(0,Q.jsxs)(Ne,{side:`right`,showCloseButton:!1,onCloseAutoFocus:ce,"data-studio-settings-drawer":!0,className:`w-[372px] max-w-[calc(100vw-48px)] gap-0 p-0 sm:max-w-[372px]`,children:[(0,Q.jsxs)(je,{className:`flex-row items-center justify-between border-b border-stroke px-4 py-2.5`,children:[(0,Q.jsx)(Pe,{className:`text-sm`,children:a(`custom-ui:studio.settings`)}),(0,Q.jsx)(Fe,{className:`sr-only`,children:a(`custom-ui:studio.settingsHint`)}),(0,Q.jsx)(I,{size:`icon-sm`,variant:`ghost`,"aria-label":a(`custom-ui:studio.closeSettings`),onClick:()=>se(!1),children:(0,Q.jsx)(he,{})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:we})]})}),Se]})})}function _r({activeSessionId:e,component:t,instance:n,notify:r}){let i=bt(t,r);return(0,Q.jsx)(w,{component:t,instance:{instanceId:n.instanceId,surface:`feature-page`,title:n.title,props:n.props},session:e?{id:e,title:``,cwd:``,status:`idle`}:void 0,notify:e=>r(e),onRequestFix:i,className:`h-full`})}function vr({componentId:e,activeSessionId:t=``,notify:n}){let{t:i}=u(),a=T(`feature-page`),o=a.placed.find(t=>t.component.id===e),s=c(e);return(0,Q.jsx)(X,{variant:`workbench`,children:(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-11 shrink-0 flex-wrap items-center gap-1 border-b border-stroke-soft px-2 py-1.5`,children:[o&&(0,Q.jsx)(`strong`,{className:`min-w-0 flex-1 truncate px-1 text-sm font-medium`,children:o.instance.title||o.component.manifest?.name||o.component.name}),(0,Q.jsx)(I,{variant:`ghost`,size:`sm`,className:`ml-auto max-[650px]:h-11`,asChild:!0,children:(0,Q.jsxs)(r,{to:l.components,children:[(0,Q.jsx)(A,{}),i(`custom-ui:tool.openSettings`)]})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden`,"data-feature-page-host":e,children:o?(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(L,{kind:`loading`,title:i(`custom-ui:customUiPage.loading`)}),children:(0,Q.jsx)(_r,{activeSessionId:t,component:o.component,instance:o.instance,notify:n},o.instance.instanceId)}):a.isLoading?(0,Q.jsx)(L,{kind:`loading`,title:i(`custom-ui:customUiPage.loading`)}):a.error?(0,Q.jsx)(L,{kind:`error`,title:i(`custom-ui:widget.catalogFailed`),action:(0,Q.jsx)(I,{variant:`secondary`,onClick:a.refetch,children:i(`custom-ui:widget.retry`)})}):(0,Q.jsx)(L,{kind:`empty`,title:i(`custom-ui:tool.notPlacedTitle`),description:i(`custom-ui:tool.notPlacedHint`),action:(0,Q.jsx)(I,{variant:`secondary`,asChild:!0,children:(0,Q.jsx)(r,{to:s,children:i(`custom-ui:tool.openInStudio`)})})})})]})})}export{gr as CustomUiPage,vr as CustomUiToolPage};
|
|
@@ -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"./use-i18n-CVZdp2ZN.js";import{t as i}from"./runtime-capabilities-store-D1FwQXKw.js";import{t as a}from"./arrow-right-DqLOhpA2.js";import{t as o}from"./download-BCfIiuaL.js";import{t as s}from"./key-round-C29uZbsf.js";import{t as c}from"./search-D0mqDaf_.js";import{t as l}from"./server-BgNvmqwJ.js";import{t as u}from"./x-07u4-129.js";import{t as d}from"./utils-C8uzG5AZ.js";import{t as f}from"./button-CCcCN8tE.js";import{t as p}from"./kbd-CAufZTkl.js";import{n as m,r as h}from"./config-search-C1YtwJAQ.js";import{s as g}from"./shortcuts-BGzXmClx.js";import{a as _,i as v,l as y,o as b,s as x,t as S}from"./dialog-2cmY5V75.js";import{t as C}from"./input-CPw-zkYh.js";import{t as w}from"./BrandLogo-k3CvJjd4.js";var T=e(t(),1),E=n();function D({query:e,onQueryChange:t,onSelect:n,inputRef:a,placement:o=`toolbar`}){let{t:s,language:l}=r(),[u,f]=(0,T.useState)(!1),[_,v]=(0,T.useState)(0),y=(0,T.useRef)(null),b=i(e=>e.capabilities),x=g(`focusSearch`),S=(0,T.useMemo)(()=>h(e,l,{capabilities:b,mobileApp:!!window.__PISPER_MOBILE_APP__}),[l,e,b]);(0,T.useEffect)(()=>v(0),[e]),(0,T.useEffect)(()=>{if(!u)return;let e=e=>{y.current&&!y.current.contains(e.target)&&f(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[u]);let w=e=>{if(f(!1),t(``),e.entry.card===`interface-custom-ui`){n(e.entry.section,`widgets`);return}m(e.entry.card,e.entry.section,{targetId:e.entry.targetId,targetText:e.title,expandGroup:e.entry.expandGroup}),n(e.entry.section)},D=u&&e.trim().length>0;return(0,E.jsxs)(`div`,{ref:y,className:d(`relative`,o===`sidebar`?`w-full`:`w-[min(250px,24vw)] max-[900px]:w-[190px] max-[650px]:col-start-1 max-[650px]:row-start-1 max-[650px]:w-full max-[650px]:min-w-0`),children:[(0,E.jsx)(c,{size:15,"aria-hidden":`true`,className:`pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-content-muted`}),(0,E.jsx)(C,{ref:a,value:e,title:s(`navigation:pageHeader.search`),"aria-label":s(`navigation:pageHeader.search`),className:d(`pl-8 text-sm`,o!==`sidebar`&&`max-[650px]:h-11 max-[650px]:text-[16px]`,o===`sidebar`&&`h-8 border-key-border bg-key pr-9 text-ellipsis shadow-key`),placeholder:s(o===`sidebar`?`config:configSearch.placeholderShort`:`config:configSearch.placeholder`),onChange:e=>{t(e.target.value),f(!0)},onFocus:()=>{e.trim()&&f(!0)},onKeyDown:e=>{e.key===`Escape`?(e.stopPropagation(),t(``),f(!1)):e.key===`ArrowDown`?(e.preventDefault(),v(e=>Math.min(e+1,S.length-1))):e.key===`ArrowUp`?(e.preventDefault(),v(e=>Math.max(e-1,0))):e.key===`Enter`&&S[_]&&(e.preventDefault(),w(S[_]))}}),o===`sidebar`&&x&&!e&&(0,E.jsx)(p,{className:`absolute top-1/2 right-2 -translate-y-1/2 pointer-coarse:hidden`,children:x}),D&&(0,E.jsx)(`div`,{className:`absolute top-full left-0 z-50 mt-1.5 w-full overflow-hidden rounded-md bg-solid shadow-float`,children:S.length===0?(0,E.jsx)(`p`,{role:`status`,className:`px-3 py-3 text-xs text-content-muted`,children:s(`config:configSearch.noResults`)}):(0,E.jsx)(`ul`,{className:`max-h-[280px] overflow-auto py-1`,children:S.map((e,t)=>(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{type:`button`,className:d(`flex w-full flex-col gap-0.5 px-3 py-1.5 text-left pointer-coarse:min-h-11`,t===_?`bg-surface-hover`:`hover:bg-surface-subtle`),onMouseEnter:()=>v(t),onClick:()=>w(e),children:[(0,E.jsx)(`span`,{className:`text-sm text-content`,children:e.title}),(0,E.jsx)(`span`,{className:`text-xs text-content-muted`,children:e.sectionTitle})]})},e.entry.id))})})]})}function O({open:e,onDismiss:t,onOpenImport:n,onOpenSettings:i}){let{t:c}=r();return(0,E.jsx)(S,{open:e,onOpenChange:e=>!e&&t(),children:(0,E.jsxs)(v,{showCloseButton:!1,overlayClassName:`z-[220]`,className:`z-[220] gap-0 rounded-[var(--r-lg)] border border-stroke bg-solid p-0`,style:{maxWidth:`min(28rem, calc(100vw - max(1rem, env(safe-area-inset-left), env(safe-area-inset-right)) - max(1rem, env(safe-area-inset-left), env(safe-area-inset-right))))`,maxHeight:`calc(100dvh - max(1rem, env(safe-area-inset-top), env(safe-area-inset-bottom)) - max(1rem, env(safe-area-inset-top), env(safe-area-inset-bottom)))`},"aria-describedby":`model-onboarding-description`,children:[(0,E.jsxs)(`div`,{className:`relative px-5 pt-5 pb-2 max-[650px]:px-4 max-[650px]:pt-4`,children:[(0,E.jsxs)(x,{className:`gap-3 pr-9 text-left`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`w-fit rounded-[13px] shadow-raise`,children:(0,E.jsx)(w,{size:44})}),(0,E.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,E.jsx)(`p`,{className:`text-xs font-medium text-content-muted`,children:c(`config:modelOnboarding.eyebrow`)}),(0,E.jsx)(y,{className:`text-[length:calc(var(--ui-font-size)*10/7)] leading-[1.3] font-semibold tracking-[-.015em]`,children:c(`config:modelOnboarding.title`)}),(0,E.jsx)(_,{id:`model-onboarding-description`,className:`leading-6`,children:c(`config:modelOnboarding.description`)})]})]}),(0,E.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute top-3 right-3 pointer-coarse:size-11`,"aria-label":c(`common:ui.closeDialog`),title:c(`common:ui.closeDialog`),onClick:t,children:(0,E.jsx)(u,{})})]}),(0,E.jsxs)(`div`,{className:`grid gap-3 px-5 pt-2 pb-4 max-[650px]:px-4`,children:[(0,E.jsx)(`ol`,{className:`m-0 list-none divide-y divide-stroke-soft border-y border-stroke-soft p-0`,children:[{Icon:l,title:c(`config:modelOnboarding.connectionTitle`),description:c(`config:modelOnboarding.connectionDescription`)},{Icon:s,title:c(`config:modelOnboarding.modelTitle`),description:c(`config:modelOnboarding.modelDescription`)}].map(({Icon:e,title:t,description:n},r)=>(0,E.jsxs)(`li`,{className:`flex items-start gap-3 py-3`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-7 shrink-0 place-items-center rounded-full bg-surface-subtle text-xs font-medium text-content-secondary tabular-nums`,children:r+1}),(0,E.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,E.jsxs)(`strong`,{className:`flex items-center gap-1.5 text-sm font-medium text-content`,children:[(0,E.jsx)(e,{className:`size-3.5 text-content-muted`,"aria-hidden":`true`}),t]}),(0,E.jsx)(`p`,{className:`text-xs leading-5 text-content-muted`,children:n})]})]},t))}),(0,E.jsxs)(f,{type:`button`,variant:`secondary`,className:`w-full max-[650px]:h-11`,onClick:n,children:[(0,E.jsx)(o,{}),c(`config:modelOnboarding.findExisting`)]})]}),(0,E.jsxs)(b,{className:`m-0 rounded-none px-5 pt-3 max-[650px]:px-4`,style:{paddingBottom:`max(env(safe-area-inset-bottom), 1rem)`},children:[(0,E.jsx)(f,{type:`button`,variant:`ghost`,className:`max-[650px]:h-11`,onClick:t,children:c(`config:modelOnboarding.later`)}),(0,E.jsxs)(f,{type:`button`,className:`max-[650px]:h-11`,onClick:i,children:[c(`config:modelOnboarding.openSettings`),(0,E.jsx)(a,{})]})]})]})})}export{D as ConfigSearchBox,O as ModelOnboardingDialog};
|