pisper 0.6.37 → 0.6.38

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.
Files changed (136) hide show
  1. package/package.json +5 -5
  2. package/web/.vite/manifest.json +731 -715
  3. package/web/assets/{AppDialog-Cw7rc4XR.js → AppDialog-D7dbnbpb.js} +1 -1
  4. package/web/assets/{AppOverlays-Di-fHhSB.js → AppOverlays-B0DiBXhm.js} +1 -1
  5. package/web/assets/{AppSelect-DQYKUW5E.js → AppSelect-B15Hpk2W.js} +1 -1
  6. package/web/assets/{AssetsPage-DIe85h--.js → AssetsPage-tYWyqjIP.js} +1 -1
  7. package/web/assets/{AttachmentTray-BLSQp6M3.js → AttachmentTray-Bl7FlLO8.js} +1 -1
  8. package/web/assets/{BoardPage-DpaN03Lf.js → BoardPage-ye9euYPu.js} +3 -3
  9. package/web/assets/{ChannelsPage-D_GuiQzA.js → ChannelsPage-CGG9jTTT.js} +1 -1
  10. package/web/assets/{ChatAppearancePage-CFZBJho6.js → ChatAppearancePage-bsoY5QKJ.js} +1 -1
  11. package/web/assets/{ChatHistoryPage-Dk3KMztM.js → ChatHistoryPage-xXomDxaq.js} +1 -1
  12. package/web/assets/{ChatMessage-pqXPc_eb.js → ChatMessage-CvHWV1Ch.js} +3 -3
  13. package/web/assets/{ChatPage-oQQshWkr.js → ChatPage-D5KB1-sG.js} +5 -5
  14. package/web/assets/ConfigPage-wu051HqP.js +7 -0
  15. package/web/assets/{DesktopWindowControls-DUcVtVCs.js → DesktopWindowControls-CAwSP797.js} +1 -1
  16. package/web/assets/{FeaturePage-DLnP1aDp.js → FeaturePage-zQDskcfW.js} +1 -1
  17. package/web/assets/{FileAttachmentPreview-RKOc2WdF.js → FileAttachmentPreview-DPaKYKtY.js} +1 -1
  18. package/web/assets/{FloatingWidgets-Bith-ECr.js → FloatingWidgets-GhTkxIDg.js} +1 -1
  19. package/web/assets/{FocusRuntimeControls-1e47Xb4z.js → FocusRuntimeControls-DBlrxVp-.js} +1 -1
  20. package/web/assets/{GitDiffViewer-CwMYo1oB.js → GitDiffViewer-Do1eDMtP.js} +1 -1
  21. package/web/assets/{ManageProjectsDialog-Docy1GpF.js → ManageProjectsDialog-C7gNiB6z.js} +1 -1
  22. package/web/assets/{MarkdownMessage-Brsfnbe4.js → MarkdownMessage-D0beXQBc.js} +1 -1
  23. package/web/assets/{McpPage-DiwEaVc_.js → McpPage-C0lFImD2.js} +1 -1
  24. package/web/assets/{MemoryEvolution-uvjfuUUj.js → MemoryEvolution-C2VICbnQ.js} +1 -1
  25. package/web/assets/{MemoryPage-BAi5hlI3.js → MemoryPage-BcU2Cs98.js} +2 -2
  26. package/web/assets/{MobileNavigation-vcszVJOp.js → MobileNavigation-BK6KIoZW.js} +1 -1
  27. package/web/assets/{MorePage-BVlc8OoO.js → MorePage-Db2xrrIi.js} +1 -1
  28. package/web/assets/{NewFolderDialog-DW2eVsTT.js → NewFolderDialog-CxX7qO47.js} +1 -1
  29. package/web/assets/{PageHeader-ZD7qkymY.js → PageHeader-D1n2Jzmx.js} +1 -1
  30. package/web/assets/{PhoneDrawer-Bj5UN8ml.js → PhoneDrawer-DLYZ5SMn.js} +1 -1
  31. package/web/assets/{PhoneMenuButton-B6s1QtNQ.js → PhoneMenuButton-BFpmL4gy.js} +1 -1
  32. package/web/assets/{PhoneTopBar-DA373mh5.js → PhoneTopBar-Cfoat09o.js} +1 -1
  33. package/web/assets/{PluginsPage-B3hsUZ_Q.js → PluginsPage-DRyoyDG9.js} +1 -1
  34. package/web/assets/{SafeModePrompt-BLbALi0G.js → SafeModePrompt-BfTTgjbT.js} +1 -1
  35. package/web/assets/{SchedulesPage-YQ6aVxUS.js → SchedulesPage-BWh3UDXa.js} +1 -1
  36. package/web/assets/{SessionBrowserPane-KHWJ-cT-.js → SessionBrowserPane-DC5guaDX.js} +2 -2
  37. package/web/assets/{SessionContextPanel-BQCxpXfH.js → SessionContextPanel-B__4h3mv.js} +2 -2
  38. package/web/assets/{SessionHome-KgMFcRJ4.js → SessionHome-BQ3qKptX.js} +1 -1
  39. package/web/assets/SessionInspector-C-NheTkC.js +1 -0
  40. package/web/assets/{SessionShell-wr7-_Sjt.js → SessionShell-DWABLP3x.js} +1 -1
  41. package/web/assets/{SettingsSidebar-DXwdmUIk.js → SettingsSidebar-Dn_SR2KI.js} +1 -1
  42. package/web/assets/{ShortcutHelpDialog-89JopRc_.js → ShortcutHelpDialog-BWe1Fjhb.js} +1 -1
  43. package/web/assets/{ShortcutKeys-6jUwKZTe.js → ShortcutKeys-CP1pnBl0.js} +1 -1
  44. package/web/assets/SidebarUpdateStatus-cvTjL5ij.js +1 -0
  45. package/web/assets/{SkillsPage-CHUoIXMG.js → SkillsPage-r-LSqZwd.js} +1 -1
  46. package/web/assets/{TaskProcessesPane-BsR96Uy0.js → TaskProcessesPane-mElR99PS.js} +1 -1
  47. package/web/assets/{TaskTerminalView-BqhXX5DQ.js → TaskTerminalView-BM91y75f.js} +1 -1
  48. package/web/assets/{TerminalPanel-CPYlb-Yf.js → TerminalPanel-D1oJpB3u.js} +1 -1
  49. package/web/assets/{WebDesktopPet-Czdppa-t.js → WebDesktopPet-QXXN3QbN.js} +1 -1
  50. package/web/assets/{WorkflowsPage-CUCLMWKi.js → WorkflowsPage-BP42MG2Z.js} +1 -1
  51. package/web/assets/{WorkspacePicker-CtkwBoo-.js → WorkspacePicker-BbdryDPr.js} +1 -1
  52. package/web/assets/{api-O9Wq9r_X.js → api-CBBBtkan.js} +1 -1
  53. package/web/assets/{app-update-B-qeHgdo.js → app-update-DunTxBgI.js} +1 -1
  54. package/web/assets/{approval-confirm-BE2pBBhd.js → approval-confirm-BqBWSuQ8.js} +1 -1
  55. package/web/assets/{assets-api-ZX3ew8NP.js → assets-api-3NSBcYaC.js} +1 -1
  56. package/web/assets/{board-messages-DDVcGLQp.js → board-messages-BnEINaKR.js} +1 -1
  57. package/web/assets/{board-projects-7fgew4qK.js → board-projects-B3PI6BjF.js} +1 -1
  58. package/web/assets/{bots-store-BakkfdxA.js → bots-store-BAntG9W8.js} +1 -1
  59. package/web/assets/{chat-api-DRk1HYBW.js → chat-api-BJg8CGKY.js} +1 -1
  60. package/web/assets/{client-store-C9d-4zaw.js → client-store-rx0O2mpN.js} +1 -1
  61. package/web/assets/{command-C1iIZLBg.js → command-DZaQ9upK.js} +1 -1
  62. package/web/assets/{config-search-BwTOSp7w.js → config-search-CzgMGmT8.js} +1 -1
  63. package/web/assets/{desktop-hosts-BQpofR4x.js → desktop-hosts-svz5JY9v.js} +1 -1
  64. package/web/assets/{dialog-BokgY2lK.js → dialog--BzPCzo6.js} +1 -1
  65. package/web/assets/{event-stream-w-KcgLqy.js → event-stream-Ddk4jhlx.js} +1 -1
  66. package/web/assets/{events-DkkGxATR.js → events-D4XQdoJj.js} +1 -1
  67. package/web/assets/{folder-paths-nGHHc6li.js → folder-paths-B1kiUC05.js} +1 -1
  68. package/web/assets/{hosts-DKIfcYBZ.js → hosts-DHUIBM87.js} +1 -1
  69. package/web/assets/{http-9v-LnE5x.js → http-DbzHoP54.js} +1 -1
  70. package/web/assets/{http-response-DkUhGWkC.js → http-response-DNu8g-gu.js} +1 -1
  71. package/web/assets/i18n-BI3c0cNs.js +1 -0
  72. package/web/assets/{index-DOv7xFwV.js → index-DG9ghV8d.js} +2 -2
  73. package/web/assets/index-PnQKlTEM.css +2 -0
  74. package/web/assets/{machine-messages-B5ms0mPd.js → machine-messages-DGZHVgCw.js} +1 -1
  75. package/web/assets/{machines-api-O06vkXBt.js → machines-api-Du_fgryI.js} +1 -1
  76. package/web/assets/{memory-api-Bb1TcNUv.js → memory-api-C9enb6fj.js} +1 -1
  77. package/web/assets/mount-app-DxMKdapI.js +9 -0
  78. package/web/assets/package-check-C5B-7aXn.js +1 -0
  79. package/web/assets/{permission-rules-api-CrWUDTm4.js → permission-rules-api-knjBf2wG.js} +1 -1
  80. package/web/assets/{pick-system-directory-DM8TTiur.js → pick-system-directory-DNfh5VTx.js} +1 -1
  81. package/web/assets/{placements-Crw6KKZv.js → placements-DTL5a48Z.js} +2 -2
  82. package/web/assets/{popover-BL8OTqgj.js → popover-CnZUY0sI.js} +1 -1
  83. package/web/assets/{public-BreU1CGn.js → public-B7hA-uIa.js} +1 -1
  84. package/web/assets/{public-B3_chwnY.js → public-BXa0r7Zi.js} +2 -2
  85. package/web/assets/{public-CuiN0QDk.js → public-CTHltVOn.js} +2 -2
  86. package/web/assets/{public-B3SnUlET.js → public-DF15NvyM.js} +1 -1
  87. package/web/assets/{public-components-9_uBKNP6.js → public-components-DQ6le1Xr.js} +1 -1
  88. package/web/assets/public-diff-DW2fvtAP.js +1 -0
  89. package/web/assets/public-events-pGyvjI9X.js +1 -0
  90. package/web/assets/{public-flags-DTUvSTHx.js → public-flags-aoH15zz6.js} +1 -1
  91. package/web/assets/{public-folder-dialog-CUSNnRpf.js → public-folder-dialog-CYl3xvCC.js} +1 -1
  92. package/web/assets/{public-greeting-CafD21gA.js → public-greeting-Bb8rfzs2.js} +1 -1
  93. package/web/assets/{public-session-_pn-KOSb.js → public-session-CesgpGcr.js} +1 -1
  94. package/web/assets/{public-sidebar-BJv_YzQa.js → public-sidebar-Cu1cOhGe.js} +1 -1
  95. package/web/assets/{runtime-capabilities-store-C9rMp9Rl.js → runtime-capabilities-store-CKI07lH0.js} +1 -1
  96. package/web/assets/{safe-mode-instance-rlw24j9k.js → safe-mode-instance-J7qm7IS6.js} +1 -1
  97. package/web/assets/safe-mode-sentinel-DeTTFEAj.js +1 -0
  98. package/web/assets/{select-Bbk9bmXO.js → select-DyBoNnz-.js} +1 -1
  99. package/web/assets/{session-change-summary-api-56l8yH9F.js → session-change-summary-api-C4FTvxhC.js} +1 -1
  100. package/web/assets/{session-home-D124ua9H.js → session-home-Tk-WXqX6.js} +1 -1
  101. package/web/assets/{session-inspector-store-DEkETXO9.js → session-inspector-store-dETdC2U_.js} +1 -1
  102. package/web/assets/{session-questions-T27yIHtt.js → session-questions-CtO1eFNU.js} +1 -1
  103. package/web/assets/{session-scope-zQ_17RIF.js → session-scope-CsPGoBJc.js} +1 -1
  104. package/web/assets/{session-tree-actions-ChzgJEea.js → session-tree-actions-DZZDLGqB.js} +1 -1
  105. package/web/assets/{session-tree-summary-BKDd_JYM.js → session-tree-summary-WmWumC6K.js} +1 -1
  106. package/web/assets/{session-web-preview-BVkOy4vs.js → session-web-preview-Cn2E8PGF.js} +1 -1
  107. package/web/assets/shell-installer-poller-CVgVVrMm.js +1 -0
  108. package/web/assets/{shortcuts-Bv8JhC38.js → shortcuts-DSdtU7Wb.js} +1 -1
  109. package/web/assets/{side-chat-context-D5EIphVm.js → side-chat-context-H-w__LCh.js} +4 -4
  110. package/web/assets/{sidebar-SxdQe8CQ.js → sidebar-BuyjYwgg.js} +1 -1
  111. package/web/assets/{sidebar-store-DyY6rJW1.js → sidebar-store-pXE_2_4e.js} +1 -1
  112. package/web/assets/{speech-session-BKR1toDn.js → speech-session-Z7b9px8D.js} +1 -1
  113. package/web/assets/{startup-queries-BlzaybQG.js → startup-queries-CoDyP6yL.js} +1 -1
  114. package/web/assets/{use-i18n-DIPRXE6G.js → use-i18n-DXKFz7VR.js} +1 -1
  115. package/web/assets/{use-open-bot-B_ehsO-d.js → use-open-bot-ySsS0WXA.js} +1 -1
  116. package/web/assets/{use-studio-actions-oQQ3gp-a.js → use-studio-actions-X_qlY_Lo.js} +1 -1
  117. package/web/assets/{useCatalogProjects-5i9tmSU1.js → useCatalogProjects-BBu88J_x.js} +1 -1
  118. package/web/assets/{useMachines-Cxl0lZtt.js → useMachines-BowIwvtG.js} +1 -1
  119. package/web/assets/{useNewProjectPicker-Be_hs0bk.js → useNewProjectPicker-YHuAYhne.js} +2 -2
  120. package/web/assets/{useNow-DDBbGE9C.js → useNow-DjgF-moE.js} +1 -1
  121. package/web/assets/{usePhoneShell-BiMVOvVC.js → usePhoneShell-B_KSvT2_.js} +1 -1
  122. package/web/assets/{useSessionListQuery-whsrfhx8.js → useSessionListQuery-DMWm19p3.js} +1 -1
  123. package/web/assets/{useSessionRowActions-44XcAIma.js → useSessionRowActions-CNU9xoQ1.js} +1 -1
  124. package/web/assets/{useSidebarModel-DXUg2oqd.js → useSidebarModel-C8AWFx72.js} +1 -1
  125. package/web/assets/{workspace-folders-CnuvMXgu.js → workspace-folders-CU_ykfdZ.js} +1 -1
  126. package/web/assets/{workspace-order-store-1MaQWfWN.js → workspace-order-store-CVIYGcOU.js} +1 -1
  127. package/web/index.html +2 -2
  128. package/web/assets/ConfigPage-CWuA29xP.js +0 -7
  129. package/web/assets/SessionInspector-BwFBCtmV.js +0 -1
  130. package/web/assets/SidebarUpdateStatus-CG5oRTvE.js +0 -1
  131. package/web/assets/i18n-DwWLj5fa.js +0 -1
  132. package/web/assets/index-DOsrWaMc.css +0 -2
  133. package/web/assets/mount-app-MpOpK-lX.js +0 -9
  134. package/web/assets/public-diff-BDIjPUsI.js +0 -1
  135. package/web/assets/public-events-BzPfNLlE.js +0 -1
  136. package/web/assets/safe-mode-sentinel-D_nToF0q.js +0 -1
