Promise.resolve({}),server_data_node:Ee(o)}),i={node:await J(),loader:J,universal:null,server:null,data:null};return ee({url:a,params:r,branch:[s,i],status:e,error:t,route:null})}catch(s){if(s instanceof ge)return Ge(new URL(s.location,location.href),{},0);throw s}}async function xt(e){const t=e.href;if($.has(t))return $.get(t);let a;try{const n=(async()=>{let r=await w.hooks.reroute({url:new URL(e),fetch:async(o,s)=>Je(o,s,e).promise})??e;if(typeof r=="string"){const o=new URL(e);w.hash?o.hash=r:o.pathname=r,r=o}return r})();$.set(t,n),a=await n}catch{$.delete(t);return}return a}async function ne(e,t){if(e&&!pe(e,L,w.hash)){const a=await xt(e);if(!a)return;const n=Pt(a);for(const r of ye){const o=r.exec(n);if(o)return{id:te(e),invalidating:t,route:r,params:ot(o),url:e}}}}function Pt(e){return ct(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function te(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function We({url:e,type:t,intent:a,delta:n,event:r}){let o=!1;const s=Re(m,a,e,t);n!==void 0&&(s.navigation.delta=n),r!==void 0&&(s.navigation.event=r);const i={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return V||He.forEach(c=>c(i)),o?null:s}async function D({type:e,url:t,popped:a,keepfocus:n,noscroll:r,replace_state:o,state:s={},redirect_count:i=0,nav_token:c={},accept:f=Ue,block:_=Ue,event:g}){const u=O;O=c;const l=await ne(t,!1),h=e==="enter"?Re(m,l,t,e):We({url:t,type:e,delta:a?.delta,intent:l,event:g});if(!h){_(),O===c&&(O=u);return}const v=y,p=S;f(),V=!0,Q&&h.navigation.type!=="enter"&&I.navigating.set(ie.current=h.navigation);let d=l&&await Xe(l);if(!d){if(pe(t,L,w.hash))return await M(t,o);d=await Qe(t,{id:null},await Y(new me(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o)}if(t=l?.url||t,O!==c)return h.reject(new Error("navigation aborted")),!1;if(d.type==="redirect"){if(i<20){await D({type:e,url:new URL(d.location,t),popped:a,keepfocus:n,noscroll:r,replace_state:o,state:s,redirect_count:i+1,nav_token:c}),h.fulfil(void 0);return}d=await Se({status:500,error:await Y(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else d.props.page.status>=400&&await I.updated.check()&&(await Fe(),await M(t,o));if(bt(),we(v),Ye(p),d.props.page.url.pathname!==t.pathname&&(t.pathname=d.props.page.url.pathname),s=a?a.state:s,!a){const b=o?0:1,N={[j]:y+=b,[H]:S+=b,[Ne]:s};(o?history.replaceState:history.pushState).call(history,N,"",t),o||wt(y,S)}const k=l&&x?.id===l.id?x.fork:null;x=null,d.props.page.state=s;let E;if(Q){const b=(await Promise.all(Array.from(yt,T=>T(h.navigation)))).filter(T=>typeof T=="function");if(b.length>0){let T=function(){b.forEach(re=>{F.delete(re)})};b.push(T),b.forEach(re=>{F.add(re)})}m=d.state,d.props.page&&(d.props.page.url=t);const N=k&&await k;N?E=N.commit():(Ve.$set(d.props),ut(d.props.page),E=at?.()),Me=!0}else await ze(d,fe,!1);const{activeElement:U}=document;await E,await G(),await G();let P=a?a.scroll:r?ae():null;if(Te){const b=t.hash&&document.getElementById(Ze(t));if(P)scrollTo(P.x,P.y);else if(b){b.scrollIntoView();const{top:N,left:T}=b.getBoundingClientRect();P={x:pageXOffset+T,y:pageYOffset+N}}else scrollTo(0,0)}const et=document.activeElement!==U&&document.activeElement!==document.body;!n&&!et&&Ct(t,P),Te=!0,d.props.page&&Object.assign(R,d.props.page),V=!1,e==="popstate"&&$e(S),h.fulfil(void 0),F.forEach(b=>b(h.navigation)),I.navigating.set(ie.current=null)}async function Qe(e,t,a,n,r){return e.origin===je&&e.pathname===location.pathname&&!Be?await Se({status:n,error:a,url:e,route:t}):await M(e,r)}function At(){let e,t={element:void 0,href:void 0},a;A.addEventListener("mousemove",i=>{const c=i.target;clearTimeout(e),e=setTimeout(()=>{o(c,q.hover)},20)});function n(i){i.defaultPrevented||o(i.composedPath()[0],q.tap)}A.addEventListener("mousedown",n),A.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(i=>{for(const c of i)c.isIntersecting&&(se(new URL(c.target.href)),r.unobserve(c.target))},{threshold:0});async function o(i,c){const f=Ce(i,A),_=f===t.element&&f?.href===t.href&&c>=a;if(!f||_)return;const{url:g,external:u,download:l}=ce(f,L,w.hash);if(u||l)return;const h=z(f),v=g&&te(m.url)===te(g);if(!(h.reload||v))if(c<=h.preload_data){t={element:f,href:f.href},a=q.tap;const p=await ne(g,!1);if(!p)return;kt(p)}else c<=h.preload_code&&(t={element:f,href:f.href},a=c,se(g))}function s(){r.disconnect();for(const i of A.querySelectorAll("a")){const{url:c,external:f,download:_}=ce(i,L,w.hash);if(f||_)continue;const g=z(i);g.reload||(g.preload_code===q.viewport&&r.observe(i),g.preload_code===q.eager&&se(c))}}F.add(s),s()}function Y(e,t){if(e instanceof _e)return e.body;const a=ve(e),n=gt(e);return w.hooks.handleError({error:e,event:t,status:a,message:n})??{message:n}}function Ft(e,t={}){return e=new URL(he(e)),e.origin!==je?Promise.reject(new Error("goto: invalid URL")):Ge(e,t,0)}function Ut(e){if(typeof e=="function")X.push(e);else{const{href:t}=new URL(e,location.href);X.push(a=>a.href===t)}}function Tt(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let a=!1;if(Oe(),!V){const n=Re(m,void 0,null,"leave"),r={...n.navigation,cancel:()=>{a=!0,n.reject(new Error("navigation cancelled"))}};He.forEach(o=>o(r))}a?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Oe()}),navigator.connection?.saveData||At(),A.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const a=Ce(t.composedPath()[0],A);if(!a)return;const{url:n,external:r,target:o,download:s}=ce(a,L,w.hash);if(!n)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=z(a);if(!(a instanceof SVGAElement)&&n.protocol!==location.protocol&&!(n.protocol==="https:"||n.protocol==="http:")||s)return;const[f,_]=(w.hash?n.hash.replace(/^#/,""):n.href).split("#"),g=f===oe(location);if(r||i.reload&&(!g||!_)){We({url:n,type:"link",event:t})?V=!0:t.preventDefault();return}if(_!==void 0&&g){const[,u]=m.url.href.split("#");if(u===_){if(t.preventDefault(),_===""||_==="top"&&a.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const l=a.ownerDocument.getElementById(decodeURIComponent(_));l&&(l.scrollIntoView(),l.focus())}return}if(K=!0,we(y),e(n),!i.replace_state)return;K=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await D({type:"link",url:n,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??n.href===location.href,event:t})}),A.addEventListener("submit",t=>{if(t.defaultPrevented)return;const a=HTMLFormElement.prototype.cloneNode.call(t.target),n=t.submitter;if((n?.formTarget||a.target)==="_blank"||(n?.formMethod||a.method)!=="get")return;const s=new URL(n?.hasAttribute("formaction")&&n?.formAction||a.action);if(pe(s,L,!1))return;const i=t.target,c=z(i);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(i,n);s.search=new URLSearchParams(f).toString(),D({type:"form",url:s,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!de){if(t.state?.[j]){const a=t.state[j];if(O={},a===y)return;const n=C[a],r=t.state[Ne]??{},o=new URL(t.state[rt]??location.href),s=t.state[H],i=m.url?oe(location)===oe(m.url):!1;if(s===S&&(Me||i)){r!==R.state&&(R.state=r),e(o),C[y]=ae(),n&&scrollTo(n.x,n.y),y=a;return}const f=a-y;await D({type:"popstate",url:o,popped:{state:r,scroll:n,delta:f},accept:()=>{y=a,S=s},block:()=>{history.go(-f)},nav_token:O,event:t})}else if(!K){const a=new URL(location.href);e(a),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{K&&(K=!1,history.replaceState({...history.state,[j]:++y,[H]:S},"",location.href))});for(const t of document.querySelectorAll("link"))vt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&I.navigating.set(ie.current=null)});function e(t){m.url=R.url=t,I.page.set(Le(R)),I.page.notify()}}async function It(e,{status:t=200,error:a,node_ids:n,params:r,route:o,server_route:s,data:i,form:c}){Be=!0;const f=new URL(location.href);let _;({params:r={},route:o={id:null}}=await ne(f,!1)||{}),_=ye.find(({id:l})=>l===o.id);let g,u=!0;try{const l=n.map(async(v,p)=>{const d=i[p];return d?.uses&&(d.uses=Ot(d.uses)),ke({loader:w.nodes[v],url:f,params:r,route:o,parent:async()=>{const k={};for(let E=0;E{const i=history.state;de=!0,location.replace(`#${n}`),w.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(o,s),de=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const o=[];for(let s=0;s{if(r.rangeCount===o.length){for(let s=0;s{r=c,o=f});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:a&&{params:t?.params??null,route:{id:t?.route?.id??null},url:a},willUnload:!t,type:n,complete:s},fulfil:r,reject:o}}function Le(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function Nt(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function Ze(e){let t;if(w.hash){const[,,a]=e.hash.split("#",3);t=a??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Kt as a,Ft as g,I as s};
diff --git a/webapp/assets/_app/immutable/chunks/Bi2FJHrT.js b/webapp/assets/_app/immutable/chunks/Bi2FJHrT.js
new file mode 100644
index 00000000..e4266d93
--- /dev/null
+++ b/webapp/assets/_app/immutable/chunks/Bi2FJHrT.js
@@ -0,0 +1 @@
+import{f as k,a as p,s as u}from"./o8CdT7B0.js";import{i as c}from"./ChJfoPF0.js";import{p as f,l as m,h as g,b as w,t as _,a as v,d as h,m as z,c as B,r as j,g as V}from"./DUMcBckj.js";import{s as q,k as A}from"./_9uqtkkk.js";import{p as a}from"./i7pKks78.js";var C=k(" ");function I(d,e){f(e,!1);const l=z();let t=a(e,"variant",8,"gray"),n=a(e,"size",8,"sm"),i=a(e,"text",8),s=a(e,"ring",8,!1);const o={success:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",error:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",warning:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",info:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",gray:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",blue:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",green:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",red:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",yellow:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",secondary:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",purple:"bg-purple-100 dark:bg-purple-900 text-purple-800 dark:text-purple-200"},b={success:"ring-green-600/20 dark:ring-green-400/30",error:"ring-red-600/20 dark:ring-red-400/30",warning:"ring-yellow-600/20 dark:ring-yellow-400/30",info:"ring-blue-600/20 dark:ring-blue-400/30",gray:"ring-gray-500/20 dark:ring-gray-400/30",blue:"ring-blue-600/20 dark:ring-blue-400/30",green:"ring-green-600/20 dark:ring-green-400/30",red:"ring-red-600/20 dark:ring-red-400/30",yellow:"ring-yellow-600/20 dark:ring-yellow-400/30",secondary:"ring-gray-500/20 dark:ring-gray-400/30",purple:"ring-purple-600/20 dark:ring-purple-400/30"},x={sm:"px-2 py-1 text-xs",md:"px-2.5 py-0.5 text-xs"};m(()=>(g(t()),g(n()),g(s())),()=>{h(l,["inline-flex items-center rounded-full font-semibold",o[t()],x[n()],s()?`ring-1 ring-inset ${b[t()]}`:""].filter(Boolean).join(" "))}),w(),c();var r=C(),y=B(r,!0);j(r),_(()=>{q(r,1,A(V(l))),u(y,i())}),p(d,r),v()}export{I as B};
diff --git a/webapp/assets/_app/immutable/chunks/Bje4SFZN.js b/webapp/assets/_app/immutable/chunks/Bje4SFZN.js
new file mode 100644
index 00000000..240dacba
--- /dev/null
+++ b/webapp/assets/_app/immutable/chunks/Bje4SFZN.js
@@ -0,0 +1,2 @@
+import{f as x,s as E,e as V,a as f,c as ae,t as Pr}from"./o8CdT7B0.js";import{i as ct}from"./ChJfoPF0.js";import{p as bt,v as vt,m as p,o as mt,d as s,q as yt,l as we,g as e,b as _t,f as W,c as d,r as o,s as n,t as _,k as tr,u as g,n as ar,h as j,a as xt,i as ht}from"./DUMcBckj.js";import{p as kt,i as v,s as wt,a as Et}from"./i7pKks78.js";import{e as Ir,i as Jr}from"./DC7Aeygn.js";import{r as T,s as ir,b as or,d as Nr,g as Ee,c as Cr}from"./_9uqtkkk.js";import{b as A,a as Br}from"./BtzOUN4g.js";import{p as Tt}from"./CdEA5IGF.js";import{M as $t}from"./CYPHW1bs.js";import{J as St,U as Rt,a as Mt,b as Ot}from"./D9ztHNzD.js";import{e as Lr}from"./BZiHL9L3.js";import{e as Ut}from"./zgwRPQVC.js";import{w as nr}from"./DTRhxHIE.js";var zt=x(''),jt=x(''),At=x(''),Pt=x(" "),It=x('
',1),Jt=x('
Create a template first or proceed without a template to use default behavior.
'),Nt=x(' '),Ct=x('
'),Bt=x(''),Lt=x(''),Dt=x(''),Gt=x(" ",1);function aa(Dr,dr){bt(dr,!1);const[Gr,qr]=wt(),c=()=>Et(Ut,"$eagerCache",Gr),M=p();let r=kt(dr,"pool",8);const Te=vt();let ie=p(!1),X=p(""),O=p(""),$=p([]),$e=p(!1),F=p(!1),H=null,oe=p(r().image||""),ne=p(r().flavor||""),P=p(r().max_runners),I=p(r().min_idle_runners),de=p(r().runner_bootstrap_timeout),se=p(r().priority),le=p(r().runner_prefix||""),S=p(r().os_type||"linux"),Y=p(r().os_arch||"amd64"),ue=p(r()["github-runner-group"]||""),pe=p(r().enabled),Z=p(r().enable_shell??!1),R=p((r().tags||[]).map(t=>t.name||"").filter(Boolean)),K=p(""),J=p("{}"),U=p(r().template_id);function Wr(t){if(t.repo_id){const a=c().repositories.find(l=>l.id===t.repo_id);return a?`${a.owner}/${a.name}`:"Unknown Entity"}if(t.org_id){const a=c().organizations.find(l=>l.id===t.org_id);return a&&a.name?a.name:"Unknown Entity"}if(t.enterprise_id){const a=c().enterprises.find(l=>l.id===t.enterprise_id);return a&&a.name?a.name:"Unknown Entity"}return"Unknown Entity"}function sr(t){return t.repo_id?"Repository":t.org_id?"Organization":t.enterprise_id?"Enterprise":"Unknown"}function Se(){if(r().endpoint?.endpoint_type)return r().endpoint.endpoint_type;if(r().repo_id){const t=c().repositories.find(a=>a.id===r().repo_id);if(t?.endpoint?.endpoint_type)return t.endpoint.endpoint_type}if(r().org_id){const t=c().organizations.find(a=>a.id===r().org_id);if(t?.endpoint?.endpoint_type)return t.endpoint.endpoint_type}if(r().enterprise_id){const t=c().enterprises.find(a=>a.id===r().enterprise_id);if(t?.endpoint?.endpoint_type)return t.endpoint.endpoint_type}return null}function Fr(){return r().repo_id?c().repositories.find(a=>a.id===r().repo_id)?.agent_mode??!1:r().org_id?c().organizations.find(a=>a.id===r().org_id)?.agent_mode??!1:r().enterprise_id?c().enterprises.find(a=>a.id===r().enterprise_id)?.agent_mode??!1:!1}function Re(t){if(t.operation!=="update")return;const a=t.payload;if(r().repo_id&&a.id===r().repo_id){const l=c().repositories.find(h=>h.id===r().repo_id);l&&(Object.assign(l,a),"agent_mode"in a&&s(M,a.agent_mode??!1))}else if(r().org_id&&a.id===r().org_id){const l=c().organizations.find(h=>h.id===r().org_id);l&&(Object.assign(l,a),"agent_mode"in a&&s(M,a.agent_mode??!1))}else if(r().enterprise_id&&a.id===r().enterprise_id){const l=c().enterprises.find(h=>h.id===r().enterprise_id);l&&(Object.assign(l,a),"agent_mode"in a&&s(M,a.agent_mode??!1))}}async function Me(t){try{if(r().repo_id){await Ee.updateRepository(r().repo_id,t);const a=c().repositories.find(l=>l.id===r().repo_id);a&&Object.assign(a,t)}else if(r().org_id){await Ee.updateOrganization(r().org_id,t);const a=c().organizations.find(l=>l.id===r().org_id);a&&Object.assign(a,t)}else if(r().enterprise_id){await Ee.updateEnterprise(r().enterprise_id,t);const a=c().enterprises.find(l=>l.id===r().enterprise_id);a&&Object.assign(a,t)}s(F,!1)}catch(a){throw a}}function Hr(){return r().repo_id?c().repositories.find(t=>t.id===r().repo_id)||null:r().org_id?c().organizations.find(t=>t.id===r().org_id)||null:r().enterprise_id&&c().enterprises.find(t=>t.id===r().enterprise_id)||null}async function lr(){try{s($e,!0);const t=Se();if(!t){s($,[]);return}if(s($,await Ee.listTemplates(e(S),void 0,t)),!e(U)||!e($).find(a=>a.id===e(U))){const a=e($).find(l=>l.owner_id==="system");a?s(U,a.id):e($).length>0&&s(U,e($)[0].id)}}catch(t){s(X,Lr(t))}finally{s($e,!1)}}mt(()=>{if(r().extra_specs)try{if(typeof r().extra_specs=="object")s(J,JSON.stringify(r().extra_specs,null,2));else{const t=JSON.parse(r().extra_specs);s(J,JSON.stringify(t,null,2))}}catch{s(J,r().extra_specs||"{}")}lr(),r().repo_id?H=nr.subscribeToEntity("repository",["update"],Re):r().org_id?H=nr.subscribeToEntity("organization",["update"],Re):r().enterprise_id&&(H=nr.subscribeToEntity("enterprise",["update"],Re))}),yt(()=>{H&&(H(),H=null)});function ur(){e(K).trim()&&!e(R).includes(e(K).trim())&&(s(R,[...e(R),e(K).trim()]),s(K,""))}function Kr(t){s(R,e(R).filter((a,l)=>l!==t))}function Qr(t){t.key==="Enter"&&(t.preventDefault(),ur())}async function Vr(){try{if(s(ie,!0),s(X,""),e(O))throw new Error(e(O));let t={};if(e(J).trim())try{t=JSON.parse(e(J))}catch{throw new Error("Invalid JSON in extra specs")}const a={image:e(oe)!==r().image?e(oe):void 0,flavor:e(ne)!==r().flavor?e(ne):void 0,max_runners:e(P)!==r().max_runners?e(P):void 0,min_idle_runners:e(I)!==r().min_idle_runners?e(I):void 0,runner_bootstrap_timeout:e(de)!==r().runner_bootstrap_timeout?e(de):void 0,priority:e(se)!==r().priority?e(se):void 0,runner_prefix:e(le)!==r().runner_prefix?e(le):void 0,os_type:e(S)!==r().os_type?e(S):void 0,os_arch:e(Y)!==r().os_arch?e(Y):void 0,"github-runner-group":e(ue)!==r()["github-runner-group"]&&e(ue)||void 0,enabled:e(pe)!==r().enabled?e(pe):void 0,enable_shell:e(Z)!==r().enable_shell?e(Z):void 0,tags:JSON.stringify(e(R))!==JSON.stringify((r().tags||[]).map(l=>l.name||"").filter(Boolean))?e(R):void 0,extra_specs:e(J).trim()!==JSON.stringify(r().extra_specs||{},null,2).trim()?t:void 0,template_id:e(U)!==r().template_id?e(U):void 0};Object.keys(a).forEach(l=>{a[l]===void 0&&delete a[l]}),Te("submit",a)}catch(t){s(X,Lr(t))}finally{s(ie,!1)}}we(()=>{},()=>{s(M,Fr())}),we(()=>e(M),()=>{e(M)||s(Z,!1)}),we(()=>e(S),()=>{e(S)&&lr()}),we(()=>(e(I),e(P)),()=>{e(I)!==null&&e(I)!==void 0&&e(P)!==null&&e(P)!==void 0&&e(I)>e(P)?s(O,"Min idle runners cannot be greater than max runners"):s(O,"")}),_t(),ct();var pr=Gt(),gr=W(pr);$t(gr,{$$events:{close:()=>Te("close")},children:(t,a)=>{var l=Dt(),h=d(l),ge=d(h),ee=d(ge);o(ge),o(h);var Q=n(h,2),fe=d(Q);{var Oe=i=>{var u=zt(),m=d(u),k=d(m,!0);o(m),o(u),_(()=>E(k,e(X))),f(i,u)};v(fe,i=>{e(X)&&i(Oe)})}var ce=n(fe,2);{var N=i=>{var u=jt(),m=d(u),k=d(m,!0);o(m),o(u),_(()=>E(k,e(O))),f(i,u)};v(ce,i=>{e(O)&&i(N)})}var C=n(ce,2),be=n(d(C),2),re=d(be),ve=n(d(re),2),B=d(ve,!0);o(ve),o(re);var L=n(re,2),me=n(d(L),2),Ue=d(me);o(me),o(L),o(be),o(C);var D=n(C,2),ye=n(d(D),2),ze=d(ye),fr=n(d(ze),2);T(fr),o(ze);var je=n(ze,2),cr=n(d(je),2);T(cr),o(je);var Ae=n(je,2),Pe=n(d(Ae),2);_(()=>{e(S),tr(()=>{})});var Ie=d(Pe);Ie.value=Ie.__value="linux";var br=n(Ie);br.value=br.__value="windows",o(Pe),o(Ae);var Je=n(Ae,2),Ne=n(d(Je),2);_(()=>{e(Y),tr(()=>{})});var Ce=d(Ne);Ce.value=Ce.__value="amd64";var vr=n(Ce);vr.value=vr.__value="arm64",o(Ne),o(Je);var mr=n(Je,2),Zr=n(d(mr),2);{var et=i=>{var u=At();f(i,u)},rt=i=>{var u=ae(),m=W(u);{var k=y=>{var z=It(),w=W(z);_(()=>{e(U),tr(()=>{e($)})}),Ir(w,5,()=>e($),Jr,(G,b)=>{var q=Pt(),zr=d(q),gt=n(zr);{var ft=rr=>{var Ar=Pr();_(()=>E(Ar,`- ${e(b),g(()=>e(b).description)??""}`)),f(rr,Ar)};v(gt,rr=>{e(b),g(()=>e(b).description)&&rr(ft)})}o(q);var jr={};_(()=>{E(zr,`${e(b),g(()=>e(b).name)??""} ${e(b),g(()=>e(b).owner_id==="system"?"(System)":"")??""} `),jr!==(jr=(e(b),g(()=>e(b).id)))&&(q.value=(q.__value=(e(b),g(()=>e(b).id)))??"")}),f(G,q)}),o(w);var he=n(w,2),ke=d(he);o(he),_(G=>E(ke,`Templates define how the runner software is installed and configured.
+ Showing templates for ${G??""} ${e(S)??""}.`),[()=>g(Se)]),or(w,()=>e(U),G=>s(U,G)),f(y,z)},te=y=>{var z=Jt(),w=d(z),he=d(w);o(w);var ke=n(w,2),G=d(ke);ar(),o(ke),o(z),_((b,q)=>{E(he,`No templates found for ${b??""} ${e(S)??""}.`),Nr(G,"href",q)},[()=>g(Se),()=>(j(Cr),g(()=>Cr("/templates")))]),f(y,z)};v(m,y=>{e($),g(()=>e($).length>0)?y(k):y(te,!1)},!0)}f(i,u)};v(Zr,i=>{e($e)?i(et):i(rt,!1)})}o(mr),o(ye),o(D);var Be=n(D,2),yr=n(d(Be),2),Le=d(yr),De=n(d(Le),2);T(De),o(Le);var Ge=n(Le,2),qe=n(d(Ge),2);T(qe),o(Ge);var _r=n(Ge,2),xr=n(d(_r),2);T(xr),o(_r),o(yr),o(Be);var We=n(Be,2),Fe=n(d(We),2),He=d(Fe),hr=n(d(He),2);T(hr),o(He);var Ke=n(He,2),kr=n(d(Ke),2);T(kr),o(Ke);var wr=n(Ke,2),Er=n(d(wr),2);T(Er),o(wr),o(Fe);var Qe=n(Fe,2),Tr=d(Qe),$r=n(d(Tr),2),Ve=d($r),_e=d(Ve);T(_e);var tt=n(_e,2);o(Ve);var at=n(Ve,2);{var it=i=>{var u=Ct();Ir(u,5,()=>e(R),Jr,(m,k,te)=>{var y=Nt(),z=d(y),w=n(z);o(y),_(()=>{E(z,`${e(k)??""} `),Nr(w,"aria-label",`Remove tag ${e(k)??""}`)}),V("click",w,()=>Kr(te)),f(m,y)}),o(u),f(i,u)};v(at,i=>{e(R),g(()=>e(R).length>0)&&i(it)})}o($r),o(Tr),o(Qe);var Xe=n(Qe,2),Sr=d(Xe),ot=n(d(Sr),2);St(ot,{rows:4,placeholder:"{}",get value(){return e(J)},set value(i){s(J,i)},$$legacy:!0}),o(Sr),o(Xe);var Ye=n(Xe,2),Rr=d(Ye);T(Rr),ar(2),o(Ye);var Mr=n(Ye,2),Ze=d(Mr),xe=d(Ze);T(xe);var nt=n(xe,2);ar(2),o(Ze);var dt=n(Ze,2);{var st=i=>{var u=Bt(),m=n(d(u),2),k=d(m),te=n(k);o(m),o(u),_(y=>E(k,`Shell access requires agent mode to be enabled on the ${y??""}. `),[()=>(j(r()),g(()=>sr(r()).toLowerCase()))]),V("click",te,()=>s(F,!0)),f(i,u)};v(dt,i=>{e(M)||i(st)})}o(Mr),o(We);var Or=n(We,2),Ur=d(Or),er=n(Ur,2),lt=d(er);{var ut=i=>{var u=Lt();f(i,u)},pt=i=>{var u=Pr("Update Pool");f(i,u)};v(lt,i=>{e(ie)?i(ut):i(pt,!1)})}o(er),o(Or),o(Q),o(l),_((i,u)=>{E(ee,`Update Pool ${j(r()),g(()=>r().id)??""}`),E(B,(j(r()),g(()=>r().provider_name))),E(Ue,`${i??""}: ${u??""}`),ir(De,1,`w-full px-3 py-2 border ${e(O)?"border-red-300 dark:border-red-500":"border-gray-300 dark:border-gray-600"} rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white`),ir(qe,1,`w-full px-3 py-2 border ${e(O)?"border-red-300 dark:border-red-500":"border-gray-300 dark:border-gray-600"} rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white`),xe.disabled=!e(M),ir(nt,1,`ml-2 block text-sm font-medium text-gray-700 dark:text-gray-300 ${e(M)?"":"opacity-50"}`),er.disabled=e(ie)||e(O)!==""},[()=>(j(r()),g(()=>sr(r()))),()=>(j(r()),g(()=>Wr(r())))]),A(fr,()=>e(oe),i=>s(oe,i)),A(cr,()=>e(ne),i=>s(ne,i)),or(Pe,()=>e(S),i=>s(S,i)),or(Ne,()=>e(Y),i=>s(Y,i)),A(De,()=>e(I),i=>s(I,i)),A(qe,()=>e(P),i=>s(P,i)),A(xr,()=>e(de),i=>s(de,i)),A(hr,()=>e(le),i=>s(le,i)),A(kr,()=>e(se),i=>s(se,i)),A(Er,()=>e(ue),i=>s(ue,i)),A(_e,()=>e(K),i=>s(K,i)),V("keydown",_e,Qr),V("click",tt,ur),Br(Rr,()=>e(pe),i=>s(pe,i)),Br(xe,()=>e(Z),i=>s(Z,i)),V("click",Ur,()=>Te("close")),V("submit",Q,Tt(Vr)),f(t,l)},$$slots:{default:!0}});var Xr=n(gr,2);{var Yr=t=>{const a=ht(()=>g(Hr));var l=ae(),h=W(l);{var ge=ee=>{var Q=ae(),fe=W(Q);{var Oe=N=>{Rt(N,{get repository(){return e(a)},$$events:{close:()=>s(F,!1),submit:C=>Me(C.detail)}})},ce=N=>{var C=ae(),be=W(C);{var re=B=>{Mt(B,{get organization(){return e(a)},$$events:{close:()=>s(F,!1),submit:L=>Me(L.detail)}})},ve=B=>{var L=ae(),me=W(L);{var Ue=D=>{Ot(D,{get enterprise(){return e(a)},$$events:{close:()=>s(F,!1),submit:ye=>Me(ye.detail)}})};v(me,D=>{j(r()),g(()=>r().enterprise_id)&&D(Ue)},!0)}f(B,L)};v(be,B=>{j(r()),g(()=>r().org_id)?B(re):B(ve,!1)},!0)}f(N,C)};v(fe,N=>{j(r()),g(()=>r().repo_id)?N(Oe):N(ce,!1)})}f(ee,Q)};v(h,ee=>{e(a)&&ee(ge)})}f(t,l)};v(Xr,t=>{e(F)&&t(Yr)})}f(Dr,pr),xt(),qr()}export{aa as U};
diff --git a/webapp/assets/_app/immutable/chunks/BqCROW90.js b/webapp/assets/_app/immutable/chunks/BqCROW90.js
new file mode 100644
index 00000000..e8106b92
--- /dev/null
+++ b/webapp/assets/_app/immutable/chunks/BqCROW90.js
@@ -0,0 +1 @@
+import{f as _,a as h,s as x}from"./o8CdT7B0.js";import{i as u}from"./ChJfoPF0.js";import{p as g,t as k,a as w,s as y,c as o,u as m,h as e,r}from"./DUMcBckj.js";import{h as z}from"./_9uqtkkk.js";import{p as d}from"./i7pKks78.js";import{g as l}from"./DQsxKNC2.js";var E=_('');function j(v,i){g(i,!1);let t=d(i,"item",8),s=d(i,"iconSize",8,"w-5 h-5");u();var a=E(),n=o(a),f=o(n);z(f,()=>(e(l),e(t()),e(s()),m(()=>l(t()?.endpoint?.endpoint_type||t()?.endpoint_type||"unknown",s())))),r(n);var p=y(n,2),c=o(p,!0);r(p),r(a),k(()=>x(c,(e(t()),m(()=>t()?.endpoint?.name||t()?.endpoint_name||t()?.endpoint_type||"Unknown")))),h(v,a),w()}export{j as E};
diff --git a/webapp/assets/_app/immutable/chunks/BtzOUN4g.js b/webapp/assets/_app/immutable/chunks/BtzOUN4g.js
new file mode 100644
index 00000000..66efa16b
--- /dev/null
+++ b/webapp/assets/_app/immutable/chunks/BtzOUN4g.js
@@ -0,0 +1 @@
+import{aa as k,u as o,a8 as h,y as t,D as f,ab as m}from"./DUMcBckj.js";import{l as _}from"./o8CdT7B0.js";function E(e,a,c=a){var v=k(),d=new WeakSet;_(e,"input",r=>{var l=r?e.defaultValue:e.value;if(l=n(e)?s(l):l,c(l),f!==null&&d.add(f),v&&l!==(l=a())){var b=e.selectionStart,u=e.selectionEnd;e.value=l??"",u!==null&&(e.selectionStart=b,e.selectionEnd=Math.min(u,e.value.length))}}),(t&&e.defaultValue!==e.value||o(a)==null&&e.value)&&(c(n(e)?s(e.value):e.value),f!==null&&d.add(f)),h(()=>{var r=a();if(e===document.activeElement){var l=m??f;if(d.has(l))return}n(e)&&r===s(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function S(e,a,c=a){_(e,"change",v=>{var d=v?e.defaultChecked:e.checked;c(d)}),(t&&e.defaultChecked!==e.checked||o(a)==null)&&c(e.checked),h(()=>{var v=a();e.checked=!!v})}function n(e){var a=e.type;return a==="number"||a==="range"}function s(e){return e===""?null:+e}export{S as a,E as b};
diff --git a/webapp/assets/_app/immutable/chunks/B7m7LjX-.js b/webapp/assets/_app/immutable/chunks/ByzrGryl.js
similarity index 88%
rename from webapp/assets/_app/immutable/chunks/B7m7LjX-.js
rename to webapp/assets/_app/immutable/chunks/ByzrGryl.js
index 1c5bf5ae..d2f200a6 100644
--- a/webapp/assets/_app/immutable/chunks/B7m7LjX-.js
+++ b/webapp/assets/_app/immutable/chunks/ByzrGryl.js
@@ -1 +1 @@
-import{z as l}from"./DzFKsO_V.js";function c(){const{subscribe:a,set:s,update:r}=l(!1);return{subscribe:a,init:()=>{const t=localStorage.getItem("theme");let e=!1;t==="dark"?e=!0:t==="light"?e=!1:e=window.matchMedia("(prefers-color-scheme: dark)").matches,s(e),o(e)},toggle:()=>r(t=>{const e=!t;return localStorage.setItem("theme",e?"dark":"light"),o(e),e}),set:t=>{localStorage.setItem("theme",t?"dark":"light"),o(t),s(t)}}}function o(a){a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const d=c();export{d as t};
+import{w as l}from"./DUMcBckj.js";function c(){const{subscribe:a,set:s,update:r}=l(!1);return{subscribe:a,init:()=>{const t=localStorage.getItem("theme");let e=!1;t==="dark"?e=!0:t==="light"?e=!1:e=window.matchMedia("(prefers-color-scheme: dark)").matches,s(e),o(e)},toggle:()=>r(t=>{const e=!t;return localStorage.setItem("theme",e?"dark":"light"),o(e),e}),set:t=>{localStorage.setItem("theme",t?"dark":"light"),o(t),s(t)}}}function o(a){a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}const d=c();export{d as t};
diff --git a/webapp/assets/_app/immutable/chunks/BzzAh3Be.js b/webapp/assets/_app/immutable/chunks/BzzAh3Be.js
deleted file mode 100644
index 326b5213..00000000
--- a/webapp/assets/_app/immutable/chunks/BzzAh3Be.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import{z as Se,o as De,y as L,aV as U,g as $,j as T,aW as ee,bt as vt}from"./DzFKsO_V.js";import{p as yt,e as bt,b as x}from"./C14okzlM.js";class Ee{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Re{constructor(t,n){this.status=t,this.location=n}}class te extends Error{constructor(t,n,a){super(a),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ge({href:e}){return e.split("#")[0]}function Rt(e,t,n,a=!1){const r=new URL(e);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(s,i){if(i==="get"||i==="getAll"||i==="has")return(c,...p)=>(n(c),s[i](c,...p));t();const l=Reflect.get(s,i);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const o=["href","pathname","search","toString","toJSON"];a&&o.push("hash");for(const s of o)Object.defineProperty(r,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a||xt(r),r}function xt(e){Object.defineProperty(e,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `page.url.hash` inside a component instead")}})}function Pt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let a=n.length;for(;a;)t=t*33^n.charCodeAt(--a)}else if(ArrayBuffer.isView(n)){const a=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let r=a.length;for(;r;)t=t*33^a[--r]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function At(e){const t=atob(e),n=new Uint8Array(t.length);for(let a=0;a{e=new Error().stack.includes("check_stack_trace")})(),window.fetch=(n,a)=>{const r=n instanceof Request?n.url:n.toString(),o=new Error().stack.split(`
-`),s=o.findIndex(h=>h.includes("load@")||h.includes("at load")),i=o.slice(0,s+2).join(`
-`),l=e?i.includes("src/runtime/client/client.js"):xe,c=a?.__sveltekit_fetch__;return l&&!c&&console.warn(`Loading ${r} using \`window.fetch\`. For best results, use the \`fetch\` that is passed to your \`load\` function: https://svelte.dev/docs/kit/load#making-fetch-requests`),(n instanceof Request?n.method:a?.method||"GET")!=="GET"&&M.delete(Pe(n)),Lt(n,a)}}const M=new Map;function Tt(e,t){const n=Pe(e,t),a=document.querySelector(n);if(a?.textContent){a.remove();let{body:r,...o}=JSON.parse(a.textContent);const s=a.getAttribute("data-ttl");return s&&M.set(n,{body:r,init:o,ttl:1e3*Number(s)}),a.getAttribute("data-b64")!==null&&(r=At(r)),Promise.resolve(new Response(r,o))}return ze(e,t)}function Ot(e,t,n){if(M.size>0){const a=Pe(e,n),r=M.get(a);if(r){if(performance.now(){const{pattern:h,params:f}=yt(i),u={id:i,exec:g=>{const w=h.exec(g);if(w)return bt(w,f,a)},errors:[1,...p||[]].map(g=>e[g]),layouts:[0,...c||[]].map(s),leaf:o(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function o(i){const l=i<0;return l&&(i=~i),[l,e[i]]}function s(i){return i===void 0?i:[r.has(i),e[i]]}}function Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Ve(e,t,n=JSON.stringify){const a=n(t);try{sessionStorage[e]=a}catch{}}const Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",jt="sveltekit:pageurl",K="sveltekit:history",W="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},ue=location.origin;function Ae(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function fe(){return{x:pageXOffset,y:pageYOffset}}const He=new WeakSet,Ke={"preload-code":["","off","false","tap","hover","viewport","eager"],"preload-data":["","off","false","tap","hover"],keepfocus:["","true","off","false"],noscroll:["","true","off","false"],reload:["","true","off","false"],replacestate:["","true","off","false"]};function H(e,t){const n=e.getAttribute(`data-sveltekit-${t}`);return Ct(e,t,n),n}function Ct(e,t,n){n!==null&&!He.has(e)&&!Ke[t].includes(n)&&(console.error(`Unexpected value for ${t} — should be one of ${Ke[t].map(a=>JSON.stringify(a)).join(", ")}`,e),He.add(e))}const Be={...N,"":N.hover};function tt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function nt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=tt(e)}}function me(e,t,n){let a;try{if(a=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&a.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";a.hash=`#${i}${a.hash}`}}catch{}const r=e instanceof SVGAElement?e.target.baseVal:e.target,o=!a||!!r||de(a,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=a?.origin===ue&&e.hasAttribute("download");return{url:a,external:o,target:r,download:s}}function ne(e){let t=null,n=null,a=null,r=null,o=null,s=null,i=e;for(;i&&i!==document.documentElement;)a===null&&(a=H(i,"preload-code")),r===null&&(r=H(i,"preload-data")),t===null&&(t=H(i,"keepfocus")),n===null&&(n=H(i,"noscroll")),o===null&&(o=H(i,"reload")),s===null&&(s=H(i,"replacestate")),i=tt(i);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[a??"off"],preload_data:Be[r??"off"],keepfocus:l(t),noscroll:l(n),reload:l(o),replace_state:l(s)}}function Fe(e){const t=Se(e);let n=!0;function a(){n=!0,t.update(s=>s)}function r(s){n=!1,t.set(s)}function o(s){let i;return t.subscribe(l=>{(i===void 0||n&&l!==i)&&s(i=l)})}return{notify:a,set:r,subscribe:o}}function Nt(){const{set:e,subscribe:t}=Se(!1);return{subscribe:t,check:async()=>!1}}function de(e,t,n){return e.origin!==ue||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function mn(e){}function qt(e){function t(n,a){if(n)for(const r in n){if(r[0]==="_"||e.has(r))continue;const o=[...e.values()],s=Dt(r,a?.slice(a.lastIndexOf(".")))??`valid exports are ${o.join(", ")}, or anything with a '_' prefix`;throw new Error(`Invalid export '${r}'${a?` in ${a}`:""} (${s})`)}}return t}function Dt(e,t=".js"){const n=[];if(Le.has(e)&&n.push(`+layout${t}`),at.has(e)&&n.push(`+page${t}`),rt.has(e)&&n.push(`+layout.server${t}`),Vt.has(e)&&n.push(`+page.server${t}`),Ht.has(e)&&n.push(`+server${t}`),n.length>0)return`'${e}' is a valid export in ${n.slice(0,-1).join(", ")}${n.length>1?" or ":""}${n.at(-1)}`}const Le=new Set(["load","prerender","csr","ssr","trailingSlash","config"]),at=new Set([...Le,"entries"]),rt=new Set([...Le]),Vt=new Set([...rt,"actions","entries"]),Ht=new Set(["GET","POST","PATCH","PUT","DELETE","OPTIONS","HEAD","fallback","prerender","trailingSlash","config","entries"]),Kt=qt(at);function Bt(e){return e.filter(t=>t!=null)}function Ft(e,t){const n=/^(moz-icon|view-source|jar):/.exec(t);n&&console.warn(`${e}: Calling \`depends('${t}')\` will throw an error in Firefox because \`${n[1]}\` is a special URI scheme`)}function Gt(e,t){if(e!=null&&Object.getPrototypeOf(e)!==Object.prototype)throw new Error(`a load function ${t} returned ${typeof e!="object"?`a ${typeof e}`:e instanceof Response?"a Response object":Array.isArray(e)?"an array":"a non-plain object"}, but must return a plain object at the top level (i.e. \`return {...}\`)`)}function Ue(e){return e instanceof Ee||e instanceof te?e.status:500}function Mt(e){return e instanceof te?e.text:"Internal Error"}let k,Y;const Jt=De.toString().includes("$$")||/function \w+\(\) \{\}/.test(De.toString());Jt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},Y={current:null}):(k=new class{#e=L(U({}),"Page.data");get data(){return $(this.#e)}set data(t){T(this.#e,t)}#t=L(U(null),"Page.form");get form(){return $(this.#t)}set form(t){T(this.#t,t)}#n=L(U(null),"Page.error");get error(){return $(this.#n)}set error(t){T(this.#n,t)}#a=L(U({}),"Page.params");get params(){return $(this.#a)}set params(t){T(this.#a,t)}#r=L(U({id:null}),"Page.route");get route(){return $(this.#r)}set route(t){T(this.#r,t)}#o=L(U({}),"Page.state");get state(){return $(this.#o)}set state(t){T(this.#o,t)}#s=L(U(-1),"Page.status");get status(){return $(this.#s)}set status(t){T(this.#s,t)}#i=L(U(new URL("https://example.com")),"Page.url");get url(){return $(this.#i)}set url(t){T(this.#i,t)}},Y=new class{#e=L(U(null),"Navigating.current");get current(){return $(this.#e)}set current(t){T(this.#e,t)}});function Wt(e){Object.assign(k,e)}const Ge={spanContext(){return Yt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Yt={traceId:"",spanId:"",traceFlags:0},zt=new Set(["icon","shortcut icon","apple-touch-icon"]),D=Xe(Ze)??{},z=Xe(Qe)??{};{let e=!1;const t=import.meta.url.split("?")[0],n=()=>{if(e)return;let o=new Error().stack?.split(`
-`);o&&(!o[0].includes("https:")&&!o[0].includes("http:")&&(o=o.slice(1)),o=o.slice(2),!o[0]?.includes(t)&&(e=!0,console.warn("Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead.")))},a=history.pushState;history.pushState=(...o)=>(n(),a.apply(history,o));const r=history.replaceState;history.replaceState=(...o)=>(n(),r.apply(history,o))}const C={url:Fe({}),page:Fe({}),navigating:Se(null),updated:Nt()};function $e(e){D[e]=fe()}function Xt(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function X(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function ot(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Me(){}let Te,we,ae,O,ve,v;const re=[],oe=[];let P=null;function ye(){P?.fork?.then(e=>e?.discard()),P=null}const Z=new Map,st=new Set,Qt=new Set,J=new Set;let m={branch:[],error:null,url:null},it=!1,se=!1,Je=!0,Q=!1,G=!1,lt=!1,Oe=!1,ct,y,R,q;const ie=new Set,We=new Map;async function yn(e,t,n){t===document.body&&console.warn(`Placing %sveltekit.body% directly inside is not recommended, as your app may break for users who have certain browser extensions installed.
-
-Consider wrapping it in an element:
-
-
- %sveltekit.body%
-
`),globalThis.__sveltekit_1ey6u51?.data&&globalThis.__sveltekit_1ey6u51.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Te=It(e),O=document.documentElement,ve=t,we=e.nodes[0],ae=e.nodes[1],we(),ae(),y=history.state?.[K],R=history.state?.[W],y||(y=R=Date.now(),history.replaceState({...history.state,[K]:y,[W]:R},""));const a=D[y];function r(){a&&(history.scrollRestoration="manual",scrollTo(a.x,a.y))}n?(r(),await fn(ve,n)):(await B({type:"enter",url:Ae(v.hash?pn(new URL(location.href)):location.href),replace_state:!0}),r()),un()}function Zt(){re.length=0,Oe=!1}function ut(e){oe.some(t=>t?.snapshot)&&(z[e]=oe.map(t=>t?.snapshot?.capture()))}function ft(e){z[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function Ye(){$e(y),Ve(Ze,D),ut(R),Ve(Qe,z)}async function dt(e,t,n,a){let r;t.invalidateAll&&ye(),await B({type:"goto",url:Ae(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:a,accept:()=>{t.invalidateAll&&(Oe=!0,r=[...We.keys()]),t.invalidate&&t.invalidate.forEach(cn)}}),t.invalidateAll&&ee().then(ee).then(()=>{We.forEach(({resource:o},s)=>{r?.includes(s)&&o.refresh?.()})})}async function en(e){if(e.id!==P?.id){ye();const t={};ie.add(t),P={id:e.id,token:t,promise:gt({...e,preload:t}).then(n=>(ie.delete(t),n.type==="loaded"&&n.state.error&&ye(),n)),fork:null}}return P.promise}async function _e(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function ht(e,t,n){if(e.state.error&&document.querySelector("vite-error-overlay"))return;m=e.state;const a=document.querySelector("style[data-sveltekit]");if(a&&a.remove(),Object.assign(k,e.props.page),ct=new v.root({target:t,props:{...e.props,stores:C,components:oe},hydrate:n,sync:!1}),await Promise.resolve(),ft(R),n){const r={from:null,to:{params:m.params,route:{id:m.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};J.forEach(o=>o(r))}se=!0}function le({url:e,params:t,branch:n,status:a,error:r,route:o,form:s}){let i="never";if(x&&(e.pathname===x||e.pathname===x+"/"))i="always";else for(const u of n)u?.slash!==void 0&&(i=u.slash);e.pathname=kt(e.pathname,i),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:r,route:o},props:{constructors:Bt(n).map(u=>u.node.component),page:qe(k)}};s!==void 0&&(l.props.form=s);let c={},p=!k,h=0;for(let u=0;uh!=="load");if(p.length>0)throw new Error(`Page options are ignored when \`router.type === 'hash'\` (${r.id} has ${p.filter(h=>h!=="load").map(h=>`'${h}'`).join(", ")})`)}if(c.universal?.load){let p=function(...f){for(const u of f){Ft(r.id,u);const{href:g}=new URL(u,n);l.dependencies.add(g)}};const h={tracing:{enabled:!1,root:Ge,current:Ge},route:new Proxy(r,{get:(f,u)=>(i&&(l.route=!0),f[u])}),params:new Proxy(a,{get:(f,u)=>(i&&l.params.add(u),f[u])}),data:o?.data??null,url:Rt(n,()=>{i&&(l.url=!0)},f=>{i&&l.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:g,promise:w}=pt(f,u,n);return i&&p(g.href),w},setHeaders:()=>{},depends:p,parent(){return i&&(l.parent=!0),t()},untrack(f){i=!1;try{return f()}finally{i=!0}}};try{Ut(),s=await c.universal.load.call(null,h)??null,Gt(s,`related to route '${r.id}'`)}finally{$t()}}return{node:c,loader:e,server:o,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??o?.data??null,slash:c.universal?.trailingSlash??o?.slash}}function pt(e,t,n){let a=e instanceof Request?e.url:e;const r=new URL(a,n);r.origin===n.origin&&(a=r.href.slice(n.origin.length));const o=se?Ot(a,r.href,t):Tt(a,t);return{resolved:r,promise:o}}function tn(e,t,n,a,r,o){if(Oe)return!0;if(!r)return!1;if(r.parent&&e||r.route&&t||r.url&&n)return!0;for(const s of r.search_params)if(a.has(s))return!0;for(const s of r.params)if(o[s]!==m.params[s])return!0;for(const s of r.dependencies)if(re.some(i=>i(new URL(s))))return!0;return!1}function je(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function nn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const a of n){const r=e.searchParams.getAll(a),o=t.searchParams.getAll(a);r.every(s=>o.includes(s))&&o.every(s=>r.includes(s))&&n.delete(a)}return n}function an({error:e,url:t,route:n,params:a}){return{type:"loaded",state:{error:e,url:t,route:n,params:a,branch:[]},props:{page:qe(k),constructors:[]}}}async function gt({id:e,invalidating:t,url:n,params:a,route:r,preload:o}){if(P?.id===e)return ie.delete(P.token),P.promise;const{errors:s,layouts:i,leaf:l}=r,c=[...i,l];s.forEach(_=>_?.().catch(()=>{})),c.forEach(_=>_?.[1]().catch(()=>{}));const p=m.url?e!==ce(m.url):!1,h=m.route?r.id!==m.route.id:!1,f=nn(m.url,n);let u=!1;const g=c.map(async(_,d)=>{if(!_)return;const S=m.branch[d];return _[1]===S?.loader&&!tn(u,h,p,f,S.universal?.uses,a)?S:(u=!0,Ie({loader:_[1],url:n,params:a,route:r,parent:async()=>{const I={};for(let A=0;A{});const w=[];for(let _=0;_Promise.resolve({}),server_data_node:je(o)}),i={node:await ae(),loader:ae,universal:null,server:null,data:null};return le({url:n,params:r,branch:[s,i],status:e,error:t,route:null})}catch(s){if(s instanceof Re)return dt(new URL(s.location,location.href),{},0);throw s}}async function on(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const a=(async()=>{let r=await v.hooks.reroute({url:new URL(e),fetch:async(o,s)=>pt(o,s,e).promise})??e;if(typeof r=="string"){const o=new URL(e);v.hash?o.hash=r:o.pathname=r,r=o}return r})();Z.set(t,a),n=await a}catch(a){Z.delete(t);{console.error(a);debugger}return}return n}async function he(e,t){if(e&&!de(e,x,v.hash)){const n=await on(e);if(!n)return;const a=sn(n);for(const r of Te){const o=r.exec(a);if(o)return{id:ce(e),invalidating:t,route:r,params:Et(o),url:e}}}}function sn(e){return St(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:a,event:r}){let o=!1;const s=Ne(m,n,e,t);a!==void 0&&(s.navigation.delta=a),r!==void 0&&(s.navigation.event=r);const i={...s.navigation,cancel:()=>{o=!0,s.reject(new Error("navigation cancelled"))}};return Q||st.forEach(l=>l(i)),o?null:s}async function B({type:e,url:t,popped:n,keepfocus:a,noscroll:r,replace_state:o,state:s={},redirect_count:i=0,nav_token:l={},accept:c=Me,block:p=Me,event:h}){const f=q;q=l;const u=await he(t,!1),g=e==="enter"?Ne(m,u,t,e):_t({url:t,type:e,delta:n?.delta,intent:u,event:h});if(!g){p(),q===l&&(q=f);return}const w=y,_=R;c(),Q=!0,se&&g.navigation.type!=="enter"&&C.navigating.set(Y.current=g.navigation);let d=u&&await gt(u);if(!d)if(de(t,x,v.hash))if(v.hash)d=await be(t,{id:null},await F(new te(404,"Not Found",`Not found: ${t.pathname} (did you forget the hash?)`),{url:t,params:{},route:{id:null}}),404,o);else return await X(t,o);else d=await be(t,{id:null},await F(new te(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,o);if(t=u?.url||t,q!==l)return g.reject(new Error("navigation aborted")),!1;if(d.type==="redirect"){if(i<20){await B({type:e,url:new URL(d.location,t),popped:n,keepfocus:a,noscroll:r,replace_state:o,state:s,redirect_count:i+1,nav_token:l}),g.fulfil(void 0);return}d=await Ce({status:500,error:await F(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else d.props.page.status>=400&&await C.updated.check()&&(await ot(),await X(t,o));if(Zt(),$e(w),ut(_),d.props.page.url.pathname!==t.pathname&&(t.pathname=d.props.page.url.pathname),s=n?n.state:s,!n){const b=o?0:1,V={[K]:y+=b,[W]:R+=b,[et]:s};(o?history.replaceState:history.pushState).call(history,V,"",t),o||Xt(y,R)}const S=u&&P?.id===u.id?P.fork:null;P=null,d.props.page.state=s;let E;if(se){const b=(await Promise.all(Array.from(Qt,j=>j(g.navigation)))).filter(j=>typeof j=="function");if(b.length>0){let j=function(){b.forEach(pe=>{J.delete(pe)})};b.push(j),b.forEach(pe=>{J.add(pe)})}m=d.state,d.props.page&&(d.props.page.url=t);const V=S&&await S;V?E=V.commit():(ct.$set(d.props),Wt(d.props.page),E=vt?.()),lt=!0}else await ht(d,ve,!1);const{activeElement:I}=document;await E,await ee(),await ee();let A=n?n.scroll:r?fe():null;if(Je){const b=t.hash&&document.getElementById(mt(t));if(A)scrollTo(A.x,A.y);else if(b){b.scrollIntoView();const{top:V,left:j}=b.getBoundingClientRect();A={x:pageXOffset+j,y:pageYOffset+V}}else scrollTo(0,0)}const wt=document.activeElement!==I&&document.activeElement!==document.body;!a&&!wt&&hn(t,A),Je=!0,d.props.page&&Object.assign(k,d.props.page),Q=!1,e==="popstate"&&ft(R),g.fulfil(void 0),J.forEach(b=>b(g.navigation)),C.navigating.set(Y.current=null)}async function be(e,t,n,a,r){if(e.origin===ue&&e.pathname===location.pathname&&!it)return await Ce({status:a,error:n,url:e,route:t});if(a!==404){console.error("An error occurred while loading the page. This will cause a full page reload. (This message will only appear during development.)");debugger}return await X(e,r)}function ln(){let e,t={element:void 0,href:void 0},n;O.addEventListener("mousemove",i=>{const l=i.target;clearTimeout(e),e=setTimeout(()=>{o(l,N.hover)},20)});function a(i){i.defaultPrevented||o(i.composedPath()[0],N.tap)}O.addEventListener("mousedown",a),O.addEventListener("touchstart",a,{passive:!0});const r=new IntersectionObserver(i=>{for(const l of i)l.isIntersecting&&(_e(new URL(l.target.href)),r.unobserve(l.target))},{threshold:0});async function o(i,l){const c=nt(i,O),p=c===t.element&&c?.href===t.href&&l>=n;if(!c||p)return;const{url:h,external:f,download:u}=me(c,x,v.hash);if(f||u)return;const g=ne(c),w=h&&ce(m.url)===ce(h);if(!(g.reload||w))if(l<=g.preload_data){t={element:c,href:c.href},n=N.tap;const _=await he(h,!1);if(!_)return;en(_).then(d=>{d.type==="loaded"&&d.state.error&&console.warn(`Preloading data for ${_.url.pathname} failed with the following error: ${d.state.error.message}
-If this error is transient, you can ignore it. Otherwise, consider disabling preloading for this route. This route was preloaded due to a data-sveltekit-preload-data attribute. See https://svelte.dev/docs/kit/link-options for more info`)})}else l<=g.preload_code&&(t={element:c,href:c.href},n=l,_e(h))}function s(){r.disconnect();for(const i of O.querySelectorAll("a")){const{url:l,external:c,download:p}=me(i,x,v.hash);if(c||p)continue;const h=ne(i);h.reload||(h.preload_code===N.viewport&&r.observe(i),h.preload_code===N.eager&&_e(l))}}J.add(s),s()}function F(e,t){if(e instanceof Ee)return e.body;console.warn("The next HMR update will cause the page to reload");const n=Ue(e),a=Mt(e);return v.hooks.handleError({error:e,event:t,status:n,message:a})??{message:a}}function bn(e,t={}){return e=new URL(Ae(e)),e.origin!==ue?Promise.reject(new Error(`Cannot use \`goto\` with an external URL. Use \`window.location = "${e}"\` instead`)):dt(e,t,0)}function cn(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function un(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ye(),!Q){const a=Ne(m,void 0,null,"leave"),r={...a.navigation,cancel:()=>{n=!0,a.reject(new Error("navigation cancelled"))}};st.forEach(o=>o(r))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ye()}),navigator.connection?.saveData||ln(),O.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=nt(t.composedPath()[0],O);if(!n)return;const{url:a,external:r,target:o,download:s}=me(n,x,v.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const i=ne(n);if(!(n instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;const[c,p]=(v.hash?a.hash.replace(/^#/,""):a.href).split("#"),h=c===ge(location);if(r||i.reload&&(!h||!p)){_t({url:a,type:"link",event:t})?Q=!0:t.preventDefault();return}if(p!==void 0&&h){const[,f]=m.url.href.split("#");if(f===p){if(t.preventDefault(),p===""||p==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(p));u&&(u.scrollIntoView(),u.focus())}return}if(G=!0,$e(y),e(a),!i.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:a,keepfocus:i.keepfocus,noscroll:i.noscroll,replace_state:i.replace_state??a.href===location.href,event:t})}),O.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),a=t.submitter;if((a?.formTarget||n.target)==="_blank"||(a?.formMethod||n.method)!=="get")return;const s=new URL(a?.hasAttribute("formaction")&&a?.formAction||n.action);if(de(s,x,!1))return;const i=t.target,l=ne(i);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(i,a);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ke){if(t.state?.[K]){const n=t.state[K];if(q={},n===y)return;const a=D[n],r=t.state[et]??{},o=new URL(t.state[jt]??location.href),s=t.state[W],i=m.url?ge(location)===ge(m.url):!1;if(s===R&&(lt||i)){r!==k.state&&(k.state=r),e(o),D[y]=fe(),a&&scrollTo(a.x,a.y),y=n;return}const c=n-y;await B({type:"popstate",url:o,popped:{state:r,scroll:a,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:q,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[K]:++y,[W]:R},"",location.href))});for(const t of document.querySelectorAll("link"))zt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(Y.current=null)});function e(t){m.url=k.url=t,C.page.set(qe(k)),C.page.notify()}}async function fn(e,{status:t=200,error:n,node_ids:a,params:r,route:o,server_route:s,data:i,form:l}){it=!0;const c=new URL(location.href);let p;({params:r={},route:o={id:null}}=await he(c,!1)||{}),p=Te.find(({id:u})=>u===o.id);let h,f=!0;try{const u=a.map(async(w,_)=>{const d=i[_];return d?.uses&&(d.uses=dn(d.uses)),Ie({loader:v.nodes[w],url:c,params:r,route:o,parent:async()=>{const S={};for(let E=0;E<_;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:je(d)})}),g=await Promise.all(u);if(p){const w=p.layouts;for(let _=0;_{const i=history.state;ke=!0,location.replace(`#${a}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(o,s),ke=!1})}else{const o=document.body,s=o.getAttribute("tabindex");o.tabIndex=-1,o.focus({preventScroll:!0,focusVisible:!1}),s!==null?o.setAttribute("tabindex",s):o.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const o=[];for(let s=0;s{if(r.rangeCount===o.length){for(let s=0;s{r=l,o=c});return s.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:a,complete:s},fulfil:r,reject:o}}function qe(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function pn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}{const e=console.warn;console.warn=function(...n){n.length===1&&/<(Layout|Page|Error)(_[\w$]+)?> was created (with unknown|without expected) prop '(data|form)'/.test(n[0])||e(...n)}}export{yn as a,bn as g,mn as l,k as p,C as s};
diff --git a/webapp/assets/_app/immutable/chunks/C0gwpZbz.js b/webapp/assets/_app/immutable/chunks/C0gwpZbz.js
new file mode 100644
index 00000000..e893a341
--- /dev/null
+++ b/webapp/assets/_app/immutable/chunks/C0gwpZbz.js
@@ -0,0 +1 @@
+import{c as S,a as C}from"./o8CdT7B0.js";import{i as L}from"./ChJfoPF0.js";import{p as B,l as w,h as n,g as t,m as y,b as V,f as A,a as E,d as _,u as f}from"./DUMcBckj.js";import{k as F}from"./DG4LDt2Z.js";import{p as m}from"./i7pKks78.js";import{B as G}from"./Bi2FJHrT.js";import{k as x}from"./DQsxKNC2.js";import{f as D}from"./ow_oMtSd.js";function J(v,u){B(u,!1);const s=y(),c=y();let e=m(u,"item",8),g=m(u,"statusType",8,"entity"),r=m(u,"statusField",8,"status");w(()=>(n(e()),n(r())),()=>{_(s,e()?.[r()]||"unknown")}),w(()=>(n(e()),n(g()),t(s),n(r())),()=>{_(c,(()=>{if(!e())return{variant:"error",text:"Unknown"};switch(g()){case"entity":return x(e());case"instance":let a="secondary";switch(t(s).toLowerCase()){case"running":a="success";break;case"stopped":a="info";break;case"creating":case"pending_create":a="warning";break;case"deleting":case"pending_delete":case"pending_force_delete":a="warning";break;case"error":case"deleted":a="error";break;case"active":case"online":a="success";break;case"idle":a="info";break;case"pending":case"installing":a="warning";break;case"failed":case"terminated":case"offline":a="error";break;case"unknown":default:a="secondary";break}return{variant:a,text:D(t(s))};case"enabled":return{variant:e().enabled?"success":"error",text:e().enabled?"Enabled":"Disabled"};case"os_type":const T=(t(s)||"").toLowerCase();let i="secondary",o=t(s)||"Unknown";switch(T){case"linux":i="success",o="Linux";break;case"windows":i="blue",o="Windows";break;case"macos":case"darwin":i="purple",o="macOS";break;default:i="gray",o=t(s)||"Unknown";break}return{variant:i,text:o};case"forge_type":const U=(t(s)||"").toLowerCase();let d="secondary",l=t(s)||"Unknown";switch(U){case"github":d="gray",l="GitHub";break;case"gitea":d="green",l="Gitea";break;default:d="secondary",l=t(s)||"Unknown";break}return{variant:d,text:l};case"custom":const p=e()[r()]||"Unknown";if(r()==="auth-type"){const b=p==="pat"||!p?"pat":"app";return{variant:b==="pat"?"success":"info",text:b==="pat"?"PAT":"App"}}return{variant:"info",text:p};default:return x(e())}})())}),V(),L();var k=S(),h=A(k);F(h,()=>(n(e()),n(r()),f(()=>`${e()?.name||"item"}-${e()?.[r()]||"status"}-${e()?.updated_at||"time"}`)),a=>{G(a,{get variant(){return t(c),f(()=>t(c).variant)},get text(){return t(c),f(()=>t(c).text)}})}),C(v,k),E()}export{J as S};
diff --git a/webapp/assets/_app/immutable/chunks/C2FKJqnN.js b/webapp/assets/_app/immutable/chunks/C2FKJqnN.js
deleted file mode 100644
index 1cc88e2d..00000000
--- a/webapp/assets/_app/immutable/chunks/C2FKJqnN.js
+++ /dev/null
@@ -1 +0,0 @@
-import{c as ie,a as T,b as i,l as le,g as Je,s as G,f as S,t as tt,i as _t,d as te,e as Ke}from"./CxOx-TIJ.js";import{i as ye}from"./3NxSoY2_.js";import{ag as sa,bh as ia,aY as la,I as da,H as ca,O as va,K as ua,J as fa,aA as ga,P as It,a2 as ma,R as pa,a8 as ha,E as xa,p as de,l as Ce,j as $,m as re,h as v,b as We,c as l,g as e,r as s,t as Y,a as ce,F as m,s as A,d as u,w as nt,i as o,f as Q,B as Ze,v as ka,e as se,u as g,y as Ie,o as Ot,x as Gt}from"./DzFKsO_V.js";import{c as wt,a as Ht}from"./BZykqlEc.js";import{p as f,i as D,c as Ut}from"./B_jyf0qs.js";import{e as Te,i as je}from"./CdXRaxkX.js";import{h as ct,s as Ne,B as Xe,r as ya,d as Be,b as _a,c as ke,f as At,k as Tt}from"./BguOOs3x.js";import{v as Dt}from"./DcWIrrGq.js";import{w as ot}from"./DoJxysSt.js";import{b as ba}from"./BVM1034P.js";import{A as Yt}from"./Ct5kWObc.js";import{B as qt}from"./1CdJgrM6.js";import{g as vt,k as Vt,b as wa,j as Nt,e as Rt,i as Ft}from"./JkzpcrZD.js";import{b as Xt}from"./Dtavz0EF.js";import{f as Ta}from"./ow_oMtSd.js";function bt(N,a,r){It&&ma();var n=N,t=ga,p,k,x=null,d=sa()?ia:la;function h(){p&&pa(p),x!==null&&(x.lastChild.remove(),n.before(x),x=null),p=k}da(()=>{if(d(t,t=a())){var _=n,C=fa();C&&(x=document.createDocumentFragment(),x.append(_=ca())),k=va(()=>r(_)),C?ua.add_callback(h):h()}}),It&&(n=ha)}function et(N,a){var r=N.$$events?.[a.type],n=xa(r)?r.slice():r==null?[]:[r];for(var t of n)t.call(this,a)}ut[m]="src/lib/components/Icons.svelte";var Ca=T(Je(' '),ut[m],[[50,0]]);function ut(N,a){ie(new.target),de(a,!1,ut);const r=re();let n=f(a,"name",8),t=f(a,"class",8,"h-5 w-5");const p={plus:' ',edit:' ',delete:' ',view:' ',close:' ',check:' ',x:' ',"chevron-left":' ',"chevron-right":' ',"chevron-down":' ',"chevron-up":' ',search:' ',refresh:' ',menu:' ',settings:' ',"check-circle":' ',"x-circle":' ',"exclamation-circle":' ',"information-circle":' ',loading:' ',sun:' ',moon:' ',document:' ',folder:' ',"git-branch":' '};Ce(()=>v(n()),()=>{$(r,p[n()]||"")}),We();var k=Ca(),x=l(k);return ct(x,()=>e(r),!0),s(k),Y(()=>Ne(k,0,`${t()}`)),i(N,k),ce({...le()})}ft[m]="src/lib/components/LoadingState.svelte";var Pa=T(S(''),ft[m],[[5,0,[[6,1],[7,1]]]]);function ft(N,a){ie(new.target),de(a,!1,ft);let r=f(a,"message",8,"Loading...");var n=Pa(),t=A(l(n),2),p=l(t,!0);return s(t),s(n),Y(()=>G(p,r())),i(N,n),ce({...le()})}Le[m]="src/lib/components/ErrorState.svelte";var Ma=T(S('
'),Le[m],[[22,5]]),Sa=T(S(''),Le[m],[[10,0,[[11,1,[[12,2,[[13,3,[[14,4,[[15,5]]]]],[18,3,[[19,4],[20,4]]]]]]]]]]);function Le(N,a){ie(new.target),de(a,!1,Le);let r=f(a,"title",8,"Error"),n=f(a,"message",8),t=f(a,"showRetry",8,!1),p=f(a,"onRetry",8,void 0);var k=Sa(),x=l(k),d=l(x),h=A(l(d),2),_=l(h),C=l(_,!0);s(_);var M=A(_,2),H=l(M,!0);s(M);var L=A(M,2);{var X=K=>{var O=Ma(),U=l(O);u(()=>Xe(U,{variant:"secondary",size:"sm",icon:" ",class:"text-red-700 dark:text-red-200 bg-red-100 dark:bg-red-800 hover:bg-red-200 dark:hover:bg-red-700 focus:outline-none focus:bg-red-200 dark:focus:bg-red-700",$$events:{click(...J){_t(p,this,J,Le,[26,17])}},children:ot(Le,(J,ee)=>{nt();var E=tt("Retry");i(J,E)}),$$slots:{default:!0}}),"component",Le,23,6,{componentTag:"Button"}),s(O),i(K,O)};u(()=>D(L,K=>{t()&&p()&&K(X)}),"if",Le,21,4)}return s(h),s(d),s(x),s(k),Y(()=>{G(C,r()),G(H,n())}),i(N,k),ce({...le()})}fe[m]="src/lib/components/EmptyState.svelte";var Ea=T(Je(' '),fe[m],[[9,2,[[10,3]]]]),ja=T(Je(' '),fe[m],[[13,2,[[14,3]]]]),Ba=T(Je(' '),fe[m],[[17,2,[[18,3]]]]),za=T(Je(' '),fe[m],[[21,2,[[22,3],[23,3]]]]),La=T(Je(' '),fe[m],[[26,2,[[27,3]]]]),Ia=T(Je(' '),fe[m],[[30,2,[[31,3],[32,3]]]]),Ha=T(S(''),fe[m],[[7,0,[[35,1],[36,1]]]]);function fe(N,a){ie(new.target),de(a,!1,fe);let r=f(a,"title",8),n=f(a,"message",8),t=f(a,"iconType",8,"document");var p=Ha(),k=l(p);{var x=H=>{var L=Ea();i(H,L)},d=H=>{var L=te(),X=Q(L);{var K=U=>{var J=ja();i(U,J)},O=U=>{var J=te(),ee=Q(J);{var E=y=>{var w=Ba();i(y,w)},c=y=>{var w=te(),j=Q(w);{var I=B=>{var R=za();i(B,R)},W=B=>{var R=te(),b=Q(R);{var z=F=>{var ne=La();i(F,ne)},P=F=>{var ne=te(),he=Q(ne);{var _e=Pe=>{var Ue=Ia();i(Pe,Ue)};u(()=>D(he,Pe=>{o(t(),"settings")&&Pe(_e)},!0),"if",fe,29,1)}i(F,ne)};u(()=>D(b,F=>{o(t(),"key")?F(z):F(P,!1)},!0),"if",fe,25,1)}i(B,R)};u(()=>D(j,B=>{o(t(),"cog")?B(I):B(W,!1)},!0),"if",fe,20,1)}i(y,w)};u(()=>D(ee,y=>{o(t(),"users")?y(E):y(c,!1)},!0),"if",fe,16,1)}i(U,J)};u(()=>D(X,U=>{o(t(),"building")?U(K):U(O,!1)},!0),"if",fe,12,1)}i(H,L)};u(()=>D(k,H=>{o(t(),"document")?H(x):H(d,!1)}),"if",fe,8,1)}var h=A(k,2),_=l(h,!0);s(h);var C=A(h,2),M=l(C,!0);return s(C),s(p),Y(()=>{G(_,r()),G(M,n())}),i(N,p),ce({...le()})}Re[m]="src/lib/components/SearchBar.svelte";var Ua=T(S(''),Re[m],[[18,0,[[19,1],[22,1]]]]);function Re(N,a){ie(new.target),de(a,!1,Re);let r=f(a,"value",12,""),n=f(a,"placeholder",8,"Search..."),t=f(a,"disabled",8,!1);const p=Ze();function k(){p("input",r())}ye();var x=Ua(),d=l(x),h=l(d);u(()=>ut(h,{name:"search",class:"h-5 w-5 text-gray-400"}),"component",Re,20,2,{componentTag:"Icons"}),s(d);var _=A(d,2);return ya(_),s(x),Y(()=>{Be(_,"placeholder",n()),_.disabled=t()}),ba(_,r),Ke("input",_,k),Ke("keydown",_,function(C){et.call(this,a,C)}),i(N,x),ce({...le()})}ze[m]="src/lib/components/SearchFilterBar.svelte";var Aa=T(S(" "),ze[m],[[48,7]]),Da=T(S(''),ze[m],[[38,3,[[39,4,[[40,5],[41,5]]]]]]),Va=T(S(''),ze[m],[[25,0,[[26,1,[[27,2,[[28,3,[[29,4]]]]]]]]]]);function ze(N,a){ie(new.target),de(a,!1,ze);var r=wt(a);let n=f(a,"searchTerm",12,""),t=f(a,"perPage",12,25),p=f(a,"placeholder",8,"Search..."),k=f(a,"showPerPageSelector",8,!0),x=f(a,"perPageOptions",24,()=>[25,50,100]);const d=Ze();function h(){d("search",{term:n()})}function _(){d("perPageChange",{perPage:t()})}ye();var C=Va(),M=l(C),H=l(M),L=l(H),X=A(l(L),2);r.binding("searchTerm",Re,n),u(()=>Re(X,{get placeholder(){return p()},get value(){return n()},set value(U){n(U)},$$events:{input:h},$$legacy:!0}),"component",ze,30,4,{componentTag:"SearchBar"}),s(L),s(H);var K=A(H,2);{var O=U=>{var J=Da(),ee=l(J),E=A(l(ee),2);Y(()=>{t(),ka(()=>{x()})}),u(()=>Te(E,5,x,je,(c,y)=>{var w=Aa(),j=l(w,!0);s(w);var I={};Y(()=>{G(j,e(y)),I!==(I=e(y))&&(w.value=(w.__value=e(y))??"")}),i(c,w)}),"each",ze,47,6),s(E),s(ee),s(J),_a(E,t),Ke("change",E,_),i(U,J)};u(()=>D(K,U=>{k()&&U(O)}),"if",ze,37,2)}return s(M),s(C),i(N,C),ce({...le()})}Ee[m]="src/lib/components/BackendSearchBar.svelte";var Na=T(S('
'),Ee[m],[[51,3]]),Ra=T(S(''),Ee[m],[[32,0,[[33,1,[[34,2,[[35,3]]]]]]]]);function Ee(N,a){ie(new.target),de(a,!1,Ee);var r=wt(a);let n=f(a,"value",12,""),t=f(a,"placeholder",8,"Search..."),p=f(a,"disabled",8,!1),k=f(a,"helpText",8,""),x=f(a,"showButton",8,!0);const d=Ze();function h(){d("search",n())}function _(){d("search",n())}function C(E){o(E.key,"Enter")&&h()}ye();var M=Ra(),H=l(M),L=l(H),X=l(L),K=l(X);r.binding("value",Re,n),u(()=>Re(K,{get placeholder(){return t()},get disabled(){return p()},get value(){return n()},set value(E){n(E)},$$events:{input:_,keydown:C},$$legacy:!0}),"component",Ee,36,4,{componentTag:"SearchBar"}),s(X);var O=A(X,2);{var U=E=>{u(()=>Xe(E,{variant:"secondary",get disabled(){return p()},$$events:{click:h},children:ot(Ee,(c,y)=>{nt();var w=tt("Search");i(c,w)}),$$slots:{default:!0}}),"component",Ee,45,4,{componentTag:"Button"})};u(()=>D(O,E=>{x()&&E(U)}),"if",Ee,44,3)}s(L);var J=A(L,2);{var ee=E=>{var c=Na(),y=l(c,!0);s(c),Y(()=>G(y,k())),i(E,c)};u(()=>D(J,E=>{k()&&E(ee)}),"if",Ee,50,2)}return s(H),s(M),i(N,M),ce({...le()})}ve[m]="src/lib/components/TablePagination.svelte";var Fa=T(S('Showing to of ',1),ve[m],[[53,14],[54,9],[55,9]]),Oa=T(S(''),ve[m],[[26,1,[[28,2],[47,2,[[48,3,[[49,4]]],[59,3,[[60,4]]]]]]]]);function ve(N,a){ie(new.target),de(a,!1,ve);const r=re(),n=re();let t=f(a,"currentPage",8,1),p=f(a,"totalPages",8,1),k=f(a,"perPage",8,25),x=f(a,"totalItems",8,0),d=f(a,"itemName",8,"results");const h=Ze();function _(L){L>=1&&L<=p()&&o(L,t(),!1)&&h("pageChange",{page:L})}Ce(()=>(v(x()),v(t()),v(k())),()=>{$(r,o(x(),0)?0:(t()-1)*k()+1)}),Ce(()=>(v(t()),v(k()),v(x())),()=>{$(n,Math.min(t()*k(),x()))}),We(),ye();var C=te(),M=Q(C);{var H=L=>{var X=Oa(),K=l(X),O=l(K);{let b=se(()=>o(t(),1));u(()=>Xe(O,{variant:"secondary",get disabled(){return e(b)},$$events:{click:()=>_(t()-1)},children:ot(ve,(z,P)=>{nt();var F=tt("Previous");i(z,F)}),$$slots:{default:!0}}),"component",ve,29,3,{componentTag:"Button"})}var U=A(O,2);{let b=se(()=>o(t(),p()));u(()=>Xe(U,{variant:"secondary",get disabled(){return e(b)},class:"ml-3",$$events:{click:()=>_(t()+1)},children:ot(ve,(z,P)=>{nt();var F=tt("Next");i(z,F)}),$$slots:{default:!0}}),"component",ve,36,3,{componentTag:"Button"})}s(K);var J=A(K,2),ee=l(J),E=l(ee),c=l(E);{var y=b=>{var z=tt();Y(()=>G(z,`No ${d()??""}`)),i(b,z)},w=b=>{var z=Fa(),P=A(Q(z)),F=l(P,!0);s(P);var ne=A(P,2),he=l(ne,!0);s(ne);var _e=A(ne,2),Pe=l(_e,!0);s(_e);var Ue=A(_e);Y(()=>{G(F,e(r)),G(he,e(n)),G(Pe,x()),G(Ue,` ${d()??""}`)}),i(b,z)};u(()=>D(c,b=>{o(x(),0)?b(y):b(w,!1)}),"if",ve,50,5)}s(E),s(ee);var j=A(ee,2),I=l(j),W=l(I);{let b=se(()=>o(t(),1));u(()=>Xe(W,{variant:"secondary",size:"sm",get disabled(){return e(b)},class:"rounded-r-none","aria-label":"Previous page",icon:" ",$$events:{click:()=>_(t()-1)}}),"component",ve,61,5,{componentTag:"Button"})}var B=A(W,2);u(()=>Te(B,1,()=>(v(p()),g(()=>Array(p()))),je,(b,z,P)=>{const F=Ie(se(()=>P+1),"page");e(F);{let ne=se(()=>o(e(F),t())?"primary":"secondary");u(()=>Xe(b,{get variant(){return e(ne)},size:"sm",class:"rounded-none border-l-0 first:border-l first:rounded-l-md",$$events:{click:()=>_(e(F))},children:ot(ve,(he,_e)=>{nt();var Pe=tt();Y(()=>G(Pe,e(F))),i(he,Pe)}),$$slots:{default:!0}}),"component",ve,74,6,{componentTag:"Button"})}}),"each",ve,72,5);var R=A(B,2);{let b=se(()=>o(t(),p()));u(()=>Xe(R,{variant:"secondary",size:"sm",get disabled(){return e(b)},class:"rounded-l-none","aria-label":"Next page",icon:" ",$$events:{click:()=>_(t()+1)}}),"component",ve,84,5,{componentTag:"Button"})}s(I),s(j),s(J),s(X),i(L,X)};u(()=>D(M,L=>{p()>1&&L(H)}),"if",ve,25,0)}return i(N,C),ce({...le()})}Z[m]="src/lib/components/MobileCard.svelte";var Ga=T(S('
'),Z[m],[[179,5]]),Ya=T(S('
'),Z[m],[[176,3,[[177,4]]]]),qa=T(S('
'),Z[m],[[188,5]]),Xa=T(S(''),Z[m],[[185,3,[[186,4]]]]),Ka=T(S('
'),Z[m],[[201,6,[[205,7]]]]),Ja=T(S('
'),Z[m],[[212,6,[[214,7]]]]),Wa=T(S('
'),Z[m],[[196,3]]),Za=T(S(" "),Z[m],[[229,5]]),Qa=T(S('
'),Z[m],[[240,3]]),$a=T(S(''),Z[m],[[173,0,[[174,1],[224,1]]]]);function Z(N,a){ie(new.target),de(a,!1,Z);const r=Ze();let n=f(a,"item",8),t=f(a,"config",8);function p(){if(!n())return"Unknown";const{field:c,useId:y,showOwner:w}=t().primaryText,j=n()[c];return y&&j?`${j.slice(0,8)}...`:w&&n().owner&&n().name?`${n().owner}/${n().name}`:j||"Unknown"}function k(){if(!t().secondaryText)return"";const{field:c,computedValue:y}=t().secondaryText;return o(y,void 0,!1)?o(typeof y,"function")?y(n()):y:n()?.[c]||""}function x(){if(!t().primaryText.href||!n())return"#";let c=t().primaryText.href;return c=c.replace("{id}",n().id||""),c=c.replace("{name}",encodeURIComponent(n().name||"")),ke(c)}function d(c){if(!n())return;const y=t().actions?.find(w=>o(w.type,c));y&&y.handler(n()),o(c,"edit")?r("edit",{item:n()}):o(c,"delete")?r("delete",{item:n()}):o(c,"clone")?r("clone",{item:n()}):r("action",{type:c,item:n()})}function h(c){switch(c.type){case"status":if(o(t().entityType,"instance")){const w=n()?.[c.field]||"unknown";let j="neutral",I=w.charAt(0).toUpperCase()+w.slice(1);return o(c.field,"status")?j=o(w,"running")?"success":o(w,"pending")||o(w,"creating")?"info":o(w,"failed")||o(w,"error")?"error":"neutral":o(c.field,"runner_status")&&(j=o(w,"idle")?"info":o(w,"active")||o(w,"running")?"success":o(w,"failed")||o(w,"error")?"error":"neutral"),{variant:j,text:I}}return{variant:"neutral",text:n()?.[c.field]||"Unknown"};case"forge":return{variant:"neutral",text:n()?.[c.field]||"unknown"};case"auth":const y=n()?.[c.field]||"pat";return{variant:o(y,"pat")?"success":"info",text:y.toUpperCase()};case"custom":if(o(typeof c.value,"function")){const w=c.value(n());return{variant:w?.variant||"neutral",text:w?.text||""}}return{variant:c.value?.variant||"neutral",text:c.value?.text||""};default:return{variant:"neutral",text:""}}}ye();var _=$a(),C=l(_),M=l(C);{var H=c=>{var y=Ya(),w=l(y),j=l(w,!0);s(w);var I=A(w,2);{var W=B=>{var R=Ga(),b=l(R,!0);s(R),Y(z=>G(b,z),[()=>g(k)]),i(B,R)};u(()=>D(I,B=>{v(t()),g(()=>t().secondaryText)&&B(W)}),"if",Z,178,4)}s(y),Y((B,R)=>{Be(y,"href",B),Ne(w,1,`text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 truncate${v(t()),g(()=>t().primaryText.isMonospace?" font-mono":"")??""}`),G(j,R)},[()=>g(x),()=>g(p)]),i(c,y)},L=c=>{var y=Xa(),w=l(y),j=l(w,!0);s(w);var I=A(w,2);{var W=B=>{var R=qa(),b=l(R,!0);s(R),Y(z=>G(b,z),[()=>g(k)]),i(B,R)};u(()=>D(I,B=>{v(t()),g(()=>t().secondaryText)&&B(W)}),"if",Z,187,4)}s(y),Y(B=>G(j,B),[()=>g(p)]),i(c,y)};u(()=>D(M,c=>{v(t()),g(()=>t().primaryText.isClickable)?c(H):c(L,!1)}),"if",Z,175,2)}var X=A(M,2);{var K=c=>{var y=Wa(),w=l(y);{var j=B=>{var R=te(),b=Q(R);u(()=>Te(b,1,()=>(v(t()),g(()=>t().customInfo)),je,(z,P)=>{const F=Ie(se(()=>(e(P),v(n()),g(()=>o(typeof e(P).icon,"function")?e(P).icon(n()):e(P).icon))),"iconHtml");e(F);const ne=Ie(se(()=>(e(P),v(n()),g(()=>o(typeof e(P).text,"function")?e(P).text(n()):e(P).text))),"text");e(ne);var he=Ka(),_e=l(he);{var Pe=at=>{var Qe=te(),lt=Q(Qe);ct(lt,()=>e(F)),i(at,Qe)};u(()=>D(_e,at=>{e(F)&&at(Pe)}),"if",Z,202,7)}var Ue=A(_e,2),gt=l(Ue,!0);s(Ue),s(he),Y(()=>G(gt,e(ne))),i(z,he)}),"each",Z,198,5),i(B,R)};u(()=>D(w,B=>{v(t()),g(()=>t().customInfo)&&B(j)}),"if",Z,197,4)}var I=A(w,2);{var W=B=>{var R=te(),b=Q(R);u(()=>Te(b,1,()=>(v(t()),g(()=>t().badges.filter(z=>o(z.type,"forge")))),je,(z,P)=>{var F=Ja(),ne=l(F);ct(ne,()=>(v(vt),e(P),v(n()),g(()=>vt(e(P).field?n()?.[e(P).field]||"unknown":n()?.endpoint?.endpoint_type||"unknown"))));var he=A(ne,2),_e=l(he,!0);s(he),s(F),Y(()=>G(_e,(v(n()),g(()=>n()?.endpoint?.name||"Unknown")))),i(z,F)}),"each",Z,211,5),i(B,R)};u(()=>D(I,B=>{v(t()),g(()=>t().badges)&&B(W)}),"if",Z,210,4)}s(y),i(c,y)};u(()=>D(X,c=>{v(t()),g(()=>t().customInfo||t().badges?.some(y=>o(y.type,"forge")))&&c(K)}),"if",Z,195,2)}s(C);var O=A(C,2),U=l(O);{var J=c=>{var y=te(),w=Q(y);u(()=>Te(w,1,()=>(v(t()),g(()=>t().badges.filter(j=>o(j.type,"forge",!1)))),je,(j,I)=>{var W=te(),B=Q(W);{var R=z=>{const P=Ie(se(()=>(e(I),g(()=>h(e(I))))),"badgeProps");e(P);var F=Za(),ne=l(F,!0);s(F),Y(()=>{Ne(F,1,`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ${v(e(P)),g(()=>o(e(P).variant,"success")?"bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-900/50 dark:text-green-300 dark:ring-green-400/20":o(e(P).variant,"info")?"bg-blue-50 text-blue-700 ring-blue-600/20 dark:bg-blue-900/50 dark:text-blue-300 dark:ring-blue-400/20":o(e(P).variant,"error")?"bg-red-50 text-red-700 ring-red-600/20 dark:bg-red-900/50 dark:text-red-300 dark:ring-red-400/20":"bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-900/50 dark:text-gray-300 dark:ring-gray-400/20")??""}`),G(ne,(v(e(P)),g(()=>e(P).text)))}),i(z,F)},b=z=>{const P=Ie(se(()=>(e(I),g(()=>h(e(I))))),"badgeProps");e(P),u(()=>qt(z,{get variant(){return v(e(P)),g(()=>e(P).variant)},get text(){return v(e(P)),g(()=>e(P).text)}}),"component",Z,234,5,{componentTag:"Badge"})};u(()=>D(B,z=>{e(I),g(()=>o(e(I).type,"status"))?z(R):z(b,!1)}),"if",Z,227,4)}i(j,W)}),"each",Z,226,3),i(c,y)};u(()=>D(U,c=>{v(t()),g(()=>t().badges)&&c(J)}),"if",Z,225,2)}var ee=A(U,2);{var E=c=>{var y=Qa();u(()=>Te(y,5,()=>(v(t()),g(()=>t().actions)),je,(w,j)=>{{let I=se(()=>(e(j),g(()=>o(e(j).type,"clone")?"copy":e(j).type))),W=se(()=>(e(j),v(t()),g(()=>o(e(j).type,"edit")?`Edit ${t().entityType}`:o(e(j).type,"delete")?`Delete ${t().entityType}`:o(e(j).type,"clone")?`Clone ${t().entityType}`:e(j).type))),B=se(()=>(e(j),v(t()),g(()=>o(e(j).type,"edit")?`Edit ${t().entityType}`:o(e(j).type,"delete")?`Delete ${t().entityType}`:o(e(j).type,"clone")?`Clone ${t().entityType}`:e(j).type)));u(()=>Yt(w,{get action(){return e(I)},size:"sm",get title(){return e(W)},get ariaLabel(){return e(B)},$$events:{click:()=>d(e(j).type)}}),"component",Z,242,5,{componentTag:"ActionButton"})}}),"each",Z,241,4),s(y),i(c,y)};u(()=>D(ee,c=>{v(t()),g(()=>t().actions)&&c(E)}),"if",Z,239,2)}return s(O),s(_),i(N,_),ce({...le()})}q[m]="src/lib/components/DataTable.svelte";var er=T(S('
'),q[m],[[197,6]]),tr=T(S('
'),q[m],[[195,4]]),ar=T(S("
"),q[m],[[227,6]]),rr=T(S("
"),q[m],[[235,7]]),nr=T(S(' ',1),q[m],[[220,3,[[221,4]]]]),or=T(S(''),q[m],[[154,0,[[176,1]]]]);function q(N,a){ie(new.target),de(a,!1,q);var r=wt(a);const n=re();let t=f(a,"columns",24,()=>[]),p=f(a,"data",24,()=>[]),k=f(a,"loading",8,!1),x=f(a,"error",8,""),d=f(a,"totalItems",8,0),h=f(a,"itemName",8,"results"),_=f(a,"searchTerm",12,""),C=f(a,"searchPlaceholder",8,"Search..."),M=f(a,"showSearch",8,!0),H=f(a,"searchType",8,"client"),L=f(a,"searchHelpText",8,""),X=f(a,"currentPage",8,1),K=f(a,"perPage",12,25),O=f(a,"totalPages",8,1),U=f(a,"showPagination",8,!0),J=f(a,"showPerPageSelector",8,!0),ee=f(a,"paginationComponent",8,null),E=f(a,"paginationProps",24,()=>({})),c=f(a,"emptyTitle",8,"No items found"),y=f(a,"emptyMessage",8,""),w=f(a,"emptyIconType",8,"document"),j=f(a,"errorTitle",8,"Error loading data"),I=f(a,"showRetry",8,!1),W=f(a,"showMobileCards",8,!0),B=f(a,"mobileCardConfig",8,null);const R=Ze();function b(V){const be=o(typeof V.detail,"string")?V.detail:V.detail.term;R("search",{term:be})}function z(V){R("pageChange",V.detail)}function P(V){R("perPageChange",V.detail)}function F(){R("retry")}function ne(V){R("edit",V.detail)}function he(V){R("delete",V.detail)}function _e(V){R("clone",V.detail)}function Pe(V){R("shell",V.detail)}function Ue(V){R("action",V.detail)}function gt(V){const be="px-6 py-4 text-sm",Fe=o(V.align,"right")?"text-right":o(V.align,"center")?"text-center":"text-left",Oe=o(V.key,"actions")?"font-medium":"text-gray-900 dark:text-white",Ge=V.flexible?"min-w-0":"";return`${be} ${Fe} ${Oe} ${Ge}`.trim()}function at(){return t().map(V=>V.flexible?`${V.flexRatio||1}fr`:"auto").join(" ")}Ce(()=>(v(y()),v(_()),v(h())),()=>{$(n,y()||(_()?`No items found matching "${_()}"`:`No ${h()} found`))}),We(),ye();var Qe=or(),lt=l(Qe);{var Kt=V=>{var be=te(),Fe=Q(be);{var Oe=oe=>{r.binding("searchTerm",Ee,_),u(()=>Ee(oe,{get placeholder(){return C()},get helpText(){return L()},showButton:!1,get value(){return _()},set value(we){_(we)},$$events:{search:b},$$legacy:!0}),"component",q,157,3,{componentTag:"BackendSearchBar"})},Ge=oe=>{r.binding("searchTerm",ze,_),r.binding("perPage",ze,K),u(()=>ze(oe,{get placeholder(){return C()},get showPerPageSelector(){return J()},get searchTerm(){return _()},set searchTerm(we){_(we)},get perPage(){return K()},set perPage(we){K(we)},$$events:{search:b,perPageChange:P},$$legacy:!0}),"component",q,165,3,{componentTag:"SearchFilterBar"})};u(()=>D(Fe,oe=>{o(H(),"backend")?oe(Oe):oe(Ge,!1)}),"if",q,156,2)}i(V,be)};u(()=>D(lt,V=>{M()&&V(Kt)}),"if",q,155,1)}var Mt=A(lt,2),St=l(Mt);{var Jt=V=>{u(()=>ft(V,{get message(){return`Loading ${h()??""}...`}}),"component",q,178,3,{componentTag:"LoadingState"})},Wt=V=>{var be=te(),Fe=Q(be);{var Oe=oe=>{{let we=se(()=>I()?F:void 0);u(()=>Le(oe,{get title(){return j()},get message(){return x()},get showRetry(){return I()},get onRetry(){return e(we)}}),"component",q,180,3,{componentTag:"ErrorState"})}},Ge=oe=>{var we=te(),mt=Q(we);{var pt=Ae=>{u(()=>fe(Ae,{get title(){return c()},get message(){return e(n)},get iconType(){return w()}}),"component",q,187,3,{componentTag:"EmptyState"})},ht=Ae=>{var Et=nr(),jt=Q(Et);{var $t=ge=>{var ae=tr();Dt(p,(xe,me)=>xe.id||xe.name||me),u(()=>Te(ae,7,p,(xe,me)=>xe.id||xe.name||me,(xe,me,kt)=>{var rt=er(),pe=l(rt);{var $e=De=>{var Ye=te(),Me=Q(Ye);u(()=>bt(Me,()=>(e(me),g(()=>`${e(me).id||e(me).name}-${e(me).updated_at}-mobile`)),qe=>{u(()=>Z(qe,{get item(){return e(me)},get config(){return B()},$$events:{edit(Se){et.call(this,a,Se)},delete(Se){et.call(this,a,Se)},clone(Se){et.call(this,a,Se)},action(Se){et.call(this,a,Se)}}}),"component",q,201,9,{componentTag:"MobileCard"})}),"key",q,200,8),i(De,Ye)},yt=De=>{var Ye=te(),Me=Q(Ye);At(Me,a,"mobile-card",{get item(){return e(me)},get index(){return e(kt)}},null),i(De,Ye)};u(()=>D(pe,De=>{B()?De($e):De(yt,!1)}),"if",q,198,7)}s(rt),i(xe,rt)}),"each",q,196,5),s(ae),i(ge,ae)};u(()=>D(jt,ge=>{W()&&ge($t)}),"if",q,193,3)}var Bt=A(jt,2),xt=l(Bt),zt=l(xt);u(()=>Te(zt,1,t,je,(ge,ae)=>{var xe=ar(),me=l(xe,!0);s(xe),Y(()=>{Ne(xe,1,`px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600 ${e(ae),g(()=>o(e(ae).align,"right")?"text-right":o(e(ae).align,"center")?"text-center":"text-left")??""}`),G(me,(e(ae),g(()=>e(ae).title)))}),i(ge,xe)}),"each",q,226,5);var ea=A(zt,2);Dt(p,(ge,ae)=>ge.id||ge.name||ae),u(()=>Te(ea,3,p,(ge,ae)=>ge.id||ge.name||ae,(ge,ae,xe)=>{var me=te(),kt=Q(me);u(()=>Te(kt,1,t,je,(rt,pe)=>{var $e=rr(),yt=l($e);{var De=Me=>{var qe=te(),Se=Q(qe);u(()=>bt(Se,()=>(e(ae),e(pe),g(()=>`${e(ae).id||e(ae).name}-${e(ae).updated_at}-${e(pe).key}`)),ta=>{var Lt=te(),aa=Q(Lt);{let ra=se(()=>o(typeof e(pe).cellProps,"function")?e(pe).cellProps(e(ae)):e(pe).cellProps);u(()=>Ht(aa,()=>e(pe).cellComponent,(na,oa)=>{oa(na,Ut({get item(){return e(ae)}},()=>e(ra),{$$events:{edit:ne,delete:he,clone:_e,shell:Pe,action:Ue}}))}),"component",q,238,10,{componentTag:"svelte:component"})}i(ta,Lt)}),"key",q,237,9),i(Me,qe)},Ye=Me=>{var qe=te(),Se=Q(qe);At(Se,a,"cell",{get item(){return e(ae)},get column(){return e(pe)},get index(){return e(xe)},get value(){return e(ae),e(pe),g(()=>e(ae)[e(pe).key])}},null),i(Me,qe)};u(()=>D(yt,Me=>{e(pe),g(()=>e(pe).cellComponent)?Me(De):Me(Ye,!1)}),"if",q,236,8)}s($e),Y(Me=>Ne($e,1,`${Me??""} border-b border-gray-200 dark:border-gray-700`),[()=>(e(pe),g(()=>gt(e(pe))))]),i(rt,$e)}),"each",q,234,6),i(ge,me)}),"each",q,233,5),s(xt),s(Bt),Y(ge=>Tt(xt,`grid-template-columns: ${ge??""}`),[()=>g(at)]),i(Ae,Et)};u(()=>D(mt,Ae=>{v(p()),g(()=>o(p().length,0))?Ae(pt):Ae(ht,!1)},!0),"if",q,186,2)}i(oe,we)};u(()=>D(Fe,oe=>{x()?oe(Oe):oe(Ge,!1)},!0),"if",q,179,2)}i(V,be)};u(()=>D(St,V=>{k()?V(Jt):V(Wt,!1)}),"if",q,177,2)}var Zt=A(St,2);{var Qt=V=>{var be=te(),Fe=Q(be);{var Oe=oe=>{var we=te(),mt=Q(we);u(()=>Ht(mt,ee,(pt,ht)=>{ht(pt,Ut({get currentPage(){return X()},get totalPages(){return O()},get totalItems(){return d()},get pageSize(){return K()},get loading(){return k()},get itemName(){return h()}},E,{$$events:{pageChange:z,pageSizeChange:P,prefetch(Ae){et.call(this,a,Ae)}}}))}),"component",q,261,4,{componentTag:"svelte:component"}),i(oe,we)},Ge=oe=>{u(()=>ve(oe,{get currentPage(){return X()},get totalPages(){return O()},get perPage(){return K()},get totalItems(){return d()},get itemName(){return h()},$$events:{pageChange:z}}),"component",q,275,4,{componentTag:"TablePagination"})};u(()=>D(Fe,oe=>{ee()?oe(Oe):oe(Ge,!1)}),"if",q,260,3)}i(V,be)};u(()=>D(Zt,V=>{v(U()),v(k()),v(x()),v(p()),g(()=>U()&&!k()&&!x()&&p().length>0)&&V(Qt)}),"if",q,259,2)}return s(Mt),s(Qe),i(N,Qe),ce({...le()})}He[m]="src/lib/components/cells/EntityCell.svelte";var sr=T(S(''),He[m],[[139,3,[[140,4,[[151,5]]]]]]),ir=T(S('
'),He[m],[[157,2]]),lr=T(S(''),He[m],[[165,1,[[169,2,[[170,3],[171,3]]]]]]),dr=T(S(' ',1),He[m],[[131,0,[[132,1,[[133,2]]]]]]);function He(N,a){ie(new.target),de(a,!1,He);const r=re(),n=re();let t=f(a,"item",8),p=f(a,"entityType",8,"repository"),k=f(a,"showOwner",8,!1),x=f(a,"showId",8,!1),d=f(a,"fontMono",8,!1),h=re(null),_=re(!1),C=re(0),M=re(0),H=re(!1);function L(){if(e(h)){const b=e(h).getBoundingClientRect();$(C,b.left),window.innerHeight-b.bottom<150?($(H,!0),$(M,b.top)):($(H,!1),$(M,b.bottom+4))}}function X(){$(_,!0),L()}function K(){$(_,!1)}Ot(()=>{window.addEventListener("scroll",L,!0),window.addEventListener("resize",L)}),Gt(()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)});function O(){if(!t())return"Unknown";switch(p()){case"repository":return k()?`${t().owner||"Unknown"}/${t().name||"Unknown"}`:t().name||"Unknown";case"organization":case"enterprise":return t().name||"Unknown";case"pool":return x()?t().id||"Unknown":t().name||"Unknown";case"scaleset":return t().name||"Unknown";case"instance":return t().name||"Unknown";case"template":return t().name||"Unknown";case"object":return t().name||"Unknown";case"credentials":return t().name||"Unknown";default:return t().name||t().id||"Unknown"}}function U(){if(!t())return"#";let b;switch(p()){case"instance":b=t().name;break;default:b=t().id||t().name;break}if(!b)return"#";switch(p()){case"repository":return ke(`/repositories/${b}`);case"organization":return ke(`/organizations/${b}`);case"enterprise":return ke(`/enterprises/${b}`);case"pool":return ke(`/pools/${b}`);case"scaleset":return ke(`/scalesets/${b}`);case"instance":return ke(`/instances/${encodeURIComponent(b)}`);case"template":return ke(`/templates/${b}`);case"object":return ke(`/objects/${b}`);case"credentials":return ke(`/credentials/${b}`);default:return"#"}}Ce(()=>{},()=>{$(r,O())}),Ce(()=>{},()=>{$(n,U())}),We(),ye();var J=dr(),ee=Q(J),E=l(ee),c=l(E),y=l(c,!0);s(c);var w=A(c,2);{var j=b=>{var z=sr(),P=l(z);Xt(P,F=>$(h,F),()=>e(h)),s(z),Ke("mouseenter",P,X),Ke("mouseleave",P,K),i(b,z)};u(()=>D(w,b=>{v(p()),v(t()),g(()=>o(p(),"object")&&t()?.description)&&b(j)}),"if",He,138,2)}s(E);var I=A(E,2);{var W=b=>{var z=ir(),P=l(z,!0);s(z),Y(()=>G(P,(v(t()),g(()=>t().provider_id)))),i(b,z)};u(()=>D(I,b=>{v(p()),v(t()),g(()=>o(p(),"instance")&&t()?.provider_id)&&b(W)}),"if",He,156,1)}s(ee);var B=A(ee,2);{var R=b=>{var z=lr(),P=l(z),F=A(l(P),2),ne=l(F,!0);s(F),s(P),s(z),Y(()=>{Tt(z,`left: ${e(C)??""}px; top: ${e(M)??""}px; transform: translateY(${e(H)?"-100%":"0"});`),G(ne,(v(t()),g(()=>t().description)))}),i(b,z)};u(()=>D(B,b=>{v(p()),v(t()),e(_),g(()=>o(p(),"object")&&t()?.description&&e(_))&&b(R)}),"if",He,164,0)}return Y(()=>{Be(c,"href",e(n)),Ne(c,1,`truncate text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 ${d()?"font-mono":""}`),Be(c,"title",e(r)),G(y,e(r))}),i(N,J),ce({...le()})}Ct[m]="src/lib/components/cells/EndpointCell.svelte";var cr=T(S(''),Ct[m],[[8,0,[[9,1],[12,1]]]]);function Ct(N,a){ie(new.target),de(a,!1,Ct);let r=f(a,"item",8),n=f(a,"iconSize",8,"w-5 h-5");ye();var t=cr(),p=l(t),k=l(p);ct(k,()=>(v(vt),v(r()),v(n()),g(()=>vt(r()?.endpoint?.endpoint_type||r()?.endpoint_type||"unknown",n())))),s(p);var x=A(p,2),d=l(x,!0);return s(x),s(t),Y(()=>G(d,(v(r()),g(()=>r()?.endpoint?.name||r()?.endpoint_name||r()?.endpoint_type||"Unknown")))),i(N,t),ce({...le()})}dt[m]="src/lib/components/cells/StatusCell.svelte";function dt(N,a){ie(new.target),de(a,!1,dt);const r=re(),n=re();let t=f(a,"item",8),p=f(a,"statusType",8,"entity"),k=f(a,"statusField",8,"status");Ce(()=>(v(t()),v(k())),()=>{$(r,t()?.[k()]||"unknown")}),Ce(()=>(v(t()),v(p()),e(r),v(k())),()=>{$(n,(()=>{if(!t())return{variant:"error",text:"Unknown"};switch(p()){case"entity":return Vt(t());case"instance":let h="secondary";switch(e(r).toLowerCase()){case"running":h="success";break;case"stopped":h="info";break;case"creating":case"pending_create":h="warning";break;case"deleting":case"pending_delete":case"pending_force_delete":h="warning";break;case"error":case"deleted":h="error";break;case"active":case"online":h="success";break;case"idle":h="info";break;case"pending":case"installing":h="warning";break;case"failed":case"terminated":case"offline":h="error";break;case"unknown":default:h="secondary";break}return{variant:h,text:Ta(e(r))};case"enabled":return{variant:t().enabled?"success":"error",text:t().enabled?"Enabled":"Disabled"};case"os_type":const _=(e(r)||"").toLowerCase();let C="secondary",M=e(r)||"Unknown";switch(_){case"linux":C="success",M="Linux";break;case"windows":C="blue",M="Windows";break;case"macos":case"darwin":C="purple",M="macOS";break;default:C="gray",M=e(r)||"Unknown";break}return{variant:C,text:M};case"forge_type":const H=(e(r)||"").toLowerCase();let L="secondary",X=e(r)||"Unknown";switch(H){case"github":L="gray",X="GitHub";break;case"gitea":L="green",X="Gitea";break;default:L="secondary",X=e(r)||"Unknown";break}return{variant:L,text:X};case"custom":const K=t()[k()]||"Unknown";if(o(k(),"auth-type")){const O=o(K,"pat")||!K?"pat":"app";return{variant:o(O,"pat")?"success":"info",text:o(O,"pat")?"PAT":"App"}}return{variant:"info",text:K};default:return Vt(t())}})())}),We(),ye();var x=te(),d=Q(x);return u(()=>bt(d,()=>(v(t()),v(k()),g(()=>`${t()?.name||"item"}-${t()?.[k()]||"status"}-${t()?.updated_at||"time"}`)),h=>{u(()=>qt(h,{get variant(){return e(n),g(()=>e(n).variant)},get text(){return e(n),g(()=>e(n).text)}}),"component",dt,168,1,{componentTag:"Badge"})}),"key",dt,167,0),i(N,x),ce({...le()})}st[m]="src/lib/components/cells/ActionsCell.svelte";var vr=T(S('
'),st[m],[[48,0]]);function st(N,a){ie(new.target),de(a,!1,st);const r=Ze();let n=f(a,"item",8),t=f(a,"actions",24,()=>[{type:"edit",title:"Edit",ariaLabel:"Edit item",action:"edit"},{type:"delete",title:"Delete",ariaLabel:"Delete item",action:"delete"}]);function p(x,d){if(!n())return;const h=d||x;o(h,"edit")?r("edit",{item:n()}):o(h,"delete")?r("delete",{item:n()}):o(h,"copy")||o(h,"clone")?r("clone",{item:n()}):o(x,"shell")?r("shell",{item:n()}):r("action",{type:h,item:n()})}ye();var k=vr();return u(()=>Te(k,5,t,je,(x,d)=>{const h=Ie(se(()=>(e(d),v(n()),g(()=>e(d).isDisabled?e(d).isDisabled(n()):!1))),"isDisabled");e(h);const _=Ie(se(()=>(e(d),g(()=>o(e(d).action,"clone")?"copy":e(d).action||(o(e(d).type,"edit")?"edit":o(e(d).type,"delete")?"delete":o(e(d).type,"copy")?"copy":o(e(d).type,"shell")?"shell":"view")))),"buttonAction");e(_);const C=Ie(se(()=>(e(d),v(n()),g(()=>o(typeof e(d).disabledTitle,"function")?e(d).disabledTitle(n()):e(d).disabledTitle))),"disabledTitleText");e(C);const M=Ie(se(()=>(v(e(h)),v(e(C)),e(d),g(()=>e(h)&&e(C)?e(C):e(d).title||(o(e(d).type,"edit")?"Edit":o(e(d).type,"delete")?"Delete":o(e(d).type,"copy")?"Clone":o(e(d).type,"shell")?"Shell":e(d).label)))),"buttonTitle");e(M);{let H=se(()=>(e(d),g(()=>e(d).ariaLabel||(o(e(d).type,"edit")?"Edit item":o(e(d).type,"delete")?"Delete item":o(e(d).type,"copy")?"Clone item":o(e(d).type,"shell")?"Open shell":e(d).label))));u(()=>Yt(x,{get action(){return e(_)},get title(){return e(M)},get ariaLabel(){return e(H)},get disabled(){return e(h)},$$events:{click:()=>p(e(d).type,e(d).action)}}),"component",st,54,2,{componentTag:"ActionButton"})}}),"each",st,49,1),s(k),i(N,k),ce({...le()})}it[m]="src/lib/components/cells/GenericCell.svelte";var ur=T(S(" "),it[m],[[55,1]]),fr=T(S(" "),it[m],[[62,1]]);function it(N,a){ie(new.target),de(a,!1,it);const r=re(),n=re();let t=f(a,"item",8),p=f(a,"field",8,void 0),k=f(a,"getValue",8,void 0),x=f(a,"type",8,"text"),d=f(a,"truncateLength",8,50),h=f(a,"showTitle",8,!1);function _(){return t()?k()?k()(t()):p()&&p().split(".").reduce((O,U)=>O?.[U],t())||"":""}function C(){return o(x(),"date")?wa(e(r)):o(x(),"truncated")&&e(r).length>d()?`${e(r).slice(0,d())}...`:e(r)}function M(){switch(x()){case"code":return"inline-block max-w-full truncate bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs font-mono";case"description":return"block w-full truncate text-sm text-gray-500 dark:text-gray-300";case"date":return"block w-full truncate text-sm text-gray-900 dark:text-white font-mono";default:return"block w-full truncate text-sm text-gray-900 dark:text-white"}}Ce(()=>{},()=>{$(r,_())}),Ce(()=>{},()=>{$(n,C())}),We(),ye();var H=te(),L=Q(H);{var X=O=>{var U=ur(),J=l(U,!0);s(U),Y(ee=>{Ne(U,1,`${ee??""} ${h()?"cursor-default":""}`),Be(U,"title",h()?e(r):""),G(J,e(n))},[()=>g(M)]),i(O,U)},K=O=>{var U=fr(),J=l(U,!0);s(U),Y(ee=>{Ne(U,1,`${ee??""} ${h()?"cursor-default":""}`),Be(U,"title",h()?e(r):""),G(J,e(n))},[()=>g(M)]),i(O,U)};u(()=>D(L,O=>{o(x(),"code")?O(X):O(K,!1)}),"if",it,54,0)}return i(N,H),ce({...le()})}Pt[m]="src/lib/components/cells/PoolEntityCell.svelte";var gr=T(S(''),Pt[m],[[8,0,[[9,1],[12,1]]]]);function Pt(N,a){ie(new.target),de(a,!1,Pt);let r=f(a,"item",8),n=f(a,"eagerCache",8,null);ye();var t=gr(),p=l(t),k=l(p,!0);s(p);var x=A(p,2),d=l(x,!0);return s(x),s(t),Y((h,_,C)=>{Be(p,"href",h),G(k,_),G(d,C)},[()=>(v(Nt),v(r()),g(()=>Nt(r()))),()=>(v(Rt),v(r()),v(n()),g(()=>Rt(r(),n()))),()=>(v(Ft),v(r()),g(()=>Ft(r())))]),i(N,t),ce({...le()})}Ve[m]="src/lib/components/cells/InstancePoolCell.svelte";var mr=T(S(' '),Ve[m],[[9,1]]),pr=T(S(' '),Ve[m],[[13,1]]),hr=T(S('- '),Ve[m],[[17,1]]),xr=T(S('
'),Ve[m],[[7,0]]);function Ve(N,a){ie(new.target),de(a,!1,Ve);let r=f(a,"item",8);ye();var n=xr(),t=l(n);{var p=x=>{var d=mr(),h=l(d);s(d),Y(_=>{Be(d,"href",_),Be(d,"title",`Pool: ${v(r()),g(()=>r().pool_id)??""}`),G(h,`Pool: ${v(r()),g(()=>r().pool_id)??""}`)},[()=>(v(ke),v(r()),g(()=>ke(`/pools/${r().pool_id}`)))]),i(x,d)},k=x=>{var d=te(),h=Q(d);{var _=M=>{var H=pr(),L=l(H);s(H),Y(X=>{Be(H,"href",X),Be(H,"title",`Scale Set: ${v(r()),g(()=>r().scale_set_id)??""}`),G(L,`Scale Set: ${v(r()),g(()=>r().scale_set_id)??""}`)},[()=>(v(ke),v(r()),g(()=>ke(`/scalesets/${r().scale_set_id}`)))]),i(M,H)},C=M=>{var H=hr();i(M,H)};u(()=>D(h,M=>{v(r()),g(()=>r()?.scale_set_id)?M(_):M(C,!1)},!0),"if",Ve,12,0)}i(x,d)};u(()=>D(t,x=>{v(r()),g(()=>r()?.pool_id)?x(p):x(k,!1)}),"if",Ve,8,0)}return s(n),i(N,n),ce({...le()})}ue[m]="src/lib/components/cells/TagsCell.svelte";var kr=T(S('- '),ue[m],[[63,1]]),yr=T(S(' '),ue[m],[[73,3]]),_r=T(S(' '),ue[m],[[78,3]]),br=T(S('
'),ue[m],[[66,1]]),wr=T(S(' '),ue[m],[[95,5]]),Tr=T(S(''),ue[m],[[87,1,[[91,2,[[92,3],[93,3]]]]]]),Cr=T(S(" ",1),ue[m],[]);function ue(N,a){ie(new.target),de(a,!1,ue);const r=re(),n=re(),t=re();let p=f(a,"item",8);const k=3;let x=re(null),d=re(!1),h=re(0),_=re(0),C=re(!1);function M(){if(e(x)){const E=e(x).getBoundingClientRect();$(h,E.left),window.innerHeight-E.bottom<150?($(C,!0),$(_,E.top)):($(C,!1),$(_,E.bottom+4))}}function H(){$(d,!0),M()}function L(){$(d,!1)}Ot(()=>{window.addEventListener("scroll",M,!0),window.addEventListener("resize",M)}),Gt(()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}),Ce(()=>v(p()),()=>{$(r,p()?.tags||[])}),Ce(()=>e(r),()=>{$(n,e(r).slice(0,k))}),Ce(()=>e(r),()=>{$(t,Math.max(0,e(r).length-k))}),We(),ye();var X=Cr(),K=Q(X);{var O=E=>{var c=kr();i(E,c)},U=E=>{var c=br(),y=l(c);u(()=>Te(y,1,()=>e(n),je,(I,W)=>{var B=yr(),R=l(B,!0);s(B),Y(()=>G(R,e(W))),i(I,B)}),"each",ue,72,2);var w=A(y,2);{var j=I=>{var W=_r(),B=l(W);s(W),Y(()=>G(B,`+${e(t)??""} more`)),i(I,W)};u(()=>D(w,I=>{e(t)>0&&I(j)}),"if",ue,77,2)}s(c),Xt(c,I=>$(x,I),()=>e(x)),Ke("mouseenter",c,function(...I){_t(()=>e(r).length>k?H:void 0,this,I,ue,[68,17])}),Ke("mouseleave",c,function(...I){_t(()=>e(r).length>k?L:void 0,this,I,ue,[69,17])}),i(E,c)};u(()=>D(K,E=>{e(r),g(()=>!e(r)||o(e(r).length,0))?E(O):E(U,!1)}),"if",ue,62,0)}var J=A(K,2);{var ee=E=>{var c=Tr(),y=l(c),w=A(l(y),2);u(()=>Te(w,5,()=>e(r),je,(j,I)=>{var W=wr(),B=l(W,!0);s(W),Y(()=>G(B,e(I))),i(j,W)}),"each",ue,94,4),s(w),s(y),s(c),Y(()=>Tt(c,`left: ${e(h)??""}px; top: ${e(_)??""}px; transform: translateY(${e(C)?"-100%":"0"});`)),i(E,c)};u(()=>D(J,E=>{e(r),e(d),g(()=>e(r).length>k&&e(d))&&E(ee)}),"if",ue,86,0)}return i(N,X),ce({...le()})}export{st as A,q as D,He as E,it as G,Ve as I,ft as L,Pt as P,dt as S,ue as T,Ct as a};
diff --git a/webapp/assets/_app/immutable/chunks/CH-vk5qo.js b/webapp/assets/_app/immutable/chunks/CH-vk5qo.js
deleted file mode 100644
index d7604eef..00000000
--- a/webapp/assets/_app/immutable/chunks/CH-vk5qo.js
+++ /dev/null
@@ -1 +0,0 @@
-import{s as t,p as r}from"./BzzAh3Be.js";import"./DzFKsO_V.js";const e={get data(){return r.data},get error(){return r.error},get form(){return r.form},get params(){return r.params},get route(){return r.route},get state(){return r.state},get status(){return r.status},get url(){return r.url}};t.updated.check;const u=e;export{u as p};
diff --git a/webapp/assets/_app/immutable/chunks/DcHRb6xX.js b/webapp/assets/_app/immutable/chunks/CKfnRgQC.js
similarity index 88%
rename from webapp/assets/_app/immutable/chunks/DcHRb6xX.js
rename to webapp/assets/_app/immutable/chunks/CKfnRgQC.js
index 9a19c4c9..15432fef 100644
--- a/webapp/assets/_app/immutable/chunks/DcHRb6xX.js
+++ b/webapp/assets/_app/immutable/chunks/CKfnRgQC.js
@@ -1,10 +1,10 @@
-import{c as Lt,a as He,s as tt,e as Pe,b as xe,d as Dt,i as Rt,l as xt,f as qe,g as gt}from"./CxOx-TIJ.js";import{i as At}from"./3NxSoY2_.js";import{ae as Tt,u as pe,D as Bt,h as Mt,aY as Ot,p as Pt,o as It,g as R,m as Ee,k as te,j as ne,x as Ht,i as Se,l as be,aW as ht,b as Ft,c as ge,r as fe,s as Ie,d as je,t as Xe,f as Wt,a as $t,n as Ut,F as Te}from"./DzFKsO_V.js";import{p as lt,i as Ye}from"./B_jyf0qs.js";import{e as ct}from"./CdXRaxkX.js";import{s as dt,d as Je}from"./BguOOs3x.js";import{b as Nt}from"./Dtavz0EF.js";import{s as zt}from"./CdEA5IGF.js";import{v as ut}from"./DcWIrrGq.js";import{l as Ae}from"./BAcG6-Ep.js";function jt(oe,re,X){Tt(()=>{var Y=pe(()=>re(oe,X?.())||{});if(X&&Y?.update){var Z=!1,le={};Bt(()=>{var O=X();Mt(O),Z&&Ot(le,O)&&(le=O,Y.update(O))}),Z=!0}if(Y?.destroy)return()=>Y.destroy()})}const qt=5,pt=6,Kt=7,Vt=8,Gt=9;function nt(oe,re){const X=new ArrayBuffer(1+re.byteLength);return new DataView(X).setUint8(0,oe),new Uint8Array(X,1).set(new Uint8Array(re)),X}function Xt(oe){const re=new DataView(oe);if(oe.byteLength<1)throw new Error("Message too short");return{type:re.getUint8(0),payload:oe.slice(1)}}function Yt(oe,re){const X=new ArrayBuffer(16+re.length);return new Uint8Array(X,0,16).set(new Uint8Array(oe)),new Uint8Array(X,16).set(re),nt(pt,X)}function Jt(oe,re,X){const Y=new ArrayBuffer(20),Z=new DataView(Y);return new Uint8Array(Y,0,16).set(new Uint8Array(oe)),Z.setUint16(16,X,!1),Z.setUint16(18,re,!1),nt(Kt,Y)}function Zt(oe){const re=new ArrayBuffer(16);return new Uint8Array(re).set(new Uint8Array(oe)),nt(Gt,re)}function Qt(oe,re,X,Y,Z){return new Promise((le,O)=>{try{const o=`${window.location.origin.replace(/^http/,"ws")}/api/v1/ws/agent/${encodeURIComponent(oe)}/shell`,c=new WebSocket(o);c.binaryType="arraybuffer";let _=null,r=!1;const d={ws:c,sessionId:null,onData:re,onReady:X,onExit:Y,onError:Z,sendData:f=>{if(_&&c.readyState===WebSocket.OPEN){const u=Yt(_,f);c.send(u)}},resize:(f,u)=>{if(_&&c.readyState===WebSocket.OPEN){const h=Jt(_,f,u);c.send(h)}},close:()=>{if(_&&c.readyState===WebSocket.OPEN){const f=Zt(_);c.send(f)}c.close()}};c.onopen=()=>{r=!0},c.onmessage=f=>{try{const{type:u,payload:h}=Xt(f.data);switch(u){case qt:if(h.byteLength>=17){const i=new DataView(h),s=h.slice(0,16),e=i.getUint8(16),t=h.byteLength>17?new TextDecoder("utf-8").decode(h.slice(17)):"";e?Z(t||"Shell initialization failed"):(_=s,d.sessionId=_,X())}break;case pt:if(h.byteLength>=16){const i=new Uint8Array(h.slice(16));re(i)}break;case Vt:Y();break;default:console.warn("Unknown message type:",u);break}}catch(u){Z(`Failed to parse message: ${u instanceof Error?u.message:"Unknown error"}`)}},c.onerror=f=>{Z("WebSocket error occurred")},c.onclose=f=>{r?Y():O(new Error(`Failed to connect: ${f.reason||"Connection closed"}`))},le(d)}catch(n){O(n)}})}var it={exports:{}},_t;function ei(){return _t||(_t=1,function(oe,re){(function(X,Y){oe.exports=Y()})(globalThis,()=>(()=>{var X={4567:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const r=o(9042),d=o(9924),f=o(844),u=o(4725),h=o(2585),i=o(3656);let s=n.AccessibilityManager=class extends f.Disposable{constructor(e,t,a,g){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=g,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let v=0;vthis._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(v=>this._handleResize(v.rows))),this.register(this._terminal.onRender(v=>this._refreshRows(v.start,v.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(v=>this._handleChar(v))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
+import{f as We,s as Xe,e as Te,a as De,c as St,b as lt}from"./o8CdT7B0.js";import{i as Ct}from"./ChJfoPF0.js";import{a7 as bt,u as Se,a8 as wt,h as yt,aU as Et,p as kt,o as Lt,g as R,m as we,j as te,d as ne,q as Dt,l as me,aF as it,b as Rt,c as ve,r as _e,s as Be,t as ze,f as xt,a as At}from"./DUMcBckj.js";import{p as st,i as je}from"./i7pKks78.js";import{e as rt}from"./DC7Aeygn.js";import{s as nt,d as qe}from"./_9uqtkkk.js";import{b as Tt}from"./DwF0DbKK.js";import{s as Bt}from"./CdEA5IGF.js";function Mt(oe,re,X){bt(()=>{var Y=Se(()=>re(oe,X?.())||{});if(X&&Y?.update){var Z=!1,he={};wt(()=>{var O=X();yt(O),Z&&Et(he,O)&&(he=O,Y.update(O))}),Z=!0}if(Y?.destroy)return()=>Y.destroy()})}const Ot=5,ct=6,Pt=7,It=8,Ht=9;function Qe(oe,re){const X=new ArrayBuffer(1+re.byteLength);return new DataView(X).setUint8(0,oe),new Uint8Array(X,1).set(new Uint8Array(re)),X}function Ft(oe){const re=new DataView(oe);if(oe.byteLength<1)throw new Error("Message too short");return{type:re.getUint8(0),payload:oe.slice(1)}}function Wt(oe,re){const X=new ArrayBuffer(16+re.length);return new Uint8Array(X,0,16).set(new Uint8Array(oe)),new Uint8Array(X,16).set(re),Qe(ct,X)}function $t(oe,re,X){const Y=new ArrayBuffer(20),Z=new DataView(Y);return new Uint8Array(Y,0,16).set(new Uint8Array(oe)),Z.setUint16(16,X,!1),Z.setUint16(18,re,!1),Qe(Pt,Y)}function Ut(oe){const re=new ArrayBuffer(16);return new Uint8Array(re).set(new Uint8Array(oe)),Qe(Ht,re)}function Nt(oe,re,X,Y,Z){return new Promise((he,O)=>{try{const o=`${window.location.origin.replace(/^http/,"ws")}/api/v1/ws/agent/${encodeURIComponent(oe)}/shell`,c=new WebSocket(o);c.binaryType="arraybuffer";let _=null,r=!1;const d={ws:c,sessionId:null,onData:re,onReady:X,onExit:Y,onError:Z,sendData:f=>{if(_&&c.readyState===WebSocket.OPEN){const u=Wt(_,f);c.send(u)}},resize:(f,u)=>{if(_&&c.readyState===WebSocket.OPEN){const h=$t(_,f,u);c.send(h)}},close:()=>{if(_&&c.readyState===WebSocket.OPEN){const f=Ut(_);c.send(f)}c.close()}};c.onopen=()=>{r=!0},c.onmessage=f=>{try{const{type:u,payload:h}=Ft(f.data);switch(u){case Ot:if(h.byteLength>=17){const i=new DataView(h),s=h.slice(0,16),e=i.getUint8(16),t=h.byteLength>17?new TextDecoder("utf-8").decode(h.slice(17)):"";e?Z(t||"Shell initialization failed"):(_=s,d.sessionId=_,X())}break;case ct:if(h.byteLength>=16){const i=new Uint8Array(h.slice(16));re(i)}break;case It:Y();break;default:console.warn("Unknown message type:",u);break}}catch(u){Z(`Failed to parse message: ${u instanceof Error?u.message:"Unknown error"}`)}},c.onerror=f=>{Z("WebSocket error occurred")},c.onclose=f=>{r?Y():O(new Error(`Failed to connect: ${f.reason||"Connection closed"}`))},he(d)}catch(n){O(n)}})}var Ye={exports:{}},ot;function zt(){return ot||(ot=1,function(oe,re){(function(X,Y){oe.exports=Y()})(globalThis,()=>(()=>{var X={4567:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const r=o(9042),d=o(9924),f=o(844),u=o(4725),h=o(2585),i=o(3656);let s=n.AccessibilityManager=class extends f.Disposable{constructor(e,t,a,g){super(),this._terminal=e,this._coreBrowserService=a,this._renderService=g,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let v=0;vthis._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new d.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(v=>this._handleResize(v.rows))),this.register(this._terminal.onRender(v=>this._refreshRows(v.start,v.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(v=>this._handleChar(v))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(v=>this._handleTab(v))),this.register(this._terminal.onKey(v=>this._handleKey(v.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,i.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,f.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=r.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const a=this._terminal.buffer,g=a.lines.length.toString();for(let v=e;v<=t;v++){const p=a.lines.get(a.ydisp+v),l=[],S=p?.translateToString(!0,void 0,void 0,l)||"",E=(a.ydisp+v+1).toString(),k=this._rowElements[v];k&&(S.length===0?(k.innerText=" ",this._rowColumns.set(k,[0,1])):(k.textContent=S,this._rowColumns.set(k,l)),k.setAttribute("aria-posinset",E),k.setAttribute("aria-setsize",g))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const a=e.target,g=this._rowElements[t===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")===(t===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==g)return;let v,p;if(t===0?(v=a,p=this._rowElements.pop(),this._rowContainer.removeChild(p)):(v=this._rowElements.shift(),p=a,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),p.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){const l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{const l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},a={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(a.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===a.node&&t.offset>a.offset)&&([t,a]=[a,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const g=this._rowElements.slice(-1)[0];if(a.node.compareDocumentPosition(g)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(a={node:g,offset:g.textContent?.length??0}),!this._rowContainer.contains(a.node))return;const v=({node:S,offset:E})=>{const k=S instanceof Text?S.parentNode:S;let x=parseInt(k?.getAttribute("aria-posinset"),10)-1;if(isNaN(x))return console.warn("row is invalid. Race condition?"),null;const w=this._rowColumns.get(k);if(!w)return console.warn("columns is null. Race condition?"),null;let B=E=this._terminal.cols&&(++x,B=0),{row:x,column:B}},p=v(t),l=v(a);if(p&&l){if(p.row>l.row||p.row===l.row&&p.column>=l.column)throw new Error("invalid range");this._terminal.select(p.column,p.row,(l.row-p.row)*this._terminal.cols-p.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{function o(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function _(d,f,u,h){d=c(d=o(d),u.decPrivateModes.bracketedPasteMode&&h.rawOptions.ignoreBracketedPasteMode!==!0),u.triggerDataEvent(d,!0),f.value=""}function r(d,f,u){const h=u.getBoundingClientRect(),i=d.clientX-h.left-10,s=d.clientY-h.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${i}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=o,n.bracketTextForPaste=c,n.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},n.handlePasteEvent=function(d,f,u,h){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),f,u,h)},n.paste=_,n.moveTextAreaUnderMouseCursor=r,n.rightClickHandler=function(d,f,u,h,i){r(d,f,u),i&&h.rightClickSelect(d),f.value=h.selectionText,f.select()}},7239:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const c=o(1505);n.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,r,d){this._css.set(_,r,d)}getCss(_,r){return this._css.get(_,r)}setColor(_,r,d){this._color.set(_,r,d)}getColor(_,r){return this._color.get(_,r)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(o,c,_,r){o.addEventListener(c,_,r);let d=!1;return{dispose:()=>{d||(d=!0,o.removeEventListener(c,_,r))}}}},3551:function(O,n,o){var c=this&&this.__decorate||function(s,e,t,a){var g,v=arguments.length,p=v<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(p=(v<3?g(p):v>3?g(e,t,p):g(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const r=o(3656),d=o(8460),f=o(844),u=o(2585),h=o(4725);let i=n.Linkifier=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(s,e,t,a,g){super(),this._element=s,this._mouseService=e,this._renderService=t,this._bufferService=a,this._linkProviderService=g,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,r.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,r.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,r.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,r.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(s){this._lastMouseEvent=s;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;const t=s.composedPath();for(let a=0;a{a?.forEach(g=>{g.link.dispose&&g.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=s.y);let t=!1;for(const[a,g]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(a)&&(t=this._checkLinkProviderResult(a,s,t)):g.provideLinks(s.y,v=>{if(this._isMouseOut)return;const p=v?.map(l=>({link:l}));this._activeProviderReplies?.set(a,p),t=this._checkLinkProviderResult(a,s,t),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(s.y,this._activeProviderReplies)})}_removeIntersectingLinks(s,e){const t=new Set;for(let a=0;as?this._bufferService.cols:p.link.range.end.x;for(let E=l;E<=S;E++){if(t.has(E)){g.splice(v--,1);break}t.add(E)}}}}_checkLinkProviderResult(s,e,t){if(!this._activeProviderReplies)return t;const a=this._activeProviderReplies.get(s);let g=!1;for(let v=0;vthis._linkAtPosition(p.link,e));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!t)for(let v=0;vthis._linkAtPosition(l.link,e));if(p){t=!0,this._handleNewLink(p);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(s){if(!this._currentLink)return;const e=this._positionFromMouseEvent(s,this._element,this._mouseService);e&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(s,this._currentLink.link.text)}_clearCurrentLink(s,e){this._currentLink&&this._lastMouseEvent&&(!s||!e||this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(s){if(!this._lastMouseEvent)return;const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(s.link,e)&&(this._currentLink=s,this._currentLink.state={decorations:{underline:s.link.decorations===void 0||s.link.decorations.underline,pointerCursor:s.link.decorations===void 0||s.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,s.link,this._lastMouseEvent),s.link.decorations={},Object.defineProperties(s.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:t=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",t))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(s.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const a=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,g=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=g&&(this._clearCurrentLink(a,g),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}})))}_linkHover(s,e,t){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&s.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(t,e.text)}_fireUnderlineEvent(s,e){const t=s.range,a=this._bufferService.buffer.ydisp,g=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-a-1,t.end.x,t.end.y-a-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(g)}_linkLeave(s,e,t){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&s.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(t,e.text)}_linkAtPosition(s,e){const t=s.range.start.y*this._bufferService.cols+s.range.start.x,a=s.range.end.y*this._bufferService.cols+s.range.end.x,g=e.y*this._bufferService.cols+e.x;return t<=g&&g<=a}_positionFromMouseEvent(s,e,t){const a=t.getCoords(s,e,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(s,e,t,a,g){return{x1:s,y1:e,x2:t,y2:a,cols:this._bufferService.cols,fg:g}}};n.Linkifier=i=c([_(1,h.IMouseService),_(2,h.IRenderService),_(3,u.IBufferService),_(4,h.ILinkProviderService)],i)},9042:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,n,o){var c=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,g=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,i,s,e);else for(var v=h.length-1;v>=0;v--)(t=h[v])&&(g=(a<3?t(g):a>3?t(i,s,g):t(i,s))||g);return a>3&&g&&Object.defineProperty(i,s,g),g},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const r=o(511),d=o(2585);let f=n.OscLinkProvider=class{constructor(h,i,s){this._bufferService=h,this._optionsService=i,this._oscLinkService=s}provideLinks(h,i){const s=this._bufferService.buffer.lines.get(h-1);if(!s)return void i(void 0);const e=[],t=this._optionsService.rawOptions.linkHandler,a=new r.CellData,g=s.getTrimmedLength();let v=-1,p=-1,l=!1;for(let S=0;St?t.activate(w,B,k):u(0,B),hover:(w,B)=>t?.hover?.(w,B,k),leave:(w,B)=>t?.leave?.(w,B,k)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(p=S,v=a.extended.urlId):(p=-1,v=-1)}}i(e)}};function u(h,i){if(confirm(`Do you want to navigate to ${i}?
-WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=f=c([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],f)},6193:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const c=o(3614),_=o(3656),r=o(3551),d=o(9042),f=o(3730),u=o(1680),h=o(3107),i=o(5744),s=o(2950),e=o(1296),t=o(428),a=o(4269),g=o(5114),v=o(8934),p=o(3230),l=o(9312),S=o(4725),E=o(6731),k=o(8055),x=o(8969),w=o(8460),B=o(844),I=o(6114),$=o(8437),j=o(2584),W=o(7399),m=o(5941),b=o(9074),y=o(2585),D=o(5435),P=o(4567),U=o(779);class q extends x.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(A={}){super(A),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(b.DecorationService),this._instantiationService.setService(y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(U.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((C,M)=>this.refresh(C,M))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(C=>this._reportWindowsOptions(C))),this.register(this._inputHandler.onColor(C=>this._handleColorEvent(C))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(C=>this._afterResize(C.cols,C.rows))),this.register((0,B.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const C of A){let M,H="";switch(C.index){case 256:M="foreground",H="10";break;case 257:M="background",H="11";break;case 258:M="cursor",H="12";break;default:M="ansi",H="4;"+C.index}switch(C.type){case 0:const z=k.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${H};${(0,m.toRgbString)(z)}${j.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors(N=>N.ansi[C.index]=k.channels.toColor(...C.color));else{const N=M;this._themeService.modifyColors(J=>J[N]=k.channels.toColor(...C.color))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(P.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const A=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(A);if(!C)return;const M=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,z=C.getWidth(M),N=this._renderService.dimensions.css.cell.width*z,J=this.buffer.y*this._renderService.dimensions.css.cell.height,se=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=J+"px",this.textarea.style.width=N+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",C=>{this.hasSelection()&&(0,c.copyHandler)(C,this._selectionService)}));const A=C=>(0,c.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,_.addDisposableDomListener)(this.element,"paste",A)),I.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",C=>{C.button===2&&(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",C=>{(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",C=>{C.button===1&&(0,c.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){if(!A)throw new Error("Terminal requires a parent element.");if(A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=A.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",M=>this.updateCursorStyle(M))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),I.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(g.CoreBrowserService,this.textarea,A.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",M=>this._handleTextAreaFocus(M))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(E.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(M=>this._onRender.fire(M))),this.onResize(M=>this._renderService.resize(M.cols,M.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(r.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(u.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(M=>this.scrollLines(M.amount,M.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(M=>this.scrollLines(M.amount,M.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",M=>this._selectionService.handleMouseDown(M))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(P.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",M=>this._handleScreenReaderModeOptionChange(M))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const A=this,C=this.element;function M(N){const J=A._mouseService.getMouseReportCoords(N,A.screenElement);if(!J)return!1;let se,ee;switch(N.overrideType||N.type){case"mousemove":ee=32,N.buttons===void 0?(se=3,N.button!==void 0&&(se=N.button<3?N.button:3)):se=1&N.buttons?0:4&N.buttons?1:2&N.buttons?2:3;break;case"mouseup":ee=0,se=N.button<3?N.button:3;break;case"mousedown":ee=1,se=N.button<3?N.button:3;break;case"wheel":if(A._customWheelEventHandler&&A._customWheelEventHandler(N)===!1||A.viewport.getLinesScrolled(N)===0)return!1;ee=N.deltaY<0?0:1,se=4;break;default:return!1}return!(ee===void 0||se===void 0||se>4)&&A.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:se,action:ee,ctrl:N.ctrlKey,alt:N.altKey,shift:N.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:N=>(M(N),N.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(N)),wheel:N=>(M(N),this.cancel(N,!0)),mousedrag:N=>{N.buttons&&M(N)},mousemove:N=>{N.buttons||M(N)}};this.register(this.coreMouseService.onProtocolChange(N=>{N?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(N)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&N?H.mousemove||(C.addEventListener("mousemove",z.mousemove),H.mousemove=z.mousemove):(C.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&N?H.wheel||(C.addEventListener("wheel",z.wheel,{passive:!1}),H.wheel=z.wheel):(C.removeEventListener("wheel",H.wheel),H.wheel=null),2&N?H.mouseup||(H.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&N?H.mousedrag||(H.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",N=>{if(N.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(N))return M(N),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(N)})),this.register((0,_.addDisposableDomListener)(C,"wheel",N=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(N)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(N);if(J===0)return;const se=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(N.deltaY<0?"A":"B");let ee="";for(let ce=0;ce{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(N),this.cancel(N)},{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",N=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(N)?void 0:this.cancel(N)},{passive:!1}))}refresh(A,C){this._renderService?.refreshRows(A,C)}updateCursorStyle(A){this._selectionService?.shouldColumnSelect(A)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(A,C,M=0){M===1?(super.scrollLines(A,C,M),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(A)}paste(A){(0,c.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}attachCustomWheelEventHandler(A){this._customWheelEventHandler=A}registerLinkProvider(A){return this._linkProviderService.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,C,M){this._selectionService.setSelection(A,C,M)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(A,C){this._selectionService?.selectLines(A,C)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!C&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,W.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),M.type===3||M.type===2){const H=this.rows-1;return this.scrollLines(M.type===2?-H:H),this.cancel(A,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(M.cancel&&this.cancel(A,!0),!M.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==j.C0.ETX&&M.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,C){const M=A.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||A.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||A.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?M:M&&(!C.keyCode||C.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)C=A.charCode;else if(A.which===null||A.which===void 0)C=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;C=A.which}return!(!C||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=A.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(A),!0}return!1}resize(A,C){A!==this.cols||C!==this.rows?super.resize(A,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,C){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let A=1;A{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=r-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(O,n,o){var c=this&&this.__decorate||function(s,e,t,a){var g,v=arguments.length,p=v<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(p=(v<3?g(p):v>3?g(e,t,p):g(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const r=o(3656),d=o(4725),f=o(8460),u=o(844),h=o(2585);let i=n.Viewport=class extends u.Disposable{constructor(s,e,t,a,g,v,p,l){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=a,this._charSizeService=g,this._renderService=v,this._coreBrowserService=p,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,r.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(S=>this._activeBuffer=S.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(S=>this._renderDimensions=S)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(S=>this._handleThemeChange(S))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t0&&(t=k),a=""}}return{bufferElements:g,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};n.Viewport=i=c([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],i)},3107:function(O,n,o){var c=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,g=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,i,s,e);else for(var v=h.length-1;v>=0;v--)(t=h[v])&&(g=(a<3?t(g):a>3?t(i,s,g):t(i,s))||g);return a>3&&g&&Object.defineProperty(i,s,g),g},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const r=o(4725),d=o(844),f=o(2585);let u=n.BufferDecorationRenderer=class extends d.Disposable{constructor(h,i,s,e,t){super(),this._screenElement=h,this._bufferService=i,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this.register((0,d.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",h?.options?.layer==="top"),i.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=h.options.x??0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(h,i),i}_refreshStyle(h){const i=h.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let s=this._decorationElements.get(h);s||(s=this._createElement(h),h.element=s,this._decorationElements.set(h,s),this._container.appendChild(s),h.onDispose(()=>{this._decorationElements.delete(h),s.remove()})),s.style.top=i*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(s)}}_refreshXPosition(h,i=h.element){if(!i)return;const s=h.options.x??0;(h.options.anchor||"left")==="right"?i.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){this._decorationElements.get(h)?.remove(),this._decorationElements.delete(h),h.dispose()}};n.BufferDecorationRenderer=u=c([_(1,f.IBufferService),_(2,r.ICoreBrowserService),_(3,f.IDecorationService),_(4,r.IRenderService)],u)},5871:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,_){return c>=o.startBufferLine-this._linePadding[_||"full"]&&c<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(O,n,o){var c=this&&this.__decorate||function(t,a,g,v){var p,l=arguments.length,S=l<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,a,g,v);else for(var E=t.length-1;E>=0;E--)(p=t[E])&&(S=(l<3?p(S):l>3?p(a,g,S):p(a,g))||S);return l>3&&S&&Object.defineProperty(a,g,S),S},_=this&&this.__param||function(t,a){return function(g,v){a(g,v,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const r=o(5871),d=o(4725),f=o(844),u=o(2585),h={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=n.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,a,g,v,p,l,S){super(),this._viewportElement=t,this._screenElement=a,this._bufferService=g,this._decorationService=v,this._renderService=p,this._optionsService=l,this._coreBrowserService=S,this._colorZoneStore=new r.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const E=this._canvas.getContext("2d");if(!E)throw new Error("Ctx cannot be null");this._ctx=E,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const t=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=t,i.center=a,i.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=i.left,s.right=i.left+i.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);h.left=a,h.center=a,h.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const a of t)a.position!=="full"&&this._renderColorZone(a);for(const a of t)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-h[t.position||"full"]/2),i[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[t.position||"full"]))}_queueRefresh(t,a){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=e=c([_(2,u.IBufferService),_(3,u.IDecorationService),_(4,d.IRenderService),_(5,u.IOptionsService),_(6,d.ICoreBrowserService)],e)},2950:function(O,n,o){var c=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,g=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,i,s,e);else for(var v=h.length-1;v>=0;v--)(t=h[v])&&(g=(a<3?t(g):a>3?t(i,s,g):t(i,s))||g);return a>3&&g&&Object.defineProperty(i,s,g),g},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const r=o(4725),d=o(2585),f=o(2584);let u=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,i,s,e,t,a){this._textarea=h,this._compositionView=i,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const i=this._textarea.value,s=i.replace(h,"");this._dataAlreadySent=s,i.length>h.length?this._coreService.triggerDataEvent(s,!0):i.lengththis.updateCompositionElements(!0),0)}}};n.CompositionHelper=u=c([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,r.IRenderService)],u)},9806:(O,n)=>{function o(c,_,r){const d=r.getBoundingClientRect(),f=c.getComputedStyle(r),u=parseInt(f.getPropertyValue("padding-left")),h=parseInt(f.getPropertyValue("padding-top"));return[_.clientX-d.left-u,_.clientY-d.top-h]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=o,n.getCoords=function(c,_,r,d,f,u,h,i,s){if(!u)return;const e=o(c,_,r);return e?(e[0]=Math.ceil((e[0]+(s?h/2:0))/h),e[1]=Math.ceil(e[1]/i),e[0]=Math.min(Math.max(e[0],1),d+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),f),e):void 0}},9504:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const c=o(2584);function _(i,s,e,t){const a=i-r(i,e),g=s-r(s,e),v=Math.abs(a-g)-function(p,l,S){let E=0;const k=p-r(p,S),x=l-r(l,S);for(let w=0;w=0&&is?"A":"B"}function f(i,s,e,t,a,g){let v=i,p=s,l="";for(;v!==e||p!==t;)v+=a?1:-1,a&&v>g.cols-1?(l+=g.buffer.translateBufferLineToString(p,!1,i,v),v=0,i=0,p++):!a&&v<0&&(l+=g.buffer.translateBufferLineToString(p,!1,0,i+1),v=g.cols-1,i=v,p--);return l+g.buffer.translateBufferLineToString(p,!1,i,v)}function u(i,s){const e=s?"O":"[";return c.C0.ESC+e+i}function h(i,s){i=Math.floor(i);let e="";for(let t=0;t0?k-r(k,x):S;const I=k,$=function(j,W,m,b,y,D){let P;return P=_(m,b,y,D).length>0?b-r(b,y):W,j=m&&Pi?"D":"C",h(Math.abs(a-i),u(v,t));v=g>s?"D":"C";const p=Math.abs(g-s);return h(function(l,S){return S.cols-l}(g>s?i:a,e)+(p-1)*e.cols+1+((g>s?a:i)-1),u(v,t))}},1296:function(O,n,o){var c=this&&this.__decorate||function(w,B,I,$){var j,W=arguments.length,m=W<3?B:$===null?$=Object.getOwnPropertyDescriptor(B,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(w,B,I,$);else for(var b=w.length-1;b>=0;b--)(j=w[b])&&(m=(W<3?j(m):W>3?j(B,I,m):j(B,I))||m);return W>3&&m&&Object.defineProperty(B,I,m),m},_=this&&this.__param||function(w,B){return function(I,$){B(I,$,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const r=o(3787),d=o(2550),f=o(2223),u=o(6171),h=o(6052),i=o(4725),s=o(8055),e=o(8460),t=o(844),a=o(2585),g="xterm-dom-renderer-owner-",v="xterm-rows",p="xterm-fg-",l="xterm-bg-",S="xterm-focus",E="xterm-selection";let k=1,x=n.DomRenderer=class extends t.Disposable{constructor(w,B,I,$,j,W,m,b,y,D,P,U,q){super(),this._terminal=w,this._document=B,this._element=I,this._screenElement=$,this._viewportElement=j,this._helperContainer=W,this._linkifier2=m,this._charSizeService=y,this._optionsService=D,this._bufferService=P,this._coreBrowserService=U,this._themeService=q,this._terminalClass=k++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(v),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,u.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(K=>this._injectCss(K))),this._injectCss(this._themeService.colors),this._rowFactory=b.createInstance(r.DomRendererRowFactory,document),this._element.classList.add(g+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(K=>this._handleLinkHover(K))),this.register(this._linkifier2.onHideLinkUnderline(K=>this._handleLinkLeave(K))),this.register((0,t.toDisposable)(()=>{this._element.classList.remove(g+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${v} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${v} .xterm-dim { color: ${s.color.multiplyOpacity(w.foreground,.5).css};}`,B+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const I=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;B+=`@keyframes ${I} { 50% { border-bottom-style: hidden; }}`,B+=`@keyframes ${$} { 50% { box-shadow: none; }}`,B+=`@keyframes ${j} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,B+=`${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[W,m]of w.ansi.entries())B+=`${this._terminalSelector} .${p}${W} { color: ${m.css}; }${this._terminalSelector} .${p}${W}.xterm-dim { color: ${s.color.multiplyOpacity(m,.5).css}; }${this._terminalSelector} .${l}${W} { background-color: ${m.css}; }`;B+=`${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(w.background).css}; }${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${l}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,B){for(let I=this._rowElements.length;I<=B;I++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,B){this._refreshRowElements(w,B),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,B,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,B,I),this.renderRows(0,this._bufferService.rows-1),!w||!B)return;this._selectionRenderModel.update(this._terminal,w,B,I);const $=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,m=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||m<0)return;const b=this._document.createDocumentFragment();if(I){const y=w[0]>B[0];b.appendChild(this._createSelectionElement(W,y?B[0]:w[0],y?w[0]:B[0],m-W+1))}else{const y=$===W?w[0]:0,D=W===j?B[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(W,y,D));const P=m-W-1;if(b.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,P)),W!==m){const U=j===m?B[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(m,0,U))}}this._selectionContainer.appendChild(b)}_createSelectionElement(w,B,I,$=1){const j=this._document.createElement("div"),W=B*this.dimensions.css.cell.width;let m=this.dimensions.css.cell.width*(I-B);return W+m>this.dimensions.css.canvas.width&&(m=this.dimensions.css.canvas.width-W),j.style.height=$*this.dimensions.css.cell.height+"px",j.style.top=w*this.dimensions.css.cell.height+"px",j.style.left=`${W}px`,j.style.width=`${m}px`,j}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,B){const I=this._bufferService.buffer,$=I.ybase+I.y,j=Math.min(I.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=w;y<=B;y++){const D=y+I.ydisp,P=this._rowElements[y],U=I.lines.get(D);if(!P||!U)break;P.replaceChildren(...this._rowFactory.createRow(U,D,D===$,m,b,j,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${g}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,B,I,$,j,W){I<0&&(w=0),$<0&&(B=0);const m=this._bufferService.rows-1;I=Math.max(Math.min(I,m),0),$=Math.max(Math.min($,m),0),j=Math.min(j,this._bufferService.cols);const b=this._bufferService.buffer,y=b.ybase+b.y,D=Math.min(b.x,j-1),P=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,q=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=I;K<=$;++K){const A=K+b.ydisp,C=this._rowElements[K],M=b.lines.get(A);if(!C||!M)break;C.replaceChildren(...this._rowFactory.createRow(M,A,A===y,U,q,D,P,this.dimensions.css.cell.width,this._widthCache,W?K===I?w:0:-1,W?(K===$?B:j)-1:-1))}}};n.DomRenderer=x=c([_(7,a.IInstantiationService),_(8,i.ICharSizeService),_(9,a.IOptionsService),_(10,a.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],x)},3787:function(O,n,o){var c=this&&this.__decorate||function(v,p,l,S){var E,k=arguments.length,x=k<3?p:S===null?S=Object.getOwnPropertyDescriptor(p,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(v,p,l,S);else for(var w=v.length-1;w>=0;w--)(E=v[w])&&(x=(k<3?E(x):k>3?E(p,l,x):E(p,l))||x);return k>3&&x&&Object.defineProperty(p,l,x),x},_=this&&this.__param||function(v,p){return function(l,S){p(l,S,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const r=o(2223),d=o(643),f=o(511),u=o(2585),h=o(8055),i=o(4725),s=o(4269),e=o(6171),t=o(3734);let a=n.DomRendererRowFactory=class{constructor(v,p,l,S,E,k,x){this._document=v,this._characterJoinerService=p,this._optionsService=l,this._coreBrowserService=S,this._coreService=E,this._decorationService=k,this._themeService=x,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,p,l){this._selectionStart=v,this._selectionEnd=p,this._columnSelectMode=l}createRow(v,p,l,S,E,k,x,w,B,I,$){const j=[],W=this._characterJoinerService.getJoinedCharacters(p),m=this._themeService.colors;let b,y=v.getNoBgTrimmedLength();l&&y0&&J===W[0][0]){ee=!0;const ie=W.shift();V=new s.JoinedCellData(this._workCell,v.translateToString(!0,ie[0],ie[1]),ie[1]-ie[0]),ce=ie[1]-1,se=V.getWidth()}const Le=this._isCellInSelection(J,p),Fe=l&&J===k,We=N&&J>=I&&J<=$;let $e=!1;this._decorationService.forEachDecorationAtCell(J,p,void 0,ie=>{$e=!0});let Ue=V.getChars()||d.WHITESPACE_CELL_CHAR;if(Ue===" "&&(V.isUnderline()||V.isOverline())&&(Ue=" "),H=se*w-B.get(Ue,V.isBold(),V.isItalic()),b){if(D&&(Le&&M||!Le&&!M&&V.bg===U)&&(Le&&M&&m.selectionForeground||V.fg===q)&&V.extended.ext===K&&We===A&&H===C&&!Fe&&!ee&&!$e){V.isInvisible()?P+=d.WHITESPACE_CELL_CHAR:P+=Ue,D++;continue}D&&(b.textContent=P),b=this._document.createElement("span"),D=0,P=""}else b=this._document.createElement("span");if(U=V.bg,q=V.fg,K=V.extended.ext,A=We,C=H,M=Le,ee&&k>=J&&k<=ce&&(k=J),!this._coreService.isCursorHidden&&Fe&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)x&&z.push("xterm-cursor-blink"),z.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(E)switch(E){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(V.isBold()&&z.push("xterm-bold"),V.isItalic()&&z.push("xterm-italic"),V.isDim()&&z.push("xterm-dim"),P=V.isInvisible()?d.WHITESPACE_CELL_CHAR:V.getChars()||d.WHITESPACE_CELL_CHAR,V.isUnderline()&&(z.push(`xterm-underline-${V.extended.underlineStyle}`),P===" "&&(P=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let ie=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&ie<8&&(ie+=8),b.style.textDecorationColor=m.ansi[ie].css}V.isOverline()&&(z.push("xterm-overline"),P===" "&&(P=" ")),V.isStrikethrough()&&z.push("xterm-strikethrough"),We&&(b.style.textDecoration="underline");let ue=V.getFgColor(),Be=V.getFgColorMode(),Ce=V.getBgColor(),Me=V.getBgColorMode();const Ne=!!V.isInverse();if(Ne){const ie=ue;ue=Ce,Ce=ie;const Ke=Be;Be=Me,Me=Ke}let me,De,we,Re=!1;switch(this._decorationService.forEachDecorationAtCell(J,p,void 0,ie=>{ie.options.layer!=="top"&&Re||(ie.backgroundColorRGB&&(Me=50331648,Ce=ie.backgroundColorRGB.rgba>>8&16777215,me=ie.backgroundColorRGB),ie.foregroundColorRGB&&(Be=50331648,ue=ie.foregroundColorRGB.rgba>>8&16777215,De=ie.foregroundColorRGB),Re=ie.options.layer==="top")}),!Re&&Le&&(me=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,Ce=me.rgba>>8&16777215,Me=50331648,Re=!0,m.selectionForeground&&(Be=50331648,ue=m.selectionForeground.rgba>>8&16777215,De=m.selectionForeground)),Re&&z.push("xterm-decoration-top"),Me){case 16777216:case 33554432:we=m.ansi[Ce],z.push(`xterm-bg-${Ce}`);break;case 50331648:we=h.channels.toColor(Ce>>16,Ce>>8&255,255&Ce),this._addStyle(b,`background-color:#${g((Ce>>>0).toString(16),"0",6)}`);break;default:Ne?(we=m.foreground,z.push(`xterm-bg-${r.INVERTED_DEFAULT_COLOR}`)):we=m.background}switch(me||V.isDim()&&(me=h.color.multiplyOpacity(we,.5)),Be){case 16777216:case 33554432:V.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(b,we,m.ansi[ue],V,me,void 0)||z.push(`xterm-fg-${ue}`);break;case 50331648:const ie=h.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(b,we,ie,V,me,De)||this._addStyle(b,`color:#${g(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,we,m.foreground,V,me,De)||Ne&&z.push(`xterm-fg-${r.INVERTED_DEFAULT_COLOR}`)}z.length&&(b.className=z.join(" "),z.length=0),Fe||ee||$e?b.textContent=P:D++,H!==this.defaultSpacing&&(b.style.letterSpacing=`${H}px`),j.push(b),J=ce}return b&&D&&(b.textContent=P),j}_applyMinimumContrast(v,p,l,S,E,k){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(S.getCode()))return!1;const x=this._getContrastCache(S);let w;if(E||k||(w=x.getColor(p.rgba,l.rgba)),w===void 0){const B=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);w=h.color.ensureContrastRatio(E||p,k||l,B),x.setColor((E||p).rgba,(k||l).rgba,w??null)}return!!w&&(this._addStyle(v,`color:${w.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,p){v.setAttribute("style",`${v.getAttribute("style")||""}${p};`)}_isCellInSelection(v,p){const l=this._selectionStart,S=this._selectionEnd;return!(!l||!S)&&(this._columnSelectMode?l[0]<=S[0]?v>=l[0]&&p>=l[1]&&v=l[1]&&v>=S[0]&&p<=S[1]:p>l[1]&&p=l[0]&&v=l[0])}};function g(v,p,l){for(;v.length{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=o.createElement("span");_.classList.add("xterm-char-measure-element");const r=o.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";const d=o.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[_,r,d,f],this._container.appendChild(_),this._container.appendChild(r),this._container.appendChild(d),this._container.appendChild(f),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,_,r){o===this._font&&c===this._fontSize&&_===this._weight&&r===this._weightBold||(this._font=o,this._fontSize=c,this._weight=_,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(o,c,_){let r=0;if(!c&&!_&&o.length===1&&(r=o.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];const u=this._measure(o,0);return u>0&&(this._flat[r]=u),u}let d=o;c&&(d+="B"),_&&(d+="I");let f=this._holey.get(d);if(f===void 0){let u=0;c&&(u|=1),_&&(u|=2),f=this._measure(o,u),f>0&&this._holey.set(d,f)}return f}_measure(o,c){const _=this._measureElements[c];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(O,n)=>{function o(_){return 57508<=_&&_<=57558}function c(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=o,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=c,n.allowRescaling=function(_,r,d,f){return r===1&&d>Math.ceil(1.5*f)&&_!==void 0&&_>255&&!c(_)&&!o(_)&&!function(u){return 57344<=u&&u<=63743}(_)},n.treatGlyphAsBackgroundColor=function(_){return o(_)||function(r){return 9472<=r&&r<=9631}(_)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},n.computeNextVariantOffset=function(_,r,d=0){return(_-(2*Math.round(r)-d))%(2*Math.round(r))}},6052:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,r,d,f=!1){if(this.selectionStart=r,this.selectionEnd=d,!r||!d||r[0]===d[0]&&r[1]===d[1])return void this.clear();const u=_.buffers.active.ydisp,h=r[1]-u,i=d[1]-u,s=Math.max(h,0),e=Math.min(i,_.rows-1);s>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=h,this.viewportEndRow=i,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=r[0],this.endCol=d[0])}isCellSelected(_,r,d){return!!this.hasSelection&&(d-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&d>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d=this.startCol&&r=this.startCol)}}n.createSelectionRenderModel=function(){return new o}},456:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const r=o(2585),d=o(8460),f=o(844);let u=n.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new i(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};n.CharSizeService=u=c([_(2,r.IOptionsService)],u);class h extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,a){t!==void 0&&t>0&&a!==void 0&&a>0&&(this._result.width=t,this._result.height=a)}}class i extends h{constructor(t,a,g){super(),this._document=t,this._parentElement=a,this._optionsService=g,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class s extends h{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const a=this._ctx.measureText("W");if(!("width"in a&&"fontBoundingBoxAscent"in a&&"fontBoundingBoxDescent"in a))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(O,n,o){var c=this&&this.__decorate||function(s,e,t,a){var g,v=arguments.length,p=v<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(p=(v<3?g(p):v>3?g(e,t,p):g(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const r=o(3734),d=o(643),f=o(511),u=o(2585);class h extends r.AttributeData{constructor(e,t,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=h;let i=n.CharacterJoinerService=class mt{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t1){const x=this._getJoinedRanges(g,l,p,t,v);for(let w=0;w1){const k=this._getJoinedRanges(g,l,p,t,v);for(let x=0;x{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const c=o(844),_=o(8460),r=o(3656);class d extends c.Disposable{constructor(h,i,s){super(),this._textarea=h,this._window=i,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(h){this._window!==h&&(this._window=h,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}n.CoreBrowserService=d;class f extends c.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,r.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const c=o(844);class _ extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const f=this.linkProviders.indexOf(d);f!==-1&&this.linkProviders.splice(f,1)}}}}n.LinkProviderService=_},8934:function(O,n,o){var c=this&&this.__decorate||function(u,h,i,s){var e,t=arguments.length,a=t<3?h:s===null?s=Object.getOwnPropertyDescriptor(h,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(u,h,i,s);else for(var g=u.length-1;g>=0;g--)(e=u[g])&&(a=(t<3?e(a):t>3?e(h,i,a):e(h,i))||a);return t>3&&a&&Object.defineProperty(h,i,a),a},_=this&&this.__param||function(u,h){return function(i,s){h(i,s,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const r=o(4725),d=o(9806);let f=n.MouseService=class{constructor(u,h){this._renderService=u,this._charSizeService=h}getCoords(u,h,i,s,e){return(0,d.getCoords)(window,u,h,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(u,h){const i=(0,d.getCoordsRelativeToElement)(window,u,h);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};n.MouseService=f=c([_(0,r.IRenderService),_(1,r.ICharSizeService)],f)},3230:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const r=o(6193),d=o(4725),f=o(8460),u=o(844),h=o(7226),i=o(2585);let s=n.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,a,g,v,p,l,S){super(),this._rowCount=e,this._charSizeService=g,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new u.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new r.RenderDebouncer((E,k)=>this._renderRows(E,k),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(a.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(v.onDecorationRegistered(()=>this._fullRefresh())),this.register(v.onDecorationRemoved(()=>this._fullRefresh())),this.register(a.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(a.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register(S.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,t),this.register(l.onWindowChange(E=>this._registerIntersectionObserver(E,t)))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const a=new e.IntersectionObserver(g=>this._handleIntersectionChange(g[g.length-1]),{threshold:0});a.observe(t),this._observerDisposable.value=(0,u.toDisposable)(()=>a.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,a=!1){this._isPaused?this._needsFullRefresh=!0:(a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,a){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,t,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};n.RenderService=s=c([_(2,i.IOptionsService),_(3,d.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],s)},9312:function(O,n,o){var c=this&&this.__decorate||function(l,S,E,k){var x,w=arguments.length,B=w<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(l,S,E,k);else for(var I=l.length-1;I>=0;I--)(x=l[I])&&(B=(w<3?x(B):w>3?x(S,E,B):x(S,E))||B);return w>3&&B&&Object.defineProperty(S,E,B),B},_=this&&this.__param||function(l,S){return function(E,k){S(E,k,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const r=o(9806),d=o(9504),f=o(456),u=o(4725),h=o(8460),i=o(844),s=o(6114),e=o(4841),t=o(511),a=o(2585),g=" ",v=new RegExp(g,"g");let p=n.SelectionService=class extends i.Disposable{constructor(l,S,E,k,x,w,B,I,$){super(),this._element=l,this._screenElement=S,this._linkifier=E,this._bufferService=k,this._coreService=x,this._mouseService=w,this._optionsService=B,this._renderService=I,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(j=>this._handleTrim(j)),this.register(this._bufferService.buffers.onBufferActivate(j=>this._handleBufferActivate(j))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!l||!S||l[0]===S[0]&&l[1]===S[1])}get selectionText(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!l||!S)return"";const E=this._bufferService.buffer,k=[];if(this._activeSelectionMode===3){if(l[0]===S[0])return"";const x=l[0]x.replace(v," ")).join(s.isWindows?`\r
+WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=f=c([_(0,d.IBufferService),_(1,d.IOptionsService),_(2,d.IOscLinkService)],f)},6193:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const c=o(3614),_=o(3656),r=o(3551),d=o(9042),f=o(3730),u=o(1680),h=o(3107),i=o(5744),s=o(2950),e=o(1296),t=o(428),a=o(4269),g=o(5114),v=o(8934),p=o(3230),l=o(9312),S=o(4725),E=o(6731),k=o(8055),x=o(8969),w=o(8460),B=o(844),I=o(6114),$=o(8437),j=o(2584),W=o(7399),m=o(5941),b=o(9074),y=o(2585),L=o(5435),P=o(4567),U=o(779);class q extends x.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(A={}){super(A),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new B.MutableDisposable),this._onCursorMove=this.register(new w.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new w.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new w.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new w.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new w.EventEmitter),this._onBlur=this.register(new w.EventEmitter),this._onA11yCharEmitter=this.register(new w.EventEmitter),this._onA11yTabEmitter=this.register(new w.EventEmitter),this._onWillOpen=this.register(new w.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(b.DecorationService),this._instantiationService.setService(y.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(U.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((C,M)=>this.refresh(C,M))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(C=>this._reportWindowsOptions(C))),this.register(this._inputHandler.onColor(C=>this._handleColorEvent(C))),this.register((0,w.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,w.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,w.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(C=>this._afterResize(C.cols,C.rows))),this.register((0,B.toDisposable)(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}_handleColorEvent(A){if(this._themeService)for(const C of A){let M,H="";switch(C.index){case 256:M="foreground",H="10";break;case 257:M="background",H="11";break;case 258:M="cursor",H="12";break;default:M="ansi",H="4;"+C.index}switch(C.type){case 0:const z=k.color.toColorRGB(M==="ansi"?this._themeService.colors.ansi[C.index]:this._themeService.colors[M]);this.coreService.triggerDataEvent(`${j.C0.ESC}]${H};${(0,m.toRgbString)(z)}${j.C1_ESCAPED.ST}`);break;case 1:if(M==="ansi")this._themeService.modifyColors(N=>N.ansi[C.index]=k.channels.toColor(...C.color));else{const N=M;this._themeService.modifyColors(J=>J[N]=k.channels.toColor(...C.color))}break;case 2:this._themeService.restoreColor(C.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(A){A?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(P.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(A){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(j.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const A=this.buffer.ybase+this.buffer.y,C=this.buffer.lines.get(A);if(!C)return;const M=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,z=C.getWidth(M),N=this._renderService.dimensions.css.cell.width*z,J=this.buffer.y*this._renderService.dimensions.css.cell.height,se=M*this._renderService.dimensions.css.cell.width;this.textarea.style.left=se+"px",this.textarea.style.top=J+"px",this.textarea.style.width=N+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",C=>{this.hasSelection()&&(0,c.copyHandler)(C,this._selectionService)}));const A=C=>(0,c.handlePasteEvent)(C,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",A)),this.register((0,_.addDisposableDomListener)(this.element,"paste",A)),I.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",C=>{C.button===2&&(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",C=>{(0,c.rightClickHandler)(C,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",C=>{C.button===1&&(0,c.moveTextAreaUnderMouseCursor)(C,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",A=>this._keyUp(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",A=>this._keyDown(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",A=>this._keyPress(A),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",A=>this._compositionHelper.compositionupdate(A))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,_.addDisposableDomListener)(this.textarea,"input",A=>this._inputEvent(A),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(A){if(!A)throw new Error("Terminal requires a parent element.");if(A.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=A.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),A.appendChild(this.element);const C=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),C.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,_.addDisposableDomListener)(this.screenElement,"mousemove",M=>this.updateCursorStyle(M))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),C.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),I.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(g.CoreBrowserService,this.textarea,A.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",M=>this._handleTextAreaFocus(M))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(t.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(E.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(a.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(p.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(M=>this._onRender.fire(M))),this.onResize(M=>this._renderService.resize(M.cols,M.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(r.Linkifier,this.screenElement)),this.element.appendChild(C);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(u.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(M=>this.scrollLines(M.amount,M.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(M=>this.scrollLines(M.amount,M.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(M=>this._renderService.handleSelectionChanged(M.start,M.end,M.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(M=>{this.textarea.value=M,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(M=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(h.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",M=>this._selectionService.handleMouseDown(M))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(P.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",M=>this._handleScreenReaderModeOptionChange(M))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",M=>{!this._overviewRulerRenderer&&M&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(i.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(e.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const A=this,C=this.element;function M(N){const J=A._mouseService.getMouseReportCoords(N,A.screenElement);if(!J)return!1;let se,ee;switch(N.overrideType||N.type){case"mousemove":ee=32,N.buttons===void 0?(se=3,N.button!==void 0&&(se=N.button<3?N.button:3)):se=1&N.buttons?0:4&N.buttons?1:2&N.buttons?2:3;break;case"mouseup":ee=0,se=N.button<3?N.button:3;break;case"mousedown":ee=1,se=N.button<3?N.button:3;break;case"wheel":if(A._customWheelEventHandler&&A._customWheelEventHandler(N)===!1||A.viewport.getLinesScrolled(N)===0)return!1;ee=N.deltaY<0?0:1,se=4;break;default:return!1}return!(ee===void 0||se===void 0||se>4)&&A.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:se,action:ee,ctrl:N.ctrlKey,alt:N.altKey,shift:N.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},z={mouseup:N=>(M(N),N.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(N)),wheel:N=>(M(N),this.cancel(N,!0)),mousedrag:N=>{N.buttons&&M(N)},mousemove:N=>{N.buttons||M(N)}};this.register(this.coreMouseService.onProtocolChange(N=>{N?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(N)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&N?H.mousemove||(C.addEventListener("mousemove",z.mousemove),H.mousemove=z.mousemove):(C.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&N?H.wheel||(C.addEventListener("wheel",z.wheel,{passive:!1}),H.wheel=z.wheel):(C.removeEventListener("wheel",H.wheel),H.wheel=null),2&N?H.mouseup||(H.mouseup=z.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&N?H.mousedrag||(H.mousedrag=z.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(C,"mousedown",N=>{if(N.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(N))return M(N),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(N)})),this.register((0,_.addDisposableDomListener)(C,"wheel",N=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(N)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(N);if(J===0)return;const se=j.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(N.deltaY<0?"A":"B");let ee="";for(let le=0;le{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(N),this.cancel(N)},{passive:!0})),this.register((0,_.addDisposableDomListener)(C,"touchmove",N=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(N)?void 0:this.cancel(N)},{passive:!1}))}refresh(A,C){this._renderService?.refreshRows(A,C)}updateCursorStyle(A){this._selectionService?.shouldColumnSelect(A)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(A,C,M=0){M===1?(super.scrollLines(A,C,M),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(A)}paste(A){(0,c.paste)(A,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(A){this._customKeyEventHandler=A}attachCustomWheelEventHandler(A){this._customWheelEventHandler=A}registerLinkProvider(A){return this._linkProviderService.registerLinkProvider(A)}registerCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const C=this._characterJoinerService.register(A);return this.refresh(0,this.rows-1),C}deregisterCharacterJoiner(A){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(A)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(A){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)}registerDecoration(A){return this._decorationService.registerDecoration(A)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(A,C,M){this._selectionService.setSelection(A,C,M)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(A,C){this._selectionService?.selectLines(A,C)}_keyDown(A){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;const C=this.browser.isMac&&this.options.macOptionIsMeta&&A.altKey;if(!C&&!this._compositionHelper.keydown(A))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;C||A.key!=="Dead"&&A.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const M=(0,W.evaluateKeyboardEvent)(A,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),M.type===3||M.type===2){const H=this.rows-1;return this.scrollLines(M.type===2?-H:H),this.cancel(A,!0)}return M.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(M.cancel&&this.cancel(A,!0),!M.key||!!(A.key&&!A.ctrlKey&&!A.altKey&&!A.metaKey&&A.key.length===1&&A.key.charCodeAt(0)>=65&&A.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(M.key!==j.C0.ETX&&M.key!==j.C0.CR||(this.textarea.value=""),this._onKey.fire({key:M.key,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(M.key,!0),!this.optionsService.rawOptions.screenReaderMode||A.altKey||A.ctrlKey?this.cancel(A,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(A,C){const M=A.isMac&&!this.options.macOptionIsMeta&&C.altKey&&!C.ctrlKey&&!C.metaKey||A.isWindows&&C.altKey&&C.ctrlKey&&!C.metaKey||A.isWindows&&C.getModifierState("AltGraph");return C.type==="keypress"?M:M&&(!C.keyCode||C.keyCode>47)}_keyUp(A){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(C){return C.keyCode===16||C.keyCode===17||C.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A),this._keyPressHandled=!1)}_keyPress(A){let C;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)C=A.charCode;else if(A.which===null||A.which===void 0)C=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;C=A.which}return!(!C||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A)||(C=String.fromCharCode(C),this._onKey.fire({key:C,domEvent:A}),this._showCursor(),this.coreService.triggerDataEvent(C,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(A){if(A.data&&A.inputType==="insertText"&&(!A.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const C=A.data;return this.coreService.triggerDataEvent(C,!0),this.cancel(A),!0}return!1}resize(A,C){A!==this.cols||C!==this.rows?super.resize(A,C):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(A,C){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let A=1;A{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,_){this._rowCount=_,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=r-this._lastRefreshMs,f=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},f)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(O,n,o){var c=this&&this.__decorate||function(s,e,t,a){var g,v=arguments.length,p=v<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(p=(v<3?g(p):v>3?g(e,t,p):g(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const r=o(3656),d=o(4725),f=o(8460),u=o(844),h=o(2585);let i=n.Viewport=class extends u.Disposable{constructor(s,e,t,a,g,v,p,l){super(),this._viewportElement=s,this._scrollArea=e,this._bufferService=t,this._optionsService=a,this._charSizeService=g,this._renderService=v,this._coreBrowserService=p,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,r.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(S=>this._activeBuffer=S.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(S=>this._renderDimensions=S)),this._handleThemeChange(l.colors),this.register(l.onChangeColors(S=>this._handleThemeChange(S))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(s){this._viewportElement.style.backgroundColor=s.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(s){if(s)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const s=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==s&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=s),this._refreshAnimationFrame=null}syncScrollArea(s=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(s);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(s)}_handleScroll(s){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const e=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const s=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(s*(this._smoothScrollState.target-this._smoothScrollState.origin)),s<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(s,e){const t=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(e<0&&this._viewportElement.scrollTop!==0||e>0&&t0&&(t=k),a=""}}return{bufferElements:g,cursorElement:t}}getLinesScrolled(s){if(s.deltaY===0||s.shiftKey)return 0;let e=this._applyScrollModifier(s.deltaY,s);return s.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(e/=this._currentRowHeight+0,this._wheelPartialScroll+=e,e=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):s.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._bufferService.rows),e}_applyScrollModifier(s,e){const t=this._optionsService.rawOptions.fastScrollModifier;return t==="alt"&&e.altKey||t==="ctrl"&&e.ctrlKey||t==="shift"&&e.shiftKey?s*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:s*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(s){this._lastTouchY=s.touches[0].pageY}handleTouchMove(s){const e=this._lastTouchY-s.touches[0].pageY;return this._lastTouchY=s.touches[0].pageY,e!==0&&(this._viewportElement.scrollTop+=e,this._bubbleScroll(s,e))}};n.Viewport=i=c([_(2,h.IBufferService),_(3,h.IOptionsService),_(4,d.ICharSizeService),_(5,d.IRenderService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],i)},3107:function(O,n,o){var c=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,g=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,i,s,e);else for(var v=h.length-1;v>=0;v--)(t=h[v])&&(g=(a<3?t(g):a>3?t(i,s,g):t(i,s))||g);return a>3&&g&&Object.defineProperty(i,s,g),g},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const r=o(4725),d=o(844),f=o(2585);let u=n.BufferDecorationRenderer=class extends d.Disposable{constructor(h,i,s,e,t){super(),this._screenElement=h,this._bufferService=i,this._coreBrowserService=s,this._decorationService=e,this._renderService=t,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(a=>this._removeDecoration(a))),this.register((0,d.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const h of this._decorationService.decorations)this._renderDecoration(h);this._dimensionsChanged=!1}_renderDecoration(h){this._refreshStyle(h),this._dimensionsChanged&&this._refreshXPosition(h)}_createElement(h){const i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",h?.options?.layer==="top"),i.style.width=`${Math.round((h.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=(h.options.height||1)*this._renderService.dimensions.css.cell.height+"px",i.style.top=(h.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const s=h.options.x??0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(h,i),i}_refreshStyle(h){const i=h.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)h.element&&(h.element.style.display="none",h.onRenderEmitter.fire(h.element));else{let s=this._decorationElements.get(h);s||(s=this._createElement(h),h.element=s,this._decorationElements.set(h,s),this._container.appendChild(s),h.onDispose(()=>{this._decorationElements.delete(h),s.remove()})),s.style.top=i*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",h.onRenderEmitter.fire(s)}}_refreshXPosition(h,i=h.element){if(!i)return;const s=h.options.x??0;(h.options.anchor||"left")==="right"?i.style.right=s?s*this._renderService.dimensions.css.cell.width+"px":"":i.style.left=s?s*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(h){this._decorationElements.get(h)?.remove(),this._decorationElements.delete(h),h.dispose()}};n.BufferDecorationRenderer=u=c([_(1,f.IBufferService),_(2,r.ICoreBrowserService),_(3,f.IDecorationService),_(4,r.IRenderService)],u)},5871:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,_){return c>=o.startBufferLine-this._linePadding[_||"full"]&&c<=o.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(O,n,o){var c=this&&this.__decorate||function(t,a,g,v){var p,l=arguments.length,S=l<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,a,g,v);else for(var E=t.length-1;E>=0;E--)(p=t[E])&&(S=(l<3?p(S):l>3?p(a,g,S):p(a,g))||S);return l>3&&S&&Object.defineProperty(a,g,S),S},_=this&&this.__param||function(t,a){return function(g,v){a(g,v,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const r=o(5871),d=o(4725),f=o(844),u=o(2585),h={full:0,left:0,center:0,right:0},i={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let e=n.OverviewRulerRenderer=class extends f.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(t,a,g,v,p,l,S){super(),this._viewportElement=t,this._screenElement=a,this._bufferService=g,this._decorationService=v,this._renderService=p,this._optionsService=l,this._coreBrowserService=S,this._colorZoneStore=new r.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const E=this._canvas.getContext("2d");if(!E)throw new Error("Ctx cannot be null");this._ctx=E,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,f.toDisposable)(()=>{this._canvas?.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const t=Math.floor(this._canvas.width/3),a=Math.ceil(this._canvas.width/3);i.full=this._canvas.width,i.left=t,i.center=a,i.right=t,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=i.left,s.right=i.left+i.center}_refreshDrawHeightConstants(){h.full=Math.round(2*this._coreBrowserService.dpr);const t=this._canvas.height/this._bufferService.buffer.lines.length,a=Math.round(Math.max(Math.min(t,12),6)*this._coreBrowserService.dpr);h.left=a,h.center=a,h.right=a}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*h.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const a of this._decorationService.decorations)this._colorZoneStore.addDecoration(a);this._ctx.lineWidth=1;const t=this._colorZoneStore.zones;for(const a of t)a.position!=="full"&&this._renderColorZone(a);for(const a of t)a.position==="full"&&this._renderColorZone(a);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(t){this._ctx.fillStyle=t.color,this._ctx.fillRect(s[t.position||"full"],Math.round((this._canvas.height-1)*(t.startBufferLine/this._bufferService.buffers.active.lines.length)-h[t.position||"full"]/2),i[t.position||"full"],Math.round((this._canvas.height-1)*((t.endBufferLine-t.startBufferLine)/this._bufferService.buffers.active.lines.length)+h[t.position||"full"]))}_queueRefresh(t,a){this._shouldUpdateDimensions=t||this._shouldUpdateDimensions,this._shouldUpdateAnchor=a||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};n.OverviewRulerRenderer=e=c([_(2,u.IBufferService),_(3,u.IDecorationService),_(4,d.IRenderService),_(5,u.IOptionsService),_(6,d.ICoreBrowserService)],e)},2950:function(O,n,o){var c=this&&this.__decorate||function(h,i,s,e){var t,a=arguments.length,g=a<3?i:e===null?e=Object.getOwnPropertyDescriptor(i,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(h,i,s,e);else for(var v=h.length-1;v>=0;v--)(t=h[v])&&(g=(a<3?t(g):a>3?t(i,s,g):t(i,s))||g);return a>3&&g&&Object.defineProperty(i,s,g),g},_=this&&this.__param||function(h,i){return function(s,e){i(s,e,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const r=o(4725),d=o(2585),f=o(2584);let u=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(h,i,s,e,t,a){this._textarea=h,this._compositionView=i,this._bufferService=s,this._optionsService=e,this._coreService=t,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(h){this._compositionView.textContent=h.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(h){if(this._isComposing||this._isSendingComposition){if(h.keyCode===229||h.keyCode===16||h.keyCode===17||h.keyCode===18)return!1;this._finalizeComposition(!1)}return h.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(h){if(this._compositionView.classList.remove("active"),this._isComposing=!1,h){const i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,i.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(i.start,i.end):this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;const i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){const h=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const i=this._textarea.value,s=i.replace(h,"");this._dataAlreadySent=s,i.length>h.length?this._coreService.triggerDataEvent(s,!0):i.lengththis.updateCompositionElements(!0),0)}}};n.CompositionHelper=u=c([_(2,d.IBufferService),_(3,d.IOptionsService),_(4,d.ICoreService),_(5,r.IRenderService)],u)},9806:(O,n)=>{function o(c,_,r){const d=r.getBoundingClientRect(),f=c.getComputedStyle(r),u=parseInt(f.getPropertyValue("padding-left")),h=parseInt(f.getPropertyValue("padding-top"));return[_.clientX-d.left-u,_.clientY-d.top-h]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=o,n.getCoords=function(c,_,r,d,f,u,h,i,s){if(!u)return;const e=o(c,_,r);return e?(e[0]=Math.ceil((e[0]+(s?h/2:0))/h),e[1]=Math.ceil(e[1]/i),e[0]=Math.min(Math.max(e[0],1),d+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),f),e):void 0}},9504:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const c=o(2584);function _(i,s,e,t){const a=i-r(i,e),g=s-r(s,e),v=Math.abs(a-g)-function(p,l,S){let E=0;const k=p-r(p,S),x=l-r(l,S);for(let w=0;w=0&&is?"A":"B"}function f(i,s,e,t,a,g){let v=i,p=s,l="";for(;v!==e||p!==t;)v+=a?1:-1,a&&v>g.cols-1?(l+=g.buffer.translateBufferLineToString(p,!1,i,v),v=0,i=0,p++):!a&&v<0&&(l+=g.buffer.translateBufferLineToString(p,!1,0,i+1),v=g.cols-1,i=v,p--);return l+g.buffer.translateBufferLineToString(p,!1,i,v)}function u(i,s){const e=s?"O":"[";return c.C0.ESC+e+i}function h(i,s){i=Math.floor(i);let e="";for(let t=0;t0?k-r(k,x):S;const I=k,$=function(j,W,m,b,y,L){let P;return P=_(m,b,y,L).length>0?b-r(b,y):W,j=m&&Pi?"D":"C",h(Math.abs(a-i),u(v,t));v=g>s?"D":"C";const p=Math.abs(g-s);return h(function(l,S){return S.cols-l}(g>s?i:a,e)+(p-1)*e.cols+1+((g>s?a:i)-1),u(v,t))}},1296:function(O,n,o){var c=this&&this.__decorate||function(w,B,I,$){var j,W=arguments.length,m=W<3?B:$===null?$=Object.getOwnPropertyDescriptor(B,I):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(w,B,I,$);else for(var b=w.length-1;b>=0;b--)(j=w[b])&&(m=(W<3?j(m):W>3?j(B,I,m):j(B,I))||m);return W>3&&m&&Object.defineProperty(B,I,m),m},_=this&&this.__param||function(w,B){return function(I,$){B(I,$,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const r=o(3787),d=o(2550),f=o(2223),u=o(6171),h=o(6052),i=o(4725),s=o(8055),e=o(8460),t=o(844),a=o(2585),g="xterm-dom-renderer-owner-",v="xterm-rows",p="xterm-fg-",l="xterm-bg-",S="xterm-focus",E="xterm-selection";let k=1,x=n.DomRenderer=class extends t.Disposable{constructor(w,B,I,$,j,W,m,b,y,L,P,U,q){super(),this._terminal=w,this._document=B,this._element=I,this._screenElement=$,this._viewportElement=j,this._helperContainer=W,this._linkifier2=m,this._charSizeService=y,this._optionsService=L,this._bufferService=P,this._coreBrowserService=U,this._themeService=q,this._terminalClass=k++,this._rowElements=[],this._selectionRenderModel=(0,h.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new e.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(v),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(E),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,u.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(K=>this._injectCss(K))),this._injectCss(this._themeService.colors),this._rowFactory=b.createInstance(r.DomRendererRowFactory,document),this._element.classList.add(g+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(K=>this._handleLinkHover(K))),this.register(this._linkifier2.onHideLinkUnderline(K=>this._handleLinkLeave(K))),this.register((0,t.toDisposable)(()=>{this._element.classList.remove(g+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new d.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const w=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*w,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*w),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/w),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/w),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(w){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${v} { color: ${w.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${v} .xterm-dim { color: ${s.color.multiplyOpacity(w.foreground,.5).css};}`,B+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const I=`blink_underline_${this._terminalClass}`,$=`blink_bar_${this._terminalClass}`,j=`blink_block_${this._terminalClass}`;B+=`@keyframes ${I} { 50% { border-bottom-style: hidden; }}`,B+=`@keyframes ${$} { 50% { box-shadow: none; }}`,B+=`@keyframes ${j} { 0% { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css}; } 50% { background-color: inherit; color: ${w.cursor.css}; }}`,B+=`${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${j} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${w.cursor.css}; color: ${w.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${w.cursor.css} !important; color: ${w.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${w.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${w.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${w.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${E} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${E} div { position: absolute; background-color: ${w.selectionBackgroundOpaque.css};}${this._terminalSelector} .${E} div { position: absolute; background-color: ${w.selectionInactiveBackgroundOpaque.css};}`;for(const[W,m]of w.ansi.entries())B+=`${this._terminalSelector} .${p}${W} { color: ${m.css}; }${this._terminalSelector} .${p}${W}.xterm-dim { color: ${s.color.multiplyOpacity(m,.5).css}; }${this._terminalSelector} .${l}${W} { background-color: ${m.css}; }`;B+=`${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(w.background).css}; }${this._terminalSelector} .${p}${f.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${s.color.multiplyOpacity(s.color.opaque(w.background),.5).css}; }${this._terminalSelector} .${l}${f.INVERTED_DEFAULT_COLOR} { background-color: ${w.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const w=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${w}px`,this._rowFactory.defaultSpacing=w}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(w,B){for(let I=this._rowElements.length;I<=B;I++){const $=this._document.createElement("div");this._rowContainer.appendChild($),this._rowElements.push($)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(w,B){this._refreshRowElements(w,B),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(w,B,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(w,B,I),this.renderRows(0,this._bufferService.rows-1),!w||!B)return;this._selectionRenderModel.update(this._terminal,w,B,I);const $=this._selectionRenderModel.viewportStartRow,j=this._selectionRenderModel.viewportEndRow,W=this._selectionRenderModel.viewportCappedStartRow,m=this._selectionRenderModel.viewportCappedEndRow;if(W>=this._bufferService.rows||m<0)return;const b=this._document.createDocumentFragment();if(I){const y=w[0]>B[0];b.appendChild(this._createSelectionElement(W,y?B[0]:w[0],y?w[0]:B[0],m-W+1))}else{const y=$===W?w[0]:0,L=W===j?B[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(W,y,L));const P=m-W-1;if(b.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,P)),W!==m){const U=j===m?B[0]:this._bufferService.cols;b.appendChild(this._createSelectionElement(m,0,U))}}this._selectionContainer.appendChild(b)}_createSelectionElement(w,B,I,$=1){const j=this._document.createElement("div"),W=B*this.dimensions.css.cell.width;let m=this.dimensions.css.cell.width*(I-B);return W+m>this.dimensions.css.canvas.width&&(m=this.dimensions.css.canvas.width-W),j.style.height=$*this.dimensions.css.cell.height+"px",j.style.top=w*this.dimensions.css.cell.height+"px",j.style.left=`${W}px`,j.style.width=`${m}px`,j}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const w of this._rowElements)w.replaceChildren()}renderRows(w,B){const I=this._bufferService.buffer,$=I.ybase+I.y,j=Math.min(I.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=w;y<=B;y++){const L=y+I.ydisp,P=this._rowElements[y],U=I.lines.get(L);if(!P||!U)break;P.replaceChildren(...this._rowFactory.createRow(U,L,L===$,m,b,j,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${g}${this._terminalClass}`}_handleLinkHover(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!0)}_handleLinkLeave(w){this._setCellUnderline(w.x1,w.x2,w.y1,w.y2,w.cols,!1)}_setCellUnderline(w,B,I,$,j,W){I<0&&(w=0),$<0&&(B=0);const m=this._bufferService.rows-1;I=Math.max(Math.min(I,m),0),$=Math.max(Math.min($,m),0),j=Math.min(j,this._bufferService.cols);const b=this._bufferService.buffer,y=b.ybase+b.y,L=Math.min(b.x,j-1),P=this._optionsService.rawOptions.cursorBlink,U=this._optionsService.rawOptions.cursorStyle,q=this._optionsService.rawOptions.cursorInactiveStyle;for(let K=I;K<=$;++K){const A=K+b.ydisp,C=this._rowElements[K],M=b.lines.get(A);if(!C||!M)break;C.replaceChildren(...this._rowFactory.createRow(M,A,A===y,U,q,L,P,this.dimensions.css.cell.width,this._widthCache,W?K===I?w:0:-1,W?(K===$?B:j)-1:-1))}}};n.DomRenderer=x=c([_(7,a.IInstantiationService),_(8,i.ICharSizeService),_(9,a.IOptionsService),_(10,a.IBufferService),_(11,i.ICoreBrowserService),_(12,i.IThemeService)],x)},3787:function(O,n,o){var c=this&&this.__decorate||function(v,p,l,S){var E,k=arguments.length,x=k<3?p:S===null?S=Object.getOwnPropertyDescriptor(p,l):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(v,p,l,S);else for(var w=v.length-1;w>=0;w--)(E=v[w])&&(x=(k<3?E(x):k>3?E(p,l,x):E(p,l))||x);return k>3&&x&&Object.defineProperty(p,l,x),x},_=this&&this.__param||function(v,p){return function(l,S){p(l,S,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const r=o(2223),d=o(643),f=o(511),u=o(2585),h=o(8055),i=o(4725),s=o(4269),e=o(6171),t=o(3734);let a=n.DomRendererRowFactory=class{constructor(v,p,l,S,E,k,x){this._document=v,this._characterJoinerService=p,this._optionsService=l,this._coreBrowserService=S,this._coreService=E,this._decorationService=k,this._themeService=x,this._workCell=new f.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,p,l){this._selectionStart=v,this._selectionEnd=p,this._columnSelectMode=l}createRow(v,p,l,S,E,k,x,w,B,I,$){const j=[],W=this._characterJoinerService.getJoinedCharacters(p),m=this._themeService.colors;let b,y=v.getNoBgTrimmedLength();l&&y0&&J===W[0][0]){ee=!0;const ie=W.shift();V=new s.JoinedCellData(this._workCell,v.translateToString(!0,ie[0],ie[1]),ie[1]-ie[0]),le=ie[1]-1,se=V.getWidth()}const Ee=this._isCellInSelection(J,p),Me=l&&J===k,Oe=N&&J>=I&&J<=$;let Pe=!1;this._decorationService.forEachDecorationAtCell(J,p,void 0,ie=>{Pe=!0});let Ie=V.getChars()||d.WHITESPACE_CELL_CHAR;if(Ie===" "&&(V.isUnderline()||V.isOverline())&&(Ie=" "),H=se*w-B.get(Ie,V.isBold(),V.isItalic()),b){if(L&&(Ee&&M||!Ee&&!M&&V.bg===U)&&(Ee&&M&&m.selectionForeground||V.fg===q)&&V.extended.ext===K&&Oe===A&&H===C&&!Me&&!ee&&!Pe){V.isInvisible()?P+=d.WHITESPACE_CELL_CHAR:P+=Ie,L++;continue}L&&(b.textContent=P),b=this._document.createElement("span"),L=0,P=""}else b=this._document.createElement("span");if(U=V.bg,q=V.fg,K=V.extended.ext,A=Oe,C=H,M=Ee,ee&&k>=J&&k<=le&&(k=J),!this._coreService.isCursorHidden&&Me&&this._coreService.isCursorInitialized){if(z.push("xterm-cursor"),this._coreBrowserService.isFocused)x&&z.push("xterm-cursor-blink"),z.push(S==="bar"?"xterm-cursor-bar":S==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(E)switch(E){case"outline":z.push("xterm-cursor-outline");break;case"block":z.push("xterm-cursor-block");break;case"bar":z.push("xterm-cursor-bar");break;case"underline":z.push("xterm-cursor-underline")}}if(V.isBold()&&z.push("xterm-bold"),V.isItalic()&&z.push("xterm-italic"),V.isDim()&&z.push("xterm-dim"),P=V.isInvisible()?d.WHITESPACE_CELL_CHAR:V.getChars()||d.WHITESPACE_CELL_CHAR,V.isUnderline()&&(z.push(`xterm-underline-${V.extended.underlineStyle}`),P===" "&&(P=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${t.AttributeData.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let ie=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&ie<8&&(ie+=8),b.style.textDecorationColor=m.ansi[ie].css}V.isOverline()&&(z.push("xterm-overline"),P===" "&&(P=" ")),V.isStrikethrough()&&z.push("xterm-strikethrough"),Oe&&(b.style.textDecoration="underline");let de=V.getFgColor(),Re=V.getFgColorMode(),pe=V.getBgColor(),xe=V.getBgColorMode();const He=!!V.isInverse();if(He){const ie=de;de=pe,pe=ie;const $e=Re;Re=xe,xe=$e}let ge,ke,Ce,Le=!1;switch(this._decorationService.forEachDecorationAtCell(J,p,void 0,ie=>{ie.options.layer!=="top"&&Le||(ie.backgroundColorRGB&&(xe=50331648,pe=ie.backgroundColorRGB.rgba>>8&16777215,ge=ie.backgroundColorRGB),ie.foregroundColorRGB&&(Re=50331648,de=ie.foregroundColorRGB.rgba>>8&16777215,ke=ie.foregroundColorRGB),Le=ie.options.layer==="top")}),!Le&&Ee&&(ge=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,pe=ge.rgba>>8&16777215,xe=50331648,Le=!0,m.selectionForeground&&(Re=50331648,de=m.selectionForeground.rgba>>8&16777215,ke=m.selectionForeground)),Le&&z.push("xterm-decoration-top"),xe){case 16777216:case 33554432:Ce=m.ansi[pe],z.push(`xterm-bg-${pe}`);break;case 50331648:Ce=h.channels.toColor(pe>>16,pe>>8&255,255&pe),this._addStyle(b,`background-color:#${g((pe>>>0).toString(16),"0",6)}`);break;default:He?(Ce=m.foreground,z.push(`xterm-bg-${r.INVERTED_DEFAULT_COLOR}`)):Ce=m.background}switch(ge||V.isDim()&&(ge=h.color.multiplyOpacity(Ce,.5)),Re){case 16777216:case 33554432:V.isBold()&&de<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(de+=8),this._applyMinimumContrast(b,Ce,m.ansi[de],V,ge,void 0)||z.push(`xterm-fg-${de}`);break;case 50331648:const ie=h.channels.toColor(de>>16&255,de>>8&255,255&de);this._applyMinimumContrast(b,Ce,ie,V,ge,ke)||this._addStyle(b,`color:#${g(de.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(b,Ce,m.foreground,V,ge,ke)||He&&z.push(`xterm-fg-${r.INVERTED_DEFAULT_COLOR}`)}z.length&&(b.className=z.join(" "),z.length=0),Me||ee||Pe?b.textContent=P:L++,H!==this.defaultSpacing&&(b.style.letterSpacing=`${H}px`),j.push(b),J=le}return b&&L&&(b.textContent=P),j}_applyMinimumContrast(v,p,l,S,E,k){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.treatGlyphAsBackgroundColor)(S.getCode()))return!1;const x=this._getContrastCache(S);let w;if(E||k||(w=x.getColor(p.rgba,l.rgba)),w===void 0){const B=this._optionsService.rawOptions.minimumContrastRatio/(S.isDim()?2:1);w=h.color.ensureContrastRatio(E||p,k||l,B),x.setColor((E||p).rgba,(k||l).rgba,w??null)}return!!w&&(this._addStyle(v,`color:${w.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,p){v.setAttribute("style",`${v.getAttribute("style")||""}${p};`)}_isCellInSelection(v,p){const l=this._selectionStart,S=this._selectionEnd;return!(!l||!S)&&(this._columnSelectMode?l[0]<=S[0]?v>=l[0]&&p>=l[1]&&v=l[1]&&v>=S[0]&&p<=S[1]:p>l[1]&&p=l[0]&&v=l[0])}};function g(v,p,l){for(;v.length{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=o.createElement("span");_.classList.add("xterm-char-measure-element");const r=o.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";const d=o.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const f=o.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold",f.style.fontStyle="italic",this._measureElements=[_,r,d,f],this._container.appendChild(_),this._container.appendChild(r),this._container.appendChild(d),this._container.appendChild(f),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,_,r){o===this._font&&c===this._fontSize&&_===this._weight&&r===this._weightBold||(this._font=o,this._fontSize=c,this._weight=_,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(o,c,_){let r=0;if(!c&&!_&&o.length===1&&(r=o.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];const u=this._measure(o,0);return u>0&&(this._flat[r]=u),u}let d=o;c&&(d+="B"),_&&(d+="I");let f=this._holey.get(d);if(f===void 0){let u=0;c&&(u|=1),_&&(u|=2),f=this._measure(o,u),f>0&&this._holey.set(d,f)}return f}_measure(o,c){const _=this._measureElements[c];return _.textContent=o.repeat(32),_.offsetWidth/32}}},2223:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(O,n)=>{function o(_){return 57508<=_&&_<=57558}function c(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=o,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=c,n.allowRescaling=function(_,r,d,f){return r===1&&d>Math.ceil(1.5*f)&&_!==void 0&&_>255&&!c(_)&&!o(_)&&!function(u){return 57344<=u&&u<=63743}(_)},n.treatGlyphAsBackgroundColor=function(_){return o(_)||function(r){return 9472<=r&&r<=9631}(_)},n.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},n.computeNextVariantOffset=function(_,r,d=0){return(_-(2*Math.round(r)-d))%(2*Math.round(r))}},6052:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,r,d,f=!1){if(this.selectionStart=r,this.selectionEnd=d,!r||!d||r[0]===d[0]&&r[1]===d[1])return void this.clear();const u=_.buffers.active.ydisp,h=r[1]-u,i=d[1]-u,s=Math.max(h,0),e=Math.min(i,_.rows-1);s>=_.rows||e<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=f,this.viewportStartRow=h,this.viewportEndRow=i,this.viewportCappedStartRow=s,this.viewportCappedEndRow=e,this.startCol=r[0],this.endCol=d[0])}isCellSelected(_,r,d){return!!this.hasSelection&&(d-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?r>=this.startCol&&d>=this.viewportCappedStartRow&&r=this.viewportCappedStartRow&&r>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d=this.startCol&&r=this.startCol)}}n.createSelectionRenderModel=function(){return new o}},456:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const r=o(2585),d=o(8460),f=o(844);let u=n.CharSizeService=class extends f.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,a){super(),this._optionsService=a,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new s(this._optionsService))}catch{this._measureStrategy=this.register(new i(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};n.CharSizeService=u=c([_(2,r.IOptionsService)],u);class h extends f.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,a){t!==void 0&&t>0&&a!==void 0&&a>0&&(this._result.width=t,this._result.height=a)}}class i extends h{constructor(t,a,g){super(),this._document=t,this._parentElement=a,this._optionsService=g,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class s extends h{constructor(t){super(),this._optionsService=t,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const a=this._ctx.measureText("W");if(!("width"in a&&"fontBoundingBoxAscent"in a&&"fontBoundingBoxDescent"in a))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const t=this._ctx.measureText("W");return this._validateAndSet(t.width,t.fontBoundingBoxAscent+t.fontBoundingBoxDescent),this._result}}},4269:function(O,n,o){var c=this&&this.__decorate||function(s,e,t,a){var g,v=arguments.length,p=v<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(s,e,t,a);else for(var l=s.length-1;l>=0;l--)(g=s[l])&&(p=(v<3?g(p):v>3?g(e,t,p):g(e,t))||p);return v>3&&p&&Object.defineProperty(e,t,p),p},_=this&&this.__param||function(s,e){return function(t,a){e(t,a,s)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const r=o(3734),d=o(643),f=o(511),u=o(2585);class h extends r.AttributeData{constructor(e,t,a){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=a}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=h;let i=n.CharacterJoinerService=class dt{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new f.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t1){const x=this._getJoinedRanges(g,l,p,t,v);for(let w=0;w1){const k=this._getJoinedRanges(g,l,p,t,v);for(let x=0;x{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const c=o(844),_=o(8460),r=o(3656);class d extends c.Disposable{constructor(h,i,s){super(),this._textarea=h,this._window=i,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new f(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this.register((0,_.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(h){this._window!==h&&(this._window=h,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}n.CoreBrowserService=d;class f extends c.Disposable{constructor(h){super(),this._parentWindow=h,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)(()=>this.clearListener()))}setWindow(h){this._parentWindow=h,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,r.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const c=o(844);class _ extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const f=this.linkProviders.indexOf(d);f!==-1&&this.linkProviders.splice(f,1)}}}}n.LinkProviderService=_},8934:function(O,n,o){var c=this&&this.__decorate||function(u,h,i,s){var e,t=arguments.length,a=t<3?h:s===null?s=Object.getOwnPropertyDescriptor(h,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(u,h,i,s);else for(var g=u.length-1;g>=0;g--)(e=u[g])&&(a=(t<3?e(a):t>3?e(h,i,a):e(h,i))||a);return t>3&&a&&Object.defineProperty(h,i,a),a},_=this&&this.__param||function(u,h){return function(i,s){h(i,s,u)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const r=o(4725),d=o(9806);let f=n.MouseService=class{constructor(u,h){this._renderService=u,this._charSizeService=h}getCoords(u,h,i,s,e){return(0,d.getCoords)(window,u,h,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,e)}getMouseReportCoords(u,h){const i=(0,d.getCoordsRelativeToElement)(window,u,h);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};n.MouseService=f=c([_(0,r.IRenderService),_(1,r.ICharSizeService)],f)},3230:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const r=o(6193),d=o(4725),f=o(8460),u=o(844),h=o(7226),i=o(2585);let s=n.RenderService=class extends u.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,a,g,v,p,l,S){super(),this._rowCount=e,this._charSizeService=g,this._renderer=this.register(new u.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._observerDisposable=this.register(new u.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new f.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new f.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new f.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new f.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new r.RenderDebouncer((E,k)=>this._renderRows(E,k),l),this.register(this._renderDebouncer),this.register(l.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(p.onResize(()=>this._fullRefresh())),this.register(p.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this.register(a.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(v.onDecorationRegistered(()=>this._fullRefresh())),this.register(v.onDecorationRemoved(()=>this._fullRefresh())),this.register(a.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(p.cols,p.rows),this._fullRefresh()})),this.register(a.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(p.buffer.y,p.buffer.y,!0))),this.register(S.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(l.window,t),this.register(l.onWindowChange(E=>this._registerIntersectionObserver(E,t)))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const a=new e.IntersectionObserver(g=>this._handleIntersectionChange(g[g.length-1]),{threshold:0});a.observe(t),this._observerDisposable.value=(0,u.toDisposable)(()=>a.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,a=!1){this._isPaused?this._needsFullRefresh=!0:(a||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,a){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=a,this._renderer.value?.handleSelectionChanged(e,t,a)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};n.RenderService=s=c([_(2,i.IOptionsService),_(3,d.ICharSizeService),_(4,i.IDecorationService),_(5,i.IBufferService),_(6,d.ICoreBrowserService),_(7,d.IThemeService)],s)},9312:function(O,n,o){var c=this&&this.__decorate||function(l,S,E,k){var x,w=arguments.length,B=w<3?S:k===null?k=Object.getOwnPropertyDescriptor(S,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(l,S,E,k);else for(var I=l.length-1;I>=0;I--)(x=l[I])&&(B=(w<3?x(B):w>3?x(S,E,B):x(S,E))||B);return w>3&&B&&Object.defineProperty(S,E,B),B},_=this&&this.__param||function(l,S){return function(E,k){S(E,k,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const r=o(9806),d=o(9504),f=o(456),u=o(4725),h=o(8460),i=o(844),s=o(6114),e=o(4841),t=o(511),a=o(2585),g=" ",v=new RegExp(g,"g");let p=n.SelectionService=class extends i.Disposable{constructor(l,S,E,k,x,w,B,I,$){super(),this._element=l,this._screenElement=S,this._linkifier=E,this._bufferService=k,this._coreService=x,this._mouseService=w,this._optionsService=B,this._renderService=I,this._coreBrowserService=$,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new t.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new h.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new h.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new h.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new h.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=j=>this._handleMouseMove(j),this._mouseUpListener=j=>this._handleMouseUp(j),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(j=>this._handleTrim(j)),this.register(this._bufferService.buffers.onBufferActivate(j=>this._handleBufferActivate(j))),this.enable(),this._model=new f.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,i.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!l||!S||l[0]===S[0]&&l[1]===S[1])}get selectionText(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!l||!S)return"";const E=this._bufferService.buffer,k=[];if(this._activeSelectionMode===3){if(l[0]===S[0])return"";const x=l[0]x.replace(v," ")).join(s.isWindows?`\r
`:`
-`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const S=this._getMouseBufferCoords(l),E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(E&&k&&S)&&this._areCoordsInSelection(S,E,k)}isCellInSelection(l,S){const E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!E||!k)&&this._areCoordsInSelection([l,S],E,k)}_areCoordsInSelection(l,S,E){return l[1]>S[1]&&l[1]=S[0]&&l[0]=S[0]}_selectWordAtCursor(l,S){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(l);return!!k&&(this._selectWordAt(k,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,S){this._model.clearSelection(),l=Math.max(l,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const S=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(l){let S=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=E?0:(S>E&&(S-=E),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(l){return s.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const S=this._getMouseBufferCoords(l);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(l){return l.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const S=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const k=(0,d.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,E=!(!l||!S||l[0]===S[0]&&l[1]===S[1]);E?l&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,S,E)):this._oldHasSelection&&this._fireOnSelectionChange(l,S,E)}_fireOnSelectionChange(l,S,E){this._oldSelectionStart=l,this._oldSelectionEnd=S,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(S=>this._handleTrim(S))}_convertViewportColToCharacterIndex(l,S){let E=S;for(let k=0;S>=k;k++){const x=l.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:x>1&&S!==k&&(E+=x-1)}return E}setSelection(l,S,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,S],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,S,E=!0,k=!0){if(l[0]>=this._bufferService.cols)return;const x=this._bufferService.buffer,w=x.lines.get(l[1]);if(!w)return;const B=x.translateBufferLineToString(l[1],!1);let I=this._convertViewportColToCharacterIndex(w,l[0]),$=I;const j=l[0]-I;let W=0,m=0,b=0,y=0;if(B.charAt(I)===" "){for(;I>0&&B.charAt(I-1)===" ";)I--;for(;$1&&(y+=K-1,$+=K-1);U>0&&I>0&&!this._isCharWordSeparator(w.loadCell(U-1,this._workCell));){w.loadCell(U-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,U--):A>1&&(b+=A-1,I-=A-1),I--,U--}for(;q1&&(y+=A-1,$+=A-1),$++,q++}}$++;let D=I+j-W+b,P=Math.min(this._bufferService.cols,$-I+W+m-b-y);if(S||B.slice(I,$).trim()!==""){if(E&&D===0&&w.getCodePoint(0)!==32){const U=x.lines.get(l[1]-1);if(U&&w.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(q){const K=this._bufferService.cols-q.start;D-=K,P+=K}}}if(k&&D+P===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const U=x.lines.get(l[1]+1);if(U?.isWrapped&&U.getCodePoint(0)!==32){const q=this._getWordAt([0,l[1]+1],!1,!1,!0);q&&(P+=q.length)}}return{start:D,length:P}}}_selectWordAt(l,S){const E=this._getWordAt(l,S);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[E.start,l[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(l){const S=this._getWordAt(l,!0);if(S){let E=l[1];for(;S.start<0;)S.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,E]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const S=this._bufferService.buffer.getWrappedRangeForLine(l),E={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};n.SelectionService=p=c([_(3,a.IBufferService),_(4,a.ICoreService),_(5,u.IMouseService),_(6,a.IOptionsService),_(7,u.IRenderService),_(8,u.ICoreBrowserService)],p)},4725:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const c=o(8343);n.ICharSizeService=(0,c.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),n.IMouseService=(0,c.createDecorator)("MouseService"),n.IRenderService=(0,c.createDecorator)("RenderService"),n.ISelectionService=(0,c.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,c.createDecorator)("ThemeService"),n.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(O,n,o){var c=this&&this.__decorate||function(p,l,S,E){var k,x=arguments.length,w=x<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,l,S,E);else for(var B=p.length-1;B>=0;B--)(k=p[B])&&(w=(x<3?k(w):x>3?k(l,S,w):k(l,S))||w);return x>3&&w&&Object.defineProperty(l,S,w),w},_=this&&this.__param||function(p,l){return function(S,E){l(S,E,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const r=o(7239),d=o(8055),f=o(8460),u=o(844),h=o(2585),i=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),t=d.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let S=0;S<216;S++){const E=l[S/36%6|0],k=l[S/6%6|0],x=l[S%6];p.push({css:d.channels.toCss(E,k,x),rgba:d.channels.toRgba(E,k,x)})}for(let S=0;S<24;S++){const E=8+10*S;p.push({css:d.channels.toCss(E,E,E),rgba:d.channels.toRgba(E,E,E)})}return p})());let g=n.ThemeService=class extends u.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new r.ColorContrastCache,this._halfContrastCache=new r.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:d.color.blend(s,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:d.color.blend(s,a),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(p={}){const l=this._colors;if(l.foreground=v(p.foreground,i),l.background=v(p.background,s),l.cursor=v(p.cursor,e),l.cursorAccent=v(p.cursorAccent,t),l.selectionBackgroundTransparent=v(p.selectionBackground,a),l.selectionBackgroundOpaque=d.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=v(p.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=d.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=p.selectionForeground?v(p.selectionForeground,d.NULL_COLOR):void 0,l.selectionForeground===d.NULL_COLOR&&(l.selectionForeground=void 0),d.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=d.color.opacity(l.selectionBackgroundTransparent,.3)),d.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=d.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=n.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=v(p.black,n.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=v(p.red,n.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=v(p.green,n.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=v(p.yellow,n.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=v(p.blue,n.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=v(p.magenta,n.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=v(p.cyan,n.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=v(p.white,n.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=v(p.brightBlack,n.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=v(p.brightRed,n.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=v(p.brightGreen,n.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=v(p.brightYellow,n.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=v(p.brightBlue,n.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=v(p.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=v(p.brightCyan,n.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=v(p.brightWhite,n.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const S=Math.min(l.ansi.length-16,p.extendedAnsi.length);for(let E=0;E{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const c=o(8460),_=o(844);class r extends _.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;const u=new Array(f);for(let h=0;hthis._length)for(let u=this._length;u=f;i--)this._array[this._getCyclicIndex(i+h.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;ithis._maxLength){const i=this._length+h.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=h.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,u,h){if(!(u<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let s=u-1;s>=0;s--)this.set(f+s+h,this.get(f+s));const i=f+u+h-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function o(c,_=5){if(typeof c!="object")return c;const r=Array.isArray(c)?[]:{};for(const d in c)r[d]=_<=1?c[d]:c[d]&&o(c[d],_-1);return r}},8055:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let o=0,c=0,_=0,r=0;var d,f,u,h,i;function s(t){const a=t.toString(16);return a.length<2?"0"+a:a}function e(t,a){return t>>0},t.toColor=function(a,g,v,p){return{css:t.toCss(a,g,v,p),rgba:t.toRgba(a,g,v,p)}}}(d||(n.channels=d={})),function(t){function a(g,v){return r=Math.round(255*v),[o,c,_]=i.toChannels(g.rgba),{css:d.toCss(o,c,_,r),rgba:d.toRgba(o,c,_,r)}}t.blend=function(g,v){if(r=(255&v.rgba)/255,r===1)return{css:v.css,rgba:v.rgba};const p=v.rgba>>24&255,l=v.rgba>>16&255,S=v.rgba>>8&255,E=g.rgba>>24&255,k=g.rgba>>16&255,x=g.rgba>>8&255;return o=E+Math.round((p-E)*r),c=k+Math.round((l-k)*r),_=x+Math.round((S-x)*r),{css:d.toCss(o,c,_),rgba:d.toRgba(o,c,_)}},t.isOpaque=function(g){return(255&g.rgba)==255},t.ensureContrastRatio=function(g,v,p){const l=i.ensureContrastRatio(g.rgba,v.rgba,p);if(l)return d.toColor(l>>24&255,l>>16&255,l>>8&255)},t.opaque=function(g){const v=(255|g.rgba)>>>0;return[o,c,_]=i.toChannels(v),{css:d.toCss(o,c,_),rgba:v}},t.opacity=a,t.multiplyOpacity=function(g,v){return r=255&g.rgba,a(g,r*v/255)},t.toColorRGB=function(g){return[g.rgba>>24&255,g.rgba>>16&255,g.rgba>>8&255]}}(f||(n.color=f={})),function(t){let a,g;try{const v=document.createElement("canvas");v.width=1,v.height=1;const p=v.getContext("2d",{willReadFrequently:!0});p&&(a=p,a.globalCompositeOperation="copy",g=a.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return o=parseInt(v.slice(1,2).repeat(2),16),c=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),d.toColor(o,c,_);case 5:return o=parseInt(v.slice(1,2).repeat(2),16),c=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),r=parseInt(v.slice(4,5).repeat(2),16),d.toColor(o,c,_,r);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const p=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return o=parseInt(p[1]),c=parseInt(p[2]),_=parseInt(p[3]),r=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),d.toColor(o,c,_,r);if(!a||!g)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=g,a.fillStyle=v,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,c,_,r]=a.getImageData(0,0,1,1).data,r!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(o,c,_,r),css:v}}}(u||(n.css=u={})),function(t){function a(g,v,p){const l=g/255,S=v/255,E=p/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}t.relativeLuminance=function(g){return a(g>>16&255,g>>8&255,255&g)},t.relativeLuminance2=a}(h||(n.rgb=h={})),function(t){function a(v,p,l){const S=v>>24&255,E=v>>16&255,k=v>>8&255;let x=p>>24&255,w=p>>16&255,B=p>>8&255,I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));for(;I0||w>0||B>0);)x-=Math.max(0,Math.ceil(.1*x)),w-=Math.max(0,Math.ceil(.1*w)),B-=Math.max(0,Math.ceil(.1*B)),I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));return(x<<24|w<<16|B<<8|255)>>>0}function g(v,p,l){const S=v>>24&255,E=v>>16&255,k=v>>8&255;let x=p>>24&255,w=p>>16&255,B=p>>8&255,I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));for(;I>>0}t.blend=function(v,p){if(r=(255&p)/255,r===1)return p;const l=p>>24&255,S=p>>16&255,E=p>>8&255,k=v>>24&255,x=v>>16&255,w=v>>8&255;return o=k+Math.round((l-k)*r),c=x+Math.round((S-x)*r),_=w+Math.round((E-w)*r),d.toRgba(o,c,_)},t.ensureContrastRatio=function(v,p,l){const S=h.relativeLuminance(v>>8),E=h.relativeLuminance(p>>8);if(e(S,E)>8));if(Be(S,h.relativeLuminance(I>>8))?w:I}return w}const k=g(v,p,l),x=e(S,h.relativeLuminance(k>>8));if(xe(S,h.relativeLuminance(w>>8))?k:w}return k}},t.reduceLuminance=a,t.increaseLuminance=g,t.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}}(i||(n.rgba=i={})),n.toPaddedHex=s,n.contrastRatio=e},8969:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const c=o(844),_=o(2585),r=o(4348),d=o(7866),f=o(744),u=o(7302),h=o(6975),i=o(8460),s=o(1753),e=o(1480),t=o(7994),a=o(9282),g=o(5435),v=o(5981),p=o(2660);let l=!1;class S extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event(k=>{this._onScrollApi?.fire(k.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(k){for(const x in k)this.optionsService.options[x]=k[x]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new r.InstantiationService,this.optionsService=this.register(new u.OptionsService(k)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new v.WriteBuffer((x,w)=>this._inputHandler.parse(x,w))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,x){this._writeBuffer.write(k,x)}writeSync(k,x){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(k,x)}input(k,x=!0){this.coreService.triggerDataEvent(k,x)}resize(k,x){isNaN(k)||isNaN(x)||(k=Math.max(k,f.MINIMUM_COLS),x=Math.max(x,f.MINIMUM_ROWS),this._bufferService.resize(k,x))}scroll(k,x=!1){this._bufferService.scroll(k,x)}scrollLines(k,x,w){this._bufferService.scrollLines(k,x,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const x=k-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)}registerEscHandler(k,x){return this._inputHandler.registerEscHandler(k,x)}registerDcsHandler(k,x){return this._inputHandler.registerDcsHandler(k,x)}registerCsiHandler(k,x){return this._inputHandler.registerCsiHandler(k,x)}registerOscHandler(k,x){return this._inputHandler.registerOscHandler(k,x)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const x=this.optionsService.rawOptions.windowsPty;x&&x.buildNumber!==void 0&&x.buildNumber!==void 0?k=x.backend==="conpty"&&x.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const x of k)x.dispose()})}}}n.CoreTerminal=S},8460:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(_))},n.runAndSubscribe=function(o,c){return c(void 0),o(_=>c(_))}},5435:function(O,n,o){var c=this&&this.__decorate||function(W,m,b,y){var D,P=arguments.length,U=P<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(W,m,b,y);else for(var q=W.length-1;q>=0;q--)(D=W[q])&&(U=(P<3?D(U):P>3?D(m,b,U):D(m,b))||U);return P>3&&U&&Object.defineProperty(m,b,U),U},_=this&&this.__param||function(W,m){return function(b,y){m(b,y,W)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const r=o(2584),d=o(7116),f=o(2015),u=o(844),h=o(482),i=o(8437),s=o(8460),e=o(643),t=o(511),a=o(3734),g=o(2585),v=o(1480),p=o(6242),l=o(6351),S=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function x(W,m){if(W>24)return m.setWinLines||!1;switch(W){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var w;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(n.WindowsOptionsReportType=w={}));let B=0;class I extends u.Disposable{getAttrData(){return this._curAttrData}constructor(m,b,y,D,P,U,q,K,A=new f.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=y,this._logService=D,this._optionsService=P,this._oscLinkService=U,this._coreMouseService=q,this._unicodeService=K,this._parser=A,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>this._activeBuffer=C.activeBuffer)),this._parser.setCsiHandlerFallback((C,M)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:M.toArray()})}),this._parser.setEscHandlerFallback(C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})}),this._parser.setExecuteHandlerFallback(C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})}),this._parser.setOscHandlerFallback((C,M,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:M,data:H})}),this._parser.setDcsHandlerFallback((C,M,H)=>{M==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:M,payload:H})}),this._parser.setPrintHandler((C,M,H)=>this.print(C,M,H)),this._parser.registerCsiHandler({final:"@"},C=>this.insertChars(C)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},C=>this.scrollLeft(C)),this._parser.registerCsiHandler({final:"A"},C=>this.cursorUp(C)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},C=>this.scrollRight(C)),this._parser.registerCsiHandler({final:"B"},C=>this.cursorDown(C)),this._parser.registerCsiHandler({final:"C"},C=>this.cursorForward(C)),this._parser.registerCsiHandler({final:"D"},C=>this.cursorBackward(C)),this._parser.registerCsiHandler({final:"E"},C=>this.cursorNextLine(C)),this._parser.registerCsiHandler({final:"F"},C=>this.cursorPrecedingLine(C)),this._parser.registerCsiHandler({final:"G"},C=>this.cursorCharAbsolute(C)),this._parser.registerCsiHandler({final:"H"},C=>this.cursorPosition(C)),this._parser.registerCsiHandler({final:"I"},C=>this.cursorForwardTab(C)),this._parser.registerCsiHandler({final:"J"},C=>this.eraseInDisplay(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},C=>this.eraseInDisplay(C,!0)),this._parser.registerCsiHandler({final:"K"},C=>this.eraseInLine(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},C=>this.eraseInLine(C,!0)),this._parser.registerCsiHandler({final:"L"},C=>this.insertLines(C)),this._parser.registerCsiHandler({final:"M"},C=>this.deleteLines(C)),this._parser.registerCsiHandler({final:"P"},C=>this.deleteChars(C)),this._parser.registerCsiHandler({final:"S"},C=>this.scrollUp(C)),this._parser.registerCsiHandler({final:"T"},C=>this.scrollDown(C)),this._parser.registerCsiHandler({final:"X"},C=>this.eraseChars(C)),this._parser.registerCsiHandler({final:"Z"},C=>this.cursorBackwardTab(C)),this._parser.registerCsiHandler({final:"`"},C=>this.charPosAbsolute(C)),this._parser.registerCsiHandler({final:"a"},C=>this.hPositionRelative(C)),this._parser.registerCsiHandler({final:"b"},C=>this.repeatPrecedingCharacter(C)),this._parser.registerCsiHandler({final:"c"},C=>this.sendDeviceAttributesPrimary(C)),this._parser.registerCsiHandler({prefix:">",final:"c"},C=>this.sendDeviceAttributesSecondary(C)),this._parser.registerCsiHandler({final:"d"},C=>this.linePosAbsolute(C)),this._parser.registerCsiHandler({final:"e"},C=>this.vPositionRelative(C)),this._parser.registerCsiHandler({final:"f"},C=>this.hVPosition(C)),this._parser.registerCsiHandler({final:"g"},C=>this.tabClear(C)),this._parser.registerCsiHandler({final:"h"},C=>this.setMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"h"},C=>this.setModePrivate(C)),this._parser.registerCsiHandler({final:"l"},C=>this.resetMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"l"},C=>this.resetModePrivate(C)),this._parser.registerCsiHandler({final:"m"},C=>this.charAttributes(C)),this._parser.registerCsiHandler({final:"n"},C=>this.deviceStatus(C)),this._parser.registerCsiHandler({prefix:"?",final:"n"},C=>this.deviceStatusPrivate(C)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},C=>this.softReset(C)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},C=>this.setCursorStyle(C)),this._parser.registerCsiHandler({final:"r"},C=>this.setScrollRegion(C)),this._parser.registerCsiHandler({final:"s"},C=>this.saveCursor(C)),this._parser.registerCsiHandler({final:"t"},C=>this.windowOptions(C)),this._parser.registerCsiHandler({final:"u"},C=>this.restoreCursor(C)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},C=>this.insertColumns(C)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},C=>this.deleteColumns(C)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},C=>this.selectProtected(C)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},C=>this.requestMode(C,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},C=>this.requestMode(C,!1)),this._parser.setExecuteHandler(r.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(r.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(r.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(r.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(r.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(r.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(r.C1.IND,()=>this.index()),this._parser.setExecuteHandler(r.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(r.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new p.OscHandler(C=>(this.setTitle(C),this.setIconName(C),!0))),this._parser.registerOscHandler(1,new p.OscHandler(C=>this.setIconName(C))),this._parser.registerOscHandler(2,new p.OscHandler(C=>this.setTitle(C))),this._parser.registerOscHandler(4,new p.OscHandler(C=>this.setOrReportIndexedColor(C))),this._parser.registerOscHandler(8,new p.OscHandler(C=>this.setHyperlink(C))),this._parser.registerOscHandler(10,new p.OscHandler(C=>this.setOrReportFgColor(C))),this._parser.registerOscHandler(11,new p.OscHandler(C=>this.setOrReportBgColor(C))),this._parser.registerOscHandler(12,new p.OscHandler(C=>this.setOrReportCursorColor(C))),this._parser.registerOscHandler(104,new p.OscHandler(C=>this.restoreIndexedColor(C))),this._parser.registerOscHandler(110,new p.OscHandler(C=>this.restoreFgColor(C))),this._parser.registerOscHandler(111,new p.OscHandler(C=>this.restoreBgColor(C))),this._parser.registerOscHandler(112,new p.OscHandler(C=>this.restoreCursorColor(C))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},()=>this.selectCharset("("+C)),this._parser.registerEscHandler({intermediates:")",final:C},()=>this.selectCharset(")"+C)),this._parser.registerEscHandler({intermediates:"*",final:C},()=>this.selectCharset("*"+C)),this._parser.registerEscHandler({intermediates:"+",final:C},()=>this.selectCharset("+"+C)),this._parser.registerEscHandler({intermediates:"-",final:C},()=>this.selectCharset("-"+C)),this._parser.registerEscHandler({intermediates:".",final:C},()=>this.selectCharset("."+C)),this._parser.registerEscHandler({intermediates:"/",final:C},()=>this.selectCharset("/"+C));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(C=>(this._logService.error("Parsing error: ",C),C)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((C,M)=>this.requestStatusString(C,M)))}_preserveStack(m,b,y,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=y,this._parseStack.position=D}_logSlowResolvingAsync(m){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([m,new Promise((b,y)=>setTimeout(()=>y("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,b){let y,D=this._activeBuffer.x,P=this._activeBuffer.y,U=0;const q=this._parseStack.paused;if(q){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(y),y;D=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>k&&(U=this._parseStack.position+k)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,C=>String.fromCharCode(C)).join("")}"`),typeof m=="string"?m.split("").map(C=>C.charCodeAt(0)):m),this._parseBuffer.lengthk)for(let C=U;C0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,M);let z=this._parser.precedingJoinState;for(let N=b;NK){if(A){const ce=H;let V=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&H instanceof i.BufferLine&&H.copyCellsFrom(ce,V,0,ee,!1);V=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}else if(C&&(H.insertCells(this._activeBuffer.x,P-ee,this._activeBuffer.getNullCell(M)),H.getWidth(K-1)===2&&H.setCellFromCodepoint(K-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,M)),H.setCellFromCodepoint(this._activeBuffer.x++,D,P,M),P>0)for(;--P;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}this._parser.precedingJoinState=z,this._activeBuffer.x0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,M),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,y=>!x(y.params[0],this._optionsService.rawOptions.windowOptions)||b(y))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new l.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new p.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);m.hasWidth(this._activeBuffer.x)&&!m.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(m,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,y,D=!1,P=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);U.replaceCells(b,y,this._activeBuffer.getNullCell(this._eraseAttrData()),P),D&&(U.isWrapped=!1)}_resetBufferLine(m,b=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),y.isWrapped=!1)}eraseInDisplay(m,b=!1){let y;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);y=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let A=K;for(let C=1;C0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(r.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(r.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(r.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(r.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(r.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;bse?1:2,z=m.params[0];return N=z,J=b?z===2?4:z===4?H(U.modes.insertMode):z===12?3:z===20?H(M.convertEol):0:z===1?H(y.applicationCursorKeys):z===3?M.windowOptions.setWinLines?K===80?2:K===132?1:0:0:z===6?H(y.origin):z===7?H(y.wraparound):z===8?3:z===9?H(D==="X10"):z===12?H(M.cursorBlink):z===25?H(!U.isCursorHidden):z===45?H(y.reverseWraparound):z===66?H(y.applicationKeypad):z===67?4:z===1e3?H(D==="VT200"):z===1002?H(D==="DRAG"):z===1003?H(D==="ANY"):z===1004?H(y.sendFocus):z===1005?4:z===1006?H(P==="SGR"):z===1015?4:z===1016?H(P==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?H(A===C):z===2004?H(y.bracketedPasteMode):0,U.triggerDataEvent(`${r.C0.ESC}[${b?"":"?"}${N};${J}$y`),!0;var N,J}_updateAttrColor(m,b,y,D,P){return b===2?(m|=50331648,m&=-16777216,m|=a.AttributeData.fromColorRGB([y,D,P])):b===5&&(m&=-50331904,m|=33554432|255&y),m}_extractColor(m,b,y){const D=[0,0,-1,0,0,0];let P=0,U=0;do{if(D[U+P]=m.params[b+U],m.hasSubParams(b+U)){const q=m.getSubParams(b+U);let K=0;do D[1]===5&&(P=1),D[U+K+1+P]=q[K];while(++K=2||D[1]===2&&U+P>=5)break;D[1]&&(P=1)}while(++U+b5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(m){m.fg=i.DEFAULT_ATTR_DATA.fg,m.bg=i.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=m.length;let y;const D=this._curAttrData;for(let P=0;P=30&&y<=37?(D.fg&=-50331904,D.fg|=16777216|y-30):y>=40&&y<=47?(D.bg&=-50331904,D.bg|=16777216|y-40):y>=90&&y<=97?(D.fg&=-50331904,D.fg|=16777224|y-90):y>=100&&y<=107?(D.bg&=-50331904,D.bg|=16777224|y-100):y===0?this._processSGR0(D):y===1?D.fg|=134217728:y===3?D.bg|=67108864:y===4?(D.fg|=268435456,this._processUnderline(m.hasSubParams(P)?m.getSubParams(P)[0]:1,D)):y===5?D.fg|=536870912:y===7?D.fg|=67108864:y===8?D.fg|=1073741824:y===9?D.fg|=2147483648:y===2?D.bg|=134217728:y===21?this._processUnderline(2,D):y===22?(D.fg&=-134217729,D.bg&=-134217729):y===23?D.bg&=-67108865:y===24?(D.fg&=-268435457,this._processUnderline(0,D)):y===25?D.fg&=-536870913:y===27?D.fg&=-67108865:y===28?D.fg&=-1073741825:y===29?D.fg&=2147483647:y===39?(D.fg&=-67108864,D.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):y===49?(D.bg&=-67108864,D.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?P+=this._extractColor(m,P,D):y===53?D.bg|=1073741824:y===55?D.bg&=-1073741825:y===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):y===100?(D.fg&=-67108864,D.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${r.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${r.C0.ESC}[${b};${y}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${r.C0.ESC}[?${b};${y}R`)}return!0}softReset(m){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(m){const b=m.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=b%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(m){const b=m.params[0]||1;let y;return(m.length<2||(y=m.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(m){if(!x(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${r.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(m){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],y=m.split(";");for(;y.length>1;){const D=y.shift(),P=y.shift();if(/^\d+$/.exec(D)){const U=parseInt(D);if(j(U))if(P==="?")b.push({type:0,index:U});else{const q=(0,S.parseColor)(P);q&&b.push({type:1,index:U,color:q})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._getCurrentLinkId()&&this._finishHyperlink();const y=m.split(":");let D;const P=y.findIndex(U=>U.startsWith("id="));return P!==-1&&(D=y[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,b){const y=m.split(";");for(let D=0;D=this._specialColors.length);++D,++b)if(y[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const P=(0,S.parseColor)(y[D]);P&&this._onColor.fire([{type:1,index:this._specialColors[b],color:P}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],y=m.split(";");for(let D=0;D=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new t.CellData;m.content=4194373,m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b(this._coreService.triggerDataEvent(`${r.C0.ESC}${P}${r.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(m,b){this._dirtyRowTracker.markRangeDirty(m,b)}}n.InputHandler=I;let $=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){Wthis.end&&(this.end=W)}markRangeDirty(W,m){W>m&&(B=W,W=m,m=B),Wthis.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j(W){return 0<=W&&W<256}$=c([_(0,g.IBufferService)],$)},844:(O,n)=>{function o(c){for(const _ of c)_.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const _=this._disposables.indexOf(c);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=o,n.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,r,d){this._data[_]||(this._data[_]={}),this._data[_][r]=d}get(_,r){return this._data[_]?this._data[_][r]:void 0}clear(){this._data={}}}n.TwoKeyMap=o,n.FourKeyMap=class{constructor(){this._data=new o}set(c,_,r,d,f){this._data.get(c,_)||this._data.set(c,_,new o),this._data.get(c,_).set(r,d,f)}get(c,_,r,d){return this._data.get(c,_)?.get(r,d)}clear(){this._data.clear()}}},6114:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const o=n.isNode?"node":navigator.userAgent,c=n.isNode?"node":navigator.platform;n.isFirefox=o.includes("Firefox"),n.isLegacyEdge=o.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(o),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),n.isIpad=c==="iPad",n.isIphone=c==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),n.isLinux=c.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(o)},6106:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let o=0;n.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const _=this._getKey(c);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===c))do _(this._array[o]);while(++o=_;){let d=_+r>>1;const f=this._getKey(this._array[d]);if(f>c)r=d-1;else{if(!(f0&&this._getKey(this._array[d-1])===c;)d--;return d}_=d+1}}return _}}},7226:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const c=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._is)return i-u<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-u))}ms`),void this._start();i=s}this.clear()}}class r extends _{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const u=Date.now()+f;return{timeRemaining:()=>Math.max(0,u-Date.now())}}}n.PriorityTaskQueue=r,n.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:r,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const c=o(643);n.updateWindowsModeWrappedState=function(_){const r=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=r?.get(_.cols-1),f=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);f&&d&&(f.isWrapped=d[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&d[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(r){return[r>>>16&255,r>>>8&255,255&r]}static fromColorRGB(r){return(255&r[0])<<16|(255&r[1])<<8|255&r[2]}clone(){const r=new o;return r.fg=this.fg,r.bg=this.bg,r.extended=this.extended.clone(),r}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(r){this._ext=r}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(r){this._ext&=-469762049,this._ext|=r<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(r){this._ext&=-67108864,this._ext|=67108863&r}get urlId(){return this._urlId}set urlId(r){this._urlId=r}get underlineVariantOffset(){const r=(3758096384&this._ext)>>29;return r<0?4294967288^r:r}set underlineVariantOffset(r){this._ext&=536870911,this._ext|=r<<29&3758096384}constructor(r=0,d=0){this._ext=0,this._urlId=0,this._ext=r,this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=c},9092:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const c=o(6349),_=o(7226),r=o(3734),d=o(8437),f=o(4634),u=o(511),h=o(643),i=o(4863),s=o(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,t,a){this._hasScrollback=e,this._optionsService=t,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=u.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=u.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new r.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new r.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&en.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const a=this.getNullCell(d.DEFAULT_ATTR_DATA);let g=0;const v=this._getCorrectBufferLength(t);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,a)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=v}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let p=0;p.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const a=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(a.length>0){const g=(0,f.reflowLargerCreateNewLayout)(this.lines,a);(0,f.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(e,t,g.countRemoved)}}_reflowLargerAdjustViewport(e,t,a){const g=this.getNullCell(d.DEFAULT_ATTR_DATA);let v=a;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;p--){let l=this.lines.get(p);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;const S=[l];for(;l.isWrapped&&p>0;)l=this.lines.get(--p),S.unshift(l);const E=this.ybase+this.y;if(E>=p&&E0&&(g.push({start:p+S.length+v,newLines:I}),v+=I.length),S.push(...I);let $=x.length-1,j=x[$];j===0&&($--,j=x[$]);let W=S.length-w-1,m=k;for(;W>=0;){const y=Math.min(m,j);if(S[$]===void 0)break;if(S[$].copyCellsFrom(S[W],m-y,j-y,y,!0),j-=y,j===0&&($--,j=x[$]),m-=y,m===0){W--;const D=Math.max(W,0);m=(0,f.getWrappedLineTrimmedLength)(S,D,this._cols)}}for(let y=0;y0;)this.ybase===0?this.y0){const p=[],l=[];for(let $=0;$=0;$--)if(x&&x.start>E+w){for(let j=x.newLines.length-1;j>=0;j--)this.lines.set($--,x.newLines[j]);$++,p.push({index:E+1,amount:x.newLines.length}),w+=x.newLines.length,x=g[++k]}else this.lines.set($,l[E--]);let B=0;for(let $=p.length-1;$>=0;$--)p[$].index+=B,this.lines.onInsertEmitter.fire(p[$]),B+=p[$].amount;const I=Math.max(0,S+v-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(e,t,a=0,g){const v=this.lines.get(e);return v?v.translateToString(t,a,g):""}getWrappedRangeForLine(e){let t=e,a=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;a+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=a,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(a=>{t.line>=a.index&&(t.line+=a.amount)})),t.register(this.lines.onDelete(a=>{t.line>=a.index&&t.linea.index&&(t.line-=a.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const c=o(3734),_=o(511),r=o(643),d=o(482);n.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let f=0;class u{constructor(i,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const t=s||_.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let a=0;a>22,2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):e]}set(i,s){this._data[3*i+1]=s[r.CHAR_DATA_ATTR_INDEX],s[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=s[1],this._data[3*i+0]=2097152|i|s[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=s[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&s}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,s){return f=3*i,s.content=this._data[f+0],s.fg=this._data[f+1],s.bg=this._data[f+2],2097152&s.content&&(s.combinedData=this._combined[i]),268435456&s.bg&&(s.extended=this._extendedAttrs[i]),s}setCell(i,s){2097152&s.content&&(this._combined[i]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=s.content,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}setCellFromCodepoint(i,s,e,t){268435456&t.bg&&(this._extendedAttrs[i]=t.extended),this._data[3*i+0]=s|e<<22,this._data[3*i+1]=t.fg,this._data[3*i+2]=t.bg}addCodepointToCell(i,s,e){let t=this._data[3*i+0];2097152&t?this._combined[i]+=(0,d.stringFromCodePoint)(s):2097151&t?(this._combined[i]=(0,d.stringFromCodePoint)(2097151&t)+(0,d.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*i+0]=t}insertCells(i,s,e){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s=0;--a)this.setCell(i+s+a,this.loadCell(i+a,t));for(let a=0;athis.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t=i&&delete this._combined[v]}const a=Object.keys(this._extendedAttrs);for(let g=0;g=i&&delete this._extendedAttrs[v]}}return this.length=i,4*e*2=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,s,e,t,a){const g=i._data;if(a)for(let p=t-1;p>=0;p--){for(let l=0;l<3;l++)this._data[3*(e+p)+l]=g[3*(s+p)+l];268435456&g[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}else for(let p=0;p=s&&(this._combined[l-s+e]=i._combined[l])}}translateToString(i,s,e,t){s=s??0,e=e??this.length,i&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let a="";for(;s>22||1}return t&&t.push(s),a}}n.BufferLine=u},4841:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(O,n)=>{function o(c,_,r){if(_===c.length-1)return c[_].getTrimmedLength();const d=!c[_].hasContent(r-1)&&c[_].getWidth(r-1)===1,f=c[_+1].getWidth(0)===2;return d&&f?r-1:r}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(c,_,r,d,f){const u=[];for(let h=0;h=h&&d0&&(l>t||e[l].getTrimmedLength()===0);l--)p++;p>0&&(u.push(h+e.length-p),u.push(p)),h+=e.length-1}return u},n.reflowLargerCreateNewLayout=function(c,_){const r=[];let d=0,f=_[d],u=0;for(let h=0;ho(c,e,_)).reduce((s,e)=>s+e);let u=0,h=0,i=0;for(;is&&(u-=s,h++);const e=c[h].getWidth(u-1)===2;e&&u--;const t=e?r-1:r;d.push(t),i+=t}return d},n.getWrappedLineTrimmedLength=o},5295:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const c=o(8460),_=o(844),r=o(9092);class d extends _.Disposable{constructor(u,h){super(),this._optionsService=u,this._bufferService=h,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new r.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new r.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(u){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(u),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(u,h){this._normal.resize(u,h),this._alt.resize(u,h),this.setupTabStops(u)}setupTabStops(u){this._normal.setupTabStops(u),this._alt.setupTabStops(u)}}n.BufferSet=d},511:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const c=o(482),_=o(643),r=o(3734);class d extends r.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new r.ExtendedAttrs,this.combinedData=""}static fromCharData(u){const h=new d;return h.setFromCharData(u),h}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(u){this.fg=u[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let h=!1;if(u[_.CHAR_DATA_CHAR_INDEX].length>2)h=!0;else if(u[_.CHAR_DATA_CHAR_INDEX].length===2){const i=u[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=u[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|u[_.CHAR_DATA_WIDTH_INDEX]<<22:h=!0}else h=!0}else this.content=u[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[_.CHAR_DATA_WIDTH_INDEX]<<22;h&&(this.combinedData=u[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|u[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=d},643:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const c=o(8460),_=o(844);class r{get id(){return this._id}constructor(f){this.line=f,this.isDisposed=!1,this._disposables=[],this._id=r._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(f){return this._disposables.push(f),f}}n.Marker=r,r._nextId=1},7116:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(O,n)=>{var o,c,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,function(r){r.NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="\x07",r.BS="\b",r.HT=" ",r.LF=`
-`,r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="\x1B",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL=""}(o||(n.C0=o={})),function(r){r.PAD="",r.HOP="",r.BPH="",r.NBH="",r.IND="",r.NEL="
",r.SSA="",r.ESA="",r.HTS="",r.HTJ="",r.VTS="",r.PLD="",r.PLU="",r.RI="",r.SS2="",r.SS3="",r.DCS="",r.PU1="",r.PU2="",r.STS="",r.CCH="",r.MW="",r.SPA="",r.EPA="",r.SOS="",r.SGCI="",r.SCI="",r.CSI="",r.ST="",r.OSC="",r.PM="",r.APC=""}(c||(n.C1=c={})),function(r){r.ST=`${o.ESC}\\`}(_||(n.C1_ESCAPED=_={}))},7399:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const c=o(2584),_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(r,d,f,u){const h={type:0,cancel:!1,key:void 0},i=(r.shiftKey?1:0)|(r.altKey?2:0)|(r.ctrlKey?4:0)|(r.metaKey?8:0);switch(r.keyCode){case 0:r.key==="UIKeyInputUpArrow"?h.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A":r.key==="UIKeyInputLeftArrow"?h.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D":r.key==="UIKeyInputRightArrow"?h.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C":r.key==="UIKeyInputDownArrow"&&(h.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:h.key=r.ctrlKey?"\b":c.C0.DEL,r.altKey&&(h.key=c.C0.ESC+h.key);break;case 9:if(r.shiftKey){h.key=c.C0.ESC+"[Z";break}h.key=c.C0.HT,h.cancel=!0;break;case 13:h.key=r.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,h.cancel=!0;break;case 27:h.key=c.C0.ESC,r.altKey&&(h.key=c.C0.ESC+c.C0.ESC),h.cancel=!0;break;case 37:if(r.metaKey)break;i?(h.key=c.C0.ESC+"[1;"+(i+1)+"D",h.key===c.C0.ESC+"[1;3D"&&(h.key=c.C0.ESC+(f?"b":"[1;5D"))):h.key=d?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(r.metaKey)break;i?(h.key=c.C0.ESC+"[1;"+(i+1)+"C",h.key===c.C0.ESC+"[1;3C"&&(h.key=c.C0.ESC+(f?"f":"[1;5C"))):h.key=d?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(r.metaKey)break;i?(h.key=c.C0.ESC+"[1;"+(i+1)+"A",f||h.key!==c.C0.ESC+"[1;3A"||(h.key=c.C0.ESC+"[1;5A")):h.key=d?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(r.metaKey)break;i?(h.key=c.C0.ESC+"[1;"+(i+1)+"B",f||h.key!==c.C0.ESC+"[1;3B"||(h.key=c.C0.ESC+"[1;5B")):h.key=d?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:r.shiftKey||r.ctrlKey||(h.key=c.C0.ESC+"[2~");break;case 46:h.key=i?c.C0.ESC+"[3;"+(i+1)+"~":c.C0.ESC+"[3~";break;case 36:h.key=i?c.C0.ESC+"[1;"+(i+1)+"H":d?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:h.key=i?c.C0.ESC+"[1;"+(i+1)+"F":d?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:r.shiftKey?h.type=2:r.ctrlKey?h.key=c.C0.ESC+"[5;"+(i+1)+"~":h.key=c.C0.ESC+"[5~";break;case 34:r.shiftKey?h.type=3:r.ctrlKey?h.key=c.C0.ESC+"[6;"+(i+1)+"~":h.key=c.C0.ESC+"[6~";break;case 112:h.key=i?c.C0.ESC+"[1;"+(i+1)+"P":c.C0.ESC+"OP";break;case 113:h.key=i?c.C0.ESC+"[1;"+(i+1)+"Q":c.C0.ESC+"OQ";break;case 114:h.key=i?c.C0.ESC+"[1;"+(i+1)+"R":c.C0.ESC+"OR";break;case 115:h.key=i?c.C0.ESC+"[1;"+(i+1)+"S":c.C0.ESC+"OS";break;case 116:h.key=i?c.C0.ESC+"[15;"+(i+1)+"~":c.C0.ESC+"[15~";break;case 117:h.key=i?c.C0.ESC+"[17;"+(i+1)+"~":c.C0.ESC+"[17~";break;case 118:h.key=i?c.C0.ESC+"[18;"+(i+1)+"~":c.C0.ESC+"[18~";break;case 119:h.key=i?c.C0.ESC+"[19;"+(i+1)+"~":c.C0.ESC+"[19~";break;case 120:h.key=i?c.C0.ESC+"[20;"+(i+1)+"~":c.C0.ESC+"[20~";break;case 121:h.key=i?c.C0.ESC+"[21;"+(i+1)+"~":c.C0.ESC+"[21~";break;case 122:h.key=i?c.C0.ESC+"[23;"+(i+1)+"~":c.C0.ESC+"[23~";break;case 123:h.key=i?c.C0.ESC+"[24;"+(i+1)+"~":c.C0.ESC+"[24~";break;default:if(!r.ctrlKey||r.shiftKey||r.altKey||r.metaKey)if(f&&!u||!r.altKey||r.metaKey)!f||r.altKey||r.ctrlKey||r.shiftKey||!r.metaKey?r.key&&!r.ctrlKey&&!r.altKey&&!r.metaKey&&r.keyCode>=48&&r.key.length===1?h.key=r.key:r.key&&r.ctrlKey&&(r.key==="_"&&(h.key=c.C0.US),r.key==="@"&&(h.key=c.C0.NUL)):r.keyCode===65&&(h.type=1);else{const s=_[r.keyCode],e=s?.[r.shiftKey?1:0];if(e)h.key=c.C0.ESC+e;else if(r.keyCode>=65&&r.keyCode<=90){const t=r.ctrlKey?r.keyCode-64:r.keyCode+32;let a=String.fromCharCode(t);r.shiftKey&&(a=a.toUpperCase()),h.key=c.C0.ESC+a}else if(r.keyCode===32)h.key=c.C0.ESC+(r.ctrlKey?c.C0.NUL:" ");else if(r.key==="Dead"&&r.code.startsWith("Key")){let t=r.code.slice(3,4);r.shiftKey||(t=t.toLowerCase()),h.key=c.C0.ESC+t,h.cancel=!0}}else r.keyCode>=65&&r.keyCode<=90?h.key=String.fromCharCode(r.keyCode-64):r.keyCode===32?h.key=c.C0.NUL:r.keyCode>=51&&r.keyCode<=55?h.key=String.fromCharCode(r.keyCode-51+27):r.keyCode===56?h.key=c.C0.DEL:r.keyCode===219?h.key=c.C0.ESC:r.keyCode===220?h.key=c.C0.FS:r.keyCode===221&&(h.key=c.C0.GS)}return h}},482:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},n.utf32ToString=function(o,c=0,_=o.length){let r="";for(let d=c;d<_;++d){let f=o[d];f>65535?(f-=65536,r+=String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):r+=String.fromCharCode(f)}return r},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const _=o.length;if(!_)return 0;let r=0,d=0;if(this._interim){const f=o.charCodeAt(d++);56320<=f&&f<=57343?c[r++]=1024*(this._interim-55296)+f-56320+65536:(c[r++]=this._interim,c[r++]=f),this._interim=0}for(let f=d;f<_;++f){const u=o.charCodeAt(f);if(55296<=u&&u<=56319){if(++f>=_)return this._interim=u,r;const h=o.charCodeAt(f);56320<=h&&h<=57343?c[r++]=1024*(u-55296)+h-56320+65536:(c[r++]=u,c[r++]=h)}else u!==65279&&(c[r++]=u)}return r}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const _=o.length;if(!_)return 0;let r,d,f,u,h=0,i=0,s=0;if(this.interim[0]){let a=!1,g=this.interim[0];g&=(224&g)==192?31:(240&g)==224?15:7;let v,p=0;for(;(v=63&this.interim[++p])&&p<4;)g<<=6,g|=v;const l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=l-p;for(;s=_)return 0;if(v=o[s++],(192&v)!=128){s--,a=!0;break}this.interim[p++]=v,g<<=6,g|=63&v}a||(l===2?g<128?s--:c[h++]=g:l===3?g<2048||g>=55296&&g<=57343||g===65279||(c[h++]=g):g<65536||g>1114111||(c[h++]=g)),this.interim.fill(0)}const e=_-4;let t=s;for(;t<_;){for(;!(!(t=_)return this.interim[0]=r,h;if(d=o[t++],(192&d)!=128){t--;continue}if(i=(31&r)<<6|63&d,i<128){t--;continue}c[h++]=i}else if((240&r)==224){if(t>=_)return this.interim[0]=r,h;if(d=o[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=r,this.interim[1]=d,h;if(f=o[t++],(192&f)!=128){t--;continue}if(i=(15&r)<<12|(63&d)<<6|63&f,i<2048||i>=55296&&i<=57343||i===65279)continue;c[h++]=i}else if((248&r)==240){if(t>=_)return this.interim[0]=r,h;if(d=o[t++],(192&d)!=128){t--;continue}if(t>=_)return this.interim[0]=r,this.interim[1]=d,h;if(f=o[t++],(192&f)!=128){t--;continue}if(t>=_)return this.interim[0]=r,this.interim[1]=d,this.interim[2]=f,h;if(u=o[t++],(192&u)!=128){t--;continue}if(i=(7&r)<<18|(63&d)<<12|(63&f)<<6|63&u,i<65536||i>1114111)continue;c[h++]=i}}return h}}},225:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const c=o(1480),_=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],r=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let d;n.UnicodeV6=class{constructor(){if(this.version="6",!d){d=new Uint8Array(65536),d.fill(1),d[0]=0,d.fill(0,1,32),d.fill(0,127,160),d.fill(2,4352,4448),d[9001]=2,d[9002]=2,d.fill(2,11904,42192),d[12351]=1,d.fill(2,44032,55204),d.fill(2,63744,64256),d.fill(2,65040,65050),d.fill(2,65072,65136),d.fill(2,65280,65377),d.fill(2,65504,65511);for(let f=0;f<_.length;++f)d.fill(0,_[f][0],_[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?d[f]:function(u,h){let i,s=0,e=h.length-1;if(uh[e][1])return!1;for(;e>=s;)if(i=s+e>>1,u>h[i][1])s=i+1;else{if(!(u=131072&&f<=196605||f>=196608&&f<=262141?2:1}charProperties(f,u){let h=this.wcwidth(f),i=h===0&&u!==0;if(i){const s=c.UnicodeService.extractWidth(u);s===0?i=!1:s>h&&(h=s)}return c.UnicodeService.createPropertyValue(0,h,i)}}},5981:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const c=o(8460),_=o(844);class r extends _.Disposable{constructor(f){super(),this._action=f,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(f,u){if(u!==void 0&&this._syncCalls>u)return void(this._syncCalls=0);if(this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let h;for(this._isSyncWriting=!0;h=this._writeBuffer.shift();){this._action(h);const i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(f,u){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(u),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=f.length,this._writeBuffer.push(f),this._callbacks.push(u)}_innerWrite(f=0,u=!0){const h=f||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const i=this._writeBuffer[this._bufferOffset],s=this._action(i,u);if(s){const t=a=>Date.now()-h>=12?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(h,a);return void s.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(t)}const e=this._callbacks[this._bufferOffset];if(e&&e(),this._bufferOffset++,this._pendingData-=i.length,Date.now()-h>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}n.WriteBuffer=r},5941:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function _(r,d){const f=r.toString(16),u=f.length<2?"0"+f:f;switch(d){case 4:return f[0];case 8:return u;case 12:return(u+u).slice(0,3);default:return u+u}}n.parseColor=function(r){if(!r)return;let d=r.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const f=o.exec(d);if(f){const u=f[1]?15:f[4]?255:f[7]?4095:65535;return[Math.round(parseInt(f[1]||f[4]||f[7]||f[10],16)/u*255),Math.round(parseInt(f[2]||f[5]||f[8]||f[11],16)/u*255),Math.round(parseInt(f[3]||f[6]||f[9]||f[12],16)/u*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),c.exec(d)&&[3,6,9,12].includes(d.length))){const f=d.length/3,u=[0,0,0];for(let h=0;h<3;++h){const i=parseInt(d.slice(f*h,f*h+f),16);u[h]=f===1?i<<4:f===2?i:f===3?i>>4:i>>8}return u}},n.toRgbString=function(r,d=16){const[f,u,h]=r;return`rgb:${_(f,d)}/${_(u,d)}/${_(h,d)}`}},5770:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const c=o(482),_=o(8742),r=o(5770),d=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=d,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}registerHandler(u,h){this._handlers[u]===void 0&&(this._handlers[u]=[]);const i=this._handlers[u];return i.push(h),{dispose:()=>{const s=i.indexOf(h);s!==-1&&i.splice(s,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}reset(){if(this._active.length)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(u,h){if(this.reset(),this._ident=u,this._active=this._handlers[u]||d,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(h);else this._handlerFb(this._ident,"HOOK",h)}put(u,h,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(u,h,i);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(u,h,i))}unhook(u,h=!0){if(this._active.length){let i=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=h,e=this._stack.fallThrough,this._stack.paused=!1),!e&&i===!1){for(;s>=0&&(i=this._active[s].unhook(u),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",u);this._active=d,this._ident=0}};const f=new _.Params;f.addParam(0),n.DcsHandler=class{constructor(u){this._handler=u,this._data="",this._params=f,this._hitLimit=!1}hook(u){this._params=u.length>1||u.params[0]?u.clone():f,this._data="",this._hitLimit=!1}put(u,h,i){this._hitLimit||(this._data+=(0,c.utf32ToString)(u,h,i),this._data.length>r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(u){let h=!1;if(this._hitLimit)h=!1;else if(u&&(h=this._handler(this._data,this._params),h instanceof Promise))return h.then(i=>(this._params=f,this._data="",this._hitLimit=!1,i));return this._params=f,this._data="",this._hitLimit=!1,h}}},2015:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const c=o(844),_=o(8742),r=o(6242),d=o(6351);class f{constructor(s){this.table=new Uint8Array(s)}setDefault(s,e){this.table.fill(s<<4|e)}add(s,e,t,a){this.table[e<<8|s]=t<<4|a}addMany(s,e,t,a){for(let g=0;gl),e=(p,l)=>s.slice(p,l),t=e(32,127),a=e(0,24);a.push(25),a.push.apply(a,e(28,32));const g=e(0,14);let v;for(v in i.setDefault(1,0),i.addMany(t,0,2,0),g)i.addMany([24,26,153,154],v,3,0),i.addMany(e(128,144),v,3,0),i.addMany(e(144,152),v,3,0),i.add(156,v,0,0),i.add(27,v,11,1),i.add(157,v,4,8),i.addMany([152,158,159],v,0,7),i.add(155,v,11,3),i.add(144,v,11,9);return i.addMany(a,0,3,0),i.addMany(a,1,3,1),i.add(127,1,0,1),i.addMany(a,8,0,8),i.addMany(a,3,3,3),i.add(127,3,0,3),i.addMany(a,4,3,4),i.add(127,4,0,4),i.addMany(a,6,3,6),i.addMany(a,5,3,5),i.add(127,5,0,5),i.addMany(a,2,3,2),i.add(127,2,0,2),i.add(93,1,4,8),i.addMany(t,8,5,8),i.add(127,8,5,8),i.addMany([156,27,24,26,7],8,6,0),i.addMany(e(28,32),8,0,8),i.addMany([88,94,95],1,0,7),i.addMany(t,7,0,7),i.addMany(a,7,0,7),i.add(156,7,0,0),i.add(127,7,0,7),i.add(91,1,11,3),i.addMany(e(64,127),3,7,0),i.addMany(e(48,60),3,8,4),i.addMany([60,61,62,63],3,9,4),i.addMany(e(48,60),4,8,4),i.addMany(e(64,127),4,7,0),i.addMany([60,61,62,63],4,0,6),i.addMany(e(32,64),6,0,6),i.add(127,6,0,6),i.addMany(e(64,127),6,0,0),i.addMany(e(32,48),3,9,5),i.addMany(e(32,48),5,9,5),i.addMany(e(48,64),5,0,6),i.addMany(e(64,127),5,7,0),i.addMany(e(32,48),4,9,5),i.addMany(e(32,48),1,9,2),i.addMany(e(32,48),2,9,2),i.addMany(e(48,127),2,10,0),i.addMany(e(48,80),1,10,0),i.addMany(e(81,88),1,10,0),i.addMany([89,90,92],1,10,0),i.addMany(e(96,127),1,10,0),i.add(80,1,11,9),i.addMany(a,9,0,9),i.add(127,9,0,9),i.addMany(e(28,32),9,0,9),i.addMany(e(32,48),9,9,12),i.addMany(e(48,60),9,8,10),i.addMany([60,61,62,63],9,9,10),i.addMany(a,11,0,11),i.addMany(e(32,128),11,0,11),i.addMany(e(28,32),11,0,11),i.addMany(a,10,0,10),i.add(127,10,0,10),i.addMany(e(28,32),10,0,10),i.addMany(e(48,60),10,8,10),i.addMany([60,61,62,63],10,0,11),i.addMany(e(32,48),10,9,12),i.addMany(a,12,0,12),i.add(127,12,0,12),i.addMany(e(28,32),12,0,12),i.addMany(e(32,48),12,9,12),i.addMany(e(48,64),12,0,11),i.addMany(e(64,127),12,12,13),i.addMany(e(64,127),10,12,13),i.addMany(e(64,127),9,12,13),i.addMany(a,13,13,13),i.addMany(t,13,13,13),i.add(127,13,0,13),i.addMany([27,156,24,26],13,14,0),i.add(u,0,2,0),i.add(u,8,5,8),i.add(u,6,0,6),i.add(u,11,0,11),i.add(u,13,13,13),i}();class h extends c.Disposable{constructor(s=n.VT500_TRANSITION_TABLE){super(),this._transitions=s,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,a)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new r.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(s,e=[64,126]){let t=0;if(s.prefix){if(s.prefix.length>1)throw new Error("only one byte as prefix supported");if(t=s.prefix.charCodeAt(0),t&&60>t||t>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(s.intermediates){if(s.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let g=0;gv||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");t<<=8,t|=v}}if(s.final.length!==1)throw new Error("final must be a single byte");const a=s.final.charCodeAt(0);if(e[0]>a||a>e[1])throw new Error(`final must be in range ${e[0]} .. ${e[1]}`);return t<<=8,t|=a,t}identToString(s){const e=[];for(;s;)e.push(String.fromCharCode(255&s)),s>>=8;return e.reverse().join("")}setPrintHandler(s){this._printHandler=s}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(s,e){const t=this._identifier(s,[48,126]);this._escHandlers[t]===void 0&&(this._escHandlers[t]=[]);const a=this._escHandlers[t];return a.push(e),{dispose:()=>{const g=a.indexOf(e);g!==-1&&a.splice(g,1)}}}clearEscHandler(s){this._escHandlers[this._identifier(s,[48,126])]&&delete this._escHandlers[this._identifier(s,[48,126])]}setEscHandlerFallback(s){this._escHandlerFb=s}setExecuteHandler(s,e){this._executeHandlers[s.charCodeAt(0)]=e}clearExecuteHandler(s){this._executeHandlers[s.charCodeAt(0)]&&delete this._executeHandlers[s.charCodeAt(0)]}setExecuteHandlerFallback(s){this._executeHandlerFb=s}registerCsiHandler(s,e){const t=this._identifier(s);this._csiHandlers[t]===void 0&&(this._csiHandlers[t]=[]);const a=this._csiHandlers[t];return a.push(e),{dispose:()=>{const g=a.indexOf(e);g!==-1&&a.splice(g,1)}}}clearCsiHandler(s){this._csiHandlers[this._identifier(s)]&&delete this._csiHandlers[this._identifier(s)]}setCsiHandlerFallback(s){this._csiHandlerFb=s}registerDcsHandler(s,e){return this._dcsParser.registerHandler(this._identifier(s),e)}clearDcsHandler(s){this._dcsParser.clearHandler(this._identifier(s))}setDcsHandlerFallback(s){this._dcsParser.setHandlerFallback(s)}registerOscHandler(s,e){return this._oscParser.registerHandler(s,e)}clearOscHandler(s){this._oscParser.clearHandler(s)}setOscHandlerFallback(s){this._oscParser.setHandlerFallback(s)}setErrorHandler(s){this._errorHandler=s}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(s,e,t,a,g){this._parseStack.state=s,this._parseStack.handlers=e,this._parseStack.handlerPos=t,this._parseStack.transition=a,this._parseStack.chunkPos=g}parse(s,e,t){let a,g=0,v=0,p=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,p=this._parseStack.chunkPos+1;else{if(t===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const l=this._parseStack.handlers;let S=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(t===!1&&S>-1){for(;S>=0&&(a=l[S](this._params),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 4:if(t===!1&&S>-1){for(;S>=0&&(a=l[S](),a!==!0);S--)if(a instanceof Promise)return this._parseStack.handlerPos=S,a}this._parseStack.handlers=[];break;case 6:if(g=s[this._parseStack.chunkPos],a=this._dcsParser.unhook(g!==24&&g!==26,t),a)return a;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(g=s[this._parseStack.chunkPos],a=this._oscParser.end(g!==24&&g!==26,t),a)return a;g===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,p=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let l=p;l>4){case 2:for(let w=l+1;;++w){if(w>=e||(g=s[w])<32||g>126&&g=e||(g=s[w])<32||g>126&&g=e||(g=s[w])<32||g>126&&g=e||(g=s[w])<32||g>126&&g=0&&(a=S[E](this._params),a!==!0);E--)if(a instanceof Promise)return this._preserveStack(3,S,E,v,l),a;E<0&&this._csiHandlerFb(this._collect<<8|g,this._params),this.precedingJoinState=0;break;case 8:do switch(g){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(g-48)}while(++l47&&g<60);l--;break;case 9:this._collect<<=8,this._collect|=g;break;case 10:const k=this._escHandlers[this._collect<<8|g];let x=k?k.length-1:-1;for(;x>=0&&(a=k[x](),a!==!0);x--)if(a instanceof Promise)return this._preserveStack(4,k,x,v,l),a;x<0&&this._escHandlerFb(this._collect<<8|g),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|g,this._params);break;case 13:for(let w=l+1;;++w)if(w>=e||(g=s[w])===24||g===26||g===27||g>127&&g=e||(g=s[w])<32||g>127&&g{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const c=o(5770),_=o(482),r=[];n.OscParser=class{constructor(){this._state=0,this._active=r,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,f){this._handlers[d]===void 0&&(this._handlers[d]=[]);const u=this._handlers[d];return u.push(f),{dispose:()=>{const h=u.indexOf(f);h!==-1&&u.splice(h,1)}}}clearHandler(d){this._handlers[d]&&delete this._handlers[d]}setHandlerFallback(d){this._handlerFb=d}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=r}reset(){if(this._state===2)for(let d=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;d>=0;--d)this._active[d].end(!1);this._stack.paused=!1,this._active=r,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||r,this._active.length)for(let d=this._active.length-1;d>=0;d--)this._active[d].start();else this._handlerFb(this._id,"START")}_put(d,f,u){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(d,f,u);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(d,f,u))}start(){this.reset(),this._state=1}put(d,f,u){if(this._state!==3){if(this._state===1)for(;f0&&this._put(d,f,u)}}end(d,f=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let u=!1,h=this._active.length-1,i=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,u=f,i=this._stack.fallThrough,this._stack.paused=!1),!i&&u===!1){for(;h>=0&&(u=this._active[h].end(d),u!==!0);h--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,u;h--}for(;h>=0;h--)if(u=this._active[h].end(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,u}else this._handlerFb(this._id,"END",d);this._active=r,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,f,u){this._hitLimit||(this._data+=(0,_.utf32ToString)(d,f,u),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let f=!1;if(this._hitLimit)f=!1;else if(d&&(f=this._handler(this._data),f instanceof Promise))return f.then(u=>(this._data="",this._hitLimit=!1,u));return this._data="",this._hitLimit=!1,f}}},8742:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const o=2147483647;class c{static fromArray(r){const d=new c;if(!r.length)return d;for(let f=Array.isArray(r[0])?1:0;f256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(r),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(r),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const r=new c(this.maxLength,this.maxSubParamsLength);return r.params.set(this.params),r.length=this.length,r._subParams.set(this._subParams),r._subParamsLength=this._subParamsLength,r._subParamsIdx.set(this._subParamsIdx),r._rejectDigits=this._rejectDigits,r._rejectSubDigits=this._rejectSubDigits,r._digitIsSub=this._digitIsSub,r}toArray(){const r=[];for(let d=0;d>8,u=255&this._subParamsIdx[d];u-f>0&&r.push(Array.prototype.slice.call(this._subParams,f,u))}return r}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(r){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(r<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=r>o?o:r}}addSubParam(r){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(r<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=r>o?o:r,this._subParamsIdx[this.length-1]++}}hasSubParams(r){return(255&this._subParamsIdx[r])-(this._subParamsIdx[r]>>8)>0}getSubParams(r){const d=this._subParamsIdx[r]>>8,f=255&this._subParamsIdx[r];return f-d>0?this._subParams.subarray(d,f):null}getSubParamsAll(){const r={};for(let d=0;d>8,u=255&this._subParamsIdx[d];u-f>0&&(r[d]=this._subParams.slice(f,u))}return r}addDigit(r){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const f=this._digitIsSub?this._subParams:this.params,u=f[d-1];f[d-1]=~u?Math.min(10*u+r,o):r}}n.Params=c},5741:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const _={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(_),c.dispose=()=>this._wrappedAddonDispose(_),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let _=0;_{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const c=o(3785),_=o(511);n.BufferApiView=class{constructor(r,d){this._buffer=r,this.type=d}init(r){return this._buffer=r,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(r){const d=this._buffer.lines.get(r);if(d)return new c.BufferLineApiView(d)}getNullCell(){return new _.CellData}}},3785:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const c=o(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,r){if(!(_<0||_>=this._line.length))return r?(this._line.loadCell(_,r),r):this._line.loadCell(_,new c.CellData)}translateToString(_,r,d){return this._line.translateToString(_,r,d)}}},8285:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const c=o(8771),_=o(8460),r=o(844);class d extends r.Disposable{constructor(u){super(),this._core=u,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}n.BufferNamespaceApi=d},7975:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,_=>c(_.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(_,r)=>c(_,r.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(O,n,o){var c=this&&this.__decorate||function(i,s,e,t){var a,g=arguments.length,v=g<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(a=i[p])&&(v=(g<3?a(v):g>3?a(s,e,v):a(s,e))||v);return g>3&&v&&Object.defineProperty(s,e,v),v},_=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const r=o(8460),d=o(844),f=o(5295),u=o(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let h=n.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(i){super(),this.isUserScrolling=!1,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new r.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(i.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(i.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new f.BufferSet(i,this))}resize(i,s){this.cols=i,this.rows=s,this.buffers.resize(i,s),this._onResize.fire({cols:i,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(i,s=!1){const e=this.buffer;let t;t=this._cachedBlankLine,t&&t.length===this.cols&&t.getFg(0)===i.fg&&t.getBg(0)===i.bg||(t=e.getBlankLine(i,s),this._cachedBlankLine=t),t.isWrapped=s;const a=e.ybase+e.scrollTop,g=e.ybase+e.scrollBottom;if(e.scrollTop===0){const v=e.lines.isFull;g===e.lines.length-1?v?e.lines.recycle().copyFrom(t):e.lines.push(t.clone()):e.lines.splice(g+1,0,t.clone()),v?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{const v=g-a+1;e.lines.shiftElements(a+1,v-1,-1),e.lines.set(g,t.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(i,s,e){const t=this.buffer;if(i<0){if(t.ydisp===0)return;this.isUserScrolling=!0}else i+t.ydisp>=t.ybase&&(this.isUserScrolling=!1);const a=t.ydisp;t.ydisp=Math.max(Math.min(t.ydisp+i,t.ybase),0),a!==t.ydisp&&(s||this._onScroll.fire(t.ydisp))}};n.BufferService=h=c([_(0,u.IOptionsService)],h)},7994:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(O,n,o){var c=this&&this.__decorate||function(t,a,g,v){var p,l=arguments.length,S=l<3?a:v===null?v=Object.getOwnPropertyDescriptor(a,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(t,a,g,v);else for(var E=t.length-1;E>=0;E--)(p=t[E])&&(S=(l<3?p(S):l>3?p(a,g,S):p(a,g))||S);return l>3&&S&&Object.defineProperty(a,g,S),S},_=this&&this.__param||function(t,a){return function(g,v){a(g,v,t)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const r=o(2585),d=o(8460),f=o(844),u={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button!==4&&t.action===1&&(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>t.action!==32||t.button!==3},ANY:{events:31,restrict:t=>!0}};function h(t,a){let g=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(g|=64,g|=t.action):(g|=3&t.button,4&t.button&&(g|=64),8&t.button&&(g|=128),t.action===32?g|=32:t.action!==0||a||(g|=3)),g}const i=String.fromCharCode,s={DEFAULT:t=>{const a=[h(t,!1)+32,t.col+32,t.row+32];return a[0]>255||a[1]>255||a[2]>255?"":`\x1B[M${i(a[0])}${i(a[1])}${i(a[2])}`},SGR:t=>{const a=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.col};${t.row}${a}`},SGR_PIXELS:t=>{const a=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${h(t,!0)};${t.x};${t.y}${a}`}};let e=n.CoreMouseService=class extends f.Disposable{constructor(t,a){super(),this._bufferService=t,this._coreService=a,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new d.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const g of Object.keys(u))this.addProtocol(g,u[g]);for(const g of Object.keys(s))this.addEncoding(g,s[g]);this.reset()}addProtocol(t,a){this._protocols[t]=a}addEncoding(t,a){this._encodings[t]=a}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;const a=this._encodings[this._activeEncoding](t);return a&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(a):this._coreService.triggerDataEvent(a,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(1&t),up:!!(2&t),drag:!!(4&t),move:!!(8&t),wheel:!!(16&t)}}_equalEvents(t,a,g){if(g){if(t.x!==a.x||t.y!==a.y)return!1}else if(t.col!==a.col||t.row!==a.row)return!1;return t.button===a.button&&t.action===a.action&&t.ctrl===a.ctrl&&t.alt===a.alt&&t.shift===a.shift}};n.CoreMouseService=e=c([_(0,r.IBufferService),_(1,r.ICoreService)],e)},6975:function(O,n,o){var c=this&&this.__decorate||function(e,t,a,g){var v,p=arguments.length,l=p<3?t:g===null?g=Object.getOwnPropertyDescriptor(t,a):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,a,g);else for(var S=e.length-1;S>=0;S--)(v=e[S])&&(l=(p<3?v(l):p>3?v(t,a,l):v(t,a))||l);return p>3&&l&&Object.defineProperty(t,a,l),l},_=this&&this.__param||function(e,t){return function(a,g){t(a,g,e)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const r=o(1439),d=o(8460),f=o(844),u=o(2585),h=Object.freeze({insertMode:!1}),i=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let s=n.CoreService=class extends f.Disposable{constructor(e,t,a){super(),this._bufferService=e,this._logService=t,this._optionsService=a,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new d.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new d.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new d.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new d.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,r.clone)(h),this.decPrivateModes=(0,r.clone)(i)}reset(){this.modes=(0,r.clone)(h),this.decPrivateModes=(0,r.clone)(i)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const a=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&a.ybase!==a.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(g=>g.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};n.CoreService=s=c([_(0,u.IBufferService),_(1,u.ILogService),_(2,u.IOptionsService)],s)},9074:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const c=o(8055),_=o(8460),r=o(844),d=o(6106);let f=0,u=0;class h extends r.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList(e=>e?.marker.line),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,r.toDisposable)(()=>this.reset()))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new i(e);if(t){const a=t.marker.onDispose(()=>t.dispose());t.onDispose(()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),a.dispose())}),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,a){let g=0,v=0;for(const p of this._decorations.getKeyIterator(t))g=p.options.x??0,v=g+(p.options.width??1),e>=g&&e{f=v.options.x??0,u=f+(v.options.width??1),e>=f&&e{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const c=o(2585),_=o(8343);class r{constructor(...f){this._entries=new Map;for(const[u,h]of f)this.set(u,h)}set(f,u){const h=this._entries.get(f);return this._entries.set(f,u),h}forEach(f){for(const[u,h]of this._entries.entries())f(u,h)}has(f){return this._entries.has(f)}get(f){return this._entries.get(f)}}n.ServiceCollection=r,n.InstantiationService=class{constructor(){this._services=new r,this._services.set(c.IInstantiationService,this)}setService(d,f){this._services.set(d,f)}getService(d){return this._services.get(d)}createInstance(d,...f){const u=(0,_.getServiceDependencies)(d).sort((s,e)=>s.index-e.index),h=[];for(const s of u){const e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${s.id}.`);h.push(e)}const i=u.length>0?u[0].index:f.length;if(f.length!==i)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${i+1} conflicts with ${f.length} static arguments`);return new d(...f,...h)}}},7866:function(O,n,o){var c=this&&this.__decorate||function(i,s,e,t){var a,g=arguments.length,v=g<3?s:t===null?t=Object.getOwnPropertyDescriptor(s,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(i,s,e,t);else for(var p=i.length-1;p>=0;p--)(a=i[p])&&(v=(g<3?a(v):g>3?a(s,e,v):a(s,e))||v);return g>3&&v&&Object.defineProperty(s,e,v),v},_=this&&this.__param||function(i,s){return function(e,t){s(e,t,i)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const r=o(844),d=o(2585),f={trace:d.LogLevelEnum.TRACE,debug:d.LogLevelEnum.DEBUG,info:d.LogLevelEnum.INFO,warn:d.LogLevelEnum.WARN,error:d.LogLevelEnum.ERROR,off:d.LogLevelEnum.OFF};let u,h=n.LogService=class extends r.Disposable{get logLevel(){return this._logLevel}constructor(i){super(),this._optionsService=i,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),u=this}_updateLogLevel(){this._logLevel=f[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(i){for(let s=0;sJSON.stringify(v)).join(", ")})`);const g=t.apply(this,a);return u.trace(`GlyphRenderer#${t.name} return`,g),g}}},7302:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const c=o(8460),_=o(844),r=o(6114);n.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:r.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const d=["normal","bold","100","200","300","400","500","600","700","800","900"];class f extends _.Disposable{constructor(h){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...n.DEFAULT_OPTIONS};for(const s in h)if(s in i)try{const e=h[s];i[s]=this._sanitizeAndValidateOption(s,e)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,_.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(h,i){return this.onOptionChange(s=>{s===h&&i(this.rawOptions[h])})}onMultipleOptionChange(h,i){return this.onOptionChange(s=>{h.indexOf(s)!==-1&&i()})}_setupOptions(){const h=s=>{if(!(s in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},i=(s,e)=>{if(!(s in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${s}"`);e=this._sanitizeAndValidateOption(s,e),this.rawOptions[s]!==e&&(this.rawOptions[s]=e,this._onOptionChange.fire(s))};for(const s in this.rawOptions){const e={get:h.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,e)}}_sanitizeAndValidateOption(h,i){switch(h){case"cursorStyle":if(i||(i=n.DEFAULT_OPTIONS[h]),!function(s){return s==="block"||s==="underline"||s==="bar"}(i))throw new Error(`"${i}" is not a valid value for ${h}`);break;case"wordSeparator":i||(i=n.DEFAULT_OPTIONS[h]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=d.includes(i)?i:n.DEFAULT_OPTIONS[h];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${h} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${h} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${h} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${h} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}n.OptionsService=f},2660:function(O,n,o){var c=this&&this.__decorate||function(f,u,h,i){var s,e=arguments.length,t=e<3?u:i===null?i=Object.getOwnPropertyDescriptor(u,h):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(f,u,h,i);else for(var a=f.length-1;a>=0;a--)(s=f[a])&&(t=(e<3?s(t):e>3?s(u,h,t):s(u,h))||t);return e>3&&t&&Object.defineProperty(u,h,t),t},_=this&&this.__param||function(f,u){return function(h,i){u(h,i,f)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const r=o(2585);let d=n.OscLinkService=class{constructor(f){this._bufferService=f,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(f){const u=this._bufferService.buffer;if(f.id===void 0){const a=u.addMarker(u.ybase+u.y),g={data:f,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(g,a)),this._dataByLinkId.set(g.id,g),g.id}const h=f,i=this._getEntryIdKey(h),s=this._entriesWithId.get(i);if(s)return this.addLineToLink(s.id,u.ybase+u.y),s.id;const e=u.addMarker(u.ybase+u.y),t={id:this._nextId++,key:this._getEntryIdKey(h),data:h,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(t,e)),this._entriesWithId.set(t.key,t),this._dataByLinkId.set(t.id,t),t.id}addLineToLink(f,u){const h=this._dataByLinkId.get(f);if(h&&h.lines.every(i=>i.line!==u)){const i=this._bufferService.buffer.addMarker(u);h.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(h,i))}}getLinkData(f){return this._dataByLinkId.get(f)?.data}_getEntryIdKey(f){return`${f.id};;${f.uri}`}_removeMarkerFromLink(f,u){const h=f.lines.indexOf(u);h!==-1&&(f.lines.splice(h,1),f.lines.length===0&&(f.data.id!==void 0&&this._entriesWithId.delete(f.key),this._dataByLinkId.delete(f.id)))}};n.OscLinkService=d=c([_(0,r.IBufferService)],d)},8343:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const o="di$target",c="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[c]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const r=function(d,f,u){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(h,i,s){i[o]===i?i[c].push({id:h,index:s}):(i[c]=[{id:h,index:s}],i[o]=i)})(r,d,u)};return r.toString=()=>_,n.serviceRegistry.set(_,r),r}},2585:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const c=o(8343);var _;n.IBufferService=(0,c.createDecorator)("BufferService"),n.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),n.ICoreService=(0,c.createDecorator)("CoreService"),n.ICharsetService=(0,c.createDecorator)("CharsetService"),n.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(r){r[r.TRACE=0]="TRACE",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARN=3]="WARN",r[r.ERROR=4]="ERROR",r[r.OFF=5]="OFF"}(_||(n.LogLevelEnum=_={})),n.ILogService=(0,c.createDecorator)("LogService"),n.IOptionsService=(0,c.createDecorator)("OptionsService"),n.IOscLinkService=(0,c.createDecorator)("OscLinkService"),n.IUnicodeService=(0,c.createDecorator)("UnicodeService"),n.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const c=o(8460),_=o(225);class r{static extractShouldJoin(f){return(1&f)!=0}static extractWidth(f){return f>>1&3}static extractCharKind(f){return f>>3}static createPropertyValue(f,u,h=!1){return(16777215&f)<<3|(3&u)<<1|(h?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const f=new _.UnicodeV6;this.register(f),this._active=f.version,this._activeProvider=f}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(f){if(!this._providers[f])throw new Error(`unknown Unicode version "${f}"`);this._active=f,this._activeProvider=this._providers[f],this._onChange.fire(f)}register(f){this._providers[f.version]=f}wcwidth(f){return this._activeProvider.wcwidth(f)}getStringCellWidth(f){let u=0,h=0;const i=f.length;for(let s=0;s=i)return u+this.wcwidth(e);const g=f.charCodeAt(s);56320<=g&&g<=57343?e=1024*(e-55296)+g-56320+65536:u+=this.wcwidth(g)}const t=this.charProperties(e,h);let a=r.extractWidth(t);r.extractShouldJoin(t)&&(a-=r.extractWidth(h)),u+=a,h=t}return u}charProperties(f,u){return this._activeProvider.charProperties(f,u)}}n.UnicodeService=r}},Y={};function Z(O){var n=Y[O];if(n!==void 0)return n.exports;var o=Y[O]={exports:{}};return X[O].call(o.exports,o,o.exports,Z),o.exports}var le={};return(()=>{var O=le;Object.defineProperty(O,"__esModule",{value:!0}),O.Terminal=void 0;const n=Z(9042),o=Z(3236),c=Z(844),_=Z(5741),r=Z(8285),d=Z(7975),f=Z(7090),u=["cols","rows"];class h extends c.Disposable{constructor(s){super(),this._core=this.register(new o.Terminal(s)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const e=a=>this._core.options[a],t=(a,g)=>{this._checkReadonlyOptions(a),this._core.options[a]=g};for(const a in this._core.options){const g={get:e.bind(this,a),set:t.bind(this,a)};Object.defineProperty(this._publicOptions,a,g)}}_checkReadonlyOptions(s){if(u.includes(s))throw new Error(`Option "${s}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new d.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new f.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new r.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const s=this._core.coreService.decPrivateModes;let e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any"}return{applicationCursorKeysMode:s.applicationCursorKeys,applicationKeypadMode:s.applicationKeypad,bracketedPasteMode:s.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:s.origin,reverseWraparoundMode:s.reverseWraparound,sendFocusMode:s.sendFocus,wraparoundMode:s.wraparound}}get options(){return this._publicOptions}set options(s){for(const e in s)this._publicOptions[e]=s[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(s,e=!0){this._core.input(s,e)}resize(s,e){this._verifyIntegers(s,e),this._core.resize(s,e)}open(s){this._core.open(s)}attachCustomKeyEventHandler(s){this._core.attachCustomKeyEventHandler(s)}attachCustomWheelEventHandler(s){this._core.attachCustomWheelEventHandler(s)}registerLinkProvider(s){return this._core.registerLinkProvider(s)}registerCharacterJoiner(s){return this._checkProposedApi(),this._core.registerCharacterJoiner(s)}deregisterCharacterJoiner(s){this._checkProposedApi(),this._core.deregisterCharacterJoiner(s)}registerMarker(s=0){return this._verifyIntegers(s),this._core.registerMarker(s)}registerDecoration(s){return this._checkProposedApi(),this._verifyPositiveIntegers(s.x??0,s.width??0,s.height??0),this._core.registerDecoration(s)}hasSelection(){return this._core.hasSelection()}select(s,e,t){this._verifyIntegers(s,e,t),this._core.select(s,e,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(s,e){this._verifyIntegers(s,e),this._core.selectLines(s,e)}dispose(){super.dispose()}scrollLines(s){this._verifyIntegers(s),this._core.scrollLines(s)}scrollPages(s){this._verifyIntegers(s),this._core.scrollPages(s)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(s){this._verifyIntegers(s),this._core.scrollToLine(s)}clear(){this._core.clear()}write(s,e){this._core.write(s,e)}writeln(s,e){this._core.write(s),this._core.write(`\r
-`,e)}paste(s){this._core.paste(s)}refresh(s,e){this._verifyIntegers(s,e),this._core.refresh(s,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return n}_verifyIntegers(...s){for(const e of s)if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const e of s)if(e&&(e===1/0||isNaN(e)||e%1!=0||e<0))throw new Error("This API only accepts positive integers")}}O.Terminal=h})(),le})())}(it)),it.exports}var ft=ei(),st={exports:{}},vt;function ti(){return vt||(vt=1,function(oe,re){(function(X,Y){oe.exports=Y()})(self,()=>(()=>{var X={};return(()=>{var Y=X;Object.defineProperty(Y,"__esModule",{value:!0}),Y.FitAddon=void 0,Y.FitAddon=class{activate(Z){this._terminal=Z}dispose(){}fit(){const Z=this.proposeDimensions();if(!Z||!this._terminal||isNaN(Z.cols)||isNaN(Z.rows))return;const le=this._terminal._core;this._terminal.rows===Z.rows&&this._terminal.cols===Z.cols||(le._renderService.clear(),this._terminal.resize(Z.cols,Z.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const Z=this._terminal._core,le=Z._renderService.dimensions;if(le.css.cell.width===0||le.css.cell.height===0)return;const O=this._terminal.options.scrollback===0?0:Z.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(n.getPropertyValue("height")),c=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),r=o-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),d=c-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-O;return{cols:Math.max(2,Math.floor(d/le.css.cell.width)),rows:Math.max(1,Math.floor(r/le.css.cell.height))}}}})(),X})())}(st)),st.exports}var rt=ti();he[Te]="src/lib/components/ShellTerminal.svelte";var ii=He(gt(' '),he[Te],[[968,12,[[969,14]]]]),si=He(gt(' '),he[Te],[[972,12,[[973,14]]]]),ri=He(qe(''),he[Te],[[996,8,[[1008,10],[1009,10,[[1015,12,[[1016,14]]]]]]]]),ni=He(qe(''),he[Te],[[1043,10,[[1044,12,[[1045,14],[1046,14]]]]]]),oi=He(qe(''),he[Te],[[1050,10,[[1051,12,[[1052,14,[[1053,16,[[1054,18]]]]],[1057,14],[1058,14]]]]]]),ai=He(qe("
"),he[Te],[[1037,6]]),hi=He(qe('
'),he[Te],[[1069,4]]),li=He(qe(''),he[Te],[[954,0,[[955,2,[[956,4,[[957,6],[960,6,[[961,8],[977,8],[978,8,[[984,10,[[985,12]]]]]]]]]]],[993,2,[[994,4,[[1021,6,[[1028,8,[[1029,10]]]]]]]]],[1035,2]]]]);function he(oe,re){Lt(new.target),Pt(re,!1,he);const X=Ee(),Y=Ee(),Z=Ee(),le=Ee(),O=Ee(),n=Ee(),o=Ee();let c=lt(re,"runnerName",8),_=lt(re,"onClose",8),r=Ee(new Map),d=Ee(""),f=1,u=Ee(),h=Ee(!1),i=!1,s=!1,e=0,t=0,a=0,g=0,v=0,p=0,l=800,S=500,E=0,k=0,x=!1;const w="garm-terminal-dimensions",B="garm-terminal-container-size";function I(){try{const L=localStorage.getItem(w);if(L){const{cols:T,rows:F}=JSON.parse(L);if(T>=50&&F>=15)return{cols:T,rows:F}}}catch(L){console.warn(...Ae("warn","Failed to load stored terminal dimensions:",L))}return{cols:107,rows:29}}function $(){try{const L=localStorage.getItem(B);if(L){const{width:T,height:F}=JSON.parse(L);if(T>=300&&F>=200&&T<=1400&&F<=800)return{width:T,height:F}}}catch(L){console.warn(...Ae("warn","Failed to load stored container size:",L))}return{width:800,height:500}}function j(L,T){if(L>=300&&T>=200&&L<=1400&&T<=800)try{localStorage.setItem(B,JSON.stringify({width:L,height:T})),console.log(`saveContainerSize: Saved ${L}x${T}px to localStorage`)}catch(F){console.warn(...Ae("warn","Failed to save container size:",F))}else console.warn(`saveContainerSize: Rejecting invalid size ${L}x${T}`)}function W(L,T){if(L>=50&&T>=15&&L<=200&&T<=60){const F=I();if(Se(F.cols,L,!1)||Se(F.rows,T,!1))try{localStorage.setItem(w,JSON.stringify({cols:L,rows:T})),console.log(`saveDimensions: Saved ${L}x${T} to localStorage (was ${F.cols}x${F.rows})`)}catch(G){console.warn(...Ae("warn","Failed to save terminal dimensions:",G))}else console.log(`saveDimensions: Skipping save - ${L}x${T} already stored`)}else console.warn(`saveDimensions: Rejecting invalid dimensions ${L}x${T}`)}let{cols:m,rows:b}=I();console.log(`ShellTerminal: Loaded stored dimensions ${m}x${b} from localStorage`);function y(){const L=`shell-${f}`,T={id:f,key:L,title:`Shell ${f}`,connection:null,terminal:null,fitAddon:null,isInitialized:!1,isConnecting:!0,isConnected:!1,error:"",isClosing:!1};return R(r).set(L,T),ne(r,R(r)),f++,L}function D(L){Se(R(d),L,!1)&&(console.log(`switchToTab: Switching from ${R(d)} to ${L} (z-index stacking)`),ne(d,L))}function P(L){console.log(`closeTab: Closing tab ${L}`);const T=R(r).get(L);if(!T){console.error(`closeTab: Tab ${L} not found`);return}const F=m,G=b;if(console.log(`closeTab: Preserving dimensions ${F}x${G} during tab close`),Se(R(d),L))if(R(r).size>1){const _e=Array.from(R(r).values()).sort((ye,ve)=>ye.id-ve.id),de=T;let Q;const ae=_e.find(ye=>ye.id>de.id);ae?Q=ae:Q=_e.filter(ve=>ve.idke.id-ve.id)[0],Q?(console.log(`closeTab: Switching from active tab ${L} (ID: ${de.id}) to ${Q.key} (ID: ${Q.id}) before cleanup`),D(Q.key),T.isClosing=!0,R(r).set(L,T),ne(r,R(r)),m=F,b=G,console.log(`closeTab: Preserved dimensions ${m}x${b} for future use`)):(console.log("closeTab: No other tabs left, closing terminal"),_()())}else console.log("closeTab: No other tabs left, closing terminal"),_()();else console.log(`closeTab: Closing inactive tab ${L}`),U(T),R(r).delete(L),ne(r,R(r))}function U(L){if(console.log(`cleanupTab: Cleaning up tab ${L.key}`),L.connection&&(console.log(`cleanupTab: Closing connection for tab ${L.key}`),L.connection.close(),L.connection=null),L.terminal){console.log(`cleanupTab: Disposing terminal for tab ${L.key}`);try{L.terminal.dispose()}catch(T){console.error(...Ae("error",`cleanupTab: Error disposing terminal for tab ${L.key}:`,T))}L.terminal=null}L.fitAddon=null,L.isInitialized=!1,L.isConnected=!1,L.isConnecting=!1}async function q(L){const T=R(r).get(L);if(T)try{const F=(await Ut(Qt(c(),G=>z(L,G),()=>N(L),()=>J(L),G=>se(L,G))))();T.connection=F,R(r).set(L,T),ne(r,R(r))}catch(F){T.error=F instanceof Error?F.message:"Failed to connect",T.isConnecting=!1,R(r).set(L,T),ne(r,R(r))}}function K(L,T){if(console.log(`initializeTerminalElement: Action called for ${T.key}, hasTerminal=${!!T.terminal}, isInitialized=${T.isInitialized}`),T.terminal&&!T.isInitialized){console.log(`initializeTerminalElement: Initializing terminal for ${T.key} via Svelte action`),T.fitAddon||(T.fitAddon=new rt.FitAddon,T.terminal.loadAddon(T.fitAddon));try{T.terminal.open(L),console.log(`initializeTerminalElement: Successfully opened terminal ${T.key} in DOM element`)}catch(F){console.error(...Ae("error",`initializeTerminalElement: Failed to open terminal ${T.key}:`,F));return}T.terminal.onData(F=>{if(T.connection&&T.isConnected){const G=new TextEncoder;T.connection.sendData(G.encode(F))}}),T.terminal.onResize(({cols:F,rows:G})=>{T.connection&&T.isConnected&&T.connection.resize(F,G)}),T.isInitialized=!0,R(r).set(T.key,T),ne(r,R(r)),Se(T.key,R(d))&&T.terminal.focus(),console.log(`initializeTerminalElement: Terminal ${T.key} fully initialized and opened in DOM`)}else console.log(`initializeTerminalElement: Skipping ${T.key} - no terminal object or already initialized`);return{destroy(){console.log(`initializeTerminalElement: DOM element being destroyed for ${T.key}`)}}}function A(){const L=R(r).get(R(d));if(L?.terminal&&L.fitAddon&&L.terminal.element){L.fitAddon.fit();const T=L.terminal.cols,F=L.terminal.rows;if(T>=50&&F>=15){m=T,b=F,console.log(`fitAllTerminals: Active terminal ${L.key} is ${T}x${F}, applying to all tabs`);for(const G of R(r).values())G.terminal&&G.connection&&G.isConnected&&(Se(G.key,R(d))?(console.log(`fitAllTerminals: Notifying active terminal ${G.key} connection about resize to ${m}x${b}`),G.connection.resize(m,b)):(console.log(`fitAllTerminals: Resizing hidden terminal ${G.key} buffer and connection to ${m}x${b}`),G.terminal.resize(m,b),G.connection.resize(m,b)))}else console.warn(`fitAllTerminals: Active terminal has tiny dimensions ${T}x${F}, skipping update`)}}const C={background:"#002b36",foreground:"#839496",cursor:"#93a1a1",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#586e75",brightRed:"#cb4b16",brightGreen:"#859900",brightYellow:"#b58900",brightBlue:"#268bd2",brightMagenta:"#d33682",brightCyan:"#2aa198",brightWhite:"#fdf6e3"},M={background:"#2d3748",foreground:"#e2e8f0",cursor:"#cbd5e0",black:"#1a202c",red:"#e53e3e",green:"#38a169",yellow:"#d69e2e",blue:"#3182ce",magenta:"#9f7aea",cyan:"#0bc5ea",white:"#f7fafc",brightBlack:"#4a5568",brightRed:"#fc8181",brightGreen:"#68d391",brightYellow:"#f6e05e",brightBlue:"#63b3ed",brightMagenta:"#b794f6",brightCyan:"#76e4f7",brightWhite:"#ffffff"};function H(){const T=document.documentElement.classList.contains("dark")?C:M;for(const F of R(r).values())F.terminal&&(F.terminal.options.theme=T,F.fitAddon&&setTimeout(()=>F.fitAddon?.fit(),0))}It(()=>{const L=I(),T=$();m=L.cols,b=L.rows,console.log(`ShellTerminal onMount: Using dimensions ${m}x${b} and container size ${T.width}x${T.height}`);const F=T.width,G=T.height;R(u)&&(te(u,R(u).style.width=`${F}px`),te(u,R(u).style.height=`${G}px`));const de=document.documentElement.classList.contains("dark")?C:M,Q=y();ne(d,Q);const ae=new ft.Terminal({cursorBlink:!0,theme:de,fontSize:13,fontFamily:'Monaco, "Menlo", "Ubuntu Mono", monospace',allowTransparency:!0}),ye=new rt.FitAddon;ae.loadAddon(ye);const ve=R(r).get(Q);ve&&(ve.terminal=ae,ve.fitAddon=ye,R(r).set(Q,ve),ne(r,R(r))),q(Q);function ke(){clearTimeout(ee),ee=setTimeout(()=>{A()},100)}const Oe=new MutationObserver(()=>H());return Oe.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",ke),document.addEventListener("fullscreenchange",$e),document.addEventListener("keydown",We),()=>{window.removeEventListener("resize",ke),document.removeEventListener("fullscreenchange",$e),document.removeEventListener("keydown",We),Oe.disconnect()}}),Ht(()=>{for(const L of R(r).values())U(L)});function z(L,T){const F=R(r).get(L);if(F?.terminal){const G=new TextDecoder().decode(T);F.terminal.write(G)}}function N(L){const T=R(r).get(L);if(T&&(T.isConnecting=!1,T.isConnected=!0,R(r).set(L,T),ne(r,R(r)),T.connection&&T.terminal&&T.fitAddon)){console.log(`handleReady: Terminal ${L} connected, fitting to restored container`),T.fitAddon.fit();const F=T.terminal.cols,G=T.terminal.rows;console.log(`handleReady: Terminal fitted to ${F}x${G}, sending to server`),T.connection.resize(F,G),F>=50&&G>=15&&(m=F,b=G)}}function J(L){const T=R(r).get(L);T&&(T.isConnected=!1,R(r).set(L,T),ne(r,R(r)),T.terminal&&T.terminal.write(`\r
-[Shell session ended]`))}function se(L,T){const F=R(r).get(L);F&&(F.error=T,F.isConnecting=!1,F.isConnected=!1,R(r).set(L,F),ne(r,R(r)))}let ee;function ce(){if(R(r).size>=5){console.log("addNewTab: Maximum number of tabs (5) reached");return}const T=document.documentElement.classList.contains("dark")?C:M,F=y(),G=new ft.Terminal({cursorBlink:!0,theme:T,fontSize:13,fontFamily:'Monaco, "Menlo", "Ubuntu Mono", monospace',allowTransparency:!0}),_e=new rt.FitAddon;G.loadAddon(_e);const de=R(r).get(F);de&&(de.terminal=G,de.fitAddon=_e,R(r).set(F,de),ne(r,R(r))),D(F),q(F)}function V(){R(h)?(x=!0,Fe(),document.exitFullscreen?.()):(Le(),R(u).requestFullscreen?.())}function Le(){const L=R(u).getBoundingClientRect();l=L.width,S=L.height,E=L.left,k=L.top}function Fe(){te(u,R(u).style.position="absolute"),te(u,R(u).style.width=`${l}px`),te(u,R(u).style.height=`${S}px`),te(u,R(u).style.left=`${E}px`),te(u,R(u).style.top=`${k}px`),te(u,R(u).style.margin="0"),te(u,R(u).style.zIndex="1000")}function We(L){Se(L.key,"Escape")&&R(h)&&!x&&(x=!0,Fe())}function $e(){const L=R(h);ne(h,!!document.fullscreenElement),L&&!R(h)?(x||Fe(),x=!1,setTimeout(()=>{A()},10)):!L&&R(h)&&(te(u,R(u).style.position=""),te(u,R(u).style.width=""),te(u,R(u).style.height=""),te(u,R(u).style.left=""),te(u,R(u).style.top=""),te(u,R(u).style.margin=""),te(u,R(u).style.zIndex=""),x=!1,setTimeout(()=>{A()},10))}function Ue(L){R(h)||(i=!0,e=L.clientX,t=L.clientY,a=R(u).offsetWidth,g=R(u).offsetHeight,L.preventDefault(),document.addEventListener("mousemove",ue),document.addEventListener("mouseup",Be),document.body.style.userSelect="none",document.body.style.cursor="nw-resize")}function ue(L){if(!i)return;const T=L.clientX-e,F=L.clientY-t,ae=R(X).filter(Ge=>!Ge.isClosing).length*120+50+40,ye=Math.max(ae,300),ve=window.innerWidth-32,ke=window.innerHeight-32,Oe=Math.max(ye,Math.min(ve,a+T)),Ve=Math.max(200,Math.min(ke,g+F));te(u,R(u).style.width=`${Oe}px`),te(u,R(u).style.height=`${Ve}px`),clearTimeout(ee),ee=setTimeout(()=>{A()},50)}function Be(){if(i=!1,document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",Be),document.body.style.userSelect="",document.body.style.cursor="",!R(h)){Le();const L=R(u).offsetWidth,T=R(u).offsetHeight;j(L,T)}setTimeout(()=>{const L=R(r).get(R(d));if(L?.terminal&&L.fitAddon&&L.terminal.element){L.fitAddon.fit();const T=L.terminal.cols,F=L.terminal.rows;T>=50&&F>=15&&(console.log(`stopResize: Saving new dimensions from manual resize: ${T}x${F}`),m=T,b=F,W(T,F))}A()},100)}function Ce(L){if(R(h))return;const T=L.target;if(Se(T.tagName,"BUTTON")||T.closest("button"))return;s=!0,e=L.clientX,t=L.clientY;const F=R(u).getBoundingClientRect();v=F.left,p=F.top,L.preventDefault(),L.stopPropagation(),document.addEventListener("mousemove",Me),document.addEventListener("mouseup",Ne),document.body.style.userSelect="none",document.body.style.cursor="move",te(u,R(u).style.position="absolute"),te(u,R(u).style.left=`${v}px`),te(u,R(u).style.top=`${p}px`),te(u,R(u).style.margin="0"),te(u,R(u).style.zIndex="1000")}function Me(L){if(!s)return;const T=L.clientX-e,F=L.clientY-t,G=Math.max(0,Math.min(window.innerWidth-R(u).offsetWidth,v+T)),_e=Math.max(0,Math.min(window.innerHeight-R(u).offsetHeight,p+F));te(u,R(u).style.left=`${G}px`),te(u,R(u).style.top=`${_e}px`)}function Ne(){s=!1,document.removeEventListener("mousemove",Me),document.removeEventListener("mouseup",Ne),document.body.style.userSelect="",document.body.style.cursor="",R(h)||Le()}be(()=>(R(r),R(d)),()=>{const L=Array.from(R(r).entries()).filter(([T,F])=>F.isClosing&&Se(F.key,R(d),!1));if(L.length>0){const[T,F]=L[0];console.log(`Reactive cleanup: Cleaning up tab ${F.key} that is closing and inactive`),U(F),R(r).delete(T),ne(r,R(r))}}),be(()=>R(r),()=>{ne(X,Array.from(R(r).values()).sort((L,T)=>L.id-T.id))}),be(()=>(R(X),R(u),R(h)),()=>{const L=R(X).filter(ae=>!ae.isClosing).length,_e=L*120+50+40,Q=Math.max(_e,300);if(R(u)&&!R(h)){const ae=R(u).offsetWidth;ae{A()},10))}}),be(()=>(R(X),R(r)),()=>{console.log(...Ae("log",`Reactive tabs array updated: ${R(X).length} tabs`,R(X).map(L=>({key:L.key,id:L.id,title:L.title,isClosing:L.isClosing})))),console.log(...Ae("log",`Map has ${R(r).size} entries:`,Array.from(R(r).keys()))),console.log(...Ae("log",`Filtered tabs for rendering: ${R(X).filter(L=>!L.isClosing).length} tabs`,R(X).filter(L=>!L.isClosing).map(L=>({key:L.key,title:L.title}))))}),be(()=>(R(r),R(d)),()=>{ne(Y,R(r).get(R(d))||null)}),be(()=>R(Y),()=>{ne(Z,R(Y)?.connection||null)}),be(()=>R(Y),()=>{ne(le,R(Y)?.terminal||null)}),be(()=>R(Y),()=>{ne(O,R(Y)?.isConnecting||!1)}),be(()=>R(Y),()=>{ne(n,R(Y)?.isConnected||!1)}),be(()=>R(Y),()=>{ne(o,R(Y)?.error||"")}),be(()=>R(d),()=>{R(d)&&console.log(`Reactive: activeTabKey changed to ${R(d)}, this should bring tab to front`)}),be(()=>(R(d),R(r),ht),()=>{if(R(d)&&R(r).size>0){const L=R(r).get(R(d));L?.terminal&&L.isInitialized&&L.isConnected&&(console.log(`Reactive focus: Bringing terminal ${R(d)} to front`),ht().then(()=>{L.terminal&&(console.log(`Reactive focus: Focusing terminal ${R(d)}`),L.terminal.focus())}))}}),Ft(),At();var me=li(),De=ge(me),we=ge(De),Re=ge(we),ie=ge(Re);fe(Re);var Ke=Ie(Re,2),ze=ge(Ke),St=ge(ze);{var Ct=L=>{var T=ii();xe(L,T)},bt=L=>{var T=si();xe(L,T)};je(()=>Ye(St,L=>{R(h)?L(Ct):L(bt,!1)}),"if",he,967,10)}fe(ze);var wt=Ie(ze,4);fe(Ke),fe(we),fe(De);var Ze=Ie(De,2),ot=ge(Ze),at=ge(ot);ut(()=>(R(X),pe(()=>R(X).filter(L=>!L.isClosing))),L=>L.key),je(()=>ct(at,1,()=>(R(X),pe(()=>R(X).filter(L=>!L.isClosing))),L=>L.key,(L,T)=>{var F=ri(),G=ge(F),_e=ge(G,!0);fe(G);var de=Ie(G,2);fe(F),Xe(()=>{dt(F,1,`tab ${R(T),R(d),pe(()=>Se(R(T).key,R(d))?"active":"")??""}`,"svelte-1wb0h1r"),tt(_e,(R(T),pe(()=>R(T).title)))}),Pe("click",de,zt(()=>P(R(T).key))),Pe("click",F,()=>D(R(T).key)),Pe("keydown",F,Q=>{(Se(Q.key,"Enter")||Se(Q.key," "))&&(Q.preventDefault(),D(R(T).key))}),xe(L,F)}),"each",he,995,6);var Qe=Ie(at,2);fe(ot),fe(Ze);var et=Ie(Ze,2);ut(()=>(R(X),pe(()=>R(X).filter(L=>!L.isClosing))),L=>L.key),je(()=>ct(et,5,()=>(R(X),pe(()=>R(X).filter(L=>!L.isClosing))),L=>L.key,(L,T)=>{var F=ai(),G=ge(F);{var _e=Q=>{var ae=ni();xe(Q,ae)},de=Q=>{var ae=Dt(),ye=Wt(ae);{var ve=ke=>{var Oe=oi(),Ve=ge(Oe),Ge=Ie(ge(Ve),4),kt=ge(Ge,!0);fe(Ge),fe(Ve),fe(Oe),Xe(()=>tt(kt,(R(T),pe(()=>R(T).error)))),xe(ke,Oe)};je(()=>Ye(ye,ke=>{R(T),pe(()=>R(T).error)&&ke(ve)},!0),"if",he,1049,8)}xe(Q,ae)};je(()=>Ye(G,Q=>{R(T),pe(()=>R(T).isConnecting)?Q(_e):Q(de,!1)}),"if",he,1042,8)}fe(F),jt(F,(Q,ae)=>K?.(Q,ae),()=>R(T)),Xe(()=>{dt(F,1,`terminal-tab ${R(T),R(d),pe(()=>Se(R(T).key,R(d))?"active":"")??""}`,"svelte-1wb0h1r"),Je(F,"data-tab-key",(R(T),pe(()=>R(T).key)))}),xe(L,F)}),"each",he,1036,4),fe(et);var yt=Ie(et,2);{var Et=L=>{var T=hi();Pe("mousedown",T,Ue),xe(L,T)};je(()=>Ye(yt,L=>{R(h)||L(Et)}),"if",he,1068,2)}return fe(me),Nt(me,L=>ne(u,L),()=>R(u)),Xe(()=>{tt(ie,`Shell - ${c()??""}`),Je(ze,"title",R(h)?"Restore":"Maximize"),Je(ze,"aria-label",R(h)?"Restore":"Maximize"),Qe.disabled=(R(r),pe(()=>R(r).size>=5)),Je(Qe,"title",(R(r),pe(()=>R(r).size>=5?"Maximum 5 tabs allowed":"New tab")))}),Pe("click",ze,V),Pe("click",wt,function(...L){Rt(_,this,L,he,[979,20])}),Pe("mousedown",De,Ce),Pe("click",Qe,ce),xe(oe,me),$t({...xt()})}export{he as S};
+`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(l){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&l&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(l){const S=this._getMouseBufferCoords(l),E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!!(E&&k&&S)&&this._areCoordsInSelection(S,E,k)}isCellInSelection(l,S){const E=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!E||!k)&&this._areCoordsInSelection([l,S],E,k)}_areCoordsInSelection(l,S,E){return l[1]>S[1]&&l[1]=S[0]&&l[0]=S[0]}_selectWordAtCursor(l,S){const E=this._linkifier.currentLink?.link?.range;if(E)return this._model.selectionStart=[E.start.x-1,E.start.y-1],this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(l);return!!k&&(this._selectWordAt(k,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(l,S){this._model.clearSelection(),l=Math.max(l,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,l],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_handleTrim(l){this._model.handleTrim(l)&&this.refresh()}_getMouseBufferCoords(l){const S=this._mouseService.getCoords(l,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(l){let S=(0,r.getCoordsRelativeToElement)(this._coreBrowserService.window,l,this._screenElement)[1];const E=this._renderService.dimensions.css.canvas.height;return S>=0&&S<=E?0:(S>E&&(S-=E),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(l){return s.isMac?l.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:l.shiftKey}handleMouseDown(l){if(this._mouseDownTimeStamp=l.timeStamp,(l.button!==2||!this.hasSelection)&&l.button===0){if(!this._enabled){if(!this.shouldForceSelection(l))return;l.stopPropagation()}l.preventDefault(),this._dragScrollAmount=0,this._enabled&&l.shiftKey?this._handleIncrementalClick(l):l.detail===1?this._handleSingleClick(l):l.detail===2?this._handleDoubleClick(l):l.detail===3&&this._handleTripleClick(l),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(l){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(l))}_handleSingleClick(l){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(l)?3:0,this._model.selectionStart=this._getMouseBufferCoords(l),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(l){this._selectWordAtCursor(l,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(l){const S=this._getMouseBufferCoords(l);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(l){return l.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(l){if(l.stopImmediatePropagation(),!this._model.selectionStart)return;const S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(l),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const E=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(l.ydisp+this._bufferService.rows,l.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=l.ydisp),this.refresh()}}_handleMouseUp(l){const S=l.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&l.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const E=this._mouseService.getCoords(l,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(E&&E[0]!==void 0&&E[1]!==void 0){const k=(0,d.moveToCellSequence)(E[0]-1,E[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(k,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const l=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,E=!(!l||!S||l[0]===S[0]&&l[1]===S[1]);E?l&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&l[0]===this._oldSelectionStart[0]&&l[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(l,S,E)):this._oldHasSelection&&this._fireOnSelectionChange(l,S,E)}_fireOnSelectionChange(l,S,E){this._oldSelectionStart=l,this._oldSelectionEnd=S,this._oldHasSelection=E,this._onSelectionChange.fire()}_handleBufferActivate(l){this.clearSelection(),this._trimListener.dispose(),this._trimListener=l.activeBuffer.lines.onTrim(S=>this._handleTrim(S))}_convertViewportColToCharacterIndex(l,S){let E=S;for(let k=0;S>=k;k++){const x=l.loadCell(k,this._workCell).getChars().length;this._workCell.getWidth()===0?E--:x>1&&S!==k&&(E+=x-1)}return E}setSelection(l,S,E){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[l,S],this._model.selectionStartLength=E,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(l){this._isClickInSelection(l)||(this._selectWordAtCursor(l,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(l,S,E=!0,k=!0){if(l[0]>=this._bufferService.cols)return;const x=this._bufferService.buffer,w=x.lines.get(l[1]);if(!w)return;const B=x.translateBufferLineToString(l[1],!1);let I=this._convertViewportColToCharacterIndex(w,l[0]),$=I;const j=l[0]-I;let W=0,m=0,b=0,y=0;if(B.charAt(I)===" "){for(;I>0&&B.charAt(I-1)===" ";)I--;for(;$1&&(y+=K-1,$+=K-1);U>0&&I>0&&!this._isCharWordSeparator(w.loadCell(U-1,this._workCell));){w.loadCell(U-1,this._workCell);const A=this._workCell.getChars().length;this._workCell.getWidth()===0?(W++,U--):A>1&&(b+=A-1,I-=A-1),I--,U--}for(;q1&&(y+=A-1,$+=A-1),$++,q++}}$++;let L=I+j-W+b,P=Math.min(this._bufferService.cols,$-I+W+m-b-y);if(S||B.slice(I,$).trim()!==""){if(E&&L===0&&w.getCodePoint(0)!==32){const U=x.lines.get(l[1]-1);if(U&&w.isWrapped&&U.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,l[1]-1],!1,!0,!1);if(q){const K=this._bufferService.cols-q.start;L-=K,P+=K}}}if(k&&L+P===this._bufferService.cols&&w.getCodePoint(this._bufferService.cols-1)!==32){const U=x.lines.get(l[1]+1);if(U?.isWrapped&&U.getCodePoint(0)!==32){const q=this._getWordAt([0,l[1]+1],!1,!1,!0);q&&(P+=q.length)}}return{start:L,length:P}}}_selectWordAt(l,S){const E=this._getWordAt(l,S);if(E){for(;E.start<0;)E.start+=this._bufferService.cols,l[1]--;this._model.selectionStart=[E.start,l[1]],this._model.selectionStartLength=E.length}}_selectToWordAt(l){const S=this._getWordAt(l,!0);if(S){let E=l[1];for(;S.start<0;)S.start+=this._bufferService.cols,E--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,E++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,E]}}_isCharWordSeparator(l){return l.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(l.getChars())>=0}_selectLineAt(l){const S=this._bufferService.buffer.getWrappedRangeForLine(l),E={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,e.getRangeLength)(E,this._bufferService.cols)}};n.SelectionService=p=c([_(3,a.IBufferService),_(4,a.ICoreService),_(5,u.IMouseService),_(6,a.IOptionsService),_(7,u.IRenderService),_(8,u.ICoreBrowserService)],p)},4725:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const c=o(8343);n.ICharSizeService=(0,c.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),n.IMouseService=(0,c.createDecorator)("MouseService"),n.IRenderService=(0,c.createDecorator)("RenderService"),n.ISelectionService=(0,c.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,c.createDecorator)("ThemeService"),n.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(O,n,o){var c=this&&this.__decorate||function(p,l,S,E){var k,x=arguments.length,w=x<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,S):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(p,l,S,E);else for(var B=p.length-1;B>=0;B--)(k=p[B])&&(w=(x<3?k(w):x>3?k(l,S,w):k(l,S))||w);return x>3&&w&&Object.defineProperty(l,S,w),w},_=this&&this.__param||function(p,l){return function(S,E){l(S,E,p)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const r=o(7239),d=o(8055),f=o(8460),u=o(844),h=o(2585),i=d.css.toColor("#ffffff"),s=d.css.toColor("#000000"),e=d.css.toColor("#ffffff"),t=d.css.toColor("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const p=[d.css.toColor("#2e3436"),d.css.toColor("#cc0000"),d.css.toColor("#4e9a06"),d.css.toColor("#c4a000"),d.css.toColor("#3465a4"),d.css.toColor("#75507b"),d.css.toColor("#06989a"),d.css.toColor("#d3d7cf"),d.css.toColor("#555753"),d.css.toColor("#ef2929"),d.css.toColor("#8ae234"),d.css.toColor("#fce94f"),d.css.toColor("#729fcf"),d.css.toColor("#ad7fa8"),d.css.toColor("#34e2e2"),d.css.toColor("#eeeeec")],l=[0,95,135,175,215,255];for(let S=0;S<216;S++){const E=l[S/36%6|0],k=l[S/6%6|0],x=l[S%6];p.push({css:d.channels.toCss(E,k,x),rgba:d.channels.toRgba(E,k,x)})}for(let S=0;S<24;S++){const E=8+10*S;p.push({css:d.channels.toCss(E,E,E),rgba:d.channels.toRgba(E,E,E)})}return p})());let g=n.ThemeService=class extends u.Disposable{get colors(){return this._colors}constructor(p){super(),this._optionsService=p,this._contrastCache=new r.ColorContrastCache,this._halfContrastCache=new r.ColorContrastCache,this._onChangeColors=this.register(new f.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:i,background:s,cursor:e,cursorAccent:t,selectionForeground:void 0,selectionBackgroundTransparent:a,selectionBackgroundOpaque:d.color.blend(s,a),selectionInactiveBackgroundTransparent:a,selectionInactiveBackgroundOpaque:d.color.blend(s,a),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(p={}){const l=this._colors;if(l.foreground=v(p.foreground,i),l.background=v(p.background,s),l.cursor=v(p.cursor,e),l.cursorAccent=v(p.cursorAccent,t),l.selectionBackgroundTransparent=v(p.selectionBackground,a),l.selectionBackgroundOpaque=d.color.blend(l.background,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundTransparent=v(p.selectionInactiveBackground,l.selectionBackgroundTransparent),l.selectionInactiveBackgroundOpaque=d.color.blend(l.background,l.selectionInactiveBackgroundTransparent),l.selectionForeground=p.selectionForeground?v(p.selectionForeground,d.NULL_COLOR):void 0,l.selectionForeground===d.NULL_COLOR&&(l.selectionForeground=void 0),d.color.isOpaque(l.selectionBackgroundTransparent)&&(l.selectionBackgroundTransparent=d.color.opacity(l.selectionBackgroundTransparent,.3)),d.color.isOpaque(l.selectionInactiveBackgroundTransparent)&&(l.selectionInactiveBackgroundTransparent=d.color.opacity(l.selectionInactiveBackgroundTransparent,.3)),l.ansi=n.DEFAULT_ANSI_COLORS.slice(),l.ansi[0]=v(p.black,n.DEFAULT_ANSI_COLORS[0]),l.ansi[1]=v(p.red,n.DEFAULT_ANSI_COLORS[1]),l.ansi[2]=v(p.green,n.DEFAULT_ANSI_COLORS[2]),l.ansi[3]=v(p.yellow,n.DEFAULT_ANSI_COLORS[3]),l.ansi[4]=v(p.blue,n.DEFAULT_ANSI_COLORS[4]),l.ansi[5]=v(p.magenta,n.DEFAULT_ANSI_COLORS[5]),l.ansi[6]=v(p.cyan,n.DEFAULT_ANSI_COLORS[6]),l.ansi[7]=v(p.white,n.DEFAULT_ANSI_COLORS[7]),l.ansi[8]=v(p.brightBlack,n.DEFAULT_ANSI_COLORS[8]),l.ansi[9]=v(p.brightRed,n.DEFAULT_ANSI_COLORS[9]),l.ansi[10]=v(p.brightGreen,n.DEFAULT_ANSI_COLORS[10]),l.ansi[11]=v(p.brightYellow,n.DEFAULT_ANSI_COLORS[11]),l.ansi[12]=v(p.brightBlue,n.DEFAULT_ANSI_COLORS[12]),l.ansi[13]=v(p.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),l.ansi[14]=v(p.brightCyan,n.DEFAULT_ANSI_COLORS[14]),l.ansi[15]=v(p.brightWhite,n.DEFAULT_ANSI_COLORS[15]),p.extendedAnsi){const S=Math.min(l.ansi.length-16,p.extendedAnsi.length);for(let E=0;E{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const c=o(8460),_=o(844);class r extends _.Disposable{constructor(f){super(),this._maxLength=f,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(f){if(this._maxLength===f)return;const u=new Array(f);for(let h=0;hthis._length)for(let u=this._length;u=f;i--)this._array[this._getCyclicIndex(i+h.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;ithis._maxLength){const i=this._length+h.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=h.length}trimStart(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)}shiftElements(f,u,h){if(!(u<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+h<0)throw new Error("Cannot shift elements in list beyond index 0");if(h>0){for(let s=u-1;s>=0;s--)this.set(f+s+h,this.get(f+s));const i=f+u+h-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function o(c,_=5){if(typeof c!="object")return c;const r=Array.isArray(c)?[]:{};for(const d in c)r[d]=_<=1?c[d]:c[d]&&o(c[d],_-1);return r}},8055:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let o=0,c=0,_=0,r=0;var d,f,u,h,i;function s(t){const a=t.toString(16);return a.length<2?"0"+a:a}function e(t,a){return t>>0},t.toColor=function(a,g,v,p){return{css:t.toCss(a,g,v,p),rgba:t.toRgba(a,g,v,p)}}}(d||(n.channels=d={})),function(t){function a(g,v){return r=Math.round(255*v),[o,c,_]=i.toChannels(g.rgba),{css:d.toCss(o,c,_,r),rgba:d.toRgba(o,c,_,r)}}t.blend=function(g,v){if(r=(255&v.rgba)/255,r===1)return{css:v.css,rgba:v.rgba};const p=v.rgba>>24&255,l=v.rgba>>16&255,S=v.rgba>>8&255,E=g.rgba>>24&255,k=g.rgba>>16&255,x=g.rgba>>8&255;return o=E+Math.round((p-E)*r),c=k+Math.round((l-k)*r),_=x+Math.round((S-x)*r),{css:d.toCss(o,c,_),rgba:d.toRgba(o,c,_)}},t.isOpaque=function(g){return(255&g.rgba)==255},t.ensureContrastRatio=function(g,v,p){const l=i.ensureContrastRatio(g.rgba,v.rgba,p);if(l)return d.toColor(l>>24&255,l>>16&255,l>>8&255)},t.opaque=function(g){const v=(255|g.rgba)>>>0;return[o,c,_]=i.toChannels(v),{css:d.toCss(o,c,_),rgba:v}},t.opacity=a,t.multiplyOpacity=function(g,v){return r=255&g.rgba,a(g,r*v/255)},t.toColorRGB=function(g){return[g.rgba>>24&255,g.rgba>>16&255,g.rgba>>8&255]}}(f||(n.color=f={})),function(t){let a,g;try{const v=document.createElement("canvas");v.width=1,v.height=1;const p=v.getContext("2d",{willReadFrequently:!0});p&&(a=p,a.globalCompositeOperation="copy",g=a.createLinearGradient(0,0,1,1))}catch{}t.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return o=parseInt(v.slice(1,2).repeat(2),16),c=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),d.toColor(o,c,_);case 5:return o=parseInt(v.slice(1,2).repeat(2),16),c=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),r=parseInt(v.slice(4,5).repeat(2),16),d.toColor(o,c,_,r);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const p=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(p)return o=parseInt(p[1]),c=parseInt(p[2]),_=parseInt(p[3]),r=Math.round(255*(p[5]===void 0?1:parseFloat(p[5]))),d.toColor(o,c,_,r);if(!a||!g)throw new Error("css.toColor: Unsupported css format");if(a.fillStyle=g,a.fillStyle=v,typeof a.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(a.fillRect(0,0,1,1),[o,c,_,r]=a.getImageData(0,0,1,1).data,r!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(o,c,_,r),css:v}}}(u||(n.css=u={})),function(t){function a(g,v,p){const l=g/255,S=v/255,E=p/255;return .2126*(l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4))+.7152*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.0722*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))}t.relativeLuminance=function(g){return a(g>>16&255,g>>8&255,255&g)},t.relativeLuminance2=a}(h||(n.rgb=h={})),function(t){function a(v,p,l){const S=v>>24&255,E=v>>16&255,k=v>>8&255;let x=p>>24&255,w=p>>16&255,B=p>>8&255,I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));for(;I0||w>0||B>0);)x-=Math.max(0,Math.ceil(.1*x)),w-=Math.max(0,Math.ceil(.1*w)),B-=Math.max(0,Math.ceil(.1*B)),I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));return(x<<24|w<<16|B<<8|255)>>>0}function g(v,p,l){const S=v>>24&255,E=v>>16&255,k=v>>8&255;let x=p>>24&255,w=p>>16&255,B=p>>8&255,I=e(h.relativeLuminance2(x,w,B),h.relativeLuminance2(S,E,k));for(;I>>0}t.blend=function(v,p){if(r=(255&p)/255,r===1)return p;const l=p>>24&255,S=p>>16&255,E=p>>8&255,k=v>>24&255,x=v>>16&255,w=v>>8&255;return o=k+Math.round((l-k)*r),c=x+Math.round((S-x)*r),_=w+Math.round((E-w)*r),d.toRgba(o,c,_)},t.ensureContrastRatio=function(v,p,l){const S=h.relativeLuminance(v>>8),E=h.relativeLuminance(p>>8);if(e(S,E)>8));if(Be(S,h.relativeLuminance(I>>8))?w:I}return w}const k=g(v,p,l),x=e(S,h.relativeLuminance(k>>8));if(xe(S,h.relativeLuminance(w>>8))?k:w}return k}},t.reduceLuminance=a,t.increaseLuminance=g,t.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}}(i||(n.rgba=i={})),n.toPaddedHex=s,n.contrastRatio=e},8969:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const c=o(844),_=o(2585),r=o(4348),d=o(7866),f=o(744),u=o(7302),h=o(6975),i=o(8460),s=o(1753),e=o(1480),t=o(7994),a=o(9282),g=o(5435),v=o(5981),p=o(2660);let l=!1;class S extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new i.EventEmitter),this._onScroll.event(k=>{this._onScrollApi?.fire(k.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(k){for(const x in k)this.optionsService.options[x]=k[x]}constructor(k){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new i.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new i.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new i.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new i.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new i.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new i.EventEmitter),this._instantiationService=new r.InstantiationService,this.optionsService=this.register(new u.OptionsService(k)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(f.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(h.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(s.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(e.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(p.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new g.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,i.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,i.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,i.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,i.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(x=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new v.WriteBuffer((x,w)=>this._inputHandler.parse(x,w))),this.register((0,i.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(k,x){this._writeBuffer.write(k,x)}writeSync(k,x){this._logService.logLevel<=_.LogLevelEnum.WARN&&!l&&(this._logService.warn("writeSync is unreliable and will be removed soon."),l=!0),this._writeBuffer.writeSync(k,x)}input(k,x=!0){this.coreService.triggerDataEvent(k,x)}resize(k,x){isNaN(k)||isNaN(x)||(k=Math.max(k,f.MINIMUM_COLS),x=Math.max(x,f.MINIMUM_ROWS),this._bufferService.resize(k,x))}scroll(k,x=!1){this._bufferService.scroll(k,x)}scrollLines(k,x,w){this._bufferService.scrollLines(k,x,w)}scrollPages(k){this.scrollLines(k*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(k){const x=k-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)}registerEscHandler(k,x){return this._inputHandler.registerEscHandler(k,x)}registerDcsHandler(k,x){return this._inputHandler.registerDcsHandler(k,x)}registerCsiHandler(k,x){return this._inputHandler.registerCsiHandler(k,x)}registerOscHandler(k,x){return this._inputHandler.registerOscHandler(k,x)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let k=!1;const x=this.optionsService.rawOptions.windowsPty;x&&x.buildNumber!==void 0&&x.buildNumber!==void 0?k=x.backend==="conpty"&&x.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(k=!0),k?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const k=[];k.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),k.push(this.registerCsiHandler({final:"H"},()=>((0,a.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const x of k)x.dispose()})}}}n.CoreTerminal=S},8460:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(_))},n.runAndSubscribe=function(o,c){return c(void 0),o(_=>c(_))}},5435:function(O,n,o){var c=this&&this.__decorate||function(W,m,b,y){var L,P=arguments.length,U=P<3?m:y===null?y=Object.getOwnPropertyDescriptor(m,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(W,m,b,y);else for(var q=W.length-1;q>=0;q--)(L=W[q])&&(U=(P<3?L(U):P>3?L(m,b,U):L(m,b))||U);return P>3&&U&&Object.defineProperty(m,b,U),U},_=this&&this.__param||function(W,m){return function(b,y){m(b,y,W)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const r=o(2584),d=o(7116),f=o(2015),u=o(844),h=o(482),i=o(8437),s=o(8460),e=o(643),t=o(511),a=o(3734),g=o(2585),v=o(1480),p=o(6242),l=o(6351),S=o(5941),E={"(":0,")":1,"*":2,"+":3,"-":1,".":2},k=131072;function x(W,m){if(W>24)return m.setWinLines||!1;switch(W){case 1:return!!m.restoreWin;case 2:return!!m.minimizeWin;case 3:return!!m.setWinPosition;case 4:return!!m.setWinSizePixels;case 5:return!!m.raiseWin;case 6:return!!m.lowerWin;case 7:return!!m.refreshWin;case 8:return!!m.setWinSizeChars;case 9:return!!m.maximizeWin;case 10:return!!m.fullscreenWin;case 11:return!!m.getWinState;case 13:return!!m.getWinPosition;case 14:return!!m.getWinSizePixels;case 15:return!!m.getScreenSizePixels;case 16:return!!m.getCellSizePixels;case 18:return!!m.getWinSizeChars;case 19:return!!m.getScreenSizeChars;case 20:return!!m.getIconTitle;case 21:return!!m.getWinTitle;case 22:return!!m.pushTitle;case 23:return!!m.popTitle;case 24:return!!m.setWinLines}return!1}var w;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w||(n.WindowsOptionsReportType=w={}));let B=0;class I extends u.Disposable{getAttrData(){return this._curAttrData}constructor(m,b,y,L,P,U,q,K,A=new f.EscapeSequenceParser){super(),this._bufferService=m,this._charsetService=b,this._coreService=y,this._logService=L,this._optionsService=P,this._oscLinkService=U,this._coreMouseService=q,this._unicodeService=K,this._parser=A,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new h.StringToUtf32,this._utf8Decoder=new h.Utf8ToUtf32,this._workCell=new t.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new s.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new s.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new s.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new s.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new s.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new s.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new s.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new s.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new s.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new s.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new s.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new s.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new $(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(C=>this._activeBuffer=C.activeBuffer)),this._parser.setCsiHandlerFallback((C,M)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(C),params:M.toArray()})}),this._parser.setEscHandlerFallback(C=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(C)})}),this._parser.setExecuteHandlerFallback(C=>{this._logService.debug("Unknown EXECUTE code: ",{code:C})}),this._parser.setOscHandlerFallback((C,M,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:C,action:M,data:H})}),this._parser.setDcsHandlerFallback((C,M,H)=>{M==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(C),action:M,payload:H})}),this._parser.setPrintHandler((C,M,H)=>this.print(C,M,H)),this._parser.registerCsiHandler({final:"@"},C=>this.insertChars(C)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},C=>this.scrollLeft(C)),this._parser.registerCsiHandler({final:"A"},C=>this.cursorUp(C)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},C=>this.scrollRight(C)),this._parser.registerCsiHandler({final:"B"},C=>this.cursorDown(C)),this._parser.registerCsiHandler({final:"C"},C=>this.cursorForward(C)),this._parser.registerCsiHandler({final:"D"},C=>this.cursorBackward(C)),this._parser.registerCsiHandler({final:"E"},C=>this.cursorNextLine(C)),this._parser.registerCsiHandler({final:"F"},C=>this.cursorPrecedingLine(C)),this._parser.registerCsiHandler({final:"G"},C=>this.cursorCharAbsolute(C)),this._parser.registerCsiHandler({final:"H"},C=>this.cursorPosition(C)),this._parser.registerCsiHandler({final:"I"},C=>this.cursorForwardTab(C)),this._parser.registerCsiHandler({final:"J"},C=>this.eraseInDisplay(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},C=>this.eraseInDisplay(C,!0)),this._parser.registerCsiHandler({final:"K"},C=>this.eraseInLine(C,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},C=>this.eraseInLine(C,!0)),this._parser.registerCsiHandler({final:"L"},C=>this.insertLines(C)),this._parser.registerCsiHandler({final:"M"},C=>this.deleteLines(C)),this._parser.registerCsiHandler({final:"P"},C=>this.deleteChars(C)),this._parser.registerCsiHandler({final:"S"},C=>this.scrollUp(C)),this._parser.registerCsiHandler({final:"T"},C=>this.scrollDown(C)),this._parser.registerCsiHandler({final:"X"},C=>this.eraseChars(C)),this._parser.registerCsiHandler({final:"Z"},C=>this.cursorBackwardTab(C)),this._parser.registerCsiHandler({final:"`"},C=>this.charPosAbsolute(C)),this._parser.registerCsiHandler({final:"a"},C=>this.hPositionRelative(C)),this._parser.registerCsiHandler({final:"b"},C=>this.repeatPrecedingCharacter(C)),this._parser.registerCsiHandler({final:"c"},C=>this.sendDeviceAttributesPrimary(C)),this._parser.registerCsiHandler({prefix:">",final:"c"},C=>this.sendDeviceAttributesSecondary(C)),this._parser.registerCsiHandler({final:"d"},C=>this.linePosAbsolute(C)),this._parser.registerCsiHandler({final:"e"},C=>this.vPositionRelative(C)),this._parser.registerCsiHandler({final:"f"},C=>this.hVPosition(C)),this._parser.registerCsiHandler({final:"g"},C=>this.tabClear(C)),this._parser.registerCsiHandler({final:"h"},C=>this.setMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"h"},C=>this.setModePrivate(C)),this._parser.registerCsiHandler({final:"l"},C=>this.resetMode(C)),this._parser.registerCsiHandler({prefix:"?",final:"l"},C=>this.resetModePrivate(C)),this._parser.registerCsiHandler({final:"m"},C=>this.charAttributes(C)),this._parser.registerCsiHandler({final:"n"},C=>this.deviceStatus(C)),this._parser.registerCsiHandler({prefix:"?",final:"n"},C=>this.deviceStatusPrivate(C)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},C=>this.softReset(C)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},C=>this.setCursorStyle(C)),this._parser.registerCsiHandler({final:"r"},C=>this.setScrollRegion(C)),this._parser.registerCsiHandler({final:"s"},C=>this.saveCursor(C)),this._parser.registerCsiHandler({final:"t"},C=>this.windowOptions(C)),this._parser.registerCsiHandler({final:"u"},C=>this.restoreCursor(C)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},C=>this.insertColumns(C)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},C=>this.deleteColumns(C)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},C=>this.selectProtected(C)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},C=>this.requestMode(C,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},C=>this.requestMode(C,!1)),this._parser.setExecuteHandler(r.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(r.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(r.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(r.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(r.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(r.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(r.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(r.C1.IND,()=>this.index()),this._parser.setExecuteHandler(r.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(r.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new p.OscHandler(C=>(this.setTitle(C),this.setIconName(C),!0))),this._parser.registerOscHandler(1,new p.OscHandler(C=>this.setIconName(C))),this._parser.registerOscHandler(2,new p.OscHandler(C=>this.setTitle(C))),this._parser.registerOscHandler(4,new p.OscHandler(C=>this.setOrReportIndexedColor(C))),this._parser.registerOscHandler(8,new p.OscHandler(C=>this.setHyperlink(C))),this._parser.registerOscHandler(10,new p.OscHandler(C=>this.setOrReportFgColor(C))),this._parser.registerOscHandler(11,new p.OscHandler(C=>this.setOrReportBgColor(C))),this._parser.registerOscHandler(12,new p.OscHandler(C=>this.setOrReportCursorColor(C))),this._parser.registerOscHandler(104,new p.OscHandler(C=>this.restoreIndexedColor(C))),this._parser.registerOscHandler(110,new p.OscHandler(C=>this.restoreFgColor(C))),this._parser.registerOscHandler(111,new p.OscHandler(C=>this.restoreBgColor(C))),this._parser.registerOscHandler(112,new p.OscHandler(C=>this.restoreCursorColor(C))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const C in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:C},()=>this.selectCharset("("+C)),this._parser.registerEscHandler({intermediates:")",final:C},()=>this.selectCharset(")"+C)),this._parser.registerEscHandler({intermediates:"*",final:C},()=>this.selectCharset("*"+C)),this._parser.registerEscHandler({intermediates:"+",final:C},()=>this.selectCharset("+"+C)),this._parser.registerEscHandler({intermediates:"-",final:C},()=>this.selectCharset("-"+C)),this._parser.registerEscHandler({intermediates:".",final:C},()=>this.selectCharset("."+C)),this._parser.registerEscHandler({intermediates:"/",final:C},()=>this.selectCharset("/"+C));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(C=>(this._logService.error("Parsing error: ",C),C)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new l.DcsHandler((C,M)=>this.requestStatusString(C,M)))}_preserveStack(m,b,y,L){this._parseStack.paused=!0,this._parseStack.cursorStartX=m,this._parseStack.cursorStartY=b,this._parseStack.decodedLength=y,this._parseStack.position=L}_logSlowResolvingAsync(m){this._logService.logLevel<=g.LogLevelEnum.WARN&&Promise.race([m,new Promise((b,y)=>setTimeout(()=>y("#SLOW_TIMEOUT"),5e3))]).catch(b=>{if(b!=="#SLOW_TIMEOUT")throw b;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(m,b){let y,L=this._activeBuffer.x,P=this._activeBuffer.y,U=0;const q=this._parseStack.paused;if(q){if(y=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,b))return this._logSlowResolvingAsync(y),y;L=this._parseStack.cursorStartX,P=this._parseStack.cursorStartY,this._parseStack.paused=!1,m.length>k&&(U=this._parseStack.position+k)}if(this._logService.logLevel<=g.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof m=="string"?` "${m}"`:` "${Array.prototype.map.call(m,C=>String.fromCharCode(C)).join("")}"`),typeof m=="string"?m.split("").map(C=>C.charCodeAt(0)):m),this._parseBuffer.lengthk)for(let C=U;C0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,M);let z=this._parser.precedingJoinState;for(let N=b;NK){if(A){const le=H;let V=this._activeBuffer.x-ee;for(this._activeBuffer.x=ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ee>0&&H instanceof i.BufferLine&&H.copyCellsFrom(le,V,0,ee,!1);V=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}else if(C&&(H.insertCells(this._activeBuffer.x,P-ee,this._activeBuffer.getNullCell(M)),H.getWidth(K-1)===2&&H.setCellFromCodepoint(K-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,M)),H.setCellFromCodepoint(this._activeBuffer.x++,L,P,M),P>0)for(;--P;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,M)}this._parser.precedingJoinState=z,this._activeBuffer.x0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,M),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(m,b){return m.final!=="t"||m.prefix||m.intermediates?this._parser.registerCsiHandler(m,b):this._parser.registerCsiHandler(m,y=>!x(y.params[0],this._optionsService.rawOptions.windowOptions)||b(y))}registerDcsHandler(m,b){return this._parser.registerDcsHandler(m,new l.DcsHandler(b))}registerEscHandler(m,b){return this._parser.registerEscHandler(m,b)}registerOscHandler(m,b){return this._parser.registerOscHandler(m,new p.OscHandler(b))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);m.hasWidth(this._activeBuffer.x)&&!m.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const m=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-m),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(m=this._bufferService.cols-1){this._activeBuffer.x=Math.min(m,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(m,b){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=m,this._activeBuffer.y=this._activeBuffer.scrollTop+b):(this._activeBuffer.x=m,this._activeBuffer.y=b),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(m,b){this._restrictCursor(),this._setCursor(this._activeBuffer.x+m,this._activeBuffer.y+b)}cursorUp(m){const b=this._activeBuffer.y-this._activeBuffer.scrollTop;return b>=0?this._moveCursor(0,-Math.min(b,m.params[0]||1)):this._moveCursor(0,-(m.params[0]||1)),!0}cursorDown(m){const b=this._activeBuffer.scrollBottom-this._activeBuffer.y;return b>=0?this._moveCursor(0,Math.min(b,m.params[0]||1)):this._moveCursor(0,m.params[0]||1),!0}cursorForward(m){return this._moveCursor(m.params[0]||1,0),!0}cursorBackward(m){return this._moveCursor(-(m.params[0]||1),0),!0}cursorNextLine(m){return this.cursorDown(m),this._activeBuffer.x=0,!0}cursorPrecedingLine(m){return this.cursorUp(m),this._activeBuffer.x=0,!0}cursorCharAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(m){return this._setCursor(m.length>=2?(m.params[1]||1)-1:0,(m.params[0]||1)-1),!0}charPosAbsolute(m){return this._setCursor((m.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(m){return this._moveCursor(m.params[0]||1,0),!0}linePosAbsolute(m){return this._setCursor(this._activeBuffer.x,(m.params[0]||1)-1),!0}vPositionRelative(m){return this._moveCursor(0,m.params[0]||1),!0}hVPosition(m){return this.cursorPosition(m),!0}tabClear(m){const b=m.params[0];return b===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:b===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(m){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let b=m.params[0]||1;for(;b--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(m){const b=m.params[0];return b===1&&(this._curAttrData.bg|=536870912),b!==2&&b!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(m,b,y,L=!1,P=!1){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);U.replaceCells(b,y,this._activeBuffer.getNullCell(this._eraseAttrData()),P),L&&(U.isWrapped=!1)}_resetBufferLine(m,b=!1){const y=this._activeBuffer.lines.get(this._activeBuffer.ybase+m);y&&(y.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),b),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+m),y.isWrapped=!1)}eraseInDisplay(m,b=!1){let y;switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:for(y=this._activeBuffer.y,this._dirtyRowTracker.markDirty(y),this._eraseInBufferLine(y++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);y=this._bufferService.cols&&(this._activeBuffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowTracker.markDirty(y-1);y--;)this._resetBufferLine(y,b);this._dirtyRowTracker.markDirty(0);break;case 3:const L=this._activeBuffer.lines.length-this._bufferService.rows;L>0&&(this._activeBuffer.lines.trimStart(L),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-L,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-L,0),this._onScroll.fire(0))}return!0}eraseInLine(m,b=!1){switch(this._restrictCursor(this._bufferService.cols),m.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,b);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,b);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,b)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(m){this._restrictCursor();let b=m.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let A=K;for(let C=1;C0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(r.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(r.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(m){return m.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(r.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(r.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(m.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(r.C0.ESC+"[>83;40003;0c")),!0}_is(m){return(this._optionsService.rawOptions.termName+"").indexOf(m)===0}setMode(m){for(let b=0;bse?1:2,z=m.params[0];return N=z,J=b?z===2?4:z===4?H(U.modes.insertMode):z===12?3:z===20?H(M.convertEol):0:z===1?H(y.applicationCursorKeys):z===3?M.windowOptions.setWinLines?K===80?2:K===132?1:0:0:z===6?H(y.origin):z===7?H(y.wraparound):z===8?3:z===9?H(L==="X10"):z===12?H(M.cursorBlink):z===25?H(!U.isCursorHidden):z===45?H(y.reverseWraparound):z===66?H(y.applicationKeypad):z===67?4:z===1e3?H(L==="VT200"):z===1002?H(L==="DRAG"):z===1003?H(L==="ANY"):z===1004?H(y.sendFocus):z===1005?4:z===1006?H(P==="SGR"):z===1015?4:z===1016?H(P==="SGR_PIXELS"):z===1048?1:z===47||z===1047||z===1049?H(A===C):z===2004?H(y.bracketedPasteMode):0,U.triggerDataEvent(`${r.C0.ESC}[${b?"":"?"}${N};${J}$y`),!0;var N,J}_updateAttrColor(m,b,y,L,P){return b===2?(m|=50331648,m&=-16777216,m|=a.AttributeData.fromColorRGB([y,L,P])):b===5&&(m&=-50331904,m|=33554432|255&y),m}_extractColor(m,b,y){const L=[0,0,-1,0,0,0];let P=0,U=0;do{if(L[U+P]=m.params[b+U],m.hasSubParams(b+U)){const q=m.getSubParams(b+U);let K=0;do L[1]===5&&(P=1),L[U+K+1+P]=q[K];while(++K=2||L[1]===2&&U+P>=5)break;L[1]&&(P=1)}while(++U+b5)&&(m=1),b.extended.underlineStyle=m,b.fg|=268435456,m===0&&(b.fg&=-268435457),b.updateExtended()}_processSGR0(m){m.fg=i.DEFAULT_ATTR_DATA.fg,m.bg=i.DEFAULT_ATTR_DATA.bg,m.extended=m.extended.clone(),m.extended.underlineStyle=0,m.extended.underlineColor&=-67108864,m.updateExtended()}charAttributes(m){if(m.length===1&&m.params[0]===0)return this._processSGR0(this._curAttrData),!0;const b=m.length;let y;const L=this._curAttrData;for(let P=0;P=30&&y<=37?(L.fg&=-50331904,L.fg|=16777216|y-30):y>=40&&y<=47?(L.bg&=-50331904,L.bg|=16777216|y-40):y>=90&&y<=97?(L.fg&=-50331904,L.fg|=16777224|y-90):y>=100&&y<=107?(L.bg&=-50331904,L.bg|=16777224|y-100):y===0?this._processSGR0(L):y===1?L.fg|=134217728:y===3?L.bg|=67108864:y===4?(L.fg|=268435456,this._processUnderline(m.hasSubParams(P)?m.getSubParams(P)[0]:1,L)):y===5?L.fg|=536870912:y===7?L.fg|=67108864:y===8?L.fg|=1073741824:y===9?L.fg|=2147483648:y===2?L.bg|=134217728:y===21?this._processUnderline(2,L):y===22?(L.fg&=-134217729,L.bg&=-134217729):y===23?L.bg&=-67108865:y===24?(L.fg&=-268435457,this._processUnderline(0,L)):y===25?L.fg&=-536870913:y===27?L.fg&=-67108865:y===28?L.fg&=-1073741825:y===29?L.fg&=2147483647:y===39?(L.fg&=-67108864,L.fg|=16777215&i.DEFAULT_ATTR_DATA.fg):y===49?(L.bg&=-67108864,L.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?P+=this._extractColor(m,P,L):y===53?L.bg|=1073741824:y===55?L.bg&=-1073741825:y===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):y===100?(L.fg&=-67108864,L.fg|=16777215&i.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&i.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0}deviceStatus(m){switch(m.params[0]){case 5:this._coreService.triggerDataEvent(`${r.C0.ESC}[0n`);break;case 6:const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${r.C0.ESC}[${b};${y}R`)}return!0}deviceStatusPrivate(m){if(m.params[0]===6){const b=this._activeBuffer.y+1,y=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${r.C0.ESC}[?${b};${y}R`)}return!0}softReset(m){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(m){const b=m.params[0]||1;switch(b){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const y=b%2==1;return this._optionsService.options.cursorBlink=y,!0}setScrollRegion(m){const b=m.params[0]||1;let y;return(m.length<2||(y=m.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>b&&(this._activeBuffer.scrollTop=b-1,this._activeBuffer.scrollBottom=y-1,this._setCursor(0,0)),!0}windowOptions(m){if(!x(m.params[0],this._optionsService.rawOptions.windowOptions))return!0;const b=m.length>1?m.params[1]:0;switch(m.params[0]){case 14:b!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${r.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:b!==0&&b!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),b!==0&&b!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:b!==0&&b!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),b!==0&&b!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(m){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(m){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(m){return this._windowTitle=m,this._onTitleChange.fire(m),!0}setIconName(m){return this._iconName=m,!0}setOrReportIndexedColor(m){const b=[],y=m.split(";");for(;y.length>1;){const L=y.shift(),P=y.shift();if(/^\d+$/.exec(L)){const U=parseInt(L);if(j(U))if(P==="?")b.push({type:0,index:U});else{const q=(0,S.parseColor)(P);q&&b.push({type:1,index:U,color:q})}}}return b.length&&this._onColor.fire(b),!0}setHyperlink(m){const b=m.split(";");return!(b.length<2)&&(b[1]?this._createHyperlink(b[0],b[1]):!b[0]&&this._finishHyperlink())}_createHyperlink(m,b){this._getCurrentLinkId()&&this._finishHyperlink();const y=m.split(":");let L;const P=y.findIndex(U=>U.startsWith("id="));return P!==-1&&(L=y[P].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:L,uri:b}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(m,b){const y=m.split(";");for(let L=0;L=this._specialColors.length);++L,++b)if(y[L]==="?")this._onColor.fire([{type:0,index:this._specialColors[b]}]);else{const P=(0,S.parseColor)(y[L]);P&&this._onColor.fire([{type:1,index:this._specialColors[b],color:P}])}return!0}setOrReportFgColor(m){return this._setOrReportSpecialColor(m,0)}setOrReportBgColor(m){return this._setOrReportSpecialColor(m,1)}setOrReportCursorColor(m){return this._setOrReportSpecialColor(m,2)}restoreIndexedColor(m){if(!m)return this._onColor.fire([{type:2}]),!0;const b=[],y=m.split(";");for(let L=0;L=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const m=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,m,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=i.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=i.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(m){return this._charsetService.setgLevel(m),!0}screenAlignmentPattern(){const m=new t.CellData;m.content=4194373,m.fg=this._curAttrData.fg,m.bg=this._curAttrData.bg,this._setCursor(0,0);for(let b=0;b(this._coreService.triggerDataEvent(`${r.C0.ESC}${P}${r.C0.ESC}\\`),!0))(m==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:m==='"p'?'P1$r61;1"p':m==="r"?`P1$r${y.scrollTop+1};${y.scrollBottom+1}r`:m==="m"?"P1$r0m":m===" q"?`P1$r${{block:2,underline:4,bar:6}[L.cursorStyle]-(L.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(m,b){this._dirtyRowTracker.markRangeDirty(m,b)}}n.InputHandler=I;let $=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){Wthis.end&&(this.end=W)}markRangeDirty(W,m){W>m&&(B=W,W=m,m=B),Wthis.end&&(this.end=m)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j(W){return 0<=W&&W<256}$=c([_(0,g.IBufferService)],$)},844:(O,n)=>{function o(c){for(const _ of c)_.dispose();c.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const _=this._disposables.indexOf(c);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},n.toDisposable=function(c){return{dispose:c}},n.disposeArray=o,n.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(_,r,d){this._data[_]||(this._data[_]={}),this._data[_][r]=d}get(_,r){return this._data[_]?this._data[_][r]:void 0}clear(){this._data={}}}n.TwoKeyMap=o,n.FourKeyMap=class{constructor(){this._data=new o}set(c,_,r,d,f){this._data.get(c,_)||this._data.set(c,_,new o),this._data.get(c,_).set(r,d,f)}get(c,_,r,d){return this._data.get(c,_)?.get(r,d)}clear(){this._data.clear()}}},6114:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const o=n.isNode?"node":navigator.userAgent,c=n.isNode?"node":navigator.platform;n.isFirefox=o.includes("Firefox"),n.isLegacyEdge=o.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(o),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=o.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),n.isIpad=c==="iPad",n.isIphone=c==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),n.isLinux=c.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(o)},6106:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let o=0;n.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const _=this._getKey(c);if(_===void 0||(o=this._search(_),o===-1)||this._getKey(this._array[o])!==_)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===c))do _(this._array[o]);while(++o=_;){let d=_+r>>1;const f=this._getKey(this._array[d]);if(f>c)r=d-1;else{if(!(f0&&this._getKey(this._array[d-1])===c;)d--;return d}_=d+1}}return _}}},7226:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const c=o(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(f){this._tasks.push(f),this._start()}flush(){for(;this._is)return i-u<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-u))}ms`),void this._start();i=s}this.clear()}}class r extends _{_requestCallback(f){return setTimeout(()=>f(this._createDeadline(16)))}_cancelCallback(f){clearTimeout(f)}_createDeadline(f){const u=Date.now()+f;return{timeRemaining:()=>Math.max(0,u-Date.now())}}}n.PriorityTaskQueue=r,n.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:r,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const c=o(643);n.updateWindowsModeWrappedState=function(_){const r=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),d=r?.get(_.cols-1),f=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);f&&d&&(f.isWrapped=d[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&d[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(O,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(r){return[r>>>16&255,r>>>8&255,255&r]}static fromColorRGB(r){return(255&r[0])<<16|(255&r[1])<<8|255&r[2]}clone(){const r=new o;return r.fg=this.fg,r.bg=this.bg,r.extended=this.extended.clone(),r}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}n.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(r){this._ext=r}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(r){this._ext&=-469762049,this._ext|=r<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(r){this._ext&=-67108864,this._ext|=67108863&r}get urlId(){return this._urlId}set urlId(r){this._urlId=r}get underlineVariantOffset(){const r=(3758096384&this._ext)>>29;return r<0?4294967288^r:r}set underlineVariantOffset(r){this._ext&=536870911,this._ext|=r<<29&3758096384}constructor(r=0,d=0){this._ext=0,this._urlId=0,this._ext=r,this._urlId=d}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=c},9092:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const c=o(6349),_=o(7226),r=o(3734),d=o(8437),f=o(4634),u=o(511),h=o(643),i=o(4863),s=o(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(e,t,a){this._hasScrollback=e,this._optionsService=t,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=s.DEFAULT_CHARSET,this.markers=[],this._nullCell=u.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]),this._whitespaceCell=u.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new r.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new r.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&en.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const a=this.getNullCell(d.DEFAULT_ATTR_DATA);let g=0;const v=this._getCorrectBufferLength(t);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,a)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=v}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let p=0;p.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const a=(0,f.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(a.length>0){const g=(0,f.reflowLargerCreateNewLayout)(this.lines,a);(0,f.reflowLargerApplyNewLayout)(this.lines,g.layout),this._reflowLargerAdjustViewport(e,t,g.countRemoved)}}_reflowLargerAdjustViewport(e,t,a){const g=this.getNullCell(d.DEFAULT_ATTR_DATA);let v=a;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;p--){let l=this.lines.get(p);if(!l||!l.isWrapped&&l.getTrimmedLength()<=e)continue;const S=[l];for(;l.isWrapped&&p>0;)l=this.lines.get(--p),S.unshift(l);const E=this.ybase+this.y;if(E>=p&&E0&&(g.push({start:p+S.length+v,newLines:I}),v+=I.length),S.push(...I);let $=x.length-1,j=x[$];j===0&&($--,j=x[$]);let W=S.length-w-1,m=k;for(;W>=0;){const y=Math.min(m,j);if(S[$]===void 0)break;if(S[$].copyCellsFrom(S[W],m-y,j-y,y,!0),j-=y,j===0&&($--,j=x[$]),m-=y,m===0){W--;const L=Math.max(W,0);m=(0,f.getWrappedLineTrimmedLength)(S,L,this._cols)}}for(let y=0;y0;)this.ybase===0?this.y0){const p=[],l=[];for(let $=0;$=0;$--)if(x&&x.start>E+w){for(let j=x.newLines.length-1;j>=0;j--)this.lines.set($--,x.newLines[j]);$++,p.push({index:E+1,amount:x.newLines.length}),w+=x.newLines.length,x=g[++k]}else this.lines.set($,l[E--]);let B=0;for(let $=p.length-1;$>=0;$--)p[$].index+=B,this.lines.onInsertEmitter.fire(p[$]),B+=p[$].amount;const I=Math.max(0,S+v-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(e,t,a=0,g){const v=this.lines.get(e);return v?v.translateToString(t,a,g):""}getWrappedRangeForLine(e){let t=e,a=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;a+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=a,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(a=>{t.line>=a.index&&(t.line+=a.amount)})),t.register(this.lines.onDelete(a=>{t.line>=a.index&&t.linea.index&&(t.line-=a.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(O,n,o)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const c=o(3734),_=o(511),r=o(643),d=o(482);n.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let f=0;class u{constructor(i,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*i);const t=s||_.CellData.fromCharData([0,r.NULL_CELL_CHAR,r.NULL_CELL_WIDTH,r.NULL_CELL_CODE]);for(let a=0;a>22,2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):e]}set(i,s){this._data[3*i+1]=s[r.CHAR_DATA_ATTR_INDEX],s[r.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[i]=s[1],this._data[3*i+0]=2097152|i|s[r.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*i+0]=s[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[r.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(i){return this._data[3*i+0]>>22}hasWidth(i){return 12582912&this._data[3*i+0]}getFg(i){return this._data[3*i+1]}getBg(i){return this._data[3*i+2]}hasContent(i){return 4194303&this._data[3*i+0]}getCodePoint(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i].charCodeAt(this._combined[i].length-1):2097151&s}isCombined(i){return 2097152&this._data[3*i+0]}getString(i){const s=this._data[3*i+0];return 2097152&s?this._combined[i]:2097151&s?(0,d.stringFromCodePoint)(2097151&s):""}isProtected(i){return 536870912&this._data[3*i+2]}loadCell(i,s){return f=3*i,s.content=this._data[f+0],s.fg=this._data[f+1],s.bg=this._data[f+2],2097152&s.content&&(s.combinedData=this._combined[i]),268435456&s.bg&&(s.extended=this._extendedAttrs[i]),s}setCell(i,s){2097152&s.content&&(this._combined[i]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[i]=s.extended),this._data[3*i+0]=s.content,this._data[3*i+1]=s.fg,this._data[3*i+2]=s.bg}setCellFromCodepoint(i,s,e,t){268435456&t.bg&&(this._extendedAttrs[i]=t.extended),this._data[3*i+0]=s|e<<22,this._data[3*i+1]=t.fg,this._data[3*i+2]=t.bg}addCodepointToCell(i,s,e){let t=this._data[3*i+0];2097152&t?this._combined[i]+=(0,d.stringFromCodePoint)(s):2097151&t?(this._combined[i]=(0,d.stringFromCodePoint)(2097151&t)+(0,d.stringFromCodePoint)(s),t&=-2097152,t|=2097152):t=s|4194304,e&&(t&=-12582913,t|=e<<22),this._data[3*i+0]=t}insertCells(i,s,e){if((i%=this.length)&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i-1,0,1,e),s=0;--a)this.setCell(i+s+a,this.loadCell(i+a,t));for(let a=0;athis.length){if(this._data.buffer.byteLength>=4*e)this._data=new Uint32Array(this._data.buffer,0,e);else{const t=new Uint32Array(e);t.set(this._data),this._data=t}for(let t=this.length;t=i&&delete this._combined[v]}const a=Object.keys(this._extendedAttrs);for(let g=0;g=i&&delete this._extendedAttrs[v]}}return this.length=i,4*e*2=0;--i)if(4194303&this._data[3*i+0])return i+(this._data[3*i+0]>>22);return 0}getNoBgTrimmedLength(){for(let i=this.length-1;i>=0;--i)if(4194303&this._data[3*i+0]||50331648&this._data[3*i+2])return i+(this._data[3*i+0]>>22);return 0}copyCellsFrom(i,s,e,t,a){const g=i._data;if(a)for(let p=t-1;p>=0;p--){for(let l=0;l<3;l++)this._data[3*(e+p)+l]=g[3*(s+p)+l];268435456&g[3*(s+p)+2]&&(this._extendedAttrs[e+p]=i._extendedAttrs[s+p])}else for(let p=0;p=s&&(this._combined[l-s+e]=i._combined[l])}}translateToString(i,s,e,t){s=s??0,e=e??this.length,i&&(e=Math.min(e,this.getTrimmedLength())),t&&(t.length=0);let a="";for(;s