System.register(["./xterm-legacy-UzqSqzXt.js?v=1773287522785","./useSocket-legacy-D9BDJ2id.js?v=1773287522785","./xterm-addon-canvas-legacy-Tys2uZOF.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785"],(function(e,n){"use strict";var o,t,s,a,r,d,c,l,i,u,m,v,f,w,p,g,x;return{setters:[e=>{o=e.x,t=e.a,s=e.b,a=e.c},e=>{r=e.u},e=>{d=e.x},e=>{c=e.k,l=e.R,i=e.r,u=e.w,m=e.o,v=e.b,f=e.$,w=e.Z,p=e.n},e=>{g=e.b1,x=e.c}],execute:function(){var n=document.createElement("style");n.textContent="[data-v-bbac929c] .xterm{padding:12px!important}\n/*$vite$:1*/",document.head.appendChild(n),e("S",x(c({__name:"index",props:{data:{},url:{}},emits:["success"],setup(e,{expose:n,emit:c}){const{t:x}=l(),A=e,{data:b}=A,y=c,{ws:C,status:h,send:_,open:T,close:k}=r(A.url,{get verifyData(){return{...b}},onMessage:(e,n)=>{const o=n.data;if(o.indexOf("Authentication timeout.")>-1)O.value=!0;else if("\\r\\nlogout\\r\\n"==o||"logout\\r\\n"==o||"\r\nlogout\r\n"==o||"logout\r\n"==o||o.search(/logout[\r\n]+$/)>-1)return S.write("\r"+x("Component.Terminal.index_1")+"\r"),M(),void k()}});let S,j;const O=i(!1),z=i(null);let D=null;const E=()=>{const e=C.value;e&&(S.loadAddon(j),S.loadAddon(new d.CanvasAddon),S.loadAddon(new s.WebLinksAddon),D=new a.AttachAddon(e),S.loadAddon(D),setTimeout((()=>{j.fit()}),100))};u([C,h],(([e,n])=>{if("CLOSED"===n&&e)return S.write("\r\n"+x("Component.Terminal.index_2")+"\r\n"),void setTimeout((()=>{T()}),500);"OPEN"===n&&e&&(D&&D.dispose(),D=new a.AttachAddon(e),S.loadAddon(D),setTimeout((()=>{j.fit();const{cols:e,rows:n}=S;_({cols:e,rows:n,resize:1}),y("success")}),100))}),{immediate:!1});const $=()=>{z.value&&S.open(z.value)};let L=!1;const M=()=>{L=!1},R=()=>{S.focus(),S.onData((e=>{const n=C.value;"\r"===e&&O.value&&(O.value=!1,S.write("\r\n"),F()),void 0!==n||"\r"!==e||L||(L=!0,S.write("\r\n"+x("Component.Terminal.index_2")+"\r\n"),F())}))},F=()=>{T(),R();const e=C.value;e&&S.loadAddon(new a.AttachAddon(e))},N=()=>{p((()=>{if(j.fit(),"CLOSED"!==h.value){const{cols:e,rows:n}=S;_({cols:e,rows:n,resize:1})}}))};let Z=!0;const B=new ResizeObserver((()=>{g((()=>{Z?Z=!1:N()}),200)()}));return n({send:_}),m((async()=>{S=new o.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#333",foreground:"#ececec"}}),j=new t.FitAddon,E(),$(),R(),N(),(()=>{const e=z.value;e&&B.observe(e)})()})),v((()=>{B?.disconnect(),k(),S?.dispose()})),(e,n)=>(f(),w("div",{ref_key:"terminalRef",ref:z,class:"w-full h-full"},null,512))}}),[["__scopeId","data-v-bbac929c"]]))}}}));