@@ -1 +1 @@
1
- import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-DOv7xFwV.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-BYsK6aeM.js";import{t as s}from"./use-i18n-DIPRXE6G.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-zQ_17RIF.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{a as ne,r as re,t as j}from"./popover-BL8OTqgj.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,F as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-oQQ3gp-a.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{u as t}from"./vendor-router-CSN_DGvx.js";import{t as n}from"./index-DG9ghV8d.js";import{i as r,r as i}from"./vendor-react-DwNgTV1j.js";import{o as a,r as o}from"./routes-BYsK6aeM.js";import{t as s}from"./use-i18n-DXKFz7VR.js";import{a as c,i as l,o as u}from"./vendor-state-GkUciC5H.js";import{r as d,t as f}from"./useQuery-DfOU-27z.js";import{A as p,j as m,n as h,r as g,t as _}from"./session-scope-CsPGoBJc.js";import{t as v}from"./createLucideIcon-Cd-3GVxJ.js";import{t as y}from"./ellipsis-CfGKfbq6.js";import{t as b}from"./grip-vertical-B__LYT0s.js";import{t as x}from"./plus-fQbSqB1n.js";import{t as S}from"./rotate-ccw-C0v8V77_.js";import{t as C}from"./settings-2-CXJjXJS9.js";import{t as w}from"./x-07u4-129.js";import{c as T,d as E,f as D,i as O,p as k,r as A,t as ee,u as te}from"./dropdown-menu-Ds0gD8S8.js";import{a as ne,r as re,t as j}from"./popover-CnZUY0sI.js";import{t as M}from"./utils-C8uzG5AZ.js";import{t as N}from"./button-CCcCN8tE.js";import{A as P,D as ie,E as ae,F as oe,O as se,S as F,f as ce,i as I,t as L,u as R}from"./use-studio-actions-X_qlY_Lo.js";var le=v(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),ue=v(`square-arrow-out-up-right`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),z=e(r(),1),B=e=>Math.min(1,Math.max(0,e)),V=e=>Number.isFinite(e)?Math.max(0,e):0,H=8,U=12,de=160;function fe(e,t,n=0){let r=Math.max(0,V(e.width)-V(t.width)),i=Math.max(0,V(e.height)-V(t.height)),a=Math.max(0,i-de),o=Math.max(0,a-H),s=V(t.height)+U,c=s?Math.floor(o/s)+1:1,l=Math.max(0,Math.floor(n)),u=Math.floor(l/c),d=l%c,f=r-H-u*(V(t.width)+U),p=a-d*s;return{x:r?B(f/r):1,y:i?B(p/i):1}}function pe(e,t){return`${t?`mobile`:`desktop`}:${e}`}function W(e,t,n){return{x:B(e.x)*Math.max(0,V(t.width)-V(n.width)),y:B(e.y)*Math.max(0,V(t.height)-V(n.height))}}function G(e,t,n,r){let i=W(e,n,r),a=Math.max(0,V(n.width)-V(r.width)),o=Math.max(0,V(n.height)-V(r.height));return{x:B(a?(i.x+t.x)/a:e.x),y:B(o?(i.y+t.y)/o:e.y)}}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e){if(!Array.isArray(e))return[];let t=new Map;for(let n of e)!K(n)||typeof n.key!=`string`||!/^(desktop|mobile):[a-zA-Z0-9][a-zA-Z0-9._:-]{0,95}$/.test(n.key)||!K(n.position)||typeof n.position.x!=`number`||!Number.isFinite(n.position.x)||typeof n.position.y!=`number`||!Number.isFinite(n.position.y)||(t.delete(n.key),t.set(n.key,{x:B(n.position.x),y:B(n.position.y)}),t.size>128&&t.delete(t.keys().next().value??``));return[...t].map(([e,t])=>({key:e,position:t}))}function me(e,t,n){return q([...e.filter(e=>e.key!==t),{key:t,position:n}])}var he=l(()=>({getItem:e=>{try{return n.getItem(e)}catch{return null}},setItem:(e,t)=>{try{n.setItem(e,t)}catch{}},removeItem:e=>{try{n.removeItem(e)}catch{}}})),J=u()(c(e=>({positions:[],setPosition:(t,n)=>e(e=>({positions:me(e.positions,t,n)})),resetPosition:t=>e(e=>({positions:e.positions.filter(e=>e.key!==t)}))}),{name:`pisper-floating-placement`,version:1,storage:he,partialize:({positions:e})=>({positions:e}),merge:(e,t)=>({...t,positions:q(e&&typeof e==`object`&&`positions`in e?e.positions:void 0)})})),Y=i(),X={width:0,height:0},ge=/^(?:desktop|mobile):[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Z=`flex items-center justify-center rounded-full bg-key text-content-muted shadow-key ring-1 ring-key-border hover:text-content`;function _e(e){let t=e.component.manifest,n=t&&se(t,`floating`)?.size||ae;return{width:n.w,height:n.h}}function ve({placed:e,boundaryRef:t,activeSessionId:n,notify:r,onClose:i,stackIndex:a}){let{t:o}=s(),{instance:c,component:l}=e,u=R(l,r),d=pe(c.instanceId,!1),f=J(e=>e.positions.find(e=>e.key===d)?.position),p=(0,z.useRef)(null),m=(0,z.useRef)(null),[h,g]=(0,z.useState)(null),[_,v]=(0,z.useState)({bounds:X,widget:X}),y=f??fe(_.bounds,_.widget,a),x=(0,z.useId)(),C=_e(e),T=c.title||l.manifest?.name||l.name;(0,z.useEffect)(()=>{let e=t.current,n=p.current;if(!e||!n)return;let r=()=>{let t={bounds:{width:e.clientWidth,height:e.clientHeight},widget:{width:n.offsetWidth,height:n.offsetHeight}};v(e=>e.bounds.width===t.bounds.width&&e.bounds.height===t.bounds.height&&e.widget.width===t.widget.width&&e.widget.height===t.widget.height?e:t)},i=new ResizeObserver(()=>r());return r(),i.observe(e),i.observe(n),window.addEventListener(`resize`,r),()=>{i.disconnect(),window.removeEventListener(`resize`,r)}},[t]),(0,z.useEffect)(()=>(g(null),()=>{let e=m.current;m.current=null,e?.element.hasPointerCapture(e.pointerId)&&e.element.releasePointerCapture(e.pointerId)}),[d]);let E=(e,t)=>{let n=m.current;!n||n.pointerId!==e.pointerId||(m.current=null,t&&J.getState().setPosition(d,n.latest),g(null),n.element.hasPointerCapture(n.pointerId)&&n.element.releasePointerCapture(n.pointerId))},D=()=>J.getState().resetPosition(d),O=e=>{let t=e.shiftKey?32:12,n={ArrowLeft:{x:-t,y:0},ArrowRight:{x:t,y:0},ArrowUp:{x:0,y:-t},ArrowDown:{x:0,y:t}};if(e.key===`Home`){e.preventDefault(),D();return}let r=n[e.key];r&&(e.preventDefault(),J.getState().setPosition(d,G(y,r,_.bounds,_.widget)))},k=W(h??y,_.bounds,_.widget);return(0,Y.jsxs)(`div`,{ref:p,role:`group`,"aria-label":T,"data-floating-widget":c.instanceId,"data-floating-component":l.id,className:`pointer-events-auto absolute flex max-w-full flex-col px-6`,style:{left:k.x,top:k.y,width:C.width+48,maxHeight:`100%`,visibility:_.bounds.width>0?`visible`:`hidden`},children:[(0,Y.jsxs)(`div`,{className:`absolute top-1/2 left-0 z-10 flex -translate-y-1/2 flex-col items-center gap-1`,children:[(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.move`),"aria-describedby":x,title:o(`custom-ui:floating.moveHint`),className:M(Z,`h-6 w-5 touch-none`),style:{cursor:h?`grabbing`:`grab`},"data-floating-move":!0,onKeyDown:O,onPointerDown:e=>{e.button!==0||m.current||(e.preventDefault(),e.currentTarget.focus({preventScroll:!0}),e.currentTarget.setPointerCapture(e.pointerId),m.current={pointerId:e.pointerId,element:e.currentTarget,x:e.clientX,y:e.clientY,initial:y,latest:y},g(y))},onPointerMove:e=>{let t=m.current;if(!t||t.pointerId!==e.pointerId)return;let n=G(t.initial,{x:e.clientX-t.x,y:e.clientY-t.y},_.bounds,_.widget);t.latest=n,g(n)},onPointerUp:e=>E(e,!0),onPointerCancel:e=>E(e,!1),onLostPointerCapture:e=>E(e,!1),children:(0,Y.jsx)(b,{className:`size-3`})}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.resetPosition`),title:o(`custom-ui:floating.resetPosition`),onClick:D,className:M(Z,`size-5`),children:(0,Y.jsx)(S,{className:`size-3`})}),(0,Y.jsx)(`span`,{id:x,className:`sr-only`,children:o(`custom-ui:floating.moveHint`)})]}),(0,Y.jsx)(`button`,{type:`button`,"aria-label":o(`custom-ui:floating.close`),title:o(`custom-ui:floating.close`),"data-floating-close":!0,onClick:()=>i(c.instanceId),className:M(Z,`absolute top-1/2 right-0 z-10 size-5 -translate-y-1/2`),children:(0,Y.jsx)(w,{className:`size-3`})}),(0,Y.jsx)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-stroke bg-panel shadow-key`,style:{height:C.height},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`floating`,title:c.title,props:c.props},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onRequestFix:u,className:`h-full`})})]})}function ye({placed:e,activeSessionId:t,notify:n,hidden:r=!1}){let{t:i}=s(),a=d(),o=(0,z.useRef)(null);(0,z.useEffect)(()=>{let e=J.getState();for(let t of e.positions)ge.test(t.key)||e.resetPosition(t.key)},[]);let c=e=>{p(e,{enabled:!1}).then(()=>a.invalidateQueries({queryKey:m.instances()}),()=>n(i(`custom-ui:floating.closeFailed`)))};return(0,Y.jsx)(`div`,{ref:o,className:`pointer-events-none fixed inset-x-2 top-12 bottom-2 z-40 overflow-hidden`,hidden:r,"data-floating-custom-ui":!0,children:e.map((e,r)=>(0,Y.jsx)(ve,{placed:e,boundaryRef:o,activeSessionId:t,notify:n,onClose:c,stackIndex:r},e.instance.instanceId))})}var be=[`session-panel`,`feature-page`,`floating`];function xe(e,t){let{instance:n,component:r}=e;return n.title||r.manifest?.i18n[t]?.name||r.name}function Q({placed:e,label:n,instances:r,notify:i}){let{t:o}=s(),c=t(),l=L(i),[u,d]=(0,z.useState)(!1),{instance:f,component:p}=e,m=async e=>{if(!u){d(!0);try{if(!await l.place(p,r,{surface:e,...f.title?{title:f.title}:{},props:f.props}))return;await l.unplace(f)&&i(o(`custom-ui:overview.moved`,{place:I(e,o)}))}finally{d(!1)}}};return(0,Y.jsxs)(ee,{children:[(0,Y.jsx)(k,{asChild:!0,children:(0,Y.jsx)(N,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`flex-none`,disabled:u,"aria-label":o(`custom-ui:overview.menu`,{name:n}),title:o(`custom-ui:overview.menu`,{name:n}),"data-overview-component-menu":!0,children:(0,Y.jsx)(y,{"aria-hidden":`true`})})}),(0,Y.jsxs)(A,{align:`end`,className:`w-52`,children:[(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id),{state:{componentInstanceId:f.instanceId}}),children:[(0,Y.jsx)(C,{"aria-hidden":`true`}),o(`custom-ui:overview.settings`)]}),(0,Y.jsxs)(O,{onSelect:()=>c(a(p.id)),children:[(0,Y.jsx)(ue,{"aria-hidden":`true`}),o(`custom-ui:tool.openInStudio`)]}),(0,Y.jsxs)(te,{children:[(0,Y.jsxs)(D,{"data-overview-component-move":!0,children:[(0,Y.jsx)(le,{"aria-hidden":`true`}),o(`custom-ui:overview.move`)]}),(0,Y.jsx)(E,{className:`w-48`,children:be.map(e=>{let t=F(p.manifest,e),n=r.some(t=>t.componentId===p.id&&t.surface===e&&t.enabled);return(0,Y.jsxs)(O,{disabled:!t||n,"data-overview-component-move-to":e,onSelect:()=>void m(e),children:[I(e,o),(0,Y.jsx)(`span`,{className:`ml-auto text-xs text-content-muted`,children:t?n?o(`custom-ui:studio.placed`):``:o(`custom-ui:studio.placeUndeclaredShort`)})]},e)})})]}),(0,Y.jsx)(T,{}),(0,Y.jsxs)(O,{"data-overview-component-remove":!0,onSelect:()=>{l.unplace(f).then(e=>{e&&i(o(`custom-ui:overview.removed`,{name:n}))})},children:[(0,Y.jsx)(w,{"aria-hidden":`true`}),o(`custom-ui:overview.remove`)]})]})]})}function Se({placed:e,instances:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a,language:o}=s(),{instance:c,component:l}=e,u=c.size===`M`?`M`:`S`,d=xe(e,o),f=R(l,r);return(0,Y.jsxs)(`article`,{"aria-label":d,"data-overview-component":c.instanceId,"data-overview-component-id":l.id,"data-overview-component-size":u,className:`flex-none overflow-hidden rounded-[var(--r-lg)] bg-panel ring-1 ring-stroke`,children:[(0,Y.jsxs)(`header`,{className:`flex h-9 items-center gap-2 border-b border-stroke-soft pr-1 pl-3 pointer-coarse:h-12`,children:[(0,Y.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13px] leading-5 font-medium text-content`,children:d}),(0,Y.jsx)(`span`,{className:`flex-none rounded-xs border border-stroke px-1.5 text-[11px] leading-4 text-content-muted`,children:a(`custom-ui:overview.badge`)}),(0,Y.jsx)(Q,{placed:e,label:d,instances:t,notify:r})]}),(0,Y.jsx)(`div`,{"data-overview-component-body":!0,className:`overflow-hidden`,style:{height:ie[u].h},children:(0,Y.jsx)(P,{component:l,instance:{instanceId:c.instanceId,surface:`overview-card`,title:c.title,props:c.props,size:u},session:n?{id:n,title:``,cwd:``,status:`idle`}:void 0,notify:r,onOpenSession:i,onRequestFix:f,className:`h-full`})})]})}function $({className:e}){let{t:n}=s(),r=t();return(0,Y.jsxs)(`button`,{type:`button`,"data-overview-component-place":!0,onClick:()=>r(o.components),className:M(`flex h-9 w-full flex-none items-center justify-center gap-1.5 rounded-[var(--r-lg)] border border-dashed border-stroke-strong text-[12.5px] text-content-muted transition-colors duration-(--d-fast) hover:bg-surface-hover hover:text-content focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus pointer-coarse:h-11`,e),children:[(0,Y.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),n(`custom-ui:overview.place`)]})}function Ce({placed:e,layout:t,activeSessionId:n,notify:r,onOpenSession:i}){let{t:a}=s(),o=f(g()).data?.instances??[],c=e.map(e=>(0,Y.jsx)(Se,{placed:e,instances:o,activeSessionId:n,notify:r,onOpenSession:i},e.instance.instanceId));return t===`popover`?(0,Y.jsxs)(j,{children:[(0,Y.jsx)(ne,{asChild:!0,children:(0,Y.jsx)(N,{variant:`outline`,"data-overview-components-trigger":!0,children:a(`custom-ui:overview.trigger`,{count:e.length})})}),(0,Y.jsxs)(re,{align:`end`,"aria-label":a(`custom-ui:overview.heading`),"data-overview-components":`popover`,className:`max-h-(--radix-popover-content-available-height) w-[344px] gap-3 overflow-y-auto p-3`,children:[c,(0,Y.jsx)($,{})]})]}):(0,Y.jsxs)(`div`,{"data-overview-components":t,className:M(`flex flex-col gap-3`,t===`phone`&&`mt-6`),children:[(0,Y.jsx)(`h2`,{className:`text-[13px] leading-5 font-medium text-content-secondary`,children:a(`custom-ui:overview.heading`)}),c,(0,Y.jsx)($,{})]})}function we({placed:e,sessionId:t,cwd:n,notify:r,onOpenSession:i}){let a=oe().find(e=>e.id===t),o=a?.title??``,s=a?.status??`idle`,c=(0,z.useMemo)(()=>({id:t,title:o,cwd:a?.cwd||n,status:s}),[n,t,s,a?.cwd,o]),{instance:l,component:u}=e,d=R(u,r);return(0,Y.jsx)(`div`,{"data-session-panel-component":l.instanceId,className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:(0,Y.jsx)(P,{component:u,instance:{instanceId:l.instanceId,surface:`session-panel`,title:l.title,props:l.props},session:c,notify:r,onOpenSession:i,onRequestFix:d,className:`h-full`},t)})}function Te(e,t){return e.manifest?.i18n[t]?.name||e.name}function Ee({cwd:e,notify:t,onAdded:n}){let{t:r,language:i}=s(),a=f(h()),o=f(g()),c=L(t),[l,u]=(0,z.useState)(null),d=o.data?.instances??[],p=(a.data?.components??[]).filter(e=>ce(e)&&F(e.manifest,`session-panel`)),m=async(e,t)=>{if(!l){u(e.id);try{let r=await c.place(e,d,{surface:`session-panel`,scope:t});r&&n(r.instance.instanceId)}finally{u(null)}}};return a.isPending||o.isPending?(0,Y.jsx)(`p`,{role:`status`,className:`text-content-muted`,children:r(`custom-ui:customUiPage.loading`)}):a.error||o.error?(0,Y.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,Y.jsx)(`p`,{role:`alert`,className:`text-content-secondary`,children:r(`custom-ui:widget.catalogFailed`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,onClick:()=>{a.refetch(),o.refetch()},children:r(`custom-ui:widget.retry`)})]}):p.length?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-session-component-add-menu":!0,children:[(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.addHint`)}),(0,Y.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-1 p-0`,children:p.map(t=>{let a=Te(t,i),o=d.find(e=>e.componentId===t.id&&e.surface===`session-panel`),s=!!(o?.enabled&&_(o.scope,e));return(0,Y.jsxs)(`li`,{"data-session-component-candidate":t.id,className:`flex flex-col gap-1.5 rounded-sm px-1.5 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`truncate text-[13px] font-medium text-content`,children:a}),s&&o?(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`ghost`,className:`self-start`,onClick:()=>n(o.instanceId),children:r(`custom-ui:studio.placed`)}):(0,Y.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null,"data-session-component-scope":`all`,onClick:()=>void m(t,{type:`all`}),children:r(`custom-ui:studio.scopeAll`)}),(0,Y.jsx)(N,{type:`button`,size:`sm`,variant:`secondary`,disabled:l!==null||!e,"data-session-component-scope":`project`,onClick:()=>void m(t,{type:`project`,cwd:e}),children:r(`custom-ui:sessionPanel.thisProject`)})]})]},t.id)})})]}):(0,Y.jsx)(`p`,{className:`text-content-secondary`,children:r(`custom-ui:sessionPanel.empty`)})}export{P as ComponentHost,ye as FloatingComponents,Ce as OverviewComponents,Ee as SessionComponentAddMenu,we as SessionPanelComponent};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mobile-runtime-recovery-tbTyacip.js","assets/rolldown-runtime-B0Z9INg1.js"])))=>i.map(i=>d[i]);
2
- import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{a as r,n as i,r as a}from"./http-response-DkUhGWkC.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
2
+ import{h as e}from"./vendor-router-CSN_DGvx.js";import{i as t,n}from"./abort-signal-f4JsiYKX.js";import{a as r,n as i,r as a}from"./http-response-DNu8g-gu.js";async function o(r){if(typeof window>`u`||!window.__PISPER_MOBILE_APP__)return;let i=n(r,s);try{await t(e(()=>import(`./mobile-runtime-recovery-tbTyacip.js`).then(e=>e.t).then(async e=>{e.installMobileRuntimeForegroundRecovery(),await e.waitForMobileRuntimeReady()}),__vite__mapDeps([0,1])),i.signal)}finally{i.dispose()}}var s=3e4;function c(e,t){return e instanceof Error&&e.message?e.message:typeof e==`string`&&e?e:t}async function l(e,t,n){let{body:a,data:l,headers:u,signal:d,timeout:f=s,...p}=t,m=l===void 0?a:l,h=new Headers(u),g;m!==void 0&&(m instanceof Blob?(g=m,h.has(`Content-Type`)||h.set(`Content-Type`,m.type||`application/octet-stream`)):(g=typeof m==`string`?m:JSON.stringify(m),h.has(`Content-Type`)||h.set(`Content-Type`,`application/json`)));let _=new AbortController,v=!1,y=()=>_.abort(d?.reason);d?.aborted?y():d?.addEventListener(`abort`,y,{once:!0});let b=f>0?setTimeout(()=>{v=!0,_.abort(new DOMException(`Request timed out`,`TimeoutError`))},f):void 0;try{if(await o(_.signal),_.signal.aborted)throw _.signal.reason;let t=await fetch(e,{...p,body:g,headers:h,signal:_.signal});if(!t.ok)throw await i(t);return await n(t)}catch(e){throw e instanceof r?e:v?new r(`请求超时 (${f}ms)`,{kind:`timeout`}):d?.aborted?new r(c(d.reason,`请求已取消`),{kind:`cancelled`}):new r(c(e,`请求失败 (network)`),{kind:`network`})}finally{b!==void 0&&clearTimeout(b),d?.removeEventListener(`abort`,y)}}function u(e,t={}){let{parse:n,...r}=t;return l(e,r,async e=>{let t=await a(e);return n?n(t):t})}function d(e,t={}){return l(e,t,e=>e.text())}function f(e,t={}){return l(e,t,e=>e.blob())}export{o as i,u as n,d as r,f as t};
@@ -1 +1 @@
1
- import{d as e,f as t,p as n,u as r}from"./i18n-DwWLj5fa.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}},a=new Set([`invalid`,`too_large`,`not_found`,`exists`,`busy`,`limit`,`unavailable`,`unsupported`,`forbidden`,`cancelled`,`timeout`,`failed`]);function o(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function s(i,s){let c=o(i),l=typeof c.code==`string`?c.code:``;if(!a.has(l)||!c.params||typeof c.params!=`object`)return s;let u=o(c.params),d=e(r.language)?r.language:t(),f=typeof u.subject==`string`&&u.subject?u.subject:`request`,p=r.exists(`errors:subject.${f}`)?n(`errors:subject.${f}`,d):f,m=n(`errors:code.${l}`,d,{subject:p}),h=typeof u.detail==`string`?u.detail.trim():``;return h?n(`errors:withDetail`,d,{message:m,detail:h}):n(`errors:plain`,d,{message:m})}function c(a){return new i(n(`common:api.invalidResponse`,e(r.language)?r.language:t()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function l(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function u(e){let t=l(await e.text());return new i(s(t,t?.error||e.statusText||`HTTP ${e.status}`),{status:e.status,data:t,kind:`http`})}async function d(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw c(e.status)}}export{i as a,s as i,u as n,d as r,c as t};
1
+ import{d as e,f as t,p as n,u as r}from"./i18n-BI3c0cNs.js";var i=class extends Error{status;data;kind;constructor(e,t={}){super(e),this.name=`ApiError`,this.status=t.status,this.data=t.data,this.kind=t.kind}},a=new Set([`invalid`,`too_large`,`not_found`,`exists`,`busy`,`limit`,`unavailable`,`unsupported`,`forbidden`,`cancelled`,`timeout`,`failed`]);function o(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function s(i,s){let c=o(i),l=typeof c.code==`string`?c.code:``;if(!a.has(l)||!c.params||typeof c.params!=`object`)return s;let u=o(c.params),d=e(r.language)?r.language:t(),f=typeof u.subject==`string`&&u.subject?u.subject:`request`,p=r.exists(`errors:subject.${f}`)?n(`errors:subject.${f}`,d):f,m=n(`errors:code.${l}`,d,{subject:p}),h=typeof u.detail==`string`?u.detail.trim():``;return h?n(`errors:withDetail`,d,{message:m,detail:h}):n(`errors:plain`,d,{message:m})}function c(a){return new i(n(`common:api.invalidResponse`,e(r.language)?r.language:t()),{status:a,kind:`protocol`,data:{code:`INVALID_RESPONSE`}})}function l(e){if(e)try{let t=JSON.parse(e);return typeof t==`object`&&t&&!Array.isArray(t)?{...t,error:`error`in t&&typeof t.error==`string`?t.error:void 0}:{error:typeof t==`string`?t:e,body:t}}catch{return{error:e}}}async function u(e){let t=l(await e.text());return new i(s(t,t?.error||e.statusText||`HTTP ${e.status}`),{status:e.status,data:t,kind:`http`})}async function d(e){if(e.status===204)return;let t=await e.text();if(t)try{return JSON.parse(t)}catch{throw c(e.status)}}export{i as a,s as i,u as n,d as r,c as t};