webmux 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/server.js +100 -2
- package/bin/webmux.js +16 -3
- package/frontend/dist/assets/index-CMdCoXme.js +148 -0
- package/frontend/dist/assets/index-nt-8CG4j.css +32 -0
- package/frontend/dist/index.html +2 -2
- package/package.json +1 -1
- package/frontend/dist/assets/index-BgwdjtQn.js +0 -35
- package/frontend/dist/assets/index-Bt0UjBTn.css +0 -32
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var Ga=Object.defineProperty;var In=r=>{throw TypeError(r)};var Xa=(r,e,n)=>e in r?Ga(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n;var Ft=(r,e,n)=>Xa(r,typeof e!="symbol"?e+"":e,n),Ts=(r,e,n)=>e.has(r)||In("Cannot "+n);var q=(r,e,n)=>(Ts(r,e,"read from private field"),n?n.call(r):e.get(r)),ve=(r,e,n)=>e.has(r)?In("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,n),be=(r,e,n,t)=>(Ts(r,e,"write to private field"),t?t.call(r,n):e.set(r,n),n),je=(r,e,n)=>(Ts(r,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const b of document.querySelectorAll('link[rel="modulepreload"]'))t(b);new MutationObserver(b=>{for(const k of b)if(k.type==="childList")for(const y of k.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&t(y)}).observe(document,{childList:!0,subtree:!0});function n(b){const k={};return b.integrity&&(k.integrity=b.integrity),b.referrerPolicy&&(k.referrerPolicy=b.referrerPolicy),b.crossOrigin==="use-credentials"?k.credentials="include":b.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function t(b){if(b.ep)return;b.ep=!0;const k=n(b);fetch(b.href,k)}})();const Ya="5";var So;typeof window<"u"&&((So=window.__svelte??(window.__svelte={})).v??(So.v=new Set)).add(Ya);const Ja=1,Za=2,yo=4,Qa=8,el=16,tl=1,rl=4,il=8,sl=16,nl=1,ol=2,tt=Symbol(),xo="http://www.w3.org/1999/xhtml",al="http://www.w3.org/2000/svg",ll="http://www.w3.org/1998/Math/MathML",cl="@attach",hl=!1;var un=Array.isArray,ul=Array.prototype.indexOf,oi=Array.prototype.includes,hs=Array.from,dl=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,fl=Object.getOwnPropertyDescriptors,_l=Object.prototype,vl=Array.prototype,Eo=Object.getPrototypeOf,Hn=Object.isExtensible;const pl=()=>{};function gl(r){for(var e=0;e<r.length;e++)r[e]()}function ko(){var r,e,n=new Promise((t,b)=>{r=t,e=b});return{promise:n,resolve:r,reject:e}}const rt=2,ai=4,us=8,dn=1<<24,xr=16,Kt=32,Ir=64,zs=128,At=512,Ze=1024,at=2048,er=4096,xt=8192,Bt=16384,jr=32768,$s=1<<25,Hr=65536,Nn=1<<17,ml=1<<18,fi=1<<19,bl=1<<20,Jt=1<<25,Nr=65536,Ks=1<<21,fn=1<<22,br=1<<23,Or=Symbol("$state"),Sl=Symbol("legacy props"),wl=Symbol(""),sr=new class extends Error{constructor(){super(...arguments);Ft(this,"name","StaleReactionError");Ft(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var wo;const _n=!!((wo=globalThis.document)!=null&&wo.contentType)&&globalThis.document.contentType.includes("xml");function Lo(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Cl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function yl(r,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function xl(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function El(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function kl(r){throw new Error("https://svelte.dev/e/effect_orphan")}function Ll(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Dl(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function Tl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Rl(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Al(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function Bl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function Ml(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Ol(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Do(r){return r===this.v}function Pl(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function To(r){return!Pl(r,this.v)}let Il=!1,dt=null;function li(r){dt=r}function Ke(r,e=!1,n){dt={p:dt,i:!1,c:null,e:null,s:r,x:null,r:Ee,l:null}}function qe(r){var e=dt,n=e.e;if(n!==null){e.e=null;for(var t of n)Qo(t)}return r!==void 0&&(e.x=r),e.i=!0,dt=e.p,r??{}}function Ro(){return!0}let Lr=[];function Ao(){var r=Lr;Lr=[],gl(r)}function hr(r){if(Lr.length===0&&!ki){var e=Lr;queueMicrotask(()=>{e===Lr&&Ao()})}Lr.push(r)}function Hl(){for(;Lr.length>0;)Ao()}function Bo(r){var e=Ee;if(e===null)return we.f|=br,r;if((e.f&jr)===0&&(e.f&ai)===0)throw r;mr(r,e)}function mr(r,e){for(;e!==null;){if((e.f&zs)!==0){if((e.f&jr)===0)throw r;try{e.b.error(r);return}catch(n){r=n}}e=e.parent}throw r}const Nl=-7169;function Ge(r,e){r.f=r.f&Nl|e}function vn(r){(r.f&At)!==0||r.deps===null?Ge(r,Ze):Ge(r,er)}function Mo(r){if(r!==null)for(const e of r)(e.f&rt)===0||(e.f&Nr)===0||(e.f^=Nr,Mo(e.deps))}function Oo(r,e,n){(r.f&at)!==0?e.add(r):(r.f&er)!==0&&n.add(r),Mo(r.deps),Ge(r,Ze)}let Vi=!1;function Fl(r){var e=Vi;try{return Vi=!1,[r(),Vi]}finally{Vi=e}}const kr=new Set;let pe=null,it=null,qs=null,ki=!1,Rs=!1,Gr=null,Yi=null;var Fn=0;let Wl=1;var Qr,ei,ti,ri,Ti,wt,Rr,nr,or,ii,lt,Vs,Gs,Xs,Ys,Po;const ns=class ns{constructor(){ve(this,lt);Ft(this,"id",Wl++);Ft(this,"current",new Map);Ft(this,"previous",new Map);ve(this,Qr,new Set);ve(this,ei,new Set);ve(this,ti,0);ve(this,ri,0);ve(this,Ti,null);ve(this,wt,[]);ve(this,Rr,new Set);ve(this,nr,new Set);ve(this,or,new Map);Ft(this,"is_fork",!1);ve(this,ii,!1)}skip_effect(e){q(this,or).has(e)||q(this,or).set(e,{d:[],m:[]})}unskip_effect(e){var n=q(this,or).get(e);if(n){q(this,or).delete(e);for(var t of n.d)Ge(t,at),this.schedule(t);for(t of n.m)Ge(t,er),this.schedule(t)}}capture(e,n){n!==tt&&!this.previous.has(e)&&this.previous.set(e,n),(e.f&br)===0&&(this.current.set(e,e.v),it==null||it.set(e,e.v))}activate(){pe=this}deactivate(){pe=null,it=null}flush(){try{Rs=!0,pe=this,je(this,lt,Gs).call(this)}finally{Fn=0,qs=null,Gr=null,Yi=null,Rs=!1,pe=null,it=null,Sr.clear()}}discard(){for(const e of q(this,ei))e(this);q(this,ei).clear(),kr.delete(this)}increment(e){be(this,ti,q(this,ti)+1),e&&be(this,ri,q(this,ri)+1)}decrement(e,n){be(this,ti,q(this,ti)-1),e&&be(this,ri,q(this,ri)-1),!(q(this,ii)||n)&&(be(this,ii,!0),hr(()=>{be(this,ii,!1),this.flush()}))}transfer_effects(e,n){for(const t of e)q(this,Rr).add(t);for(const t of n)q(this,nr).add(t);e.clear(),n.clear()}oncommit(e){q(this,Qr).add(e)}ondiscard(e){q(this,ei).add(e)}settled(){return(q(this,Ti)??be(this,Ti,ko())).promise}static ensure(){if(pe===null){const e=pe=new ns;Rs||(kr.add(pe),ki||hr(()=>{pe===e&&e.flush()}))}return pe}apply(){{it=null;return}}schedule(e){var b;if(qs=e,(b=e.b)!=null&&b.is_pending&&(e.f&(ai|us|dn))!==0&&(e.f&jr)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var t=n.f;if(Gr!==null&&n===Ee&&(we===null||(we.f&rt)===0))return;if((t&(Ir|Kt))!==0){if((t&Ze)===0)return;n.f^=Ze}}q(this,wt).push(n)}};Qr=new WeakMap,ei=new WeakMap,ti=new WeakMap,ri=new WeakMap,Ti=new WeakMap,wt=new WeakMap,Rr=new WeakMap,nr=new WeakMap,or=new WeakMap,ii=new WeakMap,lt=new WeakSet,Vs=function(){return this.is_fork||q(this,ri)>0},Gs=function(){var o,c;if(Fn++>1e3&&(kr.delete(this),jl()),!je(this,lt,Vs).call(this)){for(const h of q(this,Rr))q(this,nr).delete(h),Ge(h,at),this.schedule(h);for(const h of q(this,nr))Ge(h,er),this.schedule(h)}const e=q(this,wt);be(this,wt,[]),this.apply();var n=Gr=[],t=[],b=Yi=[];for(const h of e)try{je(this,lt,Xs).call(this,h,n,t)}catch(f){throw Fo(h),f}if(pe=null,b.length>0){var k=ns.ensure();for(const h of b)k.schedule(h)}if(Gr=null,Yi=null,je(this,lt,Vs).call(this)){je(this,lt,Ys).call(this,t),je(this,lt,Ys).call(this,n);for(const[h,f]of q(this,or))No(h,f)}else{q(this,ti)===0&&kr.delete(this),q(this,Rr).clear(),q(this,nr).clear();for(const h of q(this,Qr))h(this);q(this,Qr).clear(),Wn(t),Wn(n),(o=q(this,Ti))==null||o.resolve()}var y=pe;if(q(this,wt).length>0){const h=y??(y=this);q(h,wt).push(...q(this,wt).filter(f=>!q(h,wt).includes(f)))}y!==null&&(kr.add(y),je(c=y,lt,Gs).call(c)),kr.has(this)||je(this,lt,Po).call(this)},Xs=function(e,n,t){e.f^=Ze;for(var b=e.first;b!==null;){var k=b.f,y=(k&(Kt|Ir))!==0,o=y&&(k&Ze)!==0,c=o||(k&xt)!==0||q(this,or).has(b);if(!c&&b.fn!==null){y?b.f^=Ze:(k&ai)!==0?n.push(b):Hi(b)&&((k&xr)!==0&&q(this,nr).add(b),hi(b));var h=b.first;if(h!==null){b=h;continue}}for(;b!==null;){var f=b.next;if(f!==null){b=f;break}b=b.parent}}},Ys=function(e){for(var n=0;n<e.length;n+=1)Oo(e[n],q(this,Rr),q(this,nr))},Po=function(){var c;for(const h of kr){var e=h.id<this.id,n=[];for(const[f,u]of this.current){if(h.current.has(f))if(e&&u!==h.current.get(f))h.current.set(f,u);else continue;n.push(f)}var t=[...h.current.keys()].filter(f=>!this.current.has(f));if(t.length===0)e&&h.discard();else if(n.length>0){h.activate();var b=new Set,k=new Map;for(var y of n)Io(y,t,b,k);if(q(h,wt).length>0){h.apply();for(var o of q(h,wt))je(c=h,lt,Xs).call(c,o,[],[]);be(h,wt,[])}h.deactivate()}}};let Fr=ns;function Ul(r){var e=ki;ki=!0;try{for(var n;;){if(Hl(),pe===null)return n;pe.flush()}}finally{ki=e}}function jl(){try{Ll()}catch(r){mr(r,qs)}}let Wt=null;function Wn(r){var e=r.length;if(e!==0){for(var n=0;n<e;){var t=r[n++];if((t.f&(Bt|xt))===0&&Hi(t)&&(Wt=new Set,hi(t),t.deps===null&&t.first===null&&t.nodes===null&&t.teardown===null&&t.ac===null&&ia(t),(Wt==null?void 0:Wt.size)>0)){Sr.clear();for(const b of Wt){if((b.f&(Bt|xt))!==0)continue;const k=[b];let y=b.parent;for(;y!==null;)Wt.has(y)&&(Wt.delete(y),k.push(y)),y=y.parent;for(let o=k.length-1;o>=0;o--){const c=k[o];(c.f&(Bt|xt))===0&&hi(c)}}Wt.clear()}}Wt=null}}function Io(r,e,n,t){if(!n.has(r)&&(n.add(r),r.reactions!==null))for(const b of r.reactions){const k=b.f;(k&rt)!==0?Io(b,e,n,t):(k&(fn|xr))!==0&&(k&at)===0&&Ho(b,e,t)&&(Ge(b,at),pn(b))}}function Ho(r,e,n){const t=n.get(r);if(t!==void 0)return t;if(r.deps!==null)for(const b of r.deps){if(oi.call(e,b))return!0;if((b.f&rt)!==0&&Ho(b,e,n))return n.set(b,!0),!0}return n.set(r,!1),!1}function pn(r){pe.schedule(r)}function No(r,e){if(!((r.f&Kt)!==0&&(r.f&Ze)!==0)){(r.f&at)!==0?e.d.push(r):(r.f&er)!==0&&e.m.push(r),Ge(r,Ze);for(var n=r.first;n!==null;)No(n,e),n=n.next}}function Fo(r){Ge(r,Ze);for(var e=r.first;e!==null;)Fo(e),e=e.next}function zl(r){let e=0,n=Cr(0),t;return()=>{mn()&&(C(n),_s(()=>(e===0&&(t=fr(()=>r(()=>wr(n)))),e+=1,()=>{hr(()=>{e-=1,e===0&&(t==null||t(),t=void 0,wr(n))})})))}}var $l=Hr|fi;function Kl(r,e,n,t){new ql(r,e,n,t)}var Tt,hn,Vt,Ar,vt,Gt,Ct,Ut,ar,Br,pr,si,Ri,Ai,lr,os,Qe,Vl,Gl,Xl,Js,Ji,Zi,Zs;class ql{constructor(e,n,t,b){ve(this,Qe);Ft(this,"parent");Ft(this,"is_pending",!1);Ft(this,"transform_error");ve(this,Tt);ve(this,hn,null);ve(this,Vt);ve(this,Ar);ve(this,vt);ve(this,Gt,null);ve(this,Ct,null);ve(this,Ut,null);ve(this,ar,null);ve(this,Br,0);ve(this,pr,0);ve(this,si,!1);ve(this,Ri,new Set);ve(this,Ai,new Set);ve(this,lr,null);ve(this,os,zl(()=>(be(this,lr,Cr(q(this,Br))),()=>{be(this,lr,null)})));var k;be(this,Tt,e),be(this,Vt,n),be(this,Ar,y=>{var o=Ee;o.b=this,o.f|=zs,t(y)}),this.parent=Ee.b,this.transform_error=b??((k=this.parent)==null?void 0:k.transform_error)??(y=>y),be(this,vt,Ii(()=>{je(this,Qe,Js).call(this)},$l))}defer_effect(e){Oo(e,q(this,Ri),q(this,Ai))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!q(this,Vt).pending}update_pending_count(e,n){je(this,Qe,Zs).call(this,e,n),be(this,Br,q(this,Br)+e),!(!q(this,lr)||q(this,si))&&(be(this,si,!0),hr(()=>{be(this,si,!1),q(this,lr)&&ci(q(this,lr),q(this,Br))}))}get_effect_pending(){return q(this,os).call(this),C(q(this,lr))}error(e){var n=q(this,Vt).onerror;let t=q(this,Vt).failed;if(!n&&!t)throw e;q(this,Gt)&&(st(q(this,Gt)),be(this,Gt,null)),q(this,Ct)&&(st(q(this,Ct)),be(this,Ct,null)),q(this,Ut)&&(st(q(this,Ut)),be(this,Ut,null));var b=!1,k=!1;const y=()=>{if(b){Ol();return}b=!0,k&&Bl(),q(this,Ut)!==null&&Pr(q(this,Ut),()=>{be(this,Ut,null)}),je(this,Qe,Zi).call(this,()=>{je(this,Qe,Js).call(this)})},o=c=>{try{k=!0,n==null||n(c,y),k=!1}catch(h){mr(h,q(this,vt)&&q(this,vt).parent)}t&&be(this,Ut,je(this,Qe,Zi).call(this,()=>{try{return gt(()=>{var h=Ee;h.b=this,h.f|=zs,t(q(this,Tt),()=>c,()=>y)})}catch(h){return mr(h,q(this,vt).parent),null}}))};hr(()=>{var c;try{c=this.transform_error(e)}catch(h){mr(h,q(this,vt)&&q(this,vt).parent);return}c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(o,h=>mr(h,q(this,vt)&&q(this,vt).parent)):o(c)})}}Tt=new WeakMap,hn=new WeakMap,Vt=new WeakMap,Ar=new WeakMap,vt=new WeakMap,Gt=new WeakMap,Ct=new WeakMap,Ut=new WeakMap,ar=new WeakMap,Br=new WeakMap,pr=new WeakMap,si=new WeakMap,Ri=new WeakMap,Ai=new WeakMap,lr=new WeakMap,os=new WeakMap,Qe=new WeakSet,Vl=function(){try{be(this,Gt,gt(()=>q(this,Ar).call(this,q(this,Tt))))}catch(e){this.error(e)}},Gl=function(e){const n=q(this,Vt).failed;n&&be(this,Ut,gt(()=>{n(q(this,Tt),()=>e,()=>()=>{})}))},Xl=function(){const e=q(this,Vt).pending;e&&(this.is_pending=!0,be(this,Ct,gt(()=>e(q(this,Tt)))),hr(()=>{var n=be(this,ar,document.createDocumentFragment()),t=ur();n.append(t),be(this,Gt,je(this,Qe,Zi).call(this,()=>gt(()=>q(this,Ar).call(this,t)))),q(this,pr)===0&&(q(this,Tt).before(n),be(this,ar,null),Pr(q(this,Ct),()=>{be(this,Ct,null)}),je(this,Qe,Ji).call(this,pe))}))},Js=function(){try{if(this.is_pending=this.has_pending_snippet(),be(this,pr,0),be(this,Br,0),be(this,Gt,gt(()=>{q(this,Ar).call(this,q(this,Tt))})),q(this,pr)>0){var e=be(this,ar,document.createDocumentFragment());Cn(q(this,Gt),e);const n=q(this,Vt).pending;be(this,Ct,gt(()=>n(q(this,Tt))))}else je(this,Qe,Ji).call(this,pe)}catch(n){this.error(n)}},Ji=function(e){this.is_pending=!1,e.transfer_effects(q(this,Ri),q(this,Ai))},Zi=function(e){var n=Ee,t=we,b=dt;tr(q(this,vt)),Ot(q(this,vt)),li(q(this,vt).ctx);try{return Fr.ensure(),e()}catch(k){return Bo(k),null}finally{tr(n),Ot(t),li(b)}},Zs=function(e,n){var t;if(!this.has_pending_snippet()){this.parent&&je(t=this.parent,Qe,Zs).call(t,e,n);return}be(this,pr,q(this,pr)+e),q(this,pr)===0&&(je(this,Qe,Ji).call(this,n),q(this,Ct)&&Pr(q(this,Ct),()=>{be(this,Ct,null)}),q(this,ar)&&(q(this,Tt).before(q(this,ar)),be(this,ar,null)))};function Wo(r,e,n,t){const b=ds;var k=r.filter(d=>!d.settled);if(n.length===0&&k.length===0){t(e.map(b));return}var y=Ee,o=Yl(),c=k.length===1?k[0].promise:k.length>1?Promise.all(k.map(d=>d.promise)):null;function h(d){o();try{t(d)}catch(p){(y.f&Bt)===0&&mr(p,y)}rs()}if(n.length===0){c.then(()=>h(e.map(b)));return}var f=Uo();function u(){Promise.all(n.map(d=>Jl(d))).then(d=>h([...e.map(b),...d])).catch(d=>mr(d,y)).finally(()=>f())}c?c.then(()=>{o(),u(),rs()}):u()}function Yl(){var r=Ee,e=we,n=dt,t=pe;return function(k=!0){tr(r),Ot(e),li(n),k&&(r.f&Bt)===0&&(t==null||t.activate(),t==null||t.apply())}}function rs(r=!0){tr(null),Ot(null),li(null),r&&(pe==null||pe.deactivate())}function Uo(){var r=Ee.b,e=pe,n=r.is_rendered();return r.update_pending_count(1,e),e.increment(n),(t=!1)=>{r.update_pending_count(-1,e),e.decrement(n,t)}}function ds(r){var e=rt|at,n=we!==null&&(we.f&rt)!==0?we:null;return Ee!==null&&(Ee.f|=fi),{ctx:dt,deps:null,effects:null,equals:Do,f:e,fn:r,reactions:null,rv:0,v:tt,wv:0,parent:n??Ee,ac:null}}function Jl(r,e,n){let t=Ee;t===null&&Cl();var b=void 0,k=Cr(tt),y=!we,o=new Map;return dc(()=>{var p;var c=Ee,h=ko();b=h.promise;try{Promise.resolve(r()).then(h.resolve,h.reject).finally(rs)}catch(m){h.reject(m),rs()}var f=pe;if(y){if((c.f&jr)!==0)var u=Uo();if(t.b.is_rendered())(p=o.get(f))==null||p.reject(sr),o.delete(f);else{for(const m of o.values())m.reject(sr);o.clear()}o.set(f,h)}const d=(m,_=void 0)=>{if(u){var s=_===sr;u(s)}if(!(_===sr||(c.f&Bt)!==0)){if(f.activate(),_)k.f|=br,ci(k,_);else{(k.f&br)!==0&&(k.f^=br),ci(k,m);for(const[a,i]of o){if(o.delete(a),a===f)break;i.reject(sr)}}f.deactivate()}};h.promise.then(d,m=>d(null,m||"unknown"))}),bn(()=>{for(const c of o.values())c.reject(sr)}),new Promise(c=>{function h(f){function u(){f===b?c(k):h(b)}f.then(u,u)}h(b)})}function he(r){const e=ds(r);return oa(e),e}function jo(r){const e=ds(r);return e.equals=To,e}function Zl(r){var e=r.effects;if(e!==null){r.effects=null;for(var n=0;n<e.length;n+=1)st(e[n])}}function Ql(r){for(var e=r.parent;e!==null;){if((e.f&rt)===0)return(e.f&Bt)===0?e:null;e=e.parent}return null}function gn(r){var e,n=Ee;tr(Ql(r));try{r.f&=~Nr,Zl(r),e=ha(r)}finally{tr(n)}return e}function zo(r){var e=r.v,n=gn(r);if(!r.equals(n)&&(r.wv=la(),(!(pe!=null&&pe.is_fork)||r.deps===null)&&(r.v=n,pe==null||pe.capture(r,e),r.deps===null))){Ge(r,Ze);return}yr||(it!==null?(mn()||pe!=null&&pe.is_fork)&&it.set(r,n):vn(r))}function ec(r){var e,n;if(r.effects!==null)for(const t of r.effects)(t.teardown||t.ac)&&((e=t.teardown)==null||e.call(t),(n=t.ac)==null||n.abort(sr),t.teardown=pl,t.ac=null,Li(t,0),Sn(t))}function $o(r){if(r.effects!==null)for(const e of r.effects)e.teardown&&hi(e)}let Qs=new Set;const Sr=new Map;let Ko=!1;function Cr(r,e){var n={f:0,v:r,reactions:null,equals:Do,rv:0,wv:0};return n}function le(r,e){const n=Cr(r);return oa(n),n}function tc(r,e=!1,n=!0){const t=Cr(r);return e||(t.equals=To),t}function j(r,e,n=!1){we!==null&&(!$t||(we.f&Nn)!==0)&&Ro()&&(we.f&(rt|xr|fn|Nn))!==0&&(Mt===null||!oi.call(Mt,r))&&Al();let t=n?Me(e):e;return ci(r,t,Yi)}function ci(r,e,n=null){if(!r.equals(e)){var t=r.v;yr?Sr.set(r,e):Sr.set(r,t),r.v=e;var b=Fr.ensure();if(b.capture(r,t),(r.f&rt)!==0){const k=r;(r.f&at)!==0&&gn(k),it===null&&vn(k)}r.wv=la(),qo(r,at,n),Ee!==null&&(Ee.f&Ze)!==0&&(Ee.f&(Kt|Ir))===0&&(Dt===null?_c([r]):Dt.push(r)),!b.is_fork&&Qs.size>0&&!Ko&&rc()}return e}function rc(){Ko=!1;for(const r of Qs)(r.f&Ze)!==0&&Ge(r,er),Hi(r)&&hi(r);Qs.clear()}function ic(r,e=1){var n=C(r),t=e===1?n++:n--;return j(r,n),t}function wr(r){j(r,r.v+1)}function qo(r,e,n){var t=r.reactions;if(t!==null)for(var b=t.length,k=0;k<b;k++){var y=t[k],o=y.f,c=(o&at)===0;if(c&&Ge(y,e),(o&rt)!==0){var h=y;it==null||it.delete(h),(o&Nr)===0&&(o&At&&(y.f|=Nr),qo(h,er,n))}else if(c){var f=y;(o&xr)!==0&&Wt!==null&&Wt.add(f),n!==null?n.push(f):pn(f)}}}function Me(r){if(typeof r!="object"||r===null||Or in r)return r;const e=Eo(r);if(e!==_l&&e!==vl)return r;var n=new Map,t=un(r),b=le(0),k=dr,y=o=>{if(dr===k)return o();var c=we,h=dr;Ot(null),$n(k);var f=o();return Ot(c),$n(h),f};return t&&n.set("length",le(r.length)),new Proxy(r,{defineProperty(o,c,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&Tl();var f=n.get(c);return f===void 0?y(()=>{var u=le(h.value);return n.set(c,u),u}):j(f,h.value,!0),!0},deleteProperty(o,c){var h=n.get(c);if(h===void 0){if(c in o){const f=y(()=>le(tt));n.set(c,f),wr(b)}}else j(h,tt),wr(b);return!0},get(o,c,h){var p;if(c===Or)return r;var f=n.get(c),u=c in o;if(f===void 0&&(!u||(p=Xr(o,c))!=null&&p.writable)&&(f=y(()=>{var m=Me(u?o[c]:tt),_=le(m);return _}),n.set(c,f)),f!==void 0){var d=C(f);return d===tt?void 0:d}return Reflect.get(o,c,h)},getOwnPropertyDescriptor(o,c){var h=Reflect.getOwnPropertyDescriptor(o,c);if(h&&"value"in h){var f=n.get(c);f&&(h.value=C(f))}else if(h===void 0){var u=n.get(c),d=u==null?void 0:u.v;if(u!==void 0&&d!==tt)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return h},has(o,c){var d;if(c===Or)return!0;var h=n.get(c),f=h!==void 0&&h.v!==tt||Reflect.has(o,c);if(h!==void 0||Ee!==null&&(!f||(d=Xr(o,c))!=null&&d.writable)){h===void 0&&(h=y(()=>{var p=f?Me(o[c]):tt,m=le(p);return m}),n.set(c,h));var u=C(h);if(u===tt)return!1}return f},set(o,c,h,f){var l;var u=n.get(c),d=c in o;if(t&&c==="length")for(var p=h;p<u.v;p+=1){var m=n.get(p+"");m!==void 0?j(m,tt):p in o&&(m=y(()=>le(tt)),n.set(p+"",m))}if(u===void 0)(!d||(l=Xr(o,c))!=null&&l.writable)&&(u=y(()=>le(void 0)),j(u,Me(h)),n.set(c,u));else{d=u.v!==tt;var _=y(()=>Me(h));j(u,_)}var s=Reflect.getOwnPropertyDescriptor(o,c);if(s!=null&&s.set&&s.set.call(f,h),!d){if(t&&typeof c=="string"){var a=n.get("length"),i=Number(c);Number.isInteger(i)&&i>=a.v&&j(a,i+1)}wr(b)}return!0},ownKeys(o){C(b);var c=Reflect.ownKeys(o).filter(u=>{var d=n.get(u);return d===void 0||d.v!==tt});for(var[h,f]of n)f.v!==tt&&!(h in o)&&c.push(h);return c},setPrototypeOf(){Rl()}})}function Un(r){try{if(r!==null&&typeof r=="object"&&Or in r)return r[Or]}catch{}return r}function sc(r,e){return Object.is(Un(r),Un(e))}var en,Vo,Go,Xo;function nc(){if(en===void 0){en=window,Vo=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,n=Text.prototype;Go=Xr(e,"firstChild").get,Xo=Xr(e,"nextSibling").get,Hn(r)&&(r.__click=void 0,r.__className=void 0,r.__attributes=null,r.__style=void 0,r.__e=void 0),Hn(n)&&(n.__t=void 0)}}function ur(r=""){return document.createTextNode(r)}function Zt(r){return Go.call(r)}function Oi(r){return Xo.call(r)}function $(r,e){return Zt(r)}function Pe(r,e=!1){{var n=Zt(r);return n instanceof Comment&&n.data===""?Oi(n):n}}function V(r,e=1,n=!1){let t=r;for(;e--;)t=Oi(t);return t}function oc(r){r.textContent=""}function Yo(){return!1}function Jo(r,e,n){return document.createElementNS(e??xo,r,void 0)}function ac(r,e){if(e){const n=document.body;r.autofocus=!0,hr(()=>{document.activeElement===n&&r.focus()})}}let jn=!1;function lc(){jn||(jn=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(const n of r.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function fs(r){var e=we,n=Ee;Ot(null),tr(null);try{return r()}finally{Ot(e),tr(n)}}function Zo(r,e,n,t=n){r.addEventListener(e,()=>fs(n));const b=r.__on_r;b?r.__on_r=()=>{b(),t(!0)}:r.__on_r=()=>t(!0),lc()}function cc(r){Ee===null&&(we===null&&kl(),El()),yr&&xl()}function hc(r,e){var n=e.last;n===null?e.last=e.first=r:(n.next=r,r.prev=n,e.last=r)}function rr(r,e){var n=Ee;n!==null&&(n.f&xt)!==0&&(r|=xt);var t={ctx:dt,deps:null,nodes:null,f:r|at|At,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},b=t;if((r&ai)!==0)Gr!==null?Gr.push(t):Fr.ensure().schedule(t);else if(e!==null){try{hi(t)}catch(y){throw st(t),y}b.deps===null&&b.teardown===null&&b.nodes===null&&b.first===b.last&&(b.f&fi)===0&&(b=b.first,(r&xr)!==0&&(r&Hr)!==0&&b!==null&&(b.f|=Hr))}if(b!==null&&(b.parent=n,n!==null&&hc(b,n),we!==null&&(we.f&rt)!==0&&(r&Ir)===0)){var k=we;(k.effects??(k.effects=[])).push(b)}return t}function mn(){return we!==null&&!$t}function bn(r){const e=rr(us,null);return Ge(e,Ze),e.teardown=r,e}function Rt(r){cc();var e=Ee.f,n=!we&&(e&Kt)!==0&&(e&jr)===0;if(n){var t=dt;(t.e??(t.e=[])).push(r)}else return Qo(r)}function Qo(r){return rr(ai|bl,r)}function uc(r){Fr.ensure();const e=rr(Ir|fi,r);return(n={})=>new Promise(t=>{n.outro?Pr(e,()=>{st(e),t(void 0)}):(st(e),t(void 0))})}function Pi(r){return rr(ai,r)}function dc(r){return rr(fn|fi,r)}function _s(r,e=0){return rr(us|e,r)}function ae(r,e=[],n=[],t=[]){Wo(t,e,n,b=>{rr(us,()=>r(...b.map(C)))})}function Ii(r,e=0){var n=rr(xr|e,r);return n}function ea(r,e=0){var n=rr(dn|e,r);return n}function gt(r){return rr(Kt|fi,r)}function ta(r){var e=r.teardown;if(e!==null){const n=yr,t=we;zn(!0),Ot(null);try{e.call(null)}finally{zn(n),Ot(t)}}}function Sn(r,e=!1){var n=r.first;for(r.first=r.last=null;n!==null;){const b=n.ac;b!==null&&fs(()=>{b.abort(sr)});var t=n.next;(n.f&Ir)!==0?n.parent=null:st(n,e),n=t}}function fc(r){for(var e=r.first;e!==null;){var n=e.next;(e.f&Kt)===0&&st(e),e=n}}function st(r,e=!0){var n=!1;(e||(r.f&ml)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(ra(r.nodes.start,r.nodes.end),n=!0),Ge(r,$s),Sn(r,e&&!n),Li(r,0);var t=r.nodes&&r.nodes.t;if(t!==null)for(const k of t)k.stop();ta(r),r.f^=$s,r.f|=Bt;var b=r.parent;b!==null&&b.first!==null&&ia(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=null}function ra(r,e){for(;r!==null;){var n=r===e?null:Oi(r);r.remove(),r=n}}function ia(r){var e=r.parent,n=r.prev,t=r.next;n!==null&&(n.next=t),t!==null&&(t.prev=n),e!==null&&(e.first===r&&(e.first=t),e.last===r&&(e.last=n))}function Pr(r,e,n=!0){var t=[];sa(r,t,!0);var b=()=>{n&&st(r),e&&e()},k=t.length;if(k>0){var y=()=>--k||b();for(var o of t)o.out(y)}else b()}function sa(r,e,n){if((r.f&xt)===0){r.f^=xt;var t=r.nodes&&r.nodes.t;if(t!==null)for(const o of t)(o.is_global||n)&&e.push(o);for(var b=r.first;b!==null;){var k=b.next,y=(b.f&Hr)!==0||(b.f&Kt)!==0&&(r.f&xr)!==0;sa(b,e,y?n:!1),b=k}}}function wn(r){na(r,!0)}function na(r,e){if((r.f&xt)!==0){r.f^=xt,(r.f&Ze)===0&&(Ge(r,at),Fr.ensure().schedule(r));for(var n=r.first;n!==null;){var t=n.next,b=(n.f&Hr)!==0||(n.f&Kt)!==0;na(n,b?e:!1),n=t}var k=r.nodes&&r.nodes.t;if(k!==null)for(const y of k)(y.is_global||e)&&y.in()}}function Cn(r,e){if(r.nodes)for(var n=r.nodes.start,t=r.nodes.end;n!==null;){var b=n===t?null:Oi(n);e.append(n),n=b}}let Qi=!1,yr=!1;function zn(r){yr=r}let we=null,$t=!1;function Ot(r){we=r}let Ee=null;function tr(r){Ee=r}let Mt=null;function oa(r){we!==null&&(Mt===null?Mt=[r]:Mt.push(r))}let pt=null,St=0,Dt=null;function _c(r){Dt=r}let aa=1,Dr=0,dr=Dr;function $n(r){dr=r}function la(){return++aa}function Hi(r){var e=r.f;if((e&at)!==0)return!0;if(e&rt&&(r.f&=~Nr),(e&er)!==0){for(var n=r.deps,t=n.length,b=0;b<t;b++){var k=n[b];if(Hi(k)&&zo(k),k.wv>r.wv)return!0}(e&At)!==0&&it===null&&Ge(r,Ze)}return!1}function ca(r,e,n=!0){var t=r.reactions;if(t!==null&&!(Mt!==null&&oi.call(Mt,r)))for(var b=0;b<t.length;b++){var k=t[b];(k.f&rt)!==0?ca(k,e,!1):e===k&&(n?Ge(k,at):(k.f&Ze)!==0&&Ge(k,er),pn(k))}}function ha(r){var _;var e=pt,n=St,t=Dt,b=we,k=Mt,y=dt,o=$t,c=dr,h=r.f;pt=null,St=0,Dt=null,we=(h&(Kt|Ir))===0?r:null,Mt=null,li(r.ctx),$t=!1,dr=++Dr,r.ac!==null&&(fs(()=>{r.ac.abort(sr)}),r.ac=null);try{r.f|=Ks;var f=r.fn,u=f();r.f|=jr;var d=r.deps,p=pe==null?void 0:pe.is_fork;if(pt!==null){var m;if(p||Li(r,St),d!==null&&St>0)for(d.length=St+pt.length,m=0;m<pt.length;m++)d[St+m]=pt[m];else r.deps=d=pt;if(mn()&&(r.f&At)!==0)for(m=St;m<d.length;m++)((_=d[m]).reactions??(_.reactions=[])).push(r)}else!p&&d!==null&&St<d.length&&(Li(r,St),d.length=St);if(Ro()&&Dt!==null&&!$t&&d!==null&&(r.f&(rt|er|at))===0)for(m=0;m<Dt.length;m++)ca(Dt[m],r);if(b!==null&&b!==r){if(Dr++,b.deps!==null)for(let s=0;s<n;s+=1)b.deps[s].rv=Dr;if(e!==null)for(const s of e)s.rv=Dr;Dt!==null&&(t===null?t=Dt:t.push(...Dt))}return(r.f&br)!==0&&(r.f^=br),u}catch(s){return Bo(s)}finally{r.f^=Ks,pt=e,St=n,Dt=t,we=b,Mt=k,li(y),$t=o,dr=c}}function vc(r,e){let n=e.reactions;if(n!==null){var t=ul.call(n,r);if(t!==-1){var b=n.length-1;b===0?n=e.reactions=null:(n[t]=n[b],n.pop())}}if(n===null&&(e.f&rt)!==0&&(pt===null||!oi.call(pt,e))){var k=e;(k.f&At)!==0&&(k.f^=At,k.f&=~Nr),vn(k),ec(k),Li(k,0)}}function Li(r,e){var n=r.deps;if(n!==null)for(var t=e;t<n.length;t++)vc(r,n[t])}function hi(r){var e=r.f;if((e&Bt)===0){Ge(r,Ze);var n=Ee,t=Qi;Ee=r,Qi=!0;try{(e&(xr|dn))!==0?fc(r):Sn(r),ta(r);var b=ha(r);r.teardown=typeof b=="function"?b:null,r.wv=aa;var k;hl&&Il&&(r.f&at)!==0&&r.deps}finally{Qi=t,Ee=n}}}async function pc(){await Promise.resolve(),Ul()}function C(r){var e=r.f,n=(e&rt)!==0;if(we!==null&&!$t){var t=Ee!==null&&(Ee.f&Bt)!==0;if(!t&&(Mt===null||!oi.call(Mt,r))){var b=we.deps;if((we.f&Ks)!==0)r.rv<Dr&&(r.rv=Dr,pt===null&&b!==null&&b[St]===r?St++:pt===null?pt=[r]:pt.push(r));else{(we.deps??(we.deps=[])).push(r);var k=r.reactions;k===null?r.reactions=[we]:oi.call(k,we)||k.push(we)}}}if(yr&&Sr.has(r))return Sr.get(r);if(n){var y=r;if(yr){var o=y.v;return((y.f&Ze)===0&&y.reactions!==null||da(y))&&(o=gn(y)),Sr.set(y,o),o}var c=(y.f&At)===0&&!$t&&we!==null&&(Qi||(we.f&At)!==0),h=(y.f&jr)===0;Hi(y)&&(c&&(y.f|=At),zo(y)),c&&!h&&($o(y),ua(y))}if(it!=null&&it.has(r))return it.get(r);if((r.f&br)!==0)throw r.v;return r.v}function ua(r){if(r.f|=At,r.deps!==null)for(const e of r.deps)(e.reactions??(e.reactions=[])).push(r),(e.f&rt)!==0&&(e.f&At)===0&&($o(e),ua(e))}function da(r){if(r.v===tt)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(Sr.has(e)||(e.f&rt)!==0&&da(e))return!0;return!1}function fr(r){var e=$t;try{return $t=!0,r()}finally{$t=e}}const Tr=Symbol("events"),fa=new Set,tn=new Set;function _a(r,e,n,t={}){function b(k){if(t.capture||rn.call(e,k),!k.cancelBubble)return fs(()=>n==null?void 0:n.call(this,k))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?hr(()=>{e.addEventListener(r,b,t)}):e.addEventListener(r,b,t),b}function cr(r,e,n,t,b){var k={capture:t,passive:b},y=_a(r,e,n,k);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&bn(()=>{e.removeEventListener(r,y,k)})}function Se(r,e,n){(e[Tr]??(e[Tr]={}))[r]=n}function It(r){for(var e=0;e<r.length;e++)fa.add(r[e]);for(var n of tn)n(r)}let Kn=null;function rn(r){var s,a;var e=this,n=e.ownerDocument,t=r.type,b=((s=r.composedPath)==null?void 0:s.call(r))||[],k=b[0]||r.target;Kn=r;var y=0,o=Kn===r&&r[Tr];if(o){var c=b.indexOf(o);if(c!==-1&&(e===document||e===window)){r[Tr]=e;return}var h=b.indexOf(e);if(h===-1)return;c<=h&&(y=c)}if(k=b[y]||r.target,k!==e){dl(r,"currentTarget",{configurable:!0,get(){return k||n}});var f=we,u=Ee;Ot(null),tr(null);try{for(var d,p=[];k!==null;){var m=k.assignedSlot||k.parentNode||k.host||null;try{var _=(a=k[Tr])==null?void 0:a[t];_!=null&&(!k.disabled||r.target===k)&&_.call(k,r)}catch(i){d?p.push(i):d=i}if(r.cancelBubble||m===e||m===null)break;k=m}if(d){for(let i of p)queueMicrotask(()=>{throw i});throw d}}finally{r[Tr]=e,delete r.currentTarget,Ot(f),tr(u)}}}var Co;const As=((Co=globalThis==null?void 0:globalThis.window)==null?void 0:Co.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function gc(r){return(As==null?void 0:As.createHTML(r))??r}function va(r){var e=Jo("template");return e.innerHTML=gc(r.replaceAll("<!>","<!---->")),e.content}function Wr(r,e){var n=Ee;n.nodes===null&&(n.nodes={start:r,end:e,a:null,t:null})}function Q(r,e){var n=(e&nl)!==0,t=(e&ol)!==0,b,k=!r.startsWith("<!>");return()=>{b===void 0&&(b=va(k?r:"<!>"+r),n||(b=Zt(b)));var y=t||Vo?document.importNode(b,!0):b.cloneNode(!0);if(n){var o=Zt(y),c=y.lastChild;Wr(o,c)}else Wr(y,y);return y}}function mc(r,e,n="svg"){var t=!r.startsWith("<!>"),b=`<${n}>${t?r:"<!>"+r}</${n}>`,k;return()=>{if(!k){var y=va(b),o=Zt(y);k=Zt(o)}var c=k.cloneNode(!0);return Wr(c,c),c}}function vs(r,e){return mc(r,e,"svg")}function ze(r=""){{var e=ur(r+"");return Wr(e,e),e}}function Pt(){var r=document.createDocumentFragment(),e=document.createComment(""),n=ur();return r.append(e,n),Wr(e,n),r}function K(r,e){r!==null&&r.before(e)}function bc(r){return r.endsWith("capture")&&r!=="gotpointercapture"&&r!=="lostpointercapture"}const Sc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function wc(r){return Sc.includes(r)}const Cc={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function yc(r){return r=r.toLowerCase(),Cc[r]??r}const xc=["touchstart","touchmove"];function Ec(r){return xc.includes(r)}function ne(r,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(r.__t??(r.__t=r.nodeValue))&&(r.__t=n,r.nodeValue=`${n}`)}function kc(r,e){return Lc(r,e)}const Gi=new Map;function Lc(r,{target:e,anchor:n,props:t={},events:b,context:k,intro:y=!0,transformError:o}){nc();var c=void 0,h=uc(()=>{var f=n??e.appendChild(ur());Kl(f,{pending:()=>{}},p=>{Ke({});var m=dt;k&&(m.c=k),b&&(t.$$events=b),c=r(p,t)||{},qe()},o);var u=new Set,d=p=>{for(var m=0;m<p.length;m++){var _=p[m];if(!u.has(_)){u.add(_);var s=Ec(_);for(const l of[e,document]){var a=Gi.get(l);a===void 0&&(a=new Map,Gi.set(l,a));var i=a.get(_);i===void 0?(l.addEventListener(_,rn,{passive:s}),a.set(_,1)):a.set(_,i+1)}}}};return d(hs(fa)),tn.add(d),()=>{var s;for(var p of u)for(const a of[e,document]){var m=Gi.get(a),_=m.get(p);--_==0?(a.removeEventListener(p,rn),m.delete(p),m.size===0&&Gi.delete(a)):m.set(p,_)}tn.delete(d),f!==n&&((s=f.parentNode)==null||s.removeChild(f))}});return Dc.set(c,h),c}let Dc=new WeakMap;var jt,Xt,yt,Mr,Bi,Mi,as;class yn{constructor(e,n=!0){Ft(this,"anchor");ve(this,jt,new Map);ve(this,Xt,new Map);ve(this,yt,new Map);ve(this,Mr,new Set);ve(this,Bi,!0);ve(this,Mi,e=>{if(q(this,jt).has(e)){var n=q(this,jt).get(e),t=q(this,Xt).get(n);if(t)wn(t),q(this,Mr).delete(n);else{var b=q(this,yt).get(n);b&&(q(this,Xt).set(n,b.effect),q(this,yt).delete(n),b.fragment.lastChild.remove(),this.anchor.before(b.fragment),t=b.effect)}for(const[k,y]of q(this,jt)){if(q(this,jt).delete(k),k===e)break;const o=q(this,yt).get(y);o&&(st(o.effect),q(this,yt).delete(y))}for(const[k,y]of q(this,Xt)){if(k===n||q(this,Mr).has(k))continue;const o=()=>{if(Array.from(q(this,jt).values()).includes(k)){var h=document.createDocumentFragment();Cn(y,h),h.append(ur()),q(this,yt).set(k,{effect:y,fragment:h})}else st(y);q(this,Mr).delete(k),q(this,Xt).delete(k)};q(this,Bi)||!t?(q(this,Mr).add(k),Pr(y,o,!1)):o()}}});ve(this,as,e=>{q(this,jt).delete(e);const n=Array.from(q(this,jt).values());for(const[t,b]of q(this,yt))n.includes(t)||(st(b.effect),q(this,yt).delete(t))});this.anchor=e,be(this,Bi,n)}ensure(e,n){var t=pe,b=Yo();if(n&&!q(this,Xt).has(e)&&!q(this,yt).has(e))if(b){var k=document.createDocumentFragment(),y=ur();k.append(y),q(this,yt).set(e,{effect:gt(()=>n(y)),fragment:k})}else q(this,Xt).set(e,gt(()=>n(this.anchor)));if(q(this,jt).set(t,e),b){for(const[o,c]of q(this,Xt))o===e?t.unskip_effect(c):t.skip_effect(c);for(const[o,c]of q(this,yt))o===e?t.unskip_effect(c.effect):t.skip_effect(c.effect);t.oncommit(q(this,Mi)),t.ondiscard(q(this,as))}else q(this,Mi).call(this,t)}}jt=new WeakMap,Xt=new WeakMap,yt=new WeakMap,Mr=new WeakMap,Bi=new WeakMap,Mi=new WeakMap,as=new WeakMap;function xn(r,e,...n){var t=new yn(r);Ii(()=>{const b=e()??null;t.ensure(b,b&&(k=>b(k,...n)))},Hr)}function En(r){dt===null&&Lo(),Rt(()=>{const e=fr(r);if(typeof e=="function")return e})}function Tc(r){dt===null&&Lo(),En(()=>()=>fr(r))}function se(r,e,n=!1){var t=new yn(r),b=n?Hr:0;function k(y,o){t.ensure(y,o)}Ii(()=>{var y=!1;e((o,c=0)=>{y=!0,k(c,o)}),y||k(-1,null)},b)}const Rc=Symbol("NaN");function Ac(r,e,n){var t=new yn(r);Ii(()=>{var b=e();b!==b&&(b=Rc),t.ensure(b,n)})}function ui(r,e){return e}function Bc(r,e,n){for(var t=[],b=e.length,k,y=e.length,o=0;o<b;o++){let u=e[o];Pr(u,()=>{if(k){if(k.pending.delete(u),k.done.add(u),k.pending.size===0){var d=r.outrogroups;sn(r,hs(k.done)),d.delete(k),d.size===0&&(r.outrogroups=null)}}else y-=1},!1)}if(y===0){var c=t.length===0&&n!==null;if(c){var h=n,f=h.parentNode;oc(f),f.append(h),r.items.clear()}sn(r,e,!c)}else k={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(k)}function sn(r,e,n=!0){var t;if(r.pending.size>0){t=new Set;for(const y of r.pending.values())for(const o of y)t.add(r.items.get(o).e)}for(var b=0;b<e.length;b++){var k=e[b];if(t!=null&&t.has(k)){k.f|=Jt;const y=document.createDocumentFragment();Cn(k,y)}else st(e[b],n)}}var qn;function Xe(r,e,n,t,b,k=null){var y=r,o=new Map,c=(e&yo)!==0;if(c){var h=r;y=h.appendChild(ur())}var f=null,u=jo(()=>{var l=n();return un(l)?l:l==null?[]:hs(l)}),d,p=new Map,m=!0;function _(l){(i.effect.f&Bt)===0&&(i.pending.delete(l),i.fallback=f,Mc(i,d,y,e,t),f!==null&&(d.length===0?(f.f&Jt)===0?wn(f):(f.f^=Jt,Ei(f,null,y)):Pr(f,()=>{f=null})))}function s(l){i.pending.delete(l)}var a=Ii(()=>{d=C(u);for(var l=d.length,v=new Set,S=pe,w=Yo(),E=0;E<l;E+=1){var g=d[E],x=t(g,E),T=m?null:o.get(x);T?(T.v&&ci(T.v,g),T.i&&ci(T.i,E),w&&S.unskip_effect(T.e)):(T=Oc(o,m?y:qn??(qn=ur()),g,x,E,b,e,n),m||(T.e.f|=Jt),o.set(x,T)),v.add(x)}if(l===0&&k&&!f&&(m?f=gt(()=>k(y)):(f=gt(()=>k(qn??(qn=ur()))),f.f|=Jt)),l>v.size&&yl(),!m)if(p.set(S,v),w){for(const[A,I]of o)v.has(A)||S.skip_effect(I.e);S.oncommit(_),S.ondiscard(s)}else _(S);C(u)}),i={effect:a,items:o,pending:p,outrogroups:null,fallback:f};m=!1}function Si(r){for(;r!==null&&(r.f&Kt)===0;)r=r.next;return r}function Mc(r,e,n,t,b){var T,A,I,M,N,U,X,J,Y;var k=(t&Qa)!==0,y=e.length,o=r.items,c=Si(r.effect.first),h,f=null,u,d=[],p=[],m,_,s,a;if(k)for(a=0;a<y;a+=1)m=e[a],_=b(m,a),s=o.get(_).e,(s.f&Jt)===0&&((A=(T=s.nodes)==null?void 0:T.a)==null||A.measure(),(u??(u=new Set)).add(s));for(a=0;a<y;a+=1){if(m=e[a],_=b(m,a),s=o.get(_).e,r.outrogroups!==null)for(const D of r.outrogroups)D.pending.delete(s),D.done.delete(s);if((s.f&xt)!==0&&(wn(s),k&&((M=(I=s.nodes)==null?void 0:I.a)==null||M.unfix(),(u??(u=new Set)).delete(s))),(s.f&Jt)!==0)if(s.f^=Jt,s===c)Ei(s,null,n);else{var i=f?f.next:c;s===r.effect.last&&(r.effect.last=s.prev),s.prev&&(s.prev.next=s.next),s.next&&(s.next.prev=s.prev),_r(r,f,s),_r(r,s,i),Ei(s,i,n),f=s,d=[],p=[],c=Si(f.next);continue}if(s!==c){if(h!==void 0&&h.has(s)){if(d.length<p.length){var l=p[0],v;f=l.prev;var S=d[0],w=d[d.length-1];for(v=0;v<d.length;v+=1)Ei(d[v],l,n);for(v=0;v<p.length;v+=1)h.delete(p[v]);_r(r,S.prev,w.next),_r(r,f,S),_r(r,w,l),c=l,f=w,a-=1,d=[],p=[]}else h.delete(s),Ei(s,c,n),_r(r,s.prev,s.next),_r(r,s,f===null?r.effect.first:f.next),_r(r,f,s),f=s;continue}for(d=[],p=[];c!==null&&c!==s;)(h??(h=new Set)).add(c),p.push(c),c=Si(c.next);if(c===null)continue}(s.f&Jt)===0&&d.push(s),f=s,c=Si(s.next)}if(r.outrogroups!==null){for(const D of r.outrogroups)D.pending.size===0&&(sn(r,hs(D.done)),(N=r.outrogroups)==null||N.delete(D));r.outrogroups.size===0&&(r.outrogroups=null)}if(c!==null||h!==void 0){var E=[];if(h!==void 0)for(s of h)(s.f&xt)===0&&E.push(s);for(;c!==null;)(c.f&xt)===0&&c!==r.fallback&&E.push(c),c=Si(c.next);var g=E.length;if(g>0){var x=(t&yo)!==0&&y===0?n:null;if(k){for(a=0;a<g;a+=1)(X=(U=E[a].nodes)==null?void 0:U.a)==null||X.measure();for(a=0;a<g;a+=1)(Y=(J=E[a].nodes)==null?void 0:J.a)==null||Y.fix()}Bc(r,E,x)}}k&&hr(()=>{var D,B;if(u!==void 0)for(s of u)(B=(D=s.nodes)==null?void 0:D.a)==null||B.apply()})}function Oc(r,e,n,t,b,k,y,o){var c=(y&Ja)!==0?(y&el)===0?tc(n,!1,!1):Cr(n):null,h=(y&Za)!==0?Cr(b):null;return{v:c,i:h,e:gt(()=>(k(e,c??n,h??b,o),()=>{r.delete(t)}))}}function Ei(r,e,n){if(r.nodes)for(var t=r.nodes.start,b=r.nodes.end,k=e&&(e.f&Jt)===0?e.nodes.start:n;t!==null;){var y=Oi(t);if(k.before(t),t===b)return;t=y}}function _r(r,e,n){e===null?r.effect.first=n:e.next=n,n===null?r.effect.last=e:n.prev=e}function Vn(r,e,n=!1,t=!1,b=!1,k=!1){var y=r,o="";if(n)var c=r;ae(()=>{var h=Ee;if(o!==(o=e()??"")){if(n){h.nodes=null,c.innerHTML=o,o!==""&&Wr(Zt(c),c.lastChild);return}if(h.nodes!==null&&(ra(h.nodes.start,h.nodes.end),h.nodes=null),o!==""){var f=t?al:b?ll:void 0,u=Jo(t?"svg":b?"math":"template",f);u.innerHTML=o;var d=t||b?u:u.content;if(Wr(Zt(d),d.lastChild),t||b)for(;Zt(d);)y.before(Zt(d));else y.before(d)}}})}function Pc(r,e,n){Pi(()=>{var t=fr(()=>e(r,n==null?void 0:n())||{});if(t!=null&&t.destroy)return()=>t.destroy()})}function Ic(r,e){var n=void 0,t;ea(()=>{n!==(n=e())&&(t&&(st(t),t=null),n&&(t=gt(()=>{Pi(()=>n(r))})))})}function pa(r){var e,n,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var b=r.length;for(e=0;e<b;e++)r[e]&&(n=pa(r[e]))&&(t&&(t+=" "),t+=n)}else for(n in r)r[n]&&(t&&(t+=" "),t+=n);return t}function Hc(){for(var r,e,n=0,t="",b=arguments.length;n<b;n++)(r=arguments[n])&&(e=pa(r))&&(t&&(t+=" "),t+=e);return t}function kn(r){return typeof r=="object"?Hc(r):r??""}const Gn=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Nc(r,e,n){var t=r==null?"":""+r;if(e&&(t=t?t+" "+e:e),n){for(var b of Object.keys(n))if(n[b])t=t?t+" "+b:b;else if(t.length)for(var k=b.length,y=0;(y=t.indexOf(b,y))>=0;){var o=y+k;(y===0||Gn.includes(t[y-1]))&&(o===t.length||Gn.includes(t[o]))?t=(y===0?"":t.substring(0,y))+t.substring(o+1):y=o}}return t===""?null:t}function Xn(r,e=!1){var n=e?" !important;":";",t="";for(var b of Object.keys(r)){var k=r[b];k!=null&&k!==""&&(t+=" "+b+": "+k+n)}return t}function Bs(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function Fc(r,e){if(e){var n="",t,b;if(Array.isArray(e)?(t=e[0],b=e[1]):t=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var k=!1,y=0,o=!1,c=[];t&&c.push(...Object.keys(t).map(Bs)),b&&c.push(...Object.keys(b).map(Bs));var h=0,f=-1;const _=r.length;for(var u=0;u<_;u++){var d=r[u];if(o?d==="/"&&r[u-1]==="*"&&(o=!1):k?k===d&&(k=!1):d==="/"&&r[u+1]==="*"?o=!0:d==='"'||d==="'"?k=d:d==="("?y++:d===")"&&y--,!o&&k===!1&&y===0){if(d===":"&&f===-1)f=u;else if(d===";"||u===_-1){if(f!==-1){var p=Bs(r.substring(h,f).trim());if(!c.includes(p)){d!==";"&&u++;var m=r.substring(h,u).trim();n+=" "+m+";"}}h=u+1,f=-1}}}}return t&&(n+=Xn(t)),b&&(n+=Xn(b,!0)),n=n.trim(),n===""?null:n}return r==null?null:String(r)}function He(r,e,n,t,b,k){var y=r.__className;if(y!==n||y===void 0){var o=Nc(n,t,k);o==null?r.removeAttribute("class"):e?r.className=o:r.setAttribute("class",o),r.__className=n}else if(k&&b!==k)for(var c in k){var h=!!k[c];(b==null||h!==!!b[c])&&r.classList.toggle(c,h)}return k}function Ms(r,e={},n,t){for(var b in n){var k=n[b];e[b]!==k&&(n[b]==null?r.style.removeProperty(b):r.style.setProperty(b,k,t))}}function Ur(r,e,n,t){var b=r.__style;if(b!==e){var k=Fc(e,t);k==null?r.removeAttribute("style"):r.style.cssText=k,r.__style=e}else t&&(Array.isArray(t)?(Ms(r,n==null?void 0:n[0],t[0]),Ms(r,n==null?void 0:n[1],t[1],"important")):Ms(r,n,t));return t}function nn(r,e,n=!1){if(r.multiple){if(e==null)return;if(!un(e))return Ml();for(var t of r.options)t.selected=e.includes(Yn(t));return}for(t of r.options){var b=Yn(t);if(sc(b,e)){t.selected=!0;return}}(!n||e!==void 0)&&(r.selectedIndex=-1)}function Wc(r){var e=new MutationObserver(()=>{nn(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),bn(()=>{e.disconnect()})}function Yn(r){return"__value"in r?r.__value:r.value}const wi=Symbol("class"),Ci=Symbol("style"),ga=Symbol("is custom element"),ma=Symbol("is html"),Uc=_n?"option":"OPTION",jc=_n?"select":"SELECT",zc=_n?"progress":"PROGRESS";function Jn(r,e){var n=ps(r);n.value===(n.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==zc)||(r.value=e??"")}function is(r,e){var n=ps(r);n.checked!==(n.checked=e??void 0)&&(r.checked=e)}function $c(r,e){e?r.hasAttribute("selected")||r.setAttribute("selected",""):r.removeAttribute("selected")}function Re(r,e,n,t){var b=ps(r);b[e]!==(b[e]=n)&&(e==="loading"&&(r[wl]=n),n==null?r.removeAttribute(e):typeof n!="string"&&Sa(r).includes(e)?r[e]=n:r.setAttribute(e,n))}function Kc(r,e,n,t,b=!1,k=!1){var y=ps(r),o=y[ga],c=!y[ma],h=e||{},f=r.nodeName===Uc;for(var u in e)u in n||(n[u]=null);n.class?n.class=kn(n.class):n[wi]&&(n.class=null),n[Ci]&&(n.style??(n.style=null));var d=Sa(r);for(const v in n){let S=n[v];if(f&&v==="value"&&S==null){r.value=r.__value="",h[v]=S;continue}if(v==="class"){var p=r.namespaceURI==="http://www.w3.org/1999/xhtml";He(r,p,S,t,e==null?void 0:e[wi],n[wi]),h[v]=S,h[wi]=n[wi];continue}if(v==="style"){Ur(r,S,e==null?void 0:e[Ci],n[Ci]),h[v]=S,h[Ci]=n[Ci];continue}var m=h[v];if(!(S===m&&!(S===void 0&&r.hasAttribute(v)))){h[v]=S;var _=v[0]+v[1];if(_!=="$$")if(_==="on"){const w={},E="$$"+v;let g=v.slice(2);var s=wc(g);if(bc(g)&&(g=g.slice(0,-7),w.capture=!0),!s&&m){if(S!=null)continue;r.removeEventListener(g,h[E],w),h[E]=null}if(s)Se(g,r,S),It([g]);else if(S!=null){let x=function(T){h[v].call(this,T)};var l=x;h[E]=_a(g,r,x,w)}}else if(v==="style")Re(r,v,S);else if(v==="autofocus")ac(r,!!S);else if(!o&&(v==="__value"||v==="value"&&S!=null))r.value=r.__value=S;else if(v==="selected"&&f)$c(r,S);else{var a=v;c||(a=yc(a));var i=a==="defaultValue"||a==="defaultChecked";if(S==null&&!o&&!i)if(y[v]=null,a==="value"||a==="checked"){let w=r;const E=e===void 0;if(a==="value"){let g=w.defaultValue;w.removeAttribute(a),w.defaultValue=g,w.value=w.__value=E?g:null}else{let g=w.defaultChecked;w.removeAttribute(a),w.defaultChecked=g,w.checked=E?g:!1}}else r.removeAttribute(v);else i||d.includes(a)&&(o||typeof S!="string")?(r[a]=S,a in y&&(y[a]=tt)):typeof S!="function"&&Re(r,a,S)}}}return h}function ba(r,e,n=[],t=[],b=[],k,y=!1,o=!1){Wo(b,n,t,c=>{var h=void 0,f={},u=r.nodeName===jc,d=!1;if(ea(()=>{var m=e(...c.map(C)),_=Kc(r,h,m,k,y,o);d&&u&&"value"in m&&nn(r,m.value);for(let a of Object.getOwnPropertySymbols(f))m[a]||st(f[a]);for(let a of Object.getOwnPropertySymbols(m)){var s=m[a];a.description===cl&&(!h||s!==h[a])&&(f[a]&&st(f[a]),f[a]=gt(()=>Ic(r,()=>s))),_[a]=s}h=_}),u){var p=r;Pi(()=>{nn(p,h.value,!0),Wc(p)})}d=!0})}function ps(r){return r.__attributes??(r.__attributes={[ga]:r.nodeName.includes("-"),[ma]:r.namespaceURI===xo})}var Zn=new Map;function Sa(r){var e=r.getAttribute("is")||r.nodeName,n=Zn.get(e);if(n)return n;Zn.set(e,n=[]);for(var t,b=r,k=Element.prototype;k!==b;){t=fl(b);for(var y in t)t[y].set&&n.push(y);b=Eo(b)}return n}function Yr(r,e,n=e){var t=new WeakSet;Zo(r,"input",async b=>{var k=b?r.defaultValue:r.value;if(k=Os(r)?Ps(k):k,n(k),pe!==null&&t.add(pe),await pc(),k!==(k=e())){var y=r.selectionStart,o=r.selectionEnd,c=r.value.length;if(r.value=k??"",o!==null){var h=r.value.length;y===o&&o===c&&h>c?(r.selectionStart=h,r.selectionEnd=h):(r.selectionStart=y,r.selectionEnd=Math.min(o,h))}}}),fr(e)==null&&r.value&&(n(Os(r)?Ps(r.value):r.value),pe!==null&&t.add(pe)),_s(()=>{var b=e();if(r===document.activeElement){var k=pe;if(t.has(k))return}Os(r)&&b===Ps(r.value)||r.type==="date"&&!b&&!r.value||b!==r.value&&(r.value=b??"")})}function qc(r,e,n=e){Zo(r,"change",t=>{var b=t?r.defaultChecked:r.checked;n(b)}),fr(e)==null&&n(r.checked),_s(()=>{var t=e();r.checked=!!t})}function Os(r){var e=r.type;return e==="number"||e==="range"}function Ps(r){return r===""?null:+r}function Qn(r,e){return r===e||(r==null?void 0:r[Or])===e}function Di(r={},e,n,t){var b=dt.r,k=Ee;return Pi(()=>{var y,o;return _s(()=>{y=o,o=[],fr(()=>{r!==n(...o)&&(e(r,...o),y&&Qn(n(...y),r)&&e(null,...y))})}),()=>{let c=k;for(;c!==b&&c.parent!==null&&c.parent.f&$s;)c=c.parent;const h=()=>{o&&Qn(n(...o),r)&&e(null,...o)},f=c.teardown;c.teardown=()=>{h(),f==null||f()}}}),r}const Vc={get(r,e){if(!r.exclude.includes(e))return r.props[e]},set(r,e){return!1},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function wa(r,e,n){return new Proxy({props:r,exclude:e},Vc)}function Le(r,e,n,t){var i;var b=(n&il)!==0,k=(n&sl)!==0,y=t,o=!0,c=()=>(o&&(o=!1,y=k?fr(t):t),y);let h;if(b){var f=Or in r||Sl in r;h=((i=Xr(r,e))==null?void 0:i.set)??(f&&e in r?l=>r[e]=l:void 0)}var u,d=!1;b?[u,d]=Fl(()=>r[e]):u=r[e],u===void 0&&t!==void 0&&(u=c(),h&&(Dl(),h(u)));var p;if(p=()=>{var l=r[e];return l===void 0?c():(o=!0,l)},(n&rl)===0)return p;if(h){var m=r.$$legacy;return(function(l,v){return arguments.length>0?((!v||m||d)&&h(v?p():l),l):p()})}var _=!1,s=((n&tl)!==0?ds:jo)(()=>(_=!1,p()));b&&C(s);var a=Ee;return(function(l,v){if(arguments.length>0){const S=v?C(s):b?Me(l):l;return j(s,S),_=!0,y!==void 0&&(y=S),l}return yr&&_||(a.f&Bt)!==0?s.v:C(s)})}const Gc=["github-dark","dracula","nord","solarized-dark","one-dark"],on=[{key:"github-dark",label:"GitHub Dark",colors:{surface:"#0d1117",sidebar:"#161b22",topbar:"#1c2128",hover:"#21262d",active:"#1f6feb33",edge:"#30363d",primary:"#e6edf3",muted:"#8b949e",accent:"#58a6ff",danger:"#f85149",success:"#3fb950",warning:"#d29922"},terminal:{background:"#0d1117",foreground:"#e6edf3",cursor:"#58a6ff",selectionBackground:"#264f78"}},{key:"dracula",label:"Dracula",colors:{surface:"#282a36",sidebar:"#21222c",topbar:"#2d2f3f",hover:"#343746",active:"#bd93f933",edge:"#44475a",primary:"#f8f8f2",muted:"#6272a4",accent:"#bd93f9",danger:"#ff5555",success:"#50fa7b",warning:"#f1fa8c"},terminal:{background:"#282a36",foreground:"#f8f8f2",cursor:"#bd93f9",selectionBackground:"#44475a"}},{key:"nord",label:"Nord",colors:{surface:"#2e3440",sidebar:"#272c36",topbar:"#353b49",hover:"#3b4252",active:"#88c0d033",edge:"#4c566a",primary:"#eceff4",muted:"#81a1c1",accent:"#88c0d0",danger:"#bf616a",success:"#a3be8c",warning:"#ebcb8b"},terminal:{background:"#2e3440",foreground:"#eceff4",cursor:"#88c0d0",selectionBackground:"#434c5e"}},{key:"solarized-dark",label:"Solarized Dark",colors:{surface:"#002b36",sidebar:"#00222b",topbar:"#073642",hover:"#0a4050",active:"#268bd233",edge:"#2e5e6a",primary:"#fdf6e3",muted:"#839496",accent:"#268bd2",danger:"#dc322f",success:"#859900",warning:"#b58900"},terminal:{background:"#002b36",foreground:"#fdf6e3",cursor:"#268bd2",selectionBackground:"#073642"}},{key:"one-dark",label:"One Dark",colors:{surface:"#282c34",sidebar:"#21252b",topbar:"#2c323c",hover:"#333842",active:"#61afef33",edge:"#3e4452",primary:"#abb2bf",muted:"#636d83",accent:"#61afef",danger:"#e06c75",success:"#98c379",warning:"#e5c07b"},terminal:{background:"#282c34",foreground:"#abb2bf",cursor:"#61afef",selectionBackground:"#3e4452"}}];function Ca(r){return on.find(e=>e.key===r)??on[0]}const es="wt-ssh-host",ya="wt-theme",an="wt-last-selected-worktree";function gs(r){return r.repo?`${r.repo} #${r.number}`:`PR #${r.number}`}function Xc(r){return r==="merged"?"text-merged":r==="closed"?"text-danger":"text-primary"}function eo(r){return r==="merged"?"bg-merged/20 text-merged":r==="closed"?"bg-danger/20 text-danger":r==="open"?"bg-success/20 text-success":"bg-muted/20 text-muted"}function Yc(r){return r==="failed"?"text-danger":r==="success"?"text-success":r==="pending"?"text-warning":"text-muted"}function Jc(r){return r==="failed"?"bg-danger":r==="success"?"bg-success":r==="pending"?"bg-warning animate-pulse":"bg-muted"}function Zc(r){if(r.ciChecks.length>0){if(r.ciStatus==="failed")return"border-danger/40 bg-danger/5";if(r.ciStatus==="pending")return"border-warning/40 bg-warning/5";if(r.ciStatus==="success")return"border-success/30 bg-success/5"}return r.state==="merged"?"border-merged/35 bg-merged/8":r.state==="closed"?"border-danger/35 bg-danger/5":"border-edge bg-surface"}function Yt(r){return r instanceof Error?r.message:String(r)}function ln(r,e){return e.toLowerCase().includes(r.toLowerCase())}function Qc(){const r=localStorage.getItem(ya);return r&&Gc.includes(r)?r:"github-dark"}function eh(){var e;const r=(e=localStorage.getItem(an))==null?void 0:e.trim();return r||null}function to(r){if(r){localStorage.setItem(an,r);return}localStorage.removeItem(an)}function xa(r){const e=Ca(r),n=document.documentElement;for(const[t,b]of Object.entries(e.colors))n.style.setProperty(`--color-${t}`,b);localStorage.setItem(ya,r)}function Ea(r){switch(r){case"creating_worktree":return"Creating worktree";case"preparing_runtime":return"Preparing runtime";case"running_post_create_hook":return"Running post-create hook";case"starting_session":return"Starting session";case"reconciling":return"Reconciling";default:return"Creating"}}function th(r,e,n,t){return r&&e||!t?r:n.length===0?null:(n.find(k=>k.mux==="✓")??n[0]).branch}var rh=Q('<a target="_blank" rel="noopener"> </a>'),ih=Q("<span> </span>");function sh(r,e){Ke(e,!0);let n=Le(e,"clickable",3,!1),t=he(()=>gs(e.pr));var b=Pt(),k=Pe(b);{var y=c=>{var h=rh(),f=$(h);ae(u=>{Re(h,"href",e.pr.url),He(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80 ${u??""}`),ne(f,C(t))},[()=>eo(e.pr.state)]),K(c,h)},o=c=>{var h=ih(),f=$(h);ae(u=>{He(h,1,`shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full ${u??""}`),ne(f,C(t))},[()=>eo(e.pr.state)]),K(c,h)};se(k,c=>{n()&&e.pr.url?c(y):c(o,-1)})}K(r,b),qe()}var nh=Q('<a target="_blank" rel="noopener noreferrer" class="shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded-full no-underline hover:opacity-80"> </a>');function ka(r,e){Ke(e,!0);var n=nh(),t=$(n);ae(()=>{Re(n,"href",e.issue.url),Ur(n,`color: ${e.issue.state.color??""}; background: ${e.issue.state.color??""}20;`),Re(n,"title",`${e.issue.identifier??""} (${e.issue.state.name??""})`),ne(t,e.issue.identifier)}),K(r,n),qe()}var oh=vs('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.5"></circle><circle cx="12" cy="12" r="1.5"></circle><circle cx="19" cy="12" r="1.5"></circle></svg>'),ah=vs('<svg class="text-warning" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path><path d="M12 7v2"></path><path d="M12 13h.01"></path></svg>'),lh=vs('<svg class="text-success" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>'),ch=vs('<svg class="text-danger" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>'),hh=Q("<span><!> </span>");function uh(r,e){const n=f=>{var u=Pt(),d=Pe(u);{var p=a=>{var i=oh();ae(()=>{Re(i,"width",t()),Re(i,"height",t())}),K(a,i)},m=a=>{var i=ah();ae(()=>{Re(i,"width",t()),Re(i,"height",t())}),K(a,i)},_=a=>{var i=lh();ae(()=>{Re(i,"width",t()),Re(i,"height",t())}),K(a,i)},s=a=>{var i=ch();ae(()=>{Re(i,"width",t()),Re(i,"height",t())}),K(a,i)};se(d,a=>{e.status==="working"?a(p):e.status==="waiting"?a(m,1):e.status==="done"?a(_,2):e.status==="error"&&a(s,3)})}K(f,u)};let t=Le(e,"size",3,10),b=Le(e,"pill",3,!1);function k(f){return f==="working"?"bg-success/15 text-success":f==="waiting"?"bg-warning/15 text-warning":f==="done"?"bg-success/15 text-success":f==="error"?"bg-danger/15 text-danger":"bg-hover text-muted"}var y=Pt(),o=Pe(y);{var c=f=>{var u=hh(),d=$(u);n(d);var p=V(d);ae(m=>{He(u,1,`text-xs px-2 py-0.5 rounded-xl flex items-center gap-1 ${m??""}`),ne(p,` ${(e.status||"idle")??""}`)},[()=>k(e.status)]),K(f,u)},h=f=>{n(f)};se(o,f=>{b()?f(c):f(h,-1)})}K(r,y)}var dh=Q('<span class="shrink-0 inline-flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </span>'),fh=Q('<span class="shrink-0 text-[10px] text-muted">opening...</span>'),_h=Q('<span class="shrink-0 text-[10px] text-muted">closed</span>'),vh=Q('<span class="shrink-0"><!></span>'),ph=Q('<span class="shrink-0 w-2 h-2 rounded-full bg-accent"></span>'),gh=Q("<span> </span>"),mh=Q("<span> </span>"),bh=Q("<span> </span>"),Sh=Q('<span class="flex gap-2 text-[11px] text-muted font-mono"></span>'),wh=Q('<li><button type="button"><span class="flex items-center gap-1.5 pr-5 flex-wrap"><div class="flex items-center gap-2 max-w-[90%] min-w-0"><span class="font-medium truncate"> </span> <!> <!></div> <!> <!></span> <span class="flex gap-2 text-[11px] text-muted items-center flex-wrap"><!> <!></span> <!></button> <button type="button" class="absolute top-2 right-2 w-5 h-5 rounded flex items-center justify-center text-muted hover:text-danger hover:bg-hover opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer" title="Remove worktree">×</button></li>'),Ch=Q('<ul class="list-none overflow-y-auto flex-1 p-2"></ul>');function yh(r,e){Ke(e,!0);var n=Ch();Xe(n,21,()=>e.worktrees,t=>t.branch,(t,b)=>{const k=he(()=>C(b).branch===e.selected),y=he(()=>e.removing.has(C(b).branch)),o=he(()=>C(b).mux!=="✓"),c=he(()=>e.initializing.has(C(b).branch)),h=he(()=>C(b).creating),f=he(()=>C(y)||C(c));var u=wh(),d=$(u),p=$(d),m=$(p),_=$(m),s=$(_),a=V(_,2);{var i=B=>{var R=dh(),O=V($(R));ae(W=>ne(O,` ${W??""}...`),[()=>Ea(C(b).creationPhase)]),K(B,R)},l=B=>{var R=fh();K(B,R)},v=B=>{var R=_h();K(B,R)},S=B=>{var R=vh(),O=$(R);uh(O,{get status(){return C(b).agent},size:14}),K(B,R)};se(a,B=>{C(h)?B(i):C(c)?B(l,1):C(o)?B(v,2):B(S,-1)})}var w=V(a,2);{var E=B=>{var R=ph();K(B,R)},g=he(()=>e.notifiedBranches.has(C(b).branch));se(w,B=>{C(g)&&B(E)})}var x=V(m,2);Xe(x,17,()=>C(b).prs,B=>B.repo,(B,R)=>{sh(B,{get pr(){return C(R)}})});var T=V(x,2);{var A=B=>{ka(B,{get issue(){return C(b).linearIssue}})};se(T,B=>{C(b).linearIssue&&B(A)})}var I=V(p,2),M=$(I);{var N=B=>{var R=gh(),O=$(R);ae(()=>ne(O,C(b).agentName)),K(B,R)};se(M,B=>{C(b).agentName&&B(N)})}var U=V(M,2);{var X=B=>{var R=mh(),O=$(R);ae(()=>ne(O,C(b).profile)),K(B,R)};se(U,B=>{C(b).profile&&B(X)})}var J=V(I,2);{var Y=B=>{var R=Sh();Xe(R,21,()=>C(b).services,ui,(O,W)=>{var ee=Pt(),ce=Pe(ee);{var ie=F=>{var L=bh(),P=$(L);ae(()=>{He(L,1,kn(C(W).running?"text-success":"")),ne(P,`${C(W).name??""}:${C(W).port??""}`)}),K(F,L)};se(ce,F=>{C(W).port&&F(ie)})}K(O,ee)}),K(B,R)};se(J,B=>{C(b).services.length>0&&B(Y)})}var D=V(d,2);ae(()=>{He(u,1,`mb-0.5 group relative ${C(f)?"opacity-40 pointer-events-none":""}`),d.disabled=C(f),He(d,1,`w-full py-2.5 px-3 rounded-md border cursor-pointer flex flex-col gap-1 text-left text-inherit text-sm bg-transparent hover:bg-hover ${C(k)?"bg-active border-accent":"border-transparent"} ${C(o)&&!C(c)&&!C(h)?"opacity-50":""}`),ne(s,C(b).branch),D.disabled=C(f)}),Se("click",d,()=>e.onselect(C(b).branch)),Se("click",D,B=>{B.stopPropagation(),e.onremove(C(b).branch)}),K(t,u)}),K(r,n),qe()}It(["click"]);var xh=Q('<button type="button" title="View CI checks"><span></span> <span class="uppercase tracking-[0.08em] text-[9px]">CI</span></button>'),Eh=Q('<button type="button" title="Review PR comments"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg> <span> </span></button>'),kh=Q('<div><a target="_blank" rel="noopener" title="Open PR"><span class="truncate"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7 17 17 7"></path><path d="M7 7h10v10"></path></svg></a> <!> <!></div>');function Lh(r,e){Ke(e,!0);let n=he(()=>gs(e.pr)),t=he(()=>e.pr.ciChecks.length>0),b=he(()=>e.pr.comments.length>0);var k=kh(),y=$(k),o=$(y),c=$(o),h=V(y,2);{var f=p=>{var m=xh(),_=$(m);ae((s,a)=>{He(m,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge ${s??""}`),Re(m,"aria-label",`View CI checks for ${C(n)}`),He(_,1,`inline-block h-1.5 w-1.5 rounded-full ${a??""}`)},[()=>Yc(e.pr.ciStatus),()=>Jc(e.pr.ciStatus)]),Se("click",m,s=>{s.stopPropagation(),e.onCiClick(e.pr)}),K(p,m)};se(h,p=>{C(t)&&p(f)})}var u=V(h,2);{var d=p=>{var m=Eh();He(m,1,"relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent border-l border-edge text-accent");var _=V($(m),2),s=$(_);ae(()=>{Re(m,"aria-label",`Review ${e.pr.comments.length} comments for ${C(n)}`),ne(s,e.pr.comments.length)}),Se("click",m,a=>{a.stopPropagation(),e.onReviewsClick(e.pr)}),K(p,m)};se(u,p=>{C(b)&&p(d)})}ae((p,m)=>{He(k,1,`shrink-0 inline-flex min-w-0 items-stretch overflow-hidden rounded-full border text-[10px] font-medium leading-none ${p??""}`),Re(y,"href",e.pr.url),He(y,1,`relative flex items-center gap-1.5 bg-transparent px-2.5 py-1.5 transition-colors cursor-pointer hover:bg-hover active:bg-active focus-visible:z-10 focus-visible:bg-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent min-w-0 no-underline ${m??""}`),ne(c,C(n))},[()=>Zc(e.pr),()=>Xc(e.pr.state)]),K(r,k),qe()}It(["click"]);var Dh=Q('<span class="shrink-0 text-[10px] font-medium text-muted"> </span>'),Th=Q('<a target="_blank" rel="noopener"> </a>'),Rh=Q('<a class="shrink-0 text-[9px] px-1.5 py-0.5 rounded border border-accent/40 text-accent font-medium no-underline hover:opacity-80" title="Open in Cursor">Cursor</a>'),Ah=Q('<div class="flex items-center gap-2 min-w-0"><!> <!> <!> <!></div>');function Xi(r,e){let n=Le(e,"services",19,()=>[]),t=Le(e,"cursorUrl",3,null);var b=Ah(),k=$(b);{var y=u=>{var d=Dh(),p=$(d);ae(()=>ne(p,`${e.label??""}:`)),K(u,d)};se(k,u=>{e.label&&u(y)})}var o=V(k,2);Xe(o,17,()=>e.prs,u=>`${u.repo}#${u.number}`,(u,d)=>{Lh(u,{get pr(){return C(d)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})});var c=V(o,2);Xe(c,17,n,ui,(u,d)=>{var p=Pt(),m=Pe(p);{var _=s=>{var a=Th(),i=$(a);ae(()=>{Re(a,"href",`${window.location.protocol??""}//${window.location.hostname??""}:${C(d).port??""}`),He(a,1,`shrink-0 text-[11px] px-1.5 py-0.5 rounded border font-mono no-underline hover:opacity-80 ${C(d).running?"text-success border-success/40":"text-muted border-edge pointer-events-none"}`),ne(i,`${C(d).name??""} :${C(d).port??""}`)}),K(s,a)};se(m,s=>{C(d).port&&s(_)})}K(u,p)});var h=V(c,2);{var f=u=>{var d=Rh();ae(()=>Re(d,"href",t())),K(u,d)};se(h,u=>{t()&&u(f)})}K(r,b)}var Bh=Q("<button><!></button>");function nt(r,e){let n=Le(e,"variant",3,"default"),t=Le(e,"small",3,!1),b=Le(e,"class",3,""),k=wa(e,["$$slots","$$events","$$legacy","variant","small","class","children"]);const y={normal:"px-3 py-1.5 text-xs",small:"px-2.5 py-1 text-[11px] font-semibold"},o={default:"border-edge bg-surface text-primary hover:bg-hover",cta:"border-accent bg-accent text-white hover:opacity-90",danger:"border-danger bg-danger text-white hover:opacity-90","accent-outline":"border-accent text-accent bg-surface hover:bg-accent/10","danger-outline":"border-danger text-danger bg-surface hover:bg-danger/10"};var c=Bh();ba(c,()=>({class:`rounded-md border cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${y[t()?"small":"normal"]??""} ${o[n()]??""} ${b()??""}`,...k}));var h=$(c);xn(h,()=>e.children),K(r,c)}var Mh=Q('<span class="text-success">✓</span>'),Oh=Q('<span class="text-accent">☍</span>'),Ph=Q('<span class="text-[10px] text-muted"> </span>'),Ih=Q('<span class="text-xs text-accent truncate"> </span>'),Hh=Q('<span><!></span> <span class="flex flex-col gap-0.5 min-w-0"><span> </span> <!></span>',1);function La(r,e){Ke(e,!0);let n=Le(e,"showTimestamp",3,!1),t=Le(e,"large",3,!1);var b=Hh(),k=Pe(b),y=$(k);{var o=_=>{var s=Mh();K(_,s)},c=_=>{var s=Oh();K(_,s)};se(y,_=>{e.notification.type==="agent_stopped"?_(o):_(c,-1)})}var h=V(k,2),f=$(h),u=$(f),d=V(f,2);{var p=_=>{var s=Ph(),a=$(s);ae(i=>ne(a,i),[()=>new Date(e.notification.timestamp).toLocaleTimeString()]),K(_,s)},m=_=>{var s=Ih(),a=$(s);ae(()=>ne(a,e.notification.url)),K(_,s)};se(d,_=>{n()?_(p):e.notification.url&&_(m,1)})}ae(()=>{He(k,1,`shrink-0 ${t()?"text-base":"text-sm"}`),He(f,1,`${t()?"text-sm":"text-xs"} text-primary truncate`),ne(u,e.notification.message)}),K(r,b),qe()}var Nh=Q('<button type="button" class="p-1 -ml-1 cursor-pointer bg-transparent border-none text-muted hover:text-primary" title="Toggle sidebar"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button>'),Fh=Q('<button type="button" class="shrink-0 text-[10px] px-1.5 py-0.5 rounded border border-warning/40 text-warning bg-transparent cursor-pointer hover:bg-warning/10">dirty</button>'),Wh=Q("<!> <!> <!>",1),Uh=Q('<div class="more-dropdown svelte-gwjq7z"><div class="flex flex-col gap-2 p-3"><!> <!></div></div>'),jh=Q('<div class="more-container relative"><button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="More info"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="5" r="1"></circle><circle cx="12" cy="12" r="1"></circle><circle cx="12" cy="19" r="1"></circle></svg></button> <!></div>'),zh=Q('<span class="absolute -top-0.5 -right-0.5 w-4 h-4 rounded-full bg-accent text-white text-[10px] flex items-center justify-center leading-none"> </span>'),$h=Q('<div class="px-3 py-4 text-xs text-muted text-center">No notifications yet</div>'),Kh=Q('<li><button type="button" class="w-full px-3 py-2 text-left bg-transparent border-none text-inherit cursor-pointer hover:bg-hover flex items-center gap-2"><!></button></li>'),qh=Q('<ul class="list-none max-h-64 overflow-y-auto"></ul>'),Vh=Q('<div class="bell-dropdown svelte-gwjq7z"><div class="text-xs font-semibold text-muted px-3 py-2 border-b border-edge">Notifications</div> <!></div>'),Gh=Q('<div class="flex items-stretch bg-topbar border-b border-edge min-h-12"><div class="flex-1 min-w-0 flex flex-col justify-center px-4 py-2.5 gap-1.5"><div class="flex items-center gap-3 min-w-0"><!> <span class="text-sm font-semibold truncate"> </span> <!> <!> <!></div> <!></div> <div class="shrink-0 flex gap-2 items-center px-4"><!> <!> <div class="bell-container relative ml-3"><button type="button" class="relative p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Notifications"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"></path><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"></path></svg> <!></button> <!></div> <button type="button" class="p-1.5 rounded-md cursor-pointer bg-transparent border border-transparent text-muted hover:text-primary hover:border-edge" title="Settings"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button></div></div>');function Xh(r,e){Ke(e,!0);let n=Le(e,"linkedRepos",19,()=>[]),t=Le(e,"isMobile",3,!1),b=Le(e,"notificationHistory",19,()=>[]),k=Le(e,"unreadCount",3,0),y=le(!1),o=le(!1);function c(){var L;j(y,!C(y)),C(y)&&((L=e.onbellopen)==null||L.call(e))}function h(L){const P=L.target;P.closest(".bell-container")||j(y,!1),P.closest(".more-container")||j(o,!1)}function f(L){return L?e.sshHost?`cursor://vscode-remote/ssh-remote+${e.sshHost}${L}`:`cursor://file${L}`:null}function u(L,P){return!L||L.length<=P?L:`${L.slice(0,P-3)}...`}let d=he(()=>{var L;return f((L=e.worktree)==null?void 0:L.dir)}),p=he(()=>u(e.name,30)),m=he(()=>{var L;return(((L=e.worktree)==null?void 0:L.prs)??[]).filter(P=>!P.repo||!n().some(H=>H.alias===P.repo))}),_=he(()=>n().map(L=>{var P;return{alias:L.alias,dir:L.dir,cursorUrl:f(L.dir&&e.name?`${L.dir}/${e.name}`:null),prs:(((P=e.worktree)==null?void 0:P.prs)??[]).filter(H=>H.repo===L.alias)}}).filter(L=>L.prs.length>0||L.cursorUrl)),s=he(()=>C(m).length>0||C(_).length>0);var a=Gh();cr("click",en,h);var i=$(a),l=$(i),v=$(l);{var S=L=>{var P=Nh();Se("click",P,function(...H){var G;(G=e.ontogglesidebar)==null||G.apply(this,H)}),K(L,P)};se(v,L=>{t()&&e.ontogglesidebar&&L(S)})}var w=V(v,2),E=$(w),g=V(w,2);{var x=L=>{var P=Fh();Se("click",P,function(...H){var G;(G=e.ondirtyclick)==null||G.apply(this,H)}),K(L,P)};se(g,L=>{var P;(P=e.worktree)!=null&&P.dirty&&L(x)})}var T=V(g,2);{var A=L=>{ka(L,{get issue(){return e.worktree.linearIssue}})};se(T,L=>{var P;(P=e.worktree)!=null&&P.linearIssue&&L(A)})}var I=V(T,2);{var M=L=>{{let P=he(()=>{var H;return((H=e.worktree)==null?void 0:H.services)??[]});Xi(L,{get prs(){return C(m)},get services(){return C(P)},get cursorUrl(){return C(d)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}};se(I,L=>{t()||L(M)})}var N=V(l,2);{var U=L=>{var P=Pt(),H=Pe(P);Xe(H,17,()=>C(_),G=>G.alias,(G,Z)=>{Xi(G,{get label(){return C(Z).alias},get prs(){return C(Z).prs},get cursorUrl(){return C(Z).cursorUrl},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),K(L,P)};se(N,L=>{t()||L(U)})}var X=V(i,2),J=$(X);{var Y=L=>{var P=Wh(),H=Pe(P);{var G=ue=>{nt(ue,{variant:"default",get onclick(){return e.onclose},title:"Close worktree window",children:(de,ye)=>{var re=ze();ae(()=>ne(re,t()?"C":"Close")),K(de,re)},$$slots:{default:!0}})};se(H,ue=>{e.worktree.mux==="✓"&&ue(G)})}var Z=V(H,2);nt(Z,{variant:"accent-outline",get onclick(){return e.onmerge},title:"Merge worktree",children:(ue,de)=>{var ye=ze();ae(()=>ne(ye,t()?"M":"Merge")),K(ue,ye)},$$slots:{default:!0}});var oe=V(Z,2);nt(oe,{variant:"danger-outline",get onclick(){return e.onremove},title:"Remove worktree",children:(ue,de)=>{var ye=ze();ae(()=>ne(ye,t()?"R":"Remove")),K(ue,ye)},$$slots:{default:!0}}),K(L,P)};se(J,L=>{e.worktree&&L(Y)})}var D=V(J,2);{var B=L=>{var P=jh(),H=$(P),G=V(H,2);{var Z=oe=>{var ue=Uh(),de=$(ue),ye=$(de);Xi(ye,{get prs(){return C(m)},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}});var re=V(ye,2);Xe(re,17,()=>C(_),ge=>ge.alias,(ge,ke)=>{Xi(ge,{get label(){return C(ke).alias},get prs(){return C(ke).prs},get onCiClick(){return e.onCiClick},get onReviewsClick(){return e.onReviewsClick}})}),K(oe,ue)};se(G,oe=>{C(o)&&oe(Z)})}Se("keydown",P,()=>{}),Se("click",H,()=>{j(o,!C(o))}),K(L,P)};se(D,L=>{t()&&e.worktree&&C(s)&&L(B)})}var R=V(D,2),O=$(R),W=V($(O),2);{var ee=L=>{var P=zh(),H=$(P);ae(()=>ne(H,k()>9?"9+":k())),K(L,P)};se(W,L=>{k()>0&&L(ee)})}var ce=V(O,2);{var ie=L=>{var P=Vh(),H=V($(P),2);{var G=oe=>{var ue=$h();K(oe,ue)},Z=oe=>{var ue=qh();Xe(ue,21,b,de=>de.id,(de,ye)=>{var re=Kh(),ge=$(re),ke=$(ge);La(ke,{get notification(){return C(ye)},showTimestamp:!0}),Se("click",ge,()=>{var Je;(Je=e.onnotificationselect)==null||Je.call(e,C(ye).branch),j(y,!1)}),K(de,re)}),K(oe,ue)};se(H,oe=>{b().length===0?oe(G):oe(Z,-1)})}K(L,P)};se(ce,L=>{C(y)&&L(ie)})}var F=V(R,2);ae(()=>{Re(w,"title",e.name??void 0),ne(E,C(p)??"Select a worktree")}),Se("keydown",R,()=>{}),Se("click",O,c),Se("click",F,function(...L){var P;(P=e.onsettings)==null||P.apply(this,L)}),K(r,a),qe()}It(["click","keydown"]);var Is={exports:{}},ro;function Yh(){return ro||(ro=1,(function(r,e){(function(n,t){r.exports=t()})(globalThis,(()=>(()=>{var n={4567:function(y,o,c){var h=this&&this.__decorate||function(i,l,v,S){var w,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,v,S);else for(var x=i.length-1;x>=0;x--)(w=i[x])&&(g=(E<3?w(g):E>3?w(l,v,g):w(l,v))||g);return E>3&&g&&Object.defineProperty(l,v,g),g},f=this&&this.__param||function(i,l){return function(v,S){l(v,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),d=c(9924),p=c(844),m=c(4725),_=c(2585),s=c(3656);let a=o.AccessibilityManager=class extends p.Disposable{constructor(i,l,v,S){super(),this._terminal=i,this._coreBrowserService=v,this._renderService=S,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 w=0;w<this._terminal.rows;w++)this._rowElements[w]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[w]);if(this._topBoundaryFocusListener=w=>this._handleBoundaryFocus(w,0),this._bottomBoundaryFocusListener=w=>this._handleBoundaryFocus(w,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((w=>this._handleResize(w.rows)))),this.register(this._terminal.onRender((w=>this._refreshRows(w.start,w.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((w=>this._handleChar(w)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
3
|
+
`)))),this.register(this._terminal.onA11yTab((w=>this._handleTab(w)))),this.register(this._terminal.onKey((w=>this._handleKey(w.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,s.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,p.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(i){for(let l=0;l<i;l++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
|
|
4
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(i){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,l){this._liveRegionDebouncer.refresh(i,l,this._terminal.rows)}_renderRows(i,l){const v=this._terminal.buffer,S=v.lines.length.toString();for(let w=i;w<=l;w++){const E=v.lines.get(v.ydisp+w),g=[],x=(E==null?void 0:E.translateToString(!0,void 0,void 0,g))||"",T=(v.ydisp+w+1).toString(),A=this._rowElements[w];A&&(x.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=x,this._rowColumns.set(A,g)),A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,l){const v=i.target,S=this._rowElements[l===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==S)return;let w,E;if(l===0?(w=v,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(w=this._rowElements.shift(),E=v,this._rowContainer.removeChild(w)),w.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleSelectionChange(){var x;if(this._rowElements.length===0)return;const i=document.getSelection();if(!i)return;if(i.isCollapsed)return void(this._rowContainer.contains(i.anchorNode)&&this._terminal.clearSelection());if(!i.anchorNode||!i.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:i.anchorNode,offset:i.anchorOffset},v={node:i.focusNode,offset:i.focusOffset};if((l.node.compareDocumentPosition(v.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===v.node&&l.offset>v.offset)&&([l,v]=[v,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const S=this._rowElements.slice(-1)[0];if(v.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(v={node:S,offset:((x=S.textContent)==null?void 0:x.length)??0}),!this._rowContainer.contains(v.node))return;const w=({node:T,offset:A})=>{const I=T instanceof Text?T.parentNode:T;let M=parseInt(I==null?void 0:I.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(I);if(!N)return console.warn("columns is null. Race condition?"),null;let U=A<N.length?N[A]:N.slice(-1)[0]+1;return U>=this._terminal.cols&&(++M,U=0),{row:M,column:U}},E=w(l),g=w(v);if(E&&g){if(E.row>g.row||E.row===g.row&&E.column>=g.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(g.row-E.row)*this._terminal.cols-E.column+g.column)}}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=this._coreBrowserService.mainDocument.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_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 i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=a=h([f(1,_.IInstantiationService),f(2,m.ICoreBrowserService),f(3,m.IRenderService)],a)},3614:(y,o)=>{function c(d){return d.replace(/\r?\n/g,"\r")}function h(d,p){return p?"\x1B[200~"+d+"\x1B[201~":d}function f(d,p,m,_){d=h(d=c(d),m.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),m.triggerDataEvent(d,!0),p.value=""}function u(d,p,m){const _=m.getBoundingClientRect(),s=d.clientX-_.left-10,a=d.clientY-_.top-10;p.style.width="20px",p.style.height="20px",p.style.left=`${s}px`,p.style.top=`${a}px`,p.style.zIndex="1000",p.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(d,p){d.clipboardData&&d.clipboardData.setData("text/plain",p.selectionText),d.preventDefault()},o.handlePasteEvent=function(d,p,m,_){d.stopPropagation(),d.clipboardData&&f(d.clipboardData.getData("text/plain"),p,m,_)},o.paste=f,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(d,p,m,_,s){u(d,p,m),s&&_.rightClickSelect(d),p.value=_.selectionText,p.select()}},7239:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(f,u,d){this._css.set(f,u,d)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,d){this._color.set(f,u,d)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,f,u){c.addEventListener(h,f,u);let d=!1;return{dispose:()=>{d||(d=!0,c.removeEventListener(h,f,u))}}}},3551:function(y,o,c){var h=this&&this.__decorate||function(a,i,l,v){var S,w=arguments.length,E=w<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,v);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(w<3?S(E):w>3?S(i,l,E):S(i,l))||E);return w>3&&E&&Object.defineProperty(i,l,E),E},f=this&&this.__param||function(a,i){return function(l,v){i(l,v,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),d=c(8460),p=c(844),m=c(2585),_=c(4725);let s=o.Linkifier=class extends p.Disposable{get currentLink(){return this._currentLink}constructor(a,i,l,v,S){super(),this._element=a,this._mouseService=i,this._renderService=l,this._bufferService=v,this._linkProviderService=S,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,p.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,p.toDisposable)((()=>{var w;this._lastMouseEvent=void 0,(w=this._activeProviderReplies)==null||w.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!i)return;this._isMouseOut=!1;const l=a.composedPath();for(let v=0;v<l.length;v++){const S=l[v];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&i.x===this._lastBufferCell.x&&i.y===this._lastBufferCell.y||(this._handleHover(i),this._lastBufferCell=i)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,i){var v,S;this._activeProviderReplies&&i||((v=this._activeProviderReplies)==null||v.forEach((w=>{w==null||w.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let l=!1;for(const[w,E]of this._linkProviderService.linkProviders.entries())i?(S=this._activeProviderReplies)!=null&&S.get(w)&&(l=this._checkLinkProviderResult(w,a,l)):E.provideLinks(a.y,(g=>{var T,A;if(this._isMouseOut)return;const x=g==null?void 0:g.map((I=>({link:I})));(T=this._activeProviderReplies)==null||T.set(w,x),l=this._checkLinkProviderResult(w,a,l),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,i){const l=new Set;for(let v=0;v<i.size;v++){const S=i.get(v);if(S)for(let w=0;w<S.length;w++){const E=S[w],g=E.link.range.start.y<a?0:E.link.range.start.x,x=E.link.range.end.y>a?this._bufferService.cols:E.link.range.end.x;for(let T=g;T<=x;T++){if(l.has(T)){S.splice(w--,1);break}l.add(T)}}}}_checkLinkProviderResult(a,i,l){var w;if(!this._activeProviderReplies)return l;const v=this._activeProviderReplies.get(a);let S=!1;for(let E=0;E<a;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(S=!0);if(!S&&v){const E=v.find((g=>this._linkAtPosition(g.link,i)));E&&(l=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let E=0;E<this._activeProviderReplies.size;E++){const g=(w=this._activeProviderReplies.get(E))==null?void 0:w.find((x=>this._linkAtPosition(x.link,i)));if(g){l=!0,this._handleNewLink(g);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const i=this._positionFromMouseEvent(a,this._element,this._mouseService);i&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,i)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,i){this._currentLink&&this._lastMouseEvent&&(!a||!i||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=i)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,p.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(a.link,i)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var l,v;return(v=(l=this._currentLink)==null?void 0:l.state)==null?void 0:v.decorations.pointerCursor},set:l=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,v;return(v=(l=this._currentLink)==null?void 0:l.state)==null?void 0:v.decorations.underline},set:l=>{var v,S,w;(v=this._currentLink)!=null&&v.state&&((w=(S=this._currentLink)==null?void 0:S.state)==null?void 0:w.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const v=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(v,S),this._lastMouseEvent)){const w=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);w&&this._askForLink(w,!1)}}))))}_linkHover(a,i,l){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),i.hover&&i.hover(l,i.text)}_fireUnderlineEvent(a,i){const l=a.range,v=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-v-1,l.end.x,l.end.y-v-1,void 0);(i?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(a,i,l){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(i,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),i.leave&&i.leave(l,i.text)}_linkAtPosition(a,i){const l=a.range.start.y*this._bufferService.cols+a.range.start.x,v=a.range.end.y*this._bufferService.cols+a.range.end.x,S=i.y*this._bufferService.cols+i.x;return l<=S&&S<=v}_positionFromMouseEvent(a,i,l){const v=l.getCoords(a,i,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,i,l,v,S){return{x1:a,y1:i,x2:l,y2:v,cols:this._bufferService.cols,fg:S}}};o.Linkifier=s=h([f(1,_.IMouseService),f(2,_.IRenderService),f(3,m.IBufferService),f(4,_.ILinkProviderService)],s)},9042:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(y,o,c){var h=this&&this.__decorate||function(_,s,a,i){var l,v=arguments.length,S=v<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,s,a,i);else for(var w=_.length-1;w>=0;w--)(l=_[w])&&(S=(v<3?l(S):v>3?l(s,a,S):l(s,a))||S);return v>3&&S&&Object.defineProperty(s,a,S),S},f=this&&this.__param||function(_,s){return function(a,i){s(a,i,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),d=c(2585);let p=o.OscLinkProvider=class{constructor(_,s,a){this._bufferService=_,this._optionsService=s,this._oscLinkService=a}provideLinks(_,s){var x;const a=this._bufferService.buffer.lines.get(_-1);if(!a)return void s(void 0);const i=[],l=this._optionsService.rawOptions.linkHandler,v=new u.CellData,S=a.getTrimmedLength();let w=-1,E=-1,g=!1;for(let T=0;T<S;T++)if(E!==-1||a.hasContent(T)){if(a.loadCell(T,v),v.hasExtendedAttrs()&&v.extended.urlId){if(E===-1){E=T,w=v.extended.urlId;continue}g=v.extended.urlId!==w}else E!==-1&&(g=!0);if(g||E!==-1&&T===S-1){const A=(x=this._oscLinkService.getLinkData(w))==null?void 0:x.uri;if(A){const I={start:{x:E+1,y:_},end:{x:T+(g||T!==S-1?0:1),y:_}};let M=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const N=new URL(A);["http:","https:"].includes(N.protocol)||(M=!0)}catch{M=!0}M||i.push({text:A,range:I,activate:(N,U)=>l?l.activate(N,U,I):m(0,U),hover:(N,U)=>{var X;return(X=l==null?void 0:l.hover)==null?void 0:X.call(l,N,U,I)},leave:(N,U)=>{var X;return(X=l==null?void 0:l.leave)==null?void 0:X.call(l,N,U,I)}})}g=!1,v.hasExtendedAttrs()&&v.extended.urlId?(E=T,w=v.extended.urlId):(E=-1,w=-1)}}s(i)}};function m(_,s){if(confirm(`Do you want to navigate to ${s}?
|
|
5
|
+
|
|
6
|
+
WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=s}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=p=h([f(0,d.IBufferService),f(1,d.IOptionsService),f(2,d.IOscLinkService)],p)},6193:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,f){this._rowCount=f,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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 c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),f=c(3656),u=c(3551),d=c(9042),p=c(3730),m=c(1680),_=c(3107),s=c(5744),a=c(2950),i=c(1296),l=c(428),v=c(4269),S=c(5114),w=c(8934),E=c(3230),g=c(9312),x=c(4725),T=c(6731),A=c(8055),I=c(8969),M=c(8460),N=c(844),U=c(6114),X=c(8437),J=c(2584),Y=c(7399),D=c(5941),B=c(9074),R=c(2585),O=c(5435),W=c(4567),ee=c(779);class ce extends I.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(F={}){super(F),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(R.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(x.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,P)=>this.refresh(L,P)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,N.toDisposable)((()=>{var L,P;this._customKeyEventHandler=void 0,(P=(L=this.element)==null?void 0:L.parentNode)==null||P.removeChild(this.element)})))}_handleColorEvent(F){if(this._themeService)for(const L of F){let P,H="";switch(L.index){case 256:P="foreground",H="10";break;case 257:P="background",H="11";break;case 258:P="cursor",H="12";break;default:P="ansi",H="4;"+L.index}switch(L.type){case 0:const G=A.color.toColorRGB(P==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[P]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${H};${(0,D.toRgbString)(G)}${J.C1_ESCAPED.ST}`);break;case 1:if(P==="ansi")this._themeService.modifyColors((Z=>Z.ansi[L.index]=A.channels.toColor(...L.color)));else{const Z=P;this._themeService.modifyColors((oe=>oe[Z]=A.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(F){F?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(F){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var F;return(F=this.textarea)==null?void 0:F.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 F=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(F);if(!L)return;const P=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,G=L.getWidth(P),Z=this._renderService.dimensions.css.cell.width*G,oe=this.buffer.y*this._renderService.dimensions.css.cell.height,ue=P*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ue+"px",this.textarea.style.top=oe+"px",this.textarea.style.width=Z+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,h.copyHandler)(L,this._selectionService)})));const F=L=>(0,h.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",F)),this.register((0,f.addDisposableDomListener)(this.element,"paste",F)),U.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,h.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,h.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),U.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,h.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",(F=>this._keyUp(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",(F=>this._keyDown(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",(F=>this._keyPress(F)),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",(F=>this._compositionHelper.compositionupdate(F)))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,f.addDisposableDomListener)(this.textarea,"input",(F=>this._inputEvent(F)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(F){var P;if(!F)throw new Error("Terminal requires a parent element.");if(F.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((P=this.element)==null?void 0:P.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=F.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"),F.appendChild(this.element);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.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,f.addDisposableDomListener)(this.screenElement,"mousemove",(H=>this.updateCursorStyle(H)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",d.promptLabel),U.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(S.CoreBrowserService,this.textarea,F.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(x.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",(H=>this._handleTextAreaFocus(H)))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(x.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(x.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((H=>this._onRender.fire(H)))),this.onResize((H=>this._renderService.resize(H.cols,H.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(w.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(m.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((H=>this.scrollLines(H.amount,H.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(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((H=>this.scrollLines(H.amount,H.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,f.addDisposableDomListener)(this.element,"mousedown",(H=>this._selectionService.handleMouseDown(H)))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(H=>this._handleScreenReaderModeOptionChange(H)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(s.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const F=this,L=this.element;function P(Z){const oe=F._mouseService.getMouseReportCoords(Z,F.screenElement);if(!oe)return!1;let ue,de;switch(Z.overrideType||Z.type){case"mousemove":de=32,Z.buttons===void 0?(ue=3,Z.button!==void 0&&(ue=Z.button<3?Z.button:3)):ue=1&Z.buttons?0:4&Z.buttons?1:2&Z.buttons?2:3;break;case"mouseup":de=0,ue=Z.button<3?Z.button:3;break;case"mousedown":de=1,ue=Z.button<3?Z.button:3;break;case"wheel":if(F._customWheelEventHandler&&F._customWheelEventHandler(Z)===!1||F.viewport.getLinesScrolled(Z)===0)return!1;de=Z.deltaY<0?0:1,ue=4;break;default:return!1}return!(de===void 0||ue===void 0||ue>4)&&F.coreMouseService.triggerMouseEvent({col:oe.col,row:oe.row,x:oe.x,y:oe.y,button:ue,action:de,ctrl:Z.ctrlKey,alt:Z.altKey,shift:Z.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},G={mouseup:Z=>(P(Z),Z.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(Z)),wheel:Z=>(P(Z),this.cancel(Z,!0)),mousedrag:Z=>{Z.buttons&&P(Z)},mousemove:Z=>{Z.buttons||P(Z)}};this.register(this.coreMouseService.onProtocolChange((Z=>{Z?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Z)),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&Z?H.mousemove||(L.addEventListener("mousemove",G.mousemove),H.mousemove=G.mousemove):(L.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&Z?H.wheel||(L.addEventListener("wheel",G.wheel,{passive:!1}),H.wheel=G.wheel):(L.removeEventListener("wheel",H.wheel),H.wheel=null),2&Z?H.mouseup||(H.mouseup=G.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&Z?H.mousedrag||(H.mousedrag=G.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(L,"mousedown",(Z=>{if(Z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Z))return P(Z),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(Z)}))),this.register((0,f.addDisposableDomListener)(L,"wheel",(Z=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Z)===!1)return!1;if(!this.buffer.hasScrollback){const oe=this.viewport.getLinesScrolled(Z);if(oe===0)return;const ue=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Z.deltaY<0?"A":"B");let de="";for(let ye=0;ye<Math.abs(oe);ye++)de+=ue;return this.coreService.triggerDataEvent(de,!0),this.cancel(Z,!0)}return this.viewport.handleWheel(Z)?this.cancel(Z):void 0}}),{passive:!1})),this.register((0,f.addDisposableDomListener)(L,"touchstart",(Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Z),this.cancel(Z)}),{passive:!0})),this.register((0,f.addDisposableDomListener)(L,"touchmove",(Z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Z)?void 0:this.cancel(Z)}),{passive:!1}))}refresh(F,L){var P;(P=this._renderService)==null||P.refreshRows(F,L)}updateCursorStyle(F){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(F)?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(F,L,P=0){var H;P===1?(super.scrollLines(F,L,P),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(F)}paste(F){(0,h.paste)(F,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(F){this._customKeyEventHandler=F}attachCustomWheelEventHandler(F){this._customWheelEventHandler=F}registerLinkProvider(F){return this._linkProviderService.registerLinkProvider(F)}registerCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(F);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(F)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(F){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+F)}registerDecoration(F){return this._decorationService.registerDecoration(F)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(F,L,P){this._selectionService.setSelection(F,L,P)}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(){var F;(F=this._selectionService)==null||F.clearSelection()}selectAll(){var F;(F=this._selectionService)==null||F.selectAll()}selectLines(F,L){var P;(P=this._selectionService)==null||P.selectLines(F,L)}_keyDown(F){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&F.altKey;if(!L&&!this._compositionHelper.keydown(F))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||F.key!=="Dead"&&F.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const P=(0,Y.evaluateKeyboardEvent)(F,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(F),P.type===3||P.type===2){const H=this.rows-1;return this.scrollLines(P.type===2?-H:H),this.cancel(F,!0)}return P.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,F)||(P.cancel&&this.cancel(F,!0),!P.key||!!(F.key&&!F.ctrlKey&&!F.altKey&&!F.metaKey&&F.key.length===1&&F.key.charCodeAt(0)>=65&&F.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(P.key!==J.C0.ETX&&P.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:P.key,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(P.key,!0),!this.optionsService.rawOptions.screenReaderMode||F.altKey||F.ctrlKey?this.cancel(F,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(F,L){const P=F.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||F.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||F.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?P:P&&(!L.keyCode||L.keyCode>47)}_keyUp(F){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(F)||this.focus(),this.updateCursorStyle(F),this._keyPressHandled=!1)}_keyPress(F){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;if(this.cancel(F),F.charCode)L=F.charCode;else if(F.which===null||F.which===void 0)L=F.keyCode;else{if(F.which===0||F.charCode===0)return!1;L=F.which}return!(!L||(F.altKey||F.ctrlKey||F.metaKey)&&!this._isThirdLevelShift(this.browser,F)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(F){if(F.data&&F.inputType==="insertText"&&(!F.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=F.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(F),!0}return!1}resize(F,L){F!==this.cols||L!==this.rows?super.resize(F,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(F,L){var P,H;(P=this._charSizeService)==null||P.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var F;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 L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(X.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(F=this.viewport)==null||F.reset(),this.refresh(0,this.rows-1)}}reset(){var L,P;this.options.rows=this.rows,this.options.cols=this.cols;const F=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(P=this.viewport)==null||P.reset(),this._customKeyEventHandler=F,this.refresh(0,this.rows-1)}clearTextureAtlas(){var F;(F=this._renderService)==null||F.clearTextureAtlas()}_reportFocus(){var F;(F=this.element)!=null&&F.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(F){if(this._renderService)switch(F){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),P=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${P};${L}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),G=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${G};${H}t`)}}cancel(F,L){if(this.options.cancelEvents||L)return F.preventDefault(),F.stopPropagation(),!1}}o.Terminal=ce},9924:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,f){this._rowCount=f,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const d=u-this._lastRefreshMs,p=this._debounceThresholdMS-d;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),p)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(y,o,c){var h=this&&this.__decorate||function(a,i,l,v){var S,w=arguments.length,E=w<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,v);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(w<3?S(E):w>3?S(i,l,E):S(i,l))||E);return w>3&&E&&Object.defineProperty(i,l,E),E},f=this&&this.__param||function(a,i){return function(l,v){i(l,v,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),d=c(4725),p=c(8460),m=c(844),_=c(2585);let s=o.Viewport=class extends m.Disposable{constructor(a,i,l,v,S,w,E,g){super(),this._viewportElement=a,this._scrollArea=i,this._bufferService=l,this._optionsService=v,this._charSizeService=S,this._renderService=w,this._coreBrowserService=E,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 p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((x=>this._activeBuffer=x.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((x=>this._renderDimensions=x))),this._handleThemeChange(g.colors),this.register(g.onChangeColors((x=>this._handleThemeChange(x)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.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(a){if(a)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 i=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==i&&(this._lastRecordedBufferHeight=i,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){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 i=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:i,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<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(a,i){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(i<0&&this._viewportElement.scrollTop!==0||i>0&&l<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const i=this._getPixelsScrolled(a);return i!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+i:this._smoothScrollState.target+=i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const i=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+i,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?i*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._currentRowHeight*this._bufferService.rows),i}getBufferElements(a,i){var g;let l,v="";const S=[],w=i??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let x=a;x<w;x++){const T=E.get(x);if(!T)continue;const A=(g=E.get(x+1))==null?void 0:g.isWrapped;if(v+=T.translateToString(!A),!A||x===E.length-1){const I=document.createElement("div");I.textContent=v,S.push(I),v.length>0&&(l=I),v=""}}return{bufferElements:S,cursorElement:l}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let i=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=this._currentRowHeight+0,this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(a,i){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&i.altKey||l==="ctrl"&&i.ctrlKey||l==="shift"&&i.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const i=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,i!==0&&(this._viewportElement.scrollTop+=i,this._bubbleScroll(a,i))}};o.Viewport=s=h([f(2,_.IBufferService),f(3,_.IOptionsService),f(4,d.ICharSizeService),f(5,d.IRenderService),f(6,d.ICoreBrowserService),f(7,d.IThemeService)],s)},3107:function(y,o,c){var h=this&&this.__decorate||function(_,s,a,i){var l,v=arguments.length,S=v<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,s,a,i);else for(var w=_.length-1;w>=0;w--)(l=_[w])&&(S=(v<3?l(S):v>3?l(s,a,S):l(s,a))||S);return v>3&&S&&Object.defineProperty(s,a,S),S},f=this&&this.__param||function(_,s){return function(a,i){s(a,i,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),d=c(844),p=c(2585);let m=o.BufferDecorationRenderer=class extends d.Disposable{constructor(_,s,a,i,l){super(),this._screenElement=_,this._bufferService=s,this._coreBrowserService=a,this._decorationService=i,this._renderService=l,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((v=>this._removeDecoration(v)))),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 _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var i;const s=this._coreBrowserService.mainDocument.createElement("div");s.classList.add("xterm-decoration"),s.classList.toggle("xterm-decoration-top-layer",((i=_==null?void 0:_.options)==null?void 0:i.layer)==="top"),s.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",s.style.top=(_.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=_.options.x??0;return a&&a>this._bufferService.cols&&(s.style.display="none"),this._refreshXPosition(_,s),s}_refreshStyle(_){const s=_.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let a=this._decorationElements.get(_);a||(a=this._createElement(_),_.element=a,this._decorationElements.set(_,a),this._container.appendChild(a),_.onDispose((()=>{this._decorationElements.delete(_),a.remove()}))),a.style.top=s*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(a)}}_refreshXPosition(_,s=_.element){if(!s)return;const a=_.options.x??0;(_.options.anchor||"left")==="right"?s.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":s.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var s;(s=this._decorationElements.get(_))==null||s.remove(),this._decorationElements.delete(_),_.dispose()}};o.BufferDecorationRenderer=m=h([f(1,p.IBufferService),f(2,u.ICoreBrowserService),f(3,p.IDecorationService),f(4,u.IRenderService)],m)},5871:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,f){return h>=c.startBufferLine-this._linePadding[f||"full"]&&h<=c.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(y,o,c){var h=this&&this.__decorate||function(l,v,S,w){var E,g=arguments.length,x=g<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,v,S,w);else for(var T=l.length-1;T>=0;T--)(E=l[T])&&(x=(g<3?E(x):g>3?E(v,S,x):E(v,S))||x);return g>3&&x&&Object.defineProperty(v,S,x),x},f=this&&this.__param||function(l,v){return function(S,w){v(S,w,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),d=c(4725),p=c(844),m=c(2585),_={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let i=o.OverviewRulerRenderer=class extends p.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,v,S,w,E,g,x){var A;super(),this._viewportElement=l,this._screenElement=v,this._bufferService=S,this._decorationService=w,this._renderService=E,this._optionsService=g,this._coreBrowserService=x,this._colorZoneStore=new u.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(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,p.toDisposable)((()=>{var I;(I=this._canvas)==null||I.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 l=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=l,s.center=v,s.right=l,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=s.left,a.right=s.left+s.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);_.left=v,_.center=v,_.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.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 v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const v of l)v.position!=="full"&&this._renderColorZone(v);for(const v of l)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(a[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-_[l.position||"full"]/2),s[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[l.position||"full"]))}_queueRefresh(l,v){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=i=h([f(2,m.IBufferService),f(3,m.IDecorationService),f(4,d.IRenderService),f(5,m.IOptionsService),f(6,d.ICoreBrowserService)],i)},2950:function(y,o,c){var h=this&&this.__decorate||function(_,s,a,i){var l,v=arguments.length,S=v<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(_,s,a,i);else for(var w=_.length-1;w>=0;w--)(l=_[w])&&(S=(v<3?l(S):v>3?l(s,a,S):l(s,a))||S);return v>3&&S&&Object.defineProperty(s,a,S),S},f=this&&this.__param||function(_,s){return function(a,i){s(a,i,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),d=c(2585),p=c(2584);let m=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,s,a,i,l,v){this._textarea=_,this._compositionView=s,this._bufferService=a,this._optionsService=i,this._coreService=l,this._renderService=v,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(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const s={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,s.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(s.start,s.end):this._textarea.value.substring(s.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}}_handleAnyTextareaChanges(){const _=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const s=this._textarea.value,a=s.replace(_,"");this._dataAlreadySent=a,s.length>_.length?this._coreService.triggerDataEvent(a,!0):s.length<_.length?this._coreService.triggerDataEvent(`${p.C0.DEL}`,!0):s.length===_.length&&s!==_&&this._coreService.triggerDataEvent(s,!0)}}),0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const s=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=s*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}_||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};o.CompositionHelper=m=h([f(2,d.IBufferService),f(3,d.IOptionsService),f(4,d.ICoreService),f(5,u.IRenderService)],m)},9806:(y,o)=>{function c(h,f,u){const d=u.getBoundingClientRect(),p=h.getComputedStyle(u),m=parseInt(p.getPropertyValue("padding-left")),_=parseInt(p.getPropertyValue("padding-top"));return[f.clientX-d.left-m,f.clientY-d.top-_]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,f,u,d,p,m,_,s,a){if(!m)return;const i=c(h,f,u);return i?(i[0]=Math.ceil((i[0]+(a?_/2:0))/_),i[1]=Math.ceil(i[1]/s),i[0]=Math.min(Math.max(i[0],1),d+(a?1:0)),i[1]=Math.min(Math.max(i[1],1),p),i):void 0}},9504:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function f(s,a,i,l){const v=s-u(s,i),S=a-u(a,i),w=Math.abs(v-S)-(function(E,g,x){let T=0;const A=E-u(E,x),I=g-u(g,x);for(let M=0;M<Math.abs(A-I);M++){const N=d(E,g)==="A"?-1:1,U=x.buffer.lines.get(A+N*M);U!=null&&U.isWrapped&&T++}return T})(s,a,i);return _(w,m(d(s,a),l))}function u(s,a){let i=0,l=a.buffer.lines.get(s),v=l==null?void 0:l.isWrapped;for(;v&&s>=0&&s<a.rows;)i++,l=a.buffer.lines.get(--s),v=l==null?void 0:l.isWrapped;return i}function d(s,a){return s>a?"A":"B"}function p(s,a,i,l,v,S){let w=s,E=a,g="";for(;w!==i||E!==l;)w+=v?1:-1,v&&w>S.cols-1?(g+=S.buffer.translateBufferLineToString(E,!1,s,w),w=0,s=0,E++):!v&&w<0&&(g+=S.buffer.translateBufferLineToString(E,!1,0,s+1),w=S.cols-1,s=w,E--);return g+S.buffer.translateBufferLineToString(E,!1,s,w)}function m(s,a){const i=a?"O":"[";return h.C0.ESC+i+s}function _(s,a){s=Math.floor(s);let i="";for(let l=0;l<s;l++)i+=a;return i}o.moveToCellSequence=function(s,a,i,l){const v=i.buffer.x,S=i.buffer.y;if(!i.buffer.hasScrollback)return(function(g,x,T,A,I,M){return f(x,A,I,M).length===0?"":_(p(g,x,g,x-u(x,I),!1,I).length,m("D",M))})(v,S,0,a,i,l)+f(S,a,i,l)+(function(g,x,T,A,I,M){let N;N=f(x,A,I,M).length>0?A-u(A,I):x;const U=A,X=(function(J,Y,D,B,R,O){let W;return W=f(D,B,R,O).length>0?B-u(B,R):Y,J<D&&W<=B||J>=D&&W<B?"C":"D"})(g,x,T,A,I,M);return _(p(g,N,T,U,X==="C",I).length,m(X,M))})(v,S,s,a,i,l);let w;if(S===a)return w=v>s?"D":"C",_(Math.abs(v-s),m(w,l));w=S>a?"D":"C";const E=Math.abs(S-a);return _((function(g,x){return x.cols-g})(S>a?s:v,i)+(E-1)*i.cols+1+((S>a?v:s)-1),m(w,l))}},1296:function(y,o,c){var h=this&&this.__decorate||function(M,N,U,X){var J,Y=arguments.length,D=Y<3?N:X===null?X=Object.getOwnPropertyDescriptor(N,U):X;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(M,N,U,X);else for(var B=M.length-1;B>=0;B--)(J=M[B])&&(D=(Y<3?J(D):Y>3?J(N,U,D):J(N,U))||D);return Y>3&&D&&Object.defineProperty(N,U,D),D},f=this&&this.__param||function(M,N){return function(U,X){N(U,X,M)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),d=c(2550),p=c(2223),m=c(6171),_=c(6052),s=c(4725),a=c(8055),i=c(8460),l=c(844),v=c(2585),S="xterm-dom-renderer-owner-",w="xterm-rows",E="xterm-fg-",g="xterm-bg-",x="xterm-focus",T="xterm-selection";let A=1,I=o.DomRenderer=class extends l.Disposable{constructor(M,N,U,X,J,Y,D,B,R,O,W,ee,ce){super(),this._terminal=M,this._document=N,this._element=U,this._screenElement=X,this._viewportElement=J,this._helperContainer=Y,this._linkifier2=D,this._charSizeService=R,this._optionsService=O,this._bufferService=W,this._coreBrowserService=ee,this._themeService=ce,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new i.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(w),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,m.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ie=>this._injectCss(ie)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ie=>this._handleLinkHover(ie)))),this.register(this._linkifier2.onHideLinkUnderline((ie=>this._handleLinkLeave(ie)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(S+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 M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),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/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),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 U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${w} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,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(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${w} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${w} .xterm-dim { color: ${a.color.multiplyOpacity(M.foreground,.5).css};}`,N+=`${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 U=`blink_underline_${this._terminalClass}`,X=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;N+=`@keyframes ${U} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${X} { 50% { box-shadow: none; }}`,N+=`@keyframes ${J} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,N+=`${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${w}.${x} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${w} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,D]of M.ansi.entries())N+=`${this._terminalSelector} .${E}${Y} { color: ${D.css}; }${this._terminalSelector} .${E}${Y}.xterm-dim { color: ${a.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${g}${Y} { background-color: ${D.css}; }`;N+=`${this._terminalSelector} .${E}${p.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(M.background).css}; }${this._terminalSelector} .${E}${p.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${g}${p.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,N){for(let U=this._rowElements.length;U<=N;U++){const X=this._document.createElement("div");this._rowContainer.appendChild(X),this._rowElements.push(X)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,N){this._refreshRowElements(M,N),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(x),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(x),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(M,N,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,N,U),this.renderRows(0,this._bufferService.rows-1),!M||!N)return;this._selectionRenderModel.update(this._terminal,M,N,U);const X=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||D<0)return;const B=this._document.createDocumentFragment();if(U){const R=M[0]>N[0];B.appendChild(this._createSelectionElement(Y,R?N[0]:M[0],R?M[0]:N[0],D-Y+1))}else{const R=X===Y?M[0]:0,O=Y===J?N[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(Y,R,O));const W=D-Y-1;if(B.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,W)),Y!==D){const ee=J===D?N[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(D,0,ee))}}this._selectionContainer.appendChild(B)}_createSelectionElement(M,N,U,X=1){const J=this._document.createElement("div"),Y=N*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(U-N);return Y+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-Y),J.style.height=X*this.dimensions.css.cell.height+"px",J.style.top=M*this.dimensions.css.cell.height+"px",J.style.left=`${Y}px`,J.style.width=`${D}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 M of this._rowElements)M.replaceChildren()}renderRows(M,N){const U=this._bufferService.buffer,X=U.ybase+U.y,J=Math.min(U.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let R=M;R<=N;R++){const O=R+U.ydisp,W=this._rowElements[R],ee=U.lines.get(O);if(!W||!ee)break;W.replaceChildren(...this._rowFactory.createRow(ee,O,O===X,D,B,J,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,N,U,X,J,Y){U<0&&(M=0),X<0&&(N=0);const D=this._bufferService.rows-1;U=Math.max(Math.min(U,D),0),X=Math.max(Math.min(X,D),0),J=Math.min(J,this._bufferService.cols);const B=this._bufferService.buffer,R=B.ybase+B.y,O=Math.min(B.x,J-1),W=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let ie=U;ie<=X;++ie){const F=ie+B.ydisp,L=this._rowElements[ie],P=B.lines.get(F);if(!L||!P)break;L.replaceChildren(...this._rowFactory.createRow(P,F,F===R,ee,ce,O,W,this.dimensions.css.cell.width,this._widthCache,Y?ie===U?M:0:-1,Y?(ie===X?N:J)-1:-1))}}};o.DomRenderer=I=h([f(7,v.IInstantiationService),f(8,s.ICharSizeService),f(9,v.IOptionsService),f(10,v.IBufferService),f(11,s.ICoreBrowserService),f(12,s.IThemeService)],I)},3787:function(y,o,c){var h=this&&this.__decorate||function(w,E,g,x){var T,A=arguments.length,I=A<3?E:x===null?x=Object.getOwnPropertyDescriptor(E,g):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(w,E,g,x);else for(var M=w.length-1;M>=0;M--)(T=w[M])&&(I=(A<3?T(I):A>3?T(E,g,I):T(E,g))||I);return A>3&&I&&Object.defineProperty(E,g,I),I},f=this&&this.__param||function(w,E){return function(g,x){E(g,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),d=c(643),p=c(511),m=c(2585),_=c(8055),s=c(4725),a=c(4269),i=c(6171),l=c(3734);let v=o.DomRendererRowFactory=class{constructor(w,E,g,x,T,A,I){this._document=w,this._characterJoinerService=E,this._optionsService=g,this._coreBrowserService=x,this._coreService=T,this._decorationService=A,this._themeService=I,this._workCell=new p.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(w,E,g){this._selectionStart=w,this._selectionEnd=E,this._columnSelectMode=g}createRow(w,E,g,x,T,A,I,M,N,U,X){const J=[],Y=this._characterJoinerService.getJoinedCharacters(E),D=this._themeService.colors;let B,R=w.getNoBgTrimmedLength();g&&R<A+1&&(R=A+1);let O=0,W="",ee=0,ce=0,ie=0,F=!1,L=0,P=!1,H=0;const G=[],Z=U!==-1&&X!==-1;for(let oe=0;oe<R;oe++){w.loadCell(oe,this._workCell);let ue=this._workCell.getWidth();if(ue===0)continue;let de=!1,ye=oe,re=this._workCell;if(Y.length>0&&oe===Y[0][0]){de=!0;const Oe=Y.shift();re=new a.JoinedCellData(this._workCell,w.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),ye=Oe[1]-1,ue=re.getWidth()}const ge=this._isCellInSelection(oe,E),ke=g&&oe===A,Je=Z&&oe>=U&&oe<=X;let Ce=!1;this._decorationService.forEachDecorationAtCell(oe,E,void 0,(Oe=>{Ce=!0}));let Ae=re.getChars()||d.WHITESPACE_CELL_CHAR;if(Ae===" "&&(re.isUnderline()||re.isOverline())&&(Ae=" "),H=ue*M-N.get(Ae,re.isBold(),re.isItalic()),B){if(O&&(ge&&P||!ge&&!P&&re.bg===ee)&&(ge&&P&&D.selectionForeground||re.fg===ce)&&re.extended.ext===ie&&Je===F&&H===L&&!ke&&!de&&!Ce){re.isInvisible()?W+=d.WHITESPACE_CELL_CHAR:W+=Ae,O++;continue}O&&(B.textContent=W),B=this._document.createElement("span"),O=0,W=""}else B=this._document.createElement("span");if(ee=re.bg,ce=re.fg,ie=re.extended.ext,F=Je,L=H,P=ge,de&&A>=oe&&A<=ye&&(A=oe),!this._coreService.isCursorHidden&&ke&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)I&&G.push("xterm-cursor-blink"),G.push(x==="bar"?"xterm-cursor-bar":x==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline")}}if(re.isBold()&&G.push("xterm-bold"),re.isItalic()&&G.push("xterm-italic"),re.isDim()&&G.push("xterm-dim"),W=re.isInvisible()?d.WHITESPACE_CELL_CHAR:re.getChars()||d.WHITESPACE_CELL_CHAR,re.isUnderline()&&(G.push(`xterm-underline-${re.extended.underlineStyle}`),W===" "&&(W=" "),!re.isUnderlineColorDefault()))if(re.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(re.getUnderlineColor()).join(",")})`;else{let Oe=re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&re.isBold()&&Oe<8&&(Oe+=8),B.style.textDecorationColor=D.ansi[Oe].css}re.isOverline()&&(G.push("xterm-overline"),W===" "&&(W=" ")),re.isStrikethrough()&&G.push("xterm-strikethrough"),Je&&(B.style.textDecoration="underline");let Ie=re.getFgColor(),fe=re.getFgColorMode(),_e=re.getBgColor(),Te=re.getBgColorMode();const De=!!re.isInverse();if(De){const Oe=Ie;Ie=_e,_e=Oe;const _i=fe;fe=Te,Te=_i}let xe,ft,_t,Ht=!1;switch(this._decorationService.forEachDecorationAtCell(oe,E,void 0,(Oe=>{Oe.options.layer!=="top"&&Ht||(Oe.backgroundColorRGB&&(Te=50331648,_e=Oe.backgroundColorRGB.rgba>>8&16777215,xe=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(fe=50331648,Ie=Oe.foregroundColorRGB.rgba>>8&16777215,ft=Oe.foregroundColorRGB),Ht=Oe.options.layer==="top")})),!Ht&&ge&&(xe=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,_e=xe.rgba>>8&16777215,Te=50331648,Ht=!0,D.selectionForeground&&(fe=50331648,Ie=D.selectionForeground.rgba>>8&16777215,ft=D.selectionForeground)),Ht&&G.push("xterm-decoration-top"),Te){case 16777216:case 33554432:_t=D.ansi[_e],G.push(`xterm-bg-${_e}`);break;case 50331648:_t=_.channels.toColor(_e>>16,_e>>8&255,255&_e),this._addStyle(B,`background-color:#${S((_e>>>0).toString(16),"0",6)}`);break;default:De?(_t=D.foreground,G.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):_t=D.background}switch(xe||re.isDim()&&(xe=_.color.multiplyOpacity(_t,.5)),fe){case 16777216:case 33554432:re.isBold()&&Ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ie+=8),this._applyMinimumContrast(B,_t,D.ansi[Ie],re,xe,void 0)||G.push(`xterm-fg-${Ie}`);break;case 50331648:const Oe=_.channels.toColor(Ie>>16&255,Ie>>8&255,255&Ie);this._applyMinimumContrast(B,_t,Oe,re,xe,ft)||this._addStyle(B,`color:#${S(Ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,_t,D.foreground,re,xe,ft)||De&&G.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}G.length&&(B.className=G.join(" "),G.length=0),ke||de||Ce?B.textContent=W:O++,H!==this.defaultSpacing&&(B.style.letterSpacing=`${H}px`),J.push(B),oe=ye}return B&&O&&(B.textContent=W),J}_applyMinimumContrast(w,E,g,x,T,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,i.treatGlyphAsBackgroundColor)(x.getCode()))return!1;const I=this._getContrastCache(x);let M;if(T||A||(M=I.getColor(E.rgba,g.rgba)),M===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(x.isDim()?2:1);M=_.color.ensureContrastRatio(T||E,A||g,N),I.setColor((T||E).rgba,(A||g).rgba,M??null)}return!!M&&(this._addStyle(w,`color:${M.css}`),!0)}_getContrastCache(w){return w.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(w,E){w.setAttribute("style",`${w.getAttribute("style")||""}${E};`)}_isCellInSelection(w,E){const g=this._selectionStart,x=this._selectionEnd;return!(!g||!x)&&(this._columnSelectMode?g[0]<=x[0]?w>=g[0]&&E>=g[1]&&w<x[0]&&E<=x[1]:w<g[0]&&E>=g[1]&&w>=x[0]&&E<=x[1]:E>g[1]&&E<x[1]||g[1]===x[1]&&E===g[1]&&w>=g[0]&&w<x[0]||g[1]<x[1]&&E===x[1]&&w<x[0]||g[1]<x[1]&&E===g[1]&&w>=g[0])}};function S(w,E,g){for(;w.length<g;)w=E+w;return w}o.DomRendererRowFactory=v=h([f(1,s.ICharacterJoinerService),f(2,m.IOptionsService),f(3,s.ICoreBrowserService),f(4,m.ICoreService),f(5,m.IDecorationService),f(6,s.IThemeService)],v)},2550:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.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 f=c.createElement("span");f.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontStyle="italic";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold",p.style.fontStyle="italic",this._measureElements=[f,u,d,p],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(d),this._container.appendChild(p),h.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(c,h,f,u){c===this._font&&h===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,f){let u=0;if(!h&&!f&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const m=this._measure(c,0);return m>0&&(this._flat[u]=m),m}let d=c;h&&(d+="B"),f&&(d+="I");let p=this._holey.get(d);if(p===void 0){let m=0;h&&(m|=1),f&&(m|=2),p=this._measure(c,m),p>0&&this._holey.set(d,p)}return p}_measure(c,h){const f=this._measureElements[h];return f.textContent=c.repeat(32),f.offsetWidth/32}}},2223:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(y,o)=>{function c(f){return 57508<=f&&f<=57558}function h(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},o.isEmoji=h,o.allowRescaling=function(f,u,d,p){return u===1&&d>Math.ceil(1.5*p)&&f!==void 0&&f>255&&!h(f)&&!c(f)&&!(function(m){return 57344<=m&&m<=63743})(f)},o.treatGlyphAsBackgroundColor=function(f){return c(f)||(function(u){return 9472<=u&&u<=9631})(f)},o.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}}}},o.computeNextVariantOffset=function(f,u,d=0){return(f-(2*Math.round(u)-d))%(2*Math.round(u))}},6052:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{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(f,u,d,p=!1){if(this.selectionStart=u,this.selectionEnd=d,!u||!d||u[0]===d[0]&&u[1]===d[1])return void this.clear();const m=f.buffers.active.ydisp,_=u[1]-m,s=d[1]-m,a=Math.max(_,0),i=Math.min(s,f.rows-1);a>=f.rows||i<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=_,this.viewportEndRow=s,this.viewportCappedStartRow=a,this.viewportCappedEndRow=i,this.startCol=u[0],this.endCol=d[0])}isCellSelected(f,u,d){return!!this.hasSelection&&(d-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&d>=this.viewportCappedStartRow&&u<this.endCol&&d<=this.viewportCappedEndRow:u<this.startCol&&d>=this.viewportCappedStartRow&&u>=this.endCol&&d<=this.viewportCappedEndRow:d>this.viewportStartRow&&d<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&d===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&d===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(y,o,c){var h=this&&this.__decorate||function(i,l,v,S){var w,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,v,S);else for(var x=i.length-1;x>=0;x--)(w=i[x])&&(g=(E<3?w(g):E>3?w(l,v,g):w(l,v))||g);return E>3&&g&&Object.defineProperty(l,v,g),g},f=this&&this.__param||function(i,l){return function(v,S){l(v,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),d=c(8460),p=c(844);let m=o.CharSizeService=class extends p.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(i,l,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new d.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new s(i,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const i=this._measureStrategy.measure();i.width===this.width&&i.height===this.height||(this.width=i.width,this.height=i.height,this._onCharSizeChange.fire())}};o.CharSizeService=m=h([f(2,u.IOptionsService)],m);class _ extends p.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,v){l!==void 0&&l>0&&v!==void 0&&v>0&&(this._result.width=l,this._result.height=v)}}class s extends _{constructor(l,v,S){super(),this._document=l,this._parentElement=v,this._optionsService=S,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 a extends _{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(y,o,c){var h=this&&this.__decorate||function(a,i,l,v){var S,w=arguments.length,E=w<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,i,l,v);else for(var g=a.length-1;g>=0;g--)(S=a[g])&&(E=(w<3?S(E):w>3?S(i,l,E):S(i,l))||E);return w>3&&E&&Object.defineProperty(i,l,E),E},f=this&&this.__param||function(a,i){return function(l,v){i(l,v,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),d=c(643),p=c(511),m=c(2585);class _ extends u.AttributeData{constructor(i,l,v){super(),this.content=0,this.combinedData="",this.fg=i.fg,this.bg=i.bg,this.combinedData=l,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(i){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=_;let s=o.CharacterJoinerService=class Da{constructor(i){this._bufferService=i,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(i){const l={id:this._nextCharacterJoinerId++,handler:i};return this._characterJoiners.push(l),l.id}deregister(i){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===i)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(i){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(i);if(!l||l.length===0)return[];const v=[],S=l.translateToString(!0);let w=0,E=0,g=0,x=l.getFg(0),T=l.getBg(0);for(let A=0;A<l.getTrimmedLength();A++)if(l.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==x||this._workCell.bg!==T){if(A-w>1){const I=this._getJoinedRanges(S,g,E,l,w);for(let M=0;M<I.length;M++)v.push(I[M])}w=A,g=E,x=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||d.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-w>1){const A=this._getJoinedRanges(S,g,E,l,w);for(let I=0;I<A.length;I++)v.push(A[I])}return v}_getJoinedRanges(i,l,v,S,w){const E=i.substring(l,v);let g=[];try{g=this._characterJoiners[0].handler(E)}catch(x){console.error(x)}for(let x=1;x<this._characterJoiners.length;x++)try{const T=this._characterJoiners[x].handler(E);for(let A=0;A<T.length;A++)Da._mergeRanges(g,T[A])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,S,w),g}_stringRangesToCellRanges(i,l,v){let S=0,w=!1,E=0,g=i[S];if(g){for(let x=v;x<this._bufferService.cols;x++){const T=l.getWidth(x),A=l.getString(x).length||d.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!w&&g[0]<=E&&(g[0]=x,w=!0),g[1]<=E){if(g[1]=x,g=i[++S],!g)break;g[0]<=E?(g[0]=x,w=!0):w=!1}E+=A}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(i,l){let v=!1;for(let S=0;S<i.length;S++){const w=i[S];if(v){if(l[1]<=w[0])return i[S-1][1]=l[1],i;if(l[1]<=w[1])return i[S-1][1]=Math.max(l[1],w[1]),i.splice(S,1),i;i.splice(S,1),S--}else{if(l[1]<=w[0])return i.splice(S,0,l),i;if(l[1]<=w[1])return w[0]=Math.min(l[0],w[0]),i;l[0]<w[1]&&(w[0]=Math.min(l[0],w[0]),v=!0)}}return v?i[i.length-1][1]=l[1]:i.push(l),i}};o.CharacterJoinerService=s=h([f(0,m.IBufferService)],s)},5114:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),f=c(8460),u=c(3656);class d extends h.Disposable{constructor(_,s,a){super(),this._textarea=_,this._window=s,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new p(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((i=>this._screenDprMonitor.setWindow(i)))),this.register((0,f.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(_){this._window!==_&&(this._window=_,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}}o.CoreBrowserService=d;class p extends h.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const h=c(844);class f extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(d){return this.linkProviders.push(d),{dispose:()=>{const p=this.linkProviders.indexOf(d);p!==-1&&this.linkProviders.splice(p,1)}}}}o.LinkProviderService=f},8934:function(y,o,c){var h=this&&this.__decorate||function(m,_,s,a){var i,l=arguments.length,v=l<3?_:a===null?a=Object.getOwnPropertyDescriptor(_,s):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(m,_,s,a);else for(var S=m.length-1;S>=0;S--)(i=m[S])&&(v=(l<3?i(v):l>3?i(_,s,v):i(_,s))||v);return l>3&&v&&Object.defineProperty(_,s,v),v},f=this&&this.__param||function(m,_){return function(s,a){_(s,a,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),d=c(9806);let p=o.MouseService=class{constructor(m,_){this._renderService=m,this._charSizeService=_}getCoords(m,_,s,a,i){return(0,d.getCoords)(window,m,_,s,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(m,_){const s=(0,d.getCoordsRelativeToElement)(window,m,_);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};o.MouseService=p=h([f(0,u.IRenderService),f(1,u.ICharSizeService)],p)},3230:function(y,o,c){var h=this&&this.__decorate||function(i,l,v,S){var w,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,v,S);else for(var x=i.length-1;x>=0;x--)(w=i[x])&&(g=(E<3?w(g):E>3?w(l,v,g):w(l,v))||g);return E>3&&g&&Object.defineProperty(l,v,g),g},f=this&&this.__param||function(i,l){return function(v,S){l(v,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),d=c(4725),p=c(8460),m=c(844),_=c(7226),s=c(2585);let a=o.RenderService=class extends m.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(i,l,v,S,w,E,g,x){super(),this._rowCount=i,this._charSizeService=S,this._renderer=this.register(new m.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new m.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 p.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new p.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new p.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new p.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((T,A)=>this._renderRows(T,A)),g),this.register(this._renderDebouncer),this.register(g.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(w.onDecorationRegistered((()=>this._fullRefresh()))),this.register(w.onDecorationRemoved((()=>this._fullRefresh()))),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register(x.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(g.window,l),this.register(g.onWindowChange((T=>this._registerIntersectionObserver(T,l))))}_registerIntersectionObserver(i,l){if("IntersectionObserver"in i){const v=new i.IntersectionObserver((S=>this._handleIntersectionChange(S[S.length-1])),{threshold:0});v.observe(l),this._observerDisposable.value=(0,m.toDisposable)((()=>v.disconnect()))}}_handleIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.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(i,l,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,l,this._rowCount))}_renderRows(i,l){this._renderer.value&&(i=Math.min(i,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(i,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:l}),this._onRender.fire({start:i,end:l}),this._isNextRenderRedrawOnly=!0)}resize(i,l){this._rowCount=l,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(i){this._renderer.value=i,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,l;this._renderer.value&&((l=(i=this._renderer.value).clearTextureAtlas)==null||l.call(i),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(i,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(i,l)})):this._renderer.value.handleResize(i,l),this._fullRefresh())}handleCharSizeChanged(){var i;(i=this._renderer.value)==null||i.handleCharSizeChanged()}handleBlur(){var i;(i=this._renderer.value)==null||i.handleBlur()}handleFocus(){var i;(i=this._renderer.value)==null||i.handleFocus()}handleSelectionChanged(i,l,v){var S;this._selectionState.start=i,this._selectionState.end=l,this._selectionState.columnSelectMode=v,(S=this._renderer.value)==null||S.handleSelectionChanged(i,l,v)}handleCursorMove(){var i;(i=this._renderer.value)==null||i.handleCursorMove()}clear(){var i;(i=this._renderer.value)==null||i.clear()}};o.RenderService=a=h([f(2,s.IOptionsService),f(3,d.ICharSizeService),f(4,s.IDecorationService),f(5,s.IBufferService),f(6,d.ICoreBrowserService),f(7,d.IThemeService)],a)},9312:function(y,o,c){var h=this&&this.__decorate||function(g,x,T,A){var I,M=arguments.length,N=M<3?x:A===null?A=Object.getOwnPropertyDescriptor(x,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(g,x,T,A);else for(var U=g.length-1;U>=0;U--)(I=g[U])&&(N=(M<3?I(N):M>3?I(x,T,N):I(x,T))||N);return M>3&&N&&Object.defineProperty(x,T,N),N},f=this&&this.__param||function(g,x){return function(T,A){x(T,A,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),d=c(9504),p=c(456),m=c(4725),_=c(8460),s=c(844),a=c(6114),i=c(4841),l=c(511),v=c(2585),S=" ",w=new RegExp(S,"g");let E=o.SelectionService=class extends s.Disposable{constructor(g,x,T,A,I,M,N,U,X){super(),this._element=g,this._screenElement=x,this._linkifier=T,this._bufferService=A,this._coreService=I,this._mouseService=M,this._optionsService=N,this._renderService=U,this._coreBrowserService=X,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.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 p.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,s.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 g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!(!g||!x||g[0]===x[0]&&g[1]===x[1])}get selectionText(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;if(!g||!x)return"";const T=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(g[0]===x[0])return"";const I=g[0]<x[0]?g[0]:x[0],M=g[0]<x[0]?x[0]:g[0];for(let N=g[1];N<=x[1];N++){const U=T.translateBufferLineToString(N,!0,I,M);A.push(U)}}else{const I=g[1]===x[1]?x[0]:void 0;A.push(T.translateBufferLineToString(g[1],!0,g[0],I));for(let M=g[1]+1;M<=x[1]-1;M++){const N=T.lines.get(M),U=T.translateBufferLineToString(M,!0);N!=null&&N.isWrapped?A[A.length-1]+=U:A.push(U)}if(g[1]!==x[1]){const M=T.lines.get(x[1]),N=T.translateBufferLineToString(x[1],!0,0,x[0]);M&&M.isWrapped?A[A.length-1]+=N:A.push(N)}}return A.map((I=>I.replace(w," "))).join(a.isWindows?`\r
|
|
7
|
+
`:`
|
|
8
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&g&&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(g){const x=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(T&&A&&x)&&this._areCoordsInSelection(x,T,A)}isCellInSelection(g,x){const T=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!T||!A)&&this._areCoordsInSelection([g,x],T,A)}_areCoordsInSelection(g,x,T){return g[1]>x[1]&&g[1]<T[1]||x[1]===T[1]&&g[1]===x[1]&&g[0]>=x[0]&&g[0]<T[0]||x[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||x[1]<T[1]&&g[1]===x[1]&&g[0]>=x[0]}_selectWordAtCursor(g,x){var I,M;const T=(M=(I=this._linkifier.currentLink)==null?void 0:I.link)==null?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,i.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(g);return!!A&&(this._selectWordAt(A,x),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,x){this._model.clearSelection(),g=Math.max(g,0),x=Math.min(x,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,x],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const x=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(x)return x[0]--,x[1]--,x[1]+=this._bufferService.buffer.ydisp,x}_getMouseEventScrollAmount(g){let x=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return x>=0&&x<=T?0:(x>T&&(x-=T),x=Math.min(Math.max(x,-50),50),x/=50,x/Math.abs(x)+Math.round(14*x))}shouldForceSelection(g){return a.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}handleMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._handleIncrementalClick(g):g.detail===1?this._handleSingleClick(g):g.detail===2?this._handleDoubleClick(g):g.detail===3&&this._handleTripleClick(g),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(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_handleSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const x=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);x&&x.length!==this._model.selectionStart[0]&&x.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const x=this._getMouseBufferCoords(g);x&&(this._activeSelectionMode=2,this._selectLineAt(x[1]))}shouldColumnSelect(g){return g.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const x=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(g),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const A=T.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}x&&x[0]===this._model.selectionEnd[0]&&x[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_handleMouseUp(g){const x=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&x<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const A=(0,d.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,x=this._model.finalSelectionEnd,T=!(!g||!x||g[0]===x[0]&&g[1]===x[1]);T?g&&x&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&x[0]===this._oldSelectionEnd[0]&&x[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,x,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,x,T)}_fireOnSelectionChange(g,x,T){this._oldSelectionStart=g,this._oldSelectionEnd=x,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim((x=>this._handleTrim(x)))}_convertViewportColToCharacterIndex(g,x){let T=x;for(let A=0;x>=A;A++){const I=g.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:I>1&&x!==A&&(T+=I-1)}return T}setSelection(g,x,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,x],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,x,T=!0,A=!0){if(g[0]>=this._bufferService.cols)return;const I=this._bufferService.buffer,M=I.lines.get(g[1]);if(!M)return;const N=I.translateBufferLineToString(g[1],!1);let U=this._convertViewportColToCharacterIndex(M,g[0]),X=U;const J=g[0]-U;let Y=0,D=0,B=0,R=0;if(N.charAt(U)===" "){for(;U>0&&N.charAt(U-1)===" ";)U--;for(;X<N.length&&N.charAt(X+1)===" ";)X++}else{let ee=g[0],ce=g[0];M.getWidth(ee)===0&&(Y++,ee--),M.getWidth(ce)===2&&(D++,ce++);const ie=M.getString(ce).length;for(ie>1&&(R+=ie-1,X+=ie-1);ee>0&&U>0&&!this._isCharWordSeparator(M.loadCell(ee-1,this._workCell));){M.loadCell(ee-1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ee--):F>1&&(B+=F-1,U-=F-1),U--,ee--}for(;ce<M.length&&X+1<N.length&&!this._isCharWordSeparator(M.loadCell(ce+1,this._workCell));){M.loadCell(ce+1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ce++):F>1&&(R+=F-1,X+=F-1),X++,ce++}}X++;let O=U+J-Y+B,W=Math.min(this._bufferService.cols,X-U+Y+D-B-R);if(x||N.slice(U,X).trim()!==""){if(T&&O===0&&M.getCodePoint(0)!==32){const ee=I.lines.get(g[1]-1);if(ee&&M.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(ce){const ie=this._bufferService.cols-ce.start;O-=ie,W+=ie}}}if(A&&O+W===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const ee=I.lines.get(g[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const ce=this._getWordAt([0,g[1]+1],!1,!1,!0);ce&&(W+=ce.length)}}return{start:O,length:W}}}_selectWordAt(g,x){const T=this._getWordAt(g,x);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[T.start,g[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(g){const x=this._getWordAt(g,!0);if(x){let T=g[1];for(;x.start<0;)x.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;x.start+x.length>this._bufferService.cols;)x.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?x.start:x.start+x.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const x=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:x.first},end:{x:this._bufferService.cols-1,y:x.last}};this._model.selectionStart=[0,x.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,i.getRangeLength)(T,this._bufferService.cols)}};o.SelectionService=E=h([f(3,v.IBufferService),f(4,v.ICoreService),f(5,m.IMouseService),f(6,v.IOptionsService),f(7,m.IRenderService),f(8,m.ICoreBrowserService)],E)},4725:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(y,o,c){var h=this&&this.__decorate||function(E,g,x,T){var A,I=arguments.length,M=I<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,x):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,g,x,T);else for(var N=E.length-1;N>=0;N--)(A=E[N])&&(M=(I<3?A(M):I>3?A(g,x,M):A(g,x))||M);return I>3&&M&&Object.defineProperty(g,x,M),M},f=this&&this.__param||function(E,g){return function(x,T){g(x,T,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),d=c(8055),p=c(8460),m=c(844),_=c(2585),s=d.css.toColor("#ffffff"),a=d.css.toColor("#000000"),i=d.css.toColor("#ffffff"),l=d.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[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")],g=[0,95,135,175,215,255];for(let x=0;x<216;x++){const T=g[x/36%6|0],A=g[x/6%6|0],I=g[x%6];E.push({css:d.channels.toCss(T,A,I),rgba:d.channels.toRgba(T,A,I)})}for(let x=0;x<24;x++){const T=8+10*x;E.push({css:d.channels.toCss(T,T,T),rgba:d.channels.toRgba(T,T,T)})}return E})());let S=o.ThemeService=class extends m.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new p.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:s,background:a,cursor:i,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:d.color.blend(a,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:d.color.blend(a,v),ansi:o.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(E={}){const g=this._colors;if(g.foreground=w(E.foreground,s),g.background=w(E.background,a),g.cursor=w(E.cursor,i),g.cursorAccent=w(E.cursorAccent,l),g.selectionBackgroundTransparent=w(E.selectionBackground,v),g.selectionBackgroundOpaque=d.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=w(E.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=d.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=E.selectionForeground?w(E.selectionForeground,d.NULL_COLOR):void 0,g.selectionForeground===d.NULL_COLOR&&(g.selectionForeground=void 0),d.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=d.color.opacity(g.selectionBackgroundTransparent,.3)),d.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=d.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=o.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=w(E.black,o.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=w(E.red,o.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=w(E.green,o.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=w(E.yellow,o.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=w(E.blue,o.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=w(E.magenta,o.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=w(E.cyan,o.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=w(E.white,o.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=w(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=w(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=w(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=w(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=w(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=w(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=w(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=w(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const x=Math.min(g.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<x;T++)g.ansi[T+16]=w(E.extendedAnsi[T],o.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(E){this._restoreColor(E),this._onChangeColors.fire(this.colors)}_restoreColor(E){if(E!==void 0)switch(E){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[E]=this._restoreColors.ansi[E]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(E){E(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function w(E,g){if(E!==void 0)try{return d.css.toColor(E)}catch{}return g}o.ThemeService=S=h([f(0,_.IOptionsService)],S)},6349:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),f=c(844);class u extends f.Disposable{constructor(p){super(),this._maxLength=p,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(p){if(this._maxLength===p)return;const m=new Array(p);for(let _=0;_<Math.min(p,this.length);_++)m[_]=this._array[this._getCyclicIndex(_)];this._array=m,this._maxLength=p,this._startIndex=0}get length(){return this._length}set length(p){if(p>this._length)for(let m=this._length;m<p;m++)this._array[m]=void 0;this._length=p}get(p){return this._array[this._getCyclicIndex(p)]}set(p,m){this._array[this._getCyclicIndex(p)]=m}push(p){this._array[this._getCyclicIndex(this._length)]=p,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(p,m,..._){if(m){for(let s=p;s<this._length-m;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+m)];this._length-=m,this.onDeleteEmitter.fire({index:p,amount:m})}for(let s=this._length-1;s>=p;s--)this._array[this._getCyclicIndex(s+_.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<_.length;s++)this._array[this._getCyclicIndex(p+s)]=_[s];if(_.length&&this.onInsertEmitter.fire({index:p,amount:_.length}),this._length+_.length>this._maxLength){const s=this._length+_.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=_.length}trimStart(p){p>this._length&&(p=this._length),this._startIndex+=p,this._length-=p,this.onTrimEmitter.fire(p)}shiftElements(p,m,_){if(!(m<=0)){if(p<0||p>=this._length)throw new Error("start argument out of range");if(p+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let a=m-1;a>=0;a--)this.set(p+a+_,this.get(p+a));const s=p+m+_-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<m;s++)this.set(p+s+_,this.get(p+s))}}_getCyclicIndex(p){return(this._startIndex+p)%this._maxLength}}o.CircularList=u},1439:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,f=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const d in h)u[d]=f<=1?h[d]:h[d]&&c(h[d],f-1);return u}},8055:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,f=0,u=0;var d,p,m,_,s;function a(l){const v=l.toString(16);return v.length<2?"0"+v:v}function i(l,v){return l<v?(v+.05)/(l+.05):(l+.05)/(v+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(v,S,w,E){return E!==void 0?`#${a(v)}${a(S)}${a(w)}${a(E)}`:`#${a(v)}${a(S)}${a(w)}`},l.toRgba=function(v,S,w,E=255){return(v<<24|S<<16|w<<8|E)>>>0},l.toColor=function(v,S,w,E){return{css:l.toCss(v,S,w,E),rgba:l.toRgba(v,S,w,E)}}})(d||(o.channels=d={})),(function(l){function v(S,w){return u=Math.round(255*w),[c,h,f]=s.toChannels(S.rgba),{css:d.toCss(c,h,f,u),rgba:d.toRgba(c,h,f,u)}}l.blend=function(S,w){if(u=(255&w.rgba)/255,u===1)return{css:w.css,rgba:w.rgba};const E=w.rgba>>24&255,g=w.rgba>>16&255,x=w.rgba>>8&255,T=S.rgba>>24&255,A=S.rgba>>16&255,I=S.rgba>>8&255;return c=T+Math.round((E-T)*u),h=A+Math.round((g-A)*u),f=I+Math.round((x-I)*u),{css:d.toCss(c,h,f),rgba:d.toRgba(c,h,f)}},l.isOpaque=function(S){return(255&S.rgba)==255},l.ensureContrastRatio=function(S,w,E){const g=s.ensureContrastRatio(S.rgba,w.rgba,E);if(g)return d.toColor(g>>24&255,g>>16&255,g>>8&255)},l.opaque=function(S){const w=(255|S.rgba)>>>0;return[c,h,f]=s.toChannels(w),{css:d.toCss(c,h,f),rgba:w}},l.opacity=v,l.multiplyOpacity=function(S,w){return u=255&S.rgba,v(S,u*w/255)},l.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}})(p||(o.color=p={})),(function(l){let v,S;try{const w=document.createElement("canvas");w.width=1,w.height=1;const E=w.getContext("2d",{willReadFrequently:!0});E&&(v=E,v.globalCompositeOperation="copy",S=v.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return c=parseInt(w.slice(1,2).repeat(2),16),h=parseInt(w.slice(2,3).repeat(2),16),f=parseInt(w.slice(3,4).repeat(2),16),d.toColor(c,h,f);case 5:return c=parseInt(w.slice(1,2).repeat(2),16),h=parseInt(w.slice(2,3).repeat(2),16),f=parseInt(w.slice(3,4).repeat(2),16),u=parseInt(w.slice(4,5).repeat(2),16),d.toColor(c,h,f,u);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const E=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return c=parseInt(E[1]),h=parseInt(E[2]),f=parseInt(E[3]),u=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),d.toColor(c,h,f,u);if(!v||!S)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=S,v.fillStyle=w,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[c,h,f,u]=v.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:d.toRgba(c,h,f,u),css:w}}})(m||(o.css=m={})),(function(l){function v(S,w,E){const g=S/255,x=w/255,T=E/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}l.relativeLuminance=function(S){return v(S>>16&255,S>>8&255,255&S)},l.relativeLuminance2=v})(_||(o.rgb=_={})),(function(l){function v(w,E,g){const x=w>>24&255,T=w>>16&255,A=w>>8&255;let I=E>>24&255,M=E>>16&255,N=E>>8&255,U=i(_.relativeLuminance2(I,M,N),_.relativeLuminance2(x,T,A));for(;U<g&&(I>0||M>0||N>0);)I-=Math.max(0,Math.ceil(.1*I)),M-=Math.max(0,Math.ceil(.1*M)),N-=Math.max(0,Math.ceil(.1*N)),U=i(_.relativeLuminance2(I,M,N),_.relativeLuminance2(x,T,A));return(I<<24|M<<16|N<<8|255)>>>0}function S(w,E,g){const x=w>>24&255,T=w>>16&255,A=w>>8&255;let I=E>>24&255,M=E>>16&255,N=E>>8&255,U=i(_.relativeLuminance2(I,M,N),_.relativeLuminance2(x,T,A));for(;U<g&&(I<255||M<255||N<255);)I=Math.min(255,I+Math.ceil(.1*(255-I))),M=Math.min(255,M+Math.ceil(.1*(255-M))),N=Math.min(255,N+Math.ceil(.1*(255-N))),U=i(_.relativeLuminance2(I,M,N),_.relativeLuminance2(x,T,A));return(I<<24|M<<16|N<<8|255)>>>0}l.blend=function(w,E){if(u=(255&E)/255,u===1)return E;const g=E>>24&255,x=E>>16&255,T=E>>8&255,A=w>>24&255,I=w>>16&255,M=w>>8&255;return c=A+Math.round((g-A)*u),h=I+Math.round((x-I)*u),f=M+Math.round((T-M)*u),d.toRgba(c,h,f)},l.ensureContrastRatio=function(w,E,g){const x=_.relativeLuminance(w>>8),T=_.relativeLuminance(E>>8);if(i(x,T)<g){if(T<x){const M=v(w,E,g),N=i(x,_.relativeLuminance(M>>8));if(N<g){const U=S(w,E,g);return N>i(x,_.relativeLuminance(U>>8))?M:U}return M}const A=S(w,E,g),I=i(x,_.relativeLuminance(A>>8));if(I<g){const M=v(w,E,g);return I>i(x,_.relativeLuminance(M>>8))?A:M}return A}},l.reduceLuminance=v,l.increaseLuminance=S,l.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]}})(s||(o.rgba=s={})),o.toPaddedHex=a,o.contrastRatio=i},8969:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),f=c(2585),u=c(4348),d=c(7866),p=c(744),m=c(7302),_=c(6975),s=c(8460),a=c(1753),i=c(1480),l=c(7994),v=c(9282),S=c(5435),w=c(5981),E=c(2660);let g=!1;class x extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new s.EventEmitter),this._onScroll.event((A=>{var I;(I=this._onScrollApi)==null||I.fire(A.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(A){for(const I in A)this.optionsService.options[I]=A[I]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new s.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new s.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new s.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new s.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new s.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new m.OptionsService(A)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(p.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(d.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(i.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,s.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,s.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,s.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,s.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((I=>{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((I=>{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 w.WriteBuffer(((I,M)=>this._inputHandler.parse(I,M)))),this.register((0,s.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,I){this._writeBuffer.write(A,I)}writeSync(A,I){this._logService.logLevel<=f.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(A,I)}input(A,I=!0){this.coreService.triggerDataEvent(A,I)}resize(A,I){isNaN(A)||isNaN(I)||(A=Math.max(A,p.MINIMUM_COLS),I=Math.max(I,p.MINIMUM_ROWS),this._bufferService.resize(A,I))}scroll(A,I=!1){this._bufferService.scroll(A,I)}scrollLines(A,I,M){this._bufferService.scrollLines(A,I,M)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const I=A-this._bufferService.buffer.ydisp;I!==0&&this.scrollLines(I)}registerEscHandler(A,I){return this._inputHandler.registerEscHandler(A,I)}registerDcsHandler(A,I){return this._inputHandler.registerDcsHandler(A,I)}registerCsiHandler(A,I){return this._inputHandler.registerCsiHandler(A,I)}registerOscHandler(A,I){return this._inputHandler.registerOscHandler(A,I)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const I=this.optionsService.rawOptions.windowsPty;I&&I.buildNumber!==void 0&&I.buildNumber!==void 0?A=I.backend==="conpty"&&I.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const I of A)I.dispose()}))}}}o.CoreTerminal=x},8460:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,h){return c((f=>h.fire(f)))},o.runAndSubscribe=function(c,h){return h(void 0),c((f=>h(f)))}},5435:function(y,o,c){var h=this&&this.__decorate||function(Y,D,B,R){var O,W=arguments.length,ee=W<3?D:R===null?R=Object.getOwnPropertyDescriptor(D,B):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(Y,D,B,R);else for(var ce=Y.length-1;ce>=0;ce--)(O=Y[ce])&&(ee=(W<3?O(ee):W>3?O(D,B,ee):O(D,B))||ee);return W>3&&ee&&Object.defineProperty(D,B,ee),ee},f=this&&this.__param||function(Y,D){return function(B,R){D(B,R,Y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),d=c(7116),p=c(2015),m=c(844),_=c(482),s=c(8437),a=c(8460),i=c(643),l=c(511),v=c(3734),S=c(2585),w=c(1480),E=c(6242),g=c(6351),x=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function I(Y,D){if(Y>24)return D.setWinLines||!1;switch(Y){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var M;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(o.WindowsOptionsReportType=M={}));let N=0;class U extends m.Disposable{getAttrData(){return this._curAttrData}constructor(D,B,R,O,W,ee,ce,ie,F=new p.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=B,this._coreService=R,this._logService=O,this._optionsService=W,this._oscLinkService=ee,this._coreMouseService=ce,this._unicodeService=ie,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.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 X(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,P)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:P.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,P,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:P,data:H})})),this._parser.setDcsHandlerFallback(((L,P,H)=>{P==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:P,payload:H})})),this._parser.setPrintHandler(((L,P,H)=>this.print(L,P,H))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new E.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new E.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new E.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new E.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new E.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new E.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new E.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new E.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new E.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new E.OscHandler((L=>this.restoreCursorColor(L)))),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 L in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((L,P)=>this.requestStatusString(L,P))))}_preserveStack(D,B,R,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=R,this._parseStack.position=O}_logSlowResolvingAsync(D){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([D,new Promise(((B,R)=>setTimeout((()=>R("#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(D,B){let R,O=this._activeBuffer.x,W=this._activeBuffer.y,ee=0;const ce=this._parseStack.paused;if(ce){if(R=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(R),R;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>A&&(ee=this._parseStack.position+A)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(L=>String.fromCharCode(L))).join("")}"`),typeof D=="string"?D.split("").map((L=>L.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(D.length,A))),ce||this._dirtyRowTracker.clearRange(),D.length>A)for(let L=ee;L<D.length;L+=A){const P=L+A<D.length?L+A:D.length,H=typeof D=="string"?this._stringDecoder.decode(D.substring(L,P),this._parseBuffer):this._utf8Decoder.decode(D.subarray(L,P),this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,H))return this._preserveStack(O,W,H,L),this._logSlowResolvingAsync(R),R}else if(!ce){const L=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(R=this._parser.parse(this._parseBuffer,L))return this._preserveStack(O,W,L,0),this._logSlowResolvingAsync(R),R}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const ie=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),F=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);F<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(F,this._bufferService.rows-1),Math.min(ie,this._bufferService.rows-1))}print(D,B,R){let O,W;const ee=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,ie=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,P=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&R-B>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,P);let G=this._parser.precedingJoinState;for(let Z=B;Z<R;++Z){if(O=D[Z],O<127&&ee){const ye=ee[String.fromCharCode(O)];ye&&(O=ye.charCodeAt(0))}const oe=this._unicodeService.charProperties(O,G);W=w.UnicodeService.extractWidth(oe);const ue=w.UnicodeService.extractShouldJoin(oe),de=ue?w.UnicodeService.extractWidth(G):0;if(G=oe,ce&&this._onA11yChar.fire((0,_.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-de>ie){if(F){const ye=H;let re=this._activeBuffer.x-de;for(this._activeBuffer.x=de,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),de>0&&H instanceof s.BufferLine&&H.copyCellsFrom(ye,re,0,de,!1);re<ie;)ye.setCellFromCodepoint(re++,0,1,P)}else if(this._activeBuffer.x=ie-1,W===2)continue}if(ue&&this._activeBuffer.x){const ye=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ye,O,W);for(let re=W-de;--re>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,P)}else if(L&&(H.insertCells(this._activeBuffer.x,W-de,this._activeBuffer.getNullCell(P)),H.getWidth(ie-1)===2&&H.setCellFromCodepoint(ie-1,i.NULL_CELL_CODE,i.NULL_CELL_WIDTH,P)),H.setCellFromCodepoint(this._activeBuffer.x++,O,W,P),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,P)}this._parser.precedingJoinState=G,this._activeBuffer.x<ie&&R-B>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,P),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,B){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,B):this._parser.registerCsiHandler(D,(R=>!I(R.params[0],this._optionsService.rawOptions.windowOptions)||B(R)))}registerDcsHandler(D,B){return this._parser.registerDcsHandler(D,new g.DcsHandler(B))}registerEscHandler(D,B){return this._parser.registerEscHandler(D,B)}registerOscHandler(D,B){return this._parser.registerOscHandler(D,new E.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(){var D;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&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=D,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+B)}cursorUp(D){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const B=D.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const B=D.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,B,R,O=!1,W=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);ee.replaceCells(B,R,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(ee.isWrapped=!1)}_resetBufferLine(D,B=!1){const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);R&&(R.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),R.isWrapped=!1)}eraseInDisplay(D,B=!1){let R;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);R<this._bufferService.rows;R++)this._resetBufferLine(R,B);this._dirtyRowTracker.markDirty(R);break;case 1:for(R=this._activeBuffer.y,this._dirtyRowTracker.markDirty(R),this._eraseInBufferLine(R,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(R+1).isWrapped=!1);R--;)this._resetBufferLine(R,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(R=this._bufferService.rows,this._dirtyRowTracker.markDirty(R-1);R--;)this._resetBufferLine(R,B);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(D,B=!1){switch(this._restrictCursor(this._bufferService.cols),D.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(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;B--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(R,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const R=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;B--;)this._activeBuffer.lines.splice(R,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let B=D.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(D){let B=D.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(s.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);O.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);O.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);O.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let R=this._activeBuffer.scrollTop;R<=this._activeBuffer.scrollBottom;++R){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);O.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const B=this._parser.precedingJoinState;if(!B)return!0;const R=D.params[0]||1,O=w.UnicodeService.extractWidth(B),W=this._activeBuffer.x-O,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),ce=new Uint32Array(ee.length*R);let ie=0;for(let L=0;L<ee.length;){const P=ee.codePointAt(L)||0;ce[ie++]=P,L+=P>65535?2:1}let F=ie;for(let L=1;L<R;++L)ce.copyWithin(F,0,ie),F+=ie;return this.print(ce,0,F),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),D.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(D,B){const R=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,ee=this._coreService,{buffers:ce,cols:ie}=this._bufferService,{active:F,alt:L}=ce,P=this._optionsService.rawOptions,H=ue=>ue?1:2,G=D.params[0];return Z=G,oe=B?G===2?4:G===4?H(ee.modes.insertMode):G===12?3:G===20?H(P.convertEol):0:G===1?H(R.applicationCursorKeys):G===3?P.windowOptions.setWinLines?ie===80?2:ie===132?1:0:0:G===6?H(R.origin):G===7?H(R.wraparound):G===8?3:G===9?H(O==="X10"):G===12?H(P.cursorBlink):G===25?H(!ee.isCursorHidden):G===45?H(R.reverseWraparound):G===66?H(R.applicationKeypad):G===67?4:G===1e3?H(O==="VT200"):G===1002?H(O==="DRAG"):G===1003?H(O==="ANY"):G===1004?H(R.sendFocus):G===1005?4:G===1006?H(W==="SGR"):G===1015?4:G===1016?H(W==="SGR_PIXELS"):G===1048?1:G===47||G===1047||G===1049?H(F===L):G===2004?H(R.bracketedPasteMode):0,ee.triggerDataEvent(`${u.C0.ESC}[${B?"":"?"}${Z};${oe}$y`),!0;var Z,oe}_updateAttrColor(D,B,R,O,W){return B===2?(D|=50331648,D&=-16777216,D|=v.AttributeData.fromColorRGB([R,O,W])):B===5&&(D&=-50331904,D|=33554432|255&R),D}_extractColor(D,B,R){const O=[0,0,-1,0,0,0];let W=0,ee=0;do{if(O[ee+W]=D.params[B+ee],D.hasSubParams(B+ee)){const ce=D.getSubParams(B+ee);let ie=0;do O[1]===5&&(W=1),O[ee+ie+1+W]=ce[ie];while(++ie<ce.length&&ie+ee+1+W<O.length);break}if(O[1]===5&&ee+W>=2||O[1]===2&&ee+W>=5)break;O[1]&&(W=1)}while(++ee+B<D.length&&ee+W<O.length);for(let ce=2;ce<O.length;++ce)O[ce]===-1&&(O[ce]=0);switch(O[0]){case 38:R.fg=this._updateAttrColor(R.fg,O[1],O[3],O[4],O[5]);break;case 48:R.bg=this._updateAttrColor(R.bg,O[1],O[3],O[4],O[5]);break;case 58:R.extended=R.extended.clone(),R.extended.underlineColor=this._updateAttrColor(R.extended.underlineColor,O[1],O[3],O[4],O[5])}return ee}_processUnderline(D,B){B.extended=B.extended.clone(),(!~D||D>5)&&(D=1),B.extended.underlineStyle=D,B.fg|=268435456,D===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(D){D.fg=s.DEFAULT_ATTR_DATA.fg,D.bg=s.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=D.length;let R;const O=this._curAttrData;for(let W=0;W<B;W++)R=D.params[W],R>=30&&R<=37?(O.fg&=-50331904,O.fg|=16777216|R-30):R>=40&&R<=47?(O.bg&=-50331904,O.bg|=16777216|R-40):R>=90&&R<=97?(O.fg&=-50331904,O.fg|=16777224|R-90):R>=100&&R<=107?(O.bg&=-50331904,O.bg|=16777224|R-100):R===0?this._processSGR0(O):R===1?O.fg|=134217728:R===3?O.bg|=67108864:R===4?(O.fg|=268435456,this._processUnderline(D.hasSubParams(W)?D.getSubParams(W)[0]:1,O)):R===5?O.fg|=536870912:R===7?O.fg|=67108864:R===8?O.fg|=1073741824:R===9?O.fg|=2147483648:R===2?O.bg|=134217728:R===21?this._processUnderline(2,O):R===22?(O.fg&=-134217729,O.bg&=-134217729):R===23?O.bg&=-67108865:R===24?(O.fg&=-268435457,this._processUnderline(0,O)):R===25?O.fg&=-536870913:R===27?O.fg&=-67108865:R===28?O.fg&=-1073741825:R===29?O.fg&=2147483647:R===39?(O.fg&=-67108864,O.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):R===49?(O.bg&=-67108864,O.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):R===38||R===48||R===58?W+=this._extractColor(D,W,O):R===53?O.bg|=1073741824:R===55?O.bg&=-1073741825:R===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):R===100?(O.fg&=-67108864,O.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",R);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${B};${R}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const B=this._activeBuffer.y+1,R=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${B};${R}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.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(D){const B=D.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 R=B%2==1;return this._optionsService.options.cursorBlink=R,!0}setScrollRegion(D){const B=D.params[0]||1;let R;return(D.length<2||(R=D.params[1])>this._bufferService.rows||R===0)&&(R=this._bufferService.rows),R>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=R-1,this._setCursor(0,0)),!0}windowOptions(D){if(!I(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.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(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const B=[],R=D.split(";");for(;R.length>1;){const O=R.shift(),W=R.shift();if(/^\d+$/.exec(O)){const ee=parseInt(O);if(J(ee))if(W==="?")B.push({type:0,index:ee});else{const ce=(0,x.parseColor)(W);ce&&B.push({type:1,index:ee,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(D){const B=D.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(D,B){this._getCurrentLinkId()&&this._finishHyperlink();const R=D.split(":");let O;const W=R.findIndex((ee=>ee.startsWith("id=")));return W!==-1&&(O=R[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,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(D,B){const R=D.split(";");for(let O=0;O<R.length&&!(B>=this._specialColors.length);++O,++B)if(R[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const W=(0,x.parseColor)(R[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[B],color:W}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const B=[],R=D.split(";");for(let O=0;O<R.length;++O)if(/^\d+$/.exec(R[O])){const W=parseInt(R[O]);J(W)&&B.push({type:2,index:W})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(T[D[0]],d.CHARSETS[D[1]]||d.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),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._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new l.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const R=this._activeBuffer.ybase+this._activeBuffer.y+B,O=this._activeBuffer.lines.get(R);O&&(O.fill(D),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,B){const R=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${W}${u.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${R.scrollTop+1};${R.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,B){this._dirtyRowTracker.markRangeDirty(D,B)}}o.InputHandler=U;let X=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,D){Y>D&&(N=Y,Y=D,D=N),Y<this.start&&(this.start=Y),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(Y){return 0<=Y&&Y<256}X=h([f(0,S.IBufferService)],X)},844:(y,o)=>{function c(h){for(const f of h)f.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const f=this._disposables.indexOf(h);f!==-1&&this._disposables.splice(f,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var f;this._isDisposed||h===this._value||((f=this._value)==null||f.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(f,u,d){this._data[f]||(this._data[f]={}),this._data[f][u]=d}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,f,u,d,p){this._data.get(h,f)||this._data.set(h,f,new c),this._data.get(h,f).set(u,d,p)}get(h,f,u,d){var p;return(p=this._data.get(h,f))==null?void 0:p.get(u,d)}clear(){this._data.clear()}}},6114:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const f=c.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const f=this._getKey(h);if(f===void 0||(c=this._search(f),c===-1)||this._getKey(this._array[c])!==f)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===f);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,f){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do f(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let f=0,u=this._array.length-1;for(;u>=f;){let d=f+u>>1;const p=this._getKey(this._array[d]);if(p>h)u=d-1;else{if(!(p<h)){for(;d>0&&this._getKey(this._array[d-1])===h;)d--;return d}f=d+1}}return f}}},7226:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let m=0,_=0,s=p.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(m=Date.now(),this._tasks[this._i]()||this._i++,m=Math.max(1,Date.now()-m),_=Math.max(m,_),a=p.timeRemaining(),1.5*_>a)return s-m<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-m))}ms`),void this._start();s=a}this.clear()}}class u extends f{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){const m=Date.now()+p;return{timeRemaining:()=>Math.max(0,m-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(d){return requestIdleCallback(d)}_cancelCallback(d){cancelIdleCallback(d)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(d){this._queue.clear(),this._queue.enqueue(d)}flush(){this._queue.flush()}}},9282:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),d=u==null?void 0:u.get(f.cols-1),p=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);p&&d&&(p.isWrapped=d[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&d[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}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}}o.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,d=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=d}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),f=c(7226),u=c(3734),d=c(8437),p=c(4634),m=c(511),_=c(643),s=c(4863),a=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(i,l,v){this._hasScrollback=i,this._optionsService=l,this._bufferService=v,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=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=m.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=m.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(i){return i?(this._nullCell.fg=i.fg,this._nullCell.bg=i.bg,this._nullCell.extended=i.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(i){return i?(this._whitespaceCell.fg=i.fg,this._whitespaceCell.bg=i.bg,this._whitespaceCell.extended=i.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(i,l){return new d.BufferLine(this._bufferService.cols,this.getNullCell(i),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const i=this.ybase+this.y-this.ydisp;return i>=0&&i<this._rows}_getCorrectBufferLength(i){if(!this._hasScrollback)return i;const l=i+this._optionsService.rawOptions.scrollback;return l>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:l}fillViewportRows(i){if(this.lines.length===0){i===void 0&&(i=d.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(i))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(i,l){const v=this.getNullCell(d.DEFAULT_ATTR_DATA);let S=0;const w=this._getCorrectBufferLength(l);if(w>this.lines.maxLength&&(this.lines.maxLength=w),this.lines.length>0){if(this._cols<i)for(let g=0;g<this.lines.length;g++)S+=+this.lines.get(g).resize(i,v);let E=0;if(this._rows<l)for(let g=this._rows;g<l;g++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new d.BufferLine(i,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(i,v)));else for(let g=this._rows;g>l;g--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(w<this.lines.maxLength){const g=this.lines.length-w;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=w}this.x=Math.min(this.x,i-1),this.y=Math.min(this.y,l-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,i-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(i,l),this._cols>i))for(let E=0;E<this.lines.length;E++)S+=+this.lines.get(E).resize(i,v);this._cols=i,this._rows=l,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let i=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,i=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return i}get _isReflowEnabled(){const i=this._optionsService.rawOptions.windowsPty;return i&&i.buildNumber?this._hasScrollback&&i.backend==="conpty"&&i.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(i,l){this._cols!==i&&(i>this._cols?this._reflowLarger(i,l):this._reflowSmaller(i,l))}_reflowLarger(i,l){const v=(0,p.reflowLargerGetLinesToRemove)(this.lines,this._cols,i,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(v.length>0){const S=(0,p.reflowLargerCreateNewLayout)(this.lines,v);(0,p.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(i,l,S.countRemoved)}}_reflowLargerAdjustViewport(i,l,v){const S=this.getNullCell(d.DEFAULT_ATTR_DATA);let w=v;for(;w-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new d.BufferLine(i,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(i,l){const v=this.getNullCell(d.DEFAULT_ATTR_DATA),S=[];let w=0;for(let E=this.lines.length-1;E>=0;E--){let g=this.lines.get(E);if(!g||!g.isWrapped&&g.getTrimmedLength()<=i)continue;const x=[g];for(;g.isWrapped&&E>0;)g=this.lines.get(--E),x.unshift(g);const T=this.ybase+this.y;if(T>=E&&T<E+x.length)continue;const A=x[x.length-1].getTrimmedLength(),I=(0,p.reflowSmallerGetNewLineLengths)(x,this._cols,i),M=I.length-x.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const U=[];for(let R=0;R<M;R++){const O=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);U.push(O)}U.length>0&&(S.push({start:E+x.length+w,newLines:U}),w+=U.length),x.push(...U);let X=I.length-1,J=I[X];J===0&&(X--,J=I[X]);let Y=x.length-M-1,D=A;for(;Y>=0;){const R=Math.min(D,J);if(x[X]===void 0)break;if(x[X].copyCellsFrom(x[Y],D-R,J-R,R,!0),J-=R,J===0&&(X--,J=I[X]),D-=R,D===0){Y--;const O=Math.max(Y,0);D=(0,p.getWrappedLineTrimmedLength)(x,O,this._cols)}}for(let R=0;R<x.length;R++)I[R]<i&&x[R].setCell(I[R],v);let B=M-N;for(;B-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+w)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+l-1)}if(S.length>0){const E=[],g=[];for(let X=0;X<this.lines.length;X++)g.push(this.lines.get(X));const x=this.lines.length;let T=x-1,A=0,I=S[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+w);let M=0;for(let X=Math.min(this.lines.maxLength-1,x+w-1);X>=0;X--)if(I&&I.start>T+M){for(let J=I.newLines.length-1;J>=0;J--)this.lines.set(X--,I.newLines[J]);X++,E.push({index:T+1,amount:I.newLines.length}),M+=I.newLines.length,I=S[++A]}else this.lines.set(X,g[T--]);let N=0;for(let X=E.length-1;X>=0;X--)E[X].index+=N,this.lines.onInsertEmitter.fire(E[X]),N+=E[X].amount;const U=Math.max(0,x+w-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(i,l,v=0,S){const w=this.lines.get(i);return w?w.translateToString(l,v,S):""}getWrappedRangeForLine(i){let l=i,v=i;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:l,last:v}}setupTabStops(i){for(i!=null?this.tabs[i]||(i=this.prevStop(i)):(this.tabs={},i=0);i<this._cols;i+=this._optionsService.rawOptions.tabStopWidth)this.tabs[i]=!0}prevStop(i){for(i==null&&(i=this.x);!this.tabs[--i]&&i>0;);return i>=this._cols?this._cols-1:i<0?0:i}nextStop(i){for(i==null&&(i=this.x);!this.tabs[++i]&&i<this._cols;);return i>=this._cols?this._cols-1:i<0?0:i}clearMarkers(i){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===i&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].dispose(),this.markers.splice(i--,1);this._isClearing=!1}addMarker(i){const l=new s.Marker(i);return this.markers.push(l),l.register(this.lines.onTrim((v=>{l.line-=v,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((v=>{l.line>=v.index&&(l.line+=v.amount)}))),l.register(this.lines.onDelete((v=>{l.line>=v.index&&l.line<v.index+v.amount&&l.dispose(),l.line>v.index&&(l.line-=v.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(i){this._isClearing||this.markers.splice(this.markers.indexOf(i),1)}}},8437:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),f=c(511),u=c(643),d=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let p=0;class m{constructor(s,a,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*s);const l=a||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let v=0;v<s;++v)this.setCell(v,l);this.length=s}get(s){const a=this._data[3*s+0],i=2097151&a;return[this._data[3*s+1],2097152&a?this._combined[s]:i?(0,d.stringFromCodePoint)(i):"",a>>22,2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):i]}set(s,a){this._data[3*s+1]=a[u.CHAR_DATA_ATTR_INDEX],a[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[s]=a[1],this._data[3*s+0]=2097152|s|a[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*s+0]=a[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(s){return this._data[3*s+0]>>22}hasWidth(s){return 12582912&this._data[3*s+0]}getFg(s){return this._data[3*s+1]}getBg(s){return this._data[3*s+2]}hasContent(s){return 4194303&this._data[3*s+0]}getCodePoint(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s].charCodeAt(this._combined[s].length-1):2097151&a}isCombined(s){return 2097152&this._data[3*s+0]}getString(s){const a=this._data[3*s+0];return 2097152&a?this._combined[s]:2097151&a?(0,d.stringFromCodePoint)(2097151&a):""}isProtected(s){return 536870912&this._data[3*s+2]}loadCell(s,a){return p=3*s,a.content=this._data[p+0],a.fg=this._data[p+1],a.bg=this._data[p+2],2097152&a.content&&(a.combinedData=this._combined[s]),268435456&a.bg&&(a.extended=this._extendedAttrs[s]),a}setCell(s,a){2097152&a.content&&(this._combined[s]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[s]=a.extended),this._data[3*s+0]=a.content,this._data[3*s+1]=a.fg,this._data[3*s+2]=a.bg}setCellFromCodepoint(s,a,i,l){268435456&l.bg&&(this._extendedAttrs[s]=l.extended),this._data[3*s+0]=a|i<<22,this._data[3*s+1]=l.fg,this._data[3*s+2]=l.bg}addCodepointToCell(s,a,i){let l=this._data[3*s+0];2097152&l?this._combined[s]+=(0,d.stringFromCodePoint)(a):2097151&l?(this._combined[s]=(0,d.stringFromCodePoint)(2097151&l)+(0,d.stringFromCodePoint)(a),l&=-2097152,l|=2097152):l=a|4194304,i&&(l&=-12582913,l|=i<<22),this._data[3*s+0]=l}insertCells(s,a,i){if((s%=this.length)&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length-s){const l=new f.CellData;for(let v=this.length-s-a-1;v>=0;--v)this.setCell(s+a+v,this.loadCell(s+v,l));for(let v=0;v<a;++v)this.setCell(s+v,i)}else for(let l=s;l<this.length;++l)this.setCell(l,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(s,a,i){if(s%=this.length,a<this.length-s){const l=new f.CellData;for(let v=0;v<this.length-s-a;++v)this.setCell(s+v,this.loadCell(s+a+v,l));for(let v=this.length-a;v<this.length;++v)this.setCell(v,i)}else for(let l=s;l<this.length;++l)this.setCell(l,i);s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),this.getWidth(s)!==0||this.hasContent(s)||this.setCellFromCodepoint(s,0,1,i)}replaceCells(s,a,i,l=!1){if(l)for(s&&this.getWidth(s-1)===2&&!this.isProtected(s-1)&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,i);s<a&&s<this.length;)this.isProtected(s)||this.setCell(s,i),s++;else for(s&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s-1,0,1,i),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,i);s<a&&s<this.length;)this.setCell(s++,i)}resize(s,a){if(s===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const i=3*s;if(s>this.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const l=new Uint32Array(i);l.set(this._data),this._data=l}for(let l=this.length;l<s;++l)this.setCell(l,a)}else{this._data=this._data.subarray(0,i);const l=Object.keys(this._combined);for(let S=0;S<l.length;S++){const w=parseInt(l[S],10);w>=s&&delete this._combined[w]}const v=Object.keys(this._extendedAttrs);for(let S=0;S<v.length;S++){const w=parseInt(v[S],10);w>=s&&delete this._extendedAttrs[w]}}return this.length=s,4*i*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const s=new Uint32Array(this._data.length);return s.set(this._data),this._data=s,1}return 0}fill(s,a=!1){if(a)for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,s);else{this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,s)}}copyFrom(s){this.length!==s.length?this._data=new Uint32Array(s._data):this._data.set(s._data),this.length=s.length,this._combined={};for(const a in s._combined)this._combined[a]=s._combined[a];this._extendedAttrs={};for(const a in s._extendedAttrs)this._extendedAttrs[a]=s._extendedAttrs[a];this.isWrapped=s.isWrapped}clone(){const s=new m(0);s._data=new Uint32Array(this._data),s.length=this.length;for(const a in this._combined)s._combined[a]=this._combined[a];for(const a in this._extendedAttrs)s._extendedAttrs[a]=this._extendedAttrs[a];return s.isWrapped=this.isWrapped,s}getTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0])return s+(this._data[3*s+0]>>22);return 0}getNoBgTrimmedLength(){for(let s=this.length-1;s>=0;--s)if(4194303&this._data[3*s+0]||50331648&this._data[3*s+2])return s+(this._data[3*s+0]>>22);return 0}copyCellsFrom(s,a,i,l,v){const S=s._data;if(v)for(let E=l-1;E>=0;E--){for(let g=0;g<3;g++)this._data[3*(i+E)+g]=S[3*(a+E)+g];268435456&S[3*(a+E)+2]&&(this._extendedAttrs[i+E]=s._extendedAttrs[a+E])}else for(let E=0;E<l;E++){for(let g=0;g<3;g++)this._data[3*(i+E)+g]=S[3*(a+E)+g];268435456&S[3*(a+E)+2]&&(this._extendedAttrs[i+E]=s._extendedAttrs[a+E])}const w=Object.keys(s._combined);for(let E=0;E<w.length;E++){const g=parseInt(w[E],10);g>=a&&(this._combined[g-a+i]=s._combined[g])}}translateToString(s,a,i,l){a=a??0,i=i??this.length,s&&(i=Math.min(i,this.getTrimmedLength())),l&&(l.length=0);let v="";for(;a<i;){const S=this._data[3*a+0],w=2097151&S,E=2097152&S?this._combined[a]:w?(0,d.stringFromCodePoint)(w):u.WHITESPACE_CELL_CHAR;if(v+=E,l)for(let g=0;g<E.length;++g)l.push(a);a+=S>>22||1}return l&&l.push(a),v}}o.BufferLine=m},4841:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(y,o)=>{function c(h,f,u){if(f===h.length-1)return h[f].getTrimmedLength();const d=!h[f].hasContent(u-1)&&h[f].getWidth(u-1)===1,p=h[f+1].getWidth(0)===2;return d&&p?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,f,u,d,p){const m=[];for(let _=0;_<h.length-1;_++){let s=_,a=h.get(++s);if(!a.isWrapped)continue;const i=[h.get(_)];for(;s<h.length&&a.isWrapped;)i.push(a),a=h.get(++s);if(d>=_&&d<s){_+=i.length-1;continue}let l=0,v=c(i,l,f),S=1,w=0;for(;S<i.length;){const g=c(i,S,f),x=g-w,T=u-v,A=Math.min(x,T);i[l].copyCellsFrom(i[S],w,v,A,!1),v+=A,v===u&&(l++,v=0),w+=A,w===g&&(S++,w=0),v===0&&l!==0&&i[l-1].getWidth(u-1)===2&&(i[l].copyCellsFrom(i[l-1],u-1,v++,1,!1),i[l-1].setCell(u-1,p))}i[l].replaceCells(v,u,p);let E=0;for(let g=i.length-1;g>0&&(g>l||i[g].getTrimmedLength()===0);g--)E++;E>0&&(m.push(_+i.length-E),m.push(E)),_+=i.length-1}return m},o.reflowLargerCreateNewLayout=function(h,f){const u=[];let d=0,p=f[d],m=0;for(let _=0;_<h.length;_++)if(p===_){const s=f[++d];h.onDeleteEmitter.fire({index:_-m,amount:s}),_+=s-1,m+=s,p=f[++d]}else u.push(_);return{layout:u,countRemoved:m}},o.reflowLargerApplyNewLayout=function(h,f){const u=[];for(let d=0;d<f.length;d++)u.push(h.get(f[d]));for(let d=0;d<u.length;d++)h.set(d,u[d]);h.length=f.length},o.reflowSmallerGetNewLineLengths=function(h,f,u){const d=[],p=h.map(((a,i)=>c(h,i,f))).reduce(((a,i)=>a+i));let m=0,_=0,s=0;for(;s<p;){if(p-s<u){d.push(p-s);break}m+=u;const a=c(h,_,f);m>a&&(m-=a,_++);const i=h[_].getWidth(m-1)===2;i&&m--;const l=i?u-1:u;d.push(l),s+=l}return d},o.getWrappedLineTrimmedLength=c},5295:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),f=c(844),u=c(9092);class d extends f.Disposable{constructor(m,_){super(),this._optionsService=m,this._bufferService=_,this._onBufferActivate=this.register(new h.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 u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.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(m){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(m),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(m,_){this._normal.resize(m,_),this._alt.resize(m,_),this.setupTabStops(m)}setupTabStops(m){this._normal.setupTabStops(m),this._alt.setupTabStops(m)}}o.BufferSet=d},511:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),f=c(643),u=c(3734);class d extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(m){const _=new d;return _.setFromCharData(m),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(m){this.fg=m[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(m[f.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(m[f.CHAR_DATA_CHAR_INDEX].length===2){const s=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=s&&s<=56319){const a=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(s-55296)+a-56320+65536|m[f.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=m[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[f.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=m[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|m[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=d},643:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),f=c(844);class u{get id(){return this._id}constructor(p){this.line=p,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(p){return this._disposables.push(p),p}}o.Marker=u,u._nextId=1},7116:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(y,o)=>{var c,h,f;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
9
|
+
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(o.C0=c={})),(function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""})(h||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(f||(o.C1_ESCAPED=f={}))},7399:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const h=c(2584),f={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:["'",'"']};o.evaluateKeyboardEvent=function(u,d,p,m){const _={type:0,cancel:!1,key:void 0},s=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?_.key=d?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?_.key=d?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?_.key=d?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(_.key=d?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:_.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(_.key=h.C0.ESC+_.key);break;case 9:if(u.shiftKey){_.key=h.C0.ESC+"[Z";break}_.key=h.C0.HT,_.cancel=!0;break;case 13:_.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,_.cancel=!0;break;case 27:_.key=h.C0.ESC,u.altKey&&(_.key=h.C0.ESC+h.C0.ESC),_.cancel=!0;break;case 37:if(u.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"D",_.key===h.C0.ESC+"[1;3D"&&(_.key=h.C0.ESC+(p?"b":"[1;5D"))):_.key=d?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"C",_.key===h.C0.ESC+"[1;3C"&&(_.key=h.C0.ESC+(p?"f":"[1;5C"))):_.key=d?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"A",p||_.key!==h.C0.ESC+"[1;3A"||(_.key=h.C0.ESC+"[1;5A")):_.key=d?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;s?(_.key=h.C0.ESC+"[1;"+(s+1)+"B",p||_.key!==h.C0.ESC+"[1;3B"||(_.key=h.C0.ESC+"[1;5B")):_.key=d?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(_.key=h.C0.ESC+"[2~");break;case 46:_.key=s?h.C0.ESC+"[3;"+(s+1)+"~":h.C0.ESC+"[3~";break;case 36:_.key=s?h.C0.ESC+"[1;"+(s+1)+"H":d?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:_.key=s?h.C0.ESC+"[1;"+(s+1)+"F":d?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?_.type=2:u.ctrlKey?_.key=h.C0.ESC+"[5;"+(s+1)+"~":_.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?_.type=3:u.ctrlKey?_.key=h.C0.ESC+"[6;"+(s+1)+"~":_.key=h.C0.ESC+"[6~";break;case 112:_.key=s?h.C0.ESC+"[1;"+(s+1)+"P":h.C0.ESC+"OP";break;case 113:_.key=s?h.C0.ESC+"[1;"+(s+1)+"Q":h.C0.ESC+"OQ";break;case 114:_.key=s?h.C0.ESC+"[1;"+(s+1)+"R":h.C0.ESC+"OR";break;case 115:_.key=s?h.C0.ESC+"[1;"+(s+1)+"S":h.C0.ESC+"OS";break;case 116:_.key=s?h.C0.ESC+"[15;"+(s+1)+"~":h.C0.ESC+"[15~";break;case 117:_.key=s?h.C0.ESC+"[17;"+(s+1)+"~":h.C0.ESC+"[17~";break;case 118:_.key=s?h.C0.ESC+"[18;"+(s+1)+"~":h.C0.ESC+"[18~";break;case 119:_.key=s?h.C0.ESC+"[19;"+(s+1)+"~":h.C0.ESC+"[19~";break;case 120:_.key=s?h.C0.ESC+"[20;"+(s+1)+"~":h.C0.ESC+"[20~";break;case 121:_.key=s?h.C0.ESC+"[21;"+(s+1)+"~":h.C0.ESC+"[21~";break;case 122:_.key=s?h.C0.ESC+"[23;"+(s+1)+"~":h.C0.ESC+"[23~";break;case 123:_.key=s?h.C0.ESC+"[24;"+(s+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(p&&!m||!u.altKey||u.metaKey)!p||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?_.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(_.key=h.C0.US),u.key==="@"&&(_.key=h.C0.NUL)):u.keyCode===65&&(_.type=1);else{const a=f[u.keyCode],i=a==null?void 0:a[u.shiftKey?1:0];if(i)_.key=h.C0.ESC+i;else if(u.keyCode>=65&&u.keyCode<=90){const l=u.ctrlKey?u.keyCode-64:u.keyCode+32;let v=String.fromCharCode(l);u.shiftKey&&(v=v.toUpperCase()),_.key=h.C0.ESC+v}else if(u.keyCode===32)_.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let l=u.code.slice(3,4);u.shiftKey||(l=l.toLowerCase()),_.key=h.C0.ESC+l,_.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?_.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?_.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?_.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?_.key=h.C0.DEL:u.keyCode===219?_.key=h.C0.ESC:u.keyCode===220?_.key=h.C0.FS:u.keyCode===221&&(_.key=h.C0.GS)}return _}},482:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,f=c.length){let u="";for(let d=h;d<f;++d){let p=c[d];p>65535?(p-=65536,u+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):u+=String.fromCharCode(p)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const f=c.length;if(!f)return 0;let u=0,d=0;if(this._interim){const p=c.charCodeAt(d++);56320<=p&&p<=57343?h[u++]=1024*(this._interim-55296)+p-56320+65536:(h[u++]=this._interim,h[u++]=p),this._interim=0}for(let p=d;p<f;++p){const m=c.charCodeAt(p);if(55296<=m&&m<=56319){if(++p>=f)return this._interim=m,u;const _=c.charCodeAt(p);56320<=_&&_<=57343?h[u++]=1024*(m-55296)+_-56320+65536:(h[u++]=m,h[u++]=_)}else m!==65279&&(h[u++]=m)}return u}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const f=c.length;if(!f)return 0;let u,d,p,m,_=0,s=0,a=0;if(this.interim[0]){let v=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let w,E=0;for(;(w=63&this.interim[++E])&&E<4;)S<<=6,S|=w;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=g-E;for(;a<x;){if(a>=f)return 0;if(w=c[a++],(192&w)!=128){a--,v=!0;break}this.interim[E++]=w,S<<=6,S|=63&w}v||(g===2?S<128?a--:h[_++]=S:g===3?S<2048||S>=55296&&S<=57343||S===65279||(h[_++]=S):S<65536||S>1114111||(h[_++]=S)),this.interim.fill(0)}const i=f-4;let l=a;for(;l<f;){for(;!(!(l<i)||128&(u=c[l])||128&(d=c[l+1])||128&(p=c[l+2])||128&(m=c[l+3]));)h[_++]=u,h[_++]=d,h[_++]=p,h[_++]=m,l+=4;if(u=c[l++],u<128)h[_++]=u;else if((224&u)==192){if(l>=f)return this.interim[0]=u,_;if(d=c[l++],(192&d)!=128){l--;continue}if(s=(31&u)<<6|63&d,s<128){l--;continue}h[_++]=s}else if((240&u)==224){if(l>=f)return this.interim[0]=u,_;if(d=c[l++],(192&d)!=128){l--;continue}if(l>=f)return this.interim[0]=u,this.interim[1]=d,_;if(p=c[l++],(192&p)!=128){l--;continue}if(s=(15&u)<<12|(63&d)<<6|63&p,s<2048||s>=55296&&s<=57343||s===65279)continue;h[_++]=s}else if((248&u)==240){if(l>=f)return this.interim[0]=u,_;if(d=c[l++],(192&d)!=128){l--;continue}if(l>=f)return this.interim[0]=u,this.interim[1]=d,_;if(p=c[l++],(192&p)!=128){l--;continue}if(l>=f)return this.interim[0]=u,this.interim[1]=d,this.interim[2]=p,_;if(m=c[l++],(192&m)!=128){l--;continue}if(s=(7&u)<<18|(63&d)<<12|(63&p)<<6|63&m,s<65536||s>1114111)continue;h[_++]=s}}return _}}},225:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const h=c(1480),f=[[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]],u=[[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;o.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 p=0;p<f.length;++p)d.fill(0,f[p][0],f[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?d[p]:(function(m,_){let s,a=0,i=_.length-1;if(m<_[0][0]||m>_[i][1])return!1;for(;i>=a;)if(s=a+i>>1,m>_[s][1])a=s+1;else{if(!(m<_[s][0]))return!0;i=s-1}return!1})(p,u)?0:p>=131072&&p<=196605||p>=196608&&p<=262141?2:1}charProperties(p,m){let _=this.wcwidth(p),s=_===0&&m!==0;if(s){const a=h.UnicodeService.extractWidth(m);a===0?s=!1:a>_&&(_=a)}return h.UnicodeService.createPropertyValue(0,_,s)}}},5981:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),f=c(844);class u extends f.Disposable{constructor(p){super(),this._action=p,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(p,m){if(m!==void 0&&this._syncCalls>m)return void(this._syncCalls=0);if(this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(p,m){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+=p.length,this._writeBuffer.push(p),this._callbacks.push(m),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=p.length,this._writeBuffer.push(p),this._callbacks.push(m)}_innerWrite(p=0,m=!0){const _=p||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const s=this._writeBuffer[this._bufferOffset],a=this._action(s,m);if(a){const l=v=>Date.now()-_>=12?setTimeout((()=>this._innerWrite(0,v))):this._innerWrite(_,v);return void a.catch((v=>(queueMicrotask((()=>{throw v})),Promise.resolve(!1)))).then(l)}const i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=s.length,Date.now()-_>=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()}}o.WriteBuffer=u},5941:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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})$/,h=/^[\da-f]+$/;function f(u,d){const p=u.toString(16),m=p.length<2?"0"+p:p;switch(d){case 4:return p[0];case 8:return m;case 12:return(m+m).slice(0,3);default:return m+m}}o.parseColor=function(u){if(!u)return;let d=u.toLowerCase();if(d.indexOf("rgb:")===0){d=d.slice(4);const p=c.exec(d);if(p){const m=p[1]?15:p[4]?255:p[7]?4095:65535;return[Math.round(parseInt(p[1]||p[4]||p[7]||p[10],16)/m*255),Math.round(parseInt(p[2]||p[5]||p[8]||p[11],16)/m*255),Math.round(parseInt(p[3]||p[6]||p[9]||p[12],16)/m*255)]}}else if(d.indexOf("#")===0&&(d=d.slice(1),h.exec(d)&&[3,6,9,12].includes(d.length))){const p=d.length/3,m=[0,0,0];for(let _=0;_<3;++_){const s=parseInt(d.slice(p*_,p*_+p),16);m[_]=p===1?s<<4:p===2?s:p===3?s>>4:s>>8}return m}},o.toRgbString=function(u,d=16){const[p,m,_]=u;return`rgb:${f(p,d)}/${f(m,d)}/${f(_,d)}`}},5770:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),f=c(8742),u=c(5770),d=[];o.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(m,_){this._handlers[m]===void 0&&(this._handlers[m]=[]);const s=this._handlers[m];return s.push(_),{dispose:()=>{const a=s.indexOf(_);a!==-1&&s.splice(a,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}reset(){if(this._active.length)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].unhook(!1);this._stack.paused=!1,this._active=d,this._ident=0}hook(m,_){if(this.reset(),this._ident=m,this._active=this._handlers[m]||d,this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(m,_,s){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(m,_,s);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(m,_,s))}unhook(m,_=!0){if(this._active.length){let s=!1,a=this._active.length-1,i=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,s=_,i=this._stack.fallThrough,this._stack.paused=!1),!i&&s===!1){for(;a>=0&&(s=this._active[a].unhook(m),s!==!0);a--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,s;a--}for(;a>=0;a--)if(s=this._active[a].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,s}else this._handlerFb(this._ident,"UNHOOK",m);this._active=d,this._ident=0}};const p=new f.Params;p.addParam(0),o.DcsHandler=class{constructor(m){this._handler=m,this._data="",this._params=p,this._hitLimit=!1}hook(m){this._params=m.length>1||m.params[0]?m.clone():p,this._data="",this._hitLimit=!1}put(m,_,s){this._hitLimit||(this._data+=(0,h.utf32ToString)(m,_,s),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(m){let _=!1;if(this._hitLimit)_=!1;else if(m&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then((s=>(this._params=p,this._data="",this._hitLimit=!1,s)));return this._params=p,this._data="",this._hitLimit=!1,_}}},2015:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),f=c(8742),u=c(6242),d=c(6351);class p{constructor(a){this.table=new Uint8Array(a)}setDefault(a,i){this.table.fill(a<<4|i)}add(a,i,l,v){this.table[i<<8|a]=l<<4|v}addMany(a,i,l,v){for(let S=0;S<a.length;S++)this.table[i<<8|a[S]]=l<<4|v}}o.TransitionTable=p;const m=160;o.VT500_TRANSITION_TABLE=(function(){const s=new p(4095),a=Array.apply(null,Array(256)).map(((E,g)=>g)),i=(E,g)=>a.slice(E,g),l=i(32,127),v=i(0,24);v.push(25),v.push.apply(v,i(28,32));const S=i(0,14);let w;for(w in s.setDefault(1,0),s.addMany(l,0,2,0),S)s.addMany([24,26,153,154],w,3,0),s.addMany(i(128,144),w,3,0),s.addMany(i(144,152),w,3,0),s.add(156,w,0,0),s.add(27,w,11,1),s.add(157,w,4,8),s.addMany([152,158,159],w,0,7),s.add(155,w,11,3),s.add(144,w,11,9);return s.addMany(v,0,3,0),s.addMany(v,1,3,1),s.add(127,1,0,1),s.addMany(v,8,0,8),s.addMany(v,3,3,3),s.add(127,3,0,3),s.addMany(v,4,3,4),s.add(127,4,0,4),s.addMany(v,6,3,6),s.addMany(v,5,3,5),s.add(127,5,0,5),s.addMany(v,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(l,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(i(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(l,7,0,7),s.addMany(v,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(i(64,127),3,7,0),s.addMany(i(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(i(48,60),4,8,4),s.addMany(i(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(i(32,64),6,0,6),s.add(127,6,0,6),s.addMany(i(64,127),6,0,0),s.addMany(i(32,48),3,9,5),s.addMany(i(32,48),5,9,5),s.addMany(i(48,64),5,0,6),s.addMany(i(64,127),5,7,0),s.addMany(i(32,48),4,9,5),s.addMany(i(32,48),1,9,2),s.addMany(i(32,48),2,9,2),s.addMany(i(48,127),2,10,0),s.addMany(i(48,80),1,10,0),s.addMany(i(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(i(96,127),1,10,0),s.add(80,1,11,9),s.addMany(v,9,0,9),s.add(127,9,0,9),s.addMany(i(28,32),9,0,9),s.addMany(i(32,48),9,9,12),s.addMany(i(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(v,11,0,11),s.addMany(i(32,128),11,0,11),s.addMany(i(28,32),11,0,11),s.addMany(v,10,0,10),s.add(127,10,0,10),s.addMany(i(28,32),10,0,10),s.addMany(i(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(i(32,48),10,9,12),s.addMany(v,12,0,12),s.add(127,12,0,12),s.addMany(i(28,32),12,0,12),s.addMany(i(32,48),12,9,12),s.addMany(i(48,64),12,0,11),s.addMany(i(64,127),12,12,13),s.addMany(i(64,127),10,12,13),s.addMany(i(64,127),9,12,13),s.addMany(v,13,13,13),s.addMany(l,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(m,0,2,0),s.add(m,8,5,8),s.add(m,6,0,6),s.add(m,11,0,11),s.add(m,13,13,13),s})();class _ extends h.Disposable{constructor(a=o.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,l,v)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,l)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new d.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,i=[64,126]){let l=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=a.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<a.intermediates.length;++S){const w=a.intermediates.charCodeAt(S);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=w}}if(a.final.length!==1)throw new Error("final must be a single byte");const v=a.final.charCodeAt(0);if(i[0]>v||v>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return l<<=8,l|=v,l}identToString(a){const i=[];for(;a;)i.push(String.fromCharCode(255&a)),a>>=8;return i.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,i){const l=this._identifier(a,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const v=this._escHandlers[l];return v.push(i),{dispose:()=>{const S=v.indexOf(i);S!==-1&&v.splice(S,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,i){this._executeHandlers[a.charCodeAt(0)]=i}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,i){const l=this._identifier(a);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const v=this._csiHandlers[l];return v.push(i),{dispose:()=>{const S=v.indexOf(i);S!==-1&&v.splice(S,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,i){return this._dcsParser.registerHandler(this._identifier(a),i)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,i){return this._oscParser.registerHandler(a,i)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,i,l,v,S){this._parseStack.state=a,this._parseStack.handlers=i,this._parseStack.handlerPos=l,this._parseStack.transition=v,this._parseStack.chunkPos=S}parse(a,i,l){let v,S=0,w=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&x>-1){for(;x>=0&&(v=g[x](this._params),v!==!0);x--)if(v instanceof Promise)return this._parseStack.handlerPos=x,v}this._parseStack.handlers=[];break;case 4:if(l===!1&&x>-1){for(;x>=0&&(v=g[x](),v!==!0);x--)if(v instanceof Promise)return this._parseStack.handlerPos=x,v}this._parseStack.handlers=[];break;case 6:if(S=a[this._parseStack.chunkPos],v=this._dcsParser.unhook(S!==24&&S!==26,l),v)return v;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=a[this._parseStack.chunkPos],v=this._oscParser.end(S!==24&&S!==26,l),v)return v;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=E;g<i;++g){switch(S=a[g],w=this._transitions.table[this.currentState<<8|(S<160?S:m)],w>>4){case 2:for(let M=g+1;;++M){if(M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}if(++M>=i||(S=a[M])<32||S>126&&S<m){this._printHandler(a,g,M),g=M-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|S];let T=x?x.length-1:-1;for(;T>=0&&(v=x[T](this._params),v!==!0);T--)if(v instanceof Promise)return this._preserveStack(3,x,T,w,g),v;T<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++g<i&&(S=a[g])>47&&S<60);g--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const A=this._escHandlers[this._collect<<8|S];let I=A?A.length-1:-1;for(;I>=0&&(v=A[I](),v!==!0);I--)if(v instanceof Promise)return this._preserveStack(4,A,I,w,g),v;I<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let M=g+1;;++M)if(M>=i||(S=a[M])===24||S===26||S===27||S>127&&S<m){this._dcsParser.put(a,g,M),g=M-1;break}break;case 14:if(v=this._dcsParser.unhook(S!==24&&S!==26),v)return this._preserveStack(6,[],0,w,g),v;S===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let M=g+1;;M++)if(M>=i||(S=a[M])<32||S>127&&S<m){this._oscParser.put(a,g,M),g=M-1;break}break;case 6:if(v=this._oscParser.end(S!==24&&S!==26),v)return this._preserveStack(5,[],0,w,g),v;S===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}o.EscapeSequenceParser=_},6242:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),f=c(482),u=[];o.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(d,p){this._handlers[d]===void 0&&(this._handlers[d]=[]);const m=this._handlers[d];return m.push(p),{dispose:()=>{const _=m.indexOf(p);_!==-1&&m.splice(_,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=u}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=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,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,p,m){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(d,p,m);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(d,p,m))}start(){this.reset(),this._state=1}put(d,p,m){if(this._state!==3){if(this._state===1)for(;p<m;){const _=d[p++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&m-p>0&&this._put(d,p,m)}}end(d,p=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let m=!1,_=this._active.length-1,s=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,m=p,s=this._stack.fallThrough,this._stack.paused=!1),!s&&m===!1){for(;_>=0&&(m=this._active[_].end(d),m!==!0);_--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,m;_--}for(;_>=0;_--)if(m=this._active[_].end(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,m}else this._handlerFb(this._id,"END",d);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(d){this._handler=d,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(d,p,m){this._hitLimit||(this._data+=(0,f.utf32ToString)(d,p,m),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(d){let p=!1;if(this._hitLimit)p=!1;else if(d&&(p=this._handler(this._data),p instanceof Promise))return p.then((m=>(this._data="",this._hitLimit=!1,m)));return this._data="",this._hitLimit=!1,p}}},8742:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const d=new h;if(!u.length)return d;for(let p=Array.isArray(u[0])?1:0;p<u.length;++p){const m=u[p];if(Array.isArray(m))for(let _=0;_<m.length;++_)d.addSubParam(m[_]);else d.addParam(m)}return d}constructor(u=32,d=32){if(this.maxLength=u,this.maxSubParamsLength=d,d>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(d),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let d=0;d<this.length;++d){u.push(this.params[d]);const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];m-p>0&&u.push(Array.prototype.slice.call(this._subParams,p,m))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const d=this._subParamsIdx[u]>>8,p=255&this._subParamsIdx[u];return p-d>0?this._subParams.subarray(d,p):null}getSubParamsAll(){const u={};for(let d=0;d<this.length;++d){const p=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];m-p>0&&(u[d]=this._subParams.slice(p,m))}return u}addDigit(u){let d;if(this._rejectDigits||!(d=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const p=this._digitIsSub?this._subParams:this.params,m=p[d-1];p[d-1]=~m?Math.min(10*m+u,c):u}}o.Params=h},5741:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const f={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(f),h.dispose=()=>this._wrappedAddonDispose(f),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===c){h=f;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),f=c(511);o.BufferApiView=class{constructor(u,d){this._buffer=u,this.type=d}init(u){return this._buffer=u,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(u){const d=this._buffer.lines.get(u);if(d)return new h.BufferLineApiView(d)}getNullCell(){return new f.CellData}}},3785:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new h.CellData)}translateToString(f,u,d){return this._line.translateToString(f,u,d)}}},8285:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),f=c(8460),u=c(844);class d extends u.Disposable{constructor(m){super(),this._core=m,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}o.BufferNamespaceApi=d},7975:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(f=>h(f.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((f,u)=>h(f,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(y,o,c){var h=this&&this.__decorate||function(s,a,i,l){var v,S=arguments.length,w=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,i):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(s,a,i,l);else for(var E=s.length-1;E>=0;E--)(v=s[E])&&(w=(S<3?v(w):S>3?v(a,i,w):v(a,i))||w);return S>3&&w&&Object.defineProperty(a,i,w),w},f=this&&this.__param||function(s,a){return function(i,l){a(i,l,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),d=c(844),p=c(5295),m=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let _=o.BufferService=class extends d.Disposable{get buffer(){return this.buffers.active}constructor(s){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(s.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(s.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new p.BufferSet(s,this))}resize(s,a){this.cols=s,this.rows=a,this.buffers.resize(s,a),this._onResize.fire({cols:s,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(s,a=!1){const i=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===s.fg&&l.getBg(0)===s.bg||(l=i.getBlankLine(s,a),this._cachedBlankLine=l),l.isWrapped=a;const v=i.ybase+i.scrollTop,S=i.ybase+i.scrollBottom;if(i.scrollTop===0){const w=i.lines.isFull;S===i.lines.length-1?w?i.lines.recycle().copyFrom(l):i.lines.push(l.clone()):i.lines.splice(S+1,0,l.clone()),w?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const w=S-v+1;i.lines.shiftElements(v+1,w-1,-1),i.lines.set(S,l.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(s,a,i){const l=this.buffer;if(s<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else s+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const v=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+s,l.ybase),0),v!==l.ydisp&&(a||this._onScroll.fire(l.ydisp))}};o.BufferService=_=h([f(0,m.IOptionsService)],_)},7994:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(y,o,c){var h=this&&this.__decorate||function(l,v,S,w){var E,g=arguments.length,x=g<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(l,v,S,w);else for(var T=l.length-1;T>=0;T--)(E=l[T])&&(x=(g<3?E(x):g>3?E(v,S,x):E(v,S))||x);return g>3&&x&&Object.defineProperty(v,S,x),x},f=this&&this.__param||function(l,v){return function(S,w){v(S,w,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),d=c(8460),p=c(844),m={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function _(l,v){let S=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(S|=64,S|=l.action):(S|=3&l.button,4&l.button&&(S|=64),8&l.button&&(S|=128),l.action===32?S|=32:l.action!==0||v||(S|=3)),S}const s=String.fromCharCode,a={DEFAULT:l=>{const v=[_(l,!1)+32,l.col+32,l.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${s(v[0])}${s(v[1])}${s(v[2])}`},SGR:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.col};${l.row}${v}`},SGR_PIXELS:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.x};${l.y}${v}`}};let i=o.CoreMouseService=class extends p.Disposable{constructor(l,v){super(),this._bufferService=l,this._coreService=v,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 S of Object.keys(m))this.addProtocol(S,m[S]);for(const S of Object.keys(a))this.addEncoding(S,a[S]);this.reset()}addProtocol(l,v){this._protocols[l]=v}addEncoding(l,v){this._encodings[l]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const v=this._encodings[this._activeEncoding](l);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,v,S){if(S){if(l.x!==v.x||l.y!==v.y)return!1}else if(l.col!==v.col||l.row!==v.row)return!1;return l.button===v.button&&l.action===v.action&&l.ctrl===v.ctrl&&l.alt===v.alt&&l.shift===v.shift}};o.CoreMouseService=i=h([f(0,u.IBufferService),f(1,u.ICoreService)],i)},6975:function(y,o,c){var h=this&&this.__decorate||function(i,l,v,S){var w,E=arguments.length,g=E<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,l,v,S);else for(var x=i.length-1;x>=0;x--)(w=i[x])&&(g=(E<3?w(g):E>3?w(l,v,g):w(l,v))||g);return E>3&&g&&Object.defineProperty(l,v,g),g},f=this&&this.__param||function(i,l){return function(v,S){l(v,S,i)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),d=c(8460),p=c(844),m=c(2585),_=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=o.CoreService=class extends p.Disposable{constructor(i,l,v){super(),this._bufferService=i,this._logService=l,this._optionsService=v,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,u.clone)(_),this.decPrivateModes=(0,u.clone)(s)}reset(){this.modes=(0,u.clone)(_),this.decPrivateModes=(0,u.clone)(s)}triggerDataEvent(i,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${i}"`,(()=>i.split("").map((S=>S.charCodeAt(0))))),this._onData.fire(i)}triggerBinaryEvent(i){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${i}"`,(()=>i.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(i))}};o.CoreService=a=h([f(0,m.IBufferService),f(1,m.ILogService),f(2,m.IOptionsService)],a)},9074:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),f=c(8460),u=c(844),d=c(6106);let p=0,m=0;class _ extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new d.SortedList((i=>i==null?void 0:i.marker.line)),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(i){if(i.marker.isDisposed)return;const l=new s(i);if(l){const v=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),v.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const i of this._decorations.values())i.dispose();this._decorations.clear()}*getDecorationsAtCell(i,l,v){let S=0,w=0;for(const E of this._decorations.getKeyIterator(l))S=E.options.x??0,w=S+(E.options.width??1),i>=S&&i<w&&(!v||(E.options.layer??"bottom")===v)&&(yield E)}forEachDecorationAtCell(i,l,v,S){this._decorations.forEachByKey(l,(w=>{p=w.options.x??0,m=p+(w.options.width??1),i>=p&&i<m&&(!v||(w.options.layer??"bottom")===v)&&S(w)}))}}o.DecorationService=_;class s extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(i){super(),this.options=i,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=i.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),f=c(8343);class u{constructor(...p){this._entries=new Map;for(const[m,_]of p)this.set(m,_)}set(p,m){const _=this._entries.get(p);return this._entries.set(p,m),_}forEach(p){for(const[m,_]of this._entries.entries())p(m,_)}has(p){return this._entries.has(p)}get(p){return this._entries.get(p)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(d,p){this._services.set(d,p)}getService(d){return this._services.get(d)}createInstance(d,...p){const m=(0,f.getServiceDependencies)(d).sort(((a,i)=>a.index-i.index)),_=[];for(const a of m){const i=this._services.get(a.id);if(!i)throw new Error(`[createInstance] ${d.name} depends on UNKNOWN service ${a.id}.`);_.push(i)}const s=m.length>0?m[0].index:p.length;if(p.length!==s)throw new Error(`[createInstance] First service dependency of ${d.name} at position ${s+1} conflicts with ${p.length} static arguments`);return new d(...p,..._)}}},7866:function(y,o,c){var h=this&&this.__decorate||function(s,a,i,l){var v,S=arguments.length,w=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,i):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(s,a,i,l);else for(var E=s.length-1;E>=0;E--)(v=s[E])&&(w=(S<3?v(w):S>3?v(a,i,w):v(a,i))||w);return S>3&&w&&Object.defineProperty(a,i,w),w},f=this&&this.__param||function(s,a){return function(i,l){a(i,l,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),d=c(2585),p={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 m,_=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(s){super(),this._optionsService=s,this._logLevel=d.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),m=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(s){for(let a=0;a<s.length;a++)typeof s[a]=="function"&&(s[a]=s[a]())}_log(s,a,i){this._evalLazyOptionalParams(i),s.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...i)}trace(s,...a){var i;this._logLevel<=d.LogLevelEnum.TRACE&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,s,a)}debug(s,...a){var i;this._logLevel<=d.LogLevelEnum.DEBUG&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,s,a)}info(s,...a){var i;this._logLevel<=d.LogLevelEnum.INFO&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,s,a)}warn(s,...a){var i;this._logLevel<=d.LogLevelEnum.WARN&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,s,a)}error(s,...a){var i;this._logLevel<=d.LogLevelEnum.ERROR&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,s,a)}};o.LogService=_=h([f(0,d.IOptionsService)],_),o.setTraceLogger=function(s){m=s},o.traceCall=function(s,a,i){if(typeof i.value!="function")throw new Error("not supported");const l=i.value;i.value=function(...v){if(m.logLevel!==d.LogLevelEnum.TRACE)return l.apply(this,v);m.trace(`GlyphRenderer#${l.name}(${v.map((w=>JSON.stringify(w))).join(", ")})`);const S=l.apply(this,v);return m.trace(`GlyphRenderer#${l.name} return`,S),S}}},7302:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),f=c(844),u=c(6114);o.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:u.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 p extends f.Disposable{constructor(_){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const s={...o.DEFAULT_OPTIONS};for(const a in _)if(a in s)try{const i=_[a];s[a]=this._sanitizeAndValidateOption(a,i)}catch(i){console.error(i)}this.rawOptions=s,this.options={...s},this._setupOptions(),this.register((0,f.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(_,s){return this.onOptionChange((a=>{a===_&&s(this.rawOptions[_])}))}onMultipleOptionChange(_,s){return this.onOptionChange((a=>{_.indexOf(a)!==-1&&s()}))}_setupOptions(){const _=a=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},s=(a,i)=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);i=this._sanitizeAndValidateOption(a,i),this.rawOptions[a]!==i&&(this.rawOptions[a]=i,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const i={get:_.bind(this,a),set:s.bind(this,a)};Object.defineProperty(this.options,a,i)}}_sanitizeAndValidateOption(_,s){switch(_){case"cursorStyle":if(s||(s=o.DEFAULT_OPTIONS[_]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(s))throw new Error(`"${s}" is not a valid value for ${_}`);break;case"wordSeparator":s||(s=o.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof s=="number"&&1<=s&&s<=1e3)break;s=d.includes(s)?s:o.DEFAULT_OPTIONS[_];break;case"cursorWidth":s=Math.floor(s);case"lineHeight":case"tabStopWidth":if(s<1)throw new Error(`${_} cannot be less than 1, value: ${s}`);break;case"minimumContrastRatio":s=Math.max(1,Math.min(21,Math.round(10*s)/10));break;case"scrollback":if((s=Math.min(s,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${s}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(s<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${s}`);break;case"rows":case"cols":if(!s&&s!==0)throw new Error(`${_} must be numeric, value: ${s}`);break;case"windowsPty":s=s??{}}return s}}o.OptionsService=p},2660:function(y,o,c){var h=this&&this.__decorate||function(p,m,_,s){var a,i=arguments.length,l=i<3?m:s===null?s=Object.getOwnPropertyDescriptor(m,_):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(p,m,_,s);else for(var v=p.length-1;v>=0;v--)(a=p[v])&&(l=(i<3?a(l):i>3?a(m,_,l):a(m,_))||l);return i>3&&l&&Object.defineProperty(m,_,l),l},f=this&&this.__param||function(p,m){return function(_,s){m(_,s,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let d=o.OscLinkService=class{constructor(p){this._bufferService=p,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(p){const m=this._bufferService.buffer;if(p.id===void 0){const v=m.addMarker(m.ybase+m.y),S={data:p,id:this._nextId++,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(S,v))),this._dataByLinkId.set(S.id,S),S.id}const _=p,s=this._getEntryIdKey(_),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,m.ybase+m.y),a.id;const i=m.addMarker(m.ybase+m.y),l={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(l,i))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(p,m){const _=this._dataByLinkId.get(p);if(_&&_.lines.every((s=>s.line!==m))){const s=this._bufferService.buffer.addMarker(m);_.lines.push(s),s.onDispose((()=>this._removeMarkerFromLink(_,s)))}}getLinkData(p){var m;return(m=this._dataByLinkId.get(p))==null?void 0:m.data}_getEntryIdKey(p){return`${p.id};;${p.uri}`}_removeMarkerFromLink(p,m){const _=p.lines.indexOf(m);_!==-1&&(p.lines.splice(_,1),p.lines.length===0&&(p.data.id!==void 0&&this._entriesWithId.delete(p.key),this._dataByLinkId.delete(p.id)))}};o.OscLinkService=d=h([f(0,u.IBufferService)],d)},8343:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(f){return f[h]||[]},o.createDecorator=function(f){if(o.serviceRegistry.has(f))return o.serviceRegistry.get(f);const u=function(d,p,m){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,s,a){s[c]===s?s[h].push({id:_,index:a}):(s[h]=[{id:_,index:a}],s[c]=s)})(u,d,m)};return u.toString=()=>f,o.serviceRegistry.set(f,u),u}},2585:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var f;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(f||(o.LogLevelEnum=f={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),f=c(225);class u{static extractShouldJoin(p){return(1&p)!=0}static extractWidth(p){return p>>1&3}static extractCharKind(p){return p>>3}static createPropertyValue(p,m,_=!1){return(16777215&p)<<3|(3&m)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const p=new f.UnicodeV6;this.register(p),this._active=p.version,this._activeProvider=p}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(p){if(!this._providers[p])throw new Error(`unknown Unicode version "${p}"`);this._active=p,this._activeProvider=this._providers[p],this._onChange.fire(p)}register(p){this._providers[p.version]=p}wcwidth(p){return this._activeProvider.wcwidth(p)}getStringCellWidth(p){let m=0,_=0;const s=p.length;for(let a=0;a<s;++a){let i=p.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=s)return m+this.wcwidth(i);const S=p.charCodeAt(a);56320<=S&&S<=57343?i=1024*(i-55296)+S-56320+65536:m+=this.wcwidth(S)}const l=this.charProperties(i,_);let v=u.extractWidth(l);u.extractShouldJoin(l)&&(v-=u.extractWidth(_)),m+=v,_=l}return m}charProperties(p,m){return this._activeProvider.charProperties(p,m)}}o.UnicodeService=u}},t={};function b(y){var o=t[y];if(o!==void 0)return o.exports;var c=t[y]={exports:{}};return n[y].call(c.exports,c,c.exports,b),c.exports}var k={};return(()=>{var y=k;Object.defineProperty(y,"__esModule",{value:!0}),y.Terminal=void 0;const o=b(9042),c=b(3236),h=b(844),f=b(5741),u=b(8285),d=b(7975),p=b(7090),m=["cols","rows"];class _ extends h.Disposable{constructor(a){super(),this._core=this.register(new c.Terminal(a)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const i=v=>this._core.options[v],l=(v,S)=>{this._checkReadonlyOptions(v),this._core.options[v]=S};for(const v in this._core.options){const S={get:i.bind(this,v),set:l.bind(this,v)};Object.defineProperty(this._publicOptions,v,S)}}_checkReadonlyOptions(a){if(m.includes(a))throw new Error(`Option "${a}" 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 p.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 u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let i="none";switch(this._core.coreMouseService.activeProtocol){case"X10":i="x10";break;case"VT200":i="vt200";break;case"DRAG":i="drag";break;case"ANY":i="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:i,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const i in a)this._publicOptions[i]=a[i]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,i=!0){this._core.input(a,i)}resize(a,i){this._verifyIntegers(a,i),this._core.resize(a,i)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,i,l){this._verifyIntegers(a,i,l),this._core.select(a,i,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,i){this._verifyIntegers(a,i),this._core.selectLines(a,i)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,i){this._core.write(a,i)}writeln(a,i){this._core.write(a),this._core.write(`\r
|
|
10
|
+
`,i)}paste(a){this._core.paste(a)}refresh(a,i){this._verifyIntegers(a,i),this._core.refresh(a,i)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return o}_verifyIntegers(...a){for(const i of a)if(i===1/0||isNaN(i)||i%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const i of a)if(i&&(i===1/0||isNaN(i)||i%1!=0||i<0))throw new Error("This API only accepts positive integers")}}y.Terminal=_})(),k})()))})(Is)),Is.exports}var Jh=Yh(),Hs={exports:{}},io;function Zh(){return io||(io=1,(function(r,e){(function(n,t){r.exports=t()})(self,(()=>(()=>{var n={};return(()=>{var t=n;Object.defineProperty(t,"__esModule",{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(b){this._terminal=b}dispose(){}fit(){const b=this.proposeDimensions();if(!b||!this._terminal||isNaN(b.cols)||isNaN(b.rows))return;const k=this._terminal._core;this._terminal.rows===b.rows&&this._terminal.cols===b.cols||(k._renderService.clear(),this._terminal.resize(b.cols,b.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const b=this._terminal._core,k=b._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const y=this._terminal.options.scrollback===0?0:b.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),f=window.getComputedStyle(this._terminal.element),u=c-(parseInt(f.getPropertyValue("padding-top"))+parseInt(f.getPropertyValue("padding-bottom"))),d=h-(parseInt(f.getPropertyValue("padding-right"))+parseInt(f.getPropertyValue("padding-left")))-y;return{cols:Math.max(2,Math.floor(d/k.css.cell.width)),rows:Math.max(1,Math.floor(u/k.css.cell.height))}}}})(),n})()))})(Hs)),Hs.exports}var Qh=Zh(),Ns={exports:{}},so;function eu(){return so||(so=1,(function(r,e){(function(n,t){r.exports=t()})(self,(()=>(()=>{var n={6:(y,o)=>{function c(f){try{const u=new URL(f),d=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return f.toLocaleLowerCase().startsWith(d.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(f,u,d,p={}){this._terminal=f,this._regex=u,this._handler=d,this._options=p}provideLinks(f,u){const d=h.computeLink(f,this._regex,this._terminal,this._handler);u(this._addCallbacks(d))}_addCallbacks(f){return f.map((u=>(u.leave=this._options.leave,u.hover=(d,p)=>{if(this._options.hover){const{range:m}=u;this._options.hover(d,p,m)}},u)))}};class h{static computeLink(u,d,p,m){const _=new RegExp(d.source,(d.flags||"")+"g"),[s,a]=h._getWindowedLineStrings(u-1,p),i=s.join("");let l;const v=[];for(;l=_.exec(i);){const S=l[0];if(!c(S))continue;const[w,E]=h._mapStrIdx(p,a,0,l.index),[g,x]=h._mapStrIdx(p,w,E,S.length);if(w===-1||E===-1||g===-1||x===-1)continue;const T={start:{x:E+1,y:w+1},end:{x,y:g+1}};v.push({range:T,text:S,activate:m})}return v}static _getWindowedLineStrings(u,d){let p,m=u,_=u,s=0,a="";const i=[];if(p=d.buffer.active.getLine(u)){const l=p.translateToString(!0);if(p.isWrapped&&l[0]!==" "){for(s=0;(p=d.buffer.active.getLine(--m))&&s<2048&&(a=p.translateToString(!0),s+=a.length,i.push(a),p.isWrapped&&a.indexOf(" ")===-1););i.reverse()}for(i.push(l),s=0;(p=d.buffer.active.getLine(++_))&&p.isWrapped&&s<2048&&(a=p.translateToString(!0),s+=a.length,i.push(a),a.indexOf(" ")===-1););}return[i,m]}static _mapStrIdx(u,d,p,m){const _=u.buffer.active,s=_.getNullCell();let a=p;for(;m;){const i=_.getLine(d);if(!i)return[-1,-1];for(let l=a;l<i.length;++l){i.getCell(l,s);const v=s.getChars();if(s.getWidth()&&(m-=v.length||1,l===i.length-1&&v==="")){const S=_.getLine(d+1);S&&S.isWrapped&&(S.getCell(0,s),s.getWidth()===2&&(m+=1))}if(m<0)return[d,l]}d++,a=0}return[d,a]}}o.LinkComputer=h}},t={};function b(y){var o=t[y];if(o!==void 0)return o.exports;var c=t[y]={exports:{}};return n[y](c,c.exports,b),c.exports}var k={};return(()=>{var y=k;Object.defineProperty(y,"__esModule",{value:!0}),y.WebLinksAddon=void 0;const o=b(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(f,u){const d=window.open();if(d){try{d.opener=null}catch{}d.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}y.WebLinksAddon=class{constructor(f=h,u={}){this._handler=f,this._options=u}activate(f){this._terminal=f;const u=this._options,d=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,d,this._handler,u))}dispose(){var f;(f=this._linkProvider)==null||f.dispose()}}})(),k})()))})(Ns)),Ns.exports}var tu=eu();async function Et(r,e){const n=await fetch(`/api/${r}`,{headers:{"Content-Type":"application/json"},...e}),t=await n.json();if(!n.ok)throw new Error(t.error||`HTTP ${n.status}`);return t}function ru(){return Et("config")}function iu(r){switch(r){case"creating":case"running":case"starting":return"working";case"idle":return"waiting";case"stopped":return"done";case"error":return"error";default:return"idle"}}function su(r){return{...r,ciChecks:r.ciChecks.map(e=>({...e})),comments:r.comments.map(e=>({...e}))}}function nu(r){var e;return{branch:r.branch,agent:iu(r.status),mux:r.mux?"✓":"",path:r.path,dir:r.dir,dirty:r.dirty,status:r.status,elapsed:r.elapsed,profile:r.profile,agentName:r.agentName,services:r.services.map(n=>({...n})),paneCount:r.paneCount,prs:r.prs.map(n=>su(n)),linearIssue:r.linearIssue,creating:r.creation!==null,creationPhase:((e=r.creation)==null?void 0:e.phase)??null}}async function ou(){return(await Et("project")).worktrees.map(e=>nu(e))}async function au(){return(await Et("branches")).branches}function lu(r,e,n,t,b,k){return Et("worktrees",{method:"POST",body:JSON.stringify({mode:r,...e?{branch:e}:{},profile:n,agent:t,...b?{prompt:b}:{},...k&&Object.keys(k).length>0?{envOverrides:k}:{}})})}function cu(r){return Et(`worktrees/${encodeURIComponent(r)}`,{method:"DELETE"})}function hu(r){return Et(`worktrees/${encodeURIComponent(r)}/open`,{method:"POST"})}function uu(r){return Et(`worktrees/${encodeURIComponent(r)}/close`,{method:"POST"})}function du(r){return Et(`worktrees/${encodeURIComponent(r)}/merge`,{method:"POST"})}function fu(){return Et("linear/issues")}async function _u(r){return(await Et(`ci-logs/${r}`)).logs}async function Ta(r,e,n){await Et(`worktrees/${encodeURIComponent(r)}/send`,{method:"POST",body:JSON.stringify({text:e,...n?{preamble:n}:{}})})}function vu(r,e,n){const t=new EventSource("/api/notifications/stream");return t.addEventListener("initial",b=>{try{const k=JSON.parse(b.data);n==null||n(k)}catch{}}),t.addEventListener("notification",b=>{try{const k=JSON.parse(b.data);r(k)}catch{}}),t.addEventListener("dismiss",b=>{try{const{id:k}=JSON.parse(b.data);e(k)}catch{}}),()=>t.close()}async function pu(r){await Et(`notifications/${r}/dismiss`,{method:"POST"})}async function gu(r,e){const n=new FormData;for(const k of e)n.append("files",k);const t=await fetch(`/api/worktrees/${encodeURIComponent(r)}/upload`,{method:"POST",body:n}),b=await t.json();if(!t.ok)throw new Error(b.error||`HTTP ${t.status}`);return b}function mu(r){return Et(`worktrees/${encodeURIComponent(r)}/diff`)}var bu=Q('<div class="absolute inset-0 z-10 flex items-center justify-center bg-black/50 border-2 border-dashed border-[var(--color-accent)] rounded pointer-events-none"><span class="text-white text-sm font-medium">Drop image(s) to upload</span></div>'),Su=Q('<div class="flex-1 min-h-0 w-full p-1 overflow-hidden relative"><!></div>');function wu(r,e){Ke(e,!0);let n=Le(e,"isMobile",3,!1);const t=`\r
|
|
11
|
+
\x1B[90m[Disconnected]\x1B[0m`,b=`\r
|
|
12
|
+
\x1B[32m[Reconnected]\x1B[0m`;let k,y,o,c=null,h,f,u=null,d=null,p=null,m=0,_=0,s=!1,a=!1,i=!0,l=le(!1),v=0;function S(P){var G;if((G=navigator.clipboard)!=null&&G.writeText){navigator.clipboard.writeText(P).catch(()=>{});return}const H=document.createElement("textarea");H.value=P,H.style.position="fixed",H.style.opacity="0",document.body.appendChild(H),H.select(),document.execCommand("copy"),document.body.removeChild(H)}function w(P){(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"selectPane",pane:P}))}function E(P){(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"input",data:P}))}function g(){s=!1}function x(){return n()&&!!d&&y.modes.mouseTrackingMode!=="none"}function T(P){if(!x())return;const H=P.touches[0];H&&(m=H.pageX,_=H.pageY,s=!1)}function A(P){const H=P.touches[0];if(!x()||!d||!H)return;const G=m-H.pageX,Z=_-H.pageY;if(m=H.pageX,_=H.pageY,!s){if(Math.abs(Z)<=Math.abs(G))return;s=!0}if(Z===0)return;if(!(d.scrollHeight>d.clientHeight)){I(Z,H),P.preventDefault();return}d.scrollTop+=Z,P.preventDefault()}function I(P,H){if(!u)return;const G=new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:H.clientX,clientY:H.clientY,deltaMode:WheelEvent.DOM_DELTA_PIXEL,deltaY:P});u.dispatchEvent(G)}function M(){const P=k.querySelector(".xterm"),H=k.querySelector(".xterm-viewport");!(P instanceof HTMLElement)||!(H instanceof HTMLElement)||(u=P,d=H,P.addEventListener("touchstart",T,{passive:!0}),P.addEventListener("touchmove",A,{passive:!1}),P.addEventListener("touchend",g),P.addEventListener("touchcancel",g),p=()=>{P.removeEventListener("touchstart",T),P.removeEventListener("touchmove",A),P.removeEventListener("touchend",g),P.removeEventListener("touchcancel",g),u=null,d=null})}function N(P){return P?P.types.includes("Files")||P.types.includes("text/uri-list"):!1}function U(P){N(P.dataTransfer)&&(P.preventDefault(),v++,j(l,!0))}function X(P){C(l)&&(P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="copy"))}function J(P){v--,v<=0&&(v=0,j(l,!1))}function Y(P){const H=P.match(/<img[^>]+src=["']([^"']+)["']/i);return H?H[1]:null}async function D(P){var Z,oe,ue;P.preventDefault(),P.stopPropagation(),v=0,j(l,!1);const H=P.dataTransfer;if(!H)return;let G=Array.from(H.files).filter(de=>de.type.startsWith("image/"));if(G.length===0){const de=H.getData("text/html"),ye=H.getData("text/uri-list"),re=(de?Y(de):null)??ye;if(re)try{const ge=re.match(/^data:(image\/[^;]+);base64,(.+)/);if(ge){const ke=atob(ge[2]),Je=new Uint8Array(ke.length);for(let Ae=0;Ae<ke.length;Ae++)Je[Ae]=ke.charCodeAt(Ae);const Ce=((Z=ge[1].split("/")[1])==null?void 0:Z.replace("+xml",""))||"png";G=[new File([Je],`image.${Ce}`,{type:ge[1]})]}else if(/^https?:\/\//i.test(re)){const ke=await fetch(re),Je=ke.headers.get("content-type")??"",Ce=parseInt(ke.headers.get("content-length")??"0",10);if(ke.ok&&Je.startsWith("image/")&&Ce<=10*1024*1024){const Ae=await ke.blob(),Ie=((ue=(oe=re.split("/").pop())==null?void 0:oe.split("?")[0])==null?void 0:ue.split("#")[0])||"image.png";G=[new File([Ae],Ie,{type:Ae.type})]}}}catch{}}G.length!==0&&await B(G)}async function B(P){try{const G=(await gu(e.worktree,P)).files.map(Z=>Z.path).join(" ");E(G)}catch(H){const G=H instanceof Error?H.message:String(H);y.writeln(`\r
|
|
13
|
+
\x1B[31m[Upload error: ${G}]\x1B[0m`)}}function R(P){const H=P.clipboardData;if(!H)return;const G=[];for(const Z of H.items)if(Z.kind==="file"&&Z.type.startsWith("image/")){const oe=Z.getAsFile();oe&&G.push(oe)}G.length!==0&&(P.preventDefault(),P.stopPropagation(),B(G))}function O(){const P={type:"resize",cols:y.cols,rows:y.rows,...n()&&e.initialPane!==void 0?{initialPane:e.initialPane}:{}};return JSON.stringify(P)}function W(P=!1){if(a||(c==null?void 0:c.readyState)===WebSocket.OPEN||(c==null?void 0:c.readyState)===WebSocket.CONNECTING)return;const H=location.protocol==="https:"?"wss:":"ws:",G=new WebSocket(`${H}//${location.host}/ws/${encodeURIComponent(e.worktree)}`);c=G,G.onmessage=Z=>{const oe=Z.data,ue=oe[0];if(ue==="o"||ue==="s"){y.write(oe.slice(1));return}try{const de=JSON.parse(oe);switch(de.type){case"exit":y.writeln(`\r
|
|
14
|
+
\x1B[33m[Process exited with code ${de.exitCode}]\x1B[0m`);break;case"error":y.writeln(`\r
|
|
15
|
+
\x1B[31m[Error: ${de.message}]\x1B[0m`);break}}catch{}},G.onerror=()=>{},G.onopen=()=>{c===G&&(i=!0,o.fit(),P&&y.writeln(b),requestAnimationFrame(()=>{o.fit(),y.focus()}),G.send(O()))},G.onclose=()=>{c===G&&(c=null,!a&&(y.writeln(t),!document.hidden&&i&&(i=!1,W(!0))))}}function ee(){document.hidden||W(!0)}En(()=>{y=new Jh.Terminal({cursorBlink:!0,theme:e.terminalTheme,fontFamily:"'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, monospace",fontSize:n()?13:11,scrollback:1e4}),o=new Qh.FitAddon,y.loadAddon(o),y.loadAddon(new tu.WebLinksAddon),y.open(k),M(),k.addEventListener("contextmenu",P=>P.preventDefault()),k.addEventListener("paste",R,!0),y.parser.registerOscHandler(52,P=>{const H=P.indexOf(";");if(H!==-1){const G=P.slice(H+1);try{S(atob(G))}catch{}}return!0}),y.onSelectionChange(()=>{const P=y.getSelection();P&&S(P)}),y.attachCustomKeyEventHandler(P=>{if(P.key==="Enter"&&P.shiftKey&&!P.ctrlKey&&!P.metaKey&&!P.altKey)return P.type==="keydown"&&(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"sendKeys",hexBytes:["1b","5b","31","33","3b","32","75"]})),!1;if(P.type!=="keydown")return!0;const H=P.metaKey||P.ctrlKey;return H&&(P.key==="c"||P.key==="C")?y.hasSelection()?(S(y.getSelection()),y.clearSelection(),!1):!0:!(H&&(P.key==="ArrowUp"||P.key==="ArrowDown")||H&&(P.key==="k"||P.key==="K")||H&&(P.key==="m"||P.key==="M")||H&&(P.key==="d"||P.key==="D"))}),requestAnimationFrame(()=>{o.fit(),y.focus()}),W(),y.onData(P=>{(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"input",data:P}))}),h=new ResizeObserver(()=>{clearTimeout(f),f=setTimeout(()=>{o.fit(),(c==null?void 0:c.readyState)===WebSocket.OPEN&&c.send(JSON.stringify({type:"resize",cols:y.cols,rows:y.rows}))},150)}),h.observe(k),document.addEventListener("visibilitychange",ee),window.addEventListener("focus",ee),window.addEventListener("online",ee)}),Rt(()=>{e.terminalTheme&&y&&(y.options.theme=e.terminalTheme)}),Tc(()=>{a=!0,clearTimeout(f),p==null||p(),h==null||h.disconnect(),k==null||k.removeEventListener("paste",R,!0),document.removeEventListener("visibilitychange",ee),window.removeEventListener("focus",ee),window.removeEventListener("online",ee),c==null||c.close(),y==null||y.dispose()});var ce={sendSelectPane:w,sendInput:E},ie=Su(),F=$(ie);{var L=P=>{var H=bu();K(P,H)};se(F,P=>{C(l)&&P(L)})}return Di(ie,P=>k=P,()=>k),cr("dragenter",ie,U),cr("dragover",ie,X),cr("dragleave",ie,J),cr("drop",ie,D),K(r,ie),qe(ce)}var Cu=Q("<dialog><!></dialog>");function zr(r,e){Ke(e,!0);let n=Le(e,"wide",3,!1),t=Le(e,"maxWidth",3,""),b=Le(e,"className",3,""),k;Rt(()=>{k==null||k.showModal()});var y=Cu();let o;var c=$(y);xn(c,()=>e.children),Di(y,h=>k=h,()=>k),ae(()=>{He(y,1,`bg-sidebar text-primary border border-edge rounded-xl p-6 w-[90%] ${t()?"":n()?"max-w-[560px]":"max-w-[380px]"} ${b()??""}`),o=Ur(y,"",o,{"max-width":t()||void 0})}),cr("close",y,function(...h){var f;(f=e.onclose)==null||f.apply(this,h)}),K(r,y),qe()}var yu=Q('<p class="text-[12px] text-danger mb-4 -mt-2 whitespace-pre-wrap"> </p>'),xu=Q('<span class="spinner"></span>'),Eu=Q("<!> ",1),ku=Q('<form><h2 class="text-base mb-4">Confirm</h2> <p class="text-[13px] text-muted mb-6"> </p> <!> <div class="flex justify-end gap-2"><!> <!></div></form>');function no(r,e){Ke(e,!0);let n=Le(e,"loading",3,!1),t=Le(e,"error",3,""),b=Le(e,"confirmLabel",3,"Remove"),k=Le(e,"variant",3,"danger");zr(r,{get onclose(){return e.oncancel},children:(y,o)=>{var c=ku(),h=V($(c),2),f=$(h),u=V(h,2);{var d=s=>{var a=yu(),i=$(a);ae(()=>ne(i,t())),K(s,a)};se(u,s=>{t()&&s(d)})}var p=V(u,2),m=$(p);nt(m,{type:"button",get onclick(){return e.oncancel},get disabled(){return n()},children:(s,a)=>{var i=ze("Cancel");K(s,i)},$$slots:{default:!0}});var _=V(m,2);{let s=he(()=>k()==="accent"?"cta":"danger");nt(_,{type:"submit",get variant(){return C(s)},class:"flex items-center gap-1.5",get disabled(){return n()},autofocus:!0,children:(a,i)=>{var l=Eu(),v=Pe(l);{var S=E=>{var g=xu();K(E,g)};se(v,E=>{n()&&E(S)})}var w=V(v);ae(()=>ne(w,` ${b()??""}`)),K(a,l)},$$slots:{default:!0}})}ae(()=>ne(f,e.message)),cr("submit",c,s=>{s.preventDefault(),e.onconfirm()}),K(y,c)},$$slots:{default:!0}}),qe()}var Lu=Q('<div class="mb-3"><label class="flex items-center gap-2 text-xs text-muted cursor-pointer"> <input type="checkbox" class="accent-[var(--accent)]"/></label></div>'),Du=Q('<div class="mb-3"><label class="block text-xs text-muted mb-1.5"> </label> <input type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/></div>'),Tu=Q('<div class="mb-4"><p class="text-xs text-muted mb-2">Startup Environment <span class="opacity-60">(optional)</span></p> <div class="pl-3 border-l border-edge"></div></div>');function Ru(r,e){Ke(e,!0);let n=Le(e,"startupEnvs",19,()=>({})),t=Le(e,"envValues",31,()=>Me({})),b=he(()=>Object.keys(n()));var k=Pt(),y=Pe(k);{var o=c=>{var h=Tu(),f=V($(h),2);Xe(f,20,()=>C(b),u=>u,(u,d)=>{var p=Pt(),m=Pe(p);{var _=a=>{var i=Lu(),l=$(i),v=$(l),S=V(v);ae(()=>{Re(l,"for",`wt-env-${d??""}`),ne(v,`${d??""} `),Re(S,"id",`wt-env-${d??""}`),is(S,t()[d]===!0)}),Se("change",S,w=>{t(t()[d]=w.currentTarget.checked,!0)}),K(a,i)},s=a=>{var i=Du(),l=$(i),v=$(l),S=V(l,2);ae(()=>{Re(l,"for",`wt-env-${d??""}`),ne(v,d),Re(S,"id",`wt-env-${d??""}`)}),Yr(S,()=>t()[d],w=>t(t()[d]=w,!0)),K(a,i)};se(m,a=>{typeof n()[d]=="boolean"?a(_):a(s,-1)})}K(u,p)}),K(c,h)};se(y,c=>{C(b).length>0&&c(o)})}K(r,k),qe()}It(["change"]);var Au=Q('<label class="block text-xs text-muted mb-1.5" for="wt-name">Branch name <span class="opacity-60">(optional)</span></label> <input id="wt-name" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent"/> <button type="button" class="mt-2 text-[11px] text-accent hover:underline">Use existing branch</button>',1),Bu=Q('<p class="px-3 py-2 text-xs text-muted">Loading branches...</p>'),Mu=Q('<p class="px-3 py-2 text-xs text-muted"> </p>'),Ou=Q('<p class="px-3 py-2 text-xs text-muted">No matching branches</p>'),Pu=Q('<span class="text-[10px] text-accent">Selected</span>'),Iu=Q('<li><button type="button"><span class="font-mono text-primary"> </span> <!></button></li>'),Hu=Q('<div class="border-b border-edge px-3 py-2 text-[11px] text-muted"> </div> <ul class="max-h-48 overflow-y-auto py-1"></ul>',1),Nu=Q('<div class="mt-2 rounded-lg border border-edge bg-surface/60"><div class="border-b border-edge p-2"><input type="text" class="w-full rounded-md border border-edge bg-surface px-2.5 py-1.5 text-[12px] text-primary placeholder:text-muted/50 outline-none focus:border-accent" placeholder="Search branches..."/></div> <!></div>'),Fu=Q('<div><span class="block text-xs text-muted mb-1.5">Existing branch</span> <button type="button" class="flex w-full items-center justify-between gap-3 rounded-md border border-edge bg-surface px-2.5 py-1.5 text-left text-[13px] text-primary outline-none transition-colors hover:bg-hover focus:border-accent"><span> </span> <span class="text-[11px] text-muted"> </span></button> <!></div> <button type="button" class="mt-2 text-[11px] text-accent hover:underline">Create new branch instead</button> <p class="mt-2 text-[11px] text-muted">Removing this worktree will also delete the branch.</p>',1),Wu=Q('<label><input type="radio" name="agent" class="accent-[var(--accent)]"/> </label>'),Uu=Q('<label><input type="radio" name="profile" class="accent-[var(--accent)]"/> </label>'),ju=Q('<div class="flex flex-col gap-2 mb-6"></div>'),zu=Q('<form><h2 class="text-base mb-4">New Worktree</h2> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="wt-prompt">Prompt <span class="opacity-60">(optional)</span></label> <textarea id="wt-prompt" rows="4" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent resize-y" placeholder="Describe the task for the agent..."></textarea></div> <div class="mb-4"><!></div> <!> <div class="flex gap-2 mb-4"></div> <!> <label class="flex items-center gap-2 mb-4 text-[13px] text-muted cursor-pointer"><input type="checkbox" class="accent-[var(--accent)]"/> Save as default</label> <div class="flex justify-end gap-2"><!> <!></div></form>');function $u(r,e){Ke(e,!0);let n=Le(e,"profiles",19,()=>[]),t=Le(e,"defaultProfileName",3,""),b=Le(e,"autoNameEnabled",3,!1),k=Le(e,"initialBranch",3,""),y=Le(e,"initialPrompt",3,""),o=Le(e,"availableBranches",19,()=>[]),c=Le(e,"availableBranchesLoading",3,!1),h=Le(e,"availableBranchesError",3,null),f=Le(e,"startupEnvs",19,()=>({}));const u=[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}],d="wt-default-profile",p="wt-default-agent",m="wt-default-envs",_=localStorage.getItem(d),s=localStorage.getItem(p),a=localStorage.getItem(m);let i=he(()=>{var ie;return t()||((ie=n()[0])==null?void 0:ie.name)||"default"}),l=le("new"),v=le(Me(k())),S=le(Me(y())),w=le(""),E=le(""),g=le(!1),x=le(Me(s??"claude")),T=le(Me(_??""));const A=_!=null||s!=null||a!=null;let I=le(Me(A)),M=le(void 0),N=le(void 0);function U(){if(!a)return{...f()};try{const ie=JSON.parse(a),F=Object.fromEntries(Object.entries(ie).filter(([L])=>L in f()));return{...f(),...F}}catch{return{...f()}}}let X=le(Me(U()));function J(ie){ie.focus()}let Y=he(()=>C(E).trim()?o().filter(ie=>ln(C(E),ie.name)):o()),D=he(()=>C(l)==="new"||C(w).length>0);Rt(()=>{n().some(ie=>ie.name===C(T))||j(T,C(i),!0)});function B(ie){j(w,ie,!0),j(E,""),j(g,!1)}function R(){queueMicrotask(()=>{var ie;return(ie=C(N))==null?void 0:ie.focus()})}function O(){j(l,"existing"),j(g,!0),!C(w)&&k().trim().length>0&&j(w,k().trim(),!0),j(E,""),R()}function W(){j(l,"new"),j(g,!1),j(E,"")}function ee(ie){var L;const F=ie.relatedTarget;F instanceof Node&&((L=C(M))!=null&&L.contains(F))||(j(g,!1),j(E,""))}function ce(){if(j(g,!C(g)),!C(g)){j(E,"");return}R()}zr(r,{get onclose(){return e.oncancel},className:"md:max-w-[440px]",children:(ie,F)=>{var L=zu(),P=V($(L),2),H=V($(P),2);Pc(H,fe=>J==null?void 0:J(fe)),Pi(()=>Yr(H,()=>C(S),fe=>j(S,fe)));var G=V(P,2),Z=$(G);{var oe=fe=>{var _e=Au(),Te=V(Pe(_e),2),De=V(Te,2);ae(()=>Re(Te,"placeholder",b()?"generated from prompt if empty":"auto-generated if empty")),Yr(Te,()=>C(v),xe=>j(v,xe)),Se("click",De,O),K(fe,_e)},ue=fe=>{var _e=Fu(),Te=Pe(_e),De=V($(Te),2),xe=$(De),ft=$(xe),_t=V(xe,2),Ht=$(_t),Oe=V(De,2);{var _i=Er=>{var vi=Nu(),pi=$(vi),gi=$(pi);Di(gi,Ne=>j(N,Ne),()=>C(N));var Fi=V(pi,2);{var Wi=Ne=>{var kt=Bu();K(Ne,kt)},Ui=Ne=>{var kt=Mu(),$r=$(kt);ae(()=>ne($r,`Failed to load branches: ${h()??""}`)),K(Ne,kt)},Ss=Ne=>{var kt=Ou();K(Ne,kt)},ws=Ne=>{var kt=Hu(),$r=Pe(kt),Cs=$($r),ys=V($r,2);Xe(ys,21,()=>C(Y),mi=>mi.name,(mi,Kr)=>{var ji=Iu(),qr=$(ji),zi=$(qr),$i=$(zi),xs=V(zi,2);{var Ki=bi=>{var qi=Pu();K(bi,qi)};se(xs,bi=>{C(w)===C(Kr).name&&bi(Ki)})}ae(()=>{He(qr,1,`flex w-full items-center justify-between gap-3 px-3 py-2 text-left text-[12px] transition-colors hover:bg-hover
|
|
16
|
+
${C(w)===C(Kr).name?"bg-accent/10":""}`),ne($i,C(Kr).name)}),Se("click",qr,()=>B(C(Kr).name)),K(mi,ji)}),ae(()=>ne(Cs,`${(C(Y).length!==o().length?`${C(Y).length}/${o().length}`:o().length)??""}
|
|
17
|
+
available`)),K(Ne,kt)};se(Fi,Ne=>{c()?Ne(Wi):h()?Ne(Ui,1):C(Y).length===0?Ne(Ss,2):Ne(ws,-1)})}Se("keydown",gi,Ne=>{Ne.key==="Enter"&&!Ne.shiftKey&&(Ne.preventDefault(),C(Y)[0]&&B(C(Y)[0].name)),Ne.key==="Escape"&&(Ne.preventDefault(),j(g,!1),j(E,""))}),Yr(gi,()=>C(E),Ne=>j(E,Ne)),K(Er,vi)};se(Oe,Er=>{C(g)&&Er(_i)})}Di(Te,Er=>j(M,Er),()=>C(M));var Ni=V(Te,2);ae(()=>{Re(De,"aria-expanded",C(g)),He(xe,1,kn(C(w)?"font-mono":"text-muted/50")),ne(ft,C(w)||"Select a branch"),ne(Ht,C(g)?"▴":"▾")}),Se("focusout",Te,ee),Se("click",De,ce),Se("click",Ni,W),K(fe,_e)};se(Z,fe=>{C(l)==="new"?fe(oe):fe(ue,-1)})}var de=V(G,2);Ru(de,{get startupEnvs(){return f()},get envValues(){return C(X)},set envValues(fe){j(X,fe,!0)}});var ye=V(de,2);Xe(ye,21,()=>u,ui,(fe,_e)=>{var Te=Wu(),De=$(Te),xe=V(De);ae(()=>{He(Te,1,`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
18
|
+
${C(x)===C(_e).value?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),Jn(De,C(_e).value),is(De,C(x)===C(_e).value),ne(xe,` ${C(_e).label??""}`)}),Se("change",De,()=>j(x,C(_e).value,!0)),K(fe,Te)});var re=V(ye,2);{var ge=fe=>{var _e=ju();Xe(_e,21,n,ui,(Te,De)=>{var xe=Uu(),ft=$(xe),_t=V(ft);ae(()=>{He(xe,1,`flex items-center gap-2.5 p-2.5 rounded-lg border cursor-pointer text-[13px] transition-colors
|
|
19
|
+
${C(T)===C(De).name?"border-accent bg-accent/10":"border-edge hover:bg-hover"}`),Jn(ft,C(De).name),is(ft,C(T)===C(De).name),ne(_t,` ${C(De).name??""}`)}),Se("change",ft,()=>j(T,C(De).name,!0)),K(Te,xe)}),K(fe,_e)};se(re,fe=>{n().length>1&&fe(ge)})}var ke=V(re,2),Je=$(ke),Ce=V(ke,2),Ae=$(Ce);nt(Ae,{type:"button",get onclick(){return e.oncancel},children:(fe,_e)=>{var Te=ze("Cancel");K(fe,Te)},$$slots:{default:!0}});var Ie=V(Ae,2);{let fe=he(()=>!C(D));nt(Ie,{type:"submit",variant:"cta",get disabled(){return C(fe)},children:(_e,Te)=>{var De=ze("Create");K(_e,De)},$$slots:{default:!0}})}cr("submit",L,fe=>{fe.preventDefault(),C(I)?(localStorage.setItem(d,C(T)),localStorage.setItem(p,C(x)),localStorage.setItem(m,JSON.stringify(C(X)))):(localStorage.removeItem(d),localStorage.removeItem(p),localStorage.removeItem(m));const _e={};for(const[De,xe]of Object.entries(C(X)))typeof xe=="boolean"?xe&&(_e[De]="true"):xe&&(_e[De]=xe);const Te=C(l)==="existing"?C(w):C(v).trim();e.oncreate(C(l),Te,C(T),C(x),C(S).trim(),_e)}),Se("keydown",H,fe=>{var _e;fe.key==="Enter"&&!fe.shiftKey&&(fe.preventDefault(),(_e=fe.currentTarget.form)==null||_e.requestSubmit())}),qc(Je,()=>C(I),fe=>j(I,fe)),K(ie,L)},$$slots:{default:!0}}),qe()}It(["keydown","click","focusout","change"]);var Ku=Q('<span class="w-3 h-3 rounded-full border border-edge"></span>'),qu=Q('<button type="button"><span class="shrink-0 flex gap-0.5"></span> <span> </span></button>'),Vu=Q('<form><h2 class="text-base mb-4">Settings</h2> <div class="mb-5"><span class="block text-xs text-muted mb-2">Theme</span> <div class="grid grid-cols-2 gap-2"></div></div> <div class="mb-4"><label class="block text-xs text-muted mb-1.5" for="ssh-host">SSH Host <span class="opacity-60">(for "Open in Cursor")</span></label> <input id="ssh-host" type="text" class="w-full px-2.5 py-1.5 rounded-md border border-edge bg-surface text-primary text-[13px] placeholder:text-muted/50 outline-none focus:border-accent" placeholder="e.g. devbox or 10.0.0.5"/> <p class="text-[11px] text-muted mt-1.5">Must match an entry in your local <code class="text-accent/80">~/.ssh/config</code>. Leave empty for local mode.</p></div> <div class="flex justify-end gap-2"><!> <!></div></form>');function Gu(r,e){Ke(e,!0);let n=le(Me(localStorage.getItem(es)??""));function t(){const k=C(n).trim();k?localStorage.setItem(es,k):localStorage.removeItem(es),e.onsave(k)}function b(k){xa(k),e.onthemechange(k)}zr(r,{get onclose(){return e.onclose},wide:!0,children:(k,y)=>{var o=Vu(),c=V($(o),2),h=V($(c),2);Xe(h,21,()=>on,_=>_.key,(_,s)=>{var a=qu(),i=$(a);Xe(i,21,()=>[C(s).colors.surface,C(s).colors.accent,C(s).colors.success,C(s).colors.warning],ui,(S,w)=>{var E=Ku();ae(()=>Ur(E,`background:${C(w)??""}`)),K(S,E)});var l=V(i,2),v=$(l);ae(()=>{He(a,1,`flex items-center gap-2.5 px-3 py-2 rounded-md border cursor-pointer text-left text-[13px] transition-colors ${e.currentTheme===C(s).key?"border-accent bg-active text-primary":"border-edge bg-surface text-muted hover:bg-hover hover:text-primary"}`),ne(v,C(s).label)}),Se("click",a,()=>b(C(s).key)),K(_,a)});var f=V(c,2),u=V($(f),2),d=V(f,2),p=$(d);nt(p,{type:"button",get onclick(){return e.onclose},children:(_,s)=>{var a=ze("Cancel");K(_,a)},$$slots:{default:!0}});var m=V(p,2);nt(m,{type:"submit",variant:"cta",children:(_,s)=>{var a=ze("Save");K(_,a)},$$slots:{default:!0}}),cr("submit",o,_=>{_.preventDefault(),t()}),Yr(u,()=>C(n),_=>j(n,_)),K(k,o)},$$slots:{default:!0}}),qe()}It(["click"]);function Xu(r){return r.replace(/\x1B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1B[@-_]/g,"")}function Ra(r,e=3e4){const t=Xu(r).replace(/\r\n/g,`
|
|
20
|
+
`).replace(/\r/g,`
|
|
21
|
+
`).replace(/[^\x09\x0A\x20-\x7E]/g,"");return t.length>e?`[... truncated]
|
|
22
|
+
`+t.slice(-e):t}var Yu=Q("<button><!></button>");function ts(r,e){let n=wa(e,["$$slots","$$events","$$legacy","children"]);var t=Yu();ba(t,()=>({type:"button",class:"text-[11px] text-accent cursor-pointer bg-transparent border-none p-0 hover:underline disabled:opacity-50 disabled:cursor-not-allowed",...n}));var b=$(t);xn(b,()=>e.children),K(r,t)}var Ju=Q('<a target="_blank" rel="noopener" class="text-[11px] text-muted hover:text-primary no-underline hover:underline">GitHub ↗</a>'),Zu=Q('<div class="text-[12px] text-muted py-2 mt-2">Loading logs...</div>'),Qu=Q('<div class="mt-2"><pre class="bg-surface border border-edge rounded-md p-3 text-[11px] font-mono overflow-x-auto max-h-[300px] overflow-y-auto whitespace-pre-wrap m-0"> </pre> <div class="flex justify-end items-center gap-2 mt-1.5"><!> <!></div></div>'),ed=Q('<div class="text-[12px] text-danger py-2 mt-2"> </div>'),td=Q('<div class="text-[12px] text-danger py-1.5"> </div>'),rd=Q('<li class="rounded-md border border-edge bg-surface p-3"><div class="flex items-center gap-2"><span> </span> <span class="text-[13px] font-medium flex-1 truncate"> </span> <span> </span></div> <div class="flex items-center gap-2 mt-1.5"><!> <!></div> <!> <!> <!></li>'),id=Q('<h2 class="text-base mb-4"> </h2> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4"></ul> <div class="flex justify-end"><!></div>',1);function sd(r,e){Ke(e,!0);let n=le(Me(new Map)),t=le(Me(new Set)),b=le(null),k=le(""),y=le(!1),o=le(!1),c=le(""),h=he(()=>gs(e.pr));function f(i){return`${i.name}:${i.runId}`}function u(i){if(i.runId===null)return"";const l=C(n).get(i.runId);if(!l)return"";const v=i.name+" ";return l.split(`
|
|
23
|
+
`).filter(S=>S.startsWith(v)).map(S=>S.slice(v.length)).join(`
|
|
24
|
+
`)}function d(i){C(t).has(i)?C(t).delete(i):C(t).add(i),j(t,new Set(C(t)),!0)}async function p(i){const l=f(i);if(C(n).has(i.runId)){d(l);return}C(t).add(l),j(t,new Set(C(t)),!0),j(k,""),j(b,i.runId,!0);try{const v=await _u(i.runId);C(n).set(i.runId,v),j(n,new Map(C(n)),!0)}catch(v){j(k,Yt(v),!0),C(t).delete(l),j(t,new Set(C(t)),!0)}finally{j(b,null)}}async function m(i,l){if(!e.branch)return;j(c,""),j(o,!0);const v=["Fix the failing CI check.",`PR: ${C(h)}`,`Check: ${i}`,"","Logs:"].join(`
|
|
25
|
+
`)+`
|
|
26
|
+
`,S=Ra(l);try{await Ta(e.branch,S,v),e.onfixsuccess()}catch(w){j(c,Yt(w),!0)}finally{j(o,!1)}}async function _(i){await navigator.clipboard.writeText(i),j(y,!0),setTimeout(()=>{j(y,!1)},2e3)}function s(i){return i==="success"?"✓":i==="failed"?"✗":i==="skipped"?"—":"○"}function a(i){return i==="success"?"text-success":i==="failed"?"text-danger":i==="pending"?"text-warning":"text-muted"}zr(r,{get onclose(){return e.onclose},wide:!0,children:(i,l)=>{var v=id(),S=Pe(v),w=$(S),E=V(S,2);Xe(E,21,()=>e.pr.ciChecks,T=>T.name+T.runId,(T,A)=>{const I=he(()=>f(C(A))),M=he(()=>C(A).runId!==null&&C(n).has(C(A).runId)),N=he(()=>C(t).has(C(I))),U=he(()=>C(N)?u(C(A)):"");var X=rd(),J=$(X),Y=$(J),D=$(Y),B=V(Y,2),R=$(B),O=V(B,2),W=$(O),ee=V(J,2),ce=$(ee);{var ie=re=>{var ge=Pt(),ke=Pe(ge);{var Je=Ae=>{ts(Ae,{onclick:()=>d(C(I)),children:(Ie,fe)=>{var _e=ze();ae(()=>ne(_e,C(N)?"Hide logs":"Show logs")),K(Ie,_e)},$$slots:{default:!0}})},Ce=Ae=>{ts(Ae,{onclick:()=>p({runId:C(A).runId,name:C(A).name}),children:(Ie,fe)=>{var _e=ze("View logs");K(Ie,_e)},$$slots:{default:!0}})};se(ke,Ae=>{C(M)?Ae(Je):Ae(Ce,-1)})}K(re,ge)};se(ce,re=>{C(A).status==="failed"&&C(A).runId!==null&&re(ie)})}var F=V(ce,2);{var L=re=>{var ge=Ju();ae(()=>Re(ge,"href",C(A).url)),K(re,ge)};se(F,re=>{C(A).url&&re(L)})}var P=V(ee,2);{var H=re=>{var ge=Zu();K(re,ge)},G=re=>{var ge=Qu(),ke=$(ge),Je=$(ke),Ce=V(ke,2),Ae=$(Ce);ts(Ae,{onclick:()=>_(C(U)),children:(fe,_e)=>{var Te=ze();ae(()=>ne(Te,C(y)?"Copied!":"Copy logs")),K(fe,Te)},$$slots:{default:!0}});var Ie=V(Ae,2);{let fe=he(()=>!e.branch||C(o));nt(Ie,{variant:"cta",small:!0,get disabled(){return C(fe)},onclick:()=>m(C(A).name,C(U)),children:(_e,Te)=>{var De=ze();ae(()=>ne(De,C(o)?"Asking agent...":"Ask agent to fix")),K(_e,De)},$$slots:{default:!0}})}ae(()=>ne(Je,C(U))),K(re,ge)};se(P,re=>{C(A).runId!==null&&C(b)===C(A).runId&&C(N)?re(H):C(N)&&C(U)&&re(G,1)})}var Z=V(P,2);{var oe=re=>{var ge=ed(),ke=$(ge);ae(()=>ne(ke,C(k))),K(re,ge)},ue=he(()=>C(k)&&C(b)===null&&C(A).runId!==null&&!C(n).has(C(A).runId));se(Z,re=>{C(ue)&&re(oe)})}var de=V(Z,2);{var ye=re=>{var ge=td(),ke=$(ge);ae(()=>ne(ke,C(c))),K(re,ge)};se(de,re=>{C(c)&&re(ye)})}ae((re,ge,ke)=>{He(Y,1,`text-sm font-bold ${re??""}`),ne(D,ge),ne(R,C(A).name),He(O,1,`text-[11px] ${ke??""}`),ne(W,C(A).status)},[()=>a(C(A).status),()=>s(C(A).status),()=>a(C(A).status)]),K(T,X)});var g=V(E,2),x=$(g);nt(x,{type:"button",get onclick(){return e.onclose},children:(T,A)=>{var I=ze("Close");K(T,I)},$$slots:{default:!0}}),ae(()=>ne(w,`CI Checks — ${C(h)??""}`)),K(i,v)},$$slots:{default:!0}}),qe()}var nd=["forEach","isDisjointFrom","isSubsetOf","isSupersetOf"],od=["difference","intersection","symmetricDifference","union"],oo=!1,ni,zt,gr,ls,di,Aa,Ba;const cs=class cs extends Set{constructor(n){super();ve(this,di);ve(this,ni,new Map);ve(this,zt,le(0));ve(this,gr,le(0));ve(this,ls,dr||-1);if(n){for(var t of n)super.add(t);q(this,gr).v=super.size}oo||je(this,di,Ba).call(this)}has(n){var t=super.has(n),b=q(this,ni),k=b.get(n);if(k===void 0){if(!t)return C(q(this,zt)),!1;k=je(this,di,Aa).call(this,!0),b.set(n,k)}return C(k),t}add(n){return super.has(n)||(super.add(n),j(q(this,gr),super.size),wr(q(this,zt))),this}delete(n){var t=super.delete(n),b=q(this,ni),k=b.get(n);return k!==void 0&&(b.delete(n),j(k,!1)),t&&(j(q(this,gr),super.size),wr(q(this,zt))),t}clear(){if(super.size!==0){super.clear();var n=q(this,ni);for(var t of n.values())j(t,!1);n.clear(),j(q(this,gr),0),wr(q(this,zt))}}keys(){return this.values()}values(){return C(q(this,zt)),super.values()}entries(){return C(q(this,zt)),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return C(q(this,gr))}};ni=new WeakMap,zt=new WeakMap,gr=new WeakMap,ls=new WeakMap,di=new WeakSet,Aa=function(n){return dr===q(this,ls)?le(n):Cr(n)},Ba=function(){oo=!0;var n=cs.prototype,t=Set.prototype;for(const b of nd)n[b]=function(...k){return C(q(this,zt)),t[b].apply(this,k)};for(const b of od)n[b]=function(...k){C(q(this,zt));var y=t[b].apply(this,k);return new cs(y)}};let cn=cs;var ad=Q('<span class="text-muted ml-1">(reply)</span>'),ld=Q('<div class="text-[10px] font-mono text-accent mb-1 truncate"> <!></div>'),cd=Q('<span class="text-accent/60 ml-1">review</span>'),hd=Q('<li class="rounded-md border border-edge bg-surface p-3"><label class="flex items-start gap-2 cursor-pointer"><input type="checkbox" class="mt-0.5 accent-accent"/> <div class="flex-1 min-w-0"><!> <div class="text-[12px] text-muted mb-1"><span class="font-medium text-primary"> </span> <!></div> <pre class="text-[11px] font-mono whitespace-pre-wrap m-0 text-primary/80"> </pre></div></label></li>'),ud=Q('<div class="text-[12px] text-danger mb-3"> </div>'),dd=Q('<h2 class="text-base mb-4"> </h2> <div class="flex items-center justify-between mb-3"><!> <span class="text-[11px] text-muted"> </span></div> <ul class="list-none p-0 m-0 flex flex-col gap-2 mb-4 max-h-[400px] overflow-y-auto"></ul> <!> <div class="flex justify-end gap-2"><!> <!></div>',1);function fd(r,e){Ke(e,!0);let n=le(!1),t=le("");const b=new cn;Rt(()=>{const d=e.pr.comments.length;fr(()=>{b.clear();for(let p=0;p<d;p++)b.add(p)})});let k=he(()=>gs(e.pr)),y=he(()=>b.size===e.pr.comments.length),o=he(()=>b.size===0);function c(){if(C(y))b.clear();else for(let d=0;d<e.pr.comments.length;d++)b.add(d)}function h(d){b.has(d)?b.delete(d):b.add(d)}function f(d,p){if(d.type==="inline"){const m=d.line?`${d.path}:${d.line}`:d.path,_=d.diffHunk?`
|
|
27
|
+
\`\`\`diff
|
|
28
|
+
${d.diffHunk}
|
|
29
|
+
\`\`\`
|
|
30
|
+
`:`
|
|
31
|
+
`;return`[${p}] @${d.author} (${d.createdAt.slice(0,10)}) on ${m}:${_}${d.body}`}return`[${p}] @${d.author} (${d.createdAt.slice(0,10)}):
|
|
32
|
+
${d.body}`}async function u(){if(!e.branch||C(o))return;j(n,!0),j(t,"");const d=["Review the PR comments (including inline review comments) and elaborate a plan to address them.",`PR: ${C(k)}`,"","Comments:"].join(`
|
|
33
|
+
`)+`
|
|
34
|
+
`,p=e.pr.comments.filter((m,_)=>b.has(_)).map((m,_)=>f(m,_+1)).join(`
|
|
35
|
+
|
|
36
|
+
`);try{await Ta(e.branch,Ra(p,2e4),d),e.onsendsuccess()}catch(m){j(t,Yt(m),!0)}finally{j(n,!1)}}zr(r,{get onclose(){return e.onclose},wide:!0,children:(d,p)=>{var m=dd(),_=Pe(m),s=$(_),a=V(_,2),i=$(a);ts(i,{onclick:c,children:(A,I)=>{var M=ze();ae(()=>ne(M,C(y)?"Deselect all":"Select all")),K(A,M)},$$slots:{default:!0}});var l=V(i,2),v=$(l),S=V(a,2);Xe(S,21,()=>e.pr.comments,ui,(A,I,M)=>{var N=hd(),U=$(N),X=$(U),J=V(X,2),Y=$(J);{var D=L=>{var P=ld(),H=$(P),G=V(H);{var Z=oe=>{var ue=ad();K(oe,ue)};se(G,oe=>{C(I).isReply&&oe(Z)})}ae(()=>{Re(P,"title",C(I).path),ne(H,`${C(I).path??""}${C(I).line?`:${C(I).line}`:""} `)}),K(L,P)};se(Y,L=>{C(I).type==="inline"&&L(D)})}var B=V(Y,2),R=$(B),O=$(R),W=V(R),ee=V(W);{var ce=L=>{var P=cd();K(L,P)};se(ee,L=>{C(I).type==="inline"&&L(ce)})}var ie=V(B,2),F=$(ie);ae((L,P)=>{is(X,L),ne(O,`@${C(I).author??""}`),ne(W,` · ${P??""} `),ne(F,C(I).body)},[()=>b.has(M),()=>C(I).createdAt.slice(0,10)]),Se("change",X,()=>h(M)),K(A,N)});var w=V(S,2);{var E=A=>{var I=ud(),M=$(I);ae(()=>ne(M,C(t))),K(A,I)};se(w,A=>{C(t)&&A(E)})}var g=V(w,2),x=$(g);nt(x,{type:"button",get onclick(){return e.onclose},children:(A,I)=>{var M=ze("Cancel");K(A,M)},$$slots:{default:!0}});var T=V(x,2);{let A=he(()=>C(o)||C(n));nt(T,{variant:"cta",small:!0,get disabled(){return C(A)},onclick:u,children:(I,M)=>{var N=ze();ae(()=>ne(N,C(n)?"Sending...":`Send ${b.size} to agent`)),K(I,N)},$$slots:{default:!0}})}ae(()=>{ne(s,`PR Comments — ${C(k)??""}`),ne(v,`${b.size??""} of ${e.pr.comments.length??""} selected`)}),K(d,m)},$$slots:{default:!0}}),qe()}It(["change"]);var Ve;(function(r){r.INSERT="insert",r.DELETE="delete",r.CONTEXT="context"})(Ve||(Ve={}));const _d={LINE_BY_LINE:"line-by-line"},vd={NONE:"none"},pd={WORD:"word"};var Jr;(function(r){r.AUTO="auto",r.DARK="dark",r.LIGHT="light"})(Jr||(Jr={}));const gd=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],md=RegExp("["+gd.join("\\")+"]","g");function bd(r){return r.replace(md,"\\$&")}function ao(r){return r&&r.replace(/\\/g,"/")}function Sd(r){let e,n,t,b=0;for(e=0,t=r.length;e<t;e++)n=r.charCodeAt(e),b=(b<<5)-b+n,b|=0;return b}function Ma(r){const e=r.length;let n=-1/0;for(let t=0;t<e;t++)n=Math.max(n,r[t]);return n}function lo(r,e){const n=r.split(".");return n.length>1?n[n.length-1]:e}function co(r,e){return e.reduce((n,t)=>n||r.startsWith(t),!1)}const ho=["a/","b/","i/","w/","c/","o/"];function vr(r,e,n){const t=n!==void 0?[...ho,n]:ho,b=e?new RegExp(`^${bd(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,k=""]=b.exec(r)||[],y=t.find(c=>k.indexOf(c)===0);return(y?k.slice(y.length):k).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function wd(r,e){return vr(r,"---",e)}function Cd(r,e){return vr(r,"+++",e)}function yd(r,e={}){const n=[];let t=null,b=null,k=null,y=null,o=null,c=null,h=null;const f="--- ",u="+++ ",d="@@",p=/^old mode (\d{6})/,m=/^new mode (\d{6})/,_=/^deleted file mode (\d{6})/,s=/^new file mode (\d{6})/,a=/^copy from "?(.+)"?/,i=/^copy to "?(.+)"?/,l=/^rename from "?(.+)"?/,v=/^rename to "?(.+)"?/,S=/^similarity index (\d+)%/,w=/^dissimilarity index (\d+)%/,E=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,g=/^Binary files (.*) and (.*) differ/,x=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,A=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,I=/^new file mode (\d{6})/,M=/^deleted file mode (\d{6}),(\d{6})/,N=r.replace(/\/g,"").replace(/\r\n?/g,`
|
|
37
|
+
`).split(`
|
|
38
|
+
`);function U(){b!==null&&t!==null&&(t.blocks.push(b),b=null)}function X(){t!==null&&(!t.oldName&&c!==null&&(t.oldName=c),!t.newName&&h!==null&&(t.newName=h),t.newName&&(n.push(t),t=null)),c=null,h=null}function J(){U(),X(),t={blocks:[],deletedLines:0,addedLines:0}}function Y(R){U();let O;t!==null&&((O=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(R))?(t.isCombined=!1,k=parseInt(O[1],10),o=parseInt(O[2],10)):(O=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(R))?(t.isCombined=!0,k=parseInt(O[1],10),y=parseInt(O[2],10),o=parseInt(O[3],10)):(R.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),k=0,o=0,t.isCombined=!1)),b={lines:[],oldStartLine:k,oldStartLine2:y,newStartLine:o,header:R}}function D(R){if(t===null||b===null||k===null||o===null)return;const O={content:R},W=t.isCombined?["+ "," +","++"]:["+"],ee=t.isCombined?["- "," -","--"]:["-"];co(R,W)?(t.addedLines++,O.type=Ve.INSERT,O.oldNumber=void 0,O.newNumber=o++):co(R,ee)?(t.deletedLines++,O.type=Ve.DELETE,O.oldNumber=k++,O.newNumber=void 0):(O.type=Ve.CONTEXT,O.oldNumber=k++,O.newNumber=o++),b.lines.push(O)}function B(R,O){let W=O;for(;W<N.length-3;){if(R.startsWith("diff"))return!1;if(N[W].startsWith(f)&&N[W+1].startsWith(u)&&N[W+2].startsWith(d))return!0;W++}return!1}return N.forEach((R,O)=>{if(!R||R.startsWith("*"))return;let W;const ee=N[O-1],ce=N[O+1],ie=N[O+2];if(R.startsWith("diff --git")||R.startsWith("diff --combined")){if(J(),(W=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(R))&&(c=vr(W[1],void 0,e.dstPrefix),h=vr(W[2],void 0,e.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isGitDiff=!0;return}if(R.startsWith("Binary files")&&!(t!=null&&t.isGitDiff)){if(J(),(W=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(R))&&(c=vr(W[1],void 0,e.dstPrefix),h=vr(W[2],void 0,e.srcPrefix)),t===null)throw new Error("Where is my file !!!");t.isBinary=!0;return}if((!t||!t.isGitDiff&&t&&R.startsWith(f)&&ce.startsWith(u)&&ie.startsWith(d))&&J(),t!=null&&t.isTooBig)return;if(t&&(typeof e.diffMaxChanges=="number"&&t.addedLines+t.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&R.length>e.diffMaxLineLength)){t.isTooBig=!0,t.addedLines=0,t.deletedLines=0,t.blocks=[],b=null;const L=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(n.length):"Diff too big to be displayed";Y(L);return}if(R.startsWith(f)&&ce.startsWith(u)||R.startsWith(u)&&ee.startsWith(f)){if(t&&!t.oldName&&R.startsWith("--- ")&&(W=wd(R,e.srcPrefix))){t.oldName=W,t.language=lo(t.oldName,t.language);return}if(t&&!t.newName&&R.startsWith("+++ ")&&(W=Cd(R,e.dstPrefix))){t.newName=W,t.language=lo(t.newName,t.language);return}}if(t&&(R.startsWith(d)||t.isGitDiff&&t.oldName&&t.newName&&!b)){Y(R);return}if(b&&(R.startsWith("+")||R.startsWith("-")||R.startsWith(" "))){D(R);return}const F=!B(R,O);if(t===null)throw new Error("Where is my file !!!");(W=p.exec(R))?t.oldMode=W[1]:(W=m.exec(R))?t.newMode=W[1]:(W=_.exec(R))?(t.deletedFileMode=W[1],t.isDeleted=!0):(W=s.exec(R))?(t.newFileMode=W[1],t.isNew=!0):(W=a.exec(R))?(F&&(t.oldName=W[1]),t.isCopy=!0):(W=i.exec(R))?(F&&(t.newName=W[1]),t.isCopy=!0):(W=l.exec(R))?(F&&(t.oldName=W[1]),t.isRename=!0):(W=v.exec(R))?(F&&(t.newName=W[1]),t.isRename=!0):(W=g.exec(R))?(t.isBinary=!0,t.oldName=vr(W[1],void 0,e.srcPrefix),t.newName=vr(W[2],void 0,e.dstPrefix),Y("Binary file")):x.test(R)?(t.isBinary=!0,Y(R)):(W=S.exec(R))?t.unchangedPercentage=parseInt(W[1],10):(W=w.exec(R))?t.changedPercentage=parseInt(W[1],10):(W=E.exec(R))?(t.checksumBefore=W[1],t.checksumAfter=W[2],W[3]&&(t.mode=W[3])):(W=T.exec(R))?(t.checksumBefore=[W[2],W[3]],t.checksumAfter=W[1]):(W=A.exec(R))?(t.oldMode=[W[2],W[3]],t.newMode=W[1]):(W=I.exec(R))?(t.newFileMode=W[1],t.isNew=!0):(W=M.exec(R))&&(t.deletedFileMode=W[1],t.isDeleted=!0)}),U(),X(),n}class Oa{diff(e,n,t={}){let b;typeof t=="function"?(b=t,t={}):"callback"in t&&(b=t.callback);const k=this.castInput(e,t),y=this.castInput(n,t),o=this.removeEmpty(this.tokenize(k,t)),c=this.removeEmpty(this.tokenize(y,t));return this.diffWithOptionsObj(o,c,t,b)}diffWithOptionsObj(e,n,t,b){var k;const y=i=>{if(i=this.postProcess(i,t),b){setTimeout(function(){b(i)},0);return}else return i},o=n.length,c=e.length;let h=1,f=o+c;t.maxEditLength!=null&&(f=Math.min(f,t.maxEditLength));const u=(k=t.timeout)!==null&&k!==void 0?k:1/0,d=Date.now()+u,p=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(p[0],n,e,0,t);if(p[0].oldPos+1>=c&&m+1>=o)return y(this.buildValues(p[0].lastComponent,n,e));let _=-1/0,s=1/0;const a=()=>{for(let i=Math.max(_,-h);i<=Math.min(s,h);i+=2){let l;const v=p[i-1],S=p[i+1];v&&(p[i-1]=void 0);let w=!1;if(S){const g=S.oldPos-i;w=S&&0<=g&&g<o}const E=v&&v.oldPos+1<c;if(!w&&!E){p[i]=void 0;continue}if(!E||w&&v.oldPos<S.oldPos?l=this.addToPath(S,!0,!1,0,t):l=this.addToPath(v,!1,!0,1,t),m=this.extractCommon(l,n,e,i,t),l.oldPos+1>=c&&m+1>=o)return y(this.buildValues(l.lastComponent,n,e))||!0;p[i]=l,l.oldPos+1>=c&&(s=Math.min(s,i-1)),m+1>=o&&(_=Math.max(_,i+1))}h++};if(b)(function i(){setTimeout(function(){if(h>f||Date.now()>d)return b(void 0);a()||i()},0)})();else for(;h<=f&&Date.now()<=d;){const i=a();if(i)return i}}addToPath(e,n,t,b,k){const y=e.lastComponent;return y&&!k.oneChangePerToken&&y.added===n&&y.removed===t?{oldPos:e.oldPos+b,lastComponent:{count:y.count+1,added:n,removed:t,previousComponent:y.previousComponent}}:{oldPos:e.oldPos+b,lastComponent:{count:1,added:n,removed:t,previousComponent:y}}}extractCommon(e,n,t,b,k){const y=n.length,o=t.length;let c=e.oldPos,h=c-b,f=0;for(;h+1<y&&c+1<o&&this.equals(t[c+1],n[h+1],k);)h++,c++,f++,k.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return f&&!k.oneChangePerToken&&(e.lastComponent={count:f,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=c,h}equals(e,n,t){return t.comparator?t.comparator(e,n):e===n||!!t.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let t=0;t<e.length;t++)e[t]&&n.push(e[t]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,t){const b=[];let k;for(;e;)b.push(e),k=e.previousComponent,delete e.previousComponent,e=k;b.reverse();const y=b.length;let o=0,c=0,h=0;for(;o<y;o++){const f=b[o];if(f.removed)f.value=this.join(t.slice(h,h+f.count)),h+=f.count;else{if(!f.added&&this.useLongestToken){let u=n.slice(c,c+f.count);u=u.map(function(d,p){const m=t[h+p];return m.length>d.length?m:d}),f.value=this.join(u)}else f.value=this.join(n.slice(c,c+f.count));c+=f.count,f.added||(h+=f.count)}}return b}}class xd extends Oa{}const Ed=new xd;function kd(r,e,n){return Ed.diff(r,e,n)}const uo="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Ld extends Oa{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${uo}]+|[^\\S\\n\\r]+|[^${uo}]`,"ug");return e.match(n)||[]}}const Dd=new Ld;function Td(r,e,n){return Dd.diff(r,e,n)}function Rd(r,e){if(r.length===0)return e.length;if(e.length===0)return r.length;const n=[];let t;for(t=0;t<=e.length;t++)n[t]=[t];let b;for(b=0;b<=r.length;b++)n[0][b]=b;for(t=1;t<=e.length;t++)for(b=1;b<=r.length;b++)e.charAt(t-1)===r.charAt(b-1)?n[t][b]=n[t-1][b-1]:n[t][b]=Math.min(n[t-1][b-1]+1,Math.min(n[t][b-1]+1,n[t-1][b]+1));return n[e.length][r.length]}function Ln(r){return(e,n)=>{const t=r(e).trim(),b=r(n).trim();return Rd(t,b)/(t.length+b.length)}}function Dn(r){function e(t,b,k=new Map){let y=1/0,o;for(let c=0;c<t.length;++c)for(let h=0;h<b.length;++h){const f=JSON.stringify([t[c],b[h]]);let u;k.has(f)&&(u=k.get(f))||(u=r(t[c],b[h]),k.set(f,u)),u<y&&(y=u,o={indexA:c,indexB:h,score:y})}return o}function n(t,b,k=0,y=new Map){const o=e(t,b,y);if(!o||t.length+b.length<3)return[[t,b]];const c=t.slice(0,o.indexA),h=b.slice(0,o.indexB),f=[t[o.indexA]],u=[b[o.indexB]],d=o.indexA+1,p=o.indexB+1,m=t.slice(d),_=b.slice(p),s=n(c,h,k+1,y),a=n(f,u,k+1,y),i=n(m,_,k+1,y);let l=a;return(o.indexA>0||o.indexB>0)&&(l=s.concat(l)),(t.length>d||b.length>p)&&(l=l.concat(i)),l}return n}const ut={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ms={matching:vd.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:pd.WORD,colorScheme:Jr.LIGHT},qt="/",Pa=Ln(r=>r.value),Ad=Dn(Pa);function Fs(r){return r.indexOf("dev/null")!==-1}function Bd(r){return r.replace(/(<ins[^>]*>((.|\n)*?)<\/ins>)/g,"")}function Md(r){return r.replace(/(<del[^>]*>((.|\n)*?)<\/del>)/g,"")}function ss(r){switch(r){case Ve.CONTEXT:return ut.CONTEXT;case Ve.INSERT:return ut.INSERTS;case Ve.DELETE:return ut.DELETES}}function Tn(r){switch(r){case Jr.DARK:return"d2h-dark-color-scheme";case Jr.AUTO:return"d2h-auto-color-scheme";case Jr.LIGHT:default:return"d2h-light-color-scheme"}}function Od(r){return r?2:1}function Zr(r){return r.slice(0).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function Qt(r,e,n=!0){const t=Od(e);return{prefix:r.substring(0,t),content:n?Zr(r.substring(t)):r.substring(t)}}function bs(r){const e=ao(r.oldName),n=ao(r.newName);if(e!==n&&!Fs(e)&&!Fs(n)){const t=[],b=[],k=e.split(qt),y=n.split(qt),o=k.length,c=y.length;let h=0,f=o-1,u=c-1;for(;h<f&&h<u&&k[h]===y[h];)t.push(y[h]),h+=1;for(;f>h&&u>h&&k[f]===y[u];)b.unshift(y[u]),f-=1,u-=1;const d=t.join(qt),p=b.join(qt),m=k.slice(h,f+1).join(qt),_=y.slice(h,u+1).join(qt);return d.length&&p.length?d+qt+"{"+m+" → "+_+"}"+qt+p:d.length?d+qt+"{"+m+" → "+_+"}":p.length?"{"+m+" → "+_+"}"+qt+p:e+" → "+n}else return Fs(n)?e:n}function Rn(r){return`d2h-${Sd(bs(r)).toString().slice(-6)}`}function An(r){let e="file-changed";return r.isRename||r.isCopy?e="file-renamed":r.isNew?e="file-added":r.isDeleted?e="file-deleted":r.newName!==r.oldName&&(e="file-renamed"),e}function Ia(r,e,n,t={}){const{matching:b,maxLineLengthHighlight:k,matchWordsThreshold:y,diffStyle:o}=Object.assign(Object.assign({},ms),t),c=Qt(r,n,!1),h=Qt(e,n,!1);if(c.content.length>k||h.content.length>k)return{oldLine:{prefix:c.prefix,content:Zr(c.content)},newLine:{prefix:h.prefix,content:Zr(h.content)}};const f=o==="char"?kd(c.content,h.content):Td(c.content,h.content),u=[];if(o==="word"&&b==="words"){const p=f.filter(s=>s.removed),m=f.filter(s=>s.added);Ad(m,p).forEach(s=>{s[0].length===1&&s[1].length===1&&Pa(s[0][0],s[1][0])<y&&(u.push(s[0][0]),u.push(s[1][0]))})}const d=f.reduce((p,m)=>{const _=m.added?"ins":m.removed?"del":null,s=u.indexOf(m)>-1?' class="d2h-change"':"",a=Zr(m.value);return _!==null?`${p}<${_}${s}>${a}</${_}>`:`${p}${a}`},"");return{oldLine:{prefix:c.prefix,content:Bd(d)},newLine:{prefix:h.prefix,content:Md(d)}}}const fo="file-summary",Pd="icon",Id={colorScheme:ms.colorScheme};class Hd{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Id),n)}render(e){const n=e.map(t=>this.hoganUtils.render(fo,"line",{fileHtmlId:Rn(t),oldName:t.oldName,newName:t.newName,fileName:bs(t),deletedLines:"-"+t.deletedLines,addedLines:"+"+t.addedLines},{fileIcon:this.hoganUtils.template(Pd,An(t))})).join(`
|
|
39
|
+
`);return this.hoganUtils.render(fo,"wrapper",{colorScheme:Tn(this.config.colorScheme),filesNumber:e.length,files:n})}}const Ha=Object.assign(Object.assign({},ms),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),yi="generic",_o="line-by-line",Nd="icon",Fd="tag";class Wd{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Ha),n)}render(e){const n=e.map(t=>{let b;return t.blocks.length?b=this.generateFileHtml(t):b=this.generateEmptyDiff(),this.makeFileDiffHtml(t,b)}).join(`
|
|
40
|
+
`);return this.hoganUtils.render(yi,"wrapper",{colorScheme:Tn(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const t=this.hoganUtils.template(_o,"file-diff"),b=this.hoganUtils.template(yi,"file-path"),k=this.hoganUtils.template(Nd,"file"),y=this.hoganUtils.template(Fd,An(e));return t.render({file:e,fileHtmlId:Rn(e),diffs:n,filePath:b.render({fileDiffName:bs(e)},{fileIcon:k,fileTag:y})})}generateEmptyDiff(){return this.hoganUtils.render(yi,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:ut})}generateFileHtml(e){const n=Dn(Ln(t=>Qt(t.content,e.isCombined).content));return e.blocks.map(t=>{let b=this.hoganUtils.render(yi,"block-header",{CSSLineClass:ut,blockHeader:e.isTooBig?t.header:Zr(t.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(t).forEach(([k,y,o])=>{if(y.length&&o.length&&!k.length)this.applyRematchMatching(y,o,n).map(([c,h])=>{const{left:f,right:u}=this.processChangedLines(e,e.isCombined,c,h);b+=f,b+=u});else if(k.length)k.forEach(c=>{const{prefix:h,content:f}=Qt(c.content,e.isCombined);b+=this.generateSingleLineHtml(e,{type:ut.CONTEXT,prefix:h,content:f,oldNumber:c.oldNumber,newNumber:c.newNumber})});else if(y.length||o.length){const{left:c,right:h}=this.processChangedLines(e,e.isCombined,y,o);b+=c,b+=h}else console.error("Unknown state reached while processing groups of lines",k,y,o)}),b}).join(`
|
|
41
|
+
`)}applyLineGroupping(e){const n=[];let t=[],b=[];for(let k=0;k<e.lines.length;k++){const y=e.lines[k];(y.type!==Ve.INSERT&&b.length||y.type===Ve.CONTEXT&&t.length>0)&&(n.push([[],t,b]),t=[],b=[]),y.type===Ve.CONTEXT?n.push([[y],[],[]]):y.type===Ve.INSERT&&t.length===0?n.push([[],[],[y]]):y.type===Ve.INSERT&&t.length>0?b.push(y):y.type===Ve.DELETE&&t.push(y)}return(t.length||b.length)&&(n.push([[],t,b]),t=[],b=[]),n}applyRematchMatching(e,n,t){const b=e.length*n.length,k=Ma(e.concat(n).map(o=>o.content.length));return b<this.config.matchingMaxComparisons&&k<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?t(e,n):[[e,n]]}processChangedLines(e,n,t,b){const k={right:"",left:""},y=Math.max(t.length,b.length);for(let o=0;o<y;o++){const c=t[o],h=b[o],f=c!==void 0&&h!==void 0?Ia(c.content,h.content,n,this.config):void 0,u=c!==void 0&&c.oldNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.oldLine.prefix,content:f.oldLine.content,type:ut.DELETE_CHANGES}:Object.assign(Object.assign({},Qt(c.content,n)),{type:ss(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,d=h!==void 0&&h.newNumber!==void 0?Object.assign(Object.assign({},f!==void 0?{prefix:f.newLine.prefix,content:f.newLine.content,type:ut.INSERT_CHANGES}:Object.assign(Object.assign({},Qt(h.content,n)),{type:ss(h.type)})),{oldNumber:h.oldNumber,newNumber:h.newNumber}):void 0,{left:p,right:m}=this.generateLineHtml(e,u,d);k.left+=p,k.right+=m}return k}generateLineHtml(e,n,t){return{left:this.generateSingleLineHtml(e,n),right:this.generateSingleLineHtml(e,t)}}generateSingleLineHtml(e,n){if(n===void 0)return"";const t=this.hoganUtils.render(_o,"numbers",{oldNumber:n.oldNumber||"",newNumber:n.newNumber||""});return this.hoganUtils.render(yi,"line",{type:n.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:n.prefix===" "?" ":n.prefix,content:n.content,lineNumber:t,line:n,file:e})}}const Na=Object.assign(Object.assign({},ms),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),xi="generic",Ud="side-by-side",jd="icon",zd="tag";class $d{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Na),n)}render(e){const n=e.map(t=>{let b;return t.blocks.length?b=this.generateFileHtml(t):b=this.generateEmptyDiff(),this.makeFileDiffHtml(t,b)}).join(`
|
|
42
|
+
`);return this.hoganUtils.render(xi,"wrapper",{colorScheme:Tn(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";const t=this.hoganUtils.template(Ud,"file-diff"),b=this.hoganUtils.template(xi,"file-path"),k=this.hoganUtils.template(jd,"file"),y=this.hoganUtils.template(zd,An(e));return t.render({file:e,fileHtmlId:Rn(e),diffs:n,filePath:b.render({fileDiffName:bs(e)},{fileIcon:k,fileTag:y})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(xi,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:ut})}}generateFileHtml(e){const n=Dn(Ln(t=>Qt(t.content,e.isCombined).content));return e.blocks.map(t=>{const b={left:this.makeHeaderHtml(t.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(t).forEach(([k,y,o])=>{if(y.length&&o.length&&!k.length)this.applyRematchMatching(y,o,n).map(([c,h])=>{const{left:f,right:u}=this.processChangedLines(e.isCombined,c,h);b.left+=f,b.right+=u});else if(k.length)k.forEach(c=>{const{prefix:h,content:f}=Qt(c.content,e.isCombined),{left:u,right:d}=this.generateLineHtml({type:ut.CONTEXT,prefix:h,content:f,number:c.oldNumber},{type:ut.CONTEXT,prefix:h,content:f,number:c.newNumber});b.left+=u,b.right+=d});else if(y.length||o.length){const{left:c,right:h}=this.processChangedLines(e.isCombined,y,o);b.left+=c,b.right+=h}else console.error("Unknown state reached while processing groups of lines",k,y,o)}),b}).reduce((t,b)=>({left:t.left+b.left,right:t.right+b.right}),{left:"",right:""})}applyLineGroupping(e){const n=[];let t=[],b=[];for(let k=0;k<e.lines.length;k++){const y=e.lines[k];(y.type!==Ve.INSERT&&b.length||y.type===Ve.CONTEXT&&t.length>0)&&(n.push([[],t,b]),t=[],b=[]),y.type===Ve.CONTEXT?n.push([[y],[],[]]):y.type===Ve.INSERT&&t.length===0?n.push([[],[],[y]]):y.type===Ve.INSERT&&t.length>0?b.push(y):y.type===Ve.DELETE&&t.push(y)}return(t.length||b.length)&&(n.push([[],t,b]),t=[],b=[]),n}applyRematchMatching(e,n,t){const b=e.length*n.length,k=Ma(e.concat(n).map(o=>o.content.length));return b<this.config.matchingMaxComparisons&&k<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?t(e,n):[[e,n]]}makeHeaderHtml(e,n){return this.hoganUtils.render(xi,"block-header",{CSSLineClass:ut,blockHeader:n!=null&&n.isTooBig?e:Zr(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,n,t){const b={right:"",left:""},k=Math.max(n.length,t.length);for(let y=0;y<k;y++){const o=n[y],c=t[y],h=o!==void 0&&c!==void 0?Ia(o.content,c.content,e,this.config):void 0,f=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.oldLine.prefix,content:h.oldLine.content,type:ut.DELETE_CHANGES}:Object.assign(Object.assign({},Qt(o.content,e)),{type:ss(o.type)})),{number:o.oldNumber}):void 0,u=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},h!==void 0?{prefix:h.newLine.prefix,content:h.newLine.content,type:ut.INSERT_CHANGES}:Object.assign(Object.assign({},Qt(c.content,e)),{type:ss(c.type)})),{number:c.newNumber}):void 0,{left:d,right:p}=this.generateLineHtml(f,u);b.left+=d,b.right+=p}return b}generateLineHtml(e,n){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(n)}}generateSingleHtml(e){const n="d2h-code-side-linenumber",t="d2h-code-side-line";return this.hoganUtils.render(xi,"line",{type:(e==null?void 0:e.type)||`${ut.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?t:`${t} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?" ":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}}var Ws={},vo;function Kd(){return vo||(vo=1,(function(r){(function(e){var n=/\S/,t=/\"/g,b=/\n/g,k=/\r/g,y=/\\/g,o=/\u2028/,c=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(x,T){var A=x.length,I=0,M=1,N=2,U=I,X=null,J=null,Y="",D=[],B=!1,R=0,O=0,W="{{",ee="}}";function ce(){Y.length>0&&(D.push({tag:"_t",text:new String(Y)}),Y="")}function ie(){for(var P=!0,H=O;H<D.length;H++)if(P=e.tags[D[H].tag]<e.tags._v||D[H].tag=="_t"&&D[H].text.match(n)===null,!P)return!1;return P}function F(P,H){if(ce(),P&&ie())for(var G=O,Z;G<D.length;G++)D[G].text&&((Z=D[G+1])&&Z.tag==">"&&(Z.indent=D[G].text.toString()),D.splice(G,1));else H||D.push({tag:`
|
|
43
|
+
`});B=!1,O=D.length}function L(P,H){var G="="+ee,Z=P.indexOf(G,H),oe=f(P.substring(P.indexOf("=",H)+1,Z)).split(" ");return W=oe[0],ee=oe[oe.length-1],Z+G.length-1}for(T&&(T=T.split(" "),W=T[0],ee=T[1]),R=0;R<A;R++)U==I?u(W,x,R)?(--R,ce(),U=M):x.charAt(R)==`
|
|
44
|
+
`?F(B):Y+=x.charAt(R):U==M?(R+=W.length-1,J=e.tags[x.charAt(R+1)],X=J?x.charAt(R+1):"_v",X=="="?(R=L(x,R),U=I):(J&&R++,U=N),B=R):u(ee,x,R)?(D.push({tag:X,n:f(Y),otag:W,ctag:ee,i:X=="/"?B-W.length:R+ee.length}),Y="",R+=ee.length-1,U=I,X=="{"&&(ee=="}}"?R++:h(D[D.length-1]))):Y+=x.charAt(R);return F(B,!0),D};function h(g){g.n.substr(g.n.length-1)==="}"&&(g.n=g.n.substring(0,g.n.length-1))}function f(g){return g.trim?g.trim():g.replace(/^\s*|\s*$/g,"")}function u(g,x,T){if(x.charAt(T)!=g.charAt(0))return!1;for(var A=1,I=g.length;A<I;A++)if(x.charAt(T+A)!=g.charAt(A))return!1;return!0}var d={_t:!0,"\n":!0,$:!0,"/":!0};function p(g,x,T,A){var I=[],M=null,N=null,U=null;for(N=T[T.length-1];g.length>0;){if(U=g.shift(),N&&N.tag=="<"&&!(U.tag in d))throw new Error("Illegal content in < super tag.");if(e.tags[U.tag]<=e.tags.$||m(U,A))T.push(U),U.nodes=p(g,U.tag,T,A);else if(U.tag=="/"){if(T.length===0)throw new Error("Closing tag without opener: /"+U.n);if(M=T.pop(),U.n!=M.n&&!_(U.n,M.n,A))throw new Error("Nesting error: "+M.n+" vs. "+U.n);return M.end=U.i,I}else U.tag==`
|
|
45
|
+
`&&(U.last=g.length==0||g[0].tag==`
|
|
46
|
+
`);I.push(U)}if(T.length>0)throw new Error("missing closing tag: "+T.pop().n);return I}function m(g,x){for(var T=0,A=x.length;T<A;T++)if(x[T].o==g.n)return g.tag="#",!0}function _(g,x,T){for(var A=0,I=T.length;A<I;A++)if(T[A].c==g&&T[A].o==x)return!0}function s(g){var x=[];for(var T in g)x.push('"'+l(T)+'": function(c,p,t,i) {'+g[T]+"}");return"{ "+x.join(",")+" }"}function a(g){var x=[];for(var T in g.partials)x.push('"'+l(T)+'":{name:"'+l(g.partials[T].name)+'", '+a(g.partials[T])+"}");return"partials: {"+x.join(",")+"}, subs: "+s(g.subs)}e.stringify=function(g,x,T){return"{code: function (c,p,i) { "+e.wrapMain(g.code)+" },"+a(g)+"}"};var i=0;e.generate=function(g,x,T){i=0;var A={code:"",subs:{},partials:{}};return e.walk(g,A),T.asString?this.stringify(A,x,T):this.makeTemplate(A,x,T)},e.wrapMain=function(g){return'var t=this;t.b(i=i||"");'+g+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(g,x,T){var A=this.makePartials(g);return A.code=new Function("c","p","i",this.wrapMain(g.code)),new this.template(A,x,this,T)},e.makePartials=function(g){var x,T={subs:{},partials:g.partials,name:g.name};for(x in T.partials)T.partials[x]=this.makePartials(T.partials[x]);for(x in g.subs)T.subs[x]=new Function("c","p","t","i",g.subs[x]);return T};function l(g){return g.replace(y,"\\\\").replace(t,'\\"').replace(b,"\\n").replace(k,"\\r").replace(o,"\\u2028").replace(c,"\\u2029")}function v(g){return~g.indexOf(".")?"d":"f"}function S(g,x){var T="<"+(x.prefix||""),A=T+g.n+i++;return x.partials[A]={name:g.n,partials:{}},x.code+='t.b(t.rp("'+l(A)+'",c,p,"'+(g.indent||"")+'"));',A}e.codegen={"#":function(g,x){x.code+="if(t.s(t."+v(g.n)+'("'+l(g.n)+'",c,p,1),c,p,0,'+g.i+","+g.end+',"'+g.otag+" "+g.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(g.nodes,x),x.code+="});c.pop();}"},"^":function(g,x){x.code+="if(!t.s(t."+v(g.n)+'("'+l(g.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(g.nodes,x),x.code+="};"},">":S,"<":function(g,x){var T={partials:{},code:"",subs:{},inPartial:!0};e.walk(g.nodes,T);var A=x.partials[S(g,x)];A.subs=T.subs,A.partials=T.partials},$:function(g,x){var T={subs:{},code:"",partials:x.partials,prefix:g.n};e.walk(g.nodes,T),x.subs[g.n]=T.code,x.inPartial||(x.code+='t.sub("'+l(g.n)+'",c,p,i);')},"\n":function(g,x){x.code+=E('"\\n"'+(g.last?"":" + i"))},_v:function(g,x){x.code+="t.b(t.v(t."+v(g.n)+'("'+l(g.n)+'",c,p,0)));'},_t:function(g,x){x.code+=E('"'+l(g.text)+'"')},"{":w,"&":w};function w(g,x){x.code+="t.b(t.t(t."+v(g.n)+'("'+l(g.n)+'",c,p,0)));'}function E(g){return"t.b("+g+");"}e.walk=function(g,x){for(var T,A=0,I=g.length;A<I;A++)T=e.codegen[g[A].tag],T&&T(g[A],x);return x},e.parse=function(g,x,T){return T=T||{},p(g,"",[],T.sectionTags||[])},e.cache={},e.cacheKey=function(g,x){return[g,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},e.compile=function(g,x){x=x||{};var T=e.cacheKey(g,x),A=this.cache[T];if(A){var I=A.partials;for(var M in I)delete I[M].instance;return A}return A=this.generate(this.parse(this.scan(g,x.delimiters),g,x),g,x),this.cache[T]=A}})(r)})(Ws)),Ws}var Us={},po;function qd(){return po||(po=1,(function(r){(function(e){e.Template=function(p,m,_,s){p=p||{},this.r=p.code||this.r,this.c=_,this.options=s||{},this.text=m||"",this.partials=p.partials||{},this.subs=p.subs||{},this.buf=""},e.Template.prototype={r:function(p,m,_){return""},v:u,t:f,render:function(m,_,s){return this.ri([m],_||{},s)},ri:function(p,m,_){return this.r(p,m,_)},ep:function(p,m){var _=this.partials[p],s=m[_.name];if(_.instance&&_.base==s)return _.instance;if(typeof s=="string"){if(!this.c)throw new Error("No compiler available.");s=this.c.compile(s,this.options)}if(!s)return null;if(this.partials[p].base=s,_.subs){m.stackText||(m.stackText={});for(key in _.subs)m.stackText[key]||(m.stackText[key]=this.activeSub!==void 0&&m.stackText[this.activeSub]?m.stackText[this.activeSub]:this.text);s=t(s,_.subs,_.partials,this.stackSubs,this.stackPartials,m.stackText)}return this.partials[p].instance=s,s},rp:function(p,m,_,s){var a=this.ep(p,_);return a?a.ri(m,_,s):""},rs:function(p,m,_){var s=p[p.length-1];if(!d(s)){_(p,m,this);return}for(var a=0;a<s.length;a++)p.push(s[a]),_(p,m,this),p.pop()},s:function(p,m,_,s,a,i,l){var v;return d(p)&&p.length===0?!1:(typeof p=="function"&&(p=this.ms(p,m,_,s,a,i,l)),v=!!p,!s&&v&&m&&m.push(typeof p=="object"?p:m[m.length-1]),v)},d:function(p,m,_,s){var a,i=p.split("."),l=this.f(i[0],m,_,s),v=this.options.modelGet,S=null;if(p==="."&&d(m[m.length-2]))l=m[m.length-1];else for(var w=1;w<i.length;w++)a=n(i[w],l,v),a!==void 0?(S=l,l=a):l="";return s&&!l?!1:(!s&&typeof l=="function"&&(m.push(S),l=this.mv(l,m,_),m.pop()),l)},f:function(p,m,_,s){for(var a=!1,i=null,l=!1,v=this.options.modelGet,S=m.length-1;S>=0;S--)if(i=m[S],a=n(p,i,v),a!==void 0){l=!0;break}return l?(!s&&typeof a=="function"&&(a=this.mv(a,m,_)),a):s?!1:""},ls:function(p,m,_,s,a,i){var l=this.options.delimiters;return this.options.delimiters=i,this.b(this.ct(f(p.call(m,a,_)),m,s)),this.options.delimiters=l,!1},ct:function(p,m,_){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(p,this.options).render(m,_)},b:function(p){this.buf+=p},fl:function(){var p=this.buf;return this.buf="",p},ms:function(p,m,_,s,a,i,l){var v,S=m[m.length-1],w=p.call(S);return typeof w=="function"?s?!0:(v=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(w,S,m,_,v.substring(a,i),l)):w},mv:function(p,m,_){var s=m[m.length-1],a=p.call(s);return typeof a=="function"?this.ct(f(a.call(s)),s,_):a},sub:function(p,m,_,s){var a=this.subs[p];a&&(this.activeSub=p,a(m,_,this,s),this.activeSub=!1)}};function n(p,m,_){var s;return m&&typeof m=="object"&&(m[p]!==void 0?s=m[p]:_&&m.get&&typeof m.get=="function"&&(s=m.get(p))),s}function t(p,m,_,s,a,i){function l(){}l.prototype=p;function v(){}v.prototype=p.subs;var S,w=new l;w.subs=new v,w.subsText={},w.buf="",s=s||{},w.stackSubs=s,w.subsText=i;for(S in m)s[S]||(s[S]=m[S]);for(S in s)w.subs[S]=s[S];a=a||{},w.stackPartials=a;for(S in _)a[S]||(a[S]=_[S]);for(S in a)w.partials[S]=a[S];return w}var b=/&/g,k=/</g,y=/>/g,o=/\'/g,c=/\"/g,h=/[&<>\"\']/;function f(p){return String(p??"")}function u(p){return p=f(p),h.test(p)?p.replace(b,"&").replace(k,"<").replace(y,">").replace(o,"'").replace(c,"""):p}var d=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"}})(r)})(Us)),Us}var js,go;function Vd(){if(go)return js;go=1;var r=Kd();return r.Template=qd().Template,r.template=r.Template,js=r,js}var $e=Vd();const Ye={};Ye["file-summary-line"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<li class="d2h-file-list-line">'),t.b(`
|
|
47
|
+
`+n),t.b(' <span class="d2h-file-name-wrapper">'),t.b(`
|
|
48
|
+
`+n),t.b(t.rp("<fileIcon0",r,e," ")),t.b(' <a href="#'),t.b(t.v(t.f("fileHtmlId",r,e,0))),t.b('" class="d2h-file-name">'),t.b(t.v(t.f("fileName",r,e,0))),t.b("</a>"),t.b(`
|
|
49
|
+
`+n),t.b(' <span class="d2h-file-stats">'),t.b(`
|
|
50
|
+
`+n),t.b(' <span class="d2h-lines-added">'),t.b(t.v(t.f("addedLines",r,e,0))),t.b("</span>"),t.b(`
|
|
51
|
+
`+n),t.b(' <span class="d2h-lines-deleted">'),t.b(t.v(t.f("deletedLines",r,e,0))),t.b("</span>"),t.b(`
|
|
52
|
+
`+n),t.b(" </span>"),t.b(`
|
|
53
|
+
`+n),t.b(" </span>"),t.b(`
|
|
54
|
+
`+n),t.b("</li>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});Ye["file-summary-wrapper"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<div class="d2h-file-list-wrapper '),t.b(t.v(t.f("colorScheme",r,e,0))),t.b('">'),t.b(`
|
|
55
|
+
`+n),t.b(' <div class="d2h-file-list-header">'),t.b(`
|
|
56
|
+
`+n),t.b(' <span class="d2h-file-list-title">Files changed ('),t.b(t.v(t.f("filesNumber",r,e,0))),t.b(")</span>"),t.b(`
|
|
57
|
+
`+n),t.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),t.b(`
|
|
58
|
+
`+n),t.b(' <a class="d2h-file-switch d2h-show">show</a>'),t.b(`
|
|
59
|
+
`+n),t.b(" </div>"),t.b(`
|
|
60
|
+
`+n),t.b(' <ol class="d2h-file-list">'),t.b(`
|
|
61
|
+
`+n),t.b(" "),t.b(t.t(t.f("files",r,e,0))),t.b(`
|
|
62
|
+
`+n),t.b(" </ol>"),t.b(`
|
|
63
|
+
`+n),t.b("</div>"),t.fl()},partials:{},subs:{}});Ye["generic-block-header"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b("<tr>"),t.b(`
|
|
64
|
+
`+n),t.b(' <td class="'),t.b(t.v(t.f("lineClass",r,e,0))),t.b(" "),t.b(t.v(t.d("CSSLineClass.INFO",r,e,0))),t.b('"></td>'),t.b(`
|
|
65
|
+
`+n),t.b(' <td class="'),t.b(t.v(t.d("CSSLineClass.INFO",r,e,0))),t.b('">'),t.b(`
|
|
66
|
+
`+n),t.b(' <div class="'),t.b(t.v(t.f("contentClass",r,e,0))),t.b('">'),t.s(t.f("blockHeader",r,e,1),r,e,0,156,173,"{{ }}")&&(t.rs(r,e,function(b,k,y){y.b(y.t(y.f("blockHeader",b,k,0)))}),r.pop()),t.s(t.f("blockHeader",r,e,1),r,e,1,0,0,"")||t.b(" "),t.b("</div>"),t.b(`
|
|
67
|
+
`+n),t.b(" </td>"),t.b(`
|
|
68
|
+
`+n),t.b("</tr>"),t.fl()},partials:{},subs:{}});Ye["generic-empty-diff"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b("<tr>"),t.b(`
|
|
69
|
+
`+n),t.b(' <td class="'),t.b(t.v(t.d("CSSLineClass.INFO",r,e,0))),t.b('">'),t.b(`
|
|
70
|
+
`+n),t.b(' <div class="'),t.b(t.v(t.f("contentClass",r,e,0))),t.b('">'),t.b(`
|
|
71
|
+
`+n),t.b(" File without changes"),t.b(`
|
|
72
|
+
`+n),t.b(" </div>"),t.b(`
|
|
73
|
+
`+n),t.b(" </td>"),t.b(`
|
|
74
|
+
`+n),t.b("</tr>"),t.fl()},partials:{},subs:{}});Ye["generic-file-path"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<span class="d2h-file-name-wrapper">'),t.b(`
|
|
75
|
+
`+n),t.b(t.rp("<fileIcon0",r,e," ")),t.b(' <span class="d2h-file-name">'),t.b(t.v(t.f("fileDiffName",r,e,0))),t.b("</span>"),t.b(`
|
|
76
|
+
`+n),t.b(t.rp("<fileTag1",r,e," ")),t.b("</span>"),t.b(`
|
|
77
|
+
`+n),t.b('<label class="d2h-file-collapse">'),t.b(`
|
|
78
|
+
`+n),t.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),t.b(`
|
|
79
|
+
`+n),t.b(" Viewed"),t.b(`
|
|
80
|
+
`+n),t.b("</label>"),t.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});Ye["generic-line"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b("<tr>"),t.b(`
|
|
81
|
+
`+n),t.b(' <td class="'),t.b(t.v(t.f("lineClass",r,e,0))),t.b(" "),t.b(t.v(t.f("type",r,e,0))),t.b('">'),t.b(`
|
|
82
|
+
`+n),t.b(" "),t.b(t.t(t.f("lineNumber",r,e,0))),t.b(`
|
|
83
|
+
`+n),t.b(" </td>"),t.b(`
|
|
84
|
+
`+n),t.b(' <td class="'),t.b(t.v(t.f("type",r,e,0))),t.b('">'),t.b(`
|
|
85
|
+
`+n),t.b(' <div class="'),t.b(t.v(t.f("contentClass",r,e,0))),t.b('">'),t.b(`
|
|
86
|
+
`+n),t.s(t.f("prefix",r,e,1),r,e,0,162,238,"{{ }}")&&(t.rs(r,e,function(b,k,y){y.b(' <span class="d2h-code-line-prefix">'),y.b(y.t(y.f("prefix",b,k,0))),y.b("</span>"),y.b(`
|
|
87
|
+
`+n)}),r.pop()),t.s(t.f("prefix",r,e,1),r,e,1,0,0,"")||(t.b(' <span class="d2h-code-line-prefix"> </span>'),t.b(`
|
|
88
|
+
`+n)),t.s(t.f("content",r,e,1),r,e,0,371,445,"{{ }}")&&(t.rs(r,e,function(b,k,y){y.b(' <span class="d2h-code-line-ctn">'),y.b(y.t(y.f("content",b,k,0))),y.b("</span>"),y.b(`
|
|
89
|
+
`+n)}),r.pop()),t.s(t.f("content",r,e,1),r,e,1,0,0,"")||(t.b(' <span class="d2h-code-line-ctn"><br></span>'),t.b(`
|
|
90
|
+
`+n)),t.b(" </div>"),t.b(`
|
|
91
|
+
`+n),t.b(" </td>"),t.b(`
|
|
92
|
+
`+n),t.b("</tr>"),t.fl()},partials:{},subs:{}});Ye["generic-wrapper"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<div class="d2h-wrapper '),t.b(t.v(t.f("colorScheme",r,e,0))),t.b('">'),t.b(`
|
|
93
|
+
`+n),t.b(" "),t.b(t.t(t.f("content",r,e,0))),t.b(`
|
|
94
|
+
`+n),t.b("</div>"),t.fl()},partials:{},subs:{}});Ye["icon-file-added"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),t.b(`
|
|
95
|
+
`+n),t.b(' width="14">'),t.b(`
|
|
96
|
+
`+n),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),t.b(`
|
|
97
|
+
`+n),t.b("</svg>"),t.fl()},partials:{},subs:{}});Ye["icon-file-changed"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),t.b(`
|
|
98
|
+
`+n),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
99
|
+
`+n),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),t.b(`
|
|
100
|
+
`+n),t.b("</svg>"),t.fl()},partials:{},subs:{}});Ye["icon-file-deleted"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),t.b(`
|
|
101
|
+
`+n),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
102
|
+
`+n),t.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),t.b(`
|
|
103
|
+
`+n),t.b("</svg>"),t.fl()},partials:{},subs:{}});Ye["icon-file-renamed"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),t.b(`
|
|
104
|
+
`+n),t.b(' viewBox="0 0 14 16" width="14">'),t.b(`
|
|
105
|
+
`+n),t.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),t.b(`
|
|
106
|
+
`+n),t.b("</svg>"),t.fl()},partials:{},subs:{}});Ye["icon-file"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),t.b(`
|
|
107
|
+
`+n),t.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),t.b(`
|
|
108
|
+
`+n),t.b("</svg>"),t.fl()},partials:{},subs:{}});Ye["line-by-line-file-diff"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<div id="'),t.b(t.v(t.f("fileHtmlId",r,e,0))),t.b('" class="d2h-file-wrapper" data-lang="'),t.b(t.v(t.d("file.language",r,e,0))),t.b('">'),t.b(`
|
|
109
|
+
`+n),t.b(' <div class="d2h-file-header">'),t.b(`
|
|
110
|
+
`+n),t.b(" "),t.b(t.t(t.f("filePath",r,e,0))),t.b(`
|
|
111
|
+
`+n),t.b(" </div>"),t.b(`
|
|
112
|
+
`+n),t.b(' <div class="d2h-file-diff">'),t.b(`
|
|
113
|
+
`+n),t.b(' <div class="d2h-code-wrapper">'),t.b(`
|
|
114
|
+
`+n),t.b(' <table class="d2h-diff-table">'),t.b(`
|
|
115
|
+
`+n),t.b(' <tbody class="d2h-diff-tbody">'),t.b(`
|
|
116
|
+
`+n),t.b(" "),t.b(t.t(t.f("diffs",r,e,0))),t.b(`
|
|
117
|
+
`+n),t.b(" </tbody>"),t.b(`
|
|
118
|
+
`+n),t.b(" </table>"),t.b(`
|
|
119
|
+
`+n),t.b(" </div>"),t.b(`
|
|
120
|
+
`+n),t.b(" </div>"),t.b(`
|
|
121
|
+
`+n),t.b("</div>"),t.fl()},partials:{},subs:{}});Ye["line-by-line-numbers"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<div class="line-num1">'),t.b(t.v(t.f("oldNumber",r,e,0))),t.b("</div>"),t.b(`
|
|
122
|
+
`+n),t.b('<div class="line-num2">'),t.b(t.v(t.f("newNumber",r,e,0))),t.b("</div>"),t.fl()},partials:{},subs:{}});Ye["side-by-side-file-diff"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<div id="'),t.b(t.v(t.f("fileHtmlId",r,e,0))),t.b('" class="d2h-file-wrapper" data-lang="'),t.b(t.v(t.d("file.language",r,e,0))),t.b('">'),t.b(`
|
|
123
|
+
`+n),t.b(' <div class="d2h-file-header">'),t.b(`
|
|
124
|
+
`+n),t.b(" "),t.b(t.t(t.f("filePath",r,e,0))),t.b(`
|
|
125
|
+
`+n),t.b(" </div>"),t.b(`
|
|
126
|
+
`+n),t.b(' <div class="d2h-files-diff">'),t.b(`
|
|
127
|
+
`+n),t.b(' <div class="d2h-file-side-diff">'),t.b(`
|
|
128
|
+
`+n),t.b(' <div class="d2h-code-wrapper">'),t.b(`
|
|
129
|
+
`+n),t.b(' <table class="d2h-diff-table">'),t.b(`
|
|
130
|
+
`+n),t.b(' <tbody class="d2h-diff-tbody">'),t.b(`
|
|
131
|
+
`+n),t.b(" "),t.b(t.t(t.d("diffs.left",r,e,0))),t.b(`
|
|
132
|
+
`+n),t.b(" </tbody>"),t.b(`
|
|
133
|
+
`+n),t.b(" </table>"),t.b(`
|
|
134
|
+
`+n),t.b(" </div>"),t.b(`
|
|
135
|
+
`+n),t.b(" </div>"),t.b(`
|
|
136
|
+
`+n),t.b(' <div class="d2h-file-side-diff">'),t.b(`
|
|
137
|
+
`+n),t.b(' <div class="d2h-code-wrapper">'),t.b(`
|
|
138
|
+
`+n),t.b(' <table class="d2h-diff-table">'),t.b(`
|
|
139
|
+
`+n),t.b(' <tbody class="d2h-diff-tbody">'),t.b(`
|
|
140
|
+
`+n),t.b(" "),t.b(t.t(t.d("diffs.right",r,e,0))),t.b(`
|
|
141
|
+
`+n),t.b(" </tbody>"),t.b(`
|
|
142
|
+
`+n),t.b(" </table>"),t.b(`
|
|
143
|
+
`+n),t.b(" </div>"),t.b(`
|
|
144
|
+
`+n),t.b(" </div>"),t.b(`
|
|
145
|
+
`+n),t.b(" </div>"),t.b(`
|
|
146
|
+
`+n),t.b("</div>"),t.fl()},partials:{},subs:{}});Ye["tag-file-added"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),t.fl()},partials:{},subs:{}});Ye["tag-file-changed"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),t.fl()},partials:{},subs:{}});Ye["tag-file-deleted"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),t.fl()},partials:{},subs:{}});Ye["tag-file-renamed"]=new $e.Template({code:function(r,e,n){var t=this;return t.b(n=n||""),t.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),t.fl()},partials:{},subs:{}});class Gd{constructor({compiledTemplates:e={},rawTemplates:n={}}){const t=Object.entries(n).reduce((b,[k,y])=>{const o=$e.compile(y,{asString:!1});return Object.assign(Object.assign({},b),{[k]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},Ye),e),t)}static compile(e){return $e.compile(e,{asString:!1})}render(e,n,t,b,k){const y=this.templateKey(e,n);try{return this.preCompiledTemplates[y].render(t,b,k)}catch{throw new Error(`Could not find template to render '${y}'`)}}template(e,n){return this.preCompiledTemplates[this.templateKey(e,n)]}templateKey(e,n){return`${e}-${n}`}}const Xd=Object.assign(Object.assign(Object.assign({},Ha),Na),{outputFormat:_d.LINE_BY_LINE,drawFileList:!0});function mo(r,e={}){const n=Object.assign(Object.assign({},Xd),e),t=typeof r=="string"?yd(r,n):r,b=new Gd(n),{colorScheme:k}=n,y={colorScheme:k},o=n.drawFileList?new Hd(b,y).render(t):"",c=n.outputFormat==="side-by-side"?new $d(b,n).render(t):new Wd(b,n).render(t);return o+c}var bt={},bo;function Yd(){if(bo)return bt;bo=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.ColorSchemeType=bt.DiffStyleType=bt.LineMatchingType=bt.OutputFormatType=bt.LineType=void 0;var r;(function(n){n.INSERT="insert",n.DELETE="delete",n.CONTEXT="context"})(r||(bt.LineType=r={})),bt.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},bt.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"},bt.DiffStyleType={WORD:"word",CHAR:"char"};var e;return(function(n){n.AUTO="auto",n.DARK="dark",n.LIGHT="light"})(e||(bt.ColorSchemeType=e={})),bt}var Jd=Yd(),Zd=Q('<div class="text-sm text-muted py-8 text-center">Loading diff...</div>'),Qd=Q('<div class="text-sm text-danger py-8 text-center"> </div>'),ef=Q('<div class="text-sm text-muted py-8 text-center">No changes</div>'),tf=Q('<div class="text-[11px] text-warning px-3 py-1">Truncated (exceeded 200KB)</div>'),rf=Q('<div class="section-header svelte-12rjmc4">Uncommitted changes</div> <!> <!>',1),sf=Q('<div class="text-[11px] text-warning px-3 py-1">Truncated (exceeded 200KB)</div>'),nf=Q("<div>Unpushed commits</div> <!> <!>",1),of=Q('<div class="diff-container overflow-auto max-h-[60vh] md:max-h-[70vh] rounded-md border border-edge svelte-12rjmc4"><!> <!></div>'),af=Q('<h2 class="text-base mb-4">Changes — <span class="font-mono text-sm"> </span></h2> <!> <div class="flex justify-end mt-4"><!></div>',1);function lf(r,e){Ke(e,!0);let n=le(""),t=le(!1),b=le(""),k=le(!1),y=le(!0),o=le("");Rt(()=>{j(y,!0),j(o,""),mu(e.branch).then(d=>{j(n,d.uncommitted,!0),j(t,d.uncommittedTruncated,!0),j(b,d.unpushed,!0),j(k,d.unpushedTruncated,!0)}).catch(d=>{j(o,Yt(d),!0)}).finally(()=>{j(y,!1)})});const c={outputFormat:"line-by-line",colorScheme:Jd.ColorSchemeType.AUTO,drawFileList:!1};let h=he(()=>C(n)?mo(C(n),c):""),f=he(()=>C(b)?mo(C(b),c):""),u=he(()=>!!C(n)||!!C(b));zr(r,{get onclose(){return e.onclose},wide:!0,maxWidth:"90vw",className:"diff-dialog",children:(d,p)=>{var m=af(),_=Pe(m),s=V($(_)),a=$(s),i=V(_,2);{var l=x=>{var T=Zd();K(x,T)},v=x=>{var T=Qd(),A=$(T);ae(()=>ne(A,C(o))),K(x,T)},S=x=>{var T=ef();K(x,T)},w=x=>{var T=of(),A=$(T);{var I=U=>{var X=rf(),J=V(Pe(X),2);{var Y=B=>{var R=tf();K(B,R)};se(J,B=>{C(t)&&B(Y)})}var D=V(J,2);Vn(D,()=>C(h)),K(U,X)};se(A,U=>{C(n)&&U(I)})}var M=V(A,2);{var N=U=>{var X=nf(),J=Pe(X);let Y;var D=V(J,2);{var B=O=>{var W=sf();K(O,W)};se(D,O=>{C(k)&&O(B)})}var R=V(D,2);Vn(R,()=>C(f)),ae(()=>Y=He(J,1,"section-header svelte-12rjmc4",null,Y,{"border-t":!!C(n)})),K(U,X)};se(M,U=>{C(b)&&U(N)})}K(x,T)};se(i,x=>{C(y)?x(l):C(o)?x(v,1):C(u)?x(w,-1):x(S,2)})}var E=V(i,2),g=$(E);nt(g,{type:"button",get onclick(){return e.onclose},children:(x,T)=>{var A=ze("Close");K(x,A)},$$slots:{default:!0}}),ae(()=>ne(a,e.branch)),K(d,m)},$$slots:{default:!0}}),qe()}var cf=Q('<button type="button"> </button>'),hf=Q('<nav class="flex items-stretch bg-topbar border-t border-edge pane-bar svelte-19vlwaa"></nav>');function uf(r,e){Ke(e,!0);var n=hf();Xe(n,21,()=>e.panes,t=>t.index,(t,b)=>{var k=cf(),y=$(k);ae(()=>{He(k,1,`flex-1 py-3 text-sm font-medium cursor-pointer border-none bg-transparent ${e.activePane===C(b).index?"text-accent pane-active":"text-muted"}`,"svelte-19vlwaa"),ne(y,C(b).label)}),Se("click",k,()=>e.onselect(C(b).index)),K(t,k)}),K(r,n),qe()}It(["click"]);var df=Q('<div class="toast svelte-1974bvt" role="alert"><button type="button" class="flex-1 flex items-center gap-2 text-left bg-transparent border-none text-inherit cursor-pointer p-0"><!></button> <button type="button" class="shrink-0 w-6 h-6 flex items-center justify-center text-muted hover:text-primary cursor-pointer bg-transparent border-none text-sm">×</button></div>'),ff=Q('<div class="fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm"></div>');function _f(r,e){Ke(e,!0);var n=Pt(),t=Pe(n);{var b=k=>{var y=ff();Xe(y,21,()=>e.notifications,o=>o.id,(o,c)=>{var h=df(),f=$(h),u=$(f);La(u,{get notification(){return C(c)},large:!0});var d=V(f,2);Se("click",f,()=>{e.ondismiss(C(c).id),e.onselect(C(c).branch)}),Se("click",d,()=>e.ondismiss(C(c).id)),K(o,h)}),K(k,y)};se(t,k=>{e.notifications.length>0&&k(b)})}K(r,n),qe()}It(["click"]);var vf=Q('<p class="text-[10px] text-muted truncate m-0 mb-1"> </p>'),pf=Q('<li class="mb-1 p-2 rounded-md border border-transparent hover:bg-hover text-[12px] cursor-pointer" role="button" tabindex="0"><div class="flex items-center gap-1.5 mb-0.5"><span class="shrink-0 w-2 h-2 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-[11px] text-accent no-underline hover:underline"> </a> <span class="text-[10px] text-muted"> </span></div> <p class="truncate text-primary mb-1 m-0"> </p> <!> <div class="flex items-center justify-between gap-2"><span class="text-[10px] text-muted truncate"> <!></span> <span role="none"><!></span></div></li>'),gf=Q('<div class="px-2 pb-1"><input type="text" placeholder="Search issues…" class="w-full px-2 py-1 text-xs rounded border border-edge bg-surface text-primary placeholder:text-muted outline-none focus:border-accent"/></div> <ul class="list-none overflow-y-auto max-h-64 px-2 pb-2"></ul>',1),mf=Q('<div class="border-t border-edge"><button type="button" class="w-full flex items-center justify-between px-4 py-2 text-xs text-muted cursor-pointer bg-transparent border-none hover:bg-hover"><span class="font-semibold"> </span> <span class="text-[10px]"> </span></button> <!></div>');function bf(r,e){Ke(e,!0);let n=le(!0),t=le(""),b=he(()=>C(t)?e.issues.filter(p=>ln(C(t),p.title)||(p.description?ln(C(t),p.description):!1)):e.issues);var k=mf(),y=$(k),o=$(y),c=$(o),h=V(o,2),f=$(h),u=V(y,2);{var d=p=>{var m=gf(),_=Pe(m),s=$(_),a=V(_,2);Xe(a,21,()=>C(b),i=>i.id,(i,l)=>{var v=pf(),S=$(v),w=$(S),E=V(w,2),g=$(E),x=V(E,2),T=$(x),A=V(S,2),I=$(A),M=V(A,2);{var N=O=>{var W=vf(),ee=$(W);ae(()=>ne(ee,C(l).description)),K(O,W)};se(M,O=>{C(l).description&&O(N)})}var U=V(M,2),X=$(U),J=$(X),Y=V(J);{var D=O=>{var W=ze();ae(()=>ne(W,`· ${C(l).project??""}`)),K(O,W)};se(Y,O=>{C(l).project&&O(D)})}var B=V(X,2),R=$(B);nt(R,{small:!0,variant:"accent-outline",onclick:()=>e.onassign(C(l)),children:(O,W)=>{var ee=ze("Implement");K(O,ee)},$$slots:{default:!0}}),ae(()=>{Ur(w,`background: ${C(l).state.color??""};`),Re(w,"title",C(l).state.name),Re(E,"href",C(l).url),ne(g,C(l).identifier),ne(T,C(l).priorityLabel),ne(I,C(l).title),ne(J,C(l).team.key)}),Se("click",v,()=>e.onselect(C(l))),Se("keydown",v,O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),e.onselect(C(l)))}),Se("click",E,O=>O.stopPropagation()),Se("keydown",E,O=>O.stopPropagation()),Se("click",B,O=>O.stopPropagation()),Se("keydown",B,O=>{(O.key==="Enter"||O.key===" ")&&O.stopPropagation()}),K(i,v)}),Yr(s,()=>C(t),i=>j(t,i)),K(p,m)};se(u,p=>{C(n)||p(d)})}ae(()=>{ne(c,`Linear (${C(b).length!==e.issues.length?`${C(b).length}/`:""}${e.issues.length??""})`),ne(f,C(n)?"▸":"▾")}),Se("click",y,()=>j(n,!C(n))),K(r,k),qe()}It(["click","keydown"]);var Sf=Q('<div class="text-[13px] text-secondary whitespace-pre-wrap max-h-64 overflow-y-auto mb-4 leading-relaxed"> </div>'),wf=Q('<p class="text-[13px] text-muted italic mb-4">No description</p>'),Cf=Q("<span> </span>"),yf=Q('<span class="px-1.5 py-0.5 rounded-full text-[10px]"> </span>'),xf=Q("<span> </span>"),Ef=Q('<div class="flex items-center gap-2 mb-1"><span class="shrink-0 w-2.5 h-2.5 rounded-full"></span> <a target="_blank" rel="noopener noreferrer" class="font-mono text-xs text-accent no-underline hover:underline"> </a> <span class="text-[11px] text-muted"> </span> <span class="text-[11px] text-muted"> </span></div> <h2 class="text-base font-semibold mb-3"> </h2> <!> <div class="flex items-center gap-3 text-[11px] text-muted mb-4"><span> </span> <!> <!> <!></div> <div class="flex justify-end gap-2"><!> <!></div>',1);function kf(r,e){Ke(e,!0),zr(r,{get onclose(){return e.onclose},wide:!0,children:(n,t)=>{var b=Ef(),k=Pe(b),y=$(k),o=V(y,2),c=$(o),h=V(o,2),f=$(h),u=V(h,2),d=$(u),p=V(k,2),m=$(p),_=V(p,2);{var s=N=>{var U=Sf(),X=$(U);ae(()=>ne(X,e.issue.description)),K(N,U)},a=N=>{var U=wf();K(N,U)};se(_,N=>{e.issue.description?N(s):N(a,-1)})}var i=V(_,2),l=$(i),v=$(l),S=V(l,2);{var w=N=>{var U=Cf(),X=$(U);ae(()=>ne(X,`· ${e.issue.project??""}`)),K(N,U)};se(S,N=>{e.issue.project&&N(w)})}var E=V(S,2);{var g=N=>{var U=Pt(),X=Pe(U);Xe(X,17,()=>e.issue.labels,J=>J.name,(J,Y)=>{var D=yf(),B=$(D);ae(()=>{Ur(D,`color: ${C(Y).color??""}; background: ${C(Y).color??""}20;`),ne(B,C(Y).name)}),K(J,D)}),K(N,U)};se(E,N=>{e.issue.labels.length>0&&N(g)})}var x=V(E,2);{var T=N=>{var U=xf(),X=$(U);ae(()=>ne(X,`Due ${e.issue.dueDate??""}`)),K(N,U)};se(x,N=>{e.issue.dueDate&&N(T)})}var A=V(i,2),I=$(A);nt(I,{get onclick(){return e.onclose},children:(N,U)=>{var X=ze("Close");K(N,X)},$$slots:{default:!0}});var M=V(I,2);nt(M,{variant:"accent-outline",onclick:()=>e.onassign(e.issue),children:(N,U)=>{var X=ze("Implement");K(N,X)},$$slots:{default:!0}}),ae(()=>{Ur(y,`background: ${e.issue.state.color??""};`),Re(y,"title",e.issue.state.name),Re(o,"href",e.issue.url),ne(c,e.issue.identifier),ne(f,e.issue.state.name),ne(d,`· ${e.issue.priorityLabel??""}`),ne(m,e.issue.title),ne(v,e.issue.team.key)}),K(n,b)},$$slots:{default:!0}}),qe()}var Lf=Q('<div class="fixed inset-0 bg-black/50 z-40"></div>'),Df=Q('<button class="h-8 w-8 rounded-md border border-edge bg-surface text-muted text-sm flex items-center justify-center cursor-pointer hover:bg-hover" title="Close sidebar">×</button>'),Tf=Q('<div class="mt-2 flex items-center gap-1 text-[10px] text-muted"><span class="spinner"></span> </div>'),Rf=Q('<div class="shrink-0 border-t border-edge px-4 py-3 text-[11px] text-muted flex flex-col gap-1"><div class="flex justify-between"><span>Navigate</span><kbd class="opacity-60">Cmd+Up/Down</kbd></div> <div class="flex justify-between"><span>New worktree</span><kbd class="opacity-60">Cmd+K</kbd></div> <div class="flex justify-between"><span>Merge</span><kbd class="opacity-60">Cmd+M</kbd></div> <div class="flex justify-between"><span>Remove</span><kbd class="opacity-60">Cmd+D</kbd></div></div>'),Af=Q('<!> <aside><div class="p-4 border-b border-edge"><div class="flex items-center justify-between"><h1 class="text-base font-semibold"> </h1> <div class="flex items-center gap-2"><button class="h-8 px-2 gap-1.5 rounded-md border border-edge bg-surface text-accent text-xs flex items-center justify-center cursor-pointer hover:bg-hover disabled:opacity-50 disabled:cursor-not-allowed" title="New Worktree (Cmd+K)"><span class="text-lg leading-none">+</span> New</button> <!></div></div> <!></div> <!> <!> <!></aside>',1),Bf=Q('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-3 text-center"><span class="spinner" style="width: 24px; height: 24px; border-width: 2px;"></span> <p class="text-sm text-primary font-medium"> </p> <p class="text-xs text-muted"> </p></div></div>'),Mf=Q('<span class="text-xs text-muted"> </span>'),Of=Q('<span class="text-xs text-muted"> </span>'),Pf=Q('<span class="spinner" style="width: 14px; height: 14px; border-width: 1.5px;"></span> Opening...',1),If=Q('<div class="flex-1 flex items-center justify-center px-6"><div class="flex flex-col items-center gap-4 text-center"><p class="text-sm text-primary font-medium"> </p> <div class="flex flex-col items-center gap-1"><!> <!></div> <button class="mt-2 px-5 py-2 rounded-md bg-accent text-white text-sm font-medium cursor-pointer border-none hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2"><!></button></div></div>'),Hf=Q('<div class="flex-1 flex items-center justify-center text-muted text-sm"><p>Select a worktree from the sidebar to connect</p></div>'),Nf=Q('<div class="flex h-dvh bg-surface text-primary"><!> <main class="flex-1 min-w-0 flex flex-col overflow-hidden"><!> <!> <!></main></div> <!> <!> <!> <!> <!> <!> <!> <!> <!>',1);function Ff(r,e){Ke(e,!0);let n=le(Me({services:[],profiles:[],defaultProfileName:"",autoName:!1,linkedRepos:[]})),t=le(Me([])),b=le(Me(eh())),k=le(!1),y=le(null),o=le(null),c=le(Me(new Set)),h=le(!1),f=le(!1),u=le(null),d=le(null),p=le(!1),m=le(0),_=-1,s=0,a=0,i=le(Me(localStorage.getItem(es)??"")),l=le(Me(Qc())),v=he(()=>Ca(C(l)).terminal),S=null,w=le(null),E=le(Me([])),g=le(!1),x=le(null),T=le(Me([])),A=le(null),I=le(null),M=0;const N=3e5,U=5e3,X=1e3;let J=le(Me([])),Y=le(Me([])),D=le(0);const B=4e3,R=10;let O=le(Me(new Set));function W(z){j(J,[...C(J),z],!0),j(O,new Set([...C(O),z.branch]),!0),j(Y,[z,...C(Y)].slice(0,R),!0),ic(D),setTimeout(()=>{j(J,C(J).filter(te=>te.id!==z.id),!0)},B),document.hidden&&Notification.permission==="granted"&&new Notification(z.message,{body:z.url??z.branch,tag:`wm-${z.id}`})}function ee(z){C(Y).some(te=>te.id===z.id)||j(Y,[z,...C(Y)].slice(0,R),!0)}function ce(z){j(J,C(J).filter(te=>te.id!==z),!0),pu(z).catch(()=>{})}function ie(z){j(J,C(J).filter(te=>te.id!==z),!0)}function F(){j(D,0)}let L=le(!1),P=le(!1),H=le(0),G=le(void 0);const Z=200;let oe=le(Me(new Set)),ue=he(()=>C(t)),de=he(()=>C(ue).filter(z=>z.creating)),ye=he(()=>C(ue).filter(z=>z.creating).length),re=he(()=>Math.max(C(m),C(ye))),ge=he(()=>C(re)>0),ke=he(()=>C(ue).filter(z=>!C(c).has(z.branch))),Je=he(()=>C(re)===1?"Creating...":`Creating ${C(re)}...`),Ce=he(()=>C(b)&&!C(c).has(C(b))?C(ue).find(z=>z.branch===C(b)):void 0),Ae=he(()=>{var z,te;return!!C(b)&&((z=C(Ce))==null?void 0:z.mux)==="✓"&&!((te=C(Ce))!=null&&te.creating)}),Ie=he(()=>C(b)?C(oe).has(C(b)):!1),fe=he(()=>C(ge)?X:U);Rt(()=>{const z=th(C(b),C(Ce),C(ke),C(k));z!==C(b)&&j(b,z,!0)}),Rt(()=>{if(C(m)===0||_===-1)return;const z=C(w)?C(ue).find(te=>te.branch===C(w)):C(de).length===1?C(de)[0]:void 0;z&&(j(b,z.branch,!0),C(L)&&j(P,!1))}),Rt(()=>{S==null||S(C(fe))}),Rt(()=>{if(C(k)){if(C(Ce)){to(C(Ce).branch);return}C(ke).length===0&&to(null)}}),Rt(()=>{if(!C(h))return;const z=++a;j(E,[],!0),j(g,!0),j(x,null),au().then(te=>{z===a&&j(E,te,!0)}).catch(te=>{z===a&&j(x,Yt(te),!0)}).finally(()=>{z===a&&j(g,!1)})}),Rt(()=>{document.title=C(n).name?`${C(n).name} - Dashboard`:"Dev Dashboard"});let _e=he(()=>{var te;const z=((te=C(Ce))==null?void 0:te.paneCount)??0;return z<2?[]:Array.from({length:z},(me,Be)=>({index:Be,label:String(Be+1)}))}),Te=he(()=>C(L)&&C(Ae)&&C(_e).length>0);function De(){const z=Date.now();z-M<N||(M=z,fu().then(te=>{j(T,te,!0)}).catch(te=>console.warn("[linear]",te)))}async function xe(){try{j(t,await ou(),!0),j(k,!0)}catch(z){console.error("Failed to refresh:",z)}De()}function ft(z){j(A,z,!0),j(h,!0)}async function _t(z,te,me,Be,Fe,Ue){const et=s++,ct=C(Ce)==null;ct&&(_=et),j(m,C(m)+1),ct&&j(w,te||null,!0),j(h,!1),j(A,null);try{const Nt=lu(z,te||void 0,me,Be,Fe||void 0,Object.keys(Ue).length>0?Ue:void 0);xe();const ir=await Nt;ct&&j(w,ir.branch,!0),await xe(),ct&&et===_&&(j(b,ir.branch,!0),C(L)&&j(P,!1))}catch(Nt){alert(`Failed to create: ${Yt(Nt)}`)}finally{j(m,Math.max(0,C(m)-1),!0),ct&&et===_&&(j(w,null),_=-1)}}function Ht(z){if(C(b)!==z)return;const te=C(ue).findIndex(Ue=>Ue.branch===z),me=C(ue)[te-1],Be=C(ue)[te+1],Fe=[me,Be].find(Ue=>Ue&&!C(c).has(Ue.branch));j(b,Fe?Fe.branch:null,!0)}async function Oe(){const z=C(y);if(z){j(y,null),Ht(z),j(c,new Set([...C(c),z]),!0);try{await cu(z),await xe()}catch(te){alert(`Failed to remove: ${Yt(te)}`)}finally{j(c,new Set([...C(c)].filter(te=>te!==z)),!0)}}}async function _i(){const z=C(o);if(z){j(o,null),Ht(z),j(c,new Set([...C(c),z]),!0);try{await du(z),await xe()}catch(te){alert(`Failed to merge: ${Yt(te)}`)}finally{j(c,new Set([...C(c)].filter(te=>te!==z)),!0)}}}async function Ni(){const z=C(b);if(z){j(oe,new Set([...C(oe),z]),!0);try{await hu(z),await xe()}catch(te){alert(`Failed to open worktree: ${Yt(te)}`)}finally{j(oe,new Set([...C(oe)].filter(te=>te!==z)),!0)}}}async function Er(){const z=C(b);if(z){Ht(z);try{await uu(z),await xe()}catch(te){alert(`Failed to close worktree: ${Yt(te)}`)}}}function vi(z){const te=C(ue).filter(Fe=>!C(c).has(Fe.branch));if(te.length===0)return;if(!C(b)){j(b,te[z===1?0:te.length-1].branch,!0);return}const Be=te.findIndex(Fe=>Fe.branch===C(b))+z;Be>=0&&Be<te.length&&j(b,te[Be].branch,!0)}function pi(z){C(h)||C(y)||C(o)||!(z.metaKey||z.ctrlKey)||(z.key==="ArrowUp"?(z.preventDefault(),vi(-1)):z.key==="ArrowDown"?(z.preventDefault(),vi(1)):z.key==="k"||z.key==="K"?(z.preventDefault(),j(h,!0)):z.key==="m"||z.key==="M"?(z.preventDefault(),C(b)&&j(o,C(b),!0)):z.key==="d"||z.key==="D"?(z.preventDefault(),C(b)&&j(y,C(b),!0)):z.key==="Enter"&&C(Ce)&&C(Ce).mux!=="✓"&&!C(Ce).creating&&!C(Ie)&&(z.preventDefault(),Ni()))}function gi(z){var te;j(H,z,!0),(te=C(G))==null||te.sendSelectPane(z)}En(()=>{xa(C(l)),ru().then(mt=>{j(n,mt,!0)}).catch(()=>{}),xe(),De();let z=C(fe),te;window.addEventListener("keydown",pi);let me=vu(W,ie,ee);Notification.permission==="default"&&Notification.requestPermission().catch(()=>{});let Be,Fe=!1;function Ue(){te&&clearInterval(te),!(document.hidden||Fe)&&(te=setInterval(xe,z))}S=mt=>{z!==mt&&(z=mt,Ue())},Ue();function et(){Fe&&(Fe=!1,xe(),Ue()),clearTimeout(Be),Be=setTimeout(()=>{Fe=!0,te&&clearInterval(te)},6e4)}document.addEventListener("click",et),document.addEventListener("keydown",et),et();function ct(){document.hidden?te&&clearInterval(te):(et(),xe(),Ue())}document.addEventListener("visibilitychange",ct);const Nt=window.matchMedia("(max-width: 768px)");j(L,Nt.matches,!0),C(L)&&j(P,!0);function ir(mt){j(L,mt.matches,!0)}return Nt.addEventListener("change",ir),()=>{te&&clearInterval(te),S=null,clearTimeout(Be),document.removeEventListener("click",et),document.removeEventListener("keydown",et),window.removeEventListener("keydown",pi),document.removeEventListener("visibilitychange",ct),Nt.removeEventListener("change",ir),me()}});var Fi=Nf(),Wi=Pe(Fi),Ui=$(Wi);{var Ss=z=>{var te=Af(),me=Pe(te);{var Be=We=>{var ht=Lf();Se("click",ht,()=>j(P,!1)),Se("keydown",ht,Ds=>{Ds.key==="Escape"&&j(P,!1)}),K(We,ht)};se(me,We=>{C(L)&&We(Be)})}var Fe=V(me,2),Ue=$(Fe),et=$(Ue),ct=$(et),Nt=$(ct),ir=V(ct,2),mt=$(ir),Es=V(mt,2);{var ks=We=>{var ht=Df();Se("click",ht,()=>j(P,!1)),K(We,ht)};se(Es,We=>{C(L)&&We(ks)})}var Ls=V(et,2);{var ot=We=>{var ht=Tf(),Ds=V($(ht));ae(()=>ne(Ds,` ${C(Je)??""}`)),K(We,ht)};se(Ls,We=>{C(re)>0&&We(ot)})}var Lt=V(Ue,2);yh(Lt,{get worktrees(){return C(ue)},get selected(){return C(b)},get removing(){return C(c)},get initializing(){return C(oe)},get notifiedBranches(){return C(O)},onselect:We=>{j(b,We,!0),j(O,new Set([...C(O)].filter(ht=>ht!==We)),!0),C(L)&&j(P,!1)},onremove:We=>j(y,We,!0)});var Vr=V(Lt,2);{var Ka=We=>{bf(We,{get issues(){return C(T)},onassign:ft,onselect:ht=>j(I,ht,!0)})};se(Vr,We=>{C(T).length>0&&We(Ka)})}var qa=V(Vr,2);{var Va=We=>{var ht=Rf();K(We,ht)};se(qa,We=>{C(L)||We(Va)})}ae(()=>{He(Fe,1,`${C(L)?"fixed inset-0 z-50 w-full":"w-[220px] min-w-[220px]"} bg-sidebar border-r border-edge flex flex-col overflow-hidden`),ne(Nt,C(n).name??"Dashboard")}),Se("click",mt,()=>j(h,!0)),K(z,te)};se(Ui,z=>{(!C(L)||C(P))&&z(Ss)})}var ws=V(Ui,2),Ne=$(ws);{let z=he(()=>{var me;return((me=C(Ce))==null?void 0:me.branch)??null}),te=he(()=>C(n).linkedRepos??[]);Xh(Ne,{get name(){return C(z)},get worktree(){return C(Ce)},get sshHost(){return C(i)},get linkedRepos(){return C(te)},get isMobile(){return C(L)},get notificationHistory(){return C(Y)},get unreadCount(){return C(D)},ontogglesidebar:()=>j(P,!C(P)),onclose:Er,onmerge:()=>{C(b)&&j(o,C(b),!0)},onremove:()=>{C(b)&&j(y,C(b),!0)},onsettings:()=>j(f,!0),ondirtyclick:()=>j(p,!0),onCiClick:me=>j(u,me,!0),onReviewsClick:me=>j(d,me,!0),onbellopen:F,onnotificationselect:me=>{j(b,me,!0),j(O,new Set([...C(O)].filter(Be=>Be!==me)),!0),C(L)&&j(P,!1)}})}var kt=V(Ne,2);{var $r=z=>{var te=Pt(),me=Pe(te);Ac(me,()=>C(b),Be=>{{let Fe=he(()=>C(L)?C(H):void 0);Di(wu(Be,{get worktree(){return C(b)},get isMobile(){return C(L)},get initialPane(){return C(Fe)},get terminalTheme(){return C(v)}}),Ue=>j(G,Ue,!0),()=>C(G))}}),K(z,te)},Cs=z=>{var te=Bf(),me=$(te),Be=V($(me),2),Fe=$(Be),Ue=V(Be,2),et=$(Ue);ae(ct=>{ne(Fe,C(Ce).branch),ne(et,ct)},[()=>Ea(C(Ce).creationPhase)]),K(z,te)},ys=z=>{var te=If(),me=$(te),Be=$(me),Fe=$(Be),Ue=V(Be,2),et=$(Ue);{var ct=ot=>{var Lt=Mf(),Vr=$(Lt);ae(()=>ne(Vr,`Profile: ${C(Ce).profile??""}`)),K(ot,Lt)};se(et,ot=>{C(Ce).profile&&ot(ct)})}var Nt=V(et,2);{var ir=ot=>{var Lt=Of(),Vr=$(Lt);ae(()=>ne(Vr,`Agent: ${C(Ce).agentName??""}`)),K(ot,Lt)};se(Nt,ot=>{C(Ce).agentName&&ot(ir)})}var mt=V(Ue,2),Es=$(mt);{var ks=ot=>{var Lt=Pf();K(ot,Lt)},Ls=ot=>{var Lt=ze("Open Session");K(ot,Lt)};se(Es,ot=>{C(Ie)?ot(ks):ot(Ls,-1)})}ae(()=>{ne(Fe,C(Ce).branch),mt.disabled=C(Ie)}),Se("click",mt,Ni),K(z,te)},mi=z=>{var te=Hf();K(z,te)};se(kt,z=>{var te;C(Ae)?z($r):(te=C(Ce))!=null&&te.creating?z(Cs,1):C(Ce)?z(ys,2):z(mi,-1)})}var Kr=V(kt,2);{var ji=z=>{uf(z,{get activePane(){return C(H)},get panes(){return C(_e)},onselect:gi})};se(Kr,z=>{C(Te)&&z(ji)})}var qr=V(Wi,2);{var zi=z=>{{let te=he(()=>{var Fe;return((Fe=C(A))==null?void 0:Fe.branchName)??""}),me=he(()=>C(A)?`${C(A).title}${C(A).description?`
|
|
147
|
+
|
|
148
|
+
`+C(A).description:""}`:""),Be=he(()=>C(n).startupEnvs??{});$u(z,{get profiles(){return C(n).profiles},get defaultProfileName(){return C(n).defaultProfileName},get autoNameEnabled(){return C(n).autoName},get initialBranch(){return C(te)},get initialPrompt(){return C(me)},get availableBranches(){return C(E)},get availableBranchesLoading(){return C(g)},get availableBranchesError(){return C(x)},get startupEnvs(){return C(Be)},oncreate:_t,oncancel:()=>{j(h,!1),j(A,null)}})}};se(qr,z=>{C(h)&&z(zi)})}var $i=V(qr,2);{var xs=z=>{{let te=he(()=>`Remove worktree "${C(y)}"? This action cannot be undone.`);no(z,{get message(){return C(te)},onconfirm:Oe,oncancel:()=>j(y,null)})}};se($i,z=>{C(y)&&z(xs)})}var Ki=V($i,2);{var bi=z=>{{let te=he(()=>`Merge worktree "${C(o)}" into main? The worktree will be removed after merging.`);no(z,{get message(){return C(te)},confirmLabel:"Merge",variant:"accent",onconfirm:_i,oncancel:()=>j(o,null)})}};se(Ki,z=>{C(o)&&z(bi)})}var qi=V(Ki,2);{var Fa=z=>{Gu(z,{get currentTheme(){return C(l)},onthemechange:te=>j(l,te,!0),onsave:te=>{j(i,te,!0),j(f,!1)},onclose:()=>j(f,!1)})};se(qi,z=>{C(f)&&z(Fa)})}var Bn=V(qi,2);{var Wa=z=>{{let te=he(()=>{var me;return((me=C(Ce))==null?void 0:me.branch)??""});sd(z,{get pr(){return C(u)},get branch(){return C(te)},onclose:()=>j(u,null),onfixsuccess:()=>{j(u,null),setTimeout(()=>{var me;return(me=C(G))==null?void 0:me.sendInput("\r")},Z)}})}};se(Bn,z=>{C(u)&&z(Wa)})}var Mn=V(Bn,2);{var Ua=z=>{{let te=he(()=>{var me;return((me=C(Ce))==null?void 0:me.branch)??""});fd(z,{get pr(){return C(d)},get branch(){return C(te)},onclose:()=>j(d,null),onsendsuccess:()=>{j(d,null),setTimeout(()=>{var me;return(me=C(G))==null?void 0:me.sendInput("\r")},Z)}})}};se(Mn,z=>{C(d)&&z(Ua)})}var On=V(Mn,2);{var ja=z=>{lf(z,{get branch(){return C(b)},onclose:()=>j(p,!1)})};se(On,z=>{C(p)&&C(b)&&z(ja)})}var Pn=V(On,2);{var za=z=>{kf(z,{get issue(){return C(I)},onassign:te=>{j(I,null),ft(te)},onclose:()=>j(I,null)})};se(Pn,z=>{C(I)&&z(za)})}var $a=V(Pn,2);_f($a,{get notifications(){return C(J)},ondismiss:ce,onselect:z=>{j(b,z,!0),j(O,new Set([...C(O)].filter(te=>te!==z)),!0),C(L)&&j(P,!1)}}),K(r,Fi),qe()}It(["click","keydown"]);kc(Ff,{target:document.getElementById("app")});
|