vibelet 1.2.237 → 1.2.238

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 (106) hide show
  1. package/README.md +35 -0
  2. package/dist/index.cjs +1 -1
  3. package/dist/inventory-scan-worker.cjs +1 -1
  4. package/dist/runtime-version.cjs +1 -1
  5. package/dist/vibelet.mjs +357 -244
  6. package/dist/web/assets/App-C21-MM7L.js +2 -0
  7. package/dist/web/assets/App-CbEM8WX0.css +1 -0
  8. package/dist/web/assets/BrowserControlPanel-CkKIuEsj.js +1 -0
  9. package/dist/web/assets/{ChipGroup-DCvI-4nb.js → ChipGroup-YMpjYR9P.js} +1 -1
  10. package/dist/web/assets/FilesControlPanel-CwbB5lm2.js +1 -0
  11. package/dist/web/assets/GlobalPendingDialog-DqEBvP53.js +1 -0
  12. package/dist/web/assets/{ImageViewer-ChfsVDQe.js → ImageViewer-CK5ZHIVv.js} +1 -1
  13. package/dist/web/assets/{LanguageSettingsPanel-P7H9JLtq.js → LanguageSettingsPanel-BXx4BvyU.js} +1 -1
  14. package/dist/web/assets/{MarkdownModePanel-B4zGnWRC.js → MarkdownModePanel-VRQHdCgq.js} +1 -1
  15. package/dist/web/assets/NewSessionDialog-CuL1-FFv.js +1 -0
  16. package/dist/web/assets/{NotificationSettingsPanel-BAcpsROS.js → NotificationSettingsPanel-D78c9Tv6.js} +1 -1
  17. package/dist/web/assets/{RemoteLifeOSBlock-C46RjZWn.js → RemoteLifeOSBlock-BjYrjRa2.js} +2 -2
  18. package/dist/web/assets/RemoteWorkspaceSettings-7jz8oX59.css +1 -0
  19. package/dist/web/assets/RemoteWorkspaceSettings-B9yBCaSU.js +1 -0
  20. package/dist/web/assets/{SessionTerminalPanel-pCQpIA-I.js → SessionTerminalPanel-D_XqGjcx.js} +1 -1
  21. package/dist/web/assets/{ThemeSettingsPanel-JUF7qFiS.js → ThemeSettingsPanel-BAHOGS0L.js} +1 -1
  22. package/dist/web/assets/{abnfDiagram-VRR7QNED-BUn7dXdz.js → abnfDiagram-VRR7QNED-C_g14JDy.js} +1 -1
  23. package/dist/web/assets/arc-Dlh78dPq.js +1 -0
  24. package/dist/web/assets/{architectureDiagram-ZJ3FMSHR-QlFDuk3c.js → architectureDiagram-ZJ3FMSHR-r6osYFBK.js} +1 -1
  25. package/dist/web/assets/{arrow-right-BkDm1nz1.js → arrow-right-BtC2L5Xy.js} +1 -1
  26. package/dist/web/assets/{blockDiagram-677ZJIJ3-Di1jkO8N.js → blockDiagram-677ZJIJ3-Dt1NkFp6.js} +1 -1
  27. package/dist/web/assets/{c4Diagram-LMCZKHZV-BIE5S3xC.js → c4Diagram-LMCZKHZV-DgzJiNGp.js} +1 -1
  28. package/dist/web/assets/channel-CoeVE6la.js +1 -0
  29. package/dist/web/assets/{chunk-2Q5K7J3B-BZdVpYMm.js → chunk-2Q5K7J3B-CuStQQP5.js} +1 -1
  30. package/dist/web/assets/{chunk-32BRIVSS-DniTjuKD.js → chunk-32BRIVSS-CqcvfQyF.js} +1 -1
  31. package/dist/web/assets/{chunk-5VM5RSS4-zU4WGQUt.js → chunk-5VM5RSS4-ClfzIwi_.js} +1 -1
  32. package/dist/web/assets/{chunk-EX3LRPZG-B_EGZWf3.js → chunk-EX3LRPZG-km8mrFBg.js} +1 -1
  33. package/dist/web/assets/{chunk-JWPE2WC7-8R4xqfzd.js → chunk-JWPE2WC7-CwqQJZta.js} +1 -1
  34. package/dist/web/assets/{chunk-MOJQB5TN-CmpQblce.js → chunk-MOJQB5TN-D6HJ3YLS.js} +1 -1
  35. package/dist/web/assets/{chunk-RYQCIY6F-DrT9S-SZ.js → chunk-RYQCIY6F-DzxL_I7L.js} +1 -1
  36. package/dist/web/assets/{chunk-V7JOEXUC-CEP012wY.js → chunk-V7JOEXUC-Cx4-zn7N.js} +1 -1
  37. package/dist/web/assets/{chunk-VR4S4FIN-DcSau3fK.js → chunk-VR4S4FIN-uFIJLxCS.js} +1 -1
  38. package/dist/web/assets/{chunk-XXDRQBXY-BoXCe4yS.js → chunk-XXDRQBXY-Cg2Q6HPU.js} +1 -1
  39. package/dist/web/assets/classDiagram-OUVF2IWQ-UcfsFNaj.js +1 -0
  40. package/dist/web/assets/classDiagram-v2-EOCWNBFH-UcfsFNaj.js +1 -0
  41. package/dist/web/assets/{clsx-DNJkZJoV.js → clsx-dhsJw0G5.js} +1 -1
  42. package/dist/web/assets/{collectMessageImages-CUMbRGiF.js → collectMessageImages-ZyOAE6id.js} +1 -1
  43. package/dist/web/assets/{cose-bilkent-JH36ORCC-DKrqebqO.js → cose-bilkent-JH36ORCC-CcjvJAJB.js} +1 -1
  44. package/dist/web/assets/{cynefin-VYW2F7L2-bQLn5vS2.js → cynefin-VYW2F7L2-fGkbWpUF.js} +1 -1
  45. package/dist/web/assets/{cynefinDiagram-TSTJHNR4-ezXQFC9o.js → cynefinDiagram-TSTJHNR4-Cvuw_uxU.js} +1 -1
  46. package/dist/web/assets/{dagre-VKFMJZFB-CDV8r_Bq.js → dagre-VKFMJZFB-D07owLRU.js} +1 -1
  47. package/dist/web/assets/{diagram-FQU43EPY-BICapB67.js → diagram-FQU43EPY-C8yKetrQ.js} +1 -1
  48. package/dist/web/assets/{diagram-G47NLZAW-TuVLjwN6.js → diagram-G47NLZAW-CM7slttO.js} +1 -1
  49. package/dist/web/assets/{diagram-NH7WQ7WH-B3dBWl3F.js → diagram-NH7WQ7WH-CAqIaHvI.js} +1 -1
  50. package/dist/web/assets/{diagram-OA4YK3LP-DeIQlN-6.js → diagram-OA4YK3LP-s_8LmV3Y.js} +1 -1
  51. package/dist/web/assets/{diagram-WEI45ONY-DZcwYcod.js → diagram-WEI45ONY-DcL-hbJN.js} +1 -1
  52. package/dist/web/assets/{ebnfDiagram-CCIWWBDH-4KcDP5Zj.js → ebnfDiagram-CCIWWBDH-BiY1-WEY.js} +1 -1
  53. package/dist/web/assets/{erDiagram-Q63AITRT-D4KIuggo.js → erDiagram-Q63AITRT-iIeyBkVv.js} +1 -1
  54. package/dist/web/assets/{file-editor-FileCodeEditor-Dn3f5PUl.js → file-editor-FileCodeEditor-Cc7o0SoW.js} +2 -2
  55. package/dist/web/assets/{file-editor-ObsidianCodeEditor-BgXz3c5Z.js → file-editor-ObsidianCodeEditor-DKHh91wx.js} +2 -2
  56. package/dist/web/assets/{file-editor-ObsidianFileEditor-CM9ucogo.js → file-editor-ObsidianFileEditor-D4DiY_3P.js} +2 -2
  57. package/dist/web/assets/{file-editor-index-C7QHkk3U.js → file-editor-index-BrEnI_H0.js} +1 -1
  58. package/dist/web/assets/{file-editor-index-DIH2DQ5-.js → file-editor-index-DdTlNUV4.js} +1 -1
  59. package/dist/web/assets/{flowDiagram-23GEKE2U-BeHvede_.js → flowDiagram-23GEKE2U-CTWUxjYj.js} +1 -1
  60. package/dist/web/assets/{folder-plus-BVS_Q2fe.js → folder-plus-Cud2L2F4.js} +1 -1
  61. package/dist/web/assets/{ganttDiagram-NO4QXBWP-DrwEUqQX.js → ganttDiagram-NO4QXBWP-wo784lYB.js} +1 -1
  62. package/dist/web/assets/{gitGraphDiagram-IHSO6WYX-Cm7T6TME.js → gitGraphDiagram-IHSO6WYX-BY6lbwzB.js} +1 -1
  63. package/dist/web/assets/{highlighted-body-TPN3WLV5-DJAPujEc.js → highlighted-body-TPN3WLV5-CDeMvzq_.js} +1 -1
  64. package/dist/web/assets/{index-CapF4a8Y.js → index-BTavN9lk.js} +1 -1
  65. package/dist/web/assets/{index-CX8KV6EH.js → index-Dx_1eu1W.js} +2 -2
  66. package/dist/web/assets/{infoDiagram-FWYZ7A6U-CgeulgC-.js → infoDiagram-FWYZ7A6U-CfoivPz9.js} +1 -1
  67. package/dist/web/assets/{ishikawaDiagram-FXEZZL3T-x4glLaWe.js → ishikawaDiagram-FXEZZL3T-Bt6xBkx3.js} +1 -1
  68. package/dist/web/assets/{journeyDiagram-5HDEW3XC-DHGcWBDR.js → journeyDiagram-5HDEW3XC-D_lKOA6h.js} +1 -1
  69. package/dist/web/assets/{kanban-definition-HUTT4EX6-CqYivdRn.js → kanban-definition-HUTT4EX6-Ce_DMiiq.js} +1 -1
  70. package/dist/web/assets/key-round-BgAVbd3A.js +1 -0
  71. package/dist/web/assets/{linear-BKnAjtJN.js → linear-DmQK5Nk3.js} +1 -1
  72. package/dist/web/assets/{mermaid-O7DHMXV3-B3e3pugB.js → mermaid-O7DHMXV3-DKlyhw3K.js} +2 -2
  73. package/dist/web/assets/{mermaid.core-CTf8qcol.js → mermaid.core-jR_k1I8D.js} +2 -2
  74. package/dist/web/assets/{mindmap-definition-LN4V7U3C-NQnwG7IB.js → mindmap-definition-LN4V7U3C-4KSBnEFJ.js} +1 -1
  75. package/dist/web/assets/{pegDiagram-2B236MQR-jfLjzzsG.js → pegDiagram-2B236MQR-rZKZ-HjO.js} +1 -1
  76. package/dist/web/assets/{pieDiagram-ENE6RG2P-CgxRYPCf.js → pieDiagram-ENE6RG2P-Fz-HbF4X.js} +1 -1
  77. package/dist/web/assets/{quadrantDiagram-ABIIQ3AL-0zHgV223.js → quadrantDiagram-ABIIQ3AL-G8TsEkFM.js} +1 -1
  78. package/dist/web/assets/{railroadDiagram-RFXS5EU6-CQqf55Rk.js → railroadDiagram-RFXS5EU6-ztb7MjCm.js} +1 -1
  79. package/dist/web/assets/{requirementDiagram-TGXJPOKE-Dm9cKzLN.js → requirementDiagram-TGXJPOKE-4Y2Rvrbc.js} +1 -1
  80. package/dist/web/assets/{sankeyDiagram-HTMAVEWB-BRBxR71X.js → sankeyDiagram-HTMAVEWB-BfX7WEmV.js} +1 -1
  81. package/dist/web/assets/{sequenceDiagram-DBY2YBRQ-DxVBmbfg.js → sequenceDiagram-DBY2YBRQ-BMavjnNv.js} +1 -1
  82. package/dist/web/assets/{sizeCapture-X5ZJPWSS-DNNwG-Sh.js → sizeCapture-X5ZJPWSS-DGkFWUNW.js} +1 -1
  83. package/dist/web/assets/{stateDiagram-2N3HPSRC-C8KGcqhJ.js → stateDiagram-2N3HPSRC-Bu42YWoA.js} +1 -1
  84. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-BwgU75NJ.js +1 -0
  85. package/dist/web/assets/{swimlanes-5IMT3BWC-CRe3WzWn.js → swimlanes-5IMT3BWC-BGb3og3u.js} +2 -2
  86. package/dist/web/assets/swimlanesDiagram-G3AALYLV-D2gngEsl.js +1 -0
  87. package/dist/web/assets/{timeline-definition-FHXFAJF6-CQqiFe9j.js → timeline-definition-FHXFAJF6-Bvzb38qw.js} +1 -1
  88. package/dist/web/assets/{ts-tags-Chlpw95x.js → ts-tags-DAT_GLYZ.js} +1 -1
  89. package/dist/web/assets/{vennDiagram-L72KCM5P-C_5c80TB.js → vennDiagram-L72KCM5P-n0xgqOqd.js} +1 -1
  90. package/dist/web/assets/{wardleyDiagram-EHGQE667-DJ2RRwLP.js → wardleyDiagram-EHGQE667-CwAxqpRk.js} +1 -1
  91. package/dist/web/assets/{xychartDiagram-FW5EYKEG-MgVCQknE.js → xychartDiagram-FW5EYKEG-B6f2c1Rw.js} +1 -1
  92. package/dist/web/index.html +1 -1
  93. package/dist/web/obsidian-editor-assets.json +1 -1
  94. package/package.json +1 -1
  95. package/dist/web/assets/App-BY3qcVsa.css +0 -1
  96. package/dist/web/assets/App-CLTYkSvy.js +0 -2
  97. package/dist/web/assets/BrowserControlPanel-DJHj2vwI.js +0 -1
  98. package/dist/web/assets/FilesControlPanel-B-pqZWgH.js +0 -1
  99. package/dist/web/assets/GlobalPendingDialog-M2Dbntba.js +0 -1
  100. package/dist/web/assets/NewSessionDialog-Cw6WvtMR.js +0 -1
  101. package/dist/web/assets/arc-BW2CYTF6.js +0 -1
  102. package/dist/web/assets/channel-CgLW9Jd5.js +0 -1
  103. package/dist/web/assets/classDiagram-OUVF2IWQ-BTbMtdvt.js +0 -1
  104. package/dist/web/assets/classDiagram-v2-EOCWNBFH-BTbMtdvt.js +0 -1
  105. package/dist/web/assets/stateDiagram-v2-6OUMAXLB-Bk6KXy8V.js +0 -1
  106. package/dist/web/assets/swimlanesDiagram-G3AALYLV-DsL6VYKg.js +0 -1
