import{x as w,h as C}from"./index-BTglIPU2.js?v=1773287522785";import{T as v}from"./terminal-CFfBeKvv.js?v=1773287522785";import{k as x,R,i as T,r as s,al as k,w as M,$ as S,a8 as g,a9 as b,a0 as B,S as l,X as P,n as U}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./naive-ui--dJnpVcV.js?v=1773287522785";import"./xterm-dpUsuiNl.js?v=1773287522785";import"./useSocket-DTHwGZgK.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./xterm-addon-canvas-DELv9KNm.js?v=1773287522785";import"./useLoading-CZ2gSAW7.js?v=1773287522785";const A=x({__name:"Terminal",setup($,{expose:f}){const{t:a}=R(),c=T("fileStore"),{currentPath:m}=c,e=s(!1),u=s({id:"1",host:"127.0.0.1",port:22,ps:"",state:!0}),i=k("terminalRef"),n=s(!1);function p(){e.value=!0}function r(){return C({title:a("file.terminalModal.closeTitle"),content:a("file.terminalModal.closeMessage"),width:420,onConfirm(){e.value=!1,U(()=>n.value=!1)}}),!1}function d(o){o.indexOf("Welcome to")&&(n.value=!0)}return M(n,o=>{var t;o&&((t=i.value)==null||t.send("cd ".concat(m.value," \r\n")))}),f({open:p,close:r}),(o,t)=>{const _=w;return S(),g(_,{show:l(e),"onUpdate:show":t[0]||(t[0]=h=>P(e)?e.value=h:null),title:l(a)("file.terminalModal.title"),width:926,onPublicClose:r},{default:b(()=>[B(v,{ref_key:"terminalRef",ref:i,data:l(u),onConnectSuccess:d},null,8,["data"])]),_:1},8,["show","title"])}}});export{A as default};