@@ -1 +0,0 @@
1
- import{c as e,r,h as t,j as s,E as o}from"./index-CX8KV6EH.js";import{X as a,G as l,s as n,C as i,e as c,g as d}from"./App-CLTYkSvy.js";import{a as u,A as b}from"./arrow-right-BkDm1nz1.js";const w=e("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),p=(e,r)=>{const t=document.createElement("iframe");t.className="browser-page",t.title=e.getAttribute("aria-label")||"Browser",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-downloads"),t.referrerPolicy="no-referrer",e.append(t);const s=[];let o=-1,a=!1;const l=()=>r({url:s[o]||"",title:"",loading:a,canGoBack:o>0,canGoForward:o<s.length-1}),n=()=>{a=!0,t.src=s[o],l()};return t.addEventListener("load",()=>{a=!1,l()}),{navigate:e=>{s.splice(o+1),s.push(e),o++,n()},back:()=>{o>0&&(o--,n())},forward:()=>{o<s.length-1&&(o++,n())},reload:()=>{o>=0&&n()},stop:()=>{a=!1;try{t.contentWindow?.stop()}catch{}l()},destroy:()=>t.remove()}},f={url:"",title:"",loading:!1,canGoBack:!1,canGoForward:!1};function h({t:e,onTitleChange:h,dockActions:m,onClose:x,initialUrl:g,onUrlChange:j,visible:v=!0}){const y=r.useRef(null),E=r.useRef(null),C=r.useRef(null),k=r.useRef(null),[A,N]=r.useState(""),[U,L]=r.useState(f),[R,$]=r.useState(!1),[B,F]=r.useState(!1),[G,S]=r.useState("idle");r.useEffect(()=>{v&&B&&k.current?.focus()},[v,B]),r.useEffect(()=>{S("idle")},[U.url]),r.useEffect(()=>{if("idle"===G)return;const e=setTimeout(()=>S("idle"),2e3);return()=>clearTimeout(e)},[G]),r.useEffect(()=>{j?.(U.url)},[U.url,j]),r.useEffect(()=>{U.url&&h?.(U.title||new URL(U.url).hostname)},[U.title,U.url,e.browser]);const D=()=>{U.url&&d(U.url).then(()=>S("copied"),()=>S("failed"))},T=()=>{$(!1),B||N(U.url),F(!0),k.current?.focus(),k.current?.select()};r.useEffect(()=>{const e=y.current,r=e=>{v&&("browserAddress"===e.detail&&T(),"browserCopyUrl"===e.detail&&D())};return e?.addEventListener("vibelet.browser.command",r),()=>e?.removeEventListener("vibelet.browser.command",r)},[v,B,U.url]);const q=!!t().mountBrowser;r.useEffect(()=>{if(!E.current)return;const e=(t().mountBrowser||p)(E.current,e=>{L(e),document.activeElement!==k.current&&N(e.url)});return C.current=e,()=>{C.current=null,e.destroy()}},[]),r.useEffect(()=>{g&&C.current?.navigate(g)},[g]);const z=(e,r,t,o=!1,a=e)=>s.jsx("button",{type:"button",title:a,"aria-label":e,onClick:t,disabled:o,children:s.jsx(r,{"aria-hidden":"true"})});return s.jsxs("section",{ref:y,className:"embedded-browser-panel","aria-label":e.browser,children:[s.jsxs("div",{className:"browser-navigation",children:[m,z(e.browserBack,u,()=>C.current?.back(),!U.canGoBack),z(e.browserForward,b,()=>C.current?.forward(),!U.canGoForward),z(q&&U.loading?e.browserStop:e.browserReload,q&&U.loading?a:w,()=>q&&U.loading?C.current?.stop():C.current?.reload(),!U.url),B?s.jsxs("form",{className:"browser-address",onSubmit:e=>{e.preventDefault();const r=function(e){const r=e.trim();if(!r)return null;let t=r;if(/^[a-z][a-z\d+.-]*:/i.test(r)&&!/^[^:/\s]+:\d+(?:[/?#]|$)/.test(r)){if(!/^https?:\/\//i.test(r))return null}else t=/^(localhost|127\.0\.0\.1|\[::1\])(?::\d+)?(?:[/?#]|$)/i.test(r)?`http://${r}`:!/\s/.test(r)&&/^[^/]+\.[^/]+/.test(r)?`https://${r}`:`https://www.google.com/search?q=${encodeURIComponent(r)}`;try{const e=new URL(t);return!/^https?:$/.test(e.protocol)||e.username||e.password?null:e.href}catch{return null}}(A);r&&new URL(r).origin!==window.location.origin?($(!1),N(r),C.current?.navigate(r),k.current?.blur(),F(!1)):$(!0)},children:[s.jsx(l,{"aria-hidden":"true"}),s.jsx("input",{ref:k,value:A,onChange:e=>{N(e.target.value),$(!1)},"aria-label":e.browserAddress,placeholder:e.browserAddress,autoComplete:"off",spellCheck:!1,"aria-invalid":R,onFocus:e=>e.target.select(),onKeyDown:e=>{"Escape"===e.key&&(F(!1),$(!1),N(U.url))}})]}):s.jsx("button",{type:"button",className:"browser-page-title",title:n(U.url||e.browserAddress,"browserAddress"),"aria-label":e.browserAddress,"aria-expanded":B,onClick:T,children:U.title||e.browser}),z("copied"===G?e.browserUrlCopied:e.browserCopyUrl,"copied"===G?i:c,D,!U.url,n(e.browserCopyUrl,"browserCopyUrl")),s.jsx("a",{href:U.url||void 0,target:"_blank",rel:"noopener noreferrer","aria-label":e.browserExternal,title:e.browserExternal,"aria-disabled":!U.url,onClick:e=>{U.url?t().openExternal&&(e.preventDefault(),t().openExternal(U.url)):e.preventDefault()},children:s.jsx(o,{"aria-hidden":"true"})}),x&&s.jsx("button",{type:"button","aria-label":`${e.close} ${U.title||e.browser}`,title:n(e.close,"closeTab"),onClick:x,children:s.jsx(a,{"aria-hidden":"true"})})]}),"failed"===G&&s.jsx("p",{className:"browser-status",role:"alert",children:e.browserCopyFailed}),R&&s.jsx("p",{className:"browser-status",role:"alert",children:e.browserInvalidAddress}),U.error&&s.jsxs("div",{className:"browser-load-error",role:"alert",children:[s.jsx("p",{children:e.browserLoadFailed}),s.jsx("small",{children:U.error}),s.jsx("button",{type:"button",onClick:()=>C.current?.reload(),children:e.retry})]}),U.loading&&s.jsx("div",{className:"browser-loading",role:"status","aria-label":e.browserLoading}),s.jsx("div",{ref:E,role:"region",className:"browser-surface","aria-label":e.browser,hidden:!U.url||!!U.error}),!U.url&&s.jsxs("div",{className:"browser-empty",children:[s.jsx(l,{"aria-hidden":"true"}),s.jsx("p",{children:e.browserWelcome})]}),!q&&U.url&&s.jsx("p",{className:"browser-status",children:e.browserEmbedHint})]})}export{h as default};
@@ -1 +0,0 @@
1
- import{c as e,j as t,f as r,r as n,E as a,u as o,b as s,d as i}from"./index-CX8KV6EH.js";import{X as l,e as c,P as d,T as u,M as p,N as h,O as m,g as y,Q as f,c as g,D as x,R as v,U as b,L as w,V as j,J as k,W as D,Y as E,k as C,_ as N,$ as _,a0 as S}from"./App-CLTYkSvy.js";import{F as M}from"./folder-plus-BVS_Q2fe.js";const F=e("clipboard-paste",[["path",{d:"M11 14h10",key:"1w8e9d"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v1.344",key:"1e62lh"}],["path",{d:"m17 18 4-4-4-4",key:"z2g111"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113",key:"bjbb7m"}],["rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",key:"ublpy"}]]),L=e("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]]),T=e("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),R=e("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),P=e("scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);function A({ops:e,onOpen:r,root:o}){const s=n.useRef(null),i=e.menu;n.useLayoutEffect(()=>{const t=s.current,r=document.activeElement,n=t.getBoundingClientRect();t.style.left=`${Math.max(8,Math.min(i.x,innerWidth-n.width-8))}px`,t.style.top=`${Math.max(8,Math.min(i.y,innerHeight-n.height-8))}px`,t.querySelector("button:not(:disabled)")?.focus();const a=r=>{t.contains(r.target)||e.setMenu(null)},o=()=>e.setMenu(null);return document.addEventListener("pointerdown",a),document.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{document.removeEventListener("pointerdown",a),document.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o),t.contains(document.activeElement)&&r?.focus()}},[]);const l=t=>{e.setMenu(null),t()};return t.jsxs("div",{ref:s,role:"menu","aria-label":e.strings.open,className:"session-context-menu file-tree-menu",style:{left:i.x,top:i.y},onKeyDown:t=>{t.stopPropagation();const r=Array.from(s.current.querySelectorAll("button:not(:disabled)")),n=r.indexOf(document.activeElement);["ArrowUp","ArrowDown","Home","End","Escape","Tab"].includes(t.key)&&t.preventDefault(),"Escape"!==t.key&&"Tab"!==t.key||e.setMenu(null),"ArrowDown"===t.key&&r[(n+1)%r.length]?.focus(),"ArrowUp"===t.key&&r[(n-1+r.length)%r.length]?.focus(),"Home"===t.key&&r[0]?.focus(),"End"===t.key&&r.at(-1)?.focus()},onContextMenu:e=>e.preventDefault(),children:[!i.directory&&t.jsxs("button",{type:"button",role:"menuitem",onClick:()=>l(r),children:[t.jsx(a,{}),e.strings.open]}),i.path!==o&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{type:"button",role:"menuitem",onClick:()=>e.copy(i,!1),children:[t.jsx(c,{}),e.strings.copy,t.jsx("kbd",{children:"⌘C"})]}),t.jsxs("button",{type:"button",role:"menuitem",onClick:()=>e.copy(i,!0),children:[t.jsx(P,{}),e.strings.cut,t.jsx("kbd",{children:"⌘X"})]})]}),t.jsxs("button",{type:"button",role:"menuitem",disabled:!e.canPaste,onClick:()=>l(()=>{e.paste(i)}),children:[t.jsx(F,{}),e.strings.paste,t.jsx("kbd",{children:"⌘V"})]}),t.jsxs("button",{type:"button",role:"menuitem",onClick:()=>l(()=>{e.copyPath(i)}),children:[t.jsx(R,{}),e.strings.copyPath]}),i.path!==o&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"context-menu-separator"}),t.jsxs("button",{type:"button",role:"menuitem",onClick:()=>e.startRename(i),children:[t.jsx(d,{}),e.strings.rename,t.jsx("kbd",{children:"F2"})]}),t.jsxs("button",{type:"button",role:"menuitem",className:"danger",onClick:()=>l(()=>e.setDeleting(i)),children:[t.jsx(u,{}),e.strings.delete]})]})]})}function O({ops:e}){const r=o(()=>{e.busy||e.setDeleting(null)});return t.jsx("div",{className:"app-confirmation-layer",children:t.jsxs("div",{ref:r,className:"app-confirmation file-tree-delete-dialog",role:"dialog","aria-modal":"true","aria-label":e.strings.confirmDelete,tabIndex:-1,children:[t.jsx("h2",{children:e.strings.confirmDelete}),t.jsx("p",{children:e.deleting?.path}),t.jsx("p",{children:e.strings.deleteHint}),e.error&&t.jsx("p",{role:"alert",children:e.error}),t.jsxs("footer",{children:[t.jsx("button",{type:"button",disabled:e.busy,onClick:()=>e.setDeleting(null),children:e.strings.cancel}),t.jsx("button",{type:"button",className:"destructive",disabled:e.busy,onClick:()=>{e.deleteItem()},children:e.strings.delete})]})]})})}function I({ops:e,root:n,onOpen:a}){return t.jsxs(t.Fragment,{children:[e.menu&&r.createPortal(t.jsx(A,{ops:e,root:n,onOpen:a}),document.body),e.deleting&&r.createPortal(t.jsx(O,{ops:e}),document.body),e.error&&!e.deleting&&t.jsxs("div",{className:"file-tree-notice",role:"alert",children:[t.jsx("span",{children:e.error}),t.jsx("button",{type:"button",title:e.strings.dismiss,"aria-label":e.strings.dismiss,onClick:()=>e.setError(""),children:t.jsx(l,{})})]}),e.undo&&t.jsxs("div",{className:"file-tree-notice",role:"status",children:[t.jsx("span",{children:e.strings.deleted}),t.jsx("button",{type:"button",disabled:e.busy,onClick:()=>{e.restore()},children:e.strings.undo}),t.jsx("button",{type:"button",title:e.strings.dismiss,"aria-label":e.strings.dismiss,onClick:()=>e.setUndo(null),children:t.jsx(l,{})})]})]})}function q(e){return[...e].sort((e,t)=>Number(t.isDirectory)-Number(e.isDirectory)||e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}))}const K={copy:"Copy",cut:"Cut",paste:"Paste",copyPath:"Copy path",editPath:"Edit directory path",rename:"Rename",delete:"Delete",cancel:"Cancel",confirmDelete:"Delete this item?",deleteHint:"You can undo this deletion after it finishes.",deleted:"Deleted",undo:"Undo",dismiss:"Dismiss",name:"Name",open:"Open",errors:{destination_exists:"An item with this name already exists.",recursive_destination:"Choose a different folder.",outside_root:"Choose a destination inside this folder.",protected_path:"This location is protected.",invalid_operation:"Enter a valid file name.",unsaved_changes:"Save the open file changes first.",daemon_update_required:"Update Vibelet on the connected computer to enable file operations.",ENOENT:"The file or folder no longer exists. Refresh the tree.",EACCES:"Permission denied.",EXDEV:"Moving between disks is unavailable. Copy the item first.",operation_failed:"File operation failed.",source_cleanup_failed:"A recovery copy was saved, but the original could not be fully removed. Check file permissions before retrying.",refresh_failed:"The operation succeeded, but the file tree could not refresh. Refresh it to see the changes."}},H={copy:"复制",cut:"剪切",paste:"粘贴",copyPath:"复制路径",editPath:"修改目录路径",rename:"重命名",delete:"删除",cancel:"取消",confirmDelete:"删除这个项目?",deleteHint:"删除完成后可以撤销。",deleted:"已删除",undo:"撤销",dismiss:"关闭",name:"名称",open:"打开",errors:{destination_exists:"已有同名文件或文件夹,请换一个名称。",recursive_destination:"不能移动或复制到自身目录中。",outside_root:"请选择当前文件夹内的目标目录。",protected_path:"不能操作这个受保护的位置。",invalid_operation:"请输入有效的文件名。",unsaved_changes:"请先保存已打开文件的修改。",daemon_update_required:"请更新被连接电脑上的 Vibelet,以启用文件操作。",ENOENT:"文件或文件夹已不存在,请刷新文件树。",EACCES:"没有操作权限。",EXDEV:"暂不支持跨磁盘移动,请先复制。",operation_failed:"文件操作失败。",source_cleanup_failed:"已保存恢复副本,但原文件未能完整移除。请检查文件权限后再重试。",refresh_failed:"操作已成功,但文件树刷新失败,请刷新查看结果。"}},V={copy:"複製",cut:"剪下",paste:"貼上",copyPath:"複製路徑",editPath:"修改目錄路徑",rename:"重新命名",delete:"刪除",cancel:"取消",confirmDelete:"刪除這個項目?",deleteHint:"刪除完成後可以復原。",deleted:"已刪除",undo:"復原",dismiss:"關閉",name:"名稱",open:"開啟",errors:{destination_exists:"已有同名檔案或資料夾,請換一個名稱。",recursive_destination:"不能移動或複製到自身目錄中。",outside_root:"請選擇目前資料夾內的目標目錄。",protected_path:"不能操作這個受保護的位置。",invalid_operation:"請輸入有效的檔案名稱。",unsaved_changes:"請先儲存已開啟檔案的修改。",daemon_update_required:"請更新被連接電腦上的 Vibelet,以啟用檔案操作。",ENOENT:"檔案或資料夾已不存在,請重新整理檔案樹。",EACCES:"沒有操作權限。",EXDEV:"暫不支援跨磁碟移動,請先複製。",operation_failed:"檔案操作失敗。",source_cleanup_failed:"已儲存復原副本,但原檔案未能完整移除。請檢查檔案權限後再重試。",refresh_failed:"操作已成功,但檔案樹重新整理失敗,請重新整理查看結果。"}};let U=null,z=null;const X="application/x-vibelet-file",W="vibelet:file-clipboard";function $({client:e,onRefreshDirectory:r,cwd:a,entries:o,error:l,loaded:c,loading:u,path:S,selectedPath:F,revealRequest:R,t:P,onListDirectory:A,onLoadChildren:O,onNewFolder:$,onOpenRemoteFile:B}){const J=p(),Y=JSON.stringify([J?.scopeKey??"default",S]),Q=function(e,t,r){const a=p(),o=JSON.stringify([a?.scopeKey??"default",e]),[s,i]=h(o,()=>new Set),[l,c]=h(o,()=>({})),[d,u]=h(o,()=>new Set),[m,y]=h(o,()=>({})),f=n.useRef(0),g=n.useRef(new Set);n.useEffect(()=>(v(),()=>{f.current++}),[e,o]);const x=async(e,t)=>{if(!g.current.has(e)){g.current.add(e),u(t=>new Set(t).add(e)),y(t=>{const r={...t};return delete r[e],r});try{const n=await r(e);f.current===t&&c(t=>({...t,[e]:q(n)}))}catch{f.current===t&&y(t=>({...t,[e]:"unavailable"}))}finally{f.current===t&&(g.current.delete(e),u(t=>{const r=new Set(t);return r.delete(e),r}))}}},v=async()=>{const e=++f.current;g.current.clear(),u(new Set),y({}),c(e=>Object.fromEntries(Object.entries(e).filter(([e])=>s.has(e)))),await Promise.all([...s].map(t=>x(t,e)))};return{refresh:v,expanded:s,children:l,loading:d,errors:m,collapse:e=>i(t=>{const r=new Set(t);return r.delete(e),r}),expand:async e=>{i(t=>new Set(t).add(e)),l[e]&&!m[e]||await x(e,f.current)}}}(S,0,O),G=function(e,t){const r=p()?.scopeKey,a=function(){const e=s(i().language);return"en"===e?K:"zh-TW"===e?V:H}(),[o,l]=n.useState(null),[c,d]=n.useState(null),[u,h]=n.useState(""),[w,j]=n.useState(null),[k,D]=n.useState(null),[E,C]=n.useState(""),N=e=>{e&&C(""),j(e)},[_,M]=n.useState(!1),F=n.useRef(!1),L=n.useRef(0),[T,R]=n.useState(null),[,P]=n.useState(0),O=m(),I=O?.daemonId;n.useEffect(()=>{const e=()=>P(e=>e+1);return window.addEventListener(W,e),()=>window.removeEventListener(W,e)},[]),n.useEffect(()=>(L.current++,F.current=!1,M(!1),l(null),d(null),N(null),D(null),C(""),R(null),()=>{L.current++}),[e,t,I,r]);const q=e=>{const t=e instanceof Error?e.message:"operation_failed";C(a.errors[t]??a.errors.operation_failed)},$=async r=>{if(!O||F.current)return null;const n=L.current,o=()=>L.current===n&&m()?.daemonId===I;F.current=!0,M(!0),C("");try{const n=await b({...r,root:e,cwd:t},O);if(o()){"delete"===n.action&&D(n);try{await(async()=>{A(S),await Q.refresh()})()}catch{o()&&C(a.errors.refresh_failed)}}return{current:o()}}catch(s){return o()&&q(s),null}finally{L.current===n&&(F.current=!1,M(!1))}},B=(r,n)=>{I&&(U={target:r,cut:n,daemonId:I,root:e,cwd:t},window.dispatchEvent(new Event(W)),l(null),C(""))},J=t=>t.directory?t.path:v(t.path)??e,Y=Boolean(U&&U.daemonId===I),G=async e=>{const r=U;Y&&r&&await $({action:r.cut?"move":"copy",path:r.target.path,sourceRoot:r.root,sourceCwd:r.cwd,target:x(J(e),g(r.target.path)),autoRename:!r.cut&&f(J(e),t)===f(v(r.target.path)??r.root,r.cwd)})&&r.cut&&U===r&&(U=null,window.dispatchEvent(new Event(W)))},Z=(e,t,r)=>{F.current||l({...e,x:t,y:r})},ee=e=>{d(e),h(g(e.path)),l(null),C("")},te=r=>{if(!z||z.daemonId!==I||z.root!==e||z.cwd!==t||F.current)return!1;const n=f(z.target.path,t),a=f(r,t);return a!==n&&!a.startsWith(`${n}/`)&&f(v(z.target.path)??e,t)!==a};return{strings:a,menu:o,setMenu:l,rename:c,setRename:d,name:u,setName:h,deleting:w,setDeleting:N,error:E,setError:C,busy:_,undo:k,setUndo:D,canPaste:Y,copy:B,paste:G,key:(e,t)=>{if(e.target!==e.currentTarget)return!1;if((e.metaKey||e.ctrlKey)&&["c","x","v"].includes(e.key.toLowerCase()))return e.preventDefault(),"v"===e.key.toLowerCase()?G(t):B(t,"x"===e.key.toLowerCase()),!0;if("F2"===e.key)return e.preventDefault(),ee(t),!0;if("Delete"===e.key||e.metaKey&&"Backspace"===e.key)return e.preventDefault(),N(t),!0;if("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key){e.preventDefault();const r=e.currentTarget.getBoundingClientRect();return Z(t,r.left+20,r.top+24),!0}return!1},startRename:ee,commitRename:async()=>{if(!c)return;const t=u.trim();t&&!/[/\\\x00]/.test(t)&&"."!==t&&".."!==t?t!==g(c.path)?(await $({action:"move",path:c.path,target:x(v(c.path)??e,t)}))?.current&&d(null):d(null):q(new Error("invalid_operation"))},openMenu:Z,copyPath:async e=>{const r=L.current;try{await y(f(e.path,t))}catch(n){L.current===r&&q(n)}},deleteItem:async()=>{w&&(await $({action:"delete",path:w.path}))?.current&&N(null)},restore:async()=>{k&&(await $({action:"restore",path:k.path,recoveryId:k.recoveryId}))?.current&&D(null)},isCut:e=>Boolean(U?.cut&&U.daemonId===I&&U.target.path===e),dropTarget:T,dragStart:(r,n)=>{I&&!F.current?(z={target:n,cut:!0,daemonId:I,root:e,cwd:t},r.dataTransfer.setData(X,n.path),r.dataTransfer.effectAllowed="copyMove",l(null)):r.preventDefault()},dragEnd:()=>{z=null,R(null)},dragOver:(e,t)=>{e.dataTransfer.types.includes(X)&&te(t)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=e.altKey?"copy":"move",R(t))},dragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||R(null)},drop:(e,t)=>{e.preventDefault(),e.stopPropagation(),R(null),e.dataTransfer.types.includes(X)&&te(t)&&z&&$({action:e.altKey?"copy":"move",path:z.target.path,target:x(t,g(z.target.path))})}}}(S,a),Z=n.useRef(null),[ee,te]=h(Y,!0);!function(e,t,r,a,o){const s=n.useRef(o);s.current=o;const i=JSON.stringify(t.slice().sort());n.useEffect(()=>{if(e?.isConnected)return function(e,t,r,n){const a=e.makeId("directory-watch");let o,s=!1,i=!1,l=!1;const c=async()=>{if(l=!0,!i&&!s){i=!0;try{for(;l&&!s&&e.isConnected;)l=!1,await n().catch(()=>{})}finally{i=!1}}},d=async()=>{let n=2e3;if(e.supportsDirectoryWatch&&t.length<=256)try{(await e.request({action:"dirs.watch",id:a,paths:t,cwd:r},{timeoutMs:5e3})).unavailable.length||(n=3e4)}catch{}s||(c(),o=setTimeout(()=>{d()},n))},u=e.onMessage(e=>{"dirs.changed"===e.type&&e.watchId===a&&c()}),p=()=>{c()};window.addEventListener("focus",p);const h=()=>{s||(s=!0,o&&clearTimeout(o),u(),m(),window.removeEventListener("focus",p),e.supportsDirectoryWatch&&e.send({action:"dirs.watch",id:e.makeId("directory-unwatch"),paths:[]}))},m=e.onClose(h);return d(),h}(e,JSON.parse(i),r,()=>s.current())},[e,i,r,a])}(e,function(e,t,r,n){const a=[e],o=(e,t)=>{for(const s of t){const t=x(e,s.name);s.isDirectory&&r.has(t)&&(a.push(t),o(t,n[t]??[]))}};return o(e,t),a}(S,ee?o:[],Q.expanded,Q.children),a,Y,async()=>{await Promise.all([r?.(),Q.refresh()])});const[re,ne]=n.useState(!1),[ae,oe]=n.useState(S),[se,ie]=n.useState(F),[le,ce]=n.useState();n.useEffect(()=>{oe(S),ne(!1)},[S,Y]),n.useEffect(()=>ce(void 0),[S,o]),n.useEffect(()=>{ie(F)},[F]);const de=n.useRef(void 0);n.useEffect(()=>{if(!R||de.current===R||u)return;te(!0);const e=Array.from(Z.current?.querySelectorAll('[role="treeitem"]')??[]).find(e=>e.dataset.path===R.path);if(!e)return;ie(R.path);const t=requestAnimationFrame(()=>{e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest"}),de.current=R});return()=>cancelAnimationFrame(t)},[R,u,o,ee,te]);const ue=(e,t)=>{e.isDirectory?Q.expanded.has(t)?Q.collapse(t):Q.expand(t):(ie(t),B(t,a))},pe=e=>e?.focus(),he=q(o),me=(e,r,n)=>e.map((a,o)=>{const s=x(r,a.name),i=Q.expanded.has(s),l=a.isDirectory?i?C:N:function(e){return/\.(png|jpe?g|gif|webp|svg|ico)$/i.test(e)?T:/\.(tsx?|jsx?|json|css|html|py|rs|go|swift|ya?ml|sh)$/i.test(e)?L:_}(a.name);return t.jsxs("div",{role:"treeitem","aria-label":a.name,"aria-level":n+1,"aria-posinset":o+1,"aria-setsize":e.length,"aria-expanded":a.isDirectory?i:void 0,"aria-selected":se===s,"aria-busy":Q.loading.has(s)||void 0,"data-path":s,className:"explorer-tree-item",tabIndex:le===s||!le&&0===n&&0===o?0:-1,onFocus:e=>{e.target===e.currentTarget&&ce(s)},onKeyDown:e=>((e,t,r)=>{if(e.stopPropagation(),G.key(e,{path:r,directory:t.isDirectory}))return;if(e.target instanceof HTMLInputElement)return;const n=Array.from(Z.current?.querySelectorAll('[role="treeitem"]')??[]),a=n.indexOf(e.currentTarget);["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","Enter"," "].includes(e.key)&&e.preventDefault(),"ArrowUp"===e.key&&pe(n[Math.max(0,a-1)]),"ArrowDown"===e.key&&pe(n[Math.min(n.length-1,a+1)]),"Home"===e.key&&pe(n[0]),"End"===e.key&&pe(n.at(-1)),"ArrowRight"===e.key&&t.isDirectory&&(!Q.expanded.has(r)||Q.errors[r]?Q.expand(r):pe(e.currentTarget.querySelector('[role="treeitem"]'))),"ArrowLeft"===e.key&&(t.isDirectory&&Q.expanded.has(r)?Q.collapse(r):pe(e.currentTarget.parentElement?.closest('[role="treeitem"]'))),"Enter"!==e.key&&" "!==e.key||ue(t,r)})(e,a,s),children:[t.jsxs("div",{className:"explorer-tree-row",draggable:!G.busy&&G.rename?.path!==s,"data-cut":G.isCut(s)||void 0,"data-drop":G.dropTarget===s||void 0,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),pe(e.currentTarget.parentElement),G.openMenu({path:s,directory:a.isDirectory},e.clientX,e.clientY)},onDragStart:e=>G.dragStart(e,{path:s,directory:a.isDirectory}),onDragEnd:G.dragEnd,onDragOver:e=>a.isDirectory&&G.dragOver(e,s),onDragLeave:G.dragLeave,onDrop:e=>a.isDirectory&&G.drop(e,s),style:{paddingLeft:8+14*n},title:s,onClick:e=>{pe(e.currentTarget.parentElement),ue(a,s)},children:[t.jsx("span",{className:"explorer-chevron","aria-hidden":"true",children:a.isDirectory&&(Q.loading.has(s)?t.jsx(w,{className:"explorer-spinner"}):i?t.jsx(D,{}):t.jsx(E,{}))}),t.jsx(l,{className:a.isDirectory?"explorer-folder-icon":"explorer-file-icon","aria-hidden":"true"}),t.jsx("span",{className:"explorer-entry-name",children:G.rename?.path===s?t.jsx("input",{className:"explorer-rename","aria-label":G.strings.name,autoFocus:!0,value:G.name,disabled:G.busy,onFocus:e=>e.target.select(),onClick:e=>e.stopPropagation(),onChange:e=>G.setName(e.target.value),onKeyDown:e=>{e.stopPropagation(),e.nativeEvent.isComposing||229===e.keyCode||("Enter"===e.key&&(e.preventDefault(),G.commitRename()),"Escape"===e.key&&(e.preventDefault(),G.setRename(null)))}}):a.name})]}),a.isDirectory&&i&&t.jsxs("div",{role:"group",className:"explorer-tree-group",style:{"--tree-guide-left":14+14*n+"px"},children:[Q.children[s]?me(Q.children[s],s,n+1):null,Q.errors[s]&&t.jsx("button",{className:"explorer-retry",type:"button",onClick:()=>{Q.expand(s)},children:P.retry}),0===Q.children[s]?.length&&t.jsx("p",{className:"explorer-empty",style:{paddingLeft:36+14*n},children:P.noFilesInDirectory})]})]},s)});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"explorer-heading",children:[t.jsx("h2",{children:P.fileTree}),t.jsxs("div",{className:"explorer-actions",children:[t.jsx("button",{className:"icon-button",title:G.strings.editPath,"aria-label":G.strings.editPath,"aria-expanded":re,onClick:()=>{oe("."===S?a:S),ne(e=>!e)},type:"button",children:t.jsx(d,{"aria-hidden":"true"})}),t.jsx("button",{className:"icon-button",title:P.newFolder,"aria-label":P.newFolder,onClick:$,type:"button",children:t.jsx(M,{"aria-hidden":"true"})}),t.jsx("button",{className:"icon-button",title:P.refreshFiles,"aria-label":P.refreshFiles,disabled:u,onClick:()=>{A(S),Q.refresh()},type:"button",children:u?t.jsx(w,{className:"explorer-spinner","aria-hidden":"true"}):t.jsx(j,{"aria-hidden":"true"})}),t.jsx("button",{className:"icon-button",title:P.parentFolder,"aria-label":P.parentFolder,disabled:!v(S),onClick:()=>A(v(S)??S),type:"button",children:t.jsx(k,{"aria-hidden":"true"})})]})]}),t.jsxs("button",{type:"button",className:"explorer-root-path",onContextMenu:e=>{e.preventDefault(),G.openMenu({path:S,directory:!0},e.clientX,e.clientY)},onDragOver:e=>G.dragOver(e,S),onDragLeave:G.dragLeave,onDrop:e=>G.drop(e,S),"data-drop":G.dropTarget===S||void 0,title:"."===S?a:S,"aria-expanded":ee,onClick:()=>{te(e=>!e),ne(!1)},children:[ee?t.jsx(D,{"aria-hidden":"true"}):t.jsx(E,{"aria-hidden":"true"}),ee?t.jsx(C,{"aria-hidden":"true"}):t.jsx(N,{"aria-hidden":"true"}),t.jsx("span",{children:g("."===S?a:S)||S})]}),re&&t.jsx("form",{className:"explorer-path-form",onSubmit:e=>{e.preventDefault(),ae.trim()&&(A(ae.trim()),ne(!1))},children:t.jsx("input",{autoFocus:!0,"aria-label":P.path,value:ae,onChange:e=>oe(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||229===e.keyCode?"Enter"===e.key&&e.preventDefault():"Escape"===e.key&&ne(!1)}})}),l&&t.jsx("p",{className:"empty-copy",role:"alert",children:l}),u&&t.jsx("p",{className:"explorer-empty",role:"status",children:P.loadingFiles}),ee&&t.jsx("div",{ref:Z,role:"tree","aria-label":P.fileTree,className:"explorer-tree","aria-busy":u||G.busy,"data-drop":G.dropTarget===S||void 0,onContextMenu:e=>{e.preventDefault(),G.openMenu({path:S,directory:!0},e.clientX,e.clientY)},onDragOver:e=>G.dragOver(e,S),onDragLeave:G.dragLeave,onDrop:e=>G.drop(e,S),children:me(he,S,0)}),t.jsx(I,{ops:G,root:S,onOpen:()=>G.menu&&B(G.menu.path,a)}),ee&&c&&!u&&!l&&0===o.length&&t.jsx("p",{className:"explorer-empty",children:P.noFilesInDirectory})]})}function B({client:e,watch:r=!0,onRefreshDirectory:n,busy:a,onLoadChildren:o,cwd:s,directory:i,newDirName:l,remoteFile:c,t:d,onCreateDirectory:u,onListDirectory:m,onNewDirNameChange:y,onOpenRemoteFile:f}){const g=S(),x=p(),[v,b]=h(x?.scopeKey??"default",!1);return t.jsx(t.Fragment,{children:t.jsxs("section",{className:"control-section files-explorer",children:[t.jsx($,{client:r?e:null,onRefreshDirectory:n,cwd:s,revealRequest:g?.request,selectedPath:c?.path,onLoadChildren:o,onNewFolder:()=>b(e=>!e),entries:i.entries,error:i.error,loaded:i.loaded,loading:i.loading,path:i.path,t:d,onListDirectory:m,onOpenRemoteFile:f}),v&&t.jsxs("div",{className:"field-row file-tree-create",children:[t.jsx("input",{value:l,onChange:e=>y(e.target.value),placeholder:d.newFolder,"aria-label":d.newFolder,autoFocus:!0,onKeyDown:e=>{"Escape"===e.key&&(b(!1),y("")),"Enter"===e.key&&l.trim()&&!a&&u()}}),t.jsxs("button",{className:"icon-text-button",onClick:u,type:"button",disabled:a||!l.trim(),children:[t.jsx(N,{"aria-hidden":"true"}),d.create]})]})]})})}export{B as FilesControlPanel};
@@ -1 +0,0 @@
1
- import{j as e,r as s,u as n,f as i,t}from"./index-CX8KV6EH.js";import{S as l,d as a,X as d,C as o,K as c}from"./App-CLTYkSvy.js";function r({activeApproval:s,activeQuestion:n,busy:i,questionAnswers:t,t:r,onCancelQuestion:u,onQuestionChoice:p,onRespondApproval:h,onRespondQuestion:x}){const j=Boolean(s||n);return e.jsxs(e.Fragment,{children:[j?null:e.jsxs("section",{className:"control-section",children:[e.jsx("h2",{children:r.pendingActions}),e.jsx("p",{className:"empty-copy",children:r.noPendingActions})]}),s?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(l,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:r.approvalRequired}),e.jsx("p",{children:s.toolName})]})]}),e.jsx("p",{children:s.description}),"string"==typeof s.input?.command&&e.jsx("pre",{children:s.input.command}),e.jsxs("details",{className:"interaction-details",children:[e.jsx("summary",{children:r.interactionDetails}),e.jsx("pre",{children:a(s.input)})]},s.requestId),e.jsxs("div",{className:"attention-actions approval-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:()=>h(!1),disabled:i,children:[e.jsx(d,{"aria-hidden":"true"}),r.deny]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:()=>h(!0),disabled:i,children:[e.jsx(o,{"aria-hidden":"true"}),r.approve]})]})]}):null,n?e.jsxs("section",{className:"attention-panel",children:[e.jsxs("div",{className:"attention-head",children:[e.jsx(c,{"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("h2",{children:r.inputNeeded}),e.jsx("p",{children:r.notificationQuestionCount(n.questions.length)})]})]}),n.questions.map(s=>e.jsxs("div",{className:"question-block",children:[e.jsx("strong",{children:s.question}),e.jsx("div",{className:"choice-list",children:s.options.map(n=>{const i=(t[s.id]??[]).includes(n.label);return e.jsxs("button",{className:i?"selected":"","aria-pressed":i,onClick:()=>p(s.id,n.label,s.multiSelect),type:"button",children:[e.jsx("span",{children:n.label}),n.description?e.jsx("small",{children:n.description}):null]},n.label)})})]},s.id)),e.jsxs("div",{className:"attention-actions",children:[e.jsxs("button",{type:"button",className:"danger-button",onClick:u,disabled:i,children:[e.jsx(d,{"aria-hidden":"true"}),r.cancel]}),e.jsxs("button",{type:"button",className:"approve-button",onClick:x,disabled:i||n.questions.some(e=>!t[e.id]?.length),children:[e.jsx(o,{"aria-hidden":"true"}),r.submit]})]})]}):null]})}function u(l){const{activeApproval:a,activeQuestion:o,pendingCount:c,requestKey:u,sessions:p,t:h,errorText:x}=l,[j,b]=s.useState(null),[m,g]=s.useState(!1),v=m||c>0&&j!==u,N=()=>{b(u),g(!1)};s.useEffect(()=>{c>0&&g(!1);const e=()=>{b(null),g(0===c)};return window.addEventListener("vibelet.pending.open",e),()=>window.removeEventListener("vibelet.pending.open",e)},[c]);const y=n(N,void 0,v),q=s=>{const n=p.find(e=>e.sessionId===s);return e.jsxs("dl",{className:"global-pending-session-context",children:[e.jsxs("div",{children:[e.jsx("dt",{children:h.session}),e.jsx("dd",{className:"global-pending-session",children:n?t(n):s})]}),e.jsxs("div",{children:[e.jsx("dt",{children:h.workingDirectory}),e.jsx("dd",{className:"global-pending-directory",children:n?.cwd||h.unknown})]})]})};return v?i.createPortal(e.jsxs("div",{className:"global-pending-layer",children:[e.jsx("div",{className:"global-pending-backdrop","aria-hidden":"true",onClick:N}),e.jsxs("div",{className:"global-pending-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"global-pending-title",tabIndex:-1,ref:y,children:[e.jsxs("header",{className:"global-pending-header",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"global-pending-title",children:h.pendingActions}),e.jsx("p",{"aria-live":"polite",children:h.pendingActionCount(c)})]}),e.jsxs("div",{className:"global-pending-header-actions",children:[e.jsx("button",{className:"global-pending-clear",type:"button",disabled:0===c,onClick:l.onClearRequests,children:h.clearPendingRequests}),e.jsx("button",{className:"icon-button",type:"button","aria-label":h.close,title:h.close,onClick:N,children:e.jsx(d,{"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:"global-pending-content",children:[0===c&&e.jsx("p",{className:"empty-copy",children:h.noPendingActions}),a&&e.jsxs("section",{"data-pending-session":a.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(a.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("approval",a.sessionId,a.requestId),children:e.jsx(d,{"aria-hidden":"true"})})]}),e.jsx(r,{...l,activeQuestion:null})]}),o&&e.jsxs("section",{"data-pending-session":o.sessionId,children:[e.jsxs("div",{className:"global-pending-session-row",children:[q(o.sessionId),e.jsx("button",{type:"button","aria-label":h.dismissPendingRequest,title:h.dismissPendingRequest,onClick:()=>l.onDismissRequest("question",o.sessionId,o.requestId),children:e.jsx(d,{"aria-hidden":"true"})})]}),e.jsx(r,{...l,activeApproval:null})]}),x&&e.jsx("p",{role:"alert",className:"global-pending-error",children:x})]})]})]}),document.body):null}export{u as default};
@@ -1 +0,0 @@
1
- import{c as e,i as t,h as s,r as n,j as a,u as o,f as r}from"./index-CX8KV6EH.js";import{h as i,j as l,k as c,l as d,m as u,n as p,o as f,p as h,q as m,t as w,v as g,S as b,x as v,y as x,z as y,Z as j,A as S,D as k,X as C,E as D,H as M,J as N}from"./App-CLTYkSvy.js";import{F as E}from"./folder-plus-BVS_Q2fe.js";const A=e("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),F=e("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]),L=e("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),T="vibelet.web.recentCreations";function R(e){try{const s=JSON.parse(t().getItem(T)||"{}")[e];return Array.isArray(s)?s.filter(e=>"string"==typeof e.cwd&&["claude","codex"].includes(e.agent)&&Number.isFinite(e.createdAt)).slice(0,8):[]}catch{return[]}}const O="vibelet.web.initialMessageHistory";function I(){try{const e=JSON.parse(t().getItem(O)||"[]");return Array.isArray(e)?[...new Set(e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean))].slice(0,20):[]}catch{return[]}}const B="vibelet.web.newSessionCreateShortcut";function K({cwd:e,connected:t,load:s,t:o}){const[r,i]=n.useState();n.useEffect(()=>{if(!e||!t)return;let n=!1,a=!1;const o=()=>{a||"hidden"===document.visibilityState||(a=!0,s(e).then(t=>{n||i({cwd:e,data:t})}).catch(t=>{n||i({cwd:e,error:t instanceof Error?t.message:String(t)})}).finally(()=>{a=!1}))},r=window.setTimeout(o,250),l=window.setInterval(o,5e3);return window.addEventListener("focus",o),()=>{n=!0,window.clearTimeout(r),window.clearInterval(l),window.removeEventListener("focus",o)}},[e,t,s]);const l=t&&r?.cwd===e?r.data:void 0,c=l?.branches[e],d=l?.diffStats[e];return a.jsx("div",{className:"new-session-git",role:"status",title:r?.cwd===e?r.error:void 0,children:c||d?a.jsxs(a.Fragment,{children:[a.jsx(F,{size:14,"aria-hidden":"true"}),a.jsx("span",{className:"new-session-git-branch",title:c||"HEAD",children:c||"HEAD"}),a.jsxs("span",{className:"diff-add",children:["+",d?.additions??0]}),a.jsxs("span",{className:"diff-del",children:["−",d?.deletions??0]})]}):t&&e&&r?.cwd!==e?o.loading:" "})}function z({recent:e,chinese:t,onSelectRecent:s}){return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(l,{icon:c,label:t?"最近创建":"Recent creations",menuLabel:t?"最近创建":"Recent creations",align:"right",value:"",options:e.length?e.map((e,t)=>({value:String(t),label:e.cwd,description:"claude"===e.agent?"Claude":"Codex"})):[{value:"",label:t?"暂无创建记录":"No recent creations",disabled:!0}],onSelect:t=>{const n=e[Number(t)];n&&s(n)}})]})}function q({chinese:e,onSelectMessage:t}){const[s]=n.useState(I);return a.jsxs("div",{className:"new-session-history",children:[" ",a.jsx(l,{icon:L,label:e?"消息历史":"Message history",menuLabel:e?"消息历史":"Message history",align:"right",value:"",options:s.length?s.map((e,t)=>({value:String(t),label:e})):[{value:"",label:e?"暂无消息历史":"No message history",disabled:!0}],onSelect:e=>{const n=s[Number(e)];n&&t(n)}})]})}function J({controls:e,submit:t,draft:s,textareaRef:o,onOpen:r,onChange:i,onKeyDown:l,connected:c,chinese:h,files:m,t:w}){const g=n.useRef(null),b=n.useRef(null);return a.jsxs("div",{className:"new-session-message","aria-busy":m.uploadBusy,onDragOver:e=>{e.dataTransfer.types.includes("Files")&&e.preventDefault()},onDrop:e=>{e.dataTransfer.files.length&&(e.preventDefault(),c&&m.upload(e.dataTransfer.files))},children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-initial-message",children:h?"初始消息(可选)":"Initial message (optional)"}),a.jsx(q,{chinese:h,onSelectMessage:i})]}),a.jsxs("div",{className:"new-session-message-box",children:[a.jsx(d,{id:"new-session-initial-message",textareaRef:o??b,value:s,onValueChange:i,onKeyDown:l,rows:3,onPaste:e=>{c&&e.clipboardData.files.length&&m.upload(e.clipboardData.files)}}),a.jsx("input",{ref:g,type:"file",hidden:!0,multiple:!0,onChange:e=>{m.upload(e.currentTarget.files),e.currentTarget.value=""}}),a.jsx(u,{onOpen:r,attachments:m.attachments,uploadBusy:m.uploadBusy,onRemove:m.remove,t:w}),a.jsx(p,{leading:a.jsx(f,{label:w.uploadFiles,disabled:!c||m.uploadBusy,onClick:()=>g.current?.click()}),controls:e,submit:t})]}),m.uploadBusy&&a.jsx("small",{role:"status",children:w.uploading}),m.error&&a.jsx("p",{role:"alert",children:m.error})]})}function P(e){const{t}=e,n="desktop"===s().kind,o=m(t),r=w(t),i=g(e.models,t),c=i.find(t=>t.value===e.model)?.label??(e.model||t.defaultOption);return a.jsxs("div",{className:"new-session-options composer-control-strip "+(n?"new-session-desktop-options":""),children:[a.jsx("div",{className:"composer-permission "+("autoApprove"===e.approvalMode?"full-access":""),children:a.jsx(l,{icon:b,label:o.find(t=>t.value===e.approvalMode)?.label??t.approvalMode,menuLabel:t.approvalMode,value:e.approvalMode,onSelect:e.onApprovalModeChange,options:o,wide:!0,blendBackground:!0})}),n?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"composer-toolbar-spacer"}),a.jsx(v,{...e,modelLabel:c,modelOptions:i,effortLabel:r.find(t=>t.value===e.effort)?.label??t.effort,effortOptions:r})]}):a.jsxs(a.Fragment,{children:[a.jsx(l,{icon:x,label:c,menuLabel:t.model,value:e.model,onSelect:e.onModelChange,options:i}),a.jsx(l,{icon:j,label:e.fastMode?t.fast:t.normal,menuLabel:t.fastMode,value:e.fastMode?"on":"off",onSelect:t=>e.onFastModeChange("on"===t),selected:e.fastMode,options:[{value:"off",label:t.normal,description:t.standardExecution,icon:y},{value:"on",label:t.fast,description:t.preferFasterResponses,icon:j}]})]})]})}function H(e){const{t:l,device:d,onClose:u,onListDirectories:p}=e,f="New session"!==l.newSession,[m,w]=n.useState(e.cwd),[g,b]=n.useState(e.agent),[v,x]=n.useState(e.approvalMode),[y,j]=n.useState(e.model),[F,L]=n.useState(e.effort),[q,H]=n.useState(e.fastMode),[U,V]=n.useState(""),W=function(e,t){const[s,a]=n.useState([]),[o,r]=n.useState(!1),[i,l]=n.useState(""),c=n.useRef(new Set);return n.useEffect(()=>()=>{for(const e of c.current)e.abort();c.current.clear()},[]),{attachments:s,uploadBusy:o,error:i,upload:async s=>{if(!s?.length||!e)return;const n=new AbortController;c.current.add(n),r(!0),l("");try{for(const o of Array.from(s)){const s=await h(o,e.pairToken,n.signal,t);if(n.signal.aborted)return;a(e=>[...e,s])}}catch(o){n.signal.aborted||l(o instanceof Error?o.message:String(o))}finally{c.current.delete(n)&&r(c.current.size>0)}},remove:e=>a(t=>t.filter(t=>t.path!==e))}}(e.pairing,l),[$,G]=n.useState([]),Z=S(e.client,g,m.trim(),void 0,y,$,l),[Q,X]=n.useState("");n.useEffect(()=>{let t=!1;return G([]),X(""),e.onListModels(g).then(e=>{t||G(e)}).catch(()=>{t||X(f?"模型加载失败,请重新选择代理重试。":"Models unavailable. Select the agent again to retry.")}),()=>{t=!0}},[g,e.onListModels,f]);const[Y,_]=n.useState([]),[ee,te]=n.useState(-1),[se,ne]=n.useState(!1),[ae,oe]=n.useState(""),[re,ie]=n.useState(!1),[le,ce]=n.useState(!1),[de,ue]=n.useState(null),pe=n.useRef(null),fe=n.useRef(null),he=o(u,fe),[me]=n.useState(()=>R(d));n.useEffect(()=>{if(_([]),te(-1),oe(""),!se||!e.connected)return;let t=!1;const s=/^(?:[a-z]:[\\/]|\\\\)/i.test(m)?m.replaceAll("\\","/"):m,n=s.lastIndexOf("/"),a=n<0?".":s.slice(0,n+1)||"/",o=s.slice(n+1).toLowerCase(),r=window.setTimeout(()=>{ie(!0),p(a).then(e=>{t||_(e.filter(e=>e.isDirectory&&e.name.toLowerCase().startsWith(o)).map(e=>k(a,e.name)).slice(0,12))}).catch(e=>{t||oe(String(e instanceof Error?e.message:e))}).finally(()=>{t||ie(!1)})},180);return()=>{t=!0,window.clearTimeout(r),ie(!1)}},[m,se,e.connected,p]);const we=e=>{w(e+(e.endsWith("/")?"":"/")),pe.current?.focus()},ge=async()=>{if(de?.trim()&&!/[/\\]/.test(de)&&![".",".."].includes(de.trim())&&!le&&e.connected){ce(!0),oe("");try{const t=k(m,de.trim());await e.onCreateDirectory(t),w(t),ue(null),fe.current?.focus()}catch(t){oe(String(t))}finally{ce(!1)}}},be=()=>{m.trim()&&e.connected&&!le&&!W.uploadBusy&&(e.onCreate(m.trim(),g,{draft:U,approvalMode:v,model:y,effort:F,fastMode:q,attachments:W.attachments}),function(e){const s=e.trim();if(s)try{t().setItem(O,JSON.stringify([s,...I().filter(e=>e!==s)].slice(0,20)))}catch{}}(U),function(e,s){try{const n=JSON.parse(t().getItem(T)||"{}");n[e]=[s,...R(e).filter(e=>e.cwd!==s.cwd||e.agent!==s.agent)].slice(0,8),t().setItem(T,JSON.stringify(n))}catch{}}(d,{cwd:m.trim(),agent:g,createdAt:Date.now()}),u())},ve=function(e){const a="desktop"===s().kind,[o,r]=n.useState(()=>{try{const e=t().getItem(B);return"modEnter"===e||"shiftEnter"===e?e:"enter"}catch{return"enter"}});return{enabled:a,shortcut:o,update:e=>{r(e);try{t().setItem(B,e)}catch{}},onKeyDown:t=>{a&&!t.defaultPrevented&&"Enter"===t.key&&(t.nativeEvent.isComposing||229===t.keyCode?t.preventDefault():i(o,t)?(t.preventDefault(),t.repeat||e()):"INPUT"===t.currentTarget.tagName&&t.preventDefault())}}}(be);return r.createPortal(a.jsxs("div",{className:"new-session-layer",children:[a.jsx("div",{className:"new-session-backdrop",onClick:u}),a.jsxs("div",{className:"new-session-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",ref:he,tabIndex:-1,children:[a.jsxs("header",{children:[a.jsx("h2",{id:"new-session-title",children:l.newSession}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.close,title:l.close,onClick:u,children:a.jsx(C,{})})]}),a.jsxs("form",{onSubmit:e=>{e.preventDefault(),be()},children:[a.jsx("div",{className:"new-session-agents",children:["claude","codex"].map(e=>a.jsxs("button",{type:"button","aria-pressed":g===e,onClick:()=>{b(e),j("")},children:[a.jsx(A,{size:18}),"claude"===e?"Claude":"Codex"]},e))}),a.jsxs("div",{className:"new-session-path-field",onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||ne(!1)},children:[a.jsxs("div",{className:"new-session-field",children:[a.jsxs("div",{className:"new-session-field-heading",children:[a.jsx("label",{htmlFor:"new-session-cwd",children:l.workingDirectory}),a.jsx(z,{recent:me,chinese:f,onSelectRecent:e=>{w(e.cwd),b(e.agent),j("")}})]}),a.jsxs("div",{className:"new-session-path-row",children:[a.jsx("input",{id:"new-session-cwd",ref:pe,value:m,"aria-label":l.workingDirectory,role:"combobox","aria-autocomplete":"list",spellCheck:!1,"aria-expanded":se&&e.connected,"aria-controls":"new-session-paths","aria-activedescendant":ee>=0?`new-session-path-${ee}`:void 0,onFocus:()=>ne(!0),onChange:e=>w(e.target.value),onKeyDown:e=>{e.nativeEvent.isComposing||229===e.keyCode||(!Y.length||"ArrowDown"!==e.key&&"ArrowUp"!==e.key?("Enter"===e.key||"Tab"===e.key)&&ee>=0&&Y[ee]&&!e.metaKey&&!e.ctrlKey&&(e.preventDefault(),we(Y[ee])):(e.preventDefault(),te(t=>t<0?"ArrowDown"===e.key?0:Y.length-1:(t+("ArrowDown"===e.key?1:-1)+Y.length)%Y.length))),ve.onKeyDown(e)}}),a.jsx("button",{type:"button",className:"icon-button","aria-label":l.browseDirectories,title:l.browseDirectories,onMouseDown:e=>e.preventDefault(),onClick:()=>(we(m||e.cwd||"/"),void ne(!0)),children:a.jsx(c,{})})]})]}),se&&e.connected&&a.jsxs("div",{className:"new-session-paths",children:[a.jsx("div",{id:"new-session-paths",role:"listbox","aria-label":l.browseDirectories,children:Y.map((e,t)=>a.jsxs("button",{type:"button",id:`new-session-path-${t}`,role:"option","aria-selected":ee===t,onMouseDown:e=>e.preventDefault(),onClick:()=>we(e),title:e,children:[a.jsx(c,{size:14}),e]},e))}),a.jsxs("button",{type:"button",className:"new-session-folder-action",disabled:!m.trim()||le,onMouseDown:e=>e.preventDefault(),onClick:()=>{ne(!1),ue("")},children:[a.jsx(E,{size:14}),f?"新建文件夹":"New folder"]})]}),a.jsx("div",{className:"new-session-path-status",children:re||ae||Q?a.jsx("small",{role:ae||Q?"alert":"status",children:ae||Q||l.loadingDirectories}):a.jsx(K,{cwd:m.trim(),connected:e.connected,load:e.onLoadGitMetadata,t:l})}),null!==de&&a.jsxs("div",{className:"new-session-path-row new-session-folder-form",children:[a.jsx("input",{autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent.isComposing||ge()),"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),ue(null),pe.current?.focus())},"aria-label":f?"文件夹名称":"Folder name",value:de,onChange:e=>ue(e.target.value)}),a.jsx("button",{type:"button",disabled:le||!de.trim()||/[/\\]/.test(de),onClick:()=>{ge()},children:f?"创建文件夹":"Create folder"}),a.jsx("button",{type:"button",onClick:()=>ue(null),children:l.close})]})]}),a.jsx(J,{controls:a.jsx(P,{t:l,models:Z,approvalMode:v,onApprovalModeChange:x,model:y,onModelChange:j,effort:F,onEffortChange:L,fastMode:q,onFastModeChange:H}),submit:a.jsxs("div",{className:"submit-button-group",children:[" ",ve.enabled&&a.jsx(D,{shortcut:ve.shortcut,onChange:ve.update,action:"create",t:l}),a.jsx(M,{type:"submit","aria-label":l.newSession,title:l.newSession,disabled:!e.connected||!m.trim()||le||W.uploadBusy,children:a.jsx(N,{"aria-hidden":"true"})})]}),textareaRef:fe,onOpen:t=>e.onOpenRemoteFile(t,m),draft:U,onChange:V,onKeyDown:ve.onKeyDown,connected:e.connected,chinese:f,files:W,t:l}),!e.connected&&a.jsx("p",{role:"status",children:f?"请先连接设备,再创建会话。":"Connect a device before creating a session."}),a.jsxs("footer",{children:[a.jsx("p",{className:"new-session-create-hint",children:f?"创建后自动发送初始消息":"The initial message is sent after creation"}),"desktop"!==s().kind&&a.jsx("button",{type:"button",onClick:u,children:f?"取消":"Cancel"})]})]})]})]}),document.body)}export{H as default};
@@ -1 +0,0 @@
1
- import{G as n,H as t,I as r,J as c,K as e,L as a,M as u,N as i,O as o,P as y,Q as l,R as f,S as s,T as x,V as p}from"./mermaid.core-CTf8qcol.js";function h(n){return n.innerRadius}function v(n){return n.outerRadius}function d(n){return n.startAngle}function g(n){return n.endAngle}function m(n){return n&&n.padAngle}function T(n,t,r,c,e,a,u){var i=n-r,y=t-c,l=(u?a:-a)/o(i*i+y*y),f=l*y,s=-l*i,p=n+f,h=t+s,v=r+f,d=c+s,g=(p+v)/2,m=(h+d)/2,T=v-p,R=d-h,A=T*T+R*R,P=e-a,j=p*d-v*h,F=(R<0?-1:1)*o(x(0,P*P*A-j*j)),G=(j*R-T*F)/A,H=(-j*T-R*F)/A,I=(j*R+T*F)/A,J=(-j*T+R*F)/A,K=G-g,L=H-m,M=I-g,N=J-m;return K*K+L*L>M*M+N*N&&(G=I,H=J),{cx:G,cy:H,x01:-f,y01:-s,x11:G*(e/P-1),y11:H*(e/P-1)}}function R(){var x=h,R=v,A=e(0),P=null,j=d,F=g,G=m,H=null,I=n(J);function J(){var n,e,h=+x.apply(this,arguments),v=+R.apply(this,arguments),d=j.apply(this,arguments)-a,g=F.apply(this,arguments)-a,m=l(g-d),J=g>d;if(H||(H=n=I()),v<h&&(e=v,v=h,h=e),v>u)if(m>i-u)H.moveTo(v*r(d),v*c(d)),H.arc(0,0,v,d,g,!J),h>u&&(H.moveTo(h*r(g),h*c(g)),H.arc(0,0,h,g,d,J));else{var K,L,M=d,N=g,O=d,Q=g,S=m,V=m,b=G.apply(this,arguments)/2,k=b>u&&(P?+P.apply(this,arguments):o(h*h+v*v)),q=y(l(v-h)/2,+A.apply(this,arguments)),w=q,z=q;if(k>u){var B=s(k/h*c(b)),C=s(k/v*c(b));(S-=2*B)>u?(O+=B*=J?1:-1,Q-=B):(S=0,O=Q=(d+g)/2),(V-=2*C)>u?(M+=C*=J?1:-1,N-=C):(V=0,M=N=(d+g)/2)}var D=v*r(M),E=v*c(M),U=h*r(Q),W=h*c(Q);if(q>u){var X,Y=v*r(N),Z=v*c(N),$=h*r(O),_=h*c(O);if(m<t)if(X=function(n,t,r,c,e,a,i,o){var y=r-n,l=c-t,f=i-e,s=o-a,x=s*y-f*l;if(!(x*x<u))return[n+(x=(f*(t-a)-s*(n-e))/x)*y,t+x*l]}(D,E,$,_,Y,Z,U,W)){var nn=D-X[0],tn=E-X[1],rn=Y-X[0],cn=Z-X[1],en=1/c(p((nn*rn+tn*cn)/(o(nn*nn+tn*tn)*o(rn*rn+cn*cn)))/2),an=o(X[0]*X[0]+X[1]*X[1]);w=y(q,(h-an)/(en-1)),z=y(q,(v-an)/(en+1))}else w=z=0}V>u?z>u?(K=T($,_,D,E,v,z,J),L=T(Y,Z,U,W,v,z,J),H.moveTo(K.cx+K.x01,K.cy+K.y01),z<q?H.arc(K.cx,K.cy,z,f(K.y01,K.x01),f(L.y01,L.x01),!J):(H.arc(K.cx,K.cy,z,f(K.y01,K.x01),f(K.y11,K.x11),!J),H.arc(0,0,v,f(K.cy+K.y11,K.cx+K.x11),f(L.cy+L.y11,L.cx+L.x11),!J),H.arc(L.cx,L.cy,z,f(L.y11,L.x11),f(L.y01,L.x01),!J))):(H.moveTo(D,E),H.arc(0,0,v,M,N,!J)):H.moveTo(D,E),h>u&&S>u?w>u?(K=T(U,W,Y,Z,h,-w,J),L=T(D,E,$,_,h,-w,J),H.lineTo(K.cx+K.x01,K.cy+K.y01),w<q?H.arc(K.cx,K.cy,w,f(K.y01,K.x01),f(L.y01,L.x01),!J):(H.arc(K.cx,K.cy,w,f(K.y01,K.x01),f(K.y11,K.x11),!J),H.arc(0,0,h,f(K.cy+K.y11,K.cx+K.x11),f(L.cy+L.y11,L.cx+L.x11),J),H.arc(L.cx,L.cy,w,f(L.y11,L.x11),f(L.y01,L.x01),!J))):H.arc(0,0,h,Q,O,J):H.lineTo(U,W)}else H.moveTo(0,0);if(H.closePath(),n)return H=null,n+""||null}return J.centroid=function(){var n=(+x.apply(this,arguments)+ +R.apply(this,arguments))/2,e=(+j.apply(this,arguments)+ +F.apply(this,arguments))/2-t/2;return[r(e)*n,c(e)*n]},J.innerRadius=function(n){return arguments.length?(x="function"==typeof n?n:e(+n),J):x},J.outerRadius=function(n){return arguments.length?(R="function"==typeof n?n:e(+n),J):R},J.cornerRadius=function(n){return arguments.length?(A="function"==typeof n?n:e(+n),J):A},J.padRadius=function(n){return arguments.length?(P=null==n?null:"function"==typeof n?n:e(+n),J):P},J.startAngle=function(n){return arguments.length?(j="function"==typeof n?n:e(+n),J):j},J.endAngle=function(n){return arguments.length?(F="function"==typeof n?n:e(+n),J):F},J.padAngle=function(n){return arguments.length?(G="function"==typeof n?n:e(+n),J):G},J.context=function(n){return arguments.length?(H=n??null,J):H},J}export{R as d};
@@ -1 +0,0 @@
1
- import{U as r,C as a}from"./mermaid.core-CTf8qcol.js";const o=(o,s)=>r.lang.round(a.parse(o)[s]);export{o as c};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as e,C as i}from"./chunk-V7JOEXUC-CEP012wY.js";import{_ as o}from"./mermaid.core-CTf8qcol.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./chunk-5VM5RSS4-zU4WGQUt.js";import"./chunk-XXDRQBXY-BoXCe4yS.js";import"./chunk-VR4S4FIN-DcSau3fK.js";import"./chunk-32BRIVSS-DniTjuKD.js";import"./purify.es-BNLkGfTg.js";import"./index-CX8KV6EH.js";import"./marked.esm-BBjA1da9.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";var t={parser:e,get db(){return new i},renderer:s,styles:r,init:o(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{t as diagram};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as e,C as i}from"./chunk-V7JOEXUC-CEP012wY.js";import{_ as o}from"./mermaid.core-CTf8qcol.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./chunk-5VM5RSS4-zU4WGQUt.js";import"./chunk-XXDRQBXY-BoXCe4yS.js";import"./chunk-VR4S4FIN-DcSau3fK.js";import"./chunk-32BRIVSS-DniTjuKD.js";import"./purify.es-BNLkGfTg.js";import"./index-CX8KV6EH.js";import"./marked.esm-BBjA1da9.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";var t={parser:e,get db(){return new i},renderer:s,styles:r,init:o(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{t as diagram};
@@ -1 +0,0 @@
1
- import{s as r,b as e,a as s,S as t}from"./chunk-EX3LRPZG-B_EGZWf3.js";import{_ as i}from"./mermaid.core-CTf8qcol.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./chunk-XXDRQBXY-BoXCe4yS.js";import"./chunk-VR4S4FIN-DcSau3fK.js";import"./chunk-32BRIVSS-DniTjuKD.js";import"./purify.es-BNLkGfTg.js";import"./index-CX8KV6EH.js";import"./marked.esm-BBjA1da9.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";var o={parser:s,get db(){return new t(2)},renderer:e,styles:r,init:i(r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{o as diagram};
@@ -1 +0,0 @@
1
- import{c as r,s as t}from"./flowDiagram-23GEKE2U-BeHvede_.js";import{_ as e}from"./mermaid.core-CTf8qcol.js";import"./RemoteLifeOSBlock-C46RjZWn.js";import"./chunk-5VM5RSS4-zU4WGQUt.js";import"./chunk-XXDRQBXY-BoXCe4yS.js";import"./chunk-VR4S4FIN-DcSau3fK.js";import"./chunk-32BRIVSS-DniTjuKD.js";import"./purify.es-BNLkGfTg.js";import"./channel-CgLW9Jd5.js";import"./index-CX8KV6EH.js";import"./marked.esm-BBjA1da9.js";import"./App-CLTYkSvy.js";import"./index-CapF4a8Y.js";import"./file-editor-index-C6CU7Fik.js";var o=r({defaultLayout:"swimlane",styles:e(r=>`${t(r)}\n .swimlane.cluster rect {\n stroke: ${r.clusterBorder} !important;\n }\n [data-look="neo"].cluster rect {\n filter: none;\n }\n`,"getStyles")});export{o as diagram};