@stilero/bankan 1.0.13 → 1.0.16

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.
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var eh=X,th=Symbol.for("react.element"),rh=Symbol.for("react.fragment"),ih=Object.prototype.hasOwnProperty,sh=eh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nh={key:!0,ref:!0,__self:!0,__source:!0};function Aa(e,t,r){var i,a={},f=null,C=null;r!==void 0&&(f=""+r),t.key!==void 0&&(f=""+t.key),t.ref!==void 0&&(C=t.ref);for(i in t)ih.call(t,i)&&!nh.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)a[i]===void 0&&(a[i]=t[i]);return{$$typeof:th,type:e,key:f,ref:C,props:a,_owner:sh.current}}Ls.Fragment=rh;Ls.jsx=Aa;Ls.jsxs=Aa;Ca.exports=Ls;var L=Ca.exports,Ma={exports:{}},We={},Ia={exports:{}},Pa={};/**
17
+ */var eh=X,th=Symbol.for("react.element"),rh=Symbol.for("react.fragment"),ih=Object.prototype.hasOwnProperty,sh=eh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nh={key:!0,ref:!0,__self:!0,__source:!0};function Aa(e,t,r){var i,a={},f=null,C=null;r!==void 0&&(f=""+r),t.key!==void 0&&(f=""+t.key),t.ref!==void 0&&(C=t.ref);for(i in t)ih.call(t,i)&&!nh.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)a[i]===void 0&&(a[i]=t[i]);return{$$typeof:th,type:e,key:f,ref:C,props:a,_owner:sh.current}}Ls.Fragment=rh;Ls.jsx=Aa;Ls.jsxs=Aa;Ca.exports=Ls;var R=Ca.exports,Ma={exports:{}},We={},Ia={exports:{}},Pa={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -37,12 +37,12 @@
37
37
  `+a[C].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=C&&0<=l);break}}}finally{Xs=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vr(e):""}function dh(e){switch(e.tag){case 5:return Vr(e.type);case 16:return Vr("Lazy");case 13:return Vr("Suspense");case 19:return Vr("SuspenseList");case 0:case 2:case 15:return e=Qs(e.type,!1),e;case 11:return e=Qs(e.type.render,!1),e;case 1:return e=Qs(e.type,!0),e;default:return""}}function En(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case nr:return"Fragment";case sr:return"Portal";case xn:return"Profiler";case wo:return"StrictMode";case kn:return"Suspense";case bn:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ja:return(e.displayName||"Context")+".Consumer";case Oa:return(e._context.displayName||"Context")+".Provider";case xo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ko:return t=e.displayName||null,t!==null?t:En(e.type)||"Memo";case xt:t=e._payload,e=e._init;try{return En(e(t))}catch{}}return null}function fh(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return En(t);case 8:return t===wo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Na(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ph(e){var t=Na(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(C){i=""+C,f.call(this,C)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(C){i=""+C},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ai(e){e._valueTracker||(e._valueTracker=ph(e))}function Fa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Na(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ss(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rn(e,t){var r=t.checked;return de({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function _l(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=jt(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function za(e,t){t=t.checked,t!=null&&Co(e,"checked",t,!1)}function Ln(e,t){za(e,t);var r=jt(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Dn(e,t.type,jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vl(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Dn(e,t,r){(t!=="number"||ss(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Gr=Array.isArray;function vr(e,t,r,i){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&i&&(e[r].defaultSelected=!0)}else{for(r=""+jt(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,i&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Tn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return de({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gl(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(V(92));if(Gr(r)){if(1<r.length)throw Error(V(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:jt(r)}}function Wa(e,t){var r=jt(t.value),i=jt(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ml(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ua(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function An(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ua(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Mi,$a=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Mi=Mi||document.createElement("div"),Mi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Mi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function oi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Xr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_h=["Webkit","ms","Moz","O"];Object.keys(Xr).forEach(function(e){_h.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xr[t]=Xr[e]})});function Ka(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Xr.hasOwnProperty(e)&&Xr[e]?(""+t).trim():t+"px"}function Va(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,a=Ka(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,a):e[r]=a}}var vh=de({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mn(e,t){if(t){if(vh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function In(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pn=null;function bo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,gr=null,mr=null;function Sl(e){if(e=bi(e)){if(typeof Bn!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Is(t),Bn(e.stateNode,e.type,t))}}function Ga(e){gr?mr?mr.push(e):mr=[e]:gr=e}function qa(){if(gr){var e=gr,t=mr;if(mr=gr=null,Sl(e),t)for(e=0;e<t.length;e++)Sl(t[e])}}function Ya(e,t){return e(t)}function Xa(){}var Zs=!1;function Qa(e,t,r){if(Zs)return e(t,r);Zs=!0;try{return Ya(e,t,r)}finally{Zs=!1,(gr!==null||mr!==null)&&(Xa(),qa())}}function li(e,t){var r=e.stateNode;if(r===null)return null;var i=Is(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(V(231,t,typeof r));return r}var On=!1;if(_t)try{var jr={};Object.defineProperty(jr,"passive",{get:function(){On=!0}}),window.addEventListener("test",jr,jr),window.removeEventListener("test",jr,jr)}catch{On=!1}function gh(e,t,r,i,a,f,C,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(S){this.onError(S)}}var Qr=!1,ns=null,os=!1,jn=null,mh={onError:function(e){Qr=!0,ns=e}};function Sh(e,t,r,i,a,f,C,l,c){Qr=!1,ns=null,gh.apply(mh,arguments)}function yh(e,t,r,i,a,f,C,l,c){if(Sh.apply(this,arguments),Qr){if(Qr){var d=ns;Qr=!1,ns=null}else throw Error(V(198));os||(os=!0,jn=d)}}function tr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Za(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function yl(e){if(tr(e)!==e)throw Error(V(188))}function Ch(e){var t=e.alternate;if(!t){if(t=tr(e),t===null)throw Error(V(188));return t!==e?null:e}for(var r=e,i=t;;){var a=r.return;if(a===null)break;var f=a.alternate;if(f===null){if(i=a.return,i!==null){r=i;continue}break}if(a.child===f.child){for(f=a.child;f;){if(f===r)return yl(a),e;if(f===i)return yl(a),t;f=f.sibling}throw Error(V(188))}if(r.return!==i.return)r=a,i=f;else{for(var C=!1,l=a.child;l;){if(l===r){C=!0,r=a,i=f;break}if(l===i){C=!0,i=a,r=f;break}l=l.sibling}if(!C){for(l=f.child;l;){if(l===r){C=!0,r=f,i=a;break}if(l===i){C=!0,i=f,r=a;break}l=l.sibling}if(!C)throw Error(V(189))}}if(r.alternate!==i)throw Error(V(190))}if(r.tag!==3)throw Error(V(188));return r.stateNode.current===r?e:t}function Ja(e){return e=Ch(e),e!==null?ec(e):null}function ec(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ec(e);if(t!==null)return t;e=e.sibling}return null}var tc=ze.unstable_scheduleCallback,Cl=ze.unstable_cancelCallback,wh=ze.unstable_shouldYield,xh=ze.unstable_requestPaint,_e=ze.unstable_now,kh=ze.unstable_getCurrentPriorityLevel,Eo=ze.unstable_ImmediatePriority,rc=ze.unstable_UserBlockingPriority,ls=ze.unstable_NormalPriority,bh=ze.unstable_LowPriority,ic=ze.unstable_IdlePriority,Ds=null,at=null;function Eh(e){if(at&&typeof at.onCommitFiberRoot=="function")try{at.onCommitFiberRoot(Ds,e,void 0,(e.current.flags&128)===128)}catch{}}var tt=Math.clz32?Math.clz32:Dh,Rh=Math.log,Lh=Math.LN2;function Dh(e){return e>>>=0,e===0?32:31-(Rh(e)/Lh|0)|0}var Ii=64,Pi=4194304;function qr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function as(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,f=e.pingedLanes,C=r&268435455;if(C!==0){var l=C&~a;l!==0?i=qr(l):(f&=C,f!==0&&(i=qr(f)))}else C=r&~a,C!==0?i=qr(C):f!==0&&(i=qr(f));if(i===0)return 0;if(t!==0&&t!==i&&!(t&a)&&(a=i&-i,f=t&-t,a>=f||a===16&&(f&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-tt(t),a=1<<r,i|=e[r],t&=~a;return i}function Th(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ah(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,a=e.expirationTimes,f=e.pendingLanes;0<f;){var C=31-tt(f),l=1<<C,c=a[C];c===-1?(!(l&r)||l&i)&&(a[C]=Th(l,t)):c<=t&&(e.expiredLanes|=l),f&=~l}}function Hn(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function sc(){var e=Ii;return Ii<<=1,!(Ii&4194240)&&(Ii=64),e}function Js(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function xi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tt(t),e[t]=r}function Mh(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-tt(r),f=1<<a;t[a]=0,i[a]=-1,e[a]=-1,r&=~f}}function Ro(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-tt(r),a=1<<i;a&t|e[i]&t&&(e[i]|=t),r&=~a}}var ie=0;function nc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var oc,Lo,lc,ac,cc,Nn=!1,Bi=[],Dt=null,Tt=null,At=null,ai=new Map,ci=new Map,bt=[],Ih="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function wl(e,t){switch(e){case"focusin":case"focusout":Dt=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":At=null;break;case"pointerover":case"pointerout":ai.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ci.delete(t.pointerId)}}function Hr(e,t,r,i,a,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:f,targetContainers:[a]},t!==null&&(t=bi(t),t!==null&&Lo(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Ph(e,t,r,i,a){switch(t){case"focusin":return Dt=Hr(Dt,e,t,r,i,a),!0;case"dragenter":return Tt=Hr(Tt,e,t,r,i,a),!0;case"mouseover":return At=Hr(At,e,t,r,i,a),!0;case"pointerover":var f=a.pointerId;return ai.set(f,Hr(ai.get(f)||null,e,t,r,i,a)),!0;case"gotpointercapture":return f=a.pointerId,ci.set(f,Hr(ci.get(f)||null,e,t,r,i,a)),!0}return!1}function uc(e){var t=$t(e.target);if(t!==null){var r=tr(t);if(r!==null){if(t=r.tag,t===13){if(t=Za(r),t!==null){e.blockedOn=t,cc(e.priority,function(){lc(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Fn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Pn=i,r.target.dispatchEvent(i),Pn=null}else return t=bi(r),t!==null&&Lo(t),e.blockedOn=r,!1;t.shift()}return!0}function xl(e,t,r){qi(e)&&r.delete(t)}function Bh(){Nn=!1,Dt!==null&&qi(Dt)&&(Dt=null),Tt!==null&&qi(Tt)&&(Tt=null),At!==null&&qi(At)&&(At=null),ai.forEach(xl),ci.forEach(xl)}function Nr(e,t){e.blockedOn===t&&(e.blockedOn=null,Nn||(Nn=!0,ze.unstable_scheduleCallback(ze.unstable_NormalPriority,Bh)))}function ui(e){function t(a){return Nr(a,e)}if(0<Bi.length){Nr(Bi[0],e);for(var r=1;r<Bi.length;r++){var i=Bi[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Dt!==null&&Nr(Dt,e),Tt!==null&&Nr(Tt,e),At!==null&&Nr(At,e),ai.forEach(t),ci.forEach(t),r=0;r<bt.length;r++)i=bt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<bt.length&&(r=bt[0],r.blockedOn===null);)uc(r),r.blockedOn===null&&bt.shift()}var Sr=St.ReactCurrentBatchConfig,cs=!0;function Oh(e,t,r,i){var a=ie,f=Sr.transition;Sr.transition=null;try{ie=1,Do(e,t,r,i)}finally{ie=a,Sr.transition=f}}function jh(e,t,r,i){var a=ie,f=Sr.transition;Sr.transition=null;try{ie=4,Do(e,t,r,i)}finally{ie=a,Sr.transition=f}}function Do(e,t,r,i){if(cs){var a=Fn(e,t,r,i);if(a===null)un(e,t,i,us,r),wl(e,i);else if(Ph(a,e,t,r,i))i.stopPropagation();else if(wl(e,i),t&4&&-1<Ih.indexOf(e)){for(;a!==null;){var f=bi(a);if(f!==null&&oc(f),f=Fn(e,t,r,i),f===null&&un(e,t,i,us,r),f===a)break;a=f}a!==null&&i.stopPropagation()}else un(e,t,i,null,r)}}var us=null;function Fn(e,t,r,i){if(us=null,e=bo(i),e=$t(e),e!==null)if(t=tr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Za(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return us=e,null}function hc(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kh()){case Eo:return 1;case rc:return 4;case ls:case bh:return 16;case ic:return 536870912;default:return 16}default:return 16}}var Rt=null,To=null,Yi=null;function dc(){if(Yi)return Yi;var e,t=To,r=t.length,i,a="value"in Rt?Rt.value:Rt.textContent,f=a.length;for(e=0;e<r&&t[e]===a[e];e++);var C=r-e;for(i=1;i<=C&&t[r-i]===a[f-i];i++);return Yi=a.slice(e,1<i?1-i:void 0)}function Xi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Oi(){return!0}function kl(){return!1}function Ue(e){function t(r,i,a,f,C){this._reactName=r,this._targetInst=a,this.type=i,this.nativeEvent=f,this.target=C,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(f):f[l]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Oi:kl,this.isPropagationStopped=kl,this}return de(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Oi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Oi)},persist:function(){},isPersistent:Oi}),t}var Tr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ao=Ue(Tr),ki=de({},Tr,{view:0,detail:0}),Hh=Ue(ki),en,tn,Fr,Ts=de({},ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mo,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fr&&(Fr&&e.type==="mousemove"?(en=e.screenX-Fr.screenX,tn=e.screenY-Fr.screenY):tn=en=0,Fr=e),en)},movementY:function(e){return"movementY"in e?e.movementY:tn}}),bl=Ue(Ts),Nh=de({},Ts,{dataTransfer:0}),Fh=Ue(Nh),zh=de({},ki,{relatedTarget:0}),rn=Ue(zh),Wh=de({},Tr,{animationName:0,elapsedTime:0,pseudoElement:0}),Uh=Ue(Wh),$h=de({},Tr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kh=Ue($h),Vh=de({},Tr,{data:0}),El=Ue(Vh),Gh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Yh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yh[e])?!!t[e]:!1}function Mo(){return Xh}var Qh=de({},ki,{key:function(e){if(e.key){var t=Gh[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qh[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mo,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zh=Ue(Qh),Jh=de({},Ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rl=Ue(Jh),ed=de({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mo}),td=Ue(ed),rd=de({},Tr,{propertyName:0,elapsedTime:0,pseudoElement:0}),id=Ue(rd),sd=de({},Ts,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),nd=Ue(sd),od=[9,13,27,32],Io=_t&&"CompositionEvent"in window,Zr=null;_t&&"documentMode"in document&&(Zr=document.documentMode);var ld=_t&&"TextEvent"in window&&!Zr,fc=_t&&(!Io||Zr&&8<Zr&&11>=Zr),Ll=" ",Dl=!1;function pc(e,t){switch(e){case"keyup":return od.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _c(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function ad(e,t){switch(e){case"compositionend":return _c(t);case"keypress":return t.which!==32?null:(Dl=!0,Ll);case"textInput":return e=t.data,e===Ll&&Dl?null:e;default:return null}}function cd(e,t){if(or)return e==="compositionend"||!Io&&pc(e,t)?(e=dc(),Yi=To=Rt=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return fc&&t.locale!=="ko"?null:t.data;default:return null}}var ud={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Tl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ud[e.type]:t==="textarea"}function vc(e,t,r,i){Ga(i),t=hs(t,"onChange"),0<t.length&&(r=new Ao("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Jr=null,hi=null;function hd(e){Rc(e,0)}function As(e){var t=cr(e);if(Fa(t))return e}function dd(e,t){if(e==="change")return t}var gc=!1;if(_t){var sn;if(_t){var nn="oninput"in document;if(!nn){var Al=document.createElement("div");Al.setAttribute("oninput","return;"),nn=typeof Al.oninput=="function"}sn=nn}else sn=!1;gc=sn&&(!document.documentMode||9<document.documentMode)}function Ml(){Jr&&(Jr.detachEvent("onpropertychange",mc),hi=Jr=null)}function mc(e){if(e.propertyName==="value"&&As(hi)){var t=[];vc(t,hi,e,bo(e)),Qa(hd,t)}}function fd(e,t,r){e==="focusin"?(Ml(),Jr=t,hi=r,Jr.attachEvent("onpropertychange",mc)):e==="focusout"&&Ml()}function pd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return As(hi)}function _d(e,t){if(e==="click")return As(t)}function vd(e,t){if(e==="input"||e==="change")return As(t)}function gd(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var it=typeof Object.is=="function"?Object.is:gd;function di(e,t){if(it(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var a=r[i];if(!wn.call(t,a)||!it(e[a],t[a]))return!1}return!0}function Il(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pl(e,t){var r=Il(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Il(r)}}function Sc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yc(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ss(e.document)}return t}function Po(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function md(e){var t=yc(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Sc(r.ownerDocument.documentElement,r)){if(i!==null&&Po(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,f=Math.min(i.start,a);i=i.end===void 0?f:Math.min(i.end,a),!e.extend&&f>i&&(a=i,i=f,f=a),a=Pl(r,f);var C=Pl(r,i);a&&C&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==C.node||e.focusOffset!==C.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),f>i?(e.addRange(t),e.extend(C.node,C.offset)):(t.setEnd(C.node,C.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Sd=_t&&"documentMode"in document&&11>=document.documentMode,lr=null,zn=null,ei=null,Wn=!1;function Bl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Wn||lr==null||lr!==ss(i)||(i=lr,"selectionStart"in i&&Po(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),ei&&di(ei,i)||(ei=i,i=hs(zn,"onSelect"),0<i.length&&(t=new Ao("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=lr)))}function ji(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ar={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionend:ji("Transition","TransitionEnd")},on={},Cc={};_t&&(Cc=document.createElement("div").style,"AnimationEvent"in window||(delete ar.animationend.animation,delete ar.animationiteration.animation,delete ar.animationstart.animation),"TransitionEvent"in window||delete ar.transitionend.transition);function Ms(e){if(on[e])return on[e];if(!ar[e])return e;var t=ar[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Cc)return on[e]=t[r];return e}var wc=Ms("animationend"),xc=Ms("animationiteration"),kc=Ms("animationstart"),bc=Ms("transitionend"),Ec=new Map,Ol="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nt(e,t){Ec.set(e,t),er(t,[e])}for(var ln=0;ln<Ol.length;ln++){var an=Ol[ln],yd=an.toLowerCase(),Cd=an[0].toUpperCase()+an.slice(1);Nt(yd,"on"+Cd)}Nt(wc,"onAnimationEnd");Nt(xc,"onAnimationIteration");Nt(kc,"onAnimationStart");Nt("dblclick","onDoubleClick");Nt("focusin","onFocus");Nt("focusout","onBlur");Nt(bc,"onTransitionEnd");wr("onMouseEnter",["mouseout","mouseover"]);wr("onMouseLeave",["mouseout","mouseover"]);wr("onPointerEnter",["pointerout","pointerover"]);wr("onPointerLeave",["pointerout","pointerover"]);er("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));er("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));er("onBeforeInput",["compositionend","keypress","textInput","paste"]);er("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));er("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));er("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wd=new Set("cancel close invalid load scroll toggle".split(" ").concat(Yr));function jl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,yh(i,t,void 0,e),e.currentTarget=null}function Rc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],a=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var C=i.length-1;0<=C;C--){var l=i[C],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==f&&a.isPropagationStopped())break e;jl(a,l,d),f=c}else for(C=0;C<i.length;C++){if(l=i[C],c=l.instance,d=l.currentTarget,l=l.listener,c!==f&&a.isPropagationStopped())break e;jl(a,l,d),f=c}}}if(os)throw e=jn,os=!1,jn=null,e}function oe(e,t){var r=t[Gn];r===void 0&&(r=t[Gn]=new Set);var i=e+"__bubble";r.has(i)||(Lc(t,e,2,!1),r.add(i))}function cn(e,t,r){var i=0;t&&(i|=4),Lc(r,e,i,t)}var Hi="_reactListening"+Math.random().toString(36).slice(2);function fi(e){if(!e[Hi]){e[Hi]=!0,Ba.forEach(function(r){r!=="selectionchange"&&(wd.has(r)||cn(r,!1,e),cn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hi]||(t[Hi]=!0,cn("selectionchange",!1,t))}}function Lc(e,t,r,i){switch(hc(t)){case 1:var a=Oh;break;case 4:a=jh;break;default:a=Do}r=a.bind(null,t,r,e),a=void 0,!On||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),i?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function un(e,t,r,i,a){var f=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var C=i.tag;if(C===3||C===4){var l=i.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(C===4)for(C=i.return;C!==null;){var c=C.tag;if((c===3||c===4)&&(c=C.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;C=C.return}for(;l!==null;){if(C=$t(l),C===null)return;if(c=C.tag,c===5||c===6){i=f=C;continue e}l=l.parentNode}}i=i.return}Qa(function(){var d=f,S=bo(r),h=[];e:{var _=Ec.get(e);if(_!==void 0){var m=Ao,x=e;switch(e){case"keypress":if(Xi(r)===0)break e;case"keydown":case"keyup":m=Zh;break;case"focusin":x="focus",m=rn;break;case"focusout":x="blur",m=rn;break;case"beforeblur":case"afterblur":m=rn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=bl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Fh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=td;break;case wc:case xc:case kc:m=Uh;break;case bc:m=id;break;case"scroll":m=Hh;break;case"wheel":m=nd;break;case"copy":case"cut":case"paste":m=Kh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Rl}var v=(t&4)!==0,u=!v&&e==="scroll",o=v?_!==null?_+"Capture":null:_;v=[];for(var s=d,n;s!==null;){n=s;var p=n.stateNode;if(n.tag===5&&p!==null&&(n=p,o!==null&&(p=li(s,o),p!=null&&v.push(pi(s,p,n)))),u)break;s=s.return}0<v.length&&(_=new m(_,x,null,r,S),h.push({event:_,listeners:v}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",_&&r!==Pn&&(x=r.relatedTarget||r.fromElement)&&($t(x)||x[vt]))break e;if((m||_)&&(_=S.window===S?S:(_=S.ownerDocument)?_.defaultView||_.parentWindow:window,m?(x=r.relatedTarget||r.toElement,m=d,x=x?$t(x):null,x!==null&&(u=tr(x),x!==u||x.tag!==5&&x.tag!==6)&&(x=null)):(m=null,x=d),m!==x)){if(v=bl,p="onMouseLeave",o="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rl,p="onPointerLeave",o="onPointerEnter",s="pointer"),u=m==null?_:cr(m),n=x==null?_:cr(x),_=new v(p,s+"leave",m,r,S),_.target=u,_.relatedTarget=n,p=null,$t(S)===d&&(v=new v(o,s+"enter",x,r,S),v.target=n,v.relatedTarget=u,p=v),u=p,m&&x)t:{for(v=m,o=x,s=0,n=v;n;n=rr(n))s++;for(n=0,p=o;p;p=rr(p))n++;for(;0<s-n;)v=rr(v),s--;for(;0<n-s;)o=rr(o),n--;for(;s--;){if(v===o||o!==null&&v===o.alternate)break t;v=rr(v),o=rr(o)}v=null}else v=null;m!==null&&Hl(h,_,m,v,!1),x!==null&&u!==null&&Hl(h,u,x,v,!0)}}e:{if(_=d?cr(d):window,m=_.nodeName&&_.nodeName.toLowerCase(),m==="select"||m==="input"&&_.type==="file")var w=dd;else if(Tl(_))if(gc)w=vd;else{w=pd;var y=fd}else(m=_.nodeName)&&m.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(w=_d);if(w&&(w=w(e,d))){vc(h,w,r,S);break e}y&&y(e,_,d),e==="focusout"&&(y=_._wrapperState)&&y.controlled&&_.type==="number"&&Dn(_,"number",_.value)}switch(y=d?cr(d):window,e){case"focusin":(Tl(y)||y.contentEditable==="true")&&(lr=y,zn=d,ei=null);break;case"focusout":ei=zn=lr=null;break;case"mousedown":Wn=!0;break;case"contextmenu":case"mouseup":case"dragend":Wn=!1,Bl(h,r,S);break;case"selectionchange":if(Sd)break;case"keydown":case"keyup":Bl(h,r,S)}var k;if(Io)e:{switch(e){case"compositionstart":var g="onCompositionStart";break e;case"compositionend":g="onCompositionEnd";break e;case"compositionupdate":g="onCompositionUpdate";break e}g=void 0}else or?pc(e,r)&&(g="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(g="onCompositionStart");g&&(fc&&r.locale!=="ko"&&(or||g!=="onCompositionStart"?g==="onCompositionEnd"&&or&&(k=dc()):(Rt=S,To="value"in Rt?Rt.value:Rt.textContent,or=!0)),y=hs(d,g),0<y.length&&(g=new El(g,e,null,r,S),h.push({event:g,listeners:y}),k?g.data=k:(k=_c(r),k!==null&&(g.data=k)))),(k=ld?ad(e,r):cd(e,r))&&(d=hs(d,"onBeforeInput"),0<d.length&&(S=new El("onBeforeInput","beforeinput",null,r,S),h.push({event:S,listeners:d}),S.data=k))}Rc(h,t)})}function pi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function hs(e,t){for(var r=t+"Capture",i=[];e!==null;){var a=e,f=a.stateNode;a.tag===5&&f!==null&&(a=f,f=li(e,r),f!=null&&i.unshift(pi(e,f,a)),f=li(e,t),f!=null&&i.push(pi(e,f,a))),e=e.return}return i}function rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Hl(e,t,r,i,a){for(var f=t._reactName,C=[];r!==null&&r!==i;){var l=r,c=l.alternate,d=l.stateNode;if(c!==null&&c===i)break;l.tag===5&&d!==null&&(l=d,a?(c=li(r,f),c!=null&&C.unshift(pi(r,c,l))):a||(c=li(r,f),c!=null&&C.push(pi(r,c,l)))),r=r.return}C.length!==0&&e.push({event:t,listeners:C})}var xd=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Nl(e){return(typeof e=="string"?e:""+e).replace(xd,`
38
38
  `).replace(kd,"")}function Ni(e,t,r){if(t=Nl(t),Nl(e)!==t&&r)throw Error(V(425))}function ds(){}var Un=null,$n=null;function Kn(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vn=typeof setTimeout=="function"?setTimeout:void 0,bd=typeof clearTimeout=="function"?clearTimeout:void 0,Fl=typeof Promise=="function"?Promise:void 0,Ed=typeof queueMicrotask=="function"?queueMicrotask:typeof Fl<"u"?function(e){return Fl.resolve(null).then(e).catch(Rd)}:Vn;function Rd(e){setTimeout(function(){throw e})}function hn(e,t){var r=t,i=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(i===0){e.removeChild(a),ui(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=a}while(r);ui(t)}function Mt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function zl(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Ar=Math.random().toString(36).slice(2),lt="__reactFiber$"+Ar,_i="__reactProps$"+Ar,vt="__reactContainer$"+Ar,Gn="__reactEvents$"+Ar,Ld="__reactListeners$"+Ar,Dd="__reactHandles$"+Ar;function $t(e){var t=e[lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[vt]||r[lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=zl(e);e!==null;){if(r=e[lt])return r;e=zl(e)}return t}e=r,r=e.parentNode}return null}function bi(e){return e=e[lt]||e[vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function Is(e){return e[_i]||null}var qn=[],ur=-1;function Ft(e){return{current:e}}function le(e){0>ur||(e.current=qn[ur],qn[ur]=null,ur--)}function se(e,t){ur++,qn[ur]=e.current,e.current=t}var Ht={},Re=Ft(Ht),Be=Ft(!1),Yt=Ht;function xr(e,t){var r=e.type.contextTypes;if(!r)return Ht;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var a={},f;for(f in r)a[f]=t[f];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Oe(e){return e=e.childContextTypes,e!=null}function fs(){le(Be),le(Re)}function Wl(e,t,r){if(Re.current!==Ht)throw Error(V(168));se(Re,t),se(Be,r)}function Dc(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var a in i)if(!(a in t))throw Error(V(108,fh(e)||"Unknown",a));return de({},r,i)}function ps(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,Yt=Re.current,se(Re,e),se(Be,Be.current),!0}function Ul(e,t,r){var i=e.stateNode;if(!i)throw Error(V(169));r?(e=Dc(e,t,Yt),i.__reactInternalMemoizedMergedChildContext=e,le(Be),le(Re),se(Re,e)):le(Be),se(Be,r)}var ht=null,Ps=!1,dn=!1;function Tc(e){ht===null?ht=[e]:ht.push(e)}function Td(e){Ps=!0,Tc(e)}function zt(){if(!dn&&ht!==null){dn=!0;var e=0,t=ie;try{var r=ht;for(ie=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}ht=null,Ps=!1}catch(a){throw ht!==null&&(ht=ht.slice(e+1)),tc(Eo,zt),a}finally{ie=t,dn=!1}}return null}var hr=[],dr=0,_s=null,vs=0,Ke=[],Ve=0,Xt=null,dt=1,ft="";function Wt(e,t){hr[dr++]=vs,hr[dr++]=_s,_s=e,vs=t}function Ac(e,t,r){Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,Xt=e;var i=dt;e=ft;var a=32-tt(i)-1;i&=~(1<<a),r+=1;var f=32-tt(t)+a;if(30<f){var C=a-a%5;f=(i&(1<<C)-1).toString(32),i>>=C,a-=C,dt=1<<32-tt(t)+a|r<<a|i,ft=f+e}else dt=1<<f|r<<a|i,ft=e}function Bo(e){e.return!==null&&(Wt(e,1),Ac(e,1,0))}function Oo(e){for(;e===_s;)_s=hr[--dr],hr[dr]=null,vs=hr[--dr],hr[dr]=null;for(;e===Xt;)Xt=Ke[--Ve],Ke[Ve]=null,ft=Ke[--Ve],Ke[Ve]=null,dt=Ke[--Ve],Ke[Ve]=null}var Fe=null,Ne=null,ae=!1,et=null;function Mc(e,t){var r=Ge(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function $l(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Fe=e,Ne=Mt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,Ne=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Xt!==null?{id:dt,overflow:ft}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Ge(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Fe=e,Ne=null,!0):!1;default:return!1}}function Yn(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xn(e){if(ae){var t=Ne;if(t){var r=t;if(!$l(e,t)){if(Yn(e))throw Error(V(418));t=Mt(r.nextSibling);var i=Fe;t&&$l(e,t)?Mc(i,r):(e.flags=e.flags&-4097|2,ae=!1,Fe=e)}}else{if(Yn(e))throw Error(V(418));e.flags=e.flags&-4097|2,ae=!1,Fe=e}}}function Kl(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Fi(e){if(e!==Fe)return!1;if(!ae)return Kl(e),ae=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kn(e.type,e.memoizedProps)),t&&(t=Ne)){if(Yn(e))throw Ic(),Error(V(418));for(;t;)Mc(e,t),t=Mt(t.nextSibling)}if(Kl(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ne=Mt(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ne=null}}else Ne=Fe?Mt(e.stateNode.nextSibling):null;return!0}function Ic(){for(var e=Ne;e;)e=Mt(e.nextSibling)}function kr(){Ne=Fe=null,ae=!1}function jo(e){et===null?et=[e]:et.push(e)}var Ad=St.ReactCurrentBatchConfig;function zr(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(V(309));var i=r.stateNode}if(!i)throw Error(V(147,e));var a=i,f=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===f?t.ref:(t=function(C){var l=a.refs;C===null?delete l[f]:l[f]=C},t._stringRef=f,t)}if(typeof e!="string")throw Error(V(284));if(!r._owner)throw Error(V(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vl(e){var t=e._init;return t(e._payload)}function Pc(e){function t(o,s){if(e){var n=o.deletions;n===null?(o.deletions=[s],o.flags|=16):n.push(s)}}function r(o,s){if(!e)return null;for(;s!==null;)t(o,s),s=s.sibling;return null}function i(o,s){for(o=new Map;s!==null;)s.key!==null?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function a(o,s){return o=Ot(o,s),o.index=0,o.sibling=null,o}function f(o,s,n){return o.index=n,e?(n=o.alternate,n!==null?(n=n.index,n<s?(o.flags|=2,s):n):(o.flags|=2,s)):(o.flags|=1048576,s)}function C(o){return e&&o.alternate===null&&(o.flags|=2),o}function l(o,s,n,p){return s===null||s.tag!==6?(s=Sn(n,o.mode,p),s.return=o,s):(s=a(s,n),s.return=o,s)}function c(o,s,n,p){var w=n.type;return w===nr?S(o,s,n.props.children,p,n.key):s!==null&&(s.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Vl(w)===s.type)?(p=a(s,n.props),p.ref=zr(o,s,n),p.return=o,p):(p=is(n.type,n.key,n.props,null,o.mode,p),p.ref=zr(o,s,n),p.return=o,p)}function d(o,s,n,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==n.containerInfo||s.stateNode.implementation!==n.implementation?(s=yn(n,o.mode,p),s.return=o,s):(s=a(s,n.children||[]),s.return=o,s)}function S(o,s,n,p,w){return s===null||s.tag!==7?(s=qt(n,o.mode,p,w),s.return=o,s):(s=a(s,n),s.return=o,s)}function h(o,s,n){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Sn(""+s,o.mode,n),s.return=o,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case Ti:return n=is(s.type,s.key,s.props,null,o.mode,n),n.ref=zr(o,null,s),n.return=o,n;case sr:return s=yn(s,o.mode,n),s.return=o,s;case xt:var p=s._init;return h(o,p(s._payload),n)}if(Gr(s)||Or(s))return s=qt(s,o.mode,n,null),s.return=o,s;zi(o,s)}return null}function _(o,s,n,p){var w=s!==null?s.key:null;if(typeof n=="string"&&n!==""||typeof n=="number")return w!==null?null:l(o,s,""+n,p);if(typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:return n.key===w?c(o,s,n,p):null;case sr:return n.key===w?d(o,s,n,p):null;case xt:return w=n._init,_(o,s,w(n._payload),p)}if(Gr(n)||Or(n))return w!==null?null:S(o,s,n,p,null);zi(o,n)}return null}function m(o,s,n,p,w){if(typeof p=="string"&&p!==""||typeof p=="number")return o=o.get(n)||null,l(s,o,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ti:return o=o.get(p.key===null?n:p.key)||null,c(s,o,p,w);case sr:return o=o.get(p.key===null?n:p.key)||null,d(s,o,p,w);case xt:var y=p._init;return m(o,s,n,y(p._payload),w)}if(Gr(p)||Or(p))return o=o.get(n)||null,S(s,o,p,w,null);zi(s,p)}return null}function x(o,s,n,p){for(var w=null,y=null,k=s,g=s=0,b=null;k!==null&&g<n.length;g++){k.index>g?(b=k,k=null):b=k.sibling;var T=_(o,k,n[g],p);if(T===null){k===null&&(k=b);break}e&&k&&T.alternate===null&&t(o,k),s=f(T,s,g),y===null?w=T:y.sibling=T,y=T,k=b}if(g===n.length)return r(o,k),ae&&Wt(o,g),w;if(k===null){for(;g<n.length;g++)k=h(o,n[g],p),k!==null&&(s=f(k,s,g),y===null?w=k:y.sibling=k,y=k);return ae&&Wt(o,g),w}for(k=i(o,k);g<n.length;g++)b=m(k,o,g,n[g],p),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?g:b.key),s=f(b,s,g),y===null?w=b:y.sibling=b,y=b);return e&&k.forEach(function(I){return t(o,I)}),ae&&Wt(o,g),w}function v(o,s,n,p){var w=Or(n);if(typeof w!="function")throw Error(V(150));if(n=w.call(n),n==null)throw Error(V(151));for(var y=w=null,k=s,g=s=0,b=null,T=n.next();k!==null&&!T.done;g++,T=n.next()){k.index>g?(b=k,k=null):b=k.sibling;var I=_(o,k,T.value,p);if(I===null){k===null&&(k=b);break}e&&k&&I.alternate===null&&t(o,k),s=f(I,s,g),y===null?w=I:y.sibling=I,y=I,k=b}if(T.done)return r(o,k),ae&&Wt(o,g),w;if(k===null){for(;!T.done;g++,T=n.next())T=h(o,T.value,p),T!==null&&(s=f(T,s,g),y===null?w=T:y.sibling=T,y=T);return ae&&Wt(o,g),w}for(k=i(o,k);!T.done;g++,T=n.next())T=m(k,o,g,T.value,p),T!==null&&(e&&T.alternate!==null&&k.delete(T.key===null?g:T.key),s=f(T,s,g),y===null?w=T:y.sibling=T,y=T);return e&&k.forEach(function(O){return t(o,O)}),ae&&Wt(o,g),w}function u(o,s,n,p){if(typeof n=="object"&&n!==null&&n.type===nr&&n.key===null&&(n=n.props.children),typeof n=="object"&&n!==null){switch(n.$$typeof){case Ti:e:{for(var w=n.key,y=s;y!==null;){if(y.key===w){if(w=n.type,w===nr){if(y.tag===7){r(o,y.sibling),s=a(y,n.props.children),s.return=o,o=s;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===xt&&Vl(w)===y.type){r(o,y.sibling),s=a(y,n.props),s.ref=zr(o,y,n),s.return=o,o=s;break e}r(o,y);break}else t(o,y);y=y.sibling}n.type===nr?(s=qt(n.props.children,o.mode,p,n.key),s.return=o,o=s):(p=is(n.type,n.key,n.props,null,o.mode,p),p.ref=zr(o,s,n),p.return=o,o=p)}return C(o);case sr:e:{for(y=n.key;s!==null;){if(s.key===y)if(s.tag===4&&s.stateNode.containerInfo===n.containerInfo&&s.stateNode.implementation===n.implementation){r(o,s.sibling),s=a(s,n.children||[]),s.return=o,o=s;break e}else{r(o,s);break}else t(o,s);s=s.sibling}s=yn(n,o.mode,p),s.return=o,o=s}return C(o);case xt:return y=n._init,u(o,s,y(n._payload),p)}if(Gr(n))return x(o,s,n,p);if(Or(n))return v(o,s,n,p);zi(o,n)}return typeof n=="string"&&n!==""||typeof n=="number"?(n=""+n,s!==null&&s.tag===6?(r(o,s.sibling),s=a(s,n),s.return=o,o=s):(r(o,s),s=Sn(n,o.mode,p),s.return=o,o=s),C(o)):r(o,s)}return u}var br=Pc(!0),Bc=Pc(!1),gs=Ft(null),ms=null,fr=null,Ho=null;function No(){Ho=fr=ms=null}function Fo(e){var t=gs.current;le(gs),e._currentValue=t}function Qn(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function yr(e,t){ms=e,Ho=fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Pe=!0),e.firstContext=null)}function Ye(e){var t=e._currentValue;if(Ho!==e)if(e={context:e,memoizedValue:t,next:null},fr===null){if(ms===null)throw Error(V(308));fr=e,ms.dependencies={lanes:0,firstContext:e}}else fr=fr.next=e;return t}var Kt=null;function zo(e){Kt===null?Kt=[e]:Kt.push(e)}function Oc(e,t,r,i){var a=t.interleaved;return a===null?(r.next=r,zo(t)):(r.next=a.next,a.next=r),t.interleaved=r,gt(e,i)}function gt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var kt=!1;function Wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function It(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,re&2){var a=i.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),i.pending=t,gt(e,r)}return a=i.interleaved,a===null?(t.next=t,zo(i)):(t.next=a.next,a.next=t),i.interleaved=t,gt(e,r)}function Qi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Ro(e,r)}}function Gl(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var a=null,f=null;if(r=r.firstBaseUpdate,r!==null){do{var C={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};f===null?a=f=C:f=f.next=C,r=r.next}while(r!==null);f===null?a=f=t:f=f.next=t}else a=f=t;r={baseState:i.baseState,firstBaseUpdate:a,lastBaseUpdate:f,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ss(e,t,r,i){var a=e.updateQueue;kt=!1;var f=a.firstBaseUpdate,C=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,C===null?f=d:C.next=d,C=c;var S=e.alternate;S!==null&&(S=S.updateQueue,l=S.lastBaseUpdate,l!==C&&(l===null?S.firstBaseUpdate=d:l.next=d,S.lastBaseUpdate=c))}if(f!==null){var h=a.baseState;C=0,S=d=c=null,l=f;do{var _=l.lane,m=l.eventTime;if((i&_)===_){S!==null&&(S=S.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,v=l;switch(_=t,m=r,v.tag){case 1:if(x=v.payload,typeof x=="function"){h=x.call(m,h,_);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,_=typeof x=="function"?x.call(m,h,_):x,_==null)break e;h=de({},h,_);break e;case 2:kt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,_=a.effects,_===null?a.effects=[l]:_.push(l))}else m={eventTime:m,lane:_,tag:l.tag,payload:l.payload,callback:l.callback,next:null},S===null?(d=S=m,c=h):S=S.next=m,C|=_;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;_=l,l=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);if(S===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=S,t=a.shared.interleaved,t!==null){a=t;do C|=a.lane,a=a.next;while(a!==t)}else f===null&&(a.shared.lanes=0);Zt|=C,e.lanes=C,e.memoizedState=h}}function ql(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],a=i.callback;if(a!==null){if(i.callback=null,i=r,typeof a!="function")throw Error(V(191,a));a.call(i)}}}var Ei={},ct=Ft(Ei),vi=Ft(Ei),gi=Ft(Ei);function Vt(e){if(e===Ei)throw Error(V(174));return e}function Uo(e,t){switch(se(gi,t),se(vi,e),se(ct,Ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:An(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=An(t,e)}le(ct),se(ct,t)}function Er(){le(ct),le(vi),le(gi)}function Hc(e){Vt(gi.current);var t=Vt(ct.current),r=An(t,e.type);t!==r&&(se(vi,e),se(ct,r))}function $o(e){vi.current===e&&(le(ct),le(vi))}var ue=Ft(0);function ys(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fn=[];function Ko(){for(var e=0;e<fn.length;e++)fn[e]._workInProgressVersionPrimary=null;fn.length=0}var Zi=St.ReactCurrentDispatcher,pn=St.ReactCurrentBatchConfig,Qt=0,he=null,ge=null,Se=null,Cs=!1,ti=!1,mi=0,Md=0;function ke(){throw Error(V(321))}function Vo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!it(e[r],t[r]))return!1;return!0}function Go(e,t,r,i,a,f){if(Qt=f,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?Od:jd,e=r(i,a),ti){f=0;do{if(ti=!1,mi=0,25<=f)throw Error(V(301));f+=1,Se=ge=null,t.updateQueue=null,Zi.current=Hd,e=r(i,a)}while(ti)}if(Zi.current=ws,t=ge!==null&&ge.next!==null,Qt=0,Se=ge=he=null,Cs=!1,t)throw Error(V(300));return e}function qo(){var e=mi!==0;return mi=0,e}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Se===null?he.memoizedState=Se=e:Se=Se.next=e,Se}function Xe(){if(ge===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=ge.next;var t=Se===null?he.memoizedState:Se.next;if(t!==null)Se=t,ge=e;else{if(e===null)throw Error(V(310));ge=e,e={memoizedState:ge.memoizedState,baseState:ge.baseState,baseQueue:ge.baseQueue,queue:ge.queue,next:null},Se===null?he.memoizedState=Se=e:Se=Se.next=e}return Se}function Si(e,t){return typeof t=="function"?t(e):t}function _n(e){var t=Xe(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var i=ge,a=i.baseQueue,f=r.pending;if(f!==null){if(a!==null){var C=a.next;a.next=f.next,f.next=C}i.baseQueue=a=f,r.pending=null}if(a!==null){f=a.next,i=i.baseState;var l=C=null,c=null,d=f;do{var S=d.lane;if((Qt&S)===S)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),i=d.hasEagerState?d.eagerState:e(i,d.action);else{var h={lane:S,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,C=i):c=c.next=h,he.lanes|=S,Zt|=S}d=d.next}while(d!==null&&d!==f);c===null?C=i:c.next=l,it(i,t.memoizedState)||(Pe=!0),t.memoizedState=i,t.baseState=C,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){a=e;do f=a.lane,he.lanes|=f,Zt|=f,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function vn(e){var t=Xe(),r=t.queue;if(r===null)throw Error(V(311));r.lastRenderedReducer=e;var i=r.dispatch,a=r.pending,f=t.memoizedState;if(a!==null){r.pending=null;var C=a=a.next;do f=e(f,C.action),C=C.next;while(C!==a);it(f,t.memoizedState)||(Pe=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),r.lastRenderedState=f}return[f,i]}function Nc(){}function Fc(e,t){var r=he,i=Xe(),a=t(),f=!it(i.memoizedState,a);if(f&&(i.memoizedState=a,Pe=!0),i=i.queue,Yo(Uc.bind(null,r,i,e),[e]),i.getSnapshot!==t||f||Se!==null&&Se.memoizedState.tag&1){if(r.flags|=2048,yi(9,Wc.bind(null,r,i,a,t),void 0,null),ye===null)throw Error(V(349));Qt&30||zc(r,t,a)}return a}function zc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Wc(e,t,r,i){t.value=r,t.getSnapshot=i,$c(t)&&Kc(e)}function Uc(e,t,r){return r(function(){$c(t)&&Kc(e)})}function $c(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!it(e,r)}catch{return!0}}function Kc(e){var t=gt(e,1);t!==null&&rt(t,e,1,-1)}function Yl(e){var t=ot();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t.queue=e,e=e.dispatch=Bd.bind(null,he,e),[t.memoizedState,e]}function yi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function Vc(){return Xe().memoizedState}function Ji(e,t,r,i){var a=ot();he.flags|=e,a.memoizedState=yi(1|t,r,void 0,i===void 0?null:i)}function Bs(e,t,r,i){var a=Xe();i=i===void 0?null:i;var f=void 0;if(ge!==null){var C=ge.memoizedState;if(f=C.destroy,i!==null&&Vo(i,C.deps)){a.memoizedState=yi(t,r,f,i);return}}he.flags|=e,a.memoizedState=yi(1|t,r,f,i)}function Xl(e,t){return Ji(8390656,8,e,t)}function Yo(e,t){return Bs(2048,8,e,t)}function Gc(e,t){return Bs(4,2,e,t)}function qc(e,t){return Bs(4,4,e,t)}function Yc(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Xc(e,t,r){return r=r!=null?r.concat([e]):null,Bs(4,4,Yc.bind(null,t,e),r)}function Xo(){}function Qc(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Vo(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Zc(e,t){var r=Xe();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Vo(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Jc(e,t,r){return Qt&21?(it(r,t)||(r=sc(),he.lanes|=r,Zt|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Pe=!0),e.memoizedState=r)}function Id(e,t){var r=ie;ie=r!==0&&4>r?r:4,e(!0);var i=pn.transition;pn.transition={};try{e(!1),t()}finally{ie=r,pn.transition=i}}function eu(){return Xe().memoizedState}function Pd(e,t,r){var i=Bt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},tu(e))ru(t,r);else if(r=Oc(e,t,r,i),r!==null){var a=De();rt(r,e,i,a),iu(r,t,i)}}function Bd(e,t,r){var i=Bt(e),a={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(tu(e))ru(t,a);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var C=t.lastRenderedState,l=f(C,r);if(a.hasEagerState=!0,a.eagerState=l,it(l,C)){var c=t.interleaved;c===null?(a.next=a,zo(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=Oc(e,t,a,i),r!==null&&(a=De(),rt(r,e,i,a),iu(r,t,i))}}function tu(e){var t=e.alternate;return e===he||t!==null&&t===he}function ru(e,t){ti=Cs=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function iu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Ro(e,r)}}var ws={readContext:Ye,useCallback:ke,useContext:ke,useEffect:ke,useImperativeHandle:ke,useInsertionEffect:ke,useLayoutEffect:ke,useMemo:ke,useReducer:ke,useRef:ke,useState:ke,useDebugValue:ke,useDeferredValue:ke,useTransition:ke,useMutableSource:ke,useSyncExternalStore:ke,useId:ke,unstable_isNewReconciler:!1},Od={readContext:Ye,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:Ye,useEffect:Xl,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ji(4194308,4,Yc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ji(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ji(4,2,e,t)},useMemo:function(e,t){var r=ot();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=ot();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=Pd.bind(null,he,e),[i.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:Yl,useDebugValue:Xo,useDeferredValue:function(e){return ot().memoizedState=e},useTransition:function(){var e=Yl(!1),t=e[0];return e=Id.bind(null,e[1]),ot().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=he,a=ot();if(ae){if(r===void 0)throw Error(V(407));r=r()}else{if(r=t(),ye===null)throw Error(V(349));Qt&30||zc(i,t,r)}a.memoizedState=r;var f={value:r,getSnapshot:t};return a.queue=f,Xl(Uc.bind(null,i,f,e),[e]),i.flags|=2048,yi(9,Wc.bind(null,i,f,r,t),void 0,null),r},useId:function(){var e=ot(),t=ye.identifierPrefix;if(ae){var r=ft,i=dt;r=(i&~(1<<32-tt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=mi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Md++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},jd={readContext:Ye,useCallback:Qc,useContext:Ye,useEffect:Yo,useImperativeHandle:Xc,useInsertionEffect:Gc,useLayoutEffect:qc,useMemo:Zc,useReducer:_n,useRef:Vc,useState:function(){return _n(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return Jc(t,ge.memoizedState,e)},useTransition:function(){var e=_n(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Nc,useSyncExternalStore:Fc,useId:eu,unstable_isNewReconciler:!1},Hd={readContext:Ye,useCallback:Qc,useContext:Ye,useEffect:Yo,useImperativeHandle:Xc,useInsertionEffect:Gc,useLayoutEffect:qc,useMemo:Zc,useReducer:vn,useRef:Vc,useState:function(){return vn(Si)},useDebugValue:Xo,useDeferredValue:function(e){var t=Xe();return ge===null?t.memoizedState=e:Jc(t,ge.memoizedState,e)},useTransition:function(){var e=vn(Si)[0],t=Xe().memoizedState;return[e,t]},useMutableSource:Nc,useSyncExternalStore:Fc,useId:eu,unstable_isNewReconciler:!1};function Ze(e,t){if(e&&e.defaultProps){t=de({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Zn(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:de({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Os={isMounted:function(e){return(e=e._reactInternals)?tr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.payload=t,r!=null&&(f.callback=r),t=It(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=De(),a=Bt(e),f=pt(i,a);f.tag=1,f.payload=t,r!=null&&(f.callback=r),t=It(e,f,a),t!==null&&(rt(t,e,a,i),Qi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=De(),i=Bt(e),a=pt(r,i);a.tag=2,t!=null&&(a.callback=t),t=It(e,a,i),t!==null&&(rt(t,e,i,r),Qi(t,e,i))}};function Ql(e,t,r,i,a,f,C){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,C):t.prototype&&t.prototype.isPureReactComponent?!di(r,i)||!di(a,f):!0}function su(e,t,r){var i=!1,a=Ht,f=t.contextType;return typeof f=="object"&&f!==null?f=Ye(f):(a=Oe(t)?Yt:Re.current,i=t.contextTypes,f=(i=i!=null)?xr(e,a):Ht),t=new t(r,f),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Os,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=f),t}function Zl(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Os.enqueueReplaceState(t,t.state,null)}function Jn(e,t,r,i){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},Wo(e);var f=t.contextType;typeof f=="object"&&f!==null?a.context=Ye(f):(f=Oe(t)?Yt:Re.current,a.context=xr(e,f)),a.state=e.memoizedState,f=t.getDerivedStateFromProps,typeof f=="function"&&(Zn(e,t,f,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Os.enqueueReplaceState(a,a.state,null),Ss(e,r,a,i),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t){try{var r="",i=t;do r+=dh(i),i=i.return;while(i);var a=r}catch(f){a=`
39
39
  Error generating stack: `+f.message+`
40
- `+f.stack}return{value:e,source:t,stack:a,digest:null}}function gn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function eo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Nd=typeof WeakMap=="function"?WeakMap:Map;function nu(e,t,r){r=pt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ks||(ks=!0,uo=i),eo(e,t)},r}function ou(e,t,r){r=pt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){eo(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(r.callback=function(){eo(e,t),typeof i!="function"&&(Pt===null?Pt=new Set([this]):Pt.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Jl(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Nd;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(r)||(a.add(r),e=Jd.bind(null,e,t,r),t.then(e,e))}function ea(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ta(e,t,r,i,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=pt(-1,1),t.tag=2,It(r,t,1))),r.lanes|=1),e)}var Fd=St.ReactCurrentOwner,Pe=!1;function Le(e,t,r,i){t.child=e===null?Bc(t,null,r,i):br(t,e.child,r,i)}function ra(e,t,r,i,a){r=r.render;var f=t.ref;return yr(t,a),i=Go(e,t,r,i,f,a),r=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&r&&Bo(t),t.flags|=1,Le(e,t,i,a),t.child)}function ia(e,t,r,i,a){if(e===null){var f=r.type;return typeof f=="function"&&!sl(f)&&f.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=f,lu(e,t,f,i,a)):(e=is(r.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!(e.lanes&a)){var C=f.memoizedProps;if(r=r.compare,r=r!==null?r:di,r(C,i)&&e.ref===t.ref)return mt(e,t,a)}return t.flags|=1,e=Ot(f,i),e.ref=t.ref,e.return=t,t.child=e}function lu(e,t,r,i,a){if(e!==null){var f=e.memoizedProps;if(di(f,i)&&e.ref===t.ref)if(Pe=!1,t.pendingProps=i=f,(e.lanes&a)!==0)e.flags&131072&&(Pe=!0);else return t.lanes=e.lanes,mt(e,t,a)}return to(e,t,r,i,a)}function au(e,t,r){var i=t.pendingProps,a=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},se(_r,He),He|=r;else{if(!(r&1073741824))return e=f!==null?f.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,se(_r,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=f!==null?f.baseLanes:r,se(_r,He),He|=i}else f!==null?(i=f.baseLanes|r,t.memoizedState=null):i=r,se(_r,He),He|=i;return Le(e,t,a,r),t.child}function cu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function to(e,t,r,i,a){var f=Oe(r)?Yt:Re.current;return f=xr(t,f),yr(t,a),r=Go(e,t,r,i,f,a),i=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&i&&Bo(t),t.flags|=1,Le(e,t,r,a),t.child)}function sa(e,t,r,i,a){if(Oe(r)){var f=!0;ps(t)}else f=!1;if(yr(t,a),t.stateNode===null)es(e,t),su(t,r,i),Jn(t,r,i,a),i=!0;else if(e===null){var C=t.stateNode,l=t.memoizedProps;C.props=l;var c=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ye(d):(d=Oe(r)?Yt:Re.current,d=xr(t,d));var S=r.getDerivedStateFromProps,h=typeof S=="function"||typeof C.getSnapshotBeforeUpdate=="function";h||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(l!==i||c!==d)&&Zl(t,C,i,d),kt=!1;var _=t.memoizedState;C.state=_,Ss(t,i,C,a),c=t.memoizedState,l!==i||_!==c||Be.current||kt?(typeof S=="function"&&(Zn(t,r,S,i),c=t.memoizedState),(l=kt||Ql(t,r,l,i,_,c,d))?(h||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),C.props=i,C.state=c,C.context=d,i=l):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,jc(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Ze(t.type,l),C.props=d,h=t.pendingProps,_=C.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ye(c):(c=Oe(r)?Yt:Re.current,c=xr(t,c));var m=r.getDerivedStateFromProps;(S=typeof m=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(l!==h||_!==c)&&Zl(t,C,i,c),kt=!1,_=t.memoizedState,C.state=_,Ss(t,i,C,a);var x=t.memoizedState;l!==h||_!==x||Be.current||kt?(typeof m=="function"&&(Zn(t,r,m,i),x=t.memoizedState),(d=kt||Ql(t,r,d,i,_,x,c)||!1)?(S||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,x,c),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,x,c)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=x),C.props=i,C.state=x,C.context=c,i=d):(typeof C.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return ro(e,t,r,i,f,a)}function ro(e,t,r,i,a,f){cu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return a&&Ul(t,r,!1),mt(e,t,f);i=t.stateNode,Fd.current=t;var l=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=br(t,e.child,null,f),t.child=br(t,null,l,f)):Le(e,t,l,f),t.memoizedState=i.state,a&&Ul(t,r,!0),t.child}function uu(e){var t=e.stateNode;t.pendingContext?Wl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wl(e,t.context,!1),Uo(e,t.containerInfo)}function na(e,t,r,i,a){return kr(),jo(a),t.flags|=256,Le(e,t,r,i),t.child}var io={dehydrated:null,treeContext:null,retryLane:0};function so(e){return{baseLanes:e,cachePool:null,transitions:null}}function hu(e,t,r){var i=t.pendingProps,a=ue.current,f=!1,C=(t.flags&128)!==0,l;if((l=C)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),se(ue,a&1),e===null)return Xn(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(C=i.children,e=i.fallback,f?(i=t.mode,f=t.child,C={mode:"hidden",children:C},!(i&1)&&f!==null?(f.childLanes=0,f.pendingProps=C):f=Ns(C,i,0,null),e=qt(e,i,r,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=so(r),t.memoizedState=io,e):Qo(t,C));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return zd(e,t,C,i,l,a,r);if(f){f=i.fallback,C=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:i.children};return!(C&1)&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=Ot(a,c),i.subtreeFlags=a.subtreeFlags&14680064),l!==null?f=Ot(l,f):(f=qt(f,C,r,null),f.flags|=2),f.return=t,i.return=t,i.sibling=f,t.child=i,i=f,f=t.child,C=e.child.memoizedState,C=C===null?so(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},f.memoizedState=C,f.childLanes=e.childLanes&~r,t.memoizedState=io,i}return f=e.child,e=f.sibling,i=Ot(f,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Qo(e,t){return t=Ns({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wi(e,t,r,i){return i!==null&&jo(i),br(t,e.child,null,r),e=Qo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zd(e,t,r,i,a,f,C){if(r)return t.flags&256?(t.flags&=-257,i=gn(Error(V(422))),Wi(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=i.fallback,a=t.mode,i=Ns({mode:"visible",children:i.children},a,0,null),f=qt(f,a,C,null),f.flags|=2,i.return=t,f.return=t,i.sibling=f,t.child=i,t.mode&1&&br(t,e.child,null,C),t.child.memoizedState=so(C),t.memoizedState=io,f);if(!(t.mode&1))return Wi(e,t,C,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var l=i.dgst;return i=l,f=Error(V(419)),i=gn(f,i,void 0),Wi(e,t,C,i)}if(l=(C&e.childLanes)!==0,Pe||l){if(i=ye,i!==null){switch(C&-C){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(i.suspendedLanes|C)?0:a,a!==0&&a!==f.retryLane&&(f.retryLane=a,gt(e,a),rt(i,e,a,-1))}return il(),i=gn(Error(V(421))),Wi(e,t,C,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=ef.bind(null,e),a._reactRetry=t,null):(e=f.treeContext,Ne=Mt(a.nextSibling),Fe=t,ae=!0,et=null,e!==null&&(Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,dt=e.id,ft=e.overflow,Xt=t),t=Qo(t,i.children),t.flags|=4096,t)}function oa(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Qn(e.return,t,r)}function mn(e,t,r,i,a){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:a}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=r,f.tailMode=a)}function du(e,t,r){var i=t.pendingProps,a=i.revealOrder,f=i.tail;if(Le(e,t,i.children,r),i=ue.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oa(e,r,t);else if(e.tag===19)oa(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(se(ue,i),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&ys(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),mn(t,!1,a,r,f);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ys(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}mn(t,!0,r,null,f);break;case"together":mn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function es(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Zt|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,r=Ot(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ot(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Wd(e,t,r){switch(t.tag){case 3:uu(t),kr();break;case 5:Hc(t);break;case 1:Oe(t.type)&&ps(t);break;case 4:Uo(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;se(gs,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(se(ue,ue.current&1),t.flags|=128,null):r&t.child.childLanes?hu(e,t,r):(se(ue,ue.current&1),e=mt(e,t,r),e!==null?e.sibling:null);se(ue,ue.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return du(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),se(ue,ue.current),i)break;return null;case 22:case 23:return t.lanes=0,au(e,t,r)}return mt(e,t,r)}var fu,no,pu,_u;fu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};no=function(){};pu=function(e,t,r,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,Vt(ct.current);var f=null;switch(r){case"input":a=Rn(e,a),i=Rn(e,i),f=[];break;case"select":a=de({},a,{value:void 0}),i=de({},i,{value:void 0}),f=[];break;case"textarea":a=Tn(e,a),i=Tn(e,i),f=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=ds)}Mn(r,i);var C;r=null;for(d in a)if(!i.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(C in l)l.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ni.hasOwnProperty(d)?f||(f=[]):(f=f||[]).push(d,null));for(d in i){var c=i[d];if(l=a!=null?a[d]:void 0,i.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(C in l)!l.hasOwnProperty(C)||c&&c.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in c)c.hasOwnProperty(C)&&l[C]!==c[C]&&(r||(r={}),r[C]=c[C])}else r||(f||(f=[]),f.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(f=f||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(f=f||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ni.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&oe("scroll",e),f||l===c||(f=[])):(f=f||[]).push(d,c))}r&&(f=f||[]).push("style",r);var d=f;(t.updateQueue=d)&&(t.flags|=4)}};_u=function(e,t,r,i){r!==i&&(t.flags|=4)};function Wr(e,t){if(!ae)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Ud(e,t,r){var i=t.pendingProps;switch(Oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return Oe(t.type)&&fs(),be(t),null;case 3:return i=t.stateNode,Er(),le(Be),le(Re),Ko(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,et!==null&&(po(et),et=null))),no(e,t),be(t),null;case 5:$o(t);var a=Vt(gi.current);if(r=t.type,e!==null&&t.stateNode!=null)pu(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(V(166));return be(t),null}if(e=Vt(ct.current),Fi(t)){i=t.stateNode,r=t.type;var f=t.memoizedProps;switch(i[lt]=t,i[_i]=f,e=(t.mode&1)!==0,r){case"dialog":oe("cancel",i),oe("close",i);break;case"iframe":case"object":case"embed":oe("load",i);break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],i);break;case"source":oe("error",i);break;case"img":case"image":case"link":oe("error",i),oe("load",i);break;case"details":oe("toggle",i);break;case"input":_l(i,f),oe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!f.multiple},oe("invalid",i);break;case"textarea":gl(i,f),oe("invalid",i)}Mn(r,f),a=null;for(var C in f)if(f.hasOwnProperty(C)){var l=f[C];C==="children"?typeof l=="string"?i.textContent!==l&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,l,e),a=["children",l]):typeof l=="number"&&i.textContent!==""+l&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,l,e),a=["children",""+l]):ni.hasOwnProperty(C)&&l!=null&&C==="onScroll"&&oe("scroll",i)}switch(r){case"input":Ai(i),vl(i,f,!0);break;case"textarea":Ai(i),ml(i);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(i.onclick=ds)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ua(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[lt]=t,e[_i]=i,fu(e,t,!1,!1),t.stateNode=e;e:{switch(C=In(r,i),r){case"dialog":oe("cancel",e),oe("close",e),a=i;break;case"iframe":case"object":case"embed":oe("load",e),a=i;break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],e);a=i;break;case"source":oe("error",e),a=i;break;case"img":case"image":case"link":oe("error",e),oe("load",e),a=i;break;case"details":oe("toggle",e),a=i;break;case"input":_l(e,i),a=Rn(e,i),oe("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=de({},i,{value:void 0}),oe("invalid",e);break;case"textarea":gl(e,i),a=Tn(e,i),oe("invalid",e);break;default:a=i}Mn(r,a),l=a;for(f in l)if(l.hasOwnProperty(f)){var c=l[f];f==="style"?Va(e,c):f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&$a(e,c)):f==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&oi(e,c):typeof c=="number"&&oi(e,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ni.hasOwnProperty(f)?c!=null&&f==="onScroll"&&oe("scroll",e):c!=null&&Co(e,f,c,C))}switch(r){case"input":Ai(e),vl(e,i,!1);break;case"textarea":Ai(e),ml(e);break;case"option":i.value!=null&&e.setAttribute("value",""+jt(i.value));break;case"select":e.multiple=!!i.multiple,f=i.value,f!=null?vr(e,!!i.multiple,f,!1):i.defaultValue!=null&&vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ds)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)_u(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(V(166));if(r=Vt(gi.current),Vt(ct.current),Fi(t)){if(i=t.stateNode,r=t.memoizedProps,i[lt]=t,(f=i.nodeValue!==r)&&(e=Fe,e!==null))switch(e.tag){case 3:Ni(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ni(i.nodeValue,r,(e.mode&1)!==0)}f&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[lt]=t,t.stateNode=i}return be(t),null;case 13:if(le(ue),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Ne!==null&&t.mode&1&&!(t.flags&128))Ic(),kr(),t.flags|=98560,f=!1;else if(f=Fi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!f)throw Error(V(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(V(317));f[lt]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;be(t),f=!1}else et!==null&&(po(et),et=null),f=!0;if(!f)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||ue.current&1?me===0&&(me=3):il())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return Er(),no(e,t),e===null&&fi(t.stateNode.containerInfo),be(t),null;case 10:return Fo(t.type._context),be(t),null;case 17:return Oe(t.type)&&fs(),be(t),null;case 19:if(le(ue),f=t.memoizedState,f===null)return be(t),null;if(i=(t.flags&128)!==0,C=f.rendering,C===null)if(i)Wr(f,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=ys(e),C!==null){for(t.flags|=128,Wr(f,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)f=r,e=i,f.flags&=14680066,C=f.alternate,C===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=C.childLanes,f.lanes=C.lanes,f.child=C.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=C.memoizedProps,f.memoizedState=C.memoizedState,f.updateQueue=C.updateQueue,f.type=C.type,e=C.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return se(ue,ue.current&1|2),t.child}e=e.sibling}f.tail!==null&&_e()>Lr&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304)}else{if(!i)if(e=ys(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Wr(f,!0),f.tail===null&&f.tailMode==="hidden"&&!C.alternate&&!ae)return be(t),null}else 2*_e()-f.renderingStartTime>Lr&&r!==1073741824&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304);f.isBackwards?(C.sibling=t.child,t.child=C):(r=f.last,r!==null?r.sibling=C:t.child=C,f.last=C)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=_e(),t.sibling=null,r=ue.current,se(ue,i?r&1|2:r&1),t):(be(t),null);case 22:case 23:return rl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?He&1073741824&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function $d(e,t){switch(Oo(t),t.tag){case 1:return Oe(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Er(),le(Be),le(Re),Ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $o(t),null;case 13:if(le(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ue),null;case 4:return Er(),null;case 10:return Fo(t.type._context),null;case 22:case 23:return rl(),null;case 24:return null;default:return null}}var Ui=!1,Ee=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,Z=null;function pr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){pe(e,t,i)}else r.current=null}function oo(e,t,r){try{r()}catch(i){pe(e,t,i)}}var la=!1;function Vd(e,t){if(Un=cs,e=yc(),Po(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var C=0,l=-1,c=-1,d=0,S=0,h=e,_=null;t:for(;;){for(var m;h!==r||a!==0&&h.nodeType!==3||(l=C+a),h!==f||i!==0&&h.nodeType!==3||(c=C+i),h.nodeType===3&&(C+=h.nodeValue.length),(m=h.firstChild)!==null;)_=h,h=m;for(;;){if(h===e)break t;if(_===r&&++d===a&&(l=C),_===f&&++S===i&&(c=C),(m=h.nextSibling)!==null)break;h=_,_=h.parentNode}h=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for($n={focusedElem:e,selectionRange:r},cs=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,u=x.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ze(t.type,v),u);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var n=t.stateNode.containerInfo;n.nodeType===1?n.textContent="":n.nodeType===9&&n.documentElement&&n.removeChild(n.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(p){pe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return x=la,la=!1,x}function ri(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var f=a.destroy;a.destroy=void 0,f!==void 0&&oo(t,r,f)}a=a.next}while(a!==i)}}function js(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function lo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[_i],delete t[Gn],delete t[Ld],delete t[Dd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gu(e){return e.tag===5||e.tag===3||e.tag===4}function aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ao(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ds));else if(i!==4&&(e=e.child,e!==null))for(ao(e,t,r),e=e.sibling;e!==null;)ao(e,t,r),e=e.sibling}function co(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(co(e,t,r),e=e.sibling;e!==null;)co(e,t,r),e=e.sibling}var Ce=null,Je=!1;function wt(e,t,r){for(r=r.child;r!==null;)mu(e,t,r),r=r.sibling}function mu(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ds,r)}catch{}switch(r.tag){case 5:Ee||pr(r,t);case 6:var i=Ce,a=Je;Ce=null,wt(e,t,r),Ce=i,Je=a,Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ce.removeChild(r.stateNode));break;case 18:Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?hn(e.parentNode,r):e.nodeType===1&&hn(e,r),ui(e)):hn(Ce,r.stateNode));break;case 4:i=Ce,a=Je,Ce=r.stateNode.containerInfo,Je=!0,wt(e,t,r),Ce=i,Je=a;break;case 0:case 11:case 14:case 15:if(!Ee&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var f=a,C=f.destroy;f=f.tag,C!==void 0&&(f&2||f&4)&&oo(r,t,C),a=a.next}while(a!==i)}wt(e,t,r);break;case 1:if(!Ee&&(pr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(l){pe(r,t,l)}wt(e,t,r);break;case 21:wt(e,t,r);break;case 22:r.mode&1?(Ee=(i=Ee)||r.memoizedState!==null,wt(e,t,r),Ee=i):wt(e,t,r);break;default:wt(e,t,r)}}function ca(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Kd),t.forEach(function(i){var a=tf.bind(null,e,i);r.has(i)||(r.add(i),i.then(a,a))})}}function Qe(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{var f=e,C=t,l=C;e:for(;l!==null;){switch(l.tag){case 5:Ce=l.stateNode,Je=!1;break e;case 3:Ce=l.stateNode.containerInfo,Je=!0;break e;case 4:Ce=l.stateNode.containerInfo,Je=!0;break e}l=l.return}if(Ce===null)throw Error(V(160));mu(f,C,a),Ce=null,Je=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){pe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Su(t,e),t=t.sibling}function Su(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qe(t,e),nt(e),i&4){try{ri(3,e,e.return),js(3,e)}catch(v){pe(e,e.return,v)}try{ri(5,e,e.return)}catch(v){pe(e,e.return,v)}}break;case 1:Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return);break;case 5:if(Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return),e.flags&32){var a=e.stateNode;try{oi(a,"")}catch(v){pe(e,e.return,v)}}if(i&4&&(a=e.stateNode,a!=null)){var f=e.memoizedProps,C=r!==null?r.memoizedProps:f,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&f.type==="radio"&&f.name!=null&&za(a,f),In(l,C);var d=In(l,f);for(C=0;C<c.length;C+=2){var S=c[C],h=c[C+1];S==="style"?Va(a,h):S==="dangerouslySetInnerHTML"?$a(a,h):S==="children"?oi(a,h):Co(a,S,h,d)}switch(l){case"input":Ln(a,f);break;case"textarea":Wa(a,f);break;case"select":var _=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!f.multiple;var m=f.value;m!=null?vr(a,!!f.multiple,m,!1):_!==!!f.multiple&&(f.defaultValue!=null?vr(a,!!f.multiple,f.defaultValue,!0):vr(a,!!f.multiple,f.multiple?[]:"",!1))}a[_i]=f}catch(v){pe(e,e.return,v)}}break;case 6:if(Qe(t,e),nt(e),i&4){if(e.stateNode===null)throw Error(V(162));a=e.stateNode,f=e.memoizedProps;try{a.nodeValue=f}catch(v){pe(e,e.return,v)}}break;case 3:if(Qe(t,e),nt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(v){pe(e,e.return,v)}break;case 4:Qe(t,e),nt(e);break;case 13:Qe(t,e),nt(e),a=e.child,a.flags&8192&&(f=a.memoizedState!==null,a.stateNode.isHidden=f,!f||a.alternate!==null&&a.alternate.memoizedState!==null||(el=_e())),i&4&&ca(e);break;case 22:if(S=r!==null&&r.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||S,Qe(t,e),Ee=d):Qe(t,e),nt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!S&&e.mode&1)for(Z=e,S=e.child;S!==null;){for(h=Z=S;Z!==null;){switch(_=Z,m=_.child,_.tag){case 0:case 11:case 14:case 15:ri(4,_,_.return);break;case 1:pr(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){pe(i,r,v)}}break;case 5:pr(_,_.return);break;case 22:if(_.memoizedState!==null){ha(h);continue}}m!==null?(m.return=_,Z=m):ha(h)}S=S.sibling}e:for(S=null,h=e;;){if(h.tag===5){if(S===null){S=h;try{a=h.stateNode,d?(f=a.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(l=h.stateNode,c=h.memoizedProps.style,C=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ka("display",C))}catch(v){pe(e,e.return,v)}}}else if(h.tag===6){if(S===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){pe(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;S===h&&(S=null),h=h.return}S===h&&(S=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Qe(t,e),nt(e),i&4&&ca(e);break;case 21:break;default:Qe(t,e),nt(e)}}function nt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(gu(r)){var i=r;break e}r=r.return}throw Error(V(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(oi(a,""),i.flags&=-33);var f=aa(e);co(e,f,a);break;case 3:case 4:var C=i.stateNode.containerInfo,l=aa(e);ao(e,l,C);break;default:throw Error(V(161))}}catch(c){pe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e,t,r){Z=e,yu(e)}function yu(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var a=Z,f=a.child;if(a.tag===22&&i){var C=a.memoizedState!==null||Ui;if(!C){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Ee;l=Ui;var d=Ee;if(Ui=C,(Ee=c)&&!d)for(Z=a;Z!==null;)C=Z,c=C.child,C.tag===22&&C.memoizedState!==null?da(a):c!==null?(c.return=C,Z=c):da(a);for(;f!==null;)Z=f,yu(f),f=f.sibling;Z=a,Ui=l,Ee=d}ua(e)}else a.subtreeFlags&8772&&f!==null?(f.return=a,Z=f):ua(e)}}function ua(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||js(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ee)if(r===null)i.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ze(t.type,r.memoizedProps);i.componentDidUpdate(a,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&ql(t,f,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}ql(t,C,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var S=d.memoizedState;if(S!==null){var h=S.dehydrated;h!==null&&ui(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}Ee||t.flags&512&&lo(t)}catch(_){pe(t,t.return,_)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function ha(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function da(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{js(4,t)}catch(c){pe(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(c){pe(t,a,c)}}var f=t.return;try{lo(t)}catch(c){pe(t,f,c)}break;case 5:var C=t.return;try{lo(t)}catch(c){pe(t,C,c)}}}catch(c){pe(t,t.return,c)}if(t===e){Z=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Z=l;break}Z=t.return}}var qd=Math.ceil,xs=St.ReactCurrentDispatcher,Zo=St.ReactCurrentOwner,qe=St.ReactCurrentBatchConfig,re=0,ye=null,ve=null,we=0,He=0,_r=Ft(0),me=0,Ci=null,Zt=0,Hs=0,Jo=0,ii=null,Ie=null,el=0,Lr=1/0,ut=null,ks=!1,uo=null,Pt=null,$i=!1,Lt=null,bs=0,si=0,ho=null,ts=-1,rs=0;function De(){return re&6?_e():ts!==-1?ts:ts=_e()}function Bt(e){return e.mode&1?re&2&&we!==0?we&-we:Ad.transition!==null?(rs===0&&(rs=sc()),rs):(e=ie,e!==0||(e=window.event,e=e===void 0?16:hc(e.type)),e):1}function rt(e,t,r,i){if(50<si)throw si=0,ho=null,Error(V(185));xi(e,r,i),(!(re&2)||e!==ye)&&(e===ye&&(!(re&2)&&(Hs|=r),me===4&&Et(e,we)),je(e,i),r===1&&re===0&&!(t.mode&1)&&(Lr=_e()+500,Ps&&zt()))}function je(e,t){var r=e.callbackNode;Ah(e,t);var i=as(e,e===ye?we:0);if(i===0)r!==null&&Cl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Cl(r),t===1)e.tag===0?Td(fa.bind(null,e)):Tc(fa.bind(null,e)),Ed(function(){!(re&6)&&zt()}),r=null;else{switch(nc(i)){case 1:r=Eo;break;case 4:r=rc;break;case 16:r=ls;break;case 536870912:r=ic;break;default:r=ls}r=Lu(r,Cu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Cu(e,t){if(ts=-1,rs=0,re&6)throw Error(V(327));var r=e.callbackNode;if(Cr()&&e.callbackNode!==r)return null;var i=as(e,e===ye?we:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Es(e,i);else{t=i;var a=re;re|=2;var f=xu();(ye!==e||we!==t)&&(ut=null,Lr=_e()+500,Gt(e,t));do try{Qd();break}catch(l){wu(e,l)}while(!0);No(),xs.current=f,re=a,ve!==null?t=0:(ye=null,we=0,t=me)}if(t!==0){if(t===2&&(a=Hn(e),a!==0&&(i=a,t=fo(e,a))),t===1)throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;if(t===6)Et(e,i);else{if(a=e.current.alternate,!(i&30)&&!Yd(a)&&(t=Es(e,i),t===2&&(f=Hn(e),f!==0&&(i=f,t=fo(e,f))),t===1))throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(V(345));case 2:Ut(e,Ie,ut);break;case 3:if(Et(e,i),(i&130023424)===i&&(t=el+500-_e(),10<t)){if(as(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){De(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Vn(Ut.bind(null,e,Ie,ut),t);break}Ut(e,Ie,ut);break;case 4:if(Et(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var C=31-tt(i);f=1<<C,C=t[C],C>a&&(a=C),i&=~f}if(i=a,i=_e()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qd(i/1960))-i,10<i){e.timeoutHandle=Vn(Ut.bind(null,e,Ie,ut),i);break}Ut(e,Ie,ut);break;case 5:Ut(e,Ie,ut);break;default:throw Error(V(329))}}}return je(e,_e()),e.callbackNode===r?Cu.bind(null,e):null}function fo(e,t){var r=ii;return e.current.memoizedState.isDehydrated&&(Gt(e,t).flags|=256),e=Es(e,t),e!==2&&(t=Ie,Ie=r,t!==null&&po(t)),e}function po(e){Ie===null?Ie=e:Ie.push.apply(Ie,e)}function Yd(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var a=r[i],f=a.getSnapshot;a=a.value;try{if(!it(f(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Et(e,t){for(t&=~Jo,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tt(t),i=1<<r;e[r]=-1,t&=~i}}function fa(e){if(re&6)throw Error(V(327));Cr();var t=as(e,0);if(!(t&1))return je(e,_e()),null;var r=Es(e,t);if(e.tag!==0&&r===2){var i=Hn(e);i!==0&&(t=i,r=fo(e,i))}if(r===1)throw r=Ci,Gt(e,0),Et(e,t),je(e,_e()),r;if(r===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,Ie,ut),je(e,_e()),null}function tl(e,t){var r=re;re|=1;try{return e(t)}finally{re=r,re===0&&(Lr=_e()+500,Ps&&zt())}}function Jt(e){Lt!==null&&Lt.tag===0&&!(re&6)&&Cr();var t=re;re|=1;var r=qe.transition,i=ie;try{if(qe.transition=null,ie=1,e)return e()}finally{ie=i,qe.transition=r,re=t,!(re&6)&&zt()}}function rl(){He=_r.current,le(_r)}function Gt(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,bd(r)),ve!==null)for(r=ve.return;r!==null;){var i=r;switch(Oo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fs();break;case 3:Er(),le(Be),le(Re),Ko();break;case 5:$o(i);break;case 4:Er();break;case 13:le(ue);break;case 19:le(ue);break;case 10:Fo(i.type._context);break;case 22:case 23:rl()}r=r.return}if(ye=e,ve=e=Ot(e.current,null),we=He=t,me=0,Ci=null,Jo=Hs=Zt=0,Ie=ii=null,Kt!==null){for(t=0;t<Kt.length;t++)if(r=Kt[t],i=r.interleaved,i!==null){r.interleaved=null;var a=i.next,f=r.pending;if(f!==null){var C=f.next;f.next=a,i.next=C}r.pending=i}Kt=null}return e}function wu(e,t){do{var r=ve;try{if(No(),Zi.current=ws,Cs){for(var i=he.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Cs=!1}if(Qt=0,Se=ge=he=null,ti=!1,mi=0,Zo.current=null,r===null||r.return===null){me=1,Ci=t,ve=null;break}e:{var f=e,C=r.return,l=r,c=t;if(t=we,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,S=l,h=S.tag;if(!(S.mode&1)&&(h===0||h===11||h===15)){var _=S.alternate;_?(S.updateQueue=_.updateQueue,S.memoizedState=_.memoizedState,S.lanes=_.lanes):(S.updateQueue=null,S.memoizedState=null)}var m=ea(C);if(m!==null){m.flags&=-257,ta(m,C,l,f,t),m.mode&1&&Jl(f,d,t),t=m,c=d;var x=t.updateQueue;if(x===null){var v=new Set;v.add(c),t.updateQueue=v}else x.add(c);break e}else{if(!(t&1)){Jl(f,d,t),il();break e}c=Error(V(426))}}else if(ae&&l.mode&1){var u=ea(C);if(u!==null){!(u.flags&65536)&&(u.flags|=256),ta(u,C,l,f,t),jo(Rr(c,l));break e}}f=c=Rr(c,l),me!==4&&(me=2),ii===null?ii=[f]:ii.push(f),f=C;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var o=nu(f,c,t);Gl(f,o);break e;case 1:l=c;var s=f.type,n=f.stateNode;if(!(f.flags&128)&&(typeof s.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Pt===null||!Pt.has(n)))){f.flags|=65536,t&=-t,f.lanes|=t;var p=ou(f,l,t);Gl(f,p);break e}}f=f.return}while(f!==null)}bu(r)}catch(w){t=w,ve===r&&r!==null&&(ve=r=r.return);continue}break}while(!0)}function xu(){var e=xs.current;return xs.current=ws,e===null?ws:e}function il(){(me===0||me===3||me===2)&&(me=4),ye===null||!(Zt&268435455)&&!(Hs&268435455)||Et(ye,we)}function Es(e,t){var r=re;re|=2;var i=xu();(ye!==e||we!==t)&&(ut=null,Gt(e,t));do try{Xd();break}catch(a){wu(e,a)}while(!0);if(No(),re=r,xs.current=i,ve!==null)throw Error(V(261));return ye=null,we=0,me}function Xd(){for(;ve!==null;)ku(ve)}function Qd(){for(;ve!==null&&!wh();)ku(ve)}function ku(e){var t=Ru(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?bu(e):ve=t,Zo.current=null}function bu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=$d(r,t),r!==null){r.flags&=32767,ve=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,ve=null;return}}else if(r=Ud(r,t,He),r!==null){ve=r;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);me===0&&(me=5)}function Ut(e,t,r){var i=ie,a=qe.transition;try{qe.transition=null,ie=1,Zd(e,t,r,i)}finally{qe.transition=a,ie=i}return null}function Zd(e,t,r,i){do Cr();while(Lt!==null);if(re&6)throw Error(V(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var f=r.lanes|r.childLanes;if(Mh(e,f),e===ye&&(ve=ye=null,we=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||$i||($i=!0,Lu(ls,function(){return Cr(),null})),f=(r.flags&15990)!==0,r.subtreeFlags&15990||f){f=qe.transition,qe.transition=null;var C=ie;ie=1;var l=re;re|=4,Zo.current=null,Vd(e,r),Su(r,e),md($n),cs=!!Un,$n=Un=null,e.current=r,Gd(r),xh(),re=l,ie=C,qe.transition=f}else e.current=r;if($i&&($i=!1,Lt=e,bs=a),f=e.pendingLanes,f===0&&(Pt=null),Eh(r.stateNode),je(e,_e()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],i(a.value,{componentStack:a.stack,digest:a.digest});if(ks)throw ks=!1,e=uo,uo=null,e;return bs&1&&e.tag!==0&&Cr(),f=e.pendingLanes,f&1?e===ho?si++:(si=0,ho=e):si=0,zt(),null}function Cr(){if(Lt!==null){var e=nc(bs),t=qe.transition,r=ie;try{if(qe.transition=null,ie=16>e?16:e,Lt===null)var i=!1;else{if(e=Lt,Lt=null,bs=0,re&6)throw Error(V(331));var a=re;for(re|=4,Z=e.current;Z!==null;){var f=Z,C=f.child;if(Z.flags&16){var l=f.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Z=d;Z!==null;){var S=Z;switch(S.tag){case 0:case 11:case 15:ri(8,S,f)}var h=S.child;if(h!==null)h.return=S,Z=h;else for(;Z!==null;){S=Z;var _=S.sibling,m=S.return;if(vu(S),S===d){Z=null;break}if(_!==null){_.return=m,Z=_;break}Z=m}}}var x=f.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var u=v.sibling;v.sibling=null,v=u}while(v!==null)}}Z=f}}if(f.subtreeFlags&2064&&C!==null)C.return=f,Z=C;else e:for(;Z!==null;){if(f=Z,f.flags&2048)switch(f.tag){case 0:case 11:case 15:ri(9,f,f.return)}var o=f.sibling;if(o!==null){o.return=f.return,Z=o;break e}Z=f.return}}var s=e.current;for(Z=s;Z!==null;){C=Z;var n=C.child;if(C.subtreeFlags&2064&&n!==null)n.return=C,Z=n;else e:for(C=s;Z!==null;){if(l=Z,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:js(9,l)}}catch(w){pe(l,l.return,w)}if(l===C){Z=null;break e}var p=l.sibling;if(p!==null){p.return=l.return,Z=p;break e}Z=l.return}}if(re=a,zt(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ds,e)}catch{}i=!0}return i}finally{ie=r,qe.transition=t}}return!1}function pa(e,t,r){t=Rr(r,t),t=nu(e,t,1),e=It(e,t,1),t=De(),e!==null&&(xi(e,1,t),je(e,t))}function pe(e,t,r){if(e.tag===3)pa(e,e,r);else for(;t!==null;){if(t.tag===3){pa(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Pt===null||!Pt.has(i))){e=Rr(r,e),e=ou(t,e,1),t=It(t,e,1),e=De(),t!==null&&(xi(t,1,e),je(t,e));break}}t=t.return}}function Jd(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&r,ye===e&&(we&r)===r&&(me===4||me===3&&(we&130023424)===we&&500>_e()-el?Gt(e,0):Jo|=r),je(e,t)}function Eu(e,t){t===0&&(e.mode&1?(t=Pi,Pi<<=1,!(Pi&130023424)&&(Pi=4194304)):t=1);var r=De();e=gt(e,t),e!==null&&(xi(e,t,r),je(e,r))}function ef(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Eu(e,r)}function tf(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(V(314))}i!==null&&i.delete(t),Eu(e,r)}var Ru;Ru=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Pe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pe=!1,Wd(e,t,r);Pe=!!(e.flags&131072)}else Pe=!1,ae&&t.flags&1048576&&Ac(t,vs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;es(e,t),e=t.pendingProps;var a=xr(t,Re.current);yr(t,r),a=Go(null,t,i,e,a,r);var f=qo();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oe(i)?(f=!0,ps(t)):f=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Wo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,Jn(t,i,e,r),t=ro(null,t,i,!0,f,r)):(t.tag=0,ae&&f&&Bo(t),Le(null,t,a,r),t=t.child),t;case 16:i=t.elementType;e:{switch(es(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=sf(i),e=Ze(i,e),a){case 0:t=to(null,t,i,e,r);break e;case 1:t=sa(null,t,i,e,r);break e;case 11:t=ra(null,t,i,e,r);break e;case 14:t=ia(null,t,i,Ze(i.type,e),r);break e}throw Error(V(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),to(e,t,i,a,r);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),sa(e,t,i,a,r);case 3:e:{if(uu(t),e===null)throw Error(V(387));i=t.pendingProps,f=t.memoizedState,a=f.element,jc(e,t),Ss(t,i,null,r);var C=t.memoizedState;if(i=C.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){a=Rr(Error(V(423)),t),t=na(e,t,i,r,a);break e}else if(i!==a){a=Rr(Error(V(424)),t),t=na(e,t,i,r,a);break e}else for(Ne=Mt(t.stateNode.containerInfo.firstChild),Fe=t,ae=!0,et=null,r=Bc(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(kr(),i===a){t=mt(e,t,r);break e}Le(e,t,i,r)}t=t.child}return t;case 5:return Hc(t),e===null&&Xn(t),i=t.type,a=t.pendingProps,f=e!==null?e.memoizedProps:null,C=a.children,Kn(i,a)?C=null:f!==null&&Kn(i,f)&&(t.flags|=32),cu(e,t),Le(e,t,C,r),t.child;case 6:return e===null&&Xn(t),null;case 13:return hu(e,t,r);case 4:return Uo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=br(t,null,i,r):Le(e,t,i,r),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),ra(e,t,i,a,r);case 7:return Le(e,t,t.pendingProps,r),t.child;case 8:return Le(e,t,t.pendingProps.children,r),t.child;case 12:return Le(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,f=t.memoizedProps,C=a.value,se(gs,i._currentValue),i._currentValue=C,f!==null)if(it(f.value,C)){if(f.children===a.children&&!Be.current){t=mt(e,t,r);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var l=f.dependencies;if(l!==null){C=f.child;for(var c=l.firstContext;c!==null;){if(c.context===i){if(f.tag===1){c=pt(-1,r&-r),c.tag=2;var d=f.updateQueue;if(d!==null){d=d.shared;var S=d.pending;S===null?c.next=c:(c.next=S.next,S.next=c),d.pending=c}}f.lanes|=r,c=f.alternate,c!==null&&(c.lanes|=r),Qn(f.return,r,t),l.lanes|=r;break}c=c.next}}else if(f.tag===10)C=f.type===t.type?null:f.child;else if(f.tag===18){if(C=f.return,C===null)throw Error(V(341));C.lanes|=r,l=C.alternate,l!==null&&(l.lanes|=r),Qn(C,r,t),C=f.sibling}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===t){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}Le(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,yr(t,r),a=Ye(a),i=i(a),t.flags|=1,Le(e,t,i,r),t.child;case 14:return i=t.type,a=Ze(i,t.pendingProps),a=Ze(i.type,a),ia(e,t,i,a,r);case 15:return lu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),es(e,t),t.tag=1,Oe(i)?(e=!0,ps(t)):e=!1,yr(t,r),su(t,i,a),Jn(t,i,a,r),ro(null,t,i,!0,e,r);case 19:return du(e,t,r);case 22:return au(e,t,r)}throw Error(V(156,t.tag))};function Lu(e,t){return tc(e,t)}function rf(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,r,i){return new rf(e,t,r,i)}function sl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sf(e){if(typeof e=="function")return sl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xo)return 11;if(e===ko)return 14}return 2}function Ot(e,t){var r=e.alternate;return r===null?(r=Ge(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function is(e,t,r,i,a,f){var C=2;if(i=e,typeof e=="function")sl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case nr:return qt(r.children,a,f,t);case wo:C=8,a|=8;break;case xn:return e=Ge(12,r,t,a|2),e.elementType=xn,e.lanes=f,e;case kn:return e=Ge(13,r,t,a),e.elementType=kn,e.lanes=f,e;case bn:return e=Ge(19,r,t,a),e.elementType=bn,e.lanes=f,e;case Ha:return Ns(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oa:C=10;break e;case ja:C=9;break e;case xo:C=11;break e;case ko:C=14;break e;case xt:C=16,i=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Ge(C,r,t,a),t.elementType=e,t.type=i,t.lanes=f,t}function qt(e,t,r,i){return e=Ge(7,e,i,t),e.lanes=r,e}function Ns(e,t,r,i){return e=Ge(22,e,i,t),e.elementType=Ha,e.lanes=r,e.stateNode={isHidden:!1},e}function Sn(e,t,r){return e=Ge(6,e,null,t),e.lanes=r,e}function yn(e,t,r){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nf(e,t,r,i,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function nl(e,t,r,i,a,f,C,l,c){return e=new nf(e,t,r,l,c),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Ge(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wo(f),e}function of(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Du(e){if(!e)return Ht;e=e._reactInternals;e:{if(tr(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var r=e.type;if(Oe(r))return Dc(e,r,t)}return t}function Tu(e,t,r,i,a,f,C,l,c){return e=nl(r,i,!0,e,a,f,C,l,c),e.context=Du(null),r=e.current,i=De(),a=Bt(r),f=pt(i,a),f.callback=t??null,It(r,f,a),e.current.lanes=a,xi(e,a,i),je(e,i),e}function Fs(e,t,r,i){var a=t.current,f=De(),C=Bt(a);return r=Du(r),t.context===null?t.context=r:t.pendingContext=r,t=pt(f,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=It(a,t,C),e!==null&&(rt(e,a,C,f),Qi(e,a,C)),C}function Rs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _a(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ol(e,t){_a(e,t),(e=e.alternate)&&_a(e,t)}function lf(){return null}var Au=typeof reportError=="function"?reportError:function(e){console.error(e)};function ll(e){this._internalRoot=e}zs.prototype.render=ll.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Fs(e,t,null,null)};zs.prototype.unmount=ll.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jt(function(){Fs(null,e,null,null)}),t[vt]=null}};function zs(e){this._internalRoot=e}zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ac();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bt.length&&t!==0&&t<bt[r].priority;r++);bt.splice(r,0,e),r===0&&uc(e)}};function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ws(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function va(){}function af(e,t,r,i,a){if(a){if(typeof i=="function"){var f=i;i=function(){var d=Rs(C);f.call(d)}}var C=Tu(t,i,e,0,null,!1,!1,"",va);return e._reactRootContainer=C,e[vt]=C.current,fi(e.nodeType===8?e.parentNode:e),Jt(),C}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var l=i;i=function(){var d=Rs(c);l.call(d)}}var c=nl(e,0,!1,null,null,!1,!1,"",va);return e._reactRootContainer=c,e[vt]=c.current,fi(e.nodeType===8?e.parentNode:e),Jt(function(){Fs(t,c,r,i)}),c}function Us(e,t,r,i,a){var f=r._reactRootContainer;if(f){var C=f;if(typeof a=="function"){var l=a;a=function(){var c=Rs(C);l.call(c)}}Fs(t,C,e,a)}else C=af(r,t,e,a,i);return Rs(C)}oc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=qr(t.pendingLanes);r!==0&&(Ro(t,r|1),je(t,_e()),!(re&6)&&(Lr=_e()+500,zt()))}break;case 13:Jt(function(){var i=gt(e,1);if(i!==null){var a=De();rt(i,e,1,a)}}),ol(e,1)}};Lo=function(e){if(e.tag===13){var t=gt(e,134217728);if(t!==null){var r=De();rt(t,e,134217728,r)}ol(e,134217728)}};lc=function(e){if(e.tag===13){var t=Bt(e),r=gt(e,t);if(r!==null){var i=De();rt(r,e,t,i)}ol(e,t)}};ac=function(){return ie};cc=function(e,t){var r=ie;try{return ie=e,t()}finally{ie=r}};Bn=function(e,t,r){switch(t){case"input":if(Ln(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var a=Is(i);if(!a)throw Error(V(90));Fa(i),Ln(i,a)}}}break;case"textarea":Wa(e,r);break;case"select":t=r.value,t!=null&&vr(e,!!r.multiple,t,!1)}};Ya=tl;Xa=Jt;var cf={usingClientEntryPoint:!1,Events:[bi,cr,Is,Ga,qa,tl]},Ur={findFiberByHostInstance:$t,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uf={bundleType:Ur.bundleType,version:Ur.version,rendererPackageName:Ur.rendererPackageName,rendererConfig:Ur.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:St.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ja(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||lf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ki.isDisabled&&Ki.supportsFiber)try{Ds=Ki.inject(uf),at=Ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cf;We.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!al(t))throw Error(V(200));return of(e,t,null,r)};We.createRoot=function(e,t){if(!al(e))throw Error(V(299));var r=!1,i="",a=Au;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nl(e,1,!1,null,null,r,!1,i,a),e[vt]=t.current,fi(e.nodeType===8?e.parentNode:e),new ll(t)};We.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Ja(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return Jt(e)};We.hydrate=function(e,t,r){if(!Ws(t))throw Error(V(200));return Us(null,e,t,!0,r)};We.hydrateRoot=function(e,t,r){if(!al(e))throw Error(V(405));var i=r!=null&&r.hydratedSources||null,a=!1,f="",C=Au;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Tu(t,null,e,1,r??null,a,!1,f,C),e[vt]=t.current,fi(e),i)for(e=0;e<i.length;e++)r=i[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new zs(t)};We.render=function(e,t,r){if(!Ws(t))throw Error(V(200));return Us(null,e,t,!1,r)};We.unmountComponentAtNode=function(e){if(!Ws(e))throw Error(V(40));return e._reactRootContainer?(Jt(function(){Us(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};We.unstable_batchedUpdates=tl;We.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Ws(r))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Us(e,t,r,!1,i)};We.version="18.3.1-next-f1338f8080-20240426";function Mu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mu)}catch(e){console.error(e)}}Mu(),Ma.exports=We;var hf=Ma.exports,Iu,ga=hf;Iu=ga.createRoot,ga.hydrateRoot;const df=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,ff=3e3,pf=5,_f=5e3;function vf(){const[e,t]=X.useState(!1),[r,i]=X.useState(!1),[a,f]=X.useState([]),[C,l]=X.useState([]),[c,d]=X.useState([]),[S,h]=X.useState(null),[_,m]=X.useState([]),x=X.useRef(null),v=X.useRef(new Map),u=X.useRef(null),o=X.useCallback((j,$="info")=>{const U={id:Date.now()+Math.random(),msg:j,type:$};m(Q=>[U,...Q].slice(0,pf)),setTimeout(()=>{m(Q=>Q.filter(P=>P.id!==U.id))},_f)},[]),s=X.useCallback((j,$)=>{const U=x.current;U&&U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:j,payload:$,ts:Date.now()}))},[]),n=X.useCallback(()=>{if(x.current&&x.current.readyState===WebSocket.OPEN)return;const j=new WebSocket(df);x.current=j,j.onopen=()=>{t(!0),u.current&&(clearInterval(u.current),u.current=null);for(const[$]of v.current)s("SUBSCRIBE_TERMINAL",{agentId:$})},j.onmessage=$=>{var Q,P,R,K,H;let U;try{U=JSON.parse($.data)}catch{return}switch(U.type){case"INIT":f(U.payload.tasks||[]),l(U.payload.agents||[]),d(U.payload.repos||[]),U.payload.settings&&h(U.payload.settings),i(!0);break;case"TASKS_UPDATED":f(U.payload.tasks||[]);break;case"TASK_ADDED":f(Y=>[...Y,U.payload.task]);break;case"AGENTS_UPDATED":l(U.payload.agents||[]);break;case"AGENT_UPDATED":l(Y=>Y.some(J=>J.id===U.payload.agent.id)?Y.map(J=>J.id===U.payload.agent.id?U.payload.agent:J):[...Y,U.payload.agent]);break;case"AGENT_REMOVED":l(Y=>Y.filter(z=>z.id!==U.payload.agentId));break;case"SETTINGS_UPDATED":h(U.payload);break;case"REPOS_UPDATED":d(U.payload.repos||[]);break;case"TERMINAL_DATA":{const Y=v.current.get(U.payload.agentId);Y&&Y(U.payload.data);break}case"PLAN_READY":o(`Plan ready for ${U.payload.taskId} — approval needed`,"warning");break;case"PLAN_PARTIAL":f(Y=>Y.map(z=>z.id===U.payload.taskId?{...z,plan:U.payload.plan}:z));break;case"PR_CREATED":o(`PR created for ${U.payload.taskId}`,"success");break;case"TASK_BLOCKED":o(`${U.payload.taskId} blocked: ${U.payload.reason}`,"error");break;case"REVIEW_FAILED":o(`Review failed for ${U.payload.taskId} — returning to implementor`,"warning");break;case"REVIEW_PASSED":o(`Review passed for ${U.payload.taskId}`,"success");break;case"TASK_ABORTED":o(`Task ${U.payload.taskId} aborted`,"info");break;case"TASK_RESET":o(`Task ${U.payload.taskId} reset to backlog`,"info");break;case"TASK_RETRIED":o(`Task ${U.payload.taskId} retrying from ${U.payload.retryStatus}`,"info");break;case"TASK_DELETED":o(`Task ${U.payload.taskId} deleted from Done`,"info");break;case"BRIDGE_OPENED":o(`${U.payload.agentName} opened in Terminal`,"info");break;case"BRIDGE_RETURNED":o(`${U.payload.agentName} returned to Ban Kan`,"info");break;case"BRIDGE_ERROR":o(((Q=U.payload)==null?void 0:Q.message)||"Terminal bridge failed","error");break;case"TASK_WORKSPACE_OPENED":o(((P=U.payload)==null?void 0:P.message)||`Opened workspace for ${(R=U.payload)==null?void 0:R.taskId}`,"success");break;case"TASK_WORKSPACE_ERROR":o(((K=U.payload)==null?void 0:K.message)||"Failed to open task workspace","error");break;case"SETTINGS_ERROR":o((((H=U.payload)==null?void 0:H.errors)||[]).join(", ")||"Settings update failed","error");break}},j.onclose=()=>{t(!1),x.current=null,u.current||(u.current=setInterval(n,ff))},j.onerror=()=>{j.close()}},[o,s]);X.useEffect(()=>(n(),()=>{u.current&&clearInterval(u.current),x.current&&x.current.close()}),[n]);const p=X.useCallback((j,$,U,Q)=>{s("ADD_TASK",{title:j,priority:$,description:U,repoPath:Q})},[s]),w=X.useCallback(j=>{s("APPROVE_PLAN",{taskId:j})},[s]),y=X.useCallback((j,$)=>{s("REJECT_PLAN",{taskId:j,feedback:$})},[s]),k=X.useCallback((j,$)=>{s("INJECT_MESSAGE",{agentId:j,message:$})},[s]),g=X.useCallback((j,$)=>{s("INJECT_RAW",{agentId:j,data:$})},[s]),b=X.useCallback(j=>{s("PAUSE_AGENT",{agentId:j})},[s]),T=X.useCallback(j=>{s("RESUME_AGENT",{agentId:j})},[s]),I=X.useCallback(j=>{s("PAUSE_TASK",{taskId:j})},[s]),O=X.useCallback(j=>{s("RESUME_TASK",{taskId:j})},[s]),A=X.useCallback((j,$)=>{s("EDIT_TASK",{taskId:j,updates:$})},[s]),F=X.useCallback(j=>{s("ABORT_TASK",{taskId:j})},[s]),W=X.useCallback(j=>{s("RESET_TASK",{taskId:j})},[s]),G=X.useCallback(j=>{s("RETRY_TASK",{taskId:j})},[s]),q=X.useCallback(j=>{s("DELETE_TASK",{taskId:j})},[s]),N=X.useCallback(j=>{s("OPEN_TASK_WORKSPACE",{taskId:j})},[s]),E=X.useCallback(j=>{s("UPDATE_SETTINGS",j)},[s]),D=X.useCallback(j=>{s("OPEN_AGENT_TERMINAL",{agentId:j})},[s]),M=X.useCallback(j=>{s("RETURN_AGENT_TERMINAL",{agentId:j})},[s]),B=X.useCallback((j,$)=>(v.current.set(j,$),s("SUBSCRIBE_TERMINAL",{agentId:j}),()=>{v.current.delete(j),s("UNSUBSCRIBE_TERMINAL",{agentId:j})}),[s]);return{connected:e,isInitialized:r,tasks:a,agents:C,repos:c,settings:S,notifications:_,addTask:p,approvePlan:w,rejectPlan:y,pauseTask:I,resumeTask:O,editTask:A,abortTask:F,resetTask:W,retryTask:G,deleteTask:q,openTaskWorkspace:N,injectMessage:k,sendRaw:g,pauseAgent:b,resumeAgent:T,updateSettings:E,subscribeTerminal:B,openAgentTerminal:D,returnAgentTerminal:M}}const gf={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ma={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function mf(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"now";if(r<60)return`${r}m`;const i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function Sf(e,t=72){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function yf({task:e,columnColor:t,agents:r,isAnimating:i,onApprove:a,onReject:f,onAgentClick:C,onTaskClick:l}){const[c,d]=X.useState(!1),[S,h]=X.useState(""),[_,m]=X.useState(!1),x=e.status==="blocked",v=r.find(s=>s.id===e.assignedTo),u=x?"var(--red)":t,o=x?"rgba(255,77,77,0.05)":"transparent";return L.jsxs("div",{onClick:()=>l&&l(e),onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:{cursor:"pointer",background:_?"var(--bg2)":`linear-gradient(${o}, ${o}), var(--bg1)`,borderRadius:6,borderLeft:`3px solid ${u}`,padding:"10px 12px",transform:_?"translateY(-1px)":"none",boxShadow:_?"0 4px 12px rgba(0,0,0,0.3)":"none",transition:"transform 0.15s, box-shadow 0.15s, background 0.15s",animation:i?"card-enter 0.3s ease-out":"none"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:gf[e.priority]||"var(--text3)",flexShrink:0}}),L.jsx("span",{style:{fontSize:11,color:"var(--text3)",fontFamily:"var(--font-mono)"},children:e.id}),L.jsx("span",{style:{flex:1}}),L.jsx("span",{style:{fontSize:10,color:"var(--text3)"},children:mf(e.createdAt)})]}),L.jsx("div",{style:{fontSize:12,lineHeight:1.4,marginBottom:8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:e.progress>0?6:0},children:[L.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:(ma[e.status]||"var(--text3)")+"20",color:ma[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")}),L.jsx("span",{style:{flex:1}}),v&&L.jsxs("span",{onClick:s=>{s.stopPropagation(),C(v.id)},title:`Open ${v.name} terminal`,style:{display:"inline-flex",alignItems:"center",gap:3,padding:"2px 6px",borderRadius:9,background:(v.color||"var(--text3)")+"26",color:v.color||"var(--text3)",fontSize:10,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"40",onMouseLeave:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"26",children:[L.jsx("span",{style:{fontSize:10,lineHeight:1},children:v.icon||v.id.charAt(0).toUpperCase()}),v.name]})]}),e.progress>0&&L.jsxs("div",{style:{marginBottom:6},children:[L.jsx("div",{style:{height:2,background:"var(--border)",borderRadius:1},children:L.jsx("div",{style:{height:"100%",borderRadius:1,width:`${e.progress}%`,background:t,transition:"width 0.3s"}})}),L.jsxs("div",{style:{fontSize:9,color:"var(--text3)",textAlign:"right",marginTop:2},children:[e.progress,"%"]})]}),e.status==="awaiting_approval"&&L.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[L.jsx("button",{onClick:s=>{s.stopPropagation(),a(e.id)},style:{padding:"3px 8px",borderRadius:3,background:"rgba(61, 220, 132, 0.15)",color:"var(--green)",fontSize:11},children:"Approve"}),L.jsx("button",{onClick:s=>{s.stopPropagation(),d(!0),h("")},style:{padding:"3px 8px",borderRadius:3,background:"rgba(255, 77, 77, 0.1)",color:"var(--text2)",fontSize:11},children:"Revise"})]}),e.status==="done"&&e.prUrl&&L.jsx("div",{style:{marginTop:4},children:L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{padding:"3px 8px",borderRadius:3,background:"rgba(96, 165, 250, 0.15)",color:"#60A5FA",fontSize:11,textDecoration:"none",display:"inline-block"},children:"PR"})}),x&&e.blockedReason&&L.jsxs("div",{style:{marginTop:4},children:[L.jsx("span",{style:{fontSize:10,color:"var(--red)",fontWeight:600},children:"AWAITING HUMAN INPUT"}),L.jsx("span",{title:e.blockedReason,style:{fontSize:10,color:"var(--text3)",marginLeft:6},children:Sf(e.blockedReason)})]}),c&&L.jsx("div",{style:{marginTop:6,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:S,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&S.trim()&&(f(e.id,S.trim()),d(!1),h("")),s.key==="Escape"&&(d(!1),h(""))},style:{width:"100%",fontSize:11,padding:"4px 8px"}})})]})}function Cf({column:e,tasks:t,agents:r,animatingTasks:i,onApprove:a,onReject:f,onAgentClick:C,onAddTask:l,onTaskClick:c,canCreateTask:d}){const S=e.agentPrefix?r.filter(h=>h.id.startsWith(e.agentPrefix+"-")||h.id===e.agentPrefix):[];return L.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--bg)",minHeight:0,overflow:"hidden"},children:[L.jsxs("div",{style:{padding:"12px 12px 8px",borderBottom:`2px solid ${e.color}30`},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:S.length>0?8:0},children:[L.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:e.color,flexShrink:0},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:12,letterSpacing:1,textTransform:"uppercase"},children:e.title}),L.jsx("span",{style:{flex:1}}),t.length>0&&L.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:e.color+"33",color:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600},children:t.length})]}),S.length>0&&L.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:S.map(h=>{const _=h.status==="active",m=h.status==="blocked",x=h.status==="draining",v=!_&&!m&&!x;return L.jsxs("div",{onClick:()=>C(h.id),title:`${h.name} — ${h.status}`,style:{width:22,height:22,borderRadius:"50%",background:v?"transparent":h.color||e.color,border:v?`1px solid ${h.color||e.color}66`:x?`2px dashed ${h.color||e.color}`:m?"2px solid var(--red)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,cursor:"pointer",position:"relative",opacity:v?.4:1,transition:"opacity 0.15s"},children:[h.icon||h.id.charAt(0).toUpperCase(),_&&L.jsx("span",{style:{position:"absolute",bottom:-1,right:-1,width:5,height:5,borderRadius:"50%",background:"var(--green)",border:"1px solid var(--bg)"}})]},h.id)})})]}),L.jsxs("div",{style:{flex:1,overflowY:"auto",padding:8,display:"flex",flexDirection:"column",gap:6},children:[t.length===0&&L.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text3)",fontSize:11,textAlign:"center",padding:16},children:e.id==="backlog"?d?L.jsx("span",{onClick:l,style:{cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:"No tasks — click + ADD TASK"}):"No tasks yet — add a repository in Settings to create your first task":e.id==="done"?"No completed tasks":"All clear"}),t.map(h=>L.jsx(yf,{task:h,columnColor:e.color,agents:r,isAnimating:i.has(h.id),onApprove:a,onReject:f,onAgentClick:C,onTaskClick:c},h.id))]})]})}function $r({children:e}){return L.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:{width:"100%",height:"100%",display:"block"},children:e})}const ir=[{id:"backlog",title:"Backlog",icon:L.jsxs($r,{children:[L.jsx("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"M5 6h6M5 8.5h6M5 11h3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["backlog","paused","aborted"],agentPrefix:null,color:"var(--text3)"},{id:"planning",title:"Planning",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M4 12.5h2.25l5.75-5.75-2.25-2.25L4 10.25v2.25Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M8.75 5.75 11 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M3.5 13h9",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["workspace_setup","planning","awaiting_approval"],agentPrefix:"plan",color:"var(--steel2)"},{id:"implementation",title:"Implementation",icon:L.jsxs($r,{children:[L.jsx("path",{d:"m6.25 4.5 1.25-1.25 5 5L11.25 9.5l-.9-.9-1.6 1.6a1.5 1.5 0 0 1-2.12 0l-.83-.83a1.5 1.5 0 0 1 0-2.12l1.6-1.6-.9-.9Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"M4 12.25 7.5 8.75",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),L.jsx("path",{d:"m3.5 10.5 2 2",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["queued","implementing"],agentPrefix:"imp",color:"var(--green)"},{id:"review",title:"Review",icon:L.jsxs($r,{children:[L.jsx("path",{d:"M1.75 8s2.25-3.75 6.25-3.75S14.25 8 14.25 8 12 11.75 8 11.75 1.75 8 1.75 8Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),L.jsx("circle",{cx:"8",cy:"8",r:"1.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),statuses:["review"],agentPrefix:"rev",color:"var(--yellow)"},{id:"done",title:"Done",icon:L.jsxs($r,{children:[L.jsx("circle",{cx:"8",cy:"8",r:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),L.jsx("path",{d:"m5.5 8 1.5 1.5 3.5-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),statuses:["done"],agentPrefix:null,color:"var(--green)"}];function wf({tasks:e,agents:t,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:l}){const c=X.useRef(new Map),[d,S]=X.useState(new Set);X.useEffect(()=>{const _=c.current,m=new Set;if(e.forEach(v=>{const u=_.get(v.id);u&&u!==v.status&&m.add(v.id)}),m.size>0){S(m);const v=setTimeout(()=>S(new Set),350);return()=>clearTimeout(v)}const x=new Map;e.forEach(v=>x.set(v.id,v.status)),c.current=x},[e]),X.useEffect(()=>{const _=new Map;e.forEach(m=>_.set(m.id,m.status)),c.current=_},[e]);const h=X.useMemo(()=>{const _={};ir.forEach(m=>{_[m.id]=[]}),e.forEach(m=>{if(m.status==="blocked"){const v=ir.find(u=>u.id===m.lastActiveStage);if(v){_[v.id].push(m);return}if(m.assignedTo){const u=ir.find(o=>o.agentPrefix&&m.assignedTo.startsWith(o.agentPrefix));if(u){_[u.id].push(m);return}}_.backlog.push(m);return}const x=ir.find(v=>v.statuses.includes(m.status));x?_[x.id].push(m):_.backlog.push(m)});for(const m of ir)_[m.id].sort((x,v)=>x.status==="blocked"&&v.status!=="blocked"?-1:x.status!=="blocked"&&v.status==="blocked"?1:new Date(v.updatedAt).getTime()-new Date(x.updatedAt).getTime());return _},[e]);return L.jsx("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:1,background:"var(--border)",minHeight:0,overflow:"hidden"},children:ir.map(_=>L.jsx(Cf,{column:_,tasks:h[_.id],agents:t,animatingTasks:d,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:l},_.id))})}var Pu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),_=c(9924),m=c(844),x=c(4725),v=c(2585),u=c(3656);let o=l.AccessibilityManager=class extends m.Disposable{constructor(s,n,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,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 _.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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
40
+ `+f.stack}return{value:e,source:t,stack:a,digest:null}}function gn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function eo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Nd=typeof WeakMap=="function"?WeakMap:Map;function nu(e,t,r){r=pt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ks||(ks=!0,uo=i),eo(e,t)},r}function ou(e,t,r){r=pt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var a=t.value;r.payload=function(){return i(a)},r.callback=function(){eo(e,t)}}var f=e.stateNode;return f!==null&&typeof f.componentDidCatch=="function"&&(r.callback=function(){eo(e,t),typeof i!="function"&&(Pt===null?Pt=new Set([this]):Pt.add(this));var C=t.stack;this.componentDidCatch(t.value,{componentStack:C!==null?C:""})}),r}function Jl(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Nd;var a=new Set;i.set(t,a)}else a=i.get(t),a===void 0&&(a=new Set,i.set(t,a));a.has(r)||(a.add(r),e=Jd.bind(null,e,t,r),t.then(e,e))}function ea(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function ta(e,t,r,i,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=pt(-1,1),t.tag=2,It(r,t,1))),r.lanes|=1),e)}var Fd=St.ReactCurrentOwner,Pe=!1;function Le(e,t,r,i){t.child=e===null?Bc(t,null,r,i):br(t,e.child,r,i)}function ra(e,t,r,i,a){r=r.render;var f=t.ref;return yr(t,a),i=Go(e,t,r,i,f,a),r=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&r&&Bo(t),t.flags|=1,Le(e,t,i,a),t.child)}function ia(e,t,r,i,a){if(e===null){var f=r.type;return typeof f=="function"&&!sl(f)&&f.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=f,lu(e,t,f,i,a)):(e=is(r.type,null,i,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!(e.lanes&a)){var C=f.memoizedProps;if(r=r.compare,r=r!==null?r:di,r(C,i)&&e.ref===t.ref)return mt(e,t,a)}return t.flags|=1,e=Ot(f,i),e.ref=t.ref,e.return=t,t.child=e}function lu(e,t,r,i,a){if(e!==null){var f=e.memoizedProps;if(di(f,i)&&e.ref===t.ref)if(Pe=!1,t.pendingProps=i=f,(e.lanes&a)!==0)e.flags&131072&&(Pe=!0);else return t.lanes=e.lanes,mt(e,t,a)}return to(e,t,r,i,a)}function au(e,t,r){var i=t.pendingProps,a=i.children,f=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},se(_r,He),He|=r;else{if(!(r&1073741824))return e=f!==null?f.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,se(_r,He),He|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=f!==null?f.baseLanes:r,se(_r,He),He|=i}else f!==null?(i=f.baseLanes|r,t.memoizedState=null):i=r,se(_r,He),He|=i;return Le(e,t,a,r),t.child}function cu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function to(e,t,r,i,a){var f=Oe(r)?Yt:Re.current;return f=xr(t,f),yr(t,a),r=Go(e,t,r,i,f,a),i=qo(),e!==null&&!Pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,mt(e,t,a)):(ae&&i&&Bo(t),t.flags|=1,Le(e,t,r,a),t.child)}function sa(e,t,r,i,a){if(Oe(r)){var f=!0;ps(t)}else f=!1;if(yr(t,a),t.stateNode===null)es(e,t),su(t,r,i),Jn(t,r,i,a),i=!0;else if(e===null){var C=t.stateNode,l=t.memoizedProps;C.props=l;var c=C.context,d=r.contextType;typeof d=="object"&&d!==null?d=Ye(d):(d=Oe(r)?Yt:Re.current,d=xr(t,d));var S=r.getDerivedStateFromProps,h=typeof S=="function"||typeof C.getSnapshotBeforeUpdate=="function";h||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(l!==i||c!==d)&&Zl(t,C,i,d),kt=!1;var _=t.memoizedState;C.state=_,Ss(t,i,C,a),c=t.memoizedState,l!==i||_!==c||Be.current||kt?(typeof S=="function"&&(Zn(t,r,S,i),c=t.memoizedState),(l=kt||Ql(t,r,l,i,_,c,d))?(h||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),C.props=i,C.state=c,C.context=d,i=l):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{C=t.stateNode,jc(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Ze(t.type,l),C.props=d,h=t.pendingProps,_=C.context,c=r.contextType,typeof c=="object"&&c!==null?c=Ye(c):(c=Oe(r)?Yt:Re.current,c=xr(t,c));var m=r.getDerivedStateFromProps;(S=typeof m=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(l!==h||_!==c)&&Zl(t,C,i,c),kt=!1,_=t.memoizedState,C.state=_,Ss(t,i,C,a);var x=t.memoizedState;l!==h||_!==x||Be.current||kt?(typeof m=="function"&&(Zn(t,r,m,i),x=t.memoizedState),(d=kt||Ql(t,r,d,i,_,x,c)||!1)?(S||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(i,x,c),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(i,x,c)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=x),C.props=i,C.state=x,C.context=c,i=d):(typeof C.componentDidUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return ro(e,t,r,i,f,a)}function ro(e,t,r,i,a,f){cu(e,t);var C=(t.flags&128)!==0;if(!i&&!C)return a&&Ul(t,r,!1),mt(e,t,f);i=t.stateNode,Fd.current=t;var l=C&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&C?(t.child=br(t,e.child,null,f),t.child=br(t,null,l,f)):Le(e,t,l,f),t.memoizedState=i.state,a&&Ul(t,r,!0),t.child}function uu(e){var t=e.stateNode;t.pendingContext?Wl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wl(e,t.context,!1),Uo(e,t.containerInfo)}function na(e,t,r,i,a){return kr(),jo(a),t.flags|=256,Le(e,t,r,i),t.child}var io={dehydrated:null,treeContext:null,retryLane:0};function so(e){return{baseLanes:e,cachePool:null,transitions:null}}function hu(e,t,r){var i=t.pendingProps,a=ue.current,f=!1,C=(t.flags&128)!==0,l;if((l=C)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(f=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),se(ue,a&1),e===null)return Xn(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(C=i.children,e=i.fallback,f?(i=t.mode,f=t.child,C={mode:"hidden",children:C},!(i&1)&&f!==null?(f.childLanes=0,f.pendingProps=C):f=Ns(C,i,0,null),e=qt(e,i,r,null),f.return=t,e.return=t,f.sibling=e,t.child=f,t.child.memoizedState=so(r),t.memoizedState=io,e):Qo(t,C));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return zd(e,t,C,i,l,a,r);if(f){f=i.fallback,C=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:i.children};return!(C&1)&&t.child!==a?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=Ot(a,c),i.subtreeFlags=a.subtreeFlags&14680064),l!==null?f=Ot(l,f):(f=qt(f,C,r,null),f.flags|=2),f.return=t,i.return=t,i.sibling=f,t.child=i,i=f,f=t.child,C=e.child.memoizedState,C=C===null?so(r):{baseLanes:C.baseLanes|r,cachePool:null,transitions:C.transitions},f.memoizedState=C,f.childLanes=e.childLanes&~r,t.memoizedState=io,i}return f=e.child,e=f.sibling,i=Ot(f,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Qo(e,t){return t=Ns({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wi(e,t,r,i){return i!==null&&jo(i),br(t,e.child,null,r),e=Qo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function zd(e,t,r,i,a,f,C){if(r)return t.flags&256?(t.flags&=-257,i=gn(Error(V(422))),Wi(e,t,C,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(f=i.fallback,a=t.mode,i=Ns({mode:"visible",children:i.children},a,0,null),f=qt(f,a,C,null),f.flags|=2,i.return=t,f.return=t,i.sibling=f,t.child=i,t.mode&1&&br(t,e.child,null,C),t.child.memoizedState=so(C),t.memoizedState=io,f);if(!(t.mode&1))return Wi(e,t,C,null);if(a.data==="$!"){if(i=a.nextSibling&&a.nextSibling.dataset,i)var l=i.dgst;return i=l,f=Error(V(419)),i=gn(f,i,void 0),Wi(e,t,C,i)}if(l=(C&e.childLanes)!==0,Pe||l){if(i=ye,i!==null){switch(C&-C){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(i.suspendedLanes|C)?0:a,a!==0&&a!==f.retryLane&&(f.retryLane=a,gt(e,a),rt(i,e,a,-1))}return il(),i=gn(Error(V(421))),Wi(e,t,C,i)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=ef.bind(null,e),a._reactRetry=t,null):(e=f.treeContext,Ne=Mt(a.nextSibling),Fe=t,ae=!0,et=null,e!==null&&(Ke[Ve++]=dt,Ke[Ve++]=ft,Ke[Ve++]=Xt,dt=e.id,ft=e.overflow,Xt=t),t=Qo(t,i.children),t.flags|=4096,t)}function oa(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Qn(e.return,t,r)}function mn(e,t,r,i,a){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:a}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=i,f.tail=r,f.tailMode=a)}function du(e,t,r){var i=t.pendingProps,a=i.revealOrder,f=i.tail;if(Le(e,t,i.children,r),i=ue.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&oa(e,r,t);else if(e.tag===19)oa(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(se(ue,i),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&ys(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),mn(t,!1,a,r,f);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ys(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}mn(t,!0,r,null,f);break;case"together":mn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function es(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Zt|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,r=Ot(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Ot(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Wd(e,t,r){switch(t.tag){case 3:uu(t),kr();break;case 5:Hc(t);break;case 1:Oe(t.type)&&ps(t);break;case 4:Uo(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,a=t.memoizedProps.value;se(gs,i._currentValue),i._currentValue=a;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(se(ue,ue.current&1),t.flags|=128,null):r&t.child.childLanes?hu(e,t,r):(se(ue,ue.current&1),e=mt(e,t,r),e!==null?e.sibling:null);se(ue,ue.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return du(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),se(ue,ue.current),i)break;return null;case 22:case 23:return t.lanes=0,au(e,t,r)}return mt(e,t,r)}var fu,no,pu,_u;fu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};no=function(){};pu=function(e,t,r,i){var a=e.memoizedProps;if(a!==i){e=t.stateNode,Vt(ct.current);var f=null;switch(r){case"input":a=Rn(e,a),i=Rn(e,i),f=[];break;case"select":a=de({},a,{value:void 0}),i=de({},i,{value:void 0}),f=[];break;case"textarea":a=Tn(e,a),i=Tn(e,i),f=[];break;default:typeof a.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=ds)}Mn(r,i);var C;r=null;for(d in a)if(!i.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(C in l)l.hasOwnProperty(C)&&(r||(r={}),r[C]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ni.hasOwnProperty(d)?f||(f=[]):(f=f||[]).push(d,null));for(d in i){var c=i[d];if(l=a!=null?a[d]:void 0,i.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(C in l)!l.hasOwnProperty(C)||c&&c.hasOwnProperty(C)||(r||(r={}),r[C]="");for(C in c)c.hasOwnProperty(C)&&l[C]!==c[C]&&(r||(r={}),r[C]=c[C])}else r||(f||(f=[]),f.push(d,r)),r=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(f=f||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(f=f||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ni.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&oe("scroll",e),f||l===c||(f=[])):(f=f||[]).push(d,c))}r&&(f=f||[]).push("style",r);var d=f;(t.updateQueue=d)&&(t.flags|=4)}};_u=function(e,t,r,i){r!==i&&(t.flags|=4)};function Wr(e,t){if(!ae)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags&14680064,i|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,i|=a.subtreeFlags,i|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Ud(e,t,r){var i=t.pendingProps;switch(Oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return Oe(t.type)&&fs(),be(t),null;case 3:return i=t.stateNode,Er(),le(Be),le(Re),Ko(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,et!==null&&(po(et),et=null))),no(e,t),be(t),null;case 5:$o(t);var a=Vt(gi.current);if(r=t.type,e!==null&&t.stateNode!=null)pu(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(V(166));return be(t),null}if(e=Vt(ct.current),Fi(t)){i=t.stateNode,r=t.type;var f=t.memoizedProps;switch(i[lt]=t,i[_i]=f,e=(t.mode&1)!==0,r){case"dialog":oe("cancel",i),oe("close",i);break;case"iframe":case"object":case"embed":oe("load",i);break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],i);break;case"source":oe("error",i);break;case"img":case"image":case"link":oe("error",i),oe("load",i);break;case"details":oe("toggle",i);break;case"input":_l(i,f),oe("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!f.multiple},oe("invalid",i);break;case"textarea":gl(i,f),oe("invalid",i)}Mn(r,f),a=null;for(var C in f)if(f.hasOwnProperty(C)){var l=f[C];C==="children"?typeof l=="string"?i.textContent!==l&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,l,e),a=["children",l]):typeof l=="number"&&i.textContent!==""+l&&(f.suppressHydrationWarning!==!0&&Ni(i.textContent,l,e),a=["children",""+l]):ni.hasOwnProperty(C)&&l!=null&&C==="onScroll"&&oe("scroll",i)}switch(r){case"input":Ai(i),vl(i,f,!0);break;case"textarea":Ai(i),ml(i);break;case"select":case"option":break;default:typeof f.onClick=="function"&&(i.onclick=ds)}i=a,t.updateQueue=i,i!==null&&(t.flags|=4)}else{C=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ua(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=C.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=C.createElement(r,{is:i.is}):(e=C.createElement(r),r==="select"&&(C=e,i.multiple?C.multiple=!0:i.size&&(C.size=i.size))):e=C.createElementNS(e,r),e[lt]=t,e[_i]=i,fu(e,t,!1,!1),t.stateNode=e;e:{switch(C=In(r,i),r){case"dialog":oe("cancel",e),oe("close",e),a=i;break;case"iframe":case"object":case"embed":oe("load",e),a=i;break;case"video":case"audio":for(a=0;a<Yr.length;a++)oe(Yr[a],e);a=i;break;case"source":oe("error",e),a=i;break;case"img":case"image":case"link":oe("error",e),oe("load",e),a=i;break;case"details":oe("toggle",e),a=i;break;case"input":_l(e,i),a=Rn(e,i),oe("invalid",e);break;case"option":a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=de({},i,{value:void 0}),oe("invalid",e);break;case"textarea":gl(e,i),a=Tn(e,i),oe("invalid",e);break;default:a=i}Mn(r,a),l=a;for(f in l)if(l.hasOwnProperty(f)){var c=l[f];f==="style"?Va(e,c):f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&$a(e,c)):f==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&oi(e,c):typeof c=="number"&&oi(e,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(ni.hasOwnProperty(f)?c!=null&&f==="onScroll"&&oe("scroll",e):c!=null&&Co(e,f,c,C))}switch(r){case"input":Ai(e),vl(e,i,!1);break;case"textarea":Ai(e),ml(e);break;case"option":i.value!=null&&e.setAttribute("value",""+jt(i.value));break;case"select":e.multiple=!!i.multiple,f=i.value,f!=null?vr(e,!!i.multiple,f,!1):i.defaultValue!=null&&vr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ds)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)_u(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(V(166));if(r=Vt(gi.current),Vt(ct.current),Fi(t)){if(i=t.stateNode,r=t.memoizedProps,i[lt]=t,(f=i.nodeValue!==r)&&(e=Fe,e!==null))switch(e.tag){case 3:Ni(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ni(i.nodeValue,r,(e.mode&1)!==0)}f&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[lt]=t,t.stateNode=i}return be(t),null;case 13:if(le(ue),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ae&&Ne!==null&&t.mode&1&&!(t.flags&128))Ic(),kr(),t.flags|=98560,f=!1;else if(f=Fi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!f)throw Error(V(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(V(317));f[lt]=t}else kr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;be(t),f=!1}else et!==null&&(po(et),et=null),f=!0;if(!f)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||ue.current&1?me===0&&(me=3):il())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return Er(),no(e,t),e===null&&fi(t.stateNode.containerInfo),be(t),null;case 10:return Fo(t.type._context),be(t),null;case 17:return Oe(t.type)&&fs(),be(t),null;case 19:if(le(ue),f=t.memoizedState,f===null)return be(t),null;if(i=(t.flags&128)!==0,C=f.rendering,C===null)if(i)Wr(f,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(C=ys(e),C!==null){for(t.flags|=128,Wr(f,!1),i=C.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)f=r,e=i,f.flags&=14680066,C=f.alternate,C===null?(f.childLanes=0,f.lanes=e,f.child=null,f.subtreeFlags=0,f.memoizedProps=null,f.memoizedState=null,f.updateQueue=null,f.dependencies=null,f.stateNode=null):(f.childLanes=C.childLanes,f.lanes=C.lanes,f.child=C.child,f.subtreeFlags=0,f.deletions=null,f.memoizedProps=C.memoizedProps,f.memoizedState=C.memoizedState,f.updateQueue=C.updateQueue,f.type=C.type,e=C.dependencies,f.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return se(ue,ue.current&1|2),t.child}e=e.sibling}f.tail!==null&&_e()>Lr&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304)}else{if(!i)if(e=ys(C),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Wr(f,!0),f.tail===null&&f.tailMode==="hidden"&&!C.alternate&&!ae)return be(t),null}else 2*_e()-f.renderingStartTime>Lr&&r!==1073741824&&(t.flags|=128,i=!0,Wr(f,!1),t.lanes=4194304);f.isBackwards?(C.sibling=t.child,t.child=C):(r=f.last,r!==null?r.sibling=C:t.child=C,f.last=C)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=_e(),t.sibling=null,r=ue.current,se(ue,i?r&1|2:r&1),t):(be(t),null);case 22:case 23:return rl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?He&1073741824&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function $d(e,t){switch(Oo(t),t.tag){case 1:return Oe(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Er(),le(Be),le(Re),Ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $o(t),null;case 13:if(le(ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(ue),null;case 4:return Er(),null;case 10:return Fo(t.type._context),null;case 22:case 23:return rl(),null;case 24:return null;default:return null}}var Ui=!1,Ee=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,Z=null;function pr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){pe(e,t,i)}else r.current=null}function oo(e,t,r){try{r()}catch(i){pe(e,t,i)}}var la=!1;function Vd(e,t){if(Un=cs,e=yc(),Po(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{r.nodeType,f.nodeType}catch{r=null;break e}var C=0,l=-1,c=-1,d=0,S=0,h=e,_=null;t:for(;;){for(var m;h!==r||a!==0&&h.nodeType!==3||(l=C+a),h!==f||i!==0&&h.nodeType!==3||(c=C+i),h.nodeType===3&&(C+=h.nodeValue.length),(m=h.firstChild)!==null;)_=h,h=m;for(;;){if(h===e)break t;if(_===r&&++d===a&&(l=C),_===f&&++S===i&&(c=C),(m=h.nextSibling)!==null)break;h=_,_=h.parentNode}h=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for($n={focusedElem:e,selectionRange:r},cs=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,u=x.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ze(t.type,v),u);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var n=t.stateNode.containerInfo;n.nodeType===1?n.textContent="":n.nodeType===9&&n.documentElement&&n.removeChild(n.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(p){pe(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return x=la,la=!1,x}function ri(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var a=i=i.next;do{if((a.tag&e)===e){var f=a.destroy;a.destroy=void 0,f!==void 0&&oo(t,r,f)}a=a.next}while(a!==i)}}function js(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function lo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vu(e){var t=e.alternate;t!==null&&(e.alternate=null,vu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[lt],delete t[_i],delete t[Gn],delete t[Ld],delete t[Dd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function gu(e){return e.tag===5||e.tag===3||e.tag===4}function aa(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ao(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ds));else if(i!==4&&(e=e.child,e!==null))for(ao(e,t,r),e=e.sibling;e!==null;)ao(e,t,r),e=e.sibling}function co(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(co(e,t,r),e=e.sibling;e!==null;)co(e,t,r),e=e.sibling}var Ce=null,Je=!1;function wt(e,t,r){for(r=r.child;r!==null;)mu(e,t,r),r=r.sibling}function mu(e,t,r){if(at&&typeof at.onCommitFiberUnmount=="function")try{at.onCommitFiberUnmount(Ds,r)}catch{}switch(r.tag){case 5:Ee||pr(r,t);case 6:var i=Ce,a=Je;Ce=null,wt(e,t,r),Ce=i,Je=a,Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ce.removeChild(r.stateNode));break;case 18:Ce!==null&&(Je?(e=Ce,r=r.stateNode,e.nodeType===8?hn(e.parentNode,r):e.nodeType===1&&hn(e,r),ui(e)):hn(Ce,r.stateNode));break;case 4:i=Ce,a=Je,Ce=r.stateNode.containerInfo,Je=!0,wt(e,t,r),Ce=i,Je=a;break;case 0:case 11:case 14:case 15:if(!Ee&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){a=i=i.next;do{var f=a,C=f.destroy;f=f.tag,C!==void 0&&(f&2||f&4)&&oo(r,t,C),a=a.next}while(a!==i)}wt(e,t,r);break;case 1:if(!Ee&&(pr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(l){pe(r,t,l)}wt(e,t,r);break;case 21:wt(e,t,r);break;case 22:r.mode&1?(Ee=(i=Ee)||r.memoizedState!==null,wt(e,t,r),Ee=i):wt(e,t,r);break;default:wt(e,t,r)}}function ca(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Kd),t.forEach(function(i){var a=tf.bind(null,e,i);r.has(i)||(r.add(i),i.then(a,a))})}}function Qe(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i];try{var f=e,C=t,l=C;e:for(;l!==null;){switch(l.tag){case 5:Ce=l.stateNode,Je=!1;break e;case 3:Ce=l.stateNode.containerInfo,Je=!0;break e;case 4:Ce=l.stateNode.containerInfo,Je=!0;break e}l=l.return}if(Ce===null)throw Error(V(160));mu(f,C,a),Ce=null,Je=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){pe(a,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Su(t,e),t=t.sibling}function Su(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Qe(t,e),nt(e),i&4){try{ri(3,e,e.return),js(3,e)}catch(v){pe(e,e.return,v)}try{ri(5,e,e.return)}catch(v){pe(e,e.return,v)}}break;case 1:Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return);break;case 5:if(Qe(t,e),nt(e),i&512&&r!==null&&pr(r,r.return),e.flags&32){var a=e.stateNode;try{oi(a,"")}catch(v){pe(e,e.return,v)}}if(i&4&&(a=e.stateNode,a!=null)){var f=e.memoizedProps,C=r!==null?r.memoizedProps:f,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&f.type==="radio"&&f.name!=null&&za(a,f),In(l,C);var d=In(l,f);for(C=0;C<c.length;C+=2){var S=c[C],h=c[C+1];S==="style"?Va(a,h):S==="dangerouslySetInnerHTML"?$a(a,h):S==="children"?oi(a,h):Co(a,S,h,d)}switch(l){case"input":Ln(a,f);break;case"textarea":Wa(a,f);break;case"select":var _=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!f.multiple;var m=f.value;m!=null?vr(a,!!f.multiple,m,!1):_!==!!f.multiple&&(f.defaultValue!=null?vr(a,!!f.multiple,f.defaultValue,!0):vr(a,!!f.multiple,f.multiple?[]:"",!1))}a[_i]=f}catch(v){pe(e,e.return,v)}}break;case 6:if(Qe(t,e),nt(e),i&4){if(e.stateNode===null)throw Error(V(162));a=e.stateNode,f=e.memoizedProps;try{a.nodeValue=f}catch(v){pe(e,e.return,v)}}break;case 3:if(Qe(t,e),nt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ui(t.containerInfo)}catch(v){pe(e,e.return,v)}break;case 4:Qe(t,e),nt(e);break;case 13:Qe(t,e),nt(e),a=e.child,a.flags&8192&&(f=a.memoizedState!==null,a.stateNode.isHidden=f,!f||a.alternate!==null&&a.alternate.memoizedState!==null||(el=_e())),i&4&&ca(e);break;case 22:if(S=r!==null&&r.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||S,Qe(t,e),Ee=d):Qe(t,e),nt(e),i&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!S&&e.mode&1)for(Z=e,S=e.child;S!==null;){for(h=Z=S;Z!==null;){switch(_=Z,m=_.child,_.tag){case 0:case 11:case 14:case 15:ri(4,_,_.return);break;case 1:pr(_,_.return);var x=_.stateNode;if(typeof x.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(v){pe(i,r,v)}}break;case 5:pr(_,_.return);break;case 22:if(_.memoizedState!==null){ha(h);continue}}m!==null?(m.return=_,Z=m):ha(h)}S=S.sibling}e:for(S=null,h=e;;){if(h.tag===5){if(S===null){S=h;try{a=h.stateNode,d?(f=a.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none"):(l=h.stateNode,c=h.memoizedProps.style,C=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ka("display",C))}catch(v){pe(e,e.return,v)}}}else if(h.tag===6){if(S===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(v){pe(e,e.return,v)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===e)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;h.sibling===null;){if(h.return===null||h.return===e)break e;S===h&&(S=null),h=h.return}S===h&&(S=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:Qe(t,e),nt(e),i&4&&ca(e);break;case 21:break;default:Qe(t,e),nt(e)}}function nt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(gu(r)){var i=r;break e}r=r.return}throw Error(V(160))}switch(i.tag){case 5:var a=i.stateNode;i.flags&32&&(oi(a,""),i.flags&=-33);var f=aa(e);co(e,f,a);break;case 3:case 4:var C=i.stateNode.containerInfo,l=aa(e);ao(e,l,C);break;default:throw Error(V(161))}}catch(c){pe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Gd(e,t,r){Z=e,yu(e)}function yu(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var a=Z,f=a.child;if(a.tag===22&&i){var C=a.memoizedState!==null||Ui;if(!C){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Ee;l=Ui;var d=Ee;if(Ui=C,(Ee=c)&&!d)for(Z=a;Z!==null;)C=Z,c=C.child,C.tag===22&&C.memoizedState!==null?da(a):c!==null?(c.return=C,Z=c):da(a);for(;f!==null;)Z=f,yu(f),f=f.sibling;Z=a,Ui=l,Ee=d}ua(e)}else a.subtreeFlags&8772&&f!==null?(f.return=a,Z=f):ua(e)}}function ua(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||js(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Ee)if(r===null)i.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Ze(t.type,r.memoizedProps);i.componentDidUpdate(a,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var f=t.updateQueue;f!==null&&ql(t,f,i);break;case 3:var C=t.updateQueue;if(C!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}ql(t,C,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var S=d.memoizedState;if(S!==null){var h=S.dehydrated;h!==null&&ui(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}Ee||t.flags&512&&lo(t)}catch(_){pe(t,t.return,_)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function ha(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function da(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{js(4,t)}catch(c){pe(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var a=t.return;try{i.componentDidMount()}catch(c){pe(t,a,c)}}var f=t.return;try{lo(t)}catch(c){pe(t,f,c)}break;case 5:var C=t.return;try{lo(t)}catch(c){pe(t,C,c)}}}catch(c){pe(t,t.return,c)}if(t===e){Z=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Z=l;break}Z=t.return}}var qd=Math.ceil,xs=St.ReactCurrentDispatcher,Zo=St.ReactCurrentOwner,qe=St.ReactCurrentBatchConfig,re=0,ye=null,ve=null,we=0,He=0,_r=Ft(0),me=0,Ci=null,Zt=0,Hs=0,Jo=0,ii=null,Ie=null,el=0,Lr=1/0,ut=null,ks=!1,uo=null,Pt=null,$i=!1,Lt=null,bs=0,si=0,ho=null,ts=-1,rs=0;function De(){return re&6?_e():ts!==-1?ts:ts=_e()}function Bt(e){return e.mode&1?re&2&&we!==0?we&-we:Ad.transition!==null?(rs===0&&(rs=sc()),rs):(e=ie,e!==0||(e=window.event,e=e===void 0?16:hc(e.type)),e):1}function rt(e,t,r,i){if(50<si)throw si=0,ho=null,Error(V(185));xi(e,r,i),(!(re&2)||e!==ye)&&(e===ye&&(!(re&2)&&(Hs|=r),me===4&&Et(e,we)),je(e,i),r===1&&re===0&&!(t.mode&1)&&(Lr=_e()+500,Ps&&zt()))}function je(e,t){var r=e.callbackNode;Ah(e,t);var i=as(e,e===ye?we:0);if(i===0)r!==null&&Cl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Cl(r),t===1)e.tag===0?Td(fa.bind(null,e)):Tc(fa.bind(null,e)),Ed(function(){!(re&6)&&zt()}),r=null;else{switch(nc(i)){case 1:r=Eo;break;case 4:r=rc;break;case 16:r=ls;break;case 536870912:r=ic;break;default:r=ls}r=Lu(r,Cu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Cu(e,t){if(ts=-1,rs=0,re&6)throw Error(V(327));var r=e.callbackNode;if(Cr()&&e.callbackNode!==r)return null;var i=as(e,e===ye?we:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Es(e,i);else{t=i;var a=re;re|=2;var f=xu();(ye!==e||we!==t)&&(ut=null,Lr=_e()+500,Gt(e,t));do try{Qd();break}catch(l){wu(e,l)}while(!0);No(),xs.current=f,re=a,ve!==null?t=0:(ye=null,we=0,t=me)}if(t!==0){if(t===2&&(a=Hn(e),a!==0&&(i=a,t=fo(e,a))),t===1)throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;if(t===6)Et(e,i);else{if(a=e.current.alternate,!(i&30)&&!Yd(a)&&(t=Es(e,i),t===2&&(f=Hn(e),f!==0&&(i=f,t=fo(e,f))),t===1))throw r=Ci,Gt(e,0),Et(e,i),je(e,_e()),r;switch(e.finishedWork=a,e.finishedLanes=i,t){case 0:case 1:throw Error(V(345));case 2:Ut(e,Ie,ut);break;case 3:if(Et(e,i),(i&130023424)===i&&(t=el+500-_e(),10<t)){if(as(e,0)!==0)break;if(a=e.suspendedLanes,(a&i)!==i){De(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Vn(Ut.bind(null,e,Ie,ut),t);break}Ut(e,Ie,ut);break;case 4:if(Et(e,i),(i&4194240)===i)break;for(t=e.eventTimes,a=-1;0<i;){var C=31-tt(i);f=1<<C,C=t[C],C>a&&(a=C),i&=~f}if(i=a,i=_e()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qd(i/1960))-i,10<i){e.timeoutHandle=Vn(Ut.bind(null,e,Ie,ut),i);break}Ut(e,Ie,ut);break;case 5:Ut(e,Ie,ut);break;default:throw Error(V(329))}}}return je(e,_e()),e.callbackNode===r?Cu.bind(null,e):null}function fo(e,t){var r=ii;return e.current.memoizedState.isDehydrated&&(Gt(e,t).flags|=256),e=Es(e,t),e!==2&&(t=Ie,Ie=r,t!==null&&po(t)),e}function po(e){Ie===null?Ie=e:Ie.push.apply(Ie,e)}function Yd(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var a=r[i],f=a.getSnapshot;a=a.value;try{if(!it(f(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Et(e,t){for(t&=~Jo,t&=~Hs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tt(t),i=1<<r;e[r]=-1,t&=~i}}function fa(e){if(re&6)throw Error(V(327));Cr();var t=as(e,0);if(!(t&1))return je(e,_e()),null;var r=Es(e,t);if(e.tag!==0&&r===2){var i=Hn(e);i!==0&&(t=i,r=fo(e,i))}if(r===1)throw r=Ci,Gt(e,0),Et(e,t),je(e,_e()),r;if(r===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ut(e,Ie,ut),je(e,_e()),null}function tl(e,t){var r=re;re|=1;try{return e(t)}finally{re=r,re===0&&(Lr=_e()+500,Ps&&zt())}}function Jt(e){Lt!==null&&Lt.tag===0&&!(re&6)&&Cr();var t=re;re|=1;var r=qe.transition,i=ie;try{if(qe.transition=null,ie=1,e)return e()}finally{ie=i,qe.transition=r,re=t,!(re&6)&&zt()}}function rl(){He=_r.current,le(_r)}function Gt(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,bd(r)),ve!==null)for(r=ve.return;r!==null;){var i=r;switch(Oo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&fs();break;case 3:Er(),le(Be),le(Re),Ko();break;case 5:$o(i);break;case 4:Er();break;case 13:le(ue);break;case 19:le(ue);break;case 10:Fo(i.type._context);break;case 22:case 23:rl()}r=r.return}if(ye=e,ve=e=Ot(e.current,null),we=He=t,me=0,Ci=null,Jo=Hs=Zt=0,Ie=ii=null,Kt!==null){for(t=0;t<Kt.length;t++)if(r=Kt[t],i=r.interleaved,i!==null){r.interleaved=null;var a=i.next,f=r.pending;if(f!==null){var C=f.next;f.next=a,i.next=C}r.pending=i}Kt=null}return e}function wu(e,t){do{var r=ve;try{if(No(),Zi.current=ws,Cs){for(var i=he.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}Cs=!1}if(Qt=0,Se=ge=he=null,ti=!1,mi=0,Zo.current=null,r===null||r.return===null){me=1,Ci=t,ve=null;break}e:{var f=e,C=r.return,l=r,c=t;if(t=we,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,S=l,h=S.tag;if(!(S.mode&1)&&(h===0||h===11||h===15)){var _=S.alternate;_?(S.updateQueue=_.updateQueue,S.memoizedState=_.memoizedState,S.lanes=_.lanes):(S.updateQueue=null,S.memoizedState=null)}var m=ea(C);if(m!==null){m.flags&=-257,ta(m,C,l,f,t),m.mode&1&&Jl(f,d,t),t=m,c=d;var x=t.updateQueue;if(x===null){var v=new Set;v.add(c),t.updateQueue=v}else x.add(c);break e}else{if(!(t&1)){Jl(f,d,t),il();break e}c=Error(V(426))}}else if(ae&&l.mode&1){var u=ea(C);if(u!==null){!(u.flags&65536)&&(u.flags|=256),ta(u,C,l,f,t),jo(Rr(c,l));break e}}f=c=Rr(c,l),me!==4&&(me=2),ii===null?ii=[f]:ii.push(f),f=C;do{switch(f.tag){case 3:f.flags|=65536,t&=-t,f.lanes|=t;var o=nu(f,c,t);Gl(f,o);break e;case 1:l=c;var s=f.type,n=f.stateNode;if(!(f.flags&128)&&(typeof s.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Pt===null||!Pt.has(n)))){f.flags|=65536,t&=-t,f.lanes|=t;var p=ou(f,l,t);Gl(f,p);break e}}f=f.return}while(f!==null)}bu(r)}catch(w){t=w,ve===r&&r!==null&&(ve=r=r.return);continue}break}while(!0)}function xu(){var e=xs.current;return xs.current=ws,e===null?ws:e}function il(){(me===0||me===3||me===2)&&(me=4),ye===null||!(Zt&268435455)&&!(Hs&268435455)||Et(ye,we)}function Es(e,t){var r=re;re|=2;var i=xu();(ye!==e||we!==t)&&(ut=null,Gt(e,t));do try{Xd();break}catch(a){wu(e,a)}while(!0);if(No(),re=r,xs.current=i,ve!==null)throw Error(V(261));return ye=null,we=0,me}function Xd(){for(;ve!==null;)ku(ve)}function Qd(){for(;ve!==null&&!wh();)ku(ve)}function ku(e){var t=Ru(e.alternate,e,He);e.memoizedProps=e.pendingProps,t===null?bu(e):ve=t,Zo.current=null}function bu(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=$d(r,t),r!==null){r.flags&=32767,ve=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,ve=null;return}}else if(r=Ud(r,t,He),r!==null){ve=r;return}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);me===0&&(me=5)}function Ut(e,t,r){var i=ie,a=qe.transition;try{qe.transition=null,ie=1,Zd(e,t,r,i)}finally{qe.transition=a,ie=i}return null}function Zd(e,t,r,i){do Cr();while(Lt!==null);if(re&6)throw Error(V(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var f=r.lanes|r.childLanes;if(Mh(e,f),e===ye&&(ve=ye=null,we=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||$i||($i=!0,Lu(ls,function(){return Cr(),null})),f=(r.flags&15990)!==0,r.subtreeFlags&15990||f){f=qe.transition,qe.transition=null;var C=ie;ie=1;var l=re;re|=4,Zo.current=null,Vd(e,r),Su(r,e),md($n),cs=!!Un,$n=Un=null,e.current=r,Gd(r),xh(),re=l,ie=C,qe.transition=f}else e.current=r;if($i&&($i=!1,Lt=e,bs=a),f=e.pendingLanes,f===0&&(Pt=null),Eh(r.stateNode),je(e,_e()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],i(a.value,{componentStack:a.stack,digest:a.digest});if(ks)throw ks=!1,e=uo,uo=null,e;return bs&1&&e.tag!==0&&Cr(),f=e.pendingLanes,f&1?e===ho?si++:(si=0,ho=e):si=0,zt(),null}function Cr(){if(Lt!==null){var e=nc(bs),t=qe.transition,r=ie;try{if(qe.transition=null,ie=16>e?16:e,Lt===null)var i=!1;else{if(e=Lt,Lt=null,bs=0,re&6)throw Error(V(331));var a=re;for(re|=4,Z=e.current;Z!==null;){var f=Z,C=f.child;if(Z.flags&16){var l=f.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(Z=d;Z!==null;){var S=Z;switch(S.tag){case 0:case 11:case 15:ri(8,S,f)}var h=S.child;if(h!==null)h.return=S,Z=h;else for(;Z!==null;){S=Z;var _=S.sibling,m=S.return;if(vu(S),S===d){Z=null;break}if(_!==null){_.return=m,Z=_;break}Z=m}}}var x=f.alternate;if(x!==null){var v=x.child;if(v!==null){x.child=null;do{var u=v.sibling;v.sibling=null,v=u}while(v!==null)}}Z=f}}if(f.subtreeFlags&2064&&C!==null)C.return=f,Z=C;else e:for(;Z!==null;){if(f=Z,f.flags&2048)switch(f.tag){case 0:case 11:case 15:ri(9,f,f.return)}var o=f.sibling;if(o!==null){o.return=f.return,Z=o;break e}Z=f.return}}var s=e.current;for(Z=s;Z!==null;){C=Z;var n=C.child;if(C.subtreeFlags&2064&&n!==null)n.return=C,Z=n;else e:for(C=s;Z!==null;){if(l=Z,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:js(9,l)}}catch(w){pe(l,l.return,w)}if(l===C){Z=null;break e}var p=l.sibling;if(p!==null){p.return=l.return,Z=p;break e}Z=l.return}}if(re=a,zt(),at&&typeof at.onPostCommitFiberRoot=="function")try{at.onPostCommitFiberRoot(Ds,e)}catch{}i=!0}return i}finally{ie=r,qe.transition=t}}return!1}function pa(e,t,r){t=Rr(r,t),t=nu(e,t,1),e=It(e,t,1),t=De(),e!==null&&(xi(e,1,t),je(e,t))}function pe(e,t,r){if(e.tag===3)pa(e,e,r);else for(;t!==null;){if(t.tag===3){pa(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Pt===null||!Pt.has(i))){e=Rr(r,e),e=ou(t,e,1),t=It(t,e,1),e=De(),t!==null&&(xi(t,1,e),je(t,e));break}}t=t.return}}function Jd(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=De(),e.pingedLanes|=e.suspendedLanes&r,ye===e&&(we&r)===r&&(me===4||me===3&&(we&130023424)===we&&500>_e()-el?Gt(e,0):Jo|=r),je(e,t)}function Eu(e,t){t===0&&(e.mode&1?(t=Pi,Pi<<=1,!(Pi&130023424)&&(Pi=4194304)):t=1);var r=De();e=gt(e,t),e!==null&&(xi(e,t,r),je(e,r))}function ef(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Eu(e,r)}function tf(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(V(314))}i!==null&&i.delete(t),Eu(e,r)}var Ru;Ru=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Be.current)Pe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Pe=!1,Wd(e,t,r);Pe=!!(e.flags&131072)}else Pe=!1,ae&&t.flags&1048576&&Ac(t,vs,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;es(e,t),e=t.pendingProps;var a=xr(t,Re.current);yr(t,r),a=Go(null,t,i,e,a,r);var f=qo();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oe(i)?(f=!0,ps(t)):f=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Wo(t),a.updater=Os,t.stateNode=a,a._reactInternals=t,Jn(t,i,e,r),t=ro(null,t,i,!0,f,r)):(t.tag=0,ae&&f&&Bo(t),Le(null,t,a,r),t=t.child),t;case 16:i=t.elementType;e:{switch(es(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=sf(i),e=Ze(i,e),a){case 0:t=to(null,t,i,e,r);break e;case 1:t=sa(null,t,i,e,r);break e;case 11:t=ra(null,t,i,e,r);break e;case 14:t=ia(null,t,i,Ze(i.type,e),r);break e}throw Error(V(306,i,""))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),to(e,t,i,a,r);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),sa(e,t,i,a,r);case 3:e:{if(uu(t),e===null)throw Error(V(387));i=t.pendingProps,f=t.memoizedState,a=f.element,jc(e,t),Ss(t,i,null,r);var C=t.memoizedState;if(i=C.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){a=Rr(Error(V(423)),t),t=na(e,t,i,r,a);break e}else if(i!==a){a=Rr(Error(V(424)),t),t=na(e,t,i,r,a);break e}else for(Ne=Mt(t.stateNode.containerInfo.firstChild),Fe=t,ae=!0,et=null,r=Bc(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(kr(),i===a){t=mt(e,t,r);break e}Le(e,t,i,r)}t=t.child}return t;case 5:return Hc(t),e===null&&Xn(t),i=t.type,a=t.pendingProps,f=e!==null?e.memoizedProps:null,C=a.children,Kn(i,a)?C=null:f!==null&&Kn(i,f)&&(t.flags|=32),cu(e,t),Le(e,t,C,r),t.child;case 6:return e===null&&Xn(t),null;case 13:return hu(e,t,r);case 4:return Uo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=br(t,null,i,r):Le(e,t,i,r),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),ra(e,t,i,a,r);case 7:return Le(e,t,t.pendingProps,r),t.child;case 8:return Le(e,t,t.pendingProps.children,r),t.child;case 12:return Le(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,a=t.pendingProps,f=t.memoizedProps,C=a.value,se(gs,i._currentValue),i._currentValue=C,f!==null)if(it(f.value,C)){if(f.children===a.children&&!Be.current){t=mt(e,t,r);break e}}else for(f=t.child,f!==null&&(f.return=t);f!==null;){var l=f.dependencies;if(l!==null){C=f.child;for(var c=l.firstContext;c!==null;){if(c.context===i){if(f.tag===1){c=pt(-1,r&-r),c.tag=2;var d=f.updateQueue;if(d!==null){d=d.shared;var S=d.pending;S===null?c.next=c:(c.next=S.next,S.next=c),d.pending=c}}f.lanes|=r,c=f.alternate,c!==null&&(c.lanes|=r),Qn(f.return,r,t),l.lanes|=r;break}c=c.next}}else if(f.tag===10)C=f.type===t.type?null:f.child;else if(f.tag===18){if(C=f.return,C===null)throw Error(V(341));C.lanes|=r,l=C.alternate,l!==null&&(l.lanes|=r),Qn(C,r,t),C=f.sibling}else C=f.child;if(C!==null)C.return=f;else for(C=f;C!==null;){if(C===t){C=null;break}if(f=C.sibling,f!==null){f.return=C.return,C=f;break}C=C.return}f=C}Le(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,yr(t,r),a=Ye(a),i=i(a),t.flags|=1,Le(e,t,i,r),t.child;case 14:return i=t.type,a=Ze(i,t.pendingProps),a=Ze(i.type,a),ia(e,t,i,a,r);case 15:return lu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Ze(i,a),es(e,t),t.tag=1,Oe(i)?(e=!0,ps(t)):e=!1,yr(t,r),su(t,i,a),Jn(t,i,a,r),ro(null,t,i,!0,e,r);case 19:return du(e,t,r);case 22:return au(e,t,r)}throw Error(V(156,t.tag))};function Lu(e,t){return tc(e,t)}function rf(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,r,i){return new rf(e,t,r,i)}function sl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sf(e){if(typeof e=="function")return sl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xo)return 11;if(e===ko)return 14}return 2}function Ot(e,t){var r=e.alternate;return r===null?(r=Ge(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function is(e,t,r,i,a,f){var C=2;if(i=e,typeof e=="function")sl(e)&&(C=1);else if(typeof e=="string")C=5;else e:switch(e){case nr:return qt(r.children,a,f,t);case wo:C=8,a|=8;break;case xn:return e=Ge(12,r,t,a|2),e.elementType=xn,e.lanes=f,e;case kn:return e=Ge(13,r,t,a),e.elementType=kn,e.lanes=f,e;case bn:return e=Ge(19,r,t,a),e.elementType=bn,e.lanes=f,e;case Ha:return Ns(r,a,f,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Oa:C=10;break e;case ja:C=9;break e;case xo:C=11;break e;case ko:C=14;break e;case xt:C=16,i=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=Ge(C,r,t,a),t.elementType=e,t.type=i,t.lanes=f,t}function qt(e,t,r,i){return e=Ge(7,e,i,t),e.lanes=r,e}function Ns(e,t,r,i){return e=Ge(22,e,i,t),e.elementType=Ha,e.lanes=r,e.stateNode={isHidden:!1},e}function Sn(e,t,r){return e=Ge(6,e,null,t),e.lanes=r,e}function yn(e,t,r){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nf(e,t,r,i,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=i,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function nl(e,t,r,i,a,f,C,l,c){return e=new nf(e,t,r,l,c),t===1?(t=1,f===!0&&(t|=8)):t=0,f=Ge(3,null,null,t),e.current=f,f.stateNode=e,f.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wo(f),e}function of(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:sr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Du(e){if(!e)return Ht;e=e._reactInternals;e:{if(tr(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var r=e.type;if(Oe(r))return Dc(e,r,t)}return t}function Tu(e,t,r,i,a,f,C,l,c){return e=nl(r,i,!0,e,a,f,C,l,c),e.context=Du(null),r=e.current,i=De(),a=Bt(r),f=pt(i,a),f.callback=t??null,It(r,f,a),e.current.lanes=a,xi(e,a,i),je(e,i),e}function Fs(e,t,r,i){var a=t.current,f=De(),C=Bt(a);return r=Du(r),t.context===null?t.context=r:t.pendingContext=r,t=pt(f,C),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=It(a,t,C),e!==null&&(rt(e,a,C,f),Qi(e,a,C)),C}function Rs(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function _a(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ol(e,t){_a(e,t),(e=e.alternate)&&_a(e,t)}function lf(){return null}var Au=typeof reportError=="function"?reportError:function(e){console.error(e)};function ll(e){this._internalRoot=e}zs.prototype.render=ll.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Fs(e,t,null,null)};zs.prototype.unmount=ll.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jt(function(){Fs(null,e,null,null)}),t[vt]=null}};function zs(e){this._internalRoot=e}zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=ac();e={blockedOn:null,target:e,priority:t};for(var r=0;r<bt.length&&t!==0&&t<bt[r].priority;r++);bt.splice(r,0,e),r===0&&uc(e)}};function al(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ws(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function va(){}function af(e,t,r,i,a){if(a){if(typeof i=="function"){var f=i;i=function(){var d=Rs(C);f.call(d)}}var C=Tu(t,i,e,0,null,!1,!1,"",va);return e._reactRootContainer=C,e[vt]=C.current,fi(e.nodeType===8?e.parentNode:e),Jt(),C}for(;a=e.lastChild;)e.removeChild(a);if(typeof i=="function"){var l=i;i=function(){var d=Rs(c);l.call(d)}}var c=nl(e,0,!1,null,null,!1,!1,"",va);return e._reactRootContainer=c,e[vt]=c.current,fi(e.nodeType===8?e.parentNode:e),Jt(function(){Fs(t,c,r,i)}),c}function Us(e,t,r,i,a){var f=r._reactRootContainer;if(f){var C=f;if(typeof a=="function"){var l=a;a=function(){var c=Rs(C);l.call(c)}}Fs(t,C,e,a)}else C=af(r,t,e,a,i);return Rs(C)}oc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=qr(t.pendingLanes);r!==0&&(Ro(t,r|1),je(t,_e()),!(re&6)&&(Lr=_e()+500,zt()))}break;case 13:Jt(function(){var i=gt(e,1);if(i!==null){var a=De();rt(i,e,1,a)}}),ol(e,1)}};Lo=function(e){if(e.tag===13){var t=gt(e,134217728);if(t!==null){var r=De();rt(t,e,134217728,r)}ol(e,134217728)}};lc=function(e){if(e.tag===13){var t=Bt(e),r=gt(e,t);if(r!==null){var i=De();rt(r,e,t,i)}ol(e,t)}};ac=function(){return ie};cc=function(e,t){var r=ie;try{return ie=e,t()}finally{ie=r}};Bn=function(e,t,r){switch(t){case"input":if(Ln(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var a=Is(i);if(!a)throw Error(V(90));Fa(i),Ln(i,a)}}}break;case"textarea":Wa(e,r);break;case"select":t=r.value,t!=null&&vr(e,!!r.multiple,t,!1)}};Ya=tl;Xa=Jt;var cf={usingClientEntryPoint:!1,Events:[bi,cr,Is,Ga,qa,tl]},Ur={findFiberByHostInstance:$t,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uf={bundleType:Ur.bundleType,version:Ur.version,rendererPackageName:Ur.rendererPackageName,rendererConfig:Ur.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:St.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ja(e),e===null?null:e.stateNode},findFiberByHostInstance:Ur.findFiberByHostInstance||lf,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ki=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ki.isDisabled&&Ki.supportsFiber)try{Ds=Ki.inject(uf),at=Ki}catch{}}We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cf;We.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!al(t))throw Error(V(200));return of(e,t,null,r)};We.createRoot=function(e,t){if(!al(e))throw Error(V(299));var r=!1,i="",a=Au;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=nl(e,1,!1,null,null,r,!1,i,a),e[vt]=t.current,fi(e.nodeType===8?e.parentNode:e),new ll(t)};We.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Ja(t),e=e===null?null:e.stateNode,e};We.flushSync=function(e){return Jt(e)};We.hydrate=function(e,t,r){if(!Ws(t))throw Error(V(200));return Us(null,e,t,!0,r)};We.hydrateRoot=function(e,t,r){if(!al(e))throw Error(V(405));var i=r!=null&&r.hydratedSources||null,a=!1,f="",C=Au;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),t=Tu(t,null,e,1,r??null,a,!1,f,C),e[vt]=t.current,fi(e),i)for(e=0;e<i.length;e++)r=i[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new zs(t)};We.render=function(e,t,r){if(!Ws(t))throw Error(V(200));return Us(null,e,t,!1,r)};We.unmountComponentAtNode=function(e){if(!Ws(e))throw Error(V(40));return e._reactRootContainer?(Jt(function(){Us(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};We.unstable_batchedUpdates=tl;We.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Ws(r))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Us(e,t,r,!1,i)};We.version="18.3.1-next-f1338f8080-20240426";function Mu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mu)}catch(e){console.error(e)}}Mu(),Ma.exports=We;var hf=Ma.exports,Iu,ga=hf;Iu=ga.createRoot,ga.hydrateRoot;const df=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}`,ff=3e3,pf=5,_f=5e3;function vf(){const[e,t]=X.useState(!1),[r,i]=X.useState(!1),[a,f]=X.useState([]),[C,l]=X.useState([]),[c,d]=X.useState([]),[S,h]=X.useState(null),[_,m]=X.useState([]),x=X.useRef(null),v=X.useRef(new Map),u=X.useRef(null),o=X.useCallback((j,$="info")=>{const U={id:Date.now()+Math.random(),msg:j,type:$};m(Q=>[U,...Q].slice(0,pf)),setTimeout(()=>{m(Q=>Q.filter(P=>P.id!==U.id))},_f)},[]),s=X.useCallback((j,$)=>{const U=x.current;U&&U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:j,payload:$,ts:Date.now()}))},[]),n=X.useCallback(()=>{if(x.current&&x.current.readyState===WebSocket.OPEN)return;const j=new WebSocket(df);x.current=j,j.onopen=()=>{t(!0),u.current&&(clearInterval(u.current),u.current=null);for(const[$]of v.current)s("SUBSCRIBE_TERMINAL",{agentId:$})},j.onmessage=$=>{var Q,P,L,K,H;let U;try{U=JSON.parse($.data)}catch{return}switch(U.type){case"INIT":f(U.payload.tasks||[]),l(U.payload.agents||[]),d(U.payload.repos||[]),U.payload.settings&&h(U.payload.settings),i(!0);break;case"TASKS_UPDATED":f(U.payload.tasks||[]);break;case"TASK_ADDED":f(Y=>[...Y,U.payload.task]);break;case"AGENTS_UPDATED":l(U.payload.agents||[]);break;case"AGENT_UPDATED":l(Y=>Y.some(J=>J.id===U.payload.agent.id)?Y.map(J=>J.id===U.payload.agent.id?U.payload.agent:J):[...Y,U.payload.agent]);break;case"AGENT_REMOVED":l(Y=>Y.filter(z=>z.id!==U.payload.agentId));break;case"SETTINGS_UPDATED":h(U.payload);break;case"REPOS_UPDATED":d(U.payload.repos||[]);break;case"TERMINAL_DATA":{const Y=v.current.get(U.payload.agentId);Y&&Y(U.payload.data);break}case"PLAN_READY":o(`Plan ready for ${U.payload.taskId} — approval needed`,"warning");break;case"PLAN_PARTIAL":f(Y=>Y.map(z=>z.id===U.payload.taskId?{...z,plan:U.payload.plan}:z));break;case"PR_CREATED":o(`PR created for ${U.payload.taskId}`,"success");break;case"TASK_BLOCKED":o(`${U.payload.taskId} blocked: ${U.payload.reason}`,"error");break;case"REVIEW_FAILED":o(`Review failed for ${U.payload.taskId} — returning to implementor`,"warning");break;case"REVIEW_PASSED":o(`Review passed for ${U.payload.taskId}`,"success");break;case"TASK_ABORTED":o(`Task ${U.payload.taskId} aborted`,"info");break;case"TASK_RESET":o(`Task ${U.payload.taskId} reset to backlog`,"info");break;case"TASK_RETRIED":o(`Task ${U.payload.taskId} retrying from ${U.payload.retryStatus}`,"info");break;case"TASK_DELETED":o(`Task ${U.payload.taskId} deleted from Done`,"info");break;case"BRIDGE_OPENED":o(`${U.payload.agentName} opened in Terminal`,"info");break;case"BRIDGE_RETURNED":o(`${U.payload.agentName} returned to Ban Kan`,"info");break;case"BRIDGE_ERROR":o(((Q=U.payload)==null?void 0:Q.message)||"Terminal bridge failed","error");break;case"TASK_WORKSPACE_OPENED":o(((P=U.payload)==null?void 0:P.message)||`Opened workspace for ${(L=U.payload)==null?void 0:L.taskId}`,"success");break;case"TASK_WORKSPACE_ERROR":o(((K=U.payload)==null?void 0:K.message)||"Failed to open task workspace","error");break;case"SETTINGS_ERROR":o((((H=U.payload)==null?void 0:H.errors)||[]).join(", ")||"Settings update failed","error");break}},j.onclose=()=>{t(!1),x.current=null,u.current||(u.current=setInterval(n,ff))},j.onerror=()=>{j.close()}},[o,s]);X.useEffect(()=>(n(),()=>{u.current&&clearInterval(u.current),x.current&&x.current.close()}),[n]);const p=X.useCallback((j,$,U,Q)=>{s("ADD_TASK",{title:j,priority:$,description:U,repoPath:Q})},[s]),w=X.useCallback(j=>{s("APPROVE_PLAN",{taskId:j})},[s]),y=X.useCallback((j,$)=>{s("REJECT_PLAN",{taskId:j,feedback:$})},[s]),k=X.useCallback((j,$)=>{s("INJECT_MESSAGE",{agentId:j,message:$})},[s]),g=X.useCallback((j,$)=>{s("INJECT_RAW",{agentId:j,data:$})},[s]),b=X.useCallback(j=>{s("PAUSE_AGENT",{agentId:j})},[s]),T=X.useCallback(j=>{s("RESUME_AGENT",{agentId:j})},[s]),I=X.useCallback(j=>{s("PAUSE_TASK",{taskId:j})},[s]),O=X.useCallback(j=>{s("RESUME_TASK",{taskId:j})},[s]),A=X.useCallback((j,$)=>{s("EDIT_TASK",{taskId:j,updates:$})},[s]),F=X.useCallback(j=>{s("ABORT_TASK",{taskId:j})},[s]),W=X.useCallback(j=>{s("RESET_TASK",{taskId:j})},[s]),G=X.useCallback(j=>{s("RETRY_TASK",{taskId:j})},[s]),q=X.useCallback(j=>{s("DELETE_TASK",{taskId:j})},[s]),N=X.useCallback(j=>{s("OPEN_TASK_WORKSPACE",{taskId:j})},[s]),E=X.useCallback(j=>{s("UPDATE_SETTINGS",j)},[s]),D=X.useCallback(j=>{s("OPEN_AGENT_TERMINAL",{agentId:j})},[s]),M=X.useCallback(j=>{s("RETURN_AGENT_TERMINAL",{agentId:j})},[s]),B=X.useCallback((j,$)=>(v.current.set(j,$),s("SUBSCRIBE_TERMINAL",{agentId:j}),()=>{v.current.delete(j),s("UNSUBSCRIBE_TERMINAL",{agentId:j})}),[s]);return{connected:e,isInitialized:r,tasks:a,agents:C,repos:c,settings:S,notifications:_,addTask:p,approvePlan:w,rejectPlan:y,pauseTask:I,resumeTask:O,editTask:A,abortTask:F,resetTask:W,retryTask:G,deleteTask:q,openTaskWorkspace:N,injectMessage:k,sendRaw:g,pauseAgent:b,resumeAgent:T,updateSettings:E,subscribeTerminal:B,openAgentTerminal:D,returnAgentTerminal:M}}const gf={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ma={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function mf(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/6e4);if(r<1)return"now";if(r<60)return`${r}m`;const i=Math.floor(r/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function Sf(e,t=72){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function yf({task:e,columnColor:t,agents:r,isAnimating:i,onApprove:a,onReject:f,onAgentClick:C,onTaskClick:l}){const[c,d]=X.useState(!1),[S,h]=X.useState(""),[_,m]=X.useState(!1),x=e.status==="blocked",v=r.find(s=>s.id===e.assignedTo),u=x?"var(--red)":t,o=x?"rgba(255,77,77,0.05)":"transparent";return R.jsxs("div",{onClick:()=>l&&l(e),onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),style:{cursor:"pointer",background:_?"var(--bg2)":`linear-gradient(${o}, ${o}), var(--bg1)`,borderRadius:6,borderLeft:`3px solid ${u}`,padding:"10px 12px",transform:_?"translateY(-1px)":"none",boxShadow:_?"0 4px 12px rgba(0,0,0,0.3)":"none",transition:"transform 0.15s, box-shadow 0.15s, background 0.15s",animation:i?"card-enter 0.3s ease-out":"none"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:gf[e.priority]||"var(--text3)",flexShrink:0}}),R.jsx("span",{style:{fontSize:11,color:"var(--text3)",fontFamily:"var(--font-mono)"},children:e.id}),R.jsx("span",{style:{flex:1}}),R.jsx("span",{style:{fontSize:10,color:"var(--text3)"},children:mf(e.createdAt)})]}),R.jsx("div",{style:{fontSize:12,lineHeight:1.4,marginBottom:8,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:e.progress>0?6:0},children:[R.jsx("span",{style:{padding:"1px 6px",borderRadius:3,fontSize:10,background:(ma[e.status]||"var(--text3)")+"20",color:ma[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")}),R.jsx("span",{style:{flex:1}}),v&&R.jsxs("span",{onClick:s=>{s.stopPropagation(),C(v.id)},title:v.printMode?`Open ${v.name} output`:`Open ${v.name} terminal`,style:{display:"inline-flex",alignItems:"center",gap:3,padding:"2px 6px",borderRadius:9,background:(v.color||"var(--text3)")+"26",color:v.color||"var(--text3)",fontSize:10,cursor:"pointer",transition:"background 0.15s"},onMouseEnter:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"40",onMouseLeave:s=>s.currentTarget.style.background=(v.color||"var(--text3)")+"26",children:[R.jsx("span",{style:{fontSize:10,lineHeight:1},children:v.icon||v.id.charAt(0).toUpperCase()}),v.name]})]}),e.progress>0&&R.jsxs("div",{style:{marginBottom:6},children:[R.jsx("div",{style:{height:2,background:"var(--border)",borderRadius:1},children:R.jsx("div",{style:{height:"100%",borderRadius:1,width:`${e.progress}%`,background:t,transition:"width 0.3s"}})}),R.jsxs("div",{style:{fontSize:9,color:"var(--text3)",textAlign:"right",marginTop:2},children:[e.progress,"%"]})]}),e.status==="awaiting_approval"&&R.jsxs("div",{style:{display:"flex",gap:4,marginTop:4},children:[R.jsx("button",{onClick:s=>{s.stopPropagation(),a(e.id)},style:{padding:"3px 8px",borderRadius:3,background:"rgba(61, 220, 132, 0.15)",color:"var(--green)",fontSize:11},children:"Approve"}),R.jsx("button",{onClick:s=>{s.stopPropagation(),d(!0),h("")},style:{padding:"3px 8px",borderRadius:3,background:"rgba(255, 77, 77, 0.1)",color:"var(--text2)",fontSize:11},children:"Revise"})]}),e.status==="done"&&e.prUrl&&R.jsx("div",{style:{marginTop:4},children:R.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{padding:"3px 8px",borderRadius:3,background:"rgba(96, 165, 250, 0.15)",color:"#60A5FA",fontSize:11,textDecoration:"none",display:"inline-block"},children:"PR"})}),x&&e.blockedReason&&R.jsxs("div",{style:{marginTop:4},children:[R.jsx("span",{style:{fontSize:10,color:"var(--red)",fontWeight:600},children:"AWAITING HUMAN INPUT"}),R.jsx("span",{title:e.blockedReason,style:{fontSize:10,color:"var(--text3)",marginLeft:6},children:Sf(e.blockedReason)})]}),c&&R.jsx("div",{style:{marginTop:6,animation:"fade-in 0.15s ease-out"},children:R.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:S,onChange:s=>h(s.target.value),onKeyDown:s=>{s.key==="Enter"&&S.trim()&&(f(e.id,S.trim()),d(!1),h("")),s.key==="Escape"&&(d(!1),h(""))},style:{width:"100%",fontSize:11,padding:"4px 8px"}})})]})}function Cf({column:e,tasks:t,agents:r,animatingTasks:i,onApprove:a,onReject:f,onAgentClick:C,onAddTask:l,onTaskClick:c,canCreateTask:d}){const S=e.agentPrefix?r.filter(h=>h.id.startsWith(e.agentPrefix+"-")||h.id===e.agentPrefix):[];return R.jsxs("div",{style:{display:"flex",flexDirection:"column",background:"var(--bg)",minHeight:0,overflow:"hidden"},children:[R.jsxs("div",{style:{padding:"12px 12px 8px",borderBottom:`2px solid ${e.color}30`},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:S.length>0?8:0},children:[R.jsx("span",{style:{width:16,height:16,display:"inline-flex",alignItems:"center",justifyContent:"center",color:e.color,flexShrink:0},children:e.icon}),R.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:12,letterSpacing:1,textTransform:"uppercase"},children:e.title}),R.jsx("span",{style:{flex:1}}),t.length>0&&R.jsx("span",{style:{width:20,height:20,borderRadius:"50%",background:e.color+"33",color:e.color,display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,fontWeight:600},children:t.length})]}),S.length>0&&R.jsx("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:S.map(h=>{const _=h.status==="active",m=h.status==="blocked",x=h.status==="draining",v=!_&&!m&&!x;return R.jsxs("div",{onClick:()=>C(h.id),title:`${h.name} — ${h.status}`,style:{width:22,height:22,borderRadius:"50%",background:v?"transparent":h.color||e.color,border:v?`1px solid ${h.color||e.color}66`:x?`2px dashed ${h.color||e.color}`:m?"2px solid var(--red)":"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:10,cursor:"pointer",position:"relative",opacity:v?.4:1,transition:"opacity 0.15s"},children:[h.icon||h.id.charAt(0).toUpperCase(),_&&R.jsx("span",{style:{position:"absolute",bottom:-1,right:-1,width:5,height:5,borderRadius:"50%",background:"var(--green)",border:"1px solid var(--bg)"}})]},h.id)})})]}),R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:8,display:"flex",flexDirection:"column",gap:6},children:[t.length===0&&R.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text3)",fontSize:11,textAlign:"center",padding:16},children:e.id==="backlog"?d?R.jsx("span",{onClick:l,style:{cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:"No tasks — click + ADD TASK"}):"No tasks yet — add a repository in Settings to create your first task":e.id==="done"?"No completed tasks":"All clear"}),t.map(h=>R.jsx(yf,{task:h,columnColor:e.color,agents:r,isAnimating:i.has(h.id),onApprove:a,onReject:f,onAgentClick:C,onTaskClick:c},h.id))]})]})}function $r({children:e}){return R.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",style:{width:"100%",height:"100%",display:"block"},children:e})}const ir=[{id:"backlog",title:"Backlog",icon:R.jsxs($r,{children:[R.jsx("rect",{x:"2.5",y:"3",width:"11",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),R.jsx("path",{d:"M5 6h6M5 8.5h6M5 11h3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["backlog","paused","aborted"],agentPrefix:null,color:"var(--text3)"},{id:"planning",title:"Planning",icon:R.jsxs($r,{children:[R.jsx("path",{d:"M4 12.5h2.25l5.75-5.75-2.25-2.25L4 10.25v2.25Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),R.jsx("path",{d:"M8.75 5.75 11 8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),R.jsx("path",{d:"M3.5 13h9",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["workspace_setup","planning","awaiting_approval"],agentPrefix:"plan",color:"var(--steel2)"},{id:"implementation",title:"Implementation",icon:R.jsxs($r,{children:[R.jsx("path",{d:"m6.25 4.5 1.25-1.25 5 5L11.25 9.5l-.9-.9-1.6 1.6a1.5 1.5 0 0 1-2.12 0l-.83-.83a1.5 1.5 0 0 1 0-2.12l1.6-1.6-.9-.9Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),R.jsx("path",{d:"M4 12.25 7.5 8.75",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"}),R.jsx("path",{d:"m3.5 10.5 2 2",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5"})]}),statuses:["queued","implementing"],agentPrefix:"imp",color:"var(--green)"},{id:"review",title:"Review",icon:R.jsxs($r,{children:[R.jsx("path",{d:"M1.75 8s2.25-3.75 6.25-3.75S14.25 8 14.25 8 12 11.75 8 11.75 1.75 8 1.75 8Z",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5"}),R.jsx("circle",{cx:"8",cy:"8",r:"1.75",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),statuses:["review"],agentPrefix:"rev",color:"var(--yellow)"},{id:"done",title:"Done",icon:R.jsxs($r,{children:[R.jsx("circle",{cx:"8",cy:"8",r:"5.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5"}),R.jsx("path",{d:"m5.5 8 1.5 1.5 3.5-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})]}),statuses:["done"],agentPrefix:null,color:"var(--green)"}];function wf({tasks:e,agents:t,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:l}){const c=X.useRef(new Map),[d,S]=X.useState(new Set);X.useEffect(()=>{const _=c.current,m=new Set;if(e.forEach(v=>{const u=_.get(v.id);u&&u!==v.status&&m.add(v.id)}),m.size>0){S(m);const v=setTimeout(()=>S(new Set),350);return()=>clearTimeout(v)}const x=new Map;e.forEach(v=>x.set(v.id,v.status)),c.current=x},[e]),X.useEffect(()=>{const _=new Map;e.forEach(m=>_.set(m.id,m.status)),c.current=_},[e]);const h=X.useMemo(()=>{const _={};ir.forEach(m=>{_[m.id]=[]}),e.forEach(m=>{if(m.status==="blocked"){const v=ir.find(u=>u.id===m.lastActiveStage);if(v){_[v.id].push(m);return}if(m.assignedTo){const u=ir.find(o=>o.agentPrefix&&m.assignedTo.startsWith(o.agentPrefix));if(u){_[u.id].push(m);return}}_.backlog.push(m);return}const x=ir.find(v=>v.statuses.includes(m.status));x?_[x.id].push(m):_.backlog.push(m)});for(const m of ir)_[m.id].sort((x,v)=>x.status==="blocked"&&v.status!=="blocked"?-1:x.status!=="blocked"&&v.status==="blocked"?1:new Date(v.updatedAt).getTime()-new Date(x.updatedAt).getTime());return _},[e]);return R.jsx("div",{style:{flex:1,display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:1,background:"var(--border)",minHeight:0,overflow:"hidden"},children:ir.map(_=>R.jsx(Cf,{column:_,tasks:h[_.id],agents:t,animatingTasks:d,onApprove:r,onReject:i,onAgentClick:a,onAddTask:f,onTaskClick:C,canCreateTask:l},_.id))})}var Pu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=c(9042),_=c(9924),m=c(844),x=c(4725),v=c(2585),u=c(3656);let o=l.AccessibilityManager=class extends m.Disposable{constructor(s,n,p,w){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=w,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 y=0;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);if(this._topBoundaryFocusListener=y=>this._handleBoundaryFocus(y,0),this._bottomBoundaryFocusListener=y=>this._handleBoundaryFocus(y,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 _.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(y=>this._handleResize(y.rows))),this.register(this._terminal.onRender(y=>this._refreshRows(y.start,y.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(y=>this._handleChar(y))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
41
41
  `))),this.register(this._terminal.onA11yTab(y=>this._handleTab(y))),this.register(this._terminal.onKey(y=>this._handleKey(y.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,u.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,m.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let n=0;n<s;n++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
42
42
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,n){this._liveRegionDebouncer.refresh(s,n,this._terminal.rows)}_renderRows(s,n){const p=this._terminal.buffer,w=p.lines.length.toString();for(let y=s;y<=n;y++){const k=p.lines.get(p.ydisp+y),g=[],b=(k==null?void 0:k.translateToString(!0,void 0,void 0,g))||"",T=(p.ydisp+y+1).toString(),I=this._rowElements[y];I&&(b.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=b,this._rowColumns.set(I,g)),I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",w))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,n){const p=s.target,w=this._rowElements[n===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==w)return;let y,k;if(n===0?(y=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(y=this._rowElements.shift(),k=p,this._rowContainer.removeChild(y)),y.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),n===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(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var b;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let n={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((n.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||n.node===p.node&&n.offset>p.offset)&&([n,p]=[p,n]),n.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(n={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(n.node))return;const w=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(w)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:w,offset:((b=w.textContent)==null?void 0:b.length)??0}),!this._rowContainer.contains(p.node))return;const y=({node:T,offset:I})=>{const O=T instanceof Text?T.parentNode:T;let A=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(O);if(!F)return console.warn("columns is null. Race condition?"),null;let W=I<F.length?F[I]:F.slice(-1)[0]+1;return W>=this._terminal.cols&&(++A,W=0),{row:A,column:W}},k=y(n),g=y(p);if(k&&g){if(k.row>g.row||k.row===g.row&&k.column>=g.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(g.row-k.row)*this._terminal.cols-k.column+g.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_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 s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=o=d([S(1,v.IInstantiationService),S(2,x.ICoreBrowserService),S(3,x.IRenderService)],o)},3614:(C,l)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function d(_,m){return m?"\x1B[200~"+_+"\x1B[201~":_}function S(_,m,x,v){_=d(_=c(_),x.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(_,!0),m.value=""}function h(_,m,x){const v=x.getBoundingClientRect(),u=_.clientX-v.left-10,o=_.clientY-v.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${u}px`,m.style.top=`${o}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=d,l.copyHandler=function(_,m){_.clipboardData&&_.clipboardData.setData("text/plain",m.selectionText),_.preventDefault()},l.handlePasteEvent=function(_,m,x,v){_.stopPropagation(),_.clipboardData&&S(_.clipboardData.getData("text/plain"),m,x,v)},l.paste=S,l.moveTextAreaUnderMouseCursor=h,l.rightClickHandler=function(_,m,x,v,u){h(_,m,x),u&&v.rightClickSelect(_),m.value=v.selectionText,m.select()}},7239:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=c(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(S,h,_){this._css.set(S,h,_)}getCss(S,h){return this._css.get(S,h)}setColor(S,h,_){this._color.set(S,h,_)}getColor(S,h){return this._color.get(S,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,d,S,h){c.addEventListener(d,S,h);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(d,S,h))}}}},3551:function(C,l,c){var d=this&&this.__decorate||function(o,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,n,p);else for(var g=o.length-1;g>=0;g--)(w=o[g])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(o,s){return function(n,p){s(n,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const h=c(3656),_=c(8460),m=c(844),x=c(2585),v=c(4725);let u=l.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(o,s,n,p,w){super(),this._element=o,this._mouseService=s,this._renderService=n,this._bufferService=p,this._linkProviderService=w,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{var y;this._lastMouseEvent=void 0,(y=this._activeProviderReplies)==null||y.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(o){this._lastMouseEvent=o;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const n=o.composedPath();for(let p=0;p<n.length;p++){const w=n[p];if(w.classList.contains("xterm"))break;if(w.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(o){if(this._activeLine!==o.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(o,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,o)||(this._clearCurrentLink(),this._askForLink(o,!0))}_askForLink(o,s){var p,w;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach(y=>{y==null||y.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=o.y);let n=!1;for(const[y,k]of this._linkProviderService.linkProviders.entries())s?(w=this._activeProviderReplies)!=null&&w.get(y)&&(n=this._checkLinkProviderResult(y,o,n)):k.provideLinks(o.y,g=>{var T,I;if(this._isMouseOut)return;const b=g==null?void 0:g.map(O=>({link:O}));(T=this._activeProviderReplies)==null||T.set(y,b),n=this._checkLinkProviderResult(y,o,n),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)})}_removeIntersectingLinks(o,s){const n=new Set;for(let p=0;p<s.size;p++){const w=s.get(p);if(w)for(let y=0;y<w.length;y++){const k=w[y],g=k.link.range.start.y<o?0:k.link.range.start.x,b=k.link.range.end.y>o?this._bufferService.cols:k.link.range.end.x;for(let T=g;T<=b;T++){if(n.has(T)){w.splice(y--,1);break}n.add(T)}}}}_checkLinkProviderResult(o,s,n){var y;if(!this._activeProviderReplies)return n;const p=this._activeProviderReplies.get(o);let w=!1;for(let k=0;k<o;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(w=!0);if(!w&&p){const k=p.find(g=>this._linkAtPosition(g.link,s));k&&(n=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let k=0;k<this._activeProviderReplies.size;k++){const g=(y=this._activeProviderReplies.get(k))==null?void 0:y.find(b=>this._linkAtPosition(b.link,s));if(g){n=!0,this._handleNewLink(g);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(o){if(!this._currentLink)return;const s=this._positionFromMouseEvent(o,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(o,this._currentLink.link.text)}_clearCurrentLink(o,s){this._currentLink&&this._lastMouseEvent&&(!o||!s||this._currentLink.link.range.start.y>=o&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(o){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(o.link,s)&&(this._currentLink=o,this._currentLink.state={decorations:{underline:o.link.decorations===void 0||o.link.decorations.underline,pointerCursor:o.link.decorations===void 0||o.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,o.link,this._lastMouseEvent),o.link.decorations={},Object.defineProperties(o.link.decorations,{pointerCursor:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.pointerCursor},set:n=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,p;return(p=(n=this._currentLink)==null?void 0:n.state)==null?void 0:p.decorations.underline},set:n=>{var p,w,y;(p=this._currentLink)!=null&&p.state&&((y=(w=this._currentLink)==null?void 0:w.state)==null?void 0:y.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;const p=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=w&&(this._clearCurrentLink(p,w),this._lastMouseEvent)){const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._askForLink(y,!1)}})))}_linkHover(o,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&o.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(o,s){const n=o.range,p=this._bufferService.buffer.ydisp,w=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-p-1,n.end.x,n.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(w)}_linkLeave(o,s,n){var p;(p=this._currentLink)!=null&&p.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&o.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(o,s){const n=o.range.start.y*this._bufferService.cols+o.range.start.x,p=o.range.end.y*this._bufferService.cols+o.range.end.x,w=s.y*this._bufferService.cols+s.x;return n<=w&&w<=p}_positionFromMouseEvent(o,s,n){const p=n.getCoords(o,s,this._bufferService.cols,this._bufferService.rows);if(p)return{x:p[0],y:p[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(o,s,n,p,w){return{x1:o,y1:s,x2:n,y2:p,cols:this._bufferService.cols,fg:w}}};l.Linkifier=u=d([S(1,v.IMouseService),S(2,v.IRenderService),S(3,x.IBufferService),S(4,v.ILinkProviderService)],u)},9042:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(C,l,c){var d=this&&this.__decorate||function(v,u,o,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,o,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,o,w):n(u,o))||w);return p>3&&w&&Object.defineProperty(u,o,w),w},S=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const h=c(511),_=c(2585);let m=l.OscLinkProvider=class{constructor(v,u,o){this._bufferService=v,this._optionsService=u,this._oscLinkService=o}provideLinks(v,u){var b;const o=this._bufferService.buffer.lines.get(v-1);if(!o)return void u(void 0);const s=[],n=this._optionsService.rawOptions.linkHandler,p=new h.CellData,w=o.getTrimmedLength();let y=-1,k=-1,g=!1;for(let T=0;T<w;T++)if(k!==-1||o.hasContent(T)){if(o.loadCell(T,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=T,y=p.extended.urlId;continue}g=p.extended.urlId!==y}else k!==-1&&(g=!0);if(g||k!==-1&&T===w-1){const I=(b=this._oscLinkService.getLinkData(y))==null?void 0:b.uri;if(I){const O={start:{x:k+1,y:v},end:{x:T+(g||T!==w-1?0:1),y:v}};let A=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const F=new URL(I);["http:","https:"].includes(F.protocol)||(A=!0)}catch{A=!0}A||s.push({text:I,range:O,activate:(F,W)=>n?n.activate(F,W,O):x(0,W),hover:(F,W)=>{var G;return(G=n==null?void 0:n.hover)==null?void 0:G.call(n,F,W,O)},leave:(F,W)=>{var G;return(G=n==null?void 0:n.leave)==null?void 0:G.call(n,F,W,O)}})}g=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=T,y=p.extended.urlId):(k=-1,y=-1)}}u(s)}};function x(v,u){if(confirm(`Do you want to navigate to ${u}?
43
43
 
44
- WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=m=d([S(0,_.IBufferService),S(1,_.IOptionsService),S(2,_.IOscLinkService)],m)},6193:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,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,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=c(3614),S=c(3656),h=c(3551),_=c(9042),m=c(3730),x=c(1680),v=c(3107),u=c(5744),o=c(2950),s=c(1296),n=c(428),p=c(4269),w=c(5114),y=c(8934),k=c(3230),g=c(9312),b=c(4725),T=c(6731),I=c(8055),O=c(8969),A=c(8460),F=c(844),W=c(6114),G=c(8437),q=c(2584),N=c(7399),E=c(5941),D=c(9074),M=c(2585),B=c(5435),j=c(4567),$=c(779);class U extends O.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(P={}){super(P),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,K)=>this.refresh(R,K))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(R=>this._reportWindowsOptions(R))),this.register(this._inputHandler.onColor(R=>this._handleColorEvent(R))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(R=>this._afterResize(R.cols,R.rows))),this.register((0,F.toDisposable)(()=>{var R,K;this._customKeyEventHandler=void 0,(K=(R=this.element)==null?void 0:R.parentNode)==null||K.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const R of P){let K,H="";switch(R.index){case 256:K="foreground",H="10";break;case 257:K="background",H="11";break;case 258:K="cursor",H="12";break;default:K="ansi",H="4;"+R.index}switch(R.type){case 0:const Y=I.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[R.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${H};${(0,E.toRgbString)(Y)}${q.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(z=>z.ansi[R.index]=I.channels.toColor(...R.color));else{const z=K;this._themeService.modifyColors(J=>J[z]=I.channels.toColor(...R.color))}break;case 2:this._themeService.restoreColor(R.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(j.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.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 P=this.buffer.ybase+this.buffer.y,R=this.buffer.lines.get(P);if(!R)return;const K=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Y=R.getWidth(K),z=this._renderService.dimensions.css.cell.width*Y,J=this.buffer.y*this._renderService.dimensions.css.cell.height,ne=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ne+"px",this.textarea.style.top=J+"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,S.addDisposableDomListener)(this.element,"copy",R=>{this.hasSelection()&&(0,d.copyHandler)(R,this._selectionService)}));const P=R=>(0,d.handlePasteEvent)(R,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,S.addDisposableDomListener)(this.element,"paste",P)),W.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",R=>{R.button===2&&(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",R=>{(0,d.rightClickHandler)(R,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",R=>{R.button===1&&(0,d.moveTextAreaUnderMouseCursor)(R,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,S.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var K;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.appendChild(this.element);const R=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),R.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,S.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),R.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),W.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(w.CoreBrowserService,this.textarea,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.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(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(R);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.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(b.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,S.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,S.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(j.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,R=this.element;function K(z){const J=P._mouseService.getMouseReportCoords(z,P.screenElement);if(!J)return!1;let ne,fe;switch(z.overrideType||z.type){case"mousemove":fe=32,z.buttons===void 0?(ne=3,z.button!==void 0&&(ne=z.button<3?z.button:3)):ne=1&z.buttons?0:4&z.buttons?1:2&z.buttons?2:3;break;case"mouseup":fe=0,ne=z.button<3?z.button:3;break;case"mousedown":fe=1,ne=z.button<3?z.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(z)===!1||P.viewport.getLinesScrolled(z)===0)return!1;fe=z.deltaY<0?0:1,ne=4;break;default:return!1}return!(fe===void 0||ne===void 0||ne>4)&&P.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:ne,action:fe,ctrl:z.ctrlKey,alt:z.altKey,shift:z.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:z=>(K(z),z.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(z)),wheel:z=>(K(z),this.cancel(z,!0)),mousedrag:z=>{z.buttons&&K(z)},mousemove:z=>{z.buttons||K(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||(R.addEventListener("mousemove",Y.mousemove),H.mousemove=Y.mousemove):(R.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&z?H.wheel||(R.addEventListener("wheel",Y.wheel,{passive:!1}),H.wheel=Y.wheel):(R.removeEventListener("wheel",H.wheel),H.wheel=null),2&z?H.mouseup||(H.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&z?H.mousedrag||(H.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(R,"mousedown",z=>{if(z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(z))return K(z),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(z)})),this.register((0,S.addDisposableDomListener)(R,"wheel",z=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(z)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(z);if(J===0)return;const ne=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(z.deltaY<0?"A":"B");let fe="";for(let Me=0;Me<Math.abs(J);Me++)fe+=ne;return this.coreService.triggerDataEvent(fe,!0),this.cancel(z,!0)}return this.viewport.handleWheel(z)?this.cancel(z):void 0}},{passive:!1})),this.register((0,S.addDisposableDomListener)(R,"touchstart",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(z),this.cancel(z)},{passive:!0})),this.register((0,S.addDisposableDomListener)(R,"touchmove",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(z)?void 0:this.cancel(z)},{passive:!1}))}refresh(P,R){var K;(K=this._renderService)==null||K.refreshRows(P,R)}updateCursorStyle(P){var R;(R=this._selectionService)!=null&&R.shouldColumnSelect(P)?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(P,R,K=0){var H;K===1?(super.scrollLines(P,R,K),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(P)}paste(P){(0,d.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const R=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),R}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,R,K){this._selectionService.setSelection(P,R,K)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,R){var K;(K=this._selectionService)==null||K.selectLines(P,R)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const R=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!R&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;R||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,N.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),K.type===3||K.type===2){const H=this.rows-1;return this.scrollLines(K.type===2?-H:H),this.cancel(P,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(K.cancel&&this.cancel(P,!0),!K.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==q.C0.ETX&&K.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,R){const K=P.isMac&&!this.options.macOptionIsMeta&&R.altKey&&!R.ctrlKey&&!R.metaKey||P.isWindows&&R.altKey&&R.ctrlKey&&!R.metaKey||P.isWindows&&R.getModifierState("AltGraph");return R.type==="keypress"?K:K&&(!R.keyCode||R.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(R){return R.keyCode===16||R.keyCode===17||R.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let R;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)R=P.charCode;else if(P.which===null||P.which===void 0)R=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;R=P.which}return!(!R||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(R=String.fromCharCode(R),this._onKey.fire({key:R,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(R,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const R=P.data;return this.coreService.triggerDataEvent(R,!0),this.cancel(P),!0}return!1}resize(P,R){P!==this.cols||R!==this.rows?super.resize(P,R):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,R){var K,H;(K=this._charSizeService)==null||K.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var P;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 R=1;R<this.rows;R++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var R,K;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(R=this._selectionService)==null||R.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const R=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${K};${R}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${Y};${H}t`)}}cancel(P,R){if(this.options.cancelEvents||R)return P.preventDefault(),P.stopPropagation(),!1}}l.Terminal=U},9924:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,m=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(C,l,c){var d=this&&this.__decorate||function(o,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,n,p);else for(var g=o.length-1;g>=0;g--)(w=o[g])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(o,s){return function(n,p){s(n,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=c(3656),_=c(4725),m=c(8460),x=c(844),v=c(2585);let u=l.Viewport=class extends x.Disposable{constructor(o,s,n,p,w,y,k,g){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=n,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(g.colors),this.register(g.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.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(o){if(o)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 s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){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 s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var g;let n,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=o;b<y;b++){const T=k.get(b);if(!T)continue;const I=(g=k.get(b+1))==null?void 0:g.isWrapped;if(p+=T.translateToString(!I),!I||b===k.length-1){const O=document.createElement("div");O.textContent=p,w.push(O),p.length>0&&(n=O),p=""}}return{bufferElements:w,cursorElement:n}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};l.Viewport=u=d([S(2,v.IBufferService),S(3,v.IOptionsService),S(4,_.ICharSizeService),S(5,_.IRenderService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],u)},3107:function(C,l,c){var d=this&&this.__decorate||function(v,u,o,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,o,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,o,w):n(u,o))||w);return p>3&&w&&Object.defineProperty(u,o,w),w},S=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),m=c(2585);let x=l.BufferDecorationRenderer=class extends _.Disposable{constructor(v,u,o,s,n){super(),this._screenElement=v,this._bufferService=u,this._coreBrowserService=o,this._decorationService=s,this._renderService=n,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(p=>this._removeDecoration(p))),this.register((0,_.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var s;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((s=v==null?void 0:v.options)==null?void 0:s.layer)==="top"),u.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=v.options.x??0;return o&&o>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(v,u),u}_refreshStyle(v){const u=v.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let o=this._decorationElements.get(v);o||(o=this._createElement(v),v.element=o,this._decorationElements.set(v,o),this._container.appendChild(o),v.onDispose(()=>{this._decorationElements.delete(v),o.remove()})),o.style.top=u*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(o)}}_refreshXPosition(v,u=v.element){if(!u)return;const o=v.options.x??0;(v.options.anchor||"left")==="right"?u.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var u;(u=this._decorationElements.get(v))==null||u.remove(),this._decorationElements.delete(v),v.dispose()}};l.BufferDecorationRenderer=x=d([S(1,m.IBufferService),S(2,h.ICoreBrowserService),S(3,m.IDecorationService),S(4,h.IRenderService)],x)},5871:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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 d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,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,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,S){return d>=c.startBufferLine-this._linePadding[S||"full"]&&d<=c.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(C,l,c){var d=this&&this.__decorate||function(n,p,w,y){var k,g=arguments.length,b=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(g<3?k(b):g>3?k(p,w,b):k(p,w))||b);return g>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),m=c(844),x=c(2585),v={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let s=l.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,w,y,k,g,b){var I;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=g,this._coreBrowserService=b,this._colorZoneStore=new h.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(),(I=this._viewportElement.parentElement)==null||I.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,m.toDisposable)(()=>{var O;(O=this._canvas)==null||O.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 n=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=n,u.center=p,u.right=n,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=u.left,o.right=u.left+u.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);v.left=p,v.center=p,v.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const p of n)p.position!=="full"&&this._renderColorZone(p);for(const p of n)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(o[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-v[n.position||"full"]/2),u[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[n.position||"full"]))}_queueRefresh(n,p){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};l.OverviewRulerRenderer=s=d([S(2,x.IBufferService),S(3,x.IDecorationService),S(4,_.IRenderService),S(5,x.IOptionsService),S(6,_.ICoreBrowserService)],s)},2950:function(C,l,c){var d=this&&this.__decorate||function(v,u,o,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,o,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,o,w):n(u,o))||w);return p>3&&w&&Object.defineProperty(u,o,w),w},S=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=c(4725),_=c(2585),m=c(2584);let x=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,u,o,s,n,p){this._textarea=v,this._compositionView=u,this._bufferService=o,this._optionsService=s,this._coreService=n,this._renderService=p,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,o=u.replace(v,"");this._dataAlreadySent=o,u.length>v.length?this._coreService.triggerDataEvent(o,!0):u.length<v.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):u.length===v.length&&u!==v&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};l.CompositionHelper=x=d([S(2,_.IBufferService),S(3,_.IOptionsService),S(4,_.ICoreService),S(5,h.IRenderService)],x)},9806:(C,l)=>{function c(d,S,h){const _=h.getBoundingClientRect(),m=d.getComputedStyle(h),x=parseInt(m.getPropertyValue("padding-left")),v=parseInt(m.getPropertyValue("padding-top"));return[S.clientX-_.left-x,S.clientY-_.top-v]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(d,S,h,_,m,x,v,u,o){if(!x)return;const s=c(d,S,h);return s?(s[0]=Math.ceil((s[0]+(o?v/2:0))/v),s[1]=Math.ceil(s[1]/u),s[0]=Math.min(Math.max(s[0],1),_+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),m),s):void 0}},9504:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=c(2584);function S(u,o,s,n){const p=u-h(u,s),w=o-h(o,s),y=Math.abs(p-w)-function(k,g,b){let T=0;const I=k-h(k,b),O=g-h(g,b);for(let A=0;A<Math.abs(I-O);A++){const F=_(k,g)==="A"?-1:1,W=b.buffer.lines.get(I+F*A);W!=null&&W.isWrapped&&T++}return T}(u,o,s);return v(y,x(_(u,o),n))}function h(u,o){let s=0,n=o.buffer.lines.get(u),p=n==null?void 0:n.isWrapped;for(;p&&u>=0&&u<o.rows;)s++,n=o.buffer.lines.get(--u),p=n==null?void 0:n.isWrapped;return s}function _(u,o){return u>o?"A":"B"}function m(u,o,s,n,p,w){let y=u,k=o,g="";for(;y!==s||k!==n;)y+=p?1:-1,p&&y>w.cols-1?(g+=w.buffer.translateBufferLineToString(k,!1,u,y),y=0,u=0,k++):!p&&y<0&&(g+=w.buffer.translateBufferLineToString(k,!1,0,u+1),y=w.cols-1,u=y,k--);return g+w.buffer.translateBufferLineToString(k,!1,u,y)}function x(u,o){const s=o?"O":"[";return d.C0.ESC+s+u}function v(u,o){u=Math.floor(u);let s="";for(let n=0;n<u;n++)s+=o;return s}l.moveToCellSequence=function(u,o,s,n){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return function(g,b,T,I,O,A){return S(b,I,O,A).length===0?"":v(m(g,b,g,b-h(b,O),!1,O).length,x("D",A))}(p,w,0,o,s,n)+S(w,o,s,n)+function(g,b,T,I,O,A){let F;F=S(b,I,O,A).length>0?I-h(I,O):b;const W=I,G=function(q,N,E,D,M,B){let j;return j=S(E,D,M,B).length>0?D-h(D,M):N,q<E&&j<=D||q>=E&&j<D?"C":"D"}(g,b,T,I,O,A);return v(m(g,F,T,W,G==="C",O).length,x(G,A))}(p,w,u,o,s,n);let y;if(w===o)return y=p>u?"D":"C",v(Math.abs(p-u),x(y,n));y=w>o?"D":"C";const k=Math.abs(w-o);return v(function(g,b){return b.cols-g}(w>o?u:p,s)+(k-1)*s.cols+1+((w>o?p:u)-1),x(y,n))}},1296:function(C,l,c){var d=this&&this.__decorate||function(A,F,W,G){var q,N=arguments.length,E=N<3?F:G===null?G=Object.getOwnPropertyDescriptor(F,W):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,F,W,G);else for(var D=A.length-1;D>=0;D--)(q=A[D])&&(E=(N<3?q(E):N>3?q(F,W,E):q(F,W))||E);return N>3&&E&&Object.defineProperty(F,W,E),E},S=this&&this.__param||function(A,F){return function(W,G){F(W,G,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=c(3787),_=c(2550),m=c(2223),x=c(6171),v=c(6052),u=c(4725),o=c(8055),s=c(8460),n=c(844),p=c(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",g="xterm-bg-",b="xterm-focus",T="xterm-selection";let I=1,O=l.DomRenderer=class extends n.Disposable{constructor(A,F,W,G,q,N,E,D,M,B,j,$,U){super(),this._terminal=A,this._document=F,this._element=W,this._screenElement=G,this._viewportElement=q,this._helperContainer=N,this._linkifier2=E,this._charSizeService=M,this._optionsService=B,this._bufferService=j,this._coreBrowserService=$,this._themeService=U,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,n.toDisposable)(()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.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 A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${y} .xterm-dim { color: ${o.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${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 W=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${G} { 50% { box-shadow: none; }}`,F+=`@keyframes ${q} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[N,E]of A.ansi.entries())F+=`${this._terminalSelector} .${k}${N} { color: ${E.css}; }${this._terminalSelector} .${k}${N}.xterm-dim { color: ${o.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${g}${N} { background-color: ${E.css}; }`;F+=`${this._terminalSelector} .${k}${m.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(A.background).css}; }${this._terminalSelector} .${k}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${g}${m.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let W=this._rowElements.length;W<=F;W++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),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(b),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,W),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,W);const G=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,N=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(N>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(W){const M=A[0]>F[0];D.appendChild(this._createSelectionElement(N,M?F[0]:A[0],M?A[0]:F[0],E-N+1))}else{const M=G===N?A[0]:0,B=N===q?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(N,M,B));const j=E-N-1;if(D.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,j)),N!==E){const $=q===E?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,$))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,F,W,G=1){const q=this._document.createElement("div"),N=F*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(W-F);return N+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-N),q.style.height=G*this.dimensions.css.cell.height+"px",q.style.top=A*this.dimensions.css.cell.height+"px",q.style.left=`${N}px`,q.style.width=`${E}px`,q}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 A of this._rowElements)A.replaceChildren()}renderRows(A,F){const W=this._bufferService.buffer,G=W.ybase+W.y,q=Math.min(W.x,this._bufferService.cols-1),N=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=A;M<=F;M++){const B=M+W.ydisp,j=this._rowElements[M],$=W.lines.get(B);if(!j||!$)break;j.replaceChildren(...this._rowFactory.createRow($,B,B===G,E,D,q,N,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,W,G,q,N){W<0&&(A=0),G<0&&(F=0);const E=this._bufferService.rows-1;W=Math.max(Math.min(W,E),0),G=Math.max(Math.min(G,E),0),q=Math.min(q,this._bufferService.cols);const D=this._bufferService.buffer,M=D.ybase+D.y,B=Math.min(D.x,q-1),j=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=W;Q<=G;++Q){const P=Q+D.ydisp,R=this._rowElements[Q],K=D.lines.get(P);if(!R||!K)break;R.replaceChildren(...this._rowFactory.createRow(K,P,P===M,$,U,B,j,this.dimensions.css.cell.width,this._widthCache,N?Q===W?A:0:-1,N?(Q===G?F:q)-1:-1))}}};l.DomRenderer=O=d([S(7,p.IInstantiationService),S(8,u.ICharSizeService),S(9,p.IOptionsService),S(10,p.IBufferService),S(11,u.ICoreBrowserService),S(12,u.IThemeService)],O)},3787:function(C,l,c){var d=this&&this.__decorate||function(y,k,g,b){var T,I=arguments.length,O=I<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(y,k,g,b);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(O=(I<3?T(O):I>3?T(k,g,O):T(k,g))||O);return I>3&&O&&Object.defineProperty(k,g,O),O},S=this&&this.__param||function(y,k){return function(g,b){k(g,b,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),m=c(511),x=c(2585),v=c(8055),u=c(4725),o=c(4269),s=c(6171),n=c(3734);let p=l.DomRendererRowFactory=class{constructor(y,k,g,b,T,I,O){this._document=y,this._characterJoinerService=k,this._optionsService=g,this._coreBrowserService=b,this._coreService=T,this._decorationService=I,this._themeService=O,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,g){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=g}createRow(y,k,g,b,T,I,O,A,F,W,G){const q=[],N=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,M=y.getNoBgTrimmedLength();g&&M<I+1&&(M=I+1);let B=0,j="",$=0,U=0,Q=0,P=!1,R=0,K=!1,H=0;const Y=[],z=W!==-1&&G!==-1;for(let J=0;J<M;J++){y.loadCell(J,this._workCell);let ne=this._workCell.getWidth();if(ne===0)continue;let fe=!1,Me=J,ee=this._workCell;if(N.length>0&&J===N[0][0]){fe=!0;const ce=N.shift();ee=new o.JoinedCellData(this._workCell,y.translateToString(!0,ce[0],ce[1]),ce[1]-ce[0]),Me=ce[1]-1,ne=ee.getWidth()}const Mr=this._isCellInSelection(J,k),$s=g&&J===I,Ks=z&&J>=W&&J<=G;let Vs=!1;this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{Vs=!0});let Ri=ee.getChars()||_.WHITESPACE_CELL_CHAR;if(Ri===" "&&(ee.isUnderline()||ee.isOverline())&&(Ri=" "),H=ne*A-F.get(Ri,ee.isBold(),ee.isItalic()),D){if(B&&(Mr&&K||!Mr&&!K&&ee.bg===$)&&(Mr&&K&&E.selectionForeground||ee.fg===U)&&ee.extended.ext===Q&&Ks===P&&H===R&&!$s&&!fe&&!Vs){ee.isInvisible()?j+=_.WHITESPACE_CELL_CHAR:j+=Ri,B++;continue}B&&(D.textContent=j),D=this._document.createElement("span"),B=0,j=""}else D=this._document.createElement("span");if($=ee.bg,U=ee.fg,Q=ee.extended.ext,P=Ks,R=H,K=Mr,fe&&I>=J&&I<=Me&&(I=J),!this._coreService.isCursorHidden&&$s&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Y.push("xterm-cursor-blink"),Y.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(ee.isBold()&&Y.push("xterm-bold"),ee.isItalic()&&Y.push("xterm-italic"),ee.isDim()&&Y.push("xterm-dim"),j=ee.isInvisible()?_.WHITESPACE_CELL_CHAR:ee.getChars()||_.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(Y.push(`xterm-underline-${ee.extended.underlineStyle}`),j===" "&&(j=" "),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let ce=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&ce<8&&(ce+=8),D.style.textDecorationColor=E.ansi[ce].css}ee.isOverline()&&(Y.push("xterm-overline"),j===" "&&(j=" ")),ee.isStrikethrough()&&Y.push("xterm-strikethrough"),Ks&&(D.style.textDecoration="underline");let $e=ee.getFgColor(),Ir=ee.getFgColorMode(),st=ee.getBgColor(),Pr=ee.getBgColorMode();const Gs=!!ee.isInverse();if(Gs){const ce=$e;$e=st,st=ce;const Hu=Ir;Ir=Pr,Pr=Hu}let yt,Li,Ct,Br=!1;switch(this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{ce.options.layer!=="top"&&Br||(ce.backgroundColorRGB&&(Pr=50331648,st=ce.backgroundColorRGB.rgba>>8&16777215,yt=ce.backgroundColorRGB),ce.foregroundColorRGB&&(Ir=50331648,$e=ce.foregroundColorRGB.rgba>>8&16777215,Li=ce.foregroundColorRGB),Br=ce.options.layer==="top")}),!Br&&Mr&&(yt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,st=yt.rgba>>8&16777215,Pr=50331648,Br=!0,E.selectionForeground&&(Ir=50331648,$e=E.selectionForeground.rgba>>8&16777215,Li=E.selectionForeground)),Br&&Y.push("xterm-decoration-top"),Pr){case 16777216:case 33554432:Ct=E.ansi[st],Y.push(`xterm-bg-${st}`);break;case 50331648:Ct=v.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(D,`background-color:#${w((st>>>0).toString(16),"0",6)}`);break;default:Gs?(Ct=E.foreground,Y.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=E.background}switch(yt||ee.isDim()&&(yt=v.color.multiplyOpacity(Ct,.5)),Ir){case 16777216:case 33554432:ee.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(D,Ct,E.ansi[$e],ee,yt,void 0)||Y.push(`xterm-fg-${$e}`);break;case 50331648:const ce=v.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(D,Ct,ce,ee,yt,Li)||this._addStyle(D,`color:#${w($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Ct,E.foreground,ee,yt,Li)||Gs&&Y.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Y.length&&(D.className=Y.join(" "),Y.length=0),$s||fe||Vs?D.textContent=j:B++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),q.push(D),J=Me}return D&&B&&(D.textContent=j),q}_applyMinimumContrast(y,k,g,b,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const O=this._getContrastCache(b);let A;if(T||I||(A=O.getColor(k.rgba,g.rgba)),A===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);A=v.color.ensureContrastRatio(T||k,I||g,F),O.setColor((T||k).rgba,(I||g).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const g=this._selectionStart,b=this._selectionEnd;return!(!g||!b)&&(this._columnSelectMode?g[0]<=b[0]?y>=g[0]&&k>=g[1]&&y<b[0]&&k<=b[1]:y<g[0]&&k>=g[1]&&y>=b[0]&&k<=b[1]:k>g[1]&&k<b[1]||g[1]===b[1]&&k===g[1]&&y>=g[0]&&y<b[0]||g[1]<b[1]&&k===b[1]&&y<b[0]||g[1]<b[1]&&k===g[1]&&y>=g[0])}};function w(y,k,g){for(;y.length<g;)y=k+y;return y}l.DomRendererRowFactory=p=d([S(1,u.ICharacterJoinerService),S(2,x.IOptionsService),S(3,u.ICoreBrowserService),S(4,x.ICoreService),S(5,x.IDecorationService),S(6,u.IThemeService)],p)},2550:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,d){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 S=c.createElement("span");S.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[S,h,_,m],this._container.appendChild(S),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(m),d.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,d,S,h){c===this._font&&d===this._fontSize&&S===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=d,this._weight=S,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,d,S){let h=0;if(!d&&!S&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(c,0);return x>0&&(this._flat[h]=x),x}let _=c;d&&(_+="B"),S&&(_+="I");let m=this._holey.get(_);if(m===void 0){let x=0;d&&(x|=1),S&&(x|=2),m=this._measure(c,x),m>0&&this._holey.set(_,m)}return m}_measure(c,d){const S=this._measureElements[d];return S.textContent=c.repeat(32),S.offsetWidth/32}}},2223:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,l)=>{function c(S){return 57508<=S&&S<=57558}function d(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(S){if(!S)throw new Error("value must not be falsy");return S},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},l.isEmoji=d,l.allowRescaling=function(S,h,_,m){return h===1&&_>Math.ceil(1.5*m)&&S!==void 0&&S>255&&!d(S)&&!c(S)&&!function(x){return 57344<=x&&x<=63743}(S)},l.treatGlyphAsBackgroundColor=function(S){return c(S)||function(h){return 9472<=h&&h<=9631}(S)},l.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}}}},l.computeNextVariantOffset=function(S,h,_=0){return(S-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(S,h,_,m=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const x=S.buffers.active.ydisp,v=h[1]-x,u=_[1]-x,o=Math.max(v,0),s=Math.min(u,S.rows-1);o>=S.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=v,this.viewportEndRow=u,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=_[0])}isCellSelected(S,h,_){return!!this.hasSelection&&(_-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[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(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=c(2585),_=c(8460),m=c(844);let x=l.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new u(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};l.CharSizeService=x=d([S(2,h.IOptionsService)],x);class v extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,p){n!==void 0&&n>0&&p!==void 0&&p>0&&(this._result.width=n,this._result.height=p)}}class u extends v{constructor(n,p,w){super(),this._document=n,this._parentElement=p,this._optionsService=w,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 o extends v{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(C,l,c){var d=this&&this.__decorate||function(o,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,n,p);else for(var g=o.length-1;g>=0;g--)(w=o[g])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(o,s){return function(n,p){s(n,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=c(3734),_=c(643),m=c(511),x=c(2585);class v extends h.AttributeData{constructor(s,n,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=v;let u=l.CharacterJoinerService=class Bu{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const p=[],w=n.translateToString(!0);let y=0,k=0,g=0,b=n.getFg(0),T=n.getBg(0);for(let I=0;I<n.getTrimmedLength();I++)if(n.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==T){if(I-y>1){const O=this._getJoinedRanges(w,g,k,n,y);for(let A=0;A<O.length;A++)p.push(O[A])}y=I,g=k,b=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const I=this._getJoinedRanges(w,g,k,n,y);for(let O=0;O<I.length;O++)p.push(I[O])}return p}_getJoinedRanges(s,n,p,w,y){const k=s.substring(n,p);let g=[];try{g=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const T=this._characterJoiners[b].handler(k);for(let I=0;I<T.length;I++)Bu._mergeRanges(g,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,w,y),g}_stringRangesToCellRanges(s,n,p){let w=0,y=!1,k=0,g=s[w];if(g){for(let b=p;b<this._bufferService.cols;b++){const T=n.getWidth(b),I=n.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&g[0]<=k&&(g[0]=b,y=!0),g[1]<=k){if(g[1]=b,g=s[++w],!g)break;g[0]<=k?(g[0]=b,y=!0):y=!1}k+=I}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(n[1]<=y[0])return s[w-1][1]=n[1],s;if(n[1]<=y[1])return s[w-1][1]=Math.max(n[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(n[1]<=y[0])return s.splice(w,0,n),s;if(n[1]<=y[1])return y[0]=Math.min(n[0],y[0]),s;n[0]<y[1]&&(y[0]=Math.min(n[0],y[0]),p=!0)}}return p?s[s.length-1][1]=n[1]:s.push(n),s}};l.CharacterJoinerService=u=d([S(0,x.IBufferService)],u)},5114:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=c(844),S=c(8460),h=c(3656);class _ extends d.Disposable{constructor(v,u,o){super(),this._textarea=v,this._window=u,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,S.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(v){this._window!==v&&(this._window=v,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}}l.CoreBrowserService=_;class m extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=c(844);class S extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const m=this.linkProviders.indexOf(_);m!==-1&&this.linkProviders.splice(m,1)}}}}l.LinkProviderService=S},8934:function(C,l,c){var d=this&&this.__decorate||function(x,v,u,o){var s,n=arguments.length,p=n<3?v:o===null?o=Object.getOwnPropertyDescriptor(v,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,v,u,o);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(p=(n<3?s(p):n>3?s(v,u,p):s(v,u))||p);return n>3&&p&&Object.defineProperty(v,u,p),p},S=this&&this.__param||function(x,v){return function(u,o){v(u,o,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=c(4725),_=c(9806);let m=l.MouseService=class{constructor(x,v){this._renderService=x,this._charSizeService=v}getCoords(x,v,u,o,s){return(0,_.getCoords)(window,x,v,u,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,v){const u=(0,_.getCoordsRelativeToElement)(window,x,v);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};l.MouseService=m=d([S(0,h.IRenderService),S(1,h.ICharSizeService)],m)},3230:function(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=c(6193),_=c(4725),m=c(8460),x=c(844),v=c(7226),u=c(2585);let o=l.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,w,y,k,g,b){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new x.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,I)=>this._renderRows(T,I),g),this.register(this._renderDebouncer),this.register(g.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(y.onDecorationRegistered(()=>this._fullRefresh())),this.register(y.onDecorationRemoved(()=>this._fullRefresh())),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(g.window,n),this.register(g.onWindowChange(T=>this._registerIntersectionObserver(T,n)))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const p=new s.IntersectionObserver(w=>this._handleIntersectionChange(w[w.length-1]),{threshold:0});p.observe(n),this._observerDisposable.value=(0,x.toDisposable)(()=>p.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.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(s,n,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,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(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(n=>this.refreshRows(n.start,n.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,n)}):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,p){var w;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,n,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};l.RenderService=o=d([S(2,u.IOptionsService),S(3,_.ICharSizeService),S(4,u.IDecorationService),S(5,u.IBufferService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],o)},9312:function(C,l,c){var d=this&&this.__decorate||function(g,b,T,I){var O,A=arguments.length,F=A<3?b:I===null?I=Object.getOwnPropertyDescriptor(b,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(g,b,T,I);else for(var W=g.length-1;W>=0;W--)(O=g[W])&&(F=(A<3?O(F):A>3?O(b,T,F):O(b,T))||F);return A>3&&F&&Object.defineProperty(b,T,F),F},S=this&&this.__param||function(g,b){return function(T,I){b(T,I,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=c(9806),_=c(9504),m=c(456),x=c(4725),v=c(8460),u=c(844),o=c(6114),s=c(4841),n=c(511),p=c(2585),w=" ",y=new RegExp(w,"g");let k=l.SelectionService=class extends u.Disposable{constructor(g,b,T,I,O,A,F,W,G){super(),this._element=g,this._screenElement=b,this._linkifier=T,this._bufferService=I,this._coreService=O,this._mouseService=A,this._optionsService=F,this._renderService=W,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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,b=this._model.finalSelectionEnd;return!(!g||!b||g[0]===b[0]&&g[1]===b[1])}get selectionText(){const g=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!g||!b)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(g[0]===b[0])return"";const O=g[0]<b[0]?g[0]:b[0],A=g[0]<b[0]?b[0]:g[0];for(let F=g[1];F<=b[1];F++){const W=T.translateBufferLineToString(F,!0,O,A);I.push(W)}}else{const O=g[1]===b[1]?b[0]:void 0;I.push(T.translateBufferLineToString(g[1],!0,g[0],O));for(let A=g[1]+1;A<=b[1]-1;A++){const F=T.lines.get(A),W=T.translateBufferLineToString(A,!0);F!=null&&F.isWrapped?I[I.length-1]+=W:I.push(W)}if(g[1]!==b[1]){const A=T.lines.get(b[1]),F=T.translateBufferLineToString(b[1],!0,0,b[0]);A&&A.isWrapped?I[I.length-1]+=F:I.push(F)}}return I.map(O=>O.replace(y," ")).join(o.isWindows?`\r
44
+ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=m=d([S(0,_.IBufferService),S(1,_.IOptionsService),S(2,_.IOscLinkService)],m)},6193:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(c,d){this._renderCallback=c,this._coreBrowserService=d,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,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const d=c(3614),S=c(3656),h=c(3551),_=c(9042),m=c(3730),x=c(1680),v=c(3107),u=c(5744),o=c(2950),s=c(1296),n=c(428),p=c(4269),w=c(5114),y=c(8934),k=c(3230),g=c(9312),b=c(4725),T=c(6731),I=c(8055),O=c(8969),A=c(8460),F=c(844),W=c(6114),G=c(8437),q=c(2584),N=c(7399),E=c(5941),D=c(9074),M=c(2585),B=c(5435),j=c(4567),$=c(779);class U extends O.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(P={}){super(P),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((L,K)=>this.refresh(L,K))),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,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(L=>this._afterResize(L.cols,L.rows))),this.register((0,F.toDisposable)(()=>{var L,K;this._customKeyEventHandler=void 0,(K=(L=this.element)==null?void 0:L.parentNode)==null||K.removeChild(this.element)}))}_handleColorEvent(P){if(this._themeService)for(const L of P){let K,H="";switch(L.index){case 256:K="foreground",H="10";break;case 257:K="background",H="11";break;case 258:K="cursor",H="12";break;default:K="ansi",H="4;"+L.index}switch(L.type){case 0:const Y=I.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${H};${(0,E.toRgbString)(Y)}${q.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(z=>z.ansi[L.index]=I.channels.toColor(...L.color));else{const z=K;this._themeService.modifyColors(J=>J[z]=I.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(P){P?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(j.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(P){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var P;return(P=this.textarea)==null?void 0:P.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.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 P=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(P);if(!L)return;const K=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Y=L.getWidth(K),z=this._renderService.dimensions.css.cell.width*Y,J=this.buffer.y*this._renderService.dimensions.css.cell.height,ne=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ne+"px",this.textarea.style.top=J+"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,S.addDisposableDomListener)(this.element,"copy",L=>{this.hasSelection()&&(0,d.copyHandler)(L,this._selectionService)}));const P=L=>(0,d.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",P)),this.register((0,S.addDisposableDomListener)(this.element,"paste",P)),W.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",L=>{L.button===2&&(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",L=>{(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),W.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",L=>{L.button===1&&(0,d.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",P=>this._keyUp(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",P=>this._keyDown(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",P=>this._keyPress(P),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",P=>this._compositionHelper.compositionupdate(P))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,S.addDisposableDomListener)(this.textarea,"input",P=>this._inputEvent(P),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(P){var K;if(!P)throw new Error("Terminal requires a parent element.");if(P.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=P.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"),P.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,S.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",_.promptLabel),W.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(w.CoreBrowserService,this.textarea,P.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(b.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(b.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(b.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(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(y.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.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(x.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(b.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,S.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,S.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(j.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const P=this,L=this.element;function K(z){const J=P._mouseService.getMouseReportCoords(z,P.screenElement);if(!J)return!1;let ne,fe;switch(z.overrideType||z.type){case"mousemove":fe=32,z.buttons===void 0?(ne=3,z.button!==void 0&&(ne=z.button<3?z.button:3)):ne=1&z.buttons?0:4&z.buttons?1:2&z.buttons?2:3;break;case"mouseup":fe=0,ne=z.button<3?z.button:3;break;case"mousedown":fe=1,ne=z.button<3?z.button:3;break;case"wheel":if(P._customWheelEventHandler&&P._customWheelEventHandler(z)===!1||P.viewport.getLinesScrolled(z)===0)return!1;fe=z.deltaY<0?0:1,ne=4;break;default:return!1}return!(fe===void 0||ne===void 0||ne>4)&&P.coreMouseService.triggerMouseEvent({col:J.col,row:J.row,x:J.x,y:J.y,button:ne,action:fe,ctrl:z.ctrlKey,alt:z.altKey,shift:z.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:z=>(K(z),z.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(z)),wheel:z=>(K(z),this.cancel(z,!0)),mousedrag:z=>{z.buttons&&K(z)},mousemove:z=>{z.buttons||K(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",Y.mousemove),H.mousemove=Y.mousemove):(L.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&z?H.wheel||(L.addEventListener("wheel",Y.wheel,{passive:!1}),H.wheel=Y.wheel):(L.removeEventListener("wheel",H.wheel),H.wheel=null),2&z?H.mouseup||(H.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&z?H.mousedrag||(H.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(L,"mousedown",z=>{if(z.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(z))return K(z),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(z)})),this.register((0,S.addDisposableDomListener)(L,"wheel",z=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(z)===!1)return!1;if(!this.buffer.hasScrollback){const J=this.viewport.getLinesScrolled(z);if(J===0)return;const ne=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(z.deltaY<0?"A":"B");let fe="";for(let Me=0;Me<Math.abs(J);Me++)fe+=ne;return this.coreService.triggerDataEvent(fe,!0),this.cancel(z,!0)}return this.viewport.handleWheel(z)?this.cancel(z):void 0}},{passive:!1})),this.register((0,S.addDisposableDomListener)(L,"touchstart",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(z),this.cancel(z)},{passive:!0})),this.register((0,S.addDisposableDomListener)(L,"touchmove",z=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(z)?void 0:this.cancel(z)},{passive:!1}))}refresh(P,L){var K;(K=this._renderService)==null||K.refreshRows(P,L)}updateCursorStyle(P){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(P)?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(P,L,K=0){var H;K===1?(super.scrollLines(P,L,K),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(P)}paste(P){(0,d.paste)(P,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(P){this._customKeyEventHandler=P}attachCustomWheelEventHandler(P){this._customWheelEventHandler=P}registerLinkProvider(P){return this._linkProviderService.registerLinkProvider(P)}registerCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(P);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(P){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(P)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(P){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+P)}registerDecoration(P){return this._decorationService.registerDecoration(P)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(P,L,K){this._selectionService.setSelection(P,L,K)}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 P;(P=this._selectionService)==null||P.clearSelection()}selectAll(){var P;(P=this._selectionService)==null||P.selectAll()}selectLines(P,L){var K;(K=this._selectionService)==null||K.selectLines(P,L)}_keyDown(P){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&P.altKey;if(!L&&!this._compositionHelper.keydown(P))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||P.key!=="Dead"&&P.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,N.evaluateKeyboardEvent)(P,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(P),K.type===3||K.type===2){const H=this.rows-1;return this.scrollLines(K.type===2?-H:H),this.cancel(P,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,P)||(K.cancel&&this.cancel(P,!0),!K.key||!!(P.key&&!P.ctrlKey&&!P.altKey&&!P.metaKey&&P.key.length===1&&P.key.charCodeAt(0)>=65&&P.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==q.C0.ETX&&K.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||P.altKey||P.ctrlKey?this.cancel(P,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(P,L){const K=P.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||P.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||P.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?K:K&&(!L.keyCode||L.keyCode>47)}_keyUp(P){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1||(function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18}(P)||this.focus(),this.updateCursorStyle(P),this._keyPressHandled=!1)}_keyPress(P){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(P)===!1)return!1;if(this.cancel(P),P.charCode)L=P.charCode;else if(P.which===null||P.which===void 0)L=P.keyCode;else{if(P.which===0||P.charCode===0)return!1;L=P.which}return!(!L||(P.altKey||P.ctrlKey||P.metaKey)&&!this._isThirdLevelShift(this.browser,P)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:P}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(P){if(P.data&&P.inputType==="insertText"&&(!P.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=P.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(P),!0}return!1}resize(P,L){P!==this.cols||L!==this.rows?super.resize(P,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(P,L){var K,H;(K=this._charSizeService)==null||K.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var P;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(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(P=this.viewport)==null||P.reset(),this.refresh(0,this.rows-1)}}reset(){var L,K;this.options.rows=this.rows,this.options.cols=this.cols;const P=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=P,this.refresh(0,this.rows-1)}clearTextureAtlas(){var P;(P=this._renderService)==null||P.clearTextureAtlas()}_reportFocus(){var P;(P=this.element)!=null&&P.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(P){if(this._renderService)switch(P){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${K};${L}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${Y};${H}t`)}}cancel(P,L){if(this.options.cancelEvents||L)return P.preventDefault(),P.stopPropagation(),!1}}l.Terminal=U},9924:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(c,d=1e3){this._renderCallback=c,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,d,S){this._rowCount=S,c=c!==void 0?c:0,d=d!==void 0?d: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,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,m=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,d)}}},1680:function(C,l,c){var d=this&&this.__decorate||function(o,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,n,p);else for(var g=o.length-1;g>=0;g--)(w=o[g])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(o,s){return function(n,p){s(n,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=c(3656),_=c(4725),m=c(8460),x=c(844),v=c(2585);let u=l.Viewport=class extends x.Disposable{constructor(o,s,n,p,w,y,k,g){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=n,this._optionsService=p,this._charSizeService=w,this._renderService=y,this._coreBrowserService=k,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(b=>this._activeBuffer=b.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(b=>this._renderDimensions=b)),this._handleThemeChange(g.colors),this.register(g.onChangeColors(b=>this._handleThemeChange(b))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.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(o){if(o)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 s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){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 s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var g;let n,p="";const w=[],y=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=o;b<y;b++){const T=k.get(b);if(!T)continue;const I=(g=k.get(b+1))==null?void 0:g.isWrapped;if(p+=T.translateToString(!I),!I||b===k.length-1){const O=document.createElement("div");O.textContent=p,w.push(O),p.length>0&&(n=O),p=""}}return{bufferElements:w,cursorElement:n}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};l.Viewport=u=d([S(2,v.IBufferService),S(3,v.IOptionsService),S(4,_.ICharSizeService),S(5,_.IRenderService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],u)},3107:function(C,l,c){var d=this&&this.__decorate||function(v,u,o,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,o,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,o,w):n(u,o))||w);return p>3&&w&&Object.defineProperty(u,o,w),w},S=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=c(4725),_=c(844),m=c(2585);let x=l.BufferDecorationRenderer=class extends _.Disposable{constructor(v,u,o,s,n){super(),this._screenElement=v,this._bufferService=u,this._coreBrowserService=o,this._decorationService=s,this._renderService=n,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(p=>this._removeDecoration(p))),this.register((0,_.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var s;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((s=v==null?void 0:v.options)==null?void 0:s.layer)==="top"),u.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const o=v.options.x??0;return o&&o>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(v,u),u}_refreshStyle(v){const u=v.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let o=this._decorationElements.get(v);o||(o=this._createElement(v),v.element=o,this._decorationElements.set(v,o),this._container.appendChild(o),v.onDispose(()=>{this._decorationElements.delete(v),o.remove()})),o.style.top=u*this._renderService.dimensions.css.cell.height+"px",o.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(o)}}_refreshXPosition(v,u=v.element){if(!u)return;const o=v.options.x??0;(v.options.anchor||"left")==="right"?u.style.right=o?o*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=o?o*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var u;(u=this._decorationElements.get(v))==null||u.remove(),this._decorationElements.delete(v),v.dispose()}};l.BufferDecorationRenderer=x=d([S(1,m.IBufferService),S(2,h.ICoreBrowserService),S(3,m.IDecorationService),S(4,h.IRenderService)],x)},5871:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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 d of this._zones)if(d.color===c.options.overviewRulerOptions.color&&d.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,c.marker.line))return;if(this._lineAdjacentToZone(d,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(d,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,d){return d>=c.startBufferLine&&d<=c.endBufferLine}_lineAdjacentToZone(c,d,S){return d>=c.startBufferLine-this._linePadding[S||"full"]&&d<=c.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(c,d){c.startBufferLine=Math.min(c.startBufferLine,d),c.endBufferLine=Math.max(c.endBufferLine,d)}}},5744:function(C,l,c){var d=this&&this.__decorate||function(n,p,w,y){var k,g=arguments.length,b=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(g<3?k(b):g>3?k(p,w,b):k(p,w))||b);return g>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=c(5871),_=c(4725),m=c(844),x=c(2585),v={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0};let s=l.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,p,w,y,k,g,b){var I;super(),this._viewportElement=n,this._screenElement=p,this._bufferService=w,this._decorationService=y,this._renderService=k,this._optionsService=g,this._coreBrowserService=b,this._colorZoneStore=new h.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(),(I=this._viewportElement.parentElement)==null||I.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,m.toDisposable)(()=>{var O;(O=this._canvas)==null||O.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 n=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=n,u.center=p,u.right=n,this._refreshDrawHeightConstants(),o.full=0,o.left=0,o.center=u.left,o.right=u.left+u.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);v.left=p,v.center=p,v.right=p}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 p of this._decorationService.decorations)this._colorZoneStore.addDecoration(p);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const p of n)p.position!=="full"&&this._renderColorZone(p);for(const p of n)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(o[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-v[n.position||"full"]/2),u[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[n.position||"full"]))}_queueRefresh(n,p){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};l.OverviewRulerRenderer=s=d([S(2,x.IBufferService),S(3,x.IDecorationService),S(4,_.IRenderService),S(5,x.IOptionsService),S(6,_.ICoreBrowserService)],s)},2950:function(C,l,c){var d=this&&this.__decorate||function(v,u,o,s){var n,p=arguments.length,w=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(v,u,o,s);else for(var y=v.length-1;y>=0;y--)(n=v[y])&&(w=(p<3?n(w):p>3?n(u,o,w):n(u,o))||w);return p>3&&w&&Object.defineProperty(u,o,w),w},S=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=c(4725),_=c(2585),m=c(2584);let x=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,u,o,s,n,p){this._textarea=v,this._compositionView=u,this._bufferService=o,this._optionsService=s,this._coreService=n,this._renderService=p,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,o=u.replace(v,"");this._dataAlreadySent=o,u.length>v.length?this._coreService.triggerDataEvent(o,!0):u.length<v.length?this._coreService.triggerDataEvent(`${m.C0.DEL}`,!0):u.length===v.length&&u!==v&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};l.CompositionHelper=x=d([S(2,_.IBufferService),S(3,_.IOptionsService),S(4,_.ICoreService),S(5,h.IRenderService)],x)},9806:(C,l)=>{function c(d,S,h){const _=h.getBoundingClientRect(),m=d.getComputedStyle(h),x=parseInt(m.getPropertyValue("padding-left")),v=parseInt(m.getPropertyValue("padding-top"));return[S.clientX-_.left-x,S.clientY-_.top-v]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(d,S,h,_,m,x,v,u,o){if(!x)return;const s=c(d,S,h);return s?(s[0]=Math.ceil((s[0]+(o?v/2:0))/v),s[1]=Math.ceil(s[1]/u),s[0]=Math.min(Math.max(s[0],1),_+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),m),s):void 0}},9504:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const d=c(2584);function S(u,o,s,n){const p=u-h(u,s),w=o-h(o,s),y=Math.abs(p-w)-function(k,g,b){let T=0;const I=k-h(k,b),O=g-h(g,b);for(let A=0;A<Math.abs(I-O);A++){const F=_(k,g)==="A"?-1:1,W=b.buffer.lines.get(I+F*A);W!=null&&W.isWrapped&&T++}return T}(u,o,s);return v(y,x(_(u,o),n))}function h(u,o){let s=0,n=o.buffer.lines.get(u),p=n==null?void 0:n.isWrapped;for(;p&&u>=0&&u<o.rows;)s++,n=o.buffer.lines.get(--u),p=n==null?void 0:n.isWrapped;return s}function _(u,o){return u>o?"A":"B"}function m(u,o,s,n,p,w){let y=u,k=o,g="";for(;y!==s||k!==n;)y+=p?1:-1,p&&y>w.cols-1?(g+=w.buffer.translateBufferLineToString(k,!1,u,y),y=0,u=0,k++):!p&&y<0&&(g+=w.buffer.translateBufferLineToString(k,!1,0,u+1),y=w.cols-1,u=y,k--);return g+w.buffer.translateBufferLineToString(k,!1,u,y)}function x(u,o){const s=o?"O":"[";return d.C0.ESC+s+u}function v(u,o){u=Math.floor(u);let s="";for(let n=0;n<u;n++)s+=o;return s}l.moveToCellSequence=function(u,o,s,n){const p=s.buffer.x,w=s.buffer.y;if(!s.buffer.hasScrollback)return function(g,b,T,I,O,A){return S(b,I,O,A).length===0?"":v(m(g,b,g,b-h(b,O),!1,O).length,x("D",A))}(p,w,0,o,s,n)+S(w,o,s,n)+function(g,b,T,I,O,A){let F;F=S(b,I,O,A).length>0?I-h(I,O):b;const W=I,G=function(q,N,E,D,M,B){let j;return j=S(E,D,M,B).length>0?D-h(D,M):N,q<E&&j<=D||q>=E&&j<D?"C":"D"}(g,b,T,I,O,A);return v(m(g,F,T,W,G==="C",O).length,x(G,A))}(p,w,u,o,s,n);let y;if(w===o)return y=p>u?"D":"C",v(Math.abs(p-u),x(y,n));y=w>o?"D":"C";const k=Math.abs(w-o);return v(function(g,b){return b.cols-g}(w>o?u:p,s)+(k-1)*s.cols+1+((w>o?p:u)-1),x(y,n))}},1296:function(C,l,c){var d=this&&this.__decorate||function(A,F,W,G){var q,N=arguments.length,E=N<3?F:G===null?G=Object.getOwnPropertyDescriptor(F,W):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,F,W,G);else for(var D=A.length-1;D>=0;D--)(q=A[D])&&(E=(N<3?q(E):N>3?q(F,W,E):q(F,W))||E);return N>3&&E&&Object.defineProperty(F,W,E),E},S=this&&this.__param||function(A,F){return function(W,G){F(W,G,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=c(3787),_=c(2550),m=c(2223),x=c(6171),v=c(6052),u=c(4725),o=c(8055),s=c(8460),n=c(844),p=c(2585),w="xterm-dom-renderer-owner-",y="xterm-rows",k="xterm-fg-",g="xterm-bg-",b="xterm-focus",T="xterm-selection";let I=1,O=l.DomRenderer=class extends n.Disposable{constructor(A,F,W,G,q,N,E,D,M,B,j,$,U){super(),this._terminal=A,this._document=F,this._element=W,this._screenElement=G,this._viewportElement=q,this._helperContainer=N,this._linkifier2=E,this._charSizeService=M,this._optionsService=B,this._bufferService=j,this._coreBrowserService=$,this._themeService=U,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(y),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,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(w+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,n.toDisposable)(()=>{this._element.classList.remove(w+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new _.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 A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const F=`${this._terminalSelector} .${y} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${y} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${y} .xterm-dim { color: ${o.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${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 W=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;F+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${G} { 50% { box-shadow: none; }}`,F+=`@keyframes ${q} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${y}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${y} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[N,E]of A.ansi.entries())F+=`${this._terminalSelector} .${k}${N} { color: ${E.css}; }${this._terminalSelector} .${k}${N}.xterm-dim { color: ${o.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${g}${N} { background-color: ${E.css}; }`;F+=`${this._terminalSelector} .${k}${m.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(A.background).css}; }${this._terminalSelector} .${k}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${g}${m.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let W=this._rowElements.length;W<=F;W++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),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(b),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(b),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,W),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,W);const G=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,N=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(N>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(W){const M=A[0]>F[0];D.appendChild(this._createSelectionElement(N,M?F[0]:A[0],M?A[0]:F[0],E-N+1))}else{const M=G===N?A[0]:0,B=N===q?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(N,M,B));const j=E-N-1;if(D.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,j)),N!==E){const $=q===E?F[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,$))}}this._selectionContainer.appendChild(D)}_createSelectionElement(A,F,W,G=1){const q=this._document.createElement("div"),N=F*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(W-F);return N+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-N),q.style.height=G*this.dimensions.css.cell.height+"px",q.style.top=A*this.dimensions.css.cell.height+"px",q.style.left=`${N}px`,q.style.width=`${E}px`,q}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 A of this._rowElements)A.replaceChildren()}renderRows(A,F){const W=this._bufferService.buffer,G=W.ybase+W.y,q=Math.min(W.x,this._bufferService.cols-1),N=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let M=A;M<=F;M++){const B=M+W.ydisp,j=this._rowElements[M],$=W.lines.get(B);if(!j||!$)break;j.replaceChildren(...this._rowFactory.createRow($,B,B===G,E,D,q,N,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${w}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,W,G,q,N){W<0&&(A=0),G<0&&(F=0);const E=this._bufferService.rows-1;W=Math.max(Math.min(W,E),0),G=Math.max(Math.min(G,E),0),q=Math.min(q,this._bufferService.cols);const D=this._bufferService.buffer,M=D.ybase+D.y,B=Math.min(D.x,q-1),j=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=W;Q<=G;++Q){const P=Q+D.ydisp,L=this._rowElements[Q],K=D.lines.get(P);if(!L||!K)break;L.replaceChildren(...this._rowFactory.createRow(K,P,P===M,$,U,B,j,this.dimensions.css.cell.width,this._widthCache,N?Q===W?A:0:-1,N?(Q===G?F:q)-1:-1))}}};l.DomRenderer=O=d([S(7,p.IInstantiationService),S(8,u.ICharSizeService),S(9,p.IOptionsService),S(10,p.IBufferService),S(11,u.ICoreBrowserService),S(12,u.IThemeService)],O)},3787:function(C,l,c){var d=this&&this.__decorate||function(y,k,g,b){var T,I=arguments.length,O=I<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(y,k,g,b);else for(var A=y.length-1;A>=0;A--)(T=y[A])&&(O=(I<3?T(O):I>3?T(k,g,O):T(k,g))||O);return I>3&&O&&Object.defineProperty(k,g,O),O},S=this&&this.__param||function(y,k){return function(g,b){k(g,b,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=c(2223),_=c(643),m=c(511),x=c(2585),v=c(8055),u=c(4725),o=c(4269),s=c(6171),n=c(3734);let p=l.DomRendererRowFactory=class{constructor(y,k,g,b,T,I,O){this._document=y,this._characterJoinerService=k,this._optionsService=g,this._coreBrowserService=b,this._coreService=T,this._decorationService=I,this._themeService=O,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(y,k,g){this._selectionStart=y,this._selectionEnd=k,this._columnSelectMode=g}createRow(y,k,g,b,T,I,O,A,F,W,G){const q=[],N=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,M=y.getNoBgTrimmedLength();g&&M<I+1&&(M=I+1);let B=0,j="",$=0,U=0,Q=0,P=!1,L=0,K=!1,H=0;const Y=[],z=W!==-1&&G!==-1;for(let J=0;J<M;J++){y.loadCell(J,this._workCell);let ne=this._workCell.getWidth();if(ne===0)continue;let fe=!1,Me=J,ee=this._workCell;if(N.length>0&&J===N[0][0]){fe=!0;const ce=N.shift();ee=new o.JoinedCellData(this._workCell,y.translateToString(!0,ce[0],ce[1]),ce[1]-ce[0]),Me=ce[1]-1,ne=ee.getWidth()}const Mr=this._isCellInSelection(J,k),$s=g&&J===I,Ks=z&&J>=W&&J<=G;let Vs=!1;this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{Vs=!0});let Ri=ee.getChars()||_.WHITESPACE_CELL_CHAR;if(Ri===" "&&(ee.isUnderline()||ee.isOverline())&&(Ri=" "),H=ne*A-F.get(Ri,ee.isBold(),ee.isItalic()),D){if(B&&(Mr&&K||!Mr&&!K&&ee.bg===$)&&(Mr&&K&&E.selectionForeground||ee.fg===U)&&ee.extended.ext===Q&&Ks===P&&H===L&&!$s&&!fe&&!Vs){ee.isInvisible()?j+=_.WHITESPACE_CELL_CHAR:j+=Ri,B++;continue}B&&(D.textContent=j),D=this._document.createElement("span"),B=0,j=""}else D=this._document.createElement("span");if($=ee.bg,U=ee.fg,Q=ee.extended.ext,P=Ks,L=H,K=Mr,fe&&I>=J&&I<=Me&&(I=J),!this._coreService.isCursorHidden&&$s&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Y.push("xterm-cursor-blink"),Y.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(ee.isBold()&&Y.push("xterm-bold"),ee.isItalic()&&Y.push("xterm-italic"),ee.isDim()&&Y.push("xterm-dim"),j=ee.isInvisible()?_.WHITESPACE_CELL_CHAR:ee.getChars()||_.WHITESPACE_CELL_CHAR,ee.isUnderline()&&(Y.push(`xterm-underline-${ee.extended.underlineStyle}`),j===" "&&(j=" "),!ee.isUnderlineColorDefault()))if(ee.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ee.getUnderlineColor()).join(",")})`;else{let ce=ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ee.isBold()&&ce<8&&(ce+=8),D.style.textDecorationColor=E.ansi[ce].css}ee.isOverline()&&(Y.push("xterm-overline"),j===" "&&(j=" ")),ee.isStrikethrough()&&Y.push("xterm-strikethrough"),Ks&&(D.style.textDecoration="underline");let $e=ee.getFgColor(),Ir=ee.getFgColorMode(),st=ee.getBgColor(),Pr=ee.getBgColorMode();const Gs=!!ee.isInverse();if(Gs){const ce=$e;$e=st,st=ce;const Hu=Ir;Ir=Pr,Pr=Hu}let yt,Li,Ct,Br=!1;switch(this._decorationService.forEachDecorationAtCell(J,k,void 0,ce=>{ce.options.layer!=="top"&&Br||(ce.backgroundColorRGB&&(Pr=50331648,st=ce.backgroundColorRGB.rgba>>8&16777215,yt=ce.backgroundColorRGB),ce.foregroundColorRGB&&(Ir=50331648,$e=ce.foregroundColorRGB.rgba>>8&16777215,Li=ce.foregroundColorRGB),Br=ce.options.layer==="top")}),!Br&&Mr&&(yt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,st=yt.rgba>>8&16777215,Pr=50331648,Br=!0,E.selectionForeground&&(Ir=50331648,$e=E.selectionForeground.rgba>>8&16777215,Li=E.selectionForeground)),Br&&Y.push("xterm-decoration-top"),Pr){case 16777216:case 33554432:Ct=E.ansi[st],Y.push(`xterm-bg-${st}`);break;case 50331648:Ct=v.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(D,`background-color:#${w((st>>>0).toString(16),"0",6)}`);break;default:Gs?(Ct=E.foreground,Y.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ct=E.background}switch(yt||ee.isDim()&&(yt=v.color.multiplyOpacity(Ct,.5)),Ir){case 16777216:case 33554432:ee.isBold()&&$e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($e+=8),this._applyMinimumContrast(D,Ct,E.ansi[$e],ee,yt,void 0)||Y.push(`xterm-fg-${$e}`);break;case 50331648:const ce=v.channels.toColor($e>>16&255,$e>>8&255,255&$e);this._applyMinimumContrast(D,Ct,ce,ee,yt,Li)||this._addStyle(D,`color:#${w($e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Ct,E.foreground,ee,yt,Li)||Gs&&Y.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Y.length&&(D.className=Y.join(" "),Y.length=0),$s||fe||Vs?D.textContent=j:B++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),q.push(D),J=Me}return D&&B&&(D.textContent=j),q}_applyMinimumContrast(y,k,g,b,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const O=this._getContrastCache(b);let A;if(T||I||(A=O.getColor(k.rgba,g.rgba)),A===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);A=v.color.ensureContrastRatio(T||k,I||g,F),O.setColor((T||k).rgba,(I||g).rgba,A??null)}return!!A&&(this._addStyle(y,`color:${A.css}`),!0)}_getContrastCache(y){return y.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(y,k){y.setAttribute("style",`${y.getAttribute("style")||""}${k};`)}_isCellInSelection(y,k){const g=this._selectionStart,b=this._selectionEnd;return!(!g||!b)&&(this._columnSelectMode?g[0]<=b[0]?y>=g[0]&&k>=g[1]&&y<b[0]&&k<=b[1]:y<g[0]&&k>=g[1]&&y>=b[0]&&k<=b[1]:k>g[1]&&k<b[1]||g[1]===b[1]&&k===g[1]&&y>=g[0]&&y<b[0]||g[1]<b[1]&&k===b[1]&&y<b[0]||g[1]<b[1]&&k===g[1]&&y>=g[0])}};function w(y,k,g){for(;y.length<g;)y=k+y;return y}l.DomRendererRowFactory=p=d([S(1,u.ICharacterJoinerService),S(2,x.IOptionsService),S(3,u.ICoreBrowserService),S(4,x.ICoreService),S(5,x.IDecorationService),S(6,u.IThemeService)],p)},2550:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(c,d){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 S=c.createElement("span");S.classList.add("xterm-char-measure-element");const h=c.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const m=c.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[S,h,_,m],this._container.appendChild(S),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(m),d.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,d,S,h){c===this._font&&d===this._fontSize&&S===this._weight&&h===this._weightBold||(this._font=c,this._fontSize=d,this._weight=S,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(c,d,S){let h=0;if(!d&&!S&&c.length===1&&(h=c.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const x=this._measure(c,0);return x>0&&(this._flat[h]=x),x}let _=c;d&&(_+="B"),S&&(_+="I");let m=this._holey.get(_);if(m===void 0){let x=0;d&&(x|=1),S&&(x|=2),m=this._measure(c,x),m>0&&this._holey.set(_,m)}return m}_measure(c,d){const S=this._measureElements[d];return S.textContent=c.repeat(32),S.offsetWidth/32}}},2223:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const d=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(C,l)=>{function c(S){return 57508<=S&&S<=57558}function d(S){return S>=128512&&S<=128591||S>=127744&&S<=128511||S>=128640&&S<=128767||S>=9728&&S<=9983||S>=9984&&S<=10175||S>=65024&&S<=65039||S>=129280&&S<=129535||S>=127462&&S<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(S){if(!S)throw new Error("value must not be falsy");return S},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(S){return 57520<=S&&S<=57527},l.isEmoji=d,l.allowRescaling=function(S,h,_,m){return h===1&&_>Math.ceil(1.5*m)&&S!==void 0&&S>255&&!d(S)&&!c(S)&&!function(x){return 57344<=x&&x<=63743}(S)},l.treatGlyphAsBackgroundColor=function(S){return c(S)||function(h){return 9472<=h&&h<=9631}(S)},l.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}}}},l.computeNextVariantOffset=function(S,h,_=0){return(S-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(S,h,_,m=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const x=S.buffers.active.ydisp,v=h[1]-x,u=_[1]-x,o=Math.max(v,0),s=Math.min(u,S.rows-1);o>=S.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=v,this.viewportEndRow=u,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=h[0],this.endCol=_[0])}isCellSelected(S,h,_){return!!this.hasSelection&&(_-=S.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,d=this.selectionEnd;return!(!c||!d)&&(c[1]>d[1]||c[1]===d[1]&&c[0]>d[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(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=c(2585),_=c(8460),m=c(844);let x=l.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,p){super(),this._optionsService=p,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new o(this._optionsService))}catch{this._measureStrategy=this.register(new u(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};l.CharSizeService=x=d([S(2,h.IOptionsService)],x);class v extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,p){n!==void 0&&n>0&&p!==void 0&&p>0&&(this._result.width=n,this._result.height=p)}}class u extends v{constructor(n,p,w){super(),this._document=n,this._parentElement=p,this._optionsService=w,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 o extends v{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const p=this._ctx.measureText("W");if(!("width"in p&&"fontBoundingBoxAscent"in p&&"fontBoundingBoxDescent"in p))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(C,l,c){var d=this&&this.__decorate||function(o,s,n,p){var w,y=arguments.length,k=y<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,n):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,n,p);else for(var g=o.length-1;g>=0;g--)(w=o[g])&&(k=(y<3?w(k):y>3?w(s,n,k):w(s,n))||k);return y>3&&k&&Object.defineProperty(s,n,k),k},S=this&&this.__param||function(o,s){return function(n,p){s(n,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=c(3734),_=c(643),m=c(511),x=c(2585);class v extends h.AttributeData{constructor(s,n,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=v;let u=l.CharacterJoinerService=class Bu{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const p=[],w=n.translateToString(!0);let y=0,k=0,g=0,b=n.getFg(0),T=n.getBg(0);for(let I=0;I<n.getTrimmedLength();I++)if(n.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==T){if(I-y>1){const O=this._getJoinedRanges(w,g,k,n,y);for(let A=0;A<O.length;A++)p.push(O[A])}y=I,g=k,b=this._workCell.fg,T=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-y>1){const I=this._getJoinedRanges(w,g,k,n,y);for(let O=0;O<I.length;O++)p.push(I[O])}return p}_getJoinedRanges(s,n,p,w,y){const k=s.substring(n,p);let g=[];try{g=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const T=this._characterJoiners[b].handler(k);for(let I=0;I<T.length;I++)Bu._mergeRanges(g,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(g,w,y),g}_stringRangesToCellRanges(s,n,p){let w=0,y=!1,k=0,g=s[w];if(g){for(let b=p;b<this._bufferService.cols;b++){const T=n.getWidth(b),I=n.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!y&&g[0]<=k&&(g[0]=b,y=!0),g[1]<=k){if(g[1]=b,g=s[++w],!g)break;g[0]<=k?(g[0]=b,y=!0):y=!1}k+=I}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let p=!1;for(let w=0;w<s.length;w++){const y=s[w];if(p){if(n[1]<=y[0])return s[w-1][1]=n[1],s;if(n[1]<=y[1])return s[w-1][1]=Math.max(n[1],y[1]),s.splice(w,1),s;s.splice(w,1),w--}else{if(n[1]<=y[0])return s.splice(w,0,n),s;if(n[1]<=y[1])return y[0]=Math.min(n[0],y[0]),s;n[0]<y[1]&&(y[0]=Math.min(n[0],y[0]),p=!0)}}return p?s[s.length-1][1]=n[1]:s.push(n),s}};l.CharacterJoinerService=u=d([S(0,x.IBufferService)],u)},5114:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const d=c(844),S=c(8460),h=c(3656);class _ extends d.Disposable{constructor(v,u,o){super(),this._textarea=v,this._window=u,this.mainDocument=o,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new S.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,S.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(v){this._window!==v&&(this._window=v,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}}l.CoreBrowserService=_;class m extends d.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new S.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const d=c(844);class S extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const m=this.linkProviders.indexOf(_);m!==-1&&this.linkProviders.splice(m,1)}}}}l.LinkProviderService=S},8934:function(C,l,c){var d=this&&this.__decorate||function(x,v,u,o){var s,n=arguments.length,p=n<3?v:o===null?o=Object.getOwnPropertyDescriptor(v,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,v,u,o);else for(var w=x.length-1;w>=0;w--)(s=x[w])&&(p=(n<3?s(p):n>3?s(v,u,p):s(v,u))||p);return n>3&&p&&Object.defineProperty(v,u,p),p},S=this&&this.__param||function(x,v){return function(u,o){v(u,o,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=c(4725),_=c(9806);let m=l.MouseService=class{constructor(x,v){this._renderService=x,this._charSizeService=v}getCoords(x,v,u,o,s){return(0,_.getCoords)(window,x,v,u,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,v){const u=(0,_.getCoordsRelativeToElement)(window,x,v);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};l.MouseService=m=d([S(0,h.IRenderService),S(1,h.ICharSizeService)],m)},3230:function(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=c(6193),_=c(4725),m=c(8460),x=c(844),v=c(7226),u=c(2585);let o=l.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,p,w,y,k,g,b){super(),this._rowCount=s,this._charSizeService=w,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new x.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer((T,I)=>this._renderRows(T,I),g),this.register(this._renderDebouncer),this.register(g.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(y.onDecorationRegistered(()=>this._fullRefresh())),this.register(y.onDecorationRemoved(()=>this._fullRefresh())),this.register(p.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(p.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register(b.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(g.window,n),this.register(g.onWindowChange(T=>this._registerIntersectionObserver(T,n)))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const p=new s.IntersectionObserver(w=>this._handleIntersectionChange(w[w.length-1]),{threshold:0});p.observe(n),this._observerDisposable.value=(0,x.toDisposable)(()=>p.disconnect())}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.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(s,n,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,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(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(n=>this.refreshRows(n.start,n.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,n)}):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,p){var w;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=p,(w=this._renderer.value)==null||w.handleSelectionChanged(s,n,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};l.RenderService=o=d([S(2,u.IOptionsService),S(3,_.ICharSizeService),S(4,u.IDecorationService),S(5,u.IBufferService),S(6,_.ICoreBrowserService),S(7,_.IThemeService)],o)},9312:function(C,l,c){var d=this&&this.__decorate||function(g,b,T,I){var O,A=arguments.length,F=A<3?b:I===null?I=Object.getOwnPropertyDescriptor(b,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(g,b,T,I);else for(var W=g.length-1;W>=0;W--)(O=g[W])&&(F=(A<3?O(F):A>3?O(b,T,F):O(b,T))||F);return A>3&&F&&Object.defineProperty(b,T,F),F},S=this&&this.__param||function(g,b){return function(T,I){b(T,I,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=c(9806),_=c(9504),m=c(456),x=c(4725),v=c(8460),u=c(844),o=c(6114),s=c(4841),n=c(511),p=c(2585),w=" ",y=new RegExp(w,"g");let k=l.SelectionService=class extends u.Disposable{constructor(g,b,T,I,O,A,F,W,G){super(),this._element=g,this._screenElement=b,this._linkifier=T,this._bufferService=I,this._coreService=O,this._mouseService=A,this._optionsService=F,this._renderService=W,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(q=>this._handleTrim(q)),this.register(this._bufferService.buffers.onBufferActivate(q=>this._handleBufferActivate(q))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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,b=this._model.finalSelectionEnd;return!(!g||!b||g[0]===b[0]&&g[1]===b[1])}get selectionText(){const g=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!g||!b)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(g[0]===b[0])return"";const O=g[0]<b[0]?g[0]:b[0],A=g[0]<b[0]?b[0]:g[0];for(let F=g[1];F<=b[1];F++){const W=T.translateBufferLineToString(F,!0,O,A);I.push(W)}}else{const O=g[1]===b[1]?b[0]:void 0;I.push(T.translateBufferLineToString(g[1],!0,g[0],O));for(let A=g[1]+1;A<=b[1]-1;A++){const F=T.lines.get(A),W=T.translateBufferLineToString(A,!0);F!=null&&F.isWrapped?I[I.length-1]+=W:I.push(W)}if(g[1]!==b[1]){const A=T.lines.get(b[1]),F=T.translateBufferLineToString(b[1],!0,0,b[0]);A&&A.isWrapped?I[I.length-1]+=F:I.push(F)}}return I.map(O=>O.replace(y," ")).join(o.isWindows?`\r
45
45
  `:`
46
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.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 b=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&b)&&this._areCoordsInSelection(b,T,I)}isCellInSelection(g,b){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([g,b],T,I)}_areCoordsInSelection(g,b,T){return g[1]>b[1]&&g[1]<T[1]||b[1]===T[1]&&g[1]===b[1]&&g[0]>=b[0]&&g[0]<T[0]||b[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||b[1]<T[1]&&g[1]===b[1]&&g[0]>=b[0]}_selectWordAtCursor(g,b){var O,A;const T=(A=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:A.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(g);return!!I&&(this._selectWordAt(I,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,b){this._model.clearSelection(),g=Math.max(g,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const b=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(g){let b=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=T?0:(b>T&&(b-=T),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(g){return o.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 b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const b=this._getMouseBufferCoords(g);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(g){return g.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const b=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 I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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 b=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<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 I=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,T=!(!g||!b||g[0]===b[0]&&g[1]===b[1]);T?g&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,b,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,b,T)}_fireOnSelectionChange(g,b,T){this._oldSelectionStart=g,this._oldSelectionEnd=b,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(g,b){let T=b;for(let I=0;b>=I;I++){const O=g.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&b!==I&&(T+=O-1)}return T}setSelection(g,b,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,b],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,b,T=!0,I=!0){if(g[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,A=O.lines.get(g[1]);if(!A)return;const F=O.translateBufferLineToString(g[1],!1);let W=this._convertViewportColToCharacterIndex(A,g[0]),G=W;const q=g[0]-W;let N=0,E=0,D=0,M=0;if(F.charAt(W)===" "){for(;W>0&&F.charAt(W-1)===" ";)W--;for(;G<F.length&&F.charAt(G+1)===" ";)G++}else{let $=g[0],U=g[0];A.getWidth($)===0&&(N++,$--),A.getWidth(U)===2&&(E++,U++);const Q=A.getString(U).length;for(Q>1&&(M+=Q-1,G+=Q-1);$>0&&W>0&&!this._isCharWordSeparator(A.loadCell($-1,this._workCell));){A.loadCell($-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,$--):P>1&&(D+=P-1,W-=P-1),W--,$--}for(;U<A.length&&G+1<F.length&&!this._isCharWordSeparator(A.loadCell(U+1,this._workCell));){A.loadCell(U+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,U++):P>1&&(M+=P-1,G+=P-1),G++,U++}}G++;let B=W+q-N+D,j=Math.min(this._bufferService.cols,G-W+N+E-D-M);if(b||F.slice(W,G).trim()!==""){if(T&&B===0&&A.getCodePoint(0)!==32){const $=O.lines.get(g[1]-1);if($&&A.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){const U=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(U){const Q=this._bufferService.cols-U.start;B-=Q,j+=Q}}}if(I&&B+j===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const $=O.lines.get(g[1]+1);if($!=null&&$.isWrapped&&$.getCodePoint(0)!==32){const U=this._getWordAt([0,g[1]+1],!1,!1,!0);U&&(j+=U.length)}}return{start:B,length:j}}}_selectWordAt(g,b){const T=this._getWordAt(g,b);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 b=this._getWordAt(g,!0);if(b){let T=g[1];for(;b.start<0;)b.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const b=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};l.SelectionService=k=d([S(3,p.IBufferService),S(4,p.ICoreService),S(5,x.IMouseService),S(6,p.IOptionsService),S(7,x.IRenderService),S(8,x.ICoreBrowserService)],k)},4725:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=c(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(C,l,c){var d=this&&this.__decorate||function(k,g,b,T){var I,O=arguments.length,A=O<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,g,b,T);else for(var F=k.length-1;F>=0;F--)(I=k[F])&&(A=(O<3?I(A):O>3?I(g,b,A):I(g,b))||A);return O>3&&A&&Object.defineProperty(g,b,A),A},S=this&&this.__param||function(k,g){return function(b,T){g(b,T,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),m=c(8460),x=c(844),v=c(2585),u=_.css.toColor("#ffffff"),o=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),n=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let b=0;b<216;b++){const T=g[b/36%6|0],I=g[b/6%6|0],O=g[b%6];k.push({css:_.channels.toCss(T,I,O),rgba:_.channels.toRgba(T,I,O)})}for(let b=0;b<24;b++){const T=8+10*b;k.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return k})());let w=l.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:o,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(o,p),ansi:l.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(k={}){const g=this._colors;if(g.foreground=y(k.foreground,u),g.background=y(k.background,o),g.cursor=y(k.cursor,s),g.cursorAccent=y(k.cursorAccent,n),g.selectionBackgroundTransparent=y(k.selectionBackground,p),g.selectionBackgroundOpaque=_.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=_.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=k.selectionForeground?y(k.selectionForeground,_.NULL_COLOR):void 0,g.selectionForeground===_.NULL_COLOR&&(g.selectionForeground=void 0),_.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=_.color.opacity(g.selectionBackgroundTransparent,.3)),_.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=_.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=l.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=y(k.black,l.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=y(k.red,l.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=y(k.green,l.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=y(k.yellow,l.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=y(k.blue,l.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=y(k.magenta,l.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=y(k.cyan,l.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=y(k.white,l.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=y(k.brightBlack,l.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=y(k.brightRed,l.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=y(k.brightGreen,l.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=y(k.brightYellow,l.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=y(k.brightBlue,l.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=y(k.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=y(k.brightCyan,l.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=y(k.brightWhite,l.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(g.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<b;T++)g.ansi[T+16]=y(k.extendedAnsi[T],l.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(k){k(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 y(k,g){if(k!==void 0)try{return _.css.toColor(k)}catch{}return g}l.ThemeService=w=d([S(0,v.IOptionsService)],w)},6349:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(m){if(this._maxLength===m)return;const x=new Array(m);for(let v=0;v<Math.min(m,this.length);v++)x[v]=this._array[this._getCyclicIndex(v)];this._array=x,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let x=this._length;x<m;x++)this._array[x]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,x){this._array[this._getCyclicIndex(m)]=x}push(m){this._array[this._getCyclicIndex(this._length)]=m,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(m,x,...v){if(x){for(let u=m;u<this._length-x;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+x)];this._length-=x,this.onDeleteEmitter.fire({index:m,amount:x})}for(let u=this._length-1;u>=m;u--)this._array[this._getCyclicIndex(u+v.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<v.length;u++)this._array[this._getCyclicIndex(m+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:m,amount:v.length}),this._length+v.length>this._maxLength){const u=this._length+v.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=v.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,v){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let o=x-1;o>=0;o--)this.set(m+o+v,this.get(m+o));const u=m+x+v-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<x;u++)this.set(m+u+v,this.get(m+u))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}l.CircularList=h},1439:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(d,S=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const _ in d)h[_]=S<=1?d[_]:d[_]&&c(d[_],S-1);return h}},8055:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,d=0,S=0,h=0;var _,m,x,v,u;function o(n){const p=n.toString(16);return p.length<2?"0"+p:p}function s(n,p){return n<p?(p+.05)/(n+.05):(n+.05)/(p+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},function(n){n.toCss=function(p,w,y,k){return k!==void 0?`#${o(p)}${o(w)}${o(y)}${o(k)}`:`#${o(p)}${o(w)}${o(y)}`},n.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},n.toColor=function(p,w,y,k){return{css:n.toCss(p,w,y,k),rgba:n.toRgba(p,w,y,k)}}}(_||(l.channels=_={})),function(n){function p(w,y){return h=Math.round(255*y),[c,d,S]=u.toChannels(w.rgba),{css:_.toCss(c,d,S,h),rgba:_.toRgba(c,d,S,h)}}n.blend=function(w,y){if(h=(255&y.rgba)/255,h===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,g=y.rgba>>16&255,b=y.rgba>>8&255,T=w.rgba>>24&255,I=w.rgba>>16&255,O=w.rgba>>8&255;return c=T+Math.round((k-T)*h),d=I+Math.round((g-I)*h),S=O+Math.round((b-O)*h),{css:_.toCss(c,d,S),rgba:_.toRgba(c,d,S)}},n.isOpaque=function(w){return(255&w.rgba)==255},n.ensureContrastRatio=function(w,y,k){const g=u.ensureContrastRatio(w.rgba,y.rgba,k);if(g)return _.toColor(g>>24&255,g>>16&255,g>>8&255)},n.opaque=function(w){const y=(255|w.rgba)>>>0;return[c,d,S]=u.toChannels(y),{css:_.toCss(c,d,S),rgba:y}},n.opacity=p,n.multiplyOpacity=function(w,y){return h=255&w.rgba,p(w,h*y/255)},n.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}}(m||(l.color=m={})),function(n){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),_.toColor(c,d,S);case 5:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),_.toColor(c,d,S,h);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return c=parseInt(k[1]),d=parseInt(k[2]),S=parseInt(k[3]),h=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(c,d,S,h);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,d,S,h]=p.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,d,S,h),css:y}}}(x||(l.css=x={})),function(n){function p(w,y,k){const g=w/255,b=y/255,T=k/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}n.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},n.relativeLuminance2=p}(v||(l.rgb=v={})),function(n){function p(y,k,g){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let O=k>>24&255,A=k>>16&255,F=k>>8&255,W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));for(;W<g&&(O>0||A>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));return(O<<24|A<<16|F<<8|255)>>>0}function w(y,k,g){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let O=k>>24&255,A=k>>16&255,F=k>>8&255,W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));for(;W<g&&(O<255||A<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));return(O<<24|A<<16|F<<8|255)>>>0}n.blend=function(y,k){if(h=(255&k)/255,h===1)return k;const g=k>>24&255,b=k>>16&255,T=k>>8&255,I=y>>24&255,O=y>>16&255,A=y>>8&255;return c=I+Math.round((g-I)*h),d=O+Math.round((b-O)*h),S=A+Math.round((T-A)*h),_.toRgba(c,d,S)},n.ensureContrastRatio=function(y,k,g){const b=v.relativeLuminance(y>>8),T=v.relativeLuminance(k>>8);if(s(b,T)<g){if(T<b){const A=p(y,k,g),F=s(b,v.relativeLuminance(A>>8));if(F<g){const W=w(y,k,g);return F>s(b,v.relativeLuminance(W>>8))?A:W}return A}const I=w(y,k,g),O=s(b,v.relativeLuminance(I>>8));if(O<g){const A=p(y,k,g);return O>s(b,v.relativeLuminance(A>>8))?I:A}return I}},n.reduceLuminance=p,n.increaseLuminance=w,n.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}}(u||(l.rgba=u={})),l.toPaddedHex=o,l.contrastRatio=s},8969:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=c(844),S=c(2585),h=c(4348),_=c(7866),m=c(744),x=c(7302),v=c(6975),u=c(8460),o=c(1753),s=c(1480),n=c(7994),p=c(9282),w=c(5435),y=c(5981),k=c(2660);let g=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(I=>{var O;(O=this._onScrollApi)==null||O.fire(I.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(I){for(const O in I)this.optionsService.options[O]=I[O]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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(O=>{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(O=>{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 y.WriteBuffer((O,A)=>this._inputHandler.parse(O,A))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,O){this._writeBuffer.write(I,O)}writeSync(I,O){this._logService.logLevel<=S.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(I,O)}input(I,O=!0){this.coreService.triggerDataEvent(I,O)}resize(I,O){isNaN(I)||isNaN(O)||(I=Math.max(I,m.MINIMUM_COLS),O=Math.max(O,m.MINIMUM_ROWS),this._bufferService.resize(I,O))}scroll(I,O=!1){this._bufferService.scroll(I,O)}scrollLines(I,O,A){this._bufferService.scrollLines(I,O,A)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const O=I-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(I,O){return this._inputHandler.registerEscHandler(I,O)}registerDcsHandler(I,O){return this._inputHandler.registerDcsHandler(I,O)}registerCsiHandler(I,O){return this._inputHandler.registerCsiHandler(I,O)}registerOscHandler(I,O){return this._inputHandler.registerOscHandler(I,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?I=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const O of I)O.dispose()})}}}l.CoreTerminal=b},8460:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const S=[];for(let h=0;h<this._listeners.length;h++)S.push(this._listeners[h]);for(let h=0;h<S.length;h++)S[h].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,d){return c(S=>d.fire(S))},l.runAndSubscribe=function(c,d){return d(void 0),c(S=>d(S))}},5435:function(C,l,c){var d=this&&this.__decorate||function(N,E,D,M){var B,j=arguments.length,$=j<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,E,D,M);else for(var U=N.length-1;U>=0;U--)(B=N[U])&&($=(j<3?B($):j>3?B(E,D,$):B(E,D))||$);return j>3&&$&&Object.defineProperty(E,D,$),$},S=this&&this.__param||function(N,E){return function(D,M){E(D,M,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),m=c(2015),x=c(844),v=c(482),u=c(8437),o=c(8460),s=c(643),n=c(511),p=c(3734),w=c(2585),y=c(1480),k=c(6242),g=c(6351),b=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function O(N,E){if(N>24)return E.setWinLines||!1;switch(N){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(N){N[N.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",N[N.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(l.WindowsOptionsReportType=A={}));let F=0;class W extends x.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,M,B,j,$,U,Q,P=new m.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=M,this._logService=B,this._optionsService=j,this._oscLinkService=$,this._coreMouseService=U,this._unicodeService=Q,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._parser.setCsiHandlerFallback((R,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(R),params:K.toArray()})}),this._parser.setEscHandlerFallback(R=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(R)})}),this._parser.setExecuteHandlerFallback(R=>{this._logService.debug("Unknown EXECUTE code: ",{code:R})}),this._parser.setOscHandlerFallback((R,K,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:R,action:K,data:H})}),this._parser.setDcsHandlerFallback((R,K,H)=>{K==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(R),action:K,payload:H})}),this._parser.setPrintHandler((R,K,H)=>this.print(R,K,H)),this._parser.registerCsiHandler({final:"@"},R=>this.insertChars(R)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},R=>this.scrollLeft(R)),this._parser.registerCsiHandler({final:"A"},R=>this.cursorUp(R)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},R=>this.scrollRight(R)),this._parser.registerCsiHandler({final:"B"},R=>this.cursorDown(R)),this._parser.registerCsiHandler({final:"C"},R=>this.cursorForward(R)),this._parser.registerCsiHandler({final:"D"},R=>this.cursorBackward(R)),this._parser.registerCsiHandler({final:"E"},R=>this.cursorNextLine(R)),this._parser.registerCsiHandler({final:"F"},R=>this.cursorPrecedingLine(R)),this._parser.registerCsiHandler({final:"G"},R=>this.cursorCharAbsolute(R)),this._parser.registerCsiHandler({final:"H"},R=>this.cursorPosition(R)),this._parser.registerCsiHandler({final:"I"},R=>this.cursorForwardTab(R)),this._parser.registerCsiHandler({final:"J"},R=>this.eraseInDisplay(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},R=>this.eraseInDisplay(R,!0)),this._parser.registerCsiHandler({final:"K"},R=>this.eraseInLine(R,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},R=>this.eraseInLine(R,!0)),this._parser.registerCsiHandler({final:"L"},R=>this.insertLines(R)),this._parser.registerCsiHandler({final:"M"},R=>this.deleteLines(R)),this._parser.registerCsiHandler({final:"P"},R=>this.deleteChars(R)),this._parser.registerCsiHandler({final:"S"},R=>this.scrollUp(R)),this._parser.registerCsiHandler({final:"T"},R=>this.scrollDown(R)),this._parser.registerCsiHandler({final:"X"},R=>this.eraseChars(R)),this._parser.registerCsiHandler({final:"Z"},R=>this.cursorBackwardTab(R)),this._parser.registerCsiHandler({final:"`"},R=>this.charPosAbsolute(R)),this._parser.registerCsiHandler({final:"a"},R=>this.hPositionRelative(R)),this._parser.registerCsiHandler({final:"b"},R=>this.repeatPrecedingCharacter(R)),this._parser.registerCsiHandler({final:"c"},R=>this.sendDeviceAttributesPrimary(R)),this._parser.registerCsiHandler({prefix:">",final:"c"},R=>this.sendDeviceAttributesSecondary(R)),this._parser.registerCsiHandler({final:"d"},R=>this.linePosAbsolute(R)),this._parser.registerCsiHandler({final:"e"},R=>this.vPositionRelative(R)),this._parser.registerCsiHandler({final:"f"},R=>this.hVPosition(R)),this._parser.registerCsiHandler({final:"g"},R=>this.tabClear(R)),this._parser.registerCsiHandler({final:"h"},R=>this.setMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"h"},R=>this.setModePrivate(R)),this._parser.registerCsiHandler({final:"l"},R=>this.resetMode(R)),this._parser.registerCsiHandler({prefix:"?",final:"l"},R=>this.resetModePrivate(R)),this._parser.registerCsiHandler({final:"m"},R=>this.charAttributes(R)),this._parser.registerCsiHandler({final:"n"},R=>this.deviceStatus(R)),this._parser.registerCsiHandler({prefix:"?",final:"n"},R=>this.deviceStatusPrivate(R)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},R=>this.softReset(R)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},R=>this.setCursorStyle(R)),this._parser.registerCsiHandler({final:"r"},R=>this.setScrollRegion(R)),this._parser.registerCsiHandler({final:"s"},R=>this.saveCursor(R)),this._parser.registerCsiHandler({final:"t"},R=>this.windowOptions(R)),this._parser.registerCsiHandler({final:"u"},R=>this.restoreCursor(R)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},R=>this.insertColumns(R)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},R=>this.deleteColumns(R)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},R=>this.selectProtected(R)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},R=>this.requestMode(R,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},R=>this.requestMode(R,!1)),this._parser.setExecuteHandler(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(R=>(this.setTitle(R),this.setIconName(R),!0))),this._parser.registerOscHandler(1,new k.OscHandler(R=>this.setIconName(R))),this._parser.registerOscHandler(2,new k.OscHandler(R=>this.setTitle(R))),this._parser.registerOscHandler(4,new k.OscHandler(R=>this.setOrReportIndexedColor(R))),this._parser.registerOscHandler(8,new k.OscHandler(R=>this.setHyperlink(R))),this._parser.registerOscHandler(10,new k.OscHandler(R=>this.setOrReportFgColor(R))),this._parser.registerOscHandler(11,new k.OscHandler(R=>this.setOrReportBgColor(R))),this._parser.registerOscHandler(12,new k.OscHandler(R=>this.setOrReportCursorColor(R))),this._parser.registerOscHandler(104,new k.OscHandler(R=>this.restoreIndexedColor(R))),this._parser.registerOscHandler(110,new k.OscHandler(R=>this.restoreFgColor(R))),this._parser.registerOscHandler(111,new k.OscHandler(R=>this.restoreBgColor(R))),this._parser.registerOscHandler(112,new k.OscHandler(R=>this.restoreCursorColor(R))),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 R in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:R},()=>this.selectCharset("("+R)),this._parser.registerEscHandler({intermediates:")",final:R},()=>this.selectCharset(")"+R)),this._parser.registerEscHandler({intermediates:"*",final:R},()=>this.selectCharset("*"+R)),this._parser.registerEscHandler({intermediates:"+",final:R},()=>this.selectCharset("+"+R)),this._parser.registerEscHandler({intermediates:"-",final:R},()=>this.selectCharset("-"+R)),this._parser.registerEscHandler({intermediates:".",final:R},()=>this.selectCharset("."+R)),this._parser.registerEscHandler({intermediates:"/",final:R},()=>this.selectCharset("/"+R));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(R=>(this._logService.error("Parsing error: ",R),R)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler((R,K)=>this.requestStatusString(R,K)))}_preserveStack(E,D,M,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=M,this._parseStack.position=B}_logSlowResolvingAsync(E){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let M,B=this._activeBuffer.x,j=this._activeBuffer.y,$=0;const U=this._parseStack.paused;if(U){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(M),M;B=this._parseStack.cursorStartX,j=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>I&&($=this._parseStack.position+I)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,R=>String.fromCharCode(R)).join("")}"`),typeof E=="string"?E.split("").map(R=>R.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(E.length,I))),U||this._dirtyRowTracker.clearRange(),E.length>I)for(let R=$;R<E.length;R+=I){const K=R+I<E.length?R+I:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(R,K),this._parseBuffer):this._utf8Decoder.decode(E.subarray(R,K),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,j,H,R),this._logSlowResolvingAsync(M),M}else if(!U){const R=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,R))return this._preserveStack(B,j,R,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===B&&this._activeBuffer.y===j||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(E,D,M){let B,j;const $=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,R=this._coreService.modes.insertMode,K=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let Y=this._parser.precedingJoinState;for(let z=D;z<M;++z){if(B=E[z],B<127&&$){const Me=$[String.fromCharCode(B)];Me&&(B=Me.charCodeAt(0))}const J=this._unicodeService.charProperties(B,Y);j=y.UnicodeService.extractWidth(J);const ne=y.UnicodeService.extractShouldJoin(J),fe=ne?y.UnicodeService.extractWidth(Y):0;if(Y=J,U&&this._onA11yChar.fire((0,v.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+j-fe>Q){if(P){const Me=H;let ee=this._activeBuffer.x-fe;for(this._activeBuffer.x=fe,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),fe>0&&H instanceof u.BufferLine&&H.copyCellsFrom(Me,ee,0,fe,!1);ee<Q;)Me.setCellFromCodepoint(ee++,0,1,K)}else if(this._activeBuffer.x=Q-1,j===2)continue}if(ne&&this._activeBuffer.x){const Me=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-Me,B,j);for(let ee=j-fe;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(R&&(H.insertCells(this._activeBuffer.x,j-fe,this._activeBuffer.getNullCell(K)),H.getWidth(Q-1)===2&&H.setCellFromCodepoint(Q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,K)),H.setCellFromCodepoint(this._activeBuffer.x++,B,j,K),j>0)for(;--j;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=Y,this._activeBuffer.x<Q&&M-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,M=>!O(M.params[0],this._optionsService.rawOptions.windowOptions)||D(M))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new g.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}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 E;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&&((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,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(E,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,M,B=!1,j=!1){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);$.replaceCells(D,M,this._activeBuffer.getNullCell(this._eraseAttrData()),j),B&&($.isWrapped=!1)}_resetBufferLine(E,D=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),M.isWrapped=!1)}eraseInDisplay(E,D=!1){let M;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);M<this._bufferService.rows;M++)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;D--;)this._activeBuffer.lines.splice(j-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;D--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)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(E){let D=E.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){const D=this._parser.precedingJoinState;if(!D)return!0;const M=E.params[0]||1,B=y.UnicodeService.extractWidth(D),j=this._activeBuffer.x-B,$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(j),U=new Uint32Array($.length*M);let Q=0;for(let R=0;R<$.length;){const K=$.codePointAt(R)||0;U[Q++]=K,R+=K>65535?2:1}let P=Q;for(let R=1;R<M;++R)U.copyWithin(P,0,Q),P+=Q;return this.print(U,0,P),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){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(),E.params[D]===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(E,D){const M=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:j}=this._coreMouseService,$=this._coreService,{buffers:U,cols:Q}=this._bufferService,{active:P,alt:R}=U,K=this._optionsService.rawOptions,H=ne=>ne?1:2,Y=E.params[0];return z=Y,J=D?Y===2?4:Y===4?H($.modes.insertMode):Y===12?3:Y===20?H(K.convertEol):0:Y===1?H(M.applicationCursorKeys):Y===3?K.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:Y===6?H(M.origin):Y===7?H(M.wraparound):Y===8?3:Y===9?H(B==="X10"):Y===12?H(K.cursorBlink):Y===25?H(!$.isCursorHidden):Y===45?H(M.reverseWraparound):Y===66?H(M.applicationKeypad):Y===67?4:Y===1e3?H(B==="VT200"):Y===1002?H(B==="DRAG"):Y===1003?H(B==="ANY"):Y===1004?H(M.sendFocus):Y===1005?4:Y===1006?H(j==="SGR"):Y===1015?4:Y===1016?H(j==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?H(P===R):Y===2004?H(M.bracketedPasteMode):0,$.triggerDataEvent(`${h.C0.ESC}[${D?"":"?"}${z};${J}$y`),!0;var z,J}_updateAttrColor(E,D,M,B,j){return D===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([M,B,j])):D===5&&(E&=-50331904,E|=33554432|255&M),E}_extractColor(E,D,M){const B=[0,0,-1,0,0,0];let j=0,$=0;do{if(B[$+j]=E.params[D+$],E.hasSubParams(D+$)){const U=E.getSubParams(D+$);let Q=0;do B[1]===5&&(j=1),B[$+Q+1+j]=U[Q];while(++Q<U.length&&Q+$+1+j<B.length);break}if(B[1]===5&&$+j>=2||B[1]===2&&$+j>=5)break;B[1]&&(j=1)}while(++$+D<E.length&&$+j<B.length);for(let U=2;U<B.length;++U)B[U]===-1&&(B[U]=0);switch(B[0]){case 38:M.fg=this._updateAttrColor(M.fg,B[1],B[3],B[4],B[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,B[1],B[3],B[4],B[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,B[1],B[3],B[4],B[5])}return $}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=E.length;let M;const B=this._curAttrData;for(let j=0;j<D;j++)M=E.params[j],M>=30&&M<=37?(B.fg&=-50331904,B.fg|=16777216|M-30):M>=40&&M<=47?(B.bg&=-50331904,B.bg|=16777216|M-40):M>=90&&M<=97?(B.fg&=-50331904,B.fg|=16777224|M-90):M>=100&&M<=107?(B.bg&=-50331904,B.bg|=16777224|M-100):M===0?this._processSGR0(B):M===1?B.fg|=134217728:M===3?B.bg|=67108864:M===4?(B.fg|=268435456,this._processUnderline(E.hasSubParams(j)?E.getSubParams(j)[0]:1,B)):M===5?B.fg|=536870912:M===7?B.fg|=67108864:M===8?B.fg|=1073741824:M===9?B.fg|=2147483648:M===2?B.bg|=134217728:M===21?this._processUnderline(2,B):M===22?(B.fg&=-134217729,B.bg&=-134217729):M===23?B.bg&=-67108865:M===24?(B.fg&=-268435457,this._processUnderline(0,B)):M===25?B.fg&=-536870913:M===27?B.fg&=-67108865:M===28?B.fg&=-1073741825:M===29?B.fg&=2147483647:M===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):M===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?j+=this._extractColor(E,j,B):M===53?B.bg|=1073741824:M===55?B.bg&=-1073741825:M===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):M===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${D};${M}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${D};${M}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.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(E){const D=E.params[0]||1;switch(D){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 M=D%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(E){const D=E.params[0]||1;let M;return(E.length<2||(M=E.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){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(E){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(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const D=[],M=E.split(";");for(;M.length>1;){const B=M.shift(),j=M.shift();if(/^\d+$/.exec(B)){const $=parseInt(B);if(q($))if(j==="?")D.push({type:0,index:$});else{const U=(0,b.parseColor)(j);U&&D.push({type:1,index:$,color:U})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const M=E.split(":");let B;const j=M.findIndex($=>$.startsWith("id="));return j!==-1&&(B=M[j].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const M=E.split(";");for(let B=0;B<M.length&&!(D>=this._specialColors.length);++B,++D)if(M[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const j=(0,b.parseColor)(M[B]);j&&this._onColor.fire([{type:1,index:this._specialColors[D],color:j}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const D=[],M=E.split(";");for(let B=0;B<M.length;++B)if(/^\d+$/.exec(M[B])){const j=parseInt(M[B]);q(j)&&D.push({type:2,index:j})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){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,_.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(T[E[0]],_.CHARSETS[E[1]]||_.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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new n.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const M=this._activeBuffer.ybase+this._activeBuffer.y+D,B=this._activeBuffer.lines.get(M);B&&(B.fill(E),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const M=this._bufferService.buffer,B=this._optionsService.rawOptions;return(j=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${j}${h.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}l.InputHandler=W;let G=class{constructor(N){this._bufferService=N,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(N){N<this.start?this.start=N:N>this.end&&(this.end=N)}markRangeDirty(N,E){N>E&&(F=N,N=E,E=F),N<this.start&&(this.start=N),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(N){return 0<=N&&N<256}G=d([S(0,w.IBufferService)],G)},844:(C,l)=>{function c(d){for(const S of d)S.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const S=this._disposables.indexOf(d);S!==-1&&this._disposables.splice(S,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var S;this._isDisposed||d===this._value||((S=this._value)==null||S.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=c,l.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(S,h,_){this._data[S]||(this._data[S]={}),this._data[S][h]=_}get(S,h){return this._data[S]?this._data[S][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(d,S,h,_,m){this._data.get(d,S)||this._data.set(d,S,new c),this._data.get(d,S).set(h,_,m)}get(d,S,h,_){var m;return(m=this._data.get(d,S))==null?void 0:m.get(h,_)}clear(){this._data.clear()}}},6114:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const S=c.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const S=this._getKey(d);if(S===void 0||(c=this._search(S),c===-1)||this._getKey(this._array[c])!==S)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===S);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,S){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do S(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let S=0,h=this._array.length-1;for(;h>=S;){let _=S+h>>1;const m=this._getKey(this._array[_]);if(m>d)h=_-1;else{if(!(m<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}S=_+1}}return S}}},7226:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=c(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let x=0,v=0,u=m.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),v=Math.max(x,v),o=m.timeRemaining(),1.5*v>o)return u-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-x))}ms`),void this._start();u=o}this.clear()}}class h extends S{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=c(643);l.updateWindowsModeWrappedState=function(S){const h=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),_=h==null?void 0:h.get(S.cols-1),m=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);m&&_&&(m.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}l.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=c(6349),S=c(7226),h=c(3734),_=c(8437),m=c(4634),x=c(511),v=c(643),u=c(4863),o=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,n,p){this._hasScrollback=s,this._optionsService=n,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(n);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let g=0;g<this.lines.length;g++)w+=+this.lines.get(g).resize(s,p);let k=0;if(this._rows<n)for(let g=this._rows;g<n;g++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(s,p)));else for(let g=this._rows;g>n;g--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const g=this.lines.length-y;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=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const p=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,m.reflowLargerCreateNewLayout)(this.lines,p);(0,m.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,n,w.countRemoved)}}_reflowLargerAdjustViewport(s,n,p){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new _.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let g=this.lines.get(k);if(!g||!g.isWrapped&&g.getTrimmedLength()<=s)continue;const b=[g];for(;g.isWrapped&&k>0;)g=this.lines.get(--k),b.unshift(g);const T=this.ybase+this.y;if(T>=k&&T<k+b.length)continue;const I=b[b.length-1].getTrimmedLength(),O=(0,m.reflowSmallerGetNewLineLengths)(b,this._cols,s),A=O.length-b.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const W=[];for(let M=0;M<A;M++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(B)}W.length>0&&(w.push({start:k+b.length+y,newLines:W}),y+=W.length),b.push(...W);let G=O.length-1,q=O[G];q===0&&(G--,q=O[G]);let N=b.length-A-1,E=I;for(;N>=0;){const M=Math.min(E,q);if(b[G]===void 0)break;if(b[G].copyCellsFrom(b[N],E-M,q-M,M,!0),q-=M,q===0&&(G--,q=O[G]),E-=M,E===0){N--;const B=Math.max(N,0);E=(0,m.getWrappedLineTrimmedLength)(b,B,this._cols)}}for(let M=0;M<b.length;M++)O[M]<s&&b[M].setCell(O[M],p);let D=A-F;for(;D-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+n-1)}if(w.length>0){const k=[],g=[];for(let G=0;G<this.lines.length;G++)g.push(this.lines.get(G));const b=this.lines.length;let T=b-1,I=0,O=w[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let G=Math.min(this.lines.maxLength-1,b+y-1);G>=0;G--)if(O&&O.start>T+A){for(let q=O.newLines.length-1;q>=0;q--)this.lines.set(G--,O.newLines[q]);G++,k.push({index:T+1,amount:O.newLines.length}),A+=O.newLines.length,O=w[++I]}else this.lines.set(G,g[T--]);let F=0;for(let G=k.length-1;G>=0;G--)k[G].index+=F,this.lines.onInsertEmitter.fire(k[G]),F+=k[G].amount;const W=Math.max(0,b+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(s,n,p=0,w){const y=this.lines.get(s);return y?y.translateToString(n,p,w):""}getWrappedRangeForLine(s){let n=s,p=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:n,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new u.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim(p=>{n.line-=p,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(p=>{n.line>=p.index&&(n.line+=p.amount)})),n.register(this.lines.onDelete(p=>{n.line>=p.index&&n.line<p.index+p.amount&&n.dispose(),n.line>p.index&&(n.line-=p.amount)})),n.register(n.onDispose(()=>this._removeMarker(n))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=c(3734),S=c(511),h=c(643),_=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let m=0;class x{constructor(u,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const n=o||S.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,n);this.length=u}get(u){const o=this._data[3*u+0],s=2097151&o;return[this._data[3*u+1],2097152&o?this._combined[u]:s?(0,_.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,o){this._data[3*u+1]=o[h.CHAR_DATA_ATTR_INDEX],o[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=o[1],this._data[3*u+0]=2097152|u|o[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=o[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&o}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u]:2097151&o?(0,_.stringFromCodePoint)(2097151&o):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,o){return m=3*u,o.content=this._data[m+0],o.fg=this._data[m+1],o.bg=this._data[m+2],2097152&o.content&&(o.combinedData=this._combined[u]),268435456&o.bg&&(o.extended=this._extendedAttrs[u]),o}setCell(u,o){2097152&o.content&&(this._combined[u]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[u]=o.extended),this._data[3*u+0]=o.content,this._data[3*u+1]=o.fg,this._data[3*u+2]=o.bg}setCellFromCodepoint(u,o,s,n){268435456&n.bg&&(this._extendedAttrs[u]=n.extended),this._data[3*u+0]=o|s<<22,this._data[3*u+1]=n.fg,this._data[3*u+2]=n.bg}addCodepointToCell(u,o,s){let n=this._data[3*u+0];2097152&n?this._combined[u]+=(0,_.stringFromCodePoint)(o):2097151&n?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&n)+(0,_.stringFromCodePoint)(o),n&=-2097152,n|=2097152):n=o|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*u+0]=n}insertCells(u,o,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length-u){const n=new S.CellData;for(let p=this.length-u-o-1;p>=0;--p)this.setCell(u+o+p,this.loadCell(u+p,n));for(let p=0;p<o;++p)this.setCell(u+p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,o,s){if(u%=this.length,o<this.length-u){const n=new S.CellData;for(let p=0;p<this.length-u-o;++p)this.setCell(u+p,this.loadCell(u+o+p,n));for(let p=this.length-o;p<this.length;++p)this.setCell(p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,o,s,n=!1){if(n)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.setCell(u++,s)}resize(u,o){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<u;++n)this.setCell(n,o)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let w=0;w<n.length;w++){const y=parseInt(n[w],10);y>=u&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const o in u._combined)this._combined[o]=u._combined[o];this._extendedAttrs={};for(const o in u._extendedAttrs)this._extendedAttrs[o]=u._extendedAttrs[o];this.isWrapped=u.isWrapped}clone(){const u=new x(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const o in this._combined)u._combined[o]=this._combined[o];for(const o in this._extendedAttrs)u._extendedAttrs[o]=this._extendedAttrs[o];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,o,s,n,p){const w=u._data;if(p)for(let k=n-1;k>=0;k--){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(o+k)+g];268435456&w[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}else for(let k=0;k<n;k++){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(o+k)+g];268435456&w[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}const y=Object.keys(u._combined);for(let k=0;k<y.length;k++){const g=parseInt(y[k],10);g>=o&&(this._combined[g-o+s]=u._combined[g])}}translateToString(u,o,s,n){o=o??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let p="";for(;o<s;){const w=this._data[3*o+0],y=2097151&w,k=2097152&w?this._combined[o]:y?(0,_.stringFromCodePoint)(y):h.WHITESPACE_CELL_CHAR;if(p+=k,n)for(let g=0;g<k.length;++g)n.push(o);o+=w>>22||1}return n&&n.push(o),p}}l.BufferLine=x},4841:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,d){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 d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(C,l)=>{function c(d,S,h){if(S===d.length-1)return d[S].getTrimmedLength();const _=!d[S].hasContent(h-1)&&d[S].getWidth(h-1)===1,m=d[S+1].getWidth(0)===2;return _&&m?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,S,h,_,m){const x=[];for(let v=0;v<d.length-1;v++){let u=v,o=d.get(++u);if(!o.isWrapped)continue;const s=[d.get(v)];for(;u<d.length&&o.isWrapped;)s.push(o),o=d.get(++u);if(_>=v&&_<u){v+=s.length-1;continue}let n=0,p=c(s,n,S),w=1,y=0;for(;w<s.length;){const g=c(s,w,S),b=g-y,T=h-p,I=Math.min(b,T);s[n].copyCellsFrom(s[w],y,p,I,!1),p+=I,p===h&&(n++,p=0),y+=I,y===g&&(w++,y=0),p===0&&n!==0&&s[n-1].getWidth(h-1)===2&&(s[n].copyCellsFrom(s[n-1],h-1,p++,1,!1),s[n-1].setCell(h-1,m))}s[n].replaceCells(p,h,m);let k=0;for(let g=s.length-1;g>0&&(g>n||s[g].getTrimmedLength()===0);g--)k++;k>0&&(x.push(v+s.length-k),x.push(k)),v+=s.length-1}return x},l.reflowLargerCreateNewLayout=function(d,S){const h=[];let _=0,m=S[_],x=0;for(let v=0;v<d.length;v++)if(m===v){const u=S[++_];d.onDeleteEmitter.fire({index:v-x,amount:u}),v+=u-1,x+=u,m=S[++_]}else h.push(v);return{layout:h,countRemoved:x}},l.reflowLargerApplyNewLayout=function(d,S){const h=[];for(let _=0;_<S.length;_++)h.push(d.get(S[_]));for(let _=0;_<h.length;_++)d.set(_,h[_]);d.length=S.length},l.reflowSmallerGetNewLineLengths=function(d,S,h){const _=[],m=d.map((o,s)=>c(d,s,S)).reduce((o,s)=>o+s);let x=0,v=0,u=0;for(;u<m;){if(m-u<h){_.push(m-u);break}x+=h;const o=c(d,v,S);x>o&&(x-=o,v++);const s=d[v].getWidth(x-1)===2;s&&x--;const n=s?h-1:h;_.push(n),u+=n}return _},l.getWrappedLineTrimmedLength=c},5295:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=c(8460),S=c(844),h=c(9092);class _ extends S.Disposable{constructor(x,v){super(),this._optionsService=x,this._bufferService=v,this._onBufferActivate=this.register(new d.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,v){this._normal.resize(x,v),this._alt.resize(x,v),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}l.BufferSet=_},511:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=c(482),S=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const v=new _;return v.setFromCharData(x),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(x[S.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(x[S.CHAR_DATA_CHAR_INDEX].length===2){const u=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const o=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(u-55296)+o-56320+65536|x[S.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[S.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=x[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=c(8460),S=c(844);class h{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}l.Marker=h,h._nextId=1},7116:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,l)=>{var c,d,S;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.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 b=this._getMouseBufferCoords(g),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&b)&&this._areCoordsInSelection(b,T,I)}isCellInSelection(g,b){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([g,b],T,I)}_areCoordsInSelection(g,b,T){return g[1]>b[1]&&g[1]<T[1]||b[1]===T[1]&&g[1]===b[1]&&g[0]>=b[0]&&g[0]<T[0]||b[1]<T[1]&&g[1]===T[1]&&g[0]<T[0]||b[1]<T[1]&&g[1]===b[1]&&g[0]>=b[0]}_selectWordAtCursor(g,b){var O,A;const T=(A=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:A.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(g);return!!I&&(this._selectWordAt(I,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,b){this._model.clearSelection(),g=Math.max(g,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const b=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(g){let b=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=T?0:(b>T&&(b-=T),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(g){return o.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 b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const b=this._getMouseBufferCoords(g);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(g){return g.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const b=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 I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[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 b=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<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 I=(0,_.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,T=!(!g||!b||g[0]===b[0]&&g[1]===b[1]);T?g&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,b,T)):this._oldHasSelection&&this._fireOnSelectionChange(g,b,T)}_fireOnSelectionChange(g,b,T){this._oldSelectionStart=g,this._oldSelectionEnd=b,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(g,b){let T=b;for(let I=0;b>=I;I++){const O=g.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&b!==I&&(T+=O-1)}return T}setSelection(g,b,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,b],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,b,T=!0,I=!0){if(g[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,A=O.lines.get(g[1]);if(!A)return;const F=O.translateBufferLineToString(g[1],!1);let W=this._convertViewportColToCharacterIndex(A,g[0]),G=W;const q=g[0]-W;let N=0,E=0,D=0,M=0;if(F.charAt(W)===" "){for(;W>0&&F.charAt(W-1)===" ";)W--;for(;G<F.length&&F.charAt(G+1)===" ";)G++}else{let $=g[0],U=g[0];A.getWidth($)===0&&(N++,$--),A.getWidth(U)===2&&(E++,U++);const Q=A.getString(U).length;for(Q>1&&(M+=Q-1,G+=Q-1);$>0&&W>0&&!this._isCharWordSeparator(A.loadCell($-1,this._workCell));){A.loadCell($-1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,$--):P>1&&(D+=P-1,W-=P-1),W--,$--}for(;U<A.length&&G+1<F.length&&!this._isCharWordSeparator(A.loadCell(U+1,this._workCell));){A.loadCell(U+1,this._workCell);const P=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,U++):P>1&&(M+=P-1,G+=P-1),G++,U++}}G++;let B=W+q-N+D,j=Math.min(this._bufferService.cols,G-W+N+E-D-M);if(b||F.slice(W,G).trim()!==""){if(T&&B===0&&A.getCodePoint(0)!==32){const $=O.lines.get(g[1]-1);if($&&A.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){const U=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(U){const Q=this._bufferService.cols-U.start;B-=Q,j+=Q}}}if(I&&B+j===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const $=O.lines.get(g[1]+1);if($!=null&&$.isWrapped&&$.getCodePoint(0)!==32){const U=this._getWordAt([0,g[1]+1],!1,!1,!0);U&&(j+=U.length)}}return{start:B,length:j}}}_selectWordAt(g,b){const T=this._getWordAt(g,b);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 b=this._getWordAt(g,!0);if(b){let T=g[1];for(;b.start<0;)b.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,T]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const b=this._bufferService.buffer.getWrappedRangeForLine(g),T={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols)}};l.SelectionService=k=d([S(3,p.IBufferService),S(4,p.ICoreService),S(5,x.IMouseService),S(6,p.IOptionsService),S(7,x.IRenderService),S(8,x.ICoreBrowserService)],k)},4725:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const d=c(8343);l.ICharSizeService=(0,d.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),l.IMouseService=(0,d.createDecorator)("MouseService"),l.IRenderService=(0,d.createDecorator)("RenderService"),l.ISelectionService=(0,d.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,d.createDecorator)("ThemeService"),l.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(C,l,c){var d=this&&this.__decorate||function(k,g,b,T){var I,O=arguments.length,A=O<3?g:T===null?T=Object.getOwnPropertyDescriptor(g,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(k,g,b,T);else for(var F=k.length-1;F>=0;F--)(I=k[F])&&(A=(O<3?I(A):O>3?I(g,b,A):I(g,b))||A);return O>3&&A&&Object.defineProperty(g,b,A),A},S=this&&this.__param||function(k,g){return function(b,T){g(b,T,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),_=c(8055),m=c(8460),x=c(844),v=c(2585),u=_.css.toColor("#ffffff"),o=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),n=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let b=0;b<216;b++){const T=g[b/36%6|0],I=g[b/6%6|0],O=g[b%6];k.push({css:_.channels.toCss(T,I,O),rgba:_.channels.toRgba(T,I,O)})}for(let b=0;b<24;b++){const T=8+10*b;k.push({css:_.channels.toCss(T,T,T),rgba:_.channels.toRgba(T,T,T)})}return k})());let w=l.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:o,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(o,p),ansi:l.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(k={}){const g=this._colors;if(g.foreground=y(k.foreground,u),g.background=y(k.background,o),g.cursor=y(k.cursor,s),g.cursorAccent=y(k.cursorAccent,n),g.selectionBackgroundTransparent=y(k.selectionBackground,p),g.selectionBackgroundOpaque=_.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=y(k.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=_.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=k.selectionForeground?y(k.selectionForeground,_.NULL_COLOR):void 0,g.selectionForeground===_.NULL_COLOR&&(g.selectionForeground=void 0),_.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=_.color.opacity(g.selectionBackgroundTransparent,.3)),_.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=_.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=l.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=y(k.black,l.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=y(k.red,l.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=y(k.green,l.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=y(k.yellow,l.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=y(k.blue,l.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=y(k.magenta,l.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=y(k.cyan,l.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=y(k.white,l.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=y(k.brightBlack,l.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=y(k.brightRed,l.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=y(k.brightGreen,l.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=y(k.brightYellow,l.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=y(k.brightBlue,l.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=y(k.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=y(k.brightCyan,l.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=y(k.brightWhite,l.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(g.ansi.length-16,k.extendedAnsi.length);for(let T=0;T<b;T++)g.ansi[T+16]=y(k.extendedAnsi[T],l.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){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[k]=this._restoreColors.ansi[k]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(k){k(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 y(k,g){if(k!==void 0)try{return _.css.toColor(k)}catch{}return g}l.ThemeService=w=d([S(0,v.IOptionsService)],w)},6349:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(m){if(this._maxLength===m)return;const x=new Array(m);for(let v=0;v<Math.min(m,this.length);v++)x[v]=this._array[this._getCyclicIndex(v)];this._array=x,this._maxLength=m,this._startIndex=0}get length(){return this._length}set length(m){if(m>this._length)for(let x=this._length;x<m;x++)this._array[x]=void 0;this._length=m}get(m){return this._array[this._getCyclicIndex(m)]}set(m,x){this._array[this._getCyclicIndex(m)]=x}push(m){this._array[this._getCyclicIndex(this._length)]=m,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(m,x,...v){if(x){for(let u=m;u<this._length-x;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+x)];this._length-=x,this.onDeleteEmitter.fire({index:m,amount:x})}for(let u=this._length-1;u>=m;u--)this._array[this._getCyclicIndex(u+v.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<v.length;u++)this._array[this._getCyclicIndex(m+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:m,amount:v.length}),this._length+v.length>this._maxLength){const u=this._length+v.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=v.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,x,v){if(!(x<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let o=x-1;o>=0;o--)this.set(m+o+v,this.get(m+o));const u=m+x+v-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<x;u++)this.set(m+u+v,this.get(m+u))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}l.CircularList=h},1439:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(d,S=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const _ in d)h[_]=S<=1?d[_]:d[_]&&c(d[_],S-1);return h}},8055:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,d=0,S=0,h=0;var _,m,x,v,u;function o(n){const p=n.toString(16);return p.length<2?"0"+p:p}function s(n,p){return n<p?(p+.05)/(n+.05):(n+.05)/(p+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},function(n){n.toCss=function(p,w,y,k){return k!==void 0?`#${o(p)}${o(w)}${o(y)}${o(k)}`:`#${o(p)}${o(w)}${o(y)}`},n.toRgba=function(p,w,y,k=255){return(p<<24|w<<16|y<<8|k)>>>0},n.toColor=function(p,w,y,k){return{css:n.toCss(p,w,y,k),rgba:n.toRgba(p,w,y,k)}}}(_||(l.channels=_={})),function(n){function p(w,y){return h=Math.round(255*y),[c,d,S]=u.toChannels(w.rgba),{css:_.toCss(c,d,S,h),rgba:_.toRgba(c,d,S,h)}}n.blend=function(w,y){if(h=(255&y.rgba)/255,h===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,g=y.rgba>>16&255,b=y.rgba>>8&255,T=w.rgba>>24&255,I=w.rgba>>16&255,O=w.rgba>>8&255;return c=T+Math.round((k-T)*h),d=I+Math.round((g-I)*h),S=O+Math.round((b-O)*h),{css:_.toCss(c,d,S),rgba:_.toRgba(c,d,S)}},n.isOpaque=function(w){return(255&w.rgba)==255},n.ensureContrastRatio=function(w,y,k){const g=u.ensureContrastRatio(w.rgba,y.rgba,k);if(g)return _.toColor(g>>24&255,g>>16&255,g>>8&255)},n.opaque=function(w){const y=(255|w.rgba)>>>0;return[c,d,S]=u.toChannels(y),{css:_.toCss(c,d,S),rgba:y}},n.opacity=p,n.multiplyOpacity=function(w,y){return h=255&w.rgba,p(w,h*y/255)},n.toColorRGB=function(w){return[w.rgba>>24&255,w.rgba>>16&255,w.rgba>>8&255]}}(m||(l.color=m={})),function(n){let p,w;try{const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",w=p.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),_.toColor(c,d,S);case 5:return c=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),S=parseInt(y.slice(3,4).repeat(2),16),h=parseInt(y.slice(4,5).repeat(2),16),_.toColor(c,d,S,h);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return c=parseInt(k[1]),d=parseInt(k[2]),S=parseInt(k[3]),h=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(c,d,S,h);if(!p||!w)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=w,p.fillStyle=y,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,d,S,h]=p.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,d,S,h),css:y}}}(x||(l.css=x={})),function(n){function p(w,y,k){const g=w/255,b=y/255,T=k/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}n.relativeLuminance=function(w){return p(w>>16&255,w>>8&255,255&w)},n.relativeLuminance2=p}(v||(l.rgb=v={})),function(n){function p(y,k,g){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let O=k>>24&255,A=k>>16&255,F=k>>8&255,W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));for(;W<g&&(O>0||A>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));return(O<<24|A<<16|F<<8|255)>>>0}function w(y,k,g){const b=y>>24&255,T=y>>16&255,I=y>>8&255;let O=k>>24&255,A=k>>16&255,F=k>>8&255,W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));for(;W<g&&(O<255||A<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),W=s(v.relativeLuminance2(O,A,F),v.relativeLuminance2(b,T,I));return(O<<24|A<<16|F<<8|255)>>>0}n.blend=function(y,k){if(h=(255&k)/255,h===1)return k;const g=k>>24&255,b=k>>16&255,T=k>>8&255,I=y>>24&255,O=y>>16&255,A=y>>8&255;return c=I+Math.round((g-I)*h),d=O+Math.round((b-O)*h),S=A+Math.round((T-A)*h),_.toRgba(c,d,S)},n.ensureContrastRatio=function(y,k,g){const b=v.relativeLuminance(y>>8),T=v.relativeLuminance(k>>8);if(s(b,T)<g){if(T<b){const A=p(y,k,g),F=s(b,v.relativeLuminance(A>>8));if(F<g){const W=w(y,k,g);return F>s(b,v.relativeLuminance(W>>8))?A:W}return A}const I=w(y,k,g),O=s(b,v.relativeLuminance(I>>8));if(O<g){const A=p(y,k,g);return O>s(b,v.relativeLuminance(A>>8))?I:A}return I}},n.reduceLuminance=p,n.increaseLuminance=w,n.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]}}(u||(l.rgba=u={})),l.toPaddedHex=o,l.contrastRatio=s},8969:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const d=c(844),S=c(2585),h=c(4348),_=c(7866),m=c(744),x=c(7302),v=c(6975),u=c(8460),o=c(1753),s=c(1480),n=c(7994),p=c(9282),w=c(5435),y=c(5981),k=c(2660);let g=!1;class b extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(I=>{var O;(O=this._onScrollApi)==null||O.fire(I.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(I){for(const O in I)this.optionsService.options[O]=I[O]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new x.OptionsService(I)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new w.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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(O=>{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(O=>{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 y.WriteBuffer((O,A)=>this._inputHandler.parse(O,A))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,O){this._writeBuffer.write(I,O)}writeSync(I,O){this._logService.logLevel<=S.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(I,O)}input(I,O=!0){this.coreService.triggerDataEvent(I,O)}resize(I,O){isNaN(I)||isNaN(O)||(I=Math.max(I,m.MINIMUM_COLS),O=Math.max(O,m.MINIMUM_ROWS),this._bufferService.resize(I,O))}scroll(I,O=!1){this._bufferService.scroll(I,O)}scrollLines(I,O,A){this._bufferService.scrollLines(I,O,A)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const O=I-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(I,O){return this._inputHandler.registerEscHandler(I,O)}registerDcsHandler(I,O){return this._inputHandler.registerDcsHandler(I,O)}registerCsiHandler(I,O){return this._inputHandler.registerCsiHandler(I,O)}registerOscHandler(I,O){return this._inputHandler.registerOscHandler(I,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?I=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const O of I)O.dispose()})}}}l.CoreTerminal=b},8460:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===c)return void this._listeners.splice(d,1)}}})),this._event}fire(c,d){const S=[];for(let h=0;h<this._listeners.length;h++)S.push(this._listeners[h]);for(let h=0;h<S.length;h++)S[h].call(void 0,c,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,d){return c(S=>d.fire(S))},l.runAndSubscribe=function(c,d){return d(void 0),c(S=>d(S))}},5435:function(C,l,c){var d=this&&this.__decorate||function(N,E,D,M){var B,j=arguments.length,$=j<3?E:M===null?M=Object.getOwnPropertyDescriptor(E,D):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(N,E,D,M);else for(var U=N.length-1;U>=0;U--)(B=N[U])&&($=(j<3?B($):j>3?B(E,D,$):B(E,D))||$);return j>3&&$&&Object.defineProperty(E,D,$),$},S=this&&this.__param||function(N,E){return function(D,M){E(D,M,N)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=c(2584),_=c(7116),m=c(2015),x=c(844),v=c(482),u=c(8437),o=c(8460),s=c(643),n=c(511),p=c(3734),w=c(2585),y=c(1480),k=c(6242),g=c(6351),b=c(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function O(N,E){if(N>24)return E.setWinLines||!1;switch(N){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var A;(function(N){N[N.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",N[N.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(l.WindowsOptionsReportType=A={}));let F=0;class W extends x.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,M,B,j,$,U,Q,P=new m.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=M,this._logService=B,this._optionsService=j,this._oscLinkService=$,this._coreMouseService=U,this._unicodeService=Q,this._parser=P,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:K.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,K,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:K,data:H})}),this._parser.setDcsHandlerFallback((L,K,H)=>{K==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:K,payload:H})}),this._parser.setPrintHandler((L,K,H)=>this.print(L,K,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(h.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(h.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(h.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(h.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(h.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(h.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(h.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(h.C1.IND,()=>this.index()),this._parser.setExecuteHandler(h.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(h.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new k.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new k.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new k.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new k.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new k.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new k.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new k.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new k.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new k.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new k.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new k.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 _.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,K)=>this.requestStatusString(L,K)))}_preserveStack(E,D,M,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=M,this._parseStack.position=B}_logSlowResolvingAsync(E){this._logService.logLevel<=w.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,M)=>setTimeout(()=>M("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let M,B=this._activeBuffer.x,j=this._activeBuffer.y,$=0;const U=this._parseStack.paused;if(U){if(M=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(M),M;B=this._parseStack.cursorStartX,j=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>I&&($=this._parseStack.position+I)}if(this._logService.logLevel<=w.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,L=>String.fromCharCode(L)).join("")}"`),typeof E=="string"?E.split("").map(L=>L.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(E.length,I))),U||this._dirtyRowTracker.clearRange(),E.length>I)for(let L=$;L<E.length;L+=I){const K=L+I<E.length?L+I:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(L,K),this._parseBuffer):this._utf8Decoder.decode(E.subarray(L,K),this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,j,H,L),this._logSlowResolvingAsync(M),M}else if(!U){const L=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(M=this._parser.parse(this._parseBuffer,L))return this._preserveStack(B,j,L,0),this._logSlowResolvingAsync(M),M}this._activeBuffer.x===B&&this._activeBuffer.y===j||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),P=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);P<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(P,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(E,D,M){let B,j;const $=this._charsetService.charset,U=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,P=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,K=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&M-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let Y=this._parser.precedingJoinState;for(let z=D;z<M;++z){if(B=E[z],B<127&&$){const Me=$[String.fromCharCode(B)];Me&&(B=Me.charCodeAt(0))}const J=this._unicodeService.charProperties(B,Y);j=y.UnicodeService.extractWidth(J);const ne=y.UnicodeService.extractShouldJoin(J),fe=ne?y.UnicodeService.extractWidth(Y):0;if(Y=J,U&&this._onA11yChar.fire((0,v.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+j-fe>Q){if(P){const Me=H;let ee=this._activeBuffer.x-fe;for(this._activeBuffer.x=fe,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),fe>0&&H instanceof u.BufferLine&&H.copyCellsFrom(Me,ee,0,fe,!1);ee<Q;)Me.setCellFromCodepoint(ee++,0,1,K)}else if(this._activeBuffer.x=Q-1,j===2)continue}if(ne&&this._activeBuffer.x){const Me=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-Me,B,j);for(let ee=j-fe;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(L&&(H.insertCells(this._activeBuffer.x,j-fe,this._activeBuffer.getNullCell(K)),H.getWidth(Q-1)===2&&H.setCellFromCodepoint(Q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,K)),H.setCellFromCodepoint(this._activeBuffer.x++,B,j,K),j>0)for(;--j;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=Y,this._activeBuffer.x<Q&&M-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,M=>!O(M.params[0],this._optionsService.rawOptions.windowOptions)||D(M))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new g.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}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 E;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&&((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,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(E,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,M,B=!1,j=!1){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);$.replaceCells(D,M,this._activeBuffer.getNullCell(this._eraseAttrData()),j),B&&($.isWrapped=!1)}_resetBufferLine(E,D=!1){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);M&&(M.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),M.isWrapped=!1)}eraseInDisplay(E,D=!1){let M;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);M<this._bufferService.rows;M++)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(M);break;case 1:for(M=this._activeBuffer.y,this._dirtyRowTracker.markDirty(M),this._eraseInBufferLine(M,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(M+1).isWrapped=!1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(M=this._bufferService.rows,this._dirtyRowTracker.markDirty(M-1);M--;)this._resetBufferLine(M,D);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;D--;)this._activeBuffer.lines.splice(j-1,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const M=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;D--;)this._activeBuffer.lines.splice(M,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)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(E){let D=E.params[0]||1;for(;D--;)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(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let M=this._activeBuffer.scrollTop;M<=this._activeBuffer.scrollBottom;++M){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);B.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){const D=this._parser.precedingJoinState;if(!D)return!0;const M=E.params[0]||1,B=y.UnicodeService.extractWidth(D),j=this._activeBuffer.x-B,$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(j),U=new Uint32Array($.length*M);let Q=0;for(let L=0;L<$.length;){const K=$.codePointAt(L)||0;U[Q++]=K,L+=K>65535?2:1}let P=Q;for(let L=1;L<M;++L)U.copyWithin(P,0,Q),P+=Q;return this.print(U,0,P),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){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(),E.params[D]===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(E,D){const M=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:j}=this._coreMouseService,$=this._coreService,{buffers:U,cols:Q}=this._bufferService,{active:P,alt:L}=U,K=this._optionsService.rawOptions,H=ne=>ne?1:2,Y=E.params[0];return z=Y,J=D?Y===2?4:Y===4?H($.modes.insertMode):Y===12?3:Y===20?H(K.convertEol):0:Y===1?H(M.applicationCursorKeys):Y===3?K.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:Y===6?H(M.origin):Y===7?H(M.wraparound):Y===8?3:Y===9?H(B==="X10"):Y===12?H(K.cursorBlink):Y===25?H(!$.isCursorHidden):Y===45?H(M.reverseWraparound):Y===66?H(M.applicationKeypad):Y===67?4:Y===1e3?H(B==="VT200"):Y===1002?H(B==="DRAG"):Y===1003?H(B==="ANY"):Y===1004?H(M.sendFocus):Y===1005?4:Y===1006?H(j==="SGR"):Y===1015?4:Y===1016?H(j==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?H(P===L):Y===2004?H(M.bracketedPasteMode):0,$.triggerDataEvent(`${h.C0.ESC}[${D?"":"?"}${z};${J}$y`),!0;var z,J}_updateAttrColor(E,D,M,B,j){return D===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([M,B,j])):D===5&&(E&=-50331904,E|=33554432|255&M),E}_extractColor(E,D,M){const B=[0,0,-1,0,0,0];let j=0,$=0;do{if(B[$+j]=E.params[D+$],E.hasSubParams(D+$)){const U=E.getSubParams(D+$);let Q=0;do B[1]===5&&(j=1),B[$+Q+1+j]=U[Q];while(++Q<U.length&&Q+$+1+j<B.length);break}if(B[1]===5&&$+j>=2||B[1]===2&&$+j>=5)break;B[1]&&(j=1)}while(++$+D<E.length&&$+j<B.length);for(let U=2;U<B.length;++U)B[U]===-1&&(B[U]=0);switch(B[0]){case 38:M.fg=this._updateAttrColor(M.fg,B[1],B[3],B[4],B[5]);break;case 48:M.bg=this._updateAttrColor(M.bg,B[1],B[3],B[4],B[5]);break;case 58:M.extended=M.extended.clone(),M.extended.underlineColor=this._updateAttrColor(M.extended.underlineColor,B[1],B[3],B[4],B[5])}return $}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=u.DEFAULT_ATTR_DATA.fg,E.bg=u.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=E.length;let M;const B=this._curAttrData;for(let j=0;j<D;j++)M=E.params[j],M>=30&&M<=37?(B.fg&=-50331904,B.fg|=16777216|M-30):M>=40&&M<=47?(B.bg&=-50331904,B.bg|=16777216|M-40):M>=90&&M<=97?(B.fg&=-50331904,B.fg|=16777224|M-90):M>=100&&M<=107?(B.bg&=-50331904,B.bg|=16777224|M-100):M===0?this._processSGR0(B):M===1?B.fg|=134217728:M===3?B.bg|=67108864:M===4?(B.fg|=268435456,this._processUnderline(E.hasSubParams(j)?E.getSubParams(j)[0]:1,B)):M===5?B.fg|=536870912:M===7?B.fg|=67108864:M===8?B.fg|=1073741824:M===9?B.fg|=2147483648:M===2?B.bg|=134217728:M===21?this._processUnderline(2,B):M===22?(B.fg&=-134217729,B.bg&=-134217729):M===23?B.bg&=-67108865:M===24?(B.fg&=-268435457,this._processUnderline(0,B)):M===25?B.fg&=-536870913:M===27?B.fg&=-67108865:M===28?B.fg&=-1073741825:M===29?B.fg&=2147483647:M===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):M===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):M===38||M===48||M===58?j+=this._extractColor(E,j,B):M===53?B.bg|=1073741824:M===55?B.bg&=-1073741825:M===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):M===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",M);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${D};${M}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,M=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${D};${M}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.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(E){const D=E.params[0]||1;switch(D){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 M=D%2==1;return this._optionsService.options.cursorBlink=M,!0}setScrollRegion(E){const D=E.params[0]||1;let M;return(E.length<2||(M=E.params[1])>this._bufferService.rows||M===0)&&(M=this._bufferService.rows),M>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=M-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){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(E){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(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const D=[],M=E.split(";");for(;M.length>1;){const B=M.shift(),j=M.shift();if(/^\d+$/.exec(B)){const $=parseInt(B);if(q($))if(j==="?")D.push({type:0,index:$});else{const U=(0,b.parseColor)(j);U&&D.push({type:1,index:$,color:U})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const M=E.split(":");let B;const j=M.findIndex($=>$.startsWith("id="));return j!==-1&&(B=M[j].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const M=E.split(";");for(let B=0;B<M.length&&!(D>=this._specialColors.length);++B,++D)if(M[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const j=(0,b.parseColor)(M[B]);j&&this._onColor.fire([{type:1,index:this._specialColors[D],color:j}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const D=[],M=E.split(";");for(let B=0;B<M.length;++B)if(/^\d+$/.exec(M[B])){const j=parseInt(M[B]);q(j)&&D.push({type:2,index:j})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){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,_.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(T[E[0]],_.CHARSETS[E[1]]||_.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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new n.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const M=this._activeBuffer.ybase+this._activeBuffer.y+D,B=this._activeBuffer.lines.get(M);B&&(B.fill(E),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const M=this._bufferService.buffer,B=this._optionsService.rawOptions;return(j=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${j}${h.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${M.scrollTop+1};${M.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}l.InputHandler=W;let G=class{constructor(N){this._bufferService=N,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(N){N<this.start?this.start=N:N>this.end&&(this.end=N)}markRangeDirty(N,E){N>E&&(F=N,N=E,E=F),N<this.start&&(this.start=N),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(N){return 0<=N&&N<256}G=d([S(0,w.IBufferService)],G)},844:(C,l)=>{function c(d){for(const S of d)S.dispose();d.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const S=this._disposables.indexOf(d);S!==-1&&this._disposables.splice(S,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var S;this._isDisposed||d===this._value||((S=this._value)==null||S.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},l.toDisposable=function(d){return{dispose:d}},l.disposeArray=c,l.getDisposeArrayDisposable=function(d){return{dispose:()=>c(d)}}},1505:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(S,h,_){this._data[S]||(this._data[S]={}),this._data[S][h]=_}get(S,h){return this._data[S]?this._data[S][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(d,S,h,_,m){this._data.get(d,S)||this._data.set(d,S,new c),this._data.get(d,S).set(h,_,m)}get(d,S,h,_){var m;return(m=this._data.get(d,S))==null?void 0:m.get(h,_)}clear(){this._data.clear()}}},6114:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,d=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const S=c.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),l.isIpad=d==="iPad",l.isIphone=d==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),l.isLinux=d.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(c=this._search(this._getKey(d)),this._array.splice(c,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const S=this._getKey(d);if(S===void 0||(c=this._search(S),c===-1)||this._getKey(this._array[c])!==S)return!1;do if(this._array[c]===d)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===S);return!1}*getKeyIterator(d){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===d)}forEachByKey(d,S){if(this._array.length!==0&&(c=this._search(d),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===d))do S(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===d)}values(){return[...this._array].values()}_search(d){let S=0,h=this._array.length-1;for(;h>=S;){let _=S+h>>1;const m=this._getKey(this._array[_]);if(m>d)h=_-1;else{if(!(m<d)){for(;_>0&&this._getKey(this._array[_-1])===d;)_--;return _}S=_+1}}return S}}},7226:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const d=c(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),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(m){this._idleCallback=void 0;let x=0,v=0,u=m.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),v=Math.max(x,v),o=m.timeRemaining(),1.5*v>o)return u-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-x))}ms`),void this._start();u=o}this.clear()}}class h extends S{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const x=Date.now()+m;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const d=c(643);l.updateWindowsModeWrappedState=function(S){const h=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),_=h==null?void 0:h.get(S.cols-1),m=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);m&&_&&(m.isWrapped=_[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&_[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}l.AttributeData=c;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=d},9092:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const d=c(6349),S=c(7226),h=c(3734),_=c(8437),m=c(4634),x=c(511),v=c(643),u=c(4863),o=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,n,p){this._hasScrollback=s,this._optionsService=n,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let w=0;const y=this._getCorrectBufferLength(n);if(y>this.lines.maxLength&&(this.lines.maxLength=y),this.lines.length>0){if(this._cols<s)for(let g=0;g<this.lines.length;g++)w+=+this.lines.get(g).resize(s,p);let k=0;if(this._rows<n)for(let g=this._rows;g<n;g++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(s,p)));else for(let g=this._rows;g>n;g--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(y<this.lines.maxLength){const g=this.lines.length-y;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=y}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let k=0;k<this.lines.length;k++)w+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),w>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const p=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const w=(0,m.reflowLargerCreateNewLayout)(this.lines,p);(0,m.reflowLargerApplyNewLayout)(this.lines,w.layout),this._reflowLargerAdjustViewport(s,n,w.countRemoved)}}_reflowLargerAdjustViewport(s,n,p){const w=this.getNullCell(_.DEFAULT_ATTR_DATA);let y=p;for(;y-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new _.BufferLine(s,w))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,n){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),w=[];let y=0;for(let k=this.lines.length-1;k>=0;k--){let g=this.lines.get(k);if(!g||!g.isWrapped&&g.getTrimmedLength()<=s)continue;const b=[g];for(;g.isWrapped&&k>0;)g=this.lines.get(--k),b.unshift(g);const T=this.ybase+this.y;if(T>=k&&T<k+b.length)continue;const I=b[b.length-1].getTrimmedLength(),O=(0,m.reflowSmallerGetNewLineLengths)(b,this._cols,s),A=O.length-b.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const W=[];for(let M=0;M<A;M++){const B=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);W.push(B)}W.length>0&&(w.push({start:k+b.length+y,newLines:W}),y+=W.length),b.push(...W);let G=O.length-1,q=O[G];q===0&&(G--,q=O[G]);let N=b.length-A-1,E=I;for(;N>=0;){const M=Math.min(E,q);if(b[G]===void 0)break;if(b[G].copyCellsFrom(b[N],E-M,q-M,M,!0),q-=M,q===0&&(G--,q=O[G]),E-=M,E===0){N--;const B=Math.max(N,0);E=(0,m.getWrappedLineTrimmedLength)(b,B,this._cols)}}for(let M=0;M<b.length;M++)O[M]<s&&b[M].setCell(O[M],p);let D=A-F;for(;D-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+y)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+n-1)}if(w.length>0){const k=[],g=[];for(let G=0;G<this.lines.length;G++)g.push(this.lines.get(G));const b=this.lines.length;let T=b-1,I=0,O=w[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+y);let A=0;for(let G=Math.min(this.lines.maxLength-1,b+y-1);G>=0;G--)if(O&&O.start>T+A){for(let q=O.newLines.length-1;q>=0;q--)this.lines.set(G--,O.newLines[q]);G++,k.push({index:T+1,amount:O.newLines.length}),A+=O.newLines.length,O=w[++I]}else this.lines.set(G,g[T--]);let F=0;for(let G=k.length-1;G>=0;G--)k[G].index+=F,this.lines.onInsertEmitter.fire(k[G]),F+=k[G].amount;const W=Math.max(0,b+y-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(s,n,p=0,w){const y=this.lines.get(s);return y?y.translateToString(n,p,w):""}getWrappedRangeForLine(s){let n=s,p=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:n,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new u.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim(p=>{n.line-=p,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(p=>{n.line>=p.index&&(n.line+=p.amount)})),n.register(this.lines.onDelete(p=>{n.line>=p.index&&n.line<p.index+p.amount&&n.dispose(),n.line>p.index&&(n.line-=p.amount)})),n.register(n.onDispose(()=>this._removeMarker(n))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const d=c(3734),S=c(511),h=c(643),_=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let m=0;class x{constructor(u,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const n=o||S.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,n);this.length=u}get(u){const o=this._data[3*u+0],s=2097151&o;return[this._data[3*u+1],2097152&o?this._combined[u]:s?(0,_.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):s]}set(u,o){this._data[3*u+1]=o[h.CHAR_DATA_ATTR_INDEX],o[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=o[1],this._data[3*u+0]=2097152|u|o[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=o[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&o}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const o=this._data[3*u+0];return 2097152&o?this._combined[u]:2097151&o?(0,_.stringFromCodePoint)(2097151&o):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,o){return m=3*u,o.content=this._data[m+0],o.fg=this._data[m+1],o.bg=this._data[m+2],2097152&o.content&&(o.combinedData=this._combined[u]),268435456&o.bg&&(o.extended=this._extendedAttrs[u]),o}setCell(u,o){2097152&o.content&&(this._combined[u]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[u]=o.extended),this._data[3*u+0]=o.content,this._data[3*u+1]=o.fg,this._data[3*u+2]=o.bg}setCellFromCodepoint(u,o,s,n){268435456&n.bg&&(this._extendedAttrs[u]=n.extended),this._data[3*u+0]=o|s<<22,this._data[3*u+1]=n.fg,this._data[3*u+2]=n.bg}addCodepointToCell(u,o,s){let n=this._data[3*u+0];2097152&n?this._combined[u]+=(0,_.stringFromCodePoint)(o):2097151&n?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&n)+(0,_.stringFromCodePoint)(o),n&=-2097152,n|=2097152):n=o|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*u+0]=n}insertCells(u,o,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length-u){const n=new S.CellData;for(let p=this.length-u-o-1;p>=0;--p)this.setCell(u+o+p,this.loadCell(u+p,n));for(let p=0;p<o;++p)this.setCell(u+p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(u,o,s){if(u%=this.length,o<this.length-u){const n=new S.CellData;for(let p=0;p<this.length-u-o;++p)this.setCell(u+p,this.loadCell(u+o+p,n));for(let p=this.length-o;p<this.length;++p)this.setCell(p,s)}else for(let n=u;n<this.length;++n)this.setCell(n,s);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,s)}replaceCells(u,o,s,n=!1){if(n)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.isProtected(u)||this.setCell(u,s),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);u<o&&u<this.length;)this.setCell(u++,s)}resize(u,o){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<u;++n)this.setCell(n,o)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let w=0;w<n.length;w++){const y=parseInt(n[w],10);y>=u&&delete this._combined[y]}const p=Object.keys(this._extendedAttrs);for(let w=0;w<p.length;w++){const y=parseInt(p[w],10);y>=u&&delete this._extendedAttrs[y]}}return this.length=u,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,u);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const o in u._combined)this._combined[o]=u._combined[o];this._extendedAttrs={};for(const o in u._extendedAttrs)this._extendedAttrs[o]=u._extendedAttrs[o];this.isWrapped=u.isWrapped}clone(){const u=new x(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const o in this._combined)u._combined[o]=this._combined[o];for(const o in this._extendedAttrs)u._extendedAttrs[o]=this._extendedAttrs[o];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,o,s,n,p){const w=u._data;if(p)for(let k=n-1;k>=0;k--){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(o+k)+g];268435456&w[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}else for(let k=0;k<n;k++){for(let g=0;g<3;g++)this._data[3*(s+k)+g]=w[3*(o+k)+g];268435456&w[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}const y=Object.keys(u._combined);for(let k=0;k<y.length;k++){const g=parseInt(y[k],10);g>=o&&(this._combined[g-o+s]=u._combined[g])}}translateToString(u,o,s,n){o=o??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let p="";for(;o<s;){const w=this._data[3*o+0],y=2097151&w,k=2097152&w?this._combined[o]:y?(0,_.stringFromCodePoint)(y):h.WHITESPACE_CELL_CHAR;if(p+=k,n)for(let g=0;g<k.length;++g)n.push(o);o+=w>>22||1}return n&&n.push(o),p}}l.BufferLine=x},4841:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(c,d){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 d*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(C,l)=>{function c(d,S,h){if(S===d.length-1)return d[S].getTrimmedLength();const _=!d[S].hasContent(h-1)&&d[S].getWidth(h-1)===1,m=d[S+1].getWidth(0)===2;return _&&m?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(d,S,h,_,m){const x=[];for(let v=0;v<d.length-1;v++){let u=v,o=d.get(++u);if(!o.isWrapped)continue;const s=[d.get(v)];for(;u<d.length&&o.isWrapped;)s.push(o),o=d.get(++u);if(_>=v&&_<u){v+=s.length-1;continue}let n=0,p=c(s,n,S),w=1,y=0;for(;w<s.length;){const g=c(s,w,S),b=g-y,T=h-p,I=Math.min(b,T);s[n].copyCellsFrom(s[w],y,p,I,!1),p+=I,p===h&&(n++,p=0),y+=I,y===g&&(w++,y=0),p===0&&n!==0&&s[n-1].getWidth(h-1)===2&&(s[n].copyCellsFrom(s[n-1],h-1,p++,1,!1),s[n-1].setCell(h-1,m))}s[n].replaceCells(p,h,m);let k=0;for(let g=s.length-1;g>0&&(g>n||s[g].getTrimmedLength()===0);g--)k++;k>0&&(x.push(v+s.length-k),x.push(k)),v+=s.length-1}return x},l.reflowLargerCreateNewLayout=function(d,S){const h=[];let _=0,m=S[_],x=0;for(let v=0;v<d.length;v++)if(m===v){const u=S[++_];d.onDeleteEmitter.fire({index:v-x,amount:u}),v+=u-1,x+=u,m=S[++_]}else h.push(v);return{layout:h,countRemoved:x}},l.reflowLargerApplyNewLayout=function(d,S){const h=[];for(let _=0;_<S.length;_++)h.push(d.get(S[_]));for(let _=0;_<h.length;_++)d.set(_,h[_]);d.length=S.length},l.reflowSmallerGetNewLineLengths=function(d,S,h){const _=[],m=d.map((o,s)=>c(d,s,S)).reduce((o,s)=>o+s);let x=0,v=0,u=0;for(;u<m;){if(m-u<h){_.push(m-u);break}x+=h;const o=c(d,v,S);x>o&&(x-=o,v++);const s=d[v].getWidth(x-1)===2;s&&x--;const n=s?h-1:h;_.push(n),u+=n}return _},l.getWrappedLineTrimmedLength=c},5295:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const d=c(8460),S=c(844),h=c(9092);class _ extends S.Disposable{constructor(x,v){super(),this._optionsService=x,this._bufferService=v,this._onBufferActivate=this.register(new d.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,v){this._normal.resize(x,v),this._alt.resize(x,v),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}l.BufferSet=_},511:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const d=c(482),S=c(643),h=c(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const v=new _;return v.setFromCharData(x),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(x[S.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(x[S.CHAR_DATA_CHAR_INDEX].length===2){const u=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const o=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(u-55296)+o-56320+65536|x[S.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=x[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[S.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=x[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const d=c(8460),S=c(844);class h{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}l.Marker=h,h._nextId=1},7116:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(C,l)=>{var c,d,S;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
47
47
  `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(c||(l.C0=c={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(d||(l.C1=d={})),function(h){h.ST=`${c.ESC}\\`}(S||(l.C1_ESCAPED=S={}))},7399:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const d=c(2584),S={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:["'",'"']};l.evaluateKeyboardEvent=function(h,_,m,x){const v={type:0,cancel:!1,key:void 0},u=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(v.key=d.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=d.C0.ESC+"[Z";break}v.key=d.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,v.cancel=!0;break;case 27:v.key=d.C0.ESC,h.altKey&&(v.key=d.C0.ESC+d.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"D",v.key===d.C0.ESC+"[1;3D"&&(v.key=d.C0.ESC+(m?"b":"[1;5D"))):v.key=_?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"C",v.key===d.C0.ESC+"[1;3C"&&(v.key=d.C0.ESC+(m?"f":"[1;5C"))):v.key=_?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"A",m||v.key!==d.C0.ESC+"[1;3A"||(v.key=d.C0.ESC+"[1;5A")):v.key=_?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;u?(v.key=d.C0.ESC+"[1;"+(u+1)+"B",m||v.key!==d.C0.ESC+"[1;3B"||(v.key=d.C0.ESC+"[1;5B")):v.key=_?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=d.C0.ESC+"[2~");break;case 46:v.key=u?d.C0.ESC+"[3;"+(u+1)+"~":d.C0.ESC+"[3~";break;case 36:v.key=u?d.C0.ESC+"[1;"+(u+1)+"H":_?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:v.key=u?d.C0.ESC+"[1;"+(u+1)+"F":_?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=d.C0.ESC+"[5;"+(u+1)+"~":v.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=d.C0.ESC+"[6;"+(u+1)+"~":v.key=d.C0.ESC+"[6~";break;case 112:v.key=u?d.C0.ESC+"[1;"+(u+1)+"P":d.C0.ESC+"OP";break;case 113:v.key=u?d.C0.ESC+"[1;"+(u+1)+"Q":d.C0.ESC+"OQ";break;case 114:v.key=u?d.C0.ESC+"[1;"+(u+1)+"R":d.C0.ESC+"OR";break;case 115:v.key=u?d.C0.ESC+"[1;"+(u+1)+"S":d.C0.ESC+"OS";break;case 116:v.key=u?d.C0.ESC+"[15;"+(u+1)+"~":d.C0.ESC+"[15~";break;case 117:v.key=u?d.C0.ESC+"[17;"+(u+1)+"~":d.C0.ESC+"[17~";break;case 118:v.key=u?d.C0.ESC+"[18;"+(u+1)+"~":d.C0.ESC+"[18~";break;case 119:v.key=u?d.C0.ESC+"[19;"+(u+1)+"~":d.C0.ESC+"[19~";break;case 120:v.key=u?d.C0.ESC+"[20;"+(u+1)+"~":d.C0.ESC+"[20~";break;case 121:v.key=u?d.C0.ESC+"[21;"+(u+1)+"~":d.C0.ESC+"[21~";break;case 122:v.key=u?d.C0.ESC+"[23;"+(u+1)+"~":d.C0.ESC+"[23~";break;case 123:v.key=u?d.C0.ESC+"[24;"+(u+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(m&&!x||!h.altKey||h.metaKey)!m||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=d.C0.US),h.key==="@"&&(v.key=d.C0.NUL)):h.keyCode===65&&(v.type=1);else{const o=S[h.keyCode],s=o==null?void 0:o[h.shiftKey?1:0];if(s)v.key=d.C0.ESC+s;else if(h.keyCode>=65&&h.keyCode<=90){const n=h.ctrlKey?h.keyCode-64:h.keyCode+32;let p=String.fromCharCode(n);h.shiftKey&&(p=p.toUpperCase()),v.key=d.C0.ESC+p}else if(h.keyCode===32)v.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let n=h.code.slice(3,4);h.shiftKey||(n=n.toLowerCase()),v.key=d.C0.ESC+n,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=d.C0.DEL:h.keyCode===219?v.key=d.C0.ESC:h.keyCode===220?v.key=d.C0.FS:h.keyCode===221&&(v.key=d.C0.GS)}return v}},482:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,d=0,S=c.length){let h="";for(let _=d;_<S;++_){let m=c[_];m>65535?(m-=65536,h+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):h+=String.fromCharCode(m)}return h},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,d){const S=c.length;if(!S)return 0;let h=0,_=0;if(this._interim){const m=c.charCodeAt(_++);56320<=m&&m<=57343?d[h++]=1024*(this._interim-55296)+m-56320+65536:(d[h++]=this._interim,d[h++]=m),this._interim=0}for(let m=_;m<S;++m){const x=c.charCodeAt(m);if(55296<=x&&x<=56319){if(++m>=S)return this._interim=x,h;const v=c.charCodeAt(m);56320<=v&&v<=57343?d[h++]=1024*(x-55296)+v-56320+65536:(d[h++]=x,d[h++]=v)}else x!==65279&&(d[h++]=x)}return h}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,d){const S=c.length;if(!S)return 0;let h,_,m,x,v=0,u=0,o=0;if(this.interim[0]){let p=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let y,k=0;for(;(y=63&this.interim[++k])&&k<4;)w<<=6,w|=y;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=g-k;for(;o<b;){if(o>=S)return 0;if(y=c[o++],(192&y)!=128){o--,p=!0;break}this.interim[k++]=y,w<<=6,w|=63&y}p||(g===2?w<128?o--:d[v++]=w:g===3?w<2048||w>=55296&&w<=57343||w===65279||(d[v++]=w):w<65536||w>1114111||(d[v++]=w)),this.interim.fill(0)}const s=S-4;let n=o;for(;n<S;){for(;!(!(n<s)||128&(h=c[n])||128&(_=c[n+1])||128&(m=c[n+2])||128&(x=c[n+3]));)d[v++]=h,d[v++]=_,d[v++]=m,d[v++]=x,n+=4;if(h=c[n++],h<128)d[v++]=h;else if((224&h)==192){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(u=(31&h)<<6|63&_,u<128){n--;continue}d[v++]=u}else if((240&h)==224){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(m=c[n++],(192&m)!=128){n--;continue}if(u=(15&h)<<12|(63&_)<<6|63&m,u<2048||u>=55296&&u<=57343||u===65279)continue;d[v++]=u}else if((248&h)==240){if(n>=S)return this.interim[0]=h,v;if(_=c[n++],(192&_)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,v;if(m=c[n++],(192&m)!=128){n--;continue}if(n>=S)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=m,v;if(x=c[n++],(192&x)!=128){n--;continue}if(u=(7&h)<<18|(63&_)<<12|(63&m)<<6|63&x,u<65536||u>1114111)continue;d[v++]=u}}return v}}},225:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const d=c(1480),S=[[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]],h=[[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 _;l.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let m=0;m<S.length;++m)_.fill(0,S[m][0],S[m][1]+1)}}wcwidth(m){return m<32?0:m<127?1:m<65536?_[m]:function(x,v){let u,o=0,s=v.length-1;if(x<v[0][0]||x>v[s][1])return!1;for(;s>=o;)if(u=o+s>>1,x>v[u][1])o=u+1;else{if(!(x<v[u][0]))return!0;s=u-1}return!1}(m,h)?0:m>=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,x){let v=this.wcwidth(m),u=v===0&&x!==0;if(u){const o=d.UnicodeService.extractWidth(x);o===0?u=!1:o>v&&(v=o)}return d.UnicodeService.createPropertyValue(0,v,u)}}},5981:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const d=c(8460),S=c(844);class h extends S.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,x){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+=m.length,this._writeBuffer.push(m),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(x)}_innerWrite(m=0,x=!0){const v=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],o=this._action(u,x);if(o){const n=p=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(v,p);return void o.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-v>=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()}}l.WriteBuffer=h},5941:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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})$/,d=/^[\da-f]+$/;function S(h,_){const m=h.toString(16),x=m.length<2?"0"+m:m;switch(_){case 4:return m[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}l.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const m=c.exec(_);if(m){const x=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/x*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/x*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/x*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),d.exec(_)&&[3,6,9,12].includes(_.length))){const m=_.length/3,x=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(_.slice(m*v,m*v+m),16);x[v]=m===1?u<<4:m===2?u:m===3?u>>4:u>>8}return x}},l.toRgbString=function(h,_=16){const[m,x,v]=h;return`rgb:${S(m,_)}/${S(x,_)}/${S(v,_)}`}},5770:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const d=c(482),S=c(8742),h=c(5770),_=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(x,v){this._handlers[x]===void 0&&(this._handlers[x]=[]);const u=this._handlers[x];return u.push(v),{dispose:()=>{const o=u.indexOf(v);o!==-1&&u.splice(o,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(x,v){if(this.reset(),this._ident=x,this._active=this._handlers[x]||_,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(x,v,u){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(x,v,u);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(x,v,u))}unhook(x,v=!0){if(this._active.length){let u=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,u=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;o>=0&&(u=this._active[o].unhook(x),u!==!0);o--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,u;o--}for(;o>=0;o--)if(u=this._active[o].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",x);this._active=_,this._ident=0}};const m=new S.Params;m.addParam(0),l.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=m,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():m,this._data="",this._hitLimit=!1}put(x,v,u){this._hitLimit||(this._data+=(0,d.utf32ToString)(x,v,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let v=!1;if(this._hitLimit)v=!1;else if(x&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=m,this._data="",this._hitLimit=!1,u));return this._params=m,this._data="",this._hitLimit=!1,v}}},2015:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const d=c(844),S=c(8742),h=c(6242),_=c(6351);class m{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,n,p){this.table[s<<8|o]=n<<4|p}addMany(o,s,n,p){for(let w=0;w<o.length;w++)this.table[s<<8|o[w]]=n<<4|p}}l.TransitionTable=m;const x=160;l.VT500_TRANSITION_TABLE=function(){const u=new m(4095),o=Array.apply(null,Array(256)).map((k,g)=>g),s=(k,g)=>o.slice(k,g),n=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const w=s(0,14);let y;for(y in u.setDefault(1,0),u.addMany(n,0,2,0),w)u.addMany([24,26,153,154],y,3,0),u.addMany(s(128,144),y,3,0),u.addMany(s(144,152),y,3,0),u.add(156,y,0,0),u.add(27,y,11,1),u.add(157,y,4,8),u.addMany([152,158,159],y,0,7),u.add(155,y,11,3),u.add(144,y,11,9);return u.addMany(p,0,3,0),u.addMany(p,1,3,1),u.add(127,1,0,1),u.addMany(p,8,0,8),u.addMany(p,3,3,3),u.add(127,3,0,3),u.addMany(p,4,3,4),u.add(127,4,0,4),u.addMany(p,6,3,6),u.addMany(p,5,3,5),u.add(127,5,0,5),u.addMany(p,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(n,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(n,7,0,7),u.addMany(p,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(p,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(p,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(p,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(p,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(p,13,13,13),u.addMany(n,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(x,0,2,0),u.add(x,8,5,8),u.add(x,6,0,6),u.add(x,11,0,11),u.add(x,13,13,13),u}();class v extends d.Disposable{constructor(o=l.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new S.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let n=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=o.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<o.intermediates.length;++w){const y=o.intermediates.charCodeAt(w);if(32>y||y>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=y}}if(o.final.length!==1)throw new Error("final must be a single byte");const p=o.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=p,n}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const n=this._identifier(o,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const p=this._escHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const n=this._identifier(o);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const p=this._csiHandlers[n];return p.push(s),{dispose:()=>{const w=p.indexOf(s);w!==-1&&p.splice(w,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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(o,s,n,p,w){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=p,this._parseStack.chunkPos=w}parse(o,s,n){let p,w=0,y=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(n===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 b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&b>-1){for(;b>=0&&(p=g[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(n===!1&&b>-1){for(;b>=0&&(p=g[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(w=o[this._parseStack.chunkPos],p=this._dcsParser.unhook(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=o[this._parseStack.chunkPos],p=this._oscParser.end(w!==24&&w!==26,n),p)return p;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=k;g<s;++g){switch(w=o[g],y=this._transitions.table[this.currentState<<8|(w<160?w:x)],y>>4){case 2:for(let A=g+1;;++A){if(A>=s||(w=o[A])<32||w>126&&w<x){this._printHandler(o,g,A),g=A-1;break}if(++A>=s||(w=o[A])<32||w>126&&w<x){this._printHandler(o,g,A),g=A-1;break}if(++A>=s||(w=o[A])<32||w>126&&w<x){this._printHandler(o,g,A),g=A-1;break}if(++A>=s||(w=o[A])<32||w>126&&w<x){this._printHandler(o,g,A),g=A-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|w];let T=b?b.length-1:-1;for(;T>=0&&(p=b[T](this._params),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(3,b,T,y,g),p;T<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++g<s&&(w=o[g])>47&&w<60);g--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const I=this._escHandlers[this._collect<<8|w];let O=I?I.length-1:-1;for(;O>=0&&(p=I[O](),p!==!0);O--)if(p instanceof Promise)return this._preserveStack(4,I,O,y,g),p;O<0&&this._escHandlerFb(this._collect<<8|w),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|w,this._params);break;case 13:for(let A=g+1;;++A)if(A>=s||(w=o[A])===24||w===26||w===27||w>127&&w<x){this._dcsParser.put(o,g,A),g=A-1;break}break;case 14:if(p=this._dcsParser.unhook(w!==24&&w!==26),p)return this._preserveStack(6,[],0,y,g),p;w===27&&(y|=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 A=g+1;;A++)if(A>=s||(w=o[A])<32||w>127&&w<x){this._oscParser.put(o,g,A),g=A-1;break}break;case 6:if(p=this._oscParser.end(w!==24&&w!==26),p)return this._preserveStack(5,[],0,y,g),p;w===27&&(y|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&y}}}l.EscapeSequenceParser=v},6242:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const d=c(5770),S=c(482),h=[];l.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,m){this._handlers[_]===void 0&&(this._handlers[_]=[]);const x=this._handlers[_];return x.push(m),{dispose:()=>{const v=x.indexOf(m);v!==-1&&x.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,m,x){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,m,x);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(_,m,x))}start(){this.reset(),this._state=1}put(_,m,x){if(this._state!==3){if(this._state===1)for(;m<x;){const v=_[m++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&x-m>0&&this._put(_,m,x)}}end(_,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,x=m,u=this._stack.fallThrough,this._stack.paused=!1),!u&&x===!1){for(;v>=0&&(x=this._active[v].end(_),x!==!0);v--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,x;v--}for(;v>=0;v--)if(x=this._active[v].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,m,x){this._hitLimit||(this._data+=(0,S.utf32ToString)(_,m,x),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let m=!1;if(this._hitLimit)m=!1;else if(_&&(m=this._handler(this._data),m instanceof Promise))return m.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,m}}},8742:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class d{static fromArray(h){const _=new d;if(!h.length)return _;for(let m=Array.isArray(h[0])?1:0;m<h.length;++m){const x=h[m];if(Array.isArray(x))for(let v=0;v<x.length;++v)_.addSubParam(x[v]);else _.addParam(x)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const m=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-m>0&&h.push(Array.prototype.slice.call(this._subParams,m,x))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,m=255&this._subParamsIdx[h];return m-_>0?this._subParams.subarray(_,m):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const m=this._subParamsIdx[_]>>8,x=255&this._subParamsIdx[_];x-m>0&&(h[_]=this._subParams.slice(m,x))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,x=m[_-1];m[_-1]=~x?Math.min(10*x+h,c):h}}l.Params=d},5741:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,d){const S={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(S),d.dispose=()=>this._wrappedAddonDispose(S),d.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let d=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===c){d=S;break}if(d===-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(d,1)}}},8771:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const d=c(3785),S=c(511);l.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new d.BufferLineApiView(_)}getNullCell(){return new S.CellData}}},3785:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const d=c(511);l.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,h){if(!(S<0||S>=this._line.length))return h?(this._line.loadCell(S,h),h):this._line.loadCell(S,new d.CellData)}translateToString(S,h,_){return this._line.translateToString(S,h,_)}}},8285:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const d=c(8771),S=c(8460),h=c(844);class _ extends h.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new S.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}l.BufferNamespaceApi=_},7975:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,d){return this._core.registerCsiHandler(c,S=>d(S.toArray()))}addCsiHandler(c,d){return this.registerCsiHandler(c,d)}registerDcsHandler(c,d){return this._core.registerDcsHandler(c,(S,h)=>d(S,h.toArray()))}addDcsHandler(c,d){return this.registerDcsHandler(c,d)}registerEscHandler(c,d){return this._core.registerEscHandler(c,d)}addEscHandler(c,d){return this.registerEscHandler(c,d)}registerOscHandler(c,d){return this._core.registerOscHandler(c,d)}addOscHandler(c,d){return this.registerOscHandler(c,d)}}},7090:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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(C,l,c){var d=this&&this.__decorate||function(u,o,s,n){var p,w=arguments.length,y=w<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,o,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(o,s,y):p(o,s))||y);return w>3&&y&&Object.defineProperty(o,s,y),y},S=this&&this.__param||function(u,o){return function(s,n){o(s,n,u)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const h=c(8460),_=c(844),m=c(5295),x=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let v=l.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(u,this))}resize(u,o){this.cols=u,this.rows=o,this.buffers.resize(u,o),this._onResize.fire({cols:u,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,o=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===u.fg&&n.getBg(0)===u.bg||(n=s.getBlankLine(u,o),this._cachedBlankLine=n),n.isWrapped=o;const p=s.ybase+s.scrollTop,w=s.ybase+s.scrollBottom;if(s.scrollTop===0){const y=s.lines.isFull;w===s.lines.length-1?y?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(w+1,0,n.clone()),y?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const y=w-p+1;s.lines.shiftElements(p+1,y-1,-1),s.lines.set(w,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,o,s){const n=this.buffer;if(u<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else u+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const p=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+u,n.ybase),0),p!==n.ydisp&&(o||this._onScroll.fire(n.ydisp))}};l.BufferService=v=d([S(0,x.IOptionsService)],v)},7994:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.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,d){this._charsets[c]=d,this.glevel===c&&(this.charset=d)}}},1753:function(C,l,c){var d=this&&this.__decorate||function(n,p,w,y){var k,g=arguments.length,b=g<3?p:y===null?y=Object.getOwnPropertyDescriptor(p,w):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(n,p,w,y);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(b=(g<3?k(b):g>3?k(p,w,b):k(p,w))||b);return g>3&&b&&Object.defineProperty(p,w,b),b},S=this&&this.__param||function(n,p){return function(w,y){p(w,y,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const h=c(2585),_=c(8460),m=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function v(n,p){let w=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(w|=64,w|=n.action):(w|=3&n.button,4&n.button&&(w|=64),8&n.button&&(w|=128),n.action===32?w|=32:n.action!==0||p||(w|=3)),w}const u=String.fromCharCode,o={DEFAULT:n=>{const p=[v(n,!1)+32,n.col+32,n.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${u(p[0])}${u(p[1])}${u(p[2])}`},SGR:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.col};${n.row}${p}`},SGR_PIXELS:n=>{const p=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.x};${n.y}${p}`}};let s=l.CoreMouseService=class extends m.Disposable{constructor(n,p){super(),this._bufferService=n,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const w of Object.keys(x))this.addProtocol(w,x[w]);for(const w of Object.keys(o))this.addEncoding(w,o[w]);this.reset()}addProtocol(n,p){this._protocols[n]=p}addEncoding(n,p){this._encodings[n]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const p=this._encodings[this._activeEncoding](n);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,p,w){if(w){if(n.x!==p.x||n.y!==p.y)return!1}else if(n.col!==p.col||n.row!==p.row)return!1;return n.button===p.button&&n.action===p.action&&n.ctrl===p.ctrl&&n.alt===p.alt&&n.shift===p.shift}};l.CoreMouseService=s=d([S(0,h.IBufferService),S(1,h.ICoreService)],s)},6975:function(C,l,c){var d=this&&this.__decorate||function(s,n,p,w){var y,k=arguments.length,g=k<3?n:w===null?w=Object.getOwnPropertyDescriptor(n,p):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,p,w);else for(var b=s.length-1;b>=0;b--)(y=s[b])&&(g=(k<3?y(g):k>3?y(n,p,g):y(n,p))||g);return k>3&&g&&Object.defineProperty(n,p,g),g},S=this&&this.__param||function(s,n){return function(p,w){n(p,w,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const h=c(1439),_=c(8460),m=c(844),x=c(2585),v=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=l.CoreService=class extends m.Disposable{constructor(s,n,p){super(),this._bufferService=s,this._logService=n,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(w=>w.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(n=>n.charCodeAt(0))),this._onBinary.fire(s))}};l.CoreService=o=d([S(0,x.IBufferService),S(1,x.ILogService),S(2,x.IOptionsService)],o)},9074:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const d=c(8055),S=c(8460),h=c(844),_=c(6106);let m=0,x=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new u(s);if(n){const p=n.marker.onDispose(()=>n.dispose());n.onDispose(()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),p.dispose())}),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,p){let w=0,y=0;for(const k of this._decorations.getKeyIterator(n))w=k.options.x??0,y=w+(k.options.width??1),s>=w&&s<y&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,n,p,w){this._decorations.forEachByKey(n,y=>{m=y.options.x??0,x=m+(y.options.width??1),s>=m&&s<x&&(!p||(y.options.layer??"bottom")===p)&&w(y)})}}l.DecorationService=v;class u extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const d=c(2585),S=c(8343);class h{constructor(...m){this._entries=new Map;for(const[x,v]of m)this.set(x,v)}set(m,x){const v=this._entries.get(m);return this._entries.set(m,x),v}forEach(m){for(const[x,v]of this._entries.entries())m(x,v)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}l.ServiceCollection=h,l.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(_,m){this._services.set(_,m)}getService(_){return this._services.get(_)}createInstance(_,...m){const x=(0,S.getServiceDependencies)(_).sort((o,s)=>o.index-s.index),v=[];for(const o of x){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${o.id}.`);v.push(s)}const u=x.length>0?x[0].index:m.length;if(m.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${m.length} static arguments`);return new _(...m,...v)}}},7866:function(C,l,c){var d=this&&this.__decorate||function(u,o,s,n){var p,w=arguments.length,y=w<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,o,s,n);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(y=(w<3?p(y):w>3?p(o,s,y):p(o,s))||y);return w>3&&y&&Object.defineProperty(o,s,y),y},S=this&&this.__param||function(u,o){return function(s,n){o(s,n,u)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const h=c(844),_=c(2585),m={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let x,v=l.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let o=0;o<u.length;o++)typeof u[o]=="function"&&(u[o]=u[o]())}_log(u,o,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(u,...o){var s;this._logLevel<=_.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,o)}debug(u,...o){var s;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,o)}info(u,...o){var s;this._logLevel<=_.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,o)}warn(u,...o){var s;this._logLevel<=_.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,o)}error(u,...o){var s;this._logLevel<=_.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,o)}};l.LogService=v=d([S(0,_.IOptionsService)],v),l.setTraceLogger=function(u){x=u},l.traceCall=function(u,o,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(...p){if(x.logLevel!==_.LogLevelEnum.TRACE)return n.apply(this,p);x.trace(`GlyphRenderer#${n.name}(${p.map(y=>JSON.stringify(y)).join(", ")})`);const w=n.apply(this,p);return x.trace(`GlyphRenderer#${n.name} return`,w),w}}},7302:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const d=c(8460),S=c(844),h=c(6114);l.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends S.Disposable{constructor(v){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...l.DEFAULT_OPTIONS};for(const o in v)if(o in u)try{const s=v[o];u[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,S.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,u){return this.onOptionChange(o=>{o===v&&u(this.rawOptions[v])})}onMultipleOptionChange(v,u){return this.onOptionChange(o=>{v.indexOf(o)!==-1&&u()})}_setupOptions(){const v=o=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},u=(o,s)=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:v.bind(this,o),set:u.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(v,u){switch(v){case"cursorStyle":if(u||(u=l.DEFAULT_OPTIONS[v]),!function(o){return o==="block"||o==="underline"||o==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${v}`);break;case"wordSeparator":u||(u=l.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:l.DEFAULT_OPTIONS[v];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${v} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${v} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}l.OptionsService=m},2660:function(C,l,c){var d=this&&this.__decorate||function(m,x,v,u){var o,s=arguments.length,n=s<3?x:u===null?u=Object.getOwnPropertyDescriptor(x,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(m,x,v,u);else for(var p=m.length-1;p>=0;p--)(o=m[p])&&(n=(s<3?o(n):s>3?o(x,v,n):o(x,v))||n);return s>3&&n&&Object.defineProperty(x,v,n),n},S=this&&this.__param||function(m,x){return function(v,u){x(v,u,m)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const h=c(2585);let _=l.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const x=this._bufferService.buffer;if(m.id===void 0){const p=x.addMarker(x.ybase+x.y),w={data:m,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(w,p)),this._dataByLinkId.set(w.id,w),w.id}const v=m,u=this._getEntryIdKey(v),o=this._entriesWithId.get(u);if(o)return this.addLineToLink(o.id,x.ybase+x.y),o.id;const s=x.addMarker(x.ybase+x.y),n={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(n,s)),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(m,x){const v=this._dataByLinkId.get(m);if(v&&v.lines.every(u=>u.line!==x)){const u=this._bufferService.buffer.addMarker(x);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(m){var x;return(x=this._dataByLinkId.get(m))==null?void 0:x.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,x){const v=m.lines.indexOf(x);v!==-1&&(m.lines.splice(v,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};l.OscLinkService=_=d([S(0,h.IBufferService)],_)},8343:(C,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",d="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(S){return S[d]||[]},l.createDecorator=function(S){if(l.serviceRegistry.has(S))return l.serviceRegistry.get(S);const h=function(_,m,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,u,o){u[c]===u?u[d].push({id:v,index:o}):(u[d]=[{id:v,index:o}],u[c]=u)})(h,_,x)};return h.toString=()=>S,l.serviceRegistry.set(S,h),h}},2585:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const d=c(8343);var S;l.IBufferService=(0,d.createDecorator)("BufferService"),l.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),l.ICoreService=(0,d.createDecorator)("CoreService"),l.ICharsetService=(0,d.createDecorator)("CharsetService"),l.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(S||(l.LogLevelEnum=S={})),l.ILogService=(0,d.createDecorator)("LogService"),l.IOptionsService=(0,d.createDecorator)("OptionsService"),l.IOscLinkService=(0,d.createDecorator)("OscLinkService"),l.IUnicodeService=(0,d.createDecorator)("UnicodeService"),l.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(C,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const d=c(8460),S=c(225);class h{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,x,v=!1){return(16777215&m)<<3|(3&x)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const m=new S.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let x=0,v=0;const u=m.length;for(let o=0;o<u;++o){let s=m.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=u)return x+this.wcwidth(s);const w=m.charCodeAt(o);56320<=w&&w<=57343?s=1024*(s-55296)+w-56320+65536:x+=this.wcwidth(w)}const n=this.charProperties(s,v);let p=h.extractWidth(n);h.extractShouldJoin(n)&&(p-=h.extractWidth(v)),x+=p,v=n}return x}charProperties(m,x){return this._activeProvider.charProperties(m,x)}}l.UnicodeService=h}},i={};function a(C){var l=i[C];if(l!==void 0)return l.exports;var c=i[C]={exports:{}};return r[C].call(c.exports,c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.Terminal=void 0;const l=a(9042),c=a(3236),d=a(844),S=a(5741),h=a(8285),_=a(7975),m=a(7090),x=["cols","rows"];class v extends d.Disposable{constructor(o){super(),this._core=this.register(new c.Terminal(o)),this._addonManager=this.register(new S.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],n=(p,w)=>{this._checkReadonlyOptions(p),this._core.options[p]=w};for(const p in this._core.options){const w={get:s.bind(this,p),set:n.bind(this,p)};Object.defineProperty(this._publicOptions,p,w)}}_checkReadonlyOptions(o){if(x.includes(o))throw new Error(`Option "${o}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,s=!0){this._core.input(o,s)}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,n){this._verifyIntegers(o,s,n),this._core.select(o,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
48
- `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return l}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}C.Terminal=v})(),f})())})(Pu);var xf=Pu.exports,Ou={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const f=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(f._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,f=a._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),h=c-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),_=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(h/f.css.cell.height))}}}})(),r})())})(Ou);var kf=Ou.exports,ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,l)=>{function c(S){try{const h=new URL(S),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return S.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(S,h,_,m={}){this._terminal=S,this._regex=h,this._handler=_,this._options=m}provideLinks(S,h){const _=d.computeLink(S,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(S){return S.map(h=>(h.leave=this._options.leave,h.hover=(_,m)=>{if(this._options.hover){const{range:x}=h;this._options.hover(_,m,x)}},h))}};class d{static computeLink(h,_,m,x){const v=new RegExp(_.source,(_.flags||"")+"g"),[u,o]=d._getWindowedLineStrings(h-1,m),s=u.join("");let n;const p=[];for(;n=v.exec(s);){const w=n[0];if(!c(w))continue;const[y,k]=d._mapStrIdx(m,o,0,n.index),[g,b]=d._mapStrIdx(m,y,k,w.length);if(y===-1||k===-1||g===-1||b===-1)continue;const T={start:{x:k+1,y:y+1},end:{x:b,y:g+1}};p.push({range:T,text:w,activate:x})}return p}static _getWindowedLineStrings(h,_){let m,x=h,v=h,u=0,o="";const s=[];if(m=_.buffer.active.getLine(h)){const n=m.translateToString(!0);if(m.isWrapped&&n[0]!==" "){for(u=0;(m=_.buffer.active.getLine(--x))&&u<2048&&(o=m.translateToString(!0),u+=o.length,s.push(o),m.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(n),u=0;(m=_.buffer.active.getLine(++v))&&m.isWrapped&&u<2048&&(o=m.translateToString(!0),u+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,x]}static _mapStrIdx(h,_,m,x){const v=h.buffer.active,u=v.getNullCell();let o=m;for(;x;){const s=v.getLine(_);if(!s)return[-1,-1];for(let n=o;n<s.length;++n){s.getCell(n,u);const p=u.getChars();if(u.getWidth()&&(x-=p.length||1,n===s.length-1&&p==="")){const w=v.getLine(_+1);w&&w.isWrapped&&(w.getCell(0,u),u.getWidth()===2&&(x+=1))}if(x<0)return[_,n]}_++,o=0}return[_,o]}}l.LinkComputer=d}},i={};function a(C){var l=i[C];if(l!==void 0)return l.exports;var c=i[C]={exports:{}};return r[C](c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(S,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(S=d,h={}){this._handler=S,this._options=h}activate(S){this._terminal=S;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var S;(S=this._linkProvider)==null||S.dispose()}}})(),f})())})(ju);var bf=ju.exports;function Sa(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ef(e){if(!e)return"0s";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return`${t}h ${r}m`}function Rf({agent:e,subscribeTerminal:t,injectMessage:r,sendRaw:i,openAgentTerminal:a,returnAgentTerminal:f,onClose:C}){const l=X.useRef(null),c=X.useRef(null),[d,S]=X.useState(420),[h,_]=X.useState(""),m=X.useRef(!1),x=o=>{const s=o.clientY,n=d;m.current=!0;const p=y=>{S(Math.max(180,Math.min(window.innerHeight*.8,n-(y.clientY-s))))},w=()=>{m.current=!1,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",w)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",w)};X.useEffect(()=>{if(!l.current||!e)return;const o=e.color||"#F5A623",s=new xf.Terminal({theme:{background:"#030507",foreground:"#E8E8F0",cursor:"#F5A623",selectionBackground:o+"40"},fontFamily:"'DM Mono', monospace",fontSize:12,lineHeight:1.3,cursorBlink:!0,scrollback:5e3}),n=new kf.FitAddon,p=new bf.WebLinksAddon;s.loadAddon(n),s.loadAddon(p),s.open(l.current),requestAnimationFrame(()=>{var b;try{n.fit()}catch{}const g=(b=document.activeElement)==null?void 0:b.tagName;(!g||g==="BODY"||g==="DIV")&&s.focus()}),c.current=s,s.onData(g=>{i(e.id,g)});const w=t(e.id,g=>{s.write(g)}),y=new ResizeObserver(()=>{try{n.fit()}catch{}});y.observe(l.current);const k=g=>{g.key==="Escape"&&C()};return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k),y.disconnect(),w(),s.dispose(),c.current=null}},[e==null?void 0:e.id]);const v=o=>{o.key==="Enter"&&h.trim()&&!e.bridgeActive&&(r(e.id,h.trim()),_(""))};if(!e)return null;const u=e.color||"#F5A623";return L.jsxs("div",{style:{height:d,display:"flex",flexDirection:"column",background:"var(--bg1)",borderTop:"1px solid var(--border)"},children:[L.jsx("div",{onMouseDown:x,style:{height:6,cursor:"ns-resize",background:"transparent",borderTop:"2px solid var(--border)",flexShrink:0}}),L.jsxs("div",{style:{height:36,minHeight:36,display:"flex",alignItems:"center",gap:10,padding:"0 12px",borderBottom:"1px solid var(--border)",fontSize:11},children:[L.jsx("button",{onClick:C,style:{color:"var(--text2)",fontSize:11,padding:"2px 6px",background:"var(--bg2)",borderRadius:3,border:"1px solid var(--border)"},children:"ESC"}),L.jsx("span",{style:{color:u,fontSize:14},children:e.icon}),L.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:13},children:e.name}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e.status==="active"?"var(--green)":e.status==="blocked"?"var(--red)":"var(--text3)",animation:e.status==="active"?"pulse 2s infinite":"none"}}),L.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"center",gap:24,color:"var(--text2)"},children:[L.jsxs("span",{children:["Task: ",L.jsx("span",{style:{color:u},children:e.currentTask||"—"})]}),L.jsxs("span",{children:["Tokens: ",Sa(e.tokens||0)," / 200k"]}),L.jsxs("span",{children:["Total: ",Sa(e.aggregatedTokens||0)]}),L.jsxs("span",{children:["Uptime: ",Ef(e.uptime)]})]}),e.status==="active"&&!e.bridgeActive&&L.jsx("button",{onClick:()=>a(e.id),style:{color:"var(--text2)",fontSize:11,padding:"3px 8px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4},children:"Open in Terminal"}),e.bridgeActive&&L.jsx("button",{onClick:()=>f(e.id),style:{color:"var(--amber)",fontSize:11,padding:"3px 8px",background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4},children:"Return to Ban Kan"}),L.jsx("button",{onClick:C,style:{color:"var(--text3)",fontSize:14},children:"✕"})]}),L.jsx("div",{ref:l,style:{flex:1,overflow:"hidden",padding:4}}),L.jsxs("div",{style:{padding:"6px 12px",borderTop:"1px solid var(--border)"},children:[L.jsx("input",{type:"text",value:h,placeholder:e.bridgeActive?"Input moved to Terminal.app while bridged...":"Send message to agent...",disabled:e.status!=="active"||e.bridgeActive,onChange:o=>_(o.target.value),onKeyDown:v,style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 10px",fontSize:12,caretColor:u,opacity:e.status==="active"&&!e.bridgeActive?1:.55}}),e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Terminal.app currently owns input for this live session. Type `/return` there or use the button above to hand control back."}),e.status!=="active"&&!e.bridgeActive&&L.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Agent input is unavailable because the session is not running. Resolve the blocker, then retry the task."})]})]})}function Lf({initialPath:e,onSelect:t,onClose:r}){const[i,a]=X.useState(e||""),[f,C]=X.useState(e||""),[l,c]=X.useState([]),[d,S]=X.useState(null),[h,_]=X.useState(null),[m,x]=X.useState(!1),v=async n=>{x(!0),_(null);try{const p=n?`/api/browse-dir?path=${encodeURIComponent(n)}`:"/api/browse-dir",w=await fetch(p);if(!w.ok){const k=await w.json();_(k.error||"Failed to browse directory"),x(!1);return}const y=await w.json();a(y.current),C(y.current),S(y.parent),c(y.dirs)}catch{_("Failed to connect to server")}x(!1)};X.useEffect(()=>{v(e||"")},[]);const u=n=>{v(i+"/"+n)},o=()=>{d&&v(d)},s=n=>{n.key==="Enter"&&v(f)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200},children:L.jsxs("div",{onClick:n=>n.stopPropagation(),style:{width:500,maxHeight:"70vh",display:"flex",flexDirection:"column",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:16,marginBottom:16},children:"Select Directory"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[L.jsx("input",{type:"text",value:f,onChange:n=>C(n.target.value),onKeyDown:s,style:{flex:1,padding:"6px 10px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"}}),L.jsx("button",{onClick:()=>v(f),style:{padding:"6px 12px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Go"})]}),h&&L.jsx("div",{style:{color:"var(--red)",fontSize:11,marginBottom:8},children:h}),L.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:200,border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:m?L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"Loading..."}):L.jsxs(L.Fragment,{children:[d&&L.jsxs("div",{onClick:o,style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text2)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:n=>n.currentTarget.style.background="var(--bg2)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{fontSize:14},children:".."}),L.jsx("span",{style:{color:"var(--text3)"},children:"(parent)"})]}),l.length===0&&!d&&L.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"No subdirectories"}),l.map(n=>L.jsxs("div",{onClick:()=>u(n),style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:p=>p.currentTarget.style.background="var(--bg2)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[L.jsx("span",{style:{color:"var(--amber)"},children:"📁"}),n]},n))]})}),L.jsxs("div",{style:{marginTop:12,fontSize:11,color:"var(--text3)"},children:["Selected: ",L.jsx("span",{style:{color:"var(--text)"},children:i})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>t(i),style:{padding:"8px 20px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Select"})]})]})})}const Kr={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ya={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function Df(e,t=120){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function Tf(e=0){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e||0)}function Af(e,t){if(!e||!t)return null;const r=new Date(e).getTime(),i=new Date(t).getTime();if(Number.isNaN(r)||Number.isNaN(i)||i<r)return null;const a=Math.max(1,Math.floor((i-r)/6e4)),f=Math.floor(a/(60*24)),C=Math.floor(a%(60*24)/60),l=a%60;return f>0?C>0?`${f}d ${C}h`:`${f}d`:C>0?l>0?`${C}h ${l}m`:`${C}h`:`${l}m`}function Mf({task:e,repos:t=[],onClose:r,onApprove:i,onReject:a,onPause:f,onResume:C,onEdit:l,onAbort:c,onReset:d,onRetry:S,onDelete:h,onOpenWorkspace:_}){const[m,x]=X.useState(!1),[v,u]=X.useState(e.title),[o,s]=X.useState(e.description||""),[n,p]=X.useState(e.priority),[w,y]=X.useState(e.repoPath||""),[k,g]=X.useState(!1),[b,T]=X.useState(!1),[I,O]=X.useState(!1),[A,F]=X.useState(""),[W,G]=X.useState(!1),[q,N]=X.useState({}),E=!["done","paused","aborted"].includes(e.status),D=e.status==="paused",M=!["done","aborted"].includes(e.status),B=e.status!=="done",j=e.status==="blocked",$=!!(e.workspacePath&&_),U=Af(e.startedAt,e.completedAt),Q=Array.isArray(e.sessionHistory)?e.sessionHistory.slice().reverse():[],P=()=>{l(e.id,{title:v,description:o,priority:n,repoPath:w}),x(!1)},R=()=>{A.trim()&&(a(e.id,A.trim()),O(!1),F(""))},K=z=>{N(J=>({...J,[z]:!J[z]}))},H={fontSize:10,fontWeight:600,color:"var(--text3)",letterSpacing:1,textTransform:"uppercase",marginBottom:4},Y={fontSize:12,color:"var(--text)",marginBottom:14};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:z=>z.stopPropagation(),style:{width:540,maxHeight:"80vh",overflowY:"auto",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text3)"},children:e.id}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:10,background:(ya[e.status]||"var(--text3)")+"20",color:ya[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")})]}),L.jsx("button",{onClick:r,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),m?L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("input",{type:"text",value:v,onChange:z=>u(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("textarea",{value:o,onChange:z=>s(z.target.value),rows:3,style:{width:"100%",padding:"6px 10px",fontSize:12,resize:"vertical"}})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(z=>L.jsx("button",{onClick:()=>p(z),style:{padding:"4px 10px",borderRadius:4,fontSize:11,border:`1px solid ${n===z?Kr[z]:"var(--border)"}`,background:n===z?Kr[z]+"20":"transparent",color:n===z?Kr[z]:"var(--text2)",textTransform:"capitalize"},children:z},z))})]}),t.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsxs("select",{value:w,onChange:z=>y(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12},children:[L.jsx("option",{value:"",children:"No repository"}),t.map(z=>L.jsx("option",{value:z,children:z},z))]})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:()=>x(!1),style:{padding:"6px 14px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:P,style:{padding:"6px 16px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Save"})]})]}):L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Title"}),L.jsx("div",{style:{...Y,fontSize:14},children:e.title})]}),L.jsxs("div",{style:{display:"flex",gap:20,marginBottom:14},children:[L.jsxs("div",{children:[L.jsx("div",{style:H,children:"Priority"}),L.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:11,background:(Kr[e.priority]||"var(--text3)")+"20",color:Kr[e.priority]||"var(--text3)",textTransform:"capitalize"},children:e.priority})]}),e.repoPath&&L.jsxs("div",{style:{flex:1},children:[L.jsx("div",{style:H,children:"Repository"}),L.jsx("div",{style:{fontSize:11,color:"var(--text2)",wordBreak:"break-all"},children:e.repoPath})]})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Tokens"}),L.jsx("div",{style:{...Y,fontFamily:"var(--font-mono)"},children:Tf(e.totalTokens||0)})]}),e.description&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Description"}),L.jsx("div",{style:Y,children:e.description})]}),e.branch&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Branch"}),L.jsx("div",{style:{fontSize:12,color:"var(--steel2)"},children:e.branch})]}),L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Review Cycles"}),L.jsxs("div",{style:{fontSize:12,color:"var(--text2)"},children:[e.reviewCycleCount||0," / 3"]})]}),U&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Total Time"}),L.jsx("div",{style:{fontSize:12,color:"var(--text2)"},children:U})]}),e.prUrl&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Pull Request"}),L.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,color:"#60A5FA"},children:e.prUrl})]}),e.blockedReason&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Blocked Reason"}),L.jsx("div",{title:e.blockedReason,style:{fontSize:12,color:"var(--red)",lineHeight:1.5},children:Df(e.blockedReason)})]}),e.plan&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>g(!k),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[k?"▼":"▶"," Plan"]}),k&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:e.plan})]}),e.review&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsxs("div",{onClick:()=>T(!b),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[b?"▼":"▶"," Review"]}),b&&L.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:e.review})]}),Q.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"Completed Sessions"}),L.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",overflow:"hidden"},children:Q.map((z,J)=>{const ne=!!q[z.id];return L.jsxs("div",{style:{borderBottom:J<Q.length-1?"1px solid var(--border)":"none"},children:[L.jsxs("button",{onClick:()=>K(z.id),style:{width:"100%",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,background:"transparent",color:"var(--text)",fontSize:11,textAlign:"left"},children:[L.jsxs("span",{children:[ne?"▼":"▶"," ",z.agentName," · ",z.stage," · ",z.outcome]}),L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.finishedAt).toLocaleString()})]}),ne&&L.jsx("pre",{style:{margin:0,padding:10,fontSize:11,color:"var(--text2)",background:"var(--bg1)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:220,overflowY:"auto",borderTop:"1px solid var(--border)"},children:z.transcript||"[No transcript captured]"})]},z.id||J)})})]}),e.log&&e.log.length>0&&L.jsxs("div",{style:{marginBottom:14},children:[L.jsx("div",{style:H,children:"History"}),L.jsx("div",{style:{maxHeight:120,overflowY:"auto",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:e.log.slice().reverse().map((z,J)=>L.jsxs("div",{style:{padding:"4px 10px",fontSize:10,borderBottom:"1px solid var(--border)",display:"flex",gap:8},children:[L.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.ts).toLocaleTimeString()}),L.jsx("span",{style:{color:"var(--text2)"},children:z.message})]},J))})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",borderTop:"1px solid var(--border)",paddingTop:16,marginTop:8,flexWrap:"wrap"},children:[L.jsx("button",{onClick:()=>{u(e.title),s(e.description||""),p(e.priority),y(e.repoPath||""),x(!0)},style:{padding:"6px 14px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Edit"}),E&&L.jsx("button",{onClick:()=>f(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.15)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Pause"}),D&&L.jsx("button",{onClick:()=>C(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",border:"1px solid rgba(61, 220, 132, 0.3)",borderRadius:4,color:"var(--green)"},children:"Resume"}),e.status==="awaiting_approval"&&L.jsxs(L.Fragment,{children:[L.jsx("button",{onClick:()=>i(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",borderRadius:4,color:"var(--green)"},children:"Approve"}),L.jsx("button",{onClick:()=>O(!0),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.1)",borderRadius:4,color:"var(--text2)"},children:"Revise"})]}),j&&S&&L.jsx("button",{onClick:()=>S(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(100, 160, 255, 0.15)",border:"1px solid rgba(100, 160, 255, 0.3)",borderRadius:4,color:"var(--steel2)"},children:"Retry"}),$&&L.jsx("button",{onClick:()=>_(e.id),title:e.workspacePath,style:{padding:"6px 14px",fontSize:12,background:"rgba(96, 165, 250, 0.12)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:4,color:"#60A5FA"},children:"Open in VSCode"}),B&&d&&L.jsx("button",{onClick:()=>d(e.id),title:"Delete the local workspace and clear plan, review, branch, PR, blockers, and progress before returning to backlog.",style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Reset to Backlog"}),M&&c&&L.jsx("button",{onClick:()=>c(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.15)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:"Abort"}),e.status==="done"&&h&&L.jsx("button",{onClick:()=>{if(W){h(e.id);return}G(!0)},style:{padding:"6px 14px",fontSize:12,background:W?"rgba(255, 77, 77, 0.2)":"rgba(255, 77, 77, 0.1)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:W?"Confirm Delete":"Delete from Done"})]}),B&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Reset deletes the local workspace and discards the current plan, review, branch, blocker, and PR state."}),I&&L.jsx("div",{style:{marginTop:10,animation:"fade-in 0.15s ease-out"},children:L.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:A,onChange:z=>F(z.target.value),onKeyDown:z=>{z.key==="Enter"&&R(),z.key==="Escape"&&(O(!1),F(""))},style:{width:"100%",fontSize:11,padding:"6px 10px"}})}),W&&e.status==="done"&&L.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Delete removes the completed task from Ban Kan state and clears any saved plan/workspace artifacts."})]})]})})}const If="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAiIHZpZXdCb3g9IjAgMCAxNDAwIDM2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8dGl0bGU+QmFuIEthbiBsb2dvPC90aXRsZT4KICA8ZGVzYz5NaW5pbWFsIFNWRyBsb2dvIGZvciBCYW4gS2FuIHdpdGggaGV4YWdvbmFsIG1hcmsgYW5kIHdvcmRtYXJrLjwvZGVzYz4KCiAgPCEtLSBUcmFuc3BhcmVudCBiYWNrZ3JvdW5kIC0tPgoKICA8IS0tIExvZ28gbWFyayAtLT4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MCw0MCkiIHN0cm9rZT0iI0Y1QTYyMyIgc3Ryb2tlLXdpZHRoPSIxMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDwhLS0gT3V0ZXIgaGV4YWdvbiAtLT4KICAgIDxwYXRoIGQ9Ik0xMjAgMjAgTDIwNi42IDcwIEwyMDYuNiAxNzAgTDEyMCAyMjAgTDMzLjQgMTcwIEwzMy40IDcwIFoiLz4KICAgIDwhLS0gSW5uZXIgYmFycyAvIGthbmJhbiBsYW5lcyAtLT4KICAgIDxnIGZpbGw9IiNGNUE2MjMiIHN0cm9rZT0ibm9uZSI+CiAgICAgIDxwYXRoIGQ9Ik03NCAxNDYgQzc0IDE0Mi43IDc2LjcgMTQwIDgwIDE0MCBIMTA0IEMxMDcuMyAxNDAgMTEwIDE0Mi43IDExMCAxNDYgVjE4MiBDMTEwIDE4NS4zIDEwNy4zIDE4OCAxMDQgMTg4IEg4MCBDNzYuNyAxODggNzQgMTg1LjMgNzQgMTgyIFYxNDYgWiIvPgogICAgICA8cGF0aCBkPSJNMTEyIDExOCBDMTEyIDExNC43IDExNC43IDExMiAxMTggMTEyIEgxNDIgQzE0NS4zIDExMiAxNDggMTE0LjcgMTQ4IDExOCBWMTgyIEMxNDggMTg1LjMgMTQ1LjMgMTg4IDE0MiAxODggSDExOCBDMTE0LjcgMTg4IDExMiAxODUuMyAxMTIgMTgyIFYxMTggWiIvPgogICAgICA8cGF0aCBkPSJNMTUwIDg2IEMxNTAgODIuNyAxNTIuNyA4MCAxNTYgODAgSDE4MCBDMTgzLjMgODAgMTg2IDgyLjcgMTg2IDg2IFYxODIgQzE4NiAxODUuMyAxODMuMyAxODggMTgwIDE4OCBIMTU2IEMxNTIuNyAxODggMTUwIDE4NS4zIDE1MCAxODIgVjg2IFoiLz4KICAgIDwvZz4KICA8L2c+CgogIDwhLS0gV29yZG1hcmsgLS0+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIwLDApIj4KICAgIDx0ZXh0IHg9IjAiIHk9IjIxMCIKICAgICAgICAgIGZpbGw9IiNFOEU4RjAiCiAgICAgICAgICBmb250LXNpemU9IjExOCIKICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiCiAgICAgICAgICBsZXR0ZXItc3BhY2luZz0iMTAiCiAgICAgICAgICBmb250LWZhbWlseT0iU3luZSwgSW50ZXIsIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgICBCQU4gS0FOCiAgICA8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",Cn={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"};function Pf(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Bf(e,t){return!Array.isArray(e)||e.length===0?"":t!=null&&t.defaultRepoPath&&e.includes(t.defaultRepoPath)?t.defaultRepoPath:e[0]||""}function Of(){return L.jsx("div",{style:{height:34,display:"flex",alignItems:"center",flexShrink:0},children:L.jsx("img",{src:If,alt:"Ban Kan",style:{height:34,width:"auto",display:"block"}})})}function jf(){const{connected:e,isInitialized:t,agents:r,tasks:i,repos:a,settings:f,notifications:C,addTask:l,approvePlan:c,rejectPlan:d,pauseTask:S,resumeTask:h,editTask:_,abortTask:m,resetTask:x,retryTask:v,deleteTask:u,openTaskWorkspace:o,injectMessage:s,sendRaw:n,updateSettings:p,subscribeTerminal:w,openAgentTerminal:y,returnAgentTerminal:k}=vf(),[g,b]=X.useState(null),[T,I]=X.useState(null),[O,A]=X.useState(!1),[F,W]=X.useState(!1),G=a.length>0,q=G,N=t&&!G&&i.length===0,E=X.useMemo(()=>i.filter(P=>P.status==="awaiting_approval"||P.status==="blocked"),[i]),D=X.useMemo(()=>i.reduce((P,R)=>P+(R.totalTokens||0),0),[i]),M=X.useMemo(()=>r.filter(P=>P.status==="active").length,[r]),B=X.useMemo(()=>r.filter(P=>P.status==="blocked").length,[r]),j=X.useMemo(()=>i.filter(P=>!["backlog","done","aborted"].includes(P.status)),[i]),$=X.useMemo(()=>r.find(P=>P.id===g),[r,g]);X.useEffect(()=>{!q&&O&&A(!1)},[q,O]);const U=P=>{P!=="orch"&&b(R=>R===P?null:P)},Q=()=>{q&&A(!0)};return L.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[L.jsxs("div",{style:{height:54,minHeight:54,display:"flex",alignItems:"center",gap:16,padding:"0 16px",background:"var(--bg1)",borderBottom:"1px solid var(--border)"},children:[L.jsx("div",{style:{display:"flex",alignItems:"center",minWidth:0},children:L.jsx(Of,{})}),L.jsxs("div",{style:{display:"flex",gap:16,fontSize:11,color:"var(--text2)",marginLeft:24},children:[L.jsxs("span",{children:["Active ",L.jsx("span",{style:{color:"var(--green)"},children:M}),"/",r.length]}),B>0&&L.jsxs("span",{children:["Blocked ",L.jsx("span",{style:{color:"var(--red)"},children:B})]}),L.jsxs("span",{children:["In Flight ",L.jsx("span",{style:{color:"var(--amber)"},children:j.length})]}),L.jsxs("span",{children:["Context ",L.jsx("span",{style:{color:"var(--text)"},children:Pf(D)})]})]}),E.length>0&&L.jsxs("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 10px",background:"rgba(245, 166, 35, 0.1)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:12,color:"var(--amber)",fontSize:11},children:[L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",animation:"pulse 2s infinite"}}),E.length," need",E.length===1?"s":""," attention"]}),L.jsx("div",{style:{flex:1}}),L.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e?"var(--green)":"var(--red)"}}),L.jsx("button",{onClick:()=>W(!0),style:{padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,fontSize:14,color:"var(--text2)",cursor:"pointer"},title:"Settings",children:"⚙"}),L.jsx("button",{onClick:Q,disabled:!q,style:{padding:"6px 14px",background:q?"var(--amber)":"var(--bg2)",color:q?"#000":"var(--text3)",border:`1px solid ${q?"var(--amber)":"var(--border)"}`,borderRadius:4,fontWeight:500,fontSize:12,cursor:q?"pointer":"not-allowed",opacity:q?1:.7},title:q?"Add Task":"Configure at least one repository in Settings before adding a task",children:"+ ADD TASK"})]}),L.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[N&&L.jsx("div",{style:{margin:"16px 16px 0",padding:"18px 20px",borderRadius:10,border:"1px solid rgba(245, 166, 35, 0.35)",background:"linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(122, 162, 247, 0.08))",boxShadow:"0 12px 32px rgba(0,0,0,0.18)"},children:L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[L.jsxs("div",{style:{maxWidth:720},children:[L.jsx("div",{style:{fontFamily:"var(--font-head)",fontSize:20,fontWeight:700,marginBottom:6},children:"Welcome to Ban Kan"}),L.jsx("div",{style:{fontSize:13,color:"var(--text2)",lineHeight:1.5},children:"Open Settings to add at least one repository, choose a default repository, and review the agent configuration before creating your first task."})]}),L.jsx("button",{onClick:()=>W(!0),style:{padding:"10px 14px",background:"var(--amber)",color:"#000",border:"1px solid var(--amber)",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Open Settings"})]})}),L.jsx(wf,{tasks:i,agents:r,onApprove:c,onReject:d,onAgentClick:U,onAddTask:Q,onTaskClick:P=>I(P),canCreateTask:q})]}),g&&$&&L.jsx(Rf,{agent:$,subscribeTerminal:w,injectMessage:s,sendRaw:n,openAgentTerminal:y,returnAgentTerminal:k,onClose:()=>b(null)}),T&&L.jsx(Mf,{task:i.find(P=>P.id===T.id)||T,repos:a,onClose:()=>I(null),onApprove:P=>{c(P),I(null)},onReject:(P,R)=>{d(P,R),I(null)},onPause:P=>{S(P),I(null)},onResume:P=>{h(P)},onEdit:(P,R)=>{_(P,R)},onAbort:P=>{m(P),I(null)},onReset:P=>{x(P),I(null)},onRetry:P=>{v(P),I(null)},onDelete:P=>{u(P),I(null)},onOpenWorkspace:P=>{o(P)}}),O&&L.jsx(Hf,{repos:a,settings:f,onClose:()=>A(!1),onSubmit:(P,R,K,H)=>{l(P,R,K,H),A(!1)}}),F&&f&&L.jsx(Nf,{settings:f,onClose:()=>W(!1),onApply:P=>{p(P),W(!1)}}),L.jsx("div",{style:{position:"fixed",bottom:16,right:16,display:"flex",flexDirection:"column",gap:8,zIndex:1e3},children:C.map(P=>L.jsx("div",{style:{padding:"10px 14px",background:"var(--bg2)",borderLeft:`3px solid ${P.type==="error"?"var(--red)":P.type==="success"?"var(--green)":P.type==="warning"?"var(--amber)":"var(--steel2)"}`,borderRadius:4,fontSize:12,maxWidth:320,animation:"toast-in 0.3s ease-out",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:P.msg},P.id))})]})}function Hf({repos:e,settings:t,onClose:r,onSubmit:i}){const[a,f]=X.useState(""),[C,l]=X.useState("medium"),[c,d]=X.useState(""),[S,h]=X.useState(()=>Bf(e,t)),_=()=>{a.trim()&&i(a.trim(),C,c.trim(),S)};return L.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:m=>m.stopPropagation(),style:{width:440,padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18,marginBottom:20},children:"Add Task"}),e.length>0&&L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Repository"}),L.jsxs("select",{value:S,onChange:m=>h(m.target.value),style:{width:"100%",fontSize:12,padding:"6px 8px"},children:[L.jsx("option",{value:"",children:"No repository"}),e.map(m=>L.jsx("option",{value:m,children:m},m))]})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Title"}),L.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:m=>f(m.target.value),onKeyDown:m=>{m.key==="Enter"&&_()},placeholder:"What needs to be built?",style:{width:"100%"}})]}),L.jsxs("div",{style:{marginBottom:16},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Priority"}),L.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(m=>L.jsx("button",{onClick:()=>l(m),style:{padding:"5px 12px",borderRadius:4,fontSize:12,border:`1px solid ${C===m?Cn[m]:"var(--border)"}`,background:C===m?Cn[m]+"20":"transparent",color:C===m?Cn[m]:"var(--text2)",textTransform:"capitalize"},children:m},m))})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Description (optional)"}),L.jsx("textarea",{value:c,onChange:m=>d(m.target.value),placeholder:"Additional context...",rows:3,style:{width:"100%",resize:"vertical"}})]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:_,disabled:!a.trim(),style:{padding:"8px 20px",background:a.trim()?"var(--amber)":"var(--border)",color:a.trim()?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Add Task"})]})]})})}function Nf({settings:e,onClose:t,onApply:r}){var p,w;const[i,a]=X.useState(()=>JSON.parse(JSON.stringify(e))),[f,C]=X.useState(""),[l,c]=X.useState(!1),[d,S]=X.useState("general"),h=(y,k,g)=>{a(b=>{const T=JSON.parse(JSON.stringify(b));return T.agents[y][k]=g,T})},_=(y,k)=>{a(g=>({...g,prompts:{...g.prompts||{},[y]:k}}))},m=()=>{const y=f.trim();y&&(a(k=>{if((k.repos||[]).includes(y))return k;const g=[...k.repos||[],y];return{...k,repos:g,defaultRepoPath:k.defaultRepoPath||y}}),C(""))},x=y=>{a(k=>{const g=(k.repos||[]).filter(b=>b!==y);return{...k,repos:g,defaultRepoPath:k.defaultRepoPath===y?g[0]||"":k.defaultRepoPath}})},v={planners:{min:0,max:10},implementors:{min:1,max:10},reviewers:{min:0,max:10}},u=!!((p=i.workspaceRoot)!=null&&p.trim())&&Object.entries(i.agents||{}).every(([y,k])=>{const g=v[y]||{min:1,max:10};return k.max>=g.min&&k.max<=g.max})&&["planning","implementation","review"].every(y=>{var k;return typeof((k=i.prompts)==null?void 0:k[y])=="string"}),o=[{key:"general",label:"General"},{key:"planning",label:"Planning"},{key:"implementation",label:"Implementation"},{key:"review",label:"Review"}],s={planning:{roleKey:"planners",promptKey:"planning",description:"Set max agents to 0 to disable planning and skip directly into implementation."},implementation:{roleKey:"implementors",promptKey:"implementation",description:"Implementation cannot be disabled. The prompt body customizes the engineer instructions only."},review:{roleKey:"reviewers",promptKey:"review",description:"Set max agents to 0 to disable review and create the PR immediately after implementation."}},n=y=>{var T;const k=s[y],g=i.agents[k.roleKey],b=v[k.roleKey];return L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:10},children:"AGENTS"}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Max:"}),L.jsx("input",{type:"number",min:b.min,max:b.max,value:g.max,onChange:I=>{const O=b.min,A=parseInt(I.target.value,10),F=Number.isNaN(A)?O:Math.max(b.min,Math.min(b.max,A));h(k.roleKey,"max",F)},style:{width:60,padding:"4px 6px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,textAlign:"center"}})]}),L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[L.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"CLI:"}),L.jsxs("select",{value:g.cli,onChange:I=>h(k.roleKey,"cli",I.target.value),style:{padding:"4px 8px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4},children:[L.jsx("option",{value:"claude",children:"claude"}),L.jsx("option",{value:"codex",children:"codex"})]})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:k.description})]}),L.jsxs("div",{style:{marginBottom:18},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"PROMPT BODY"}),L.jsx("textarea",{value:((T=i.prompts)==null?void 0:T[k.promptKey])||"",onChange:I=>_(k.promptKey,I.target.value),spellCheck:!1,style:{width:"100%",minHeight:220,resize:"vertical",padding:"10px 12px",fontSize:12,lineHeight:1.5,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)"}}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"This edits the stage instructions only. Required output markers and parser-critical formatting stay fixed."})]})]})};return L.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:L.jsxs("div",{onClick:y=>y.stopPropagation(),style:{width:760,maxWidth:"calc(100vw - 32px)",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[L.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[L.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18},children:"Settings"}),L.jsx("button",{onClick:t,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),L.jsx("div",{style:{display:"flex",gap:8,marginBottom:18,flexWrap:"wrap"},children:o.map(y=>L.jsx("button",{onClick:()=>S(y.key),style:{padding:"7px 12px",background:d===y.key?"var(--amber)":"var(--bg2)",color:d===y.key?"#000":"var(--text2)",border:"1px solid",borderColor:d===y.key?"var(--amber)":"var(--border)",borderRadius:999,fontSize:12,fontWeight:600,cursor:"pointer"},children:y.label},y.key))}),L.jsxs("div",{style:{maxHeight:"65vh",overflowY:"auto",paddingRight:4},children:[d==="general"&&L.jsxs(L.Fragment,{children:[L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"WORKSPACE FOLDER"}),L.jsxs("div",{style:{display:"flex",gap:8,marginBottom:6},children:[L.jsx("input",{type:"text",value:i.workspaceRoot||"",onChange:y=>a(k=>({...k,workspaceRoot:y.target.value})),placeholder:"/path/to/workspaces",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:()=>c(!0),style:{fontSize:12,padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)",cursor:"pointer"},children:"Browse"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:"Local folder used when the app creates per-task working copies."}),l&&L.jsx(Lf,{initialPath:i.workspaceRoot||"",onSelect:y=>{a(k=>({...k,workspaceRoot:y})),c(!1)},onClose:()=>c(!1)})]}),L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"REPOSITORIES"}),(i.repos||[]).map(y=>L.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[L.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y,children:y}),L.jsx("button",{onClick:()=>x(y),style:{color:"var(--red)",fontSize:12,flexShrink:0},children:"×"})]},y)),L.jsxs("div",{style:{display:"flex",gap:8,marginTop:10},children:[L.jsx("input",{type:"text",value:f,onChange:y=>C(y.target.value),onKeyDown:y=>{y.key==="Enter"&&m()},placeholder:"https://github.com/org/repo",style:{flex:1,fontSize:12,padding:"6px 10px"}}),L.jsx("button",{onClick:m,disabled:!f.trim(),style:{fontSize:12,padding:"6px 10px",background:f.trim()?"var(--bg2)":"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:f.trim()?"var(--text)":"var(--text3)",cursor:f.trim()?"pointer":"default"},children:"Add Repo"})]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"Add repository URLs for task assignment. The workspace folder above controls where the app checks them out locally."})]}),((w=i.repos)==null?void 0:w.length)>0&&L.jsxs("div",{style:{marginBottom:20},children:[L.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"DEFAULT REPOSITORY"}),L.jsxs("select",{value:i.defaultRepoPath||"",onChange:y=>a(k=>({...k,defaultRepoPath:y.target.value})),style:{width:"100%",fontSize:12,padding:"6px 10px"},children:[L.jsx("option",{value:"",children:"No default repository"}),(i.repos||[]).map(y=>L.jsx("option",{value:y,children:y},y))]}),L.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"New tasks preselect this repository. If it is removed, the first remaining repository becomes the default."})]}),L.jsx("div",{style:{fontSize:11,color:"var(--text3)",marginBottom:16,fontStyle:"italic"},children:"Orchestrator scales agents up on demand, up to the max per role. Planning and Review can be disabled by setting max to 0."})]}),d!=="general"&&n(d)]}),L.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[L.jsx("button",{onClick:t,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),L.jsx("button",{onClick:()=>r(i),disabled:!u,style:{padding:"8px 20px",background:u?"var(--amber)":"var(--border)",color:u?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Apply"})]})]})})}Iu(document.getElementById("root")).render(L.jsx(jf,{}));
48
+ `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return l}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}C.Terminal=v})(),f})())})(Pu);var xf=Pu.exports,Ou={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const f=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(f._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,f=a._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const C=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),d=Math.max(0,parseInt(l.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),h=c-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),_=d-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-C;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(h/f.css.cell.height))}}}})(),r})())})(Ou);var kf=Ou.exports,ju={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(C,l)=>{function c(S){try{const h=new URL(S),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return S.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(S,h,_,m={}){this._terminal=S,this._regex=h,this._handler=_,this._options=m}provideLinks(S,h){const _=d.computeLink(S,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(S){return S.map(h=>(h.leave=this._options.leave,h.hover=(_,m)=>{if(this._options.hover){const{range:x}=h;this._options.hover(_,m,x)}},h))}};class d{static computeLink(h,_,m,x){const v=new RegExp(_.source,(_.flags||"")+"g"),[u,o]=d._getWindowedLineStrings(h-1,m),s=u.join("");let n;const p=[];for(;n=v.exec(s);){const w=n[0];if(!c(w))continue;const[y,k]=d._mapStrIdx(m,o,0,n.index),[g,b]=d._mapStrIdx(m,y,k,w.length);if(y===-1||k===-1||g===-1||b===-1)continue;const T={start:{x:k+1,y:y+1},end:{x:b,y:g+1}};p.push({range:T,text:w,activate:x})}return p}static _getWindowedLineStrings(h,_){let m,x=h,v=h,u=0,o="";const s=[];if(m=_.buffer.active.getLine(h)){const n=m.translateToString(!0);if(m.isWrapped&&n[0]!==" "){for(u=0;(m=_.buffer.active.getLine(--x))&&u<2048&&(o=m.translateToString(!0),u+=o.length,s.push(o),m.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(n),u=0;(m=_.buffer.active.getLine(++v))&&m.isWrapped&&u<2048&&(o=m.translateToString(!0),u+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,x]}static _mapStrIdx(h,_,m,x){const v=h.buffer.active,u=v.getNullCell();let o=m;for(;x;){const s=v.getLine(_);if(!s)return[-1,-1];for(let n=o;n<s.length;++n){s.getCell(n,u);const p=u.getChars();if(u.getWidth()&&(x-=p.length||1,n===s.length-1&&p==="")){const w=v.getLine(_+1);w&&w.isWrapped&&(w.getCell(0,u),u.getWidth()===2&&(x+=1))}if(x<0)return[_,n]}_++,o=0}return[_,o]}}l.LinkComputer=d}},i={};function a(C){var l=i[C];if(l!==void 0)return l.exports;var c=i[C]={exports:{}};return r[C](c,c.exports,a),c.exports}var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.WebLinksAddon=void 0;const l=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(S,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}C.WebLinksAddon=class{constructor(S=d,h={}){this._handler=S,this._options=h}activate(S){this._terminal=S;const h=this._options,_=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var S;(S=this._linkProvider)==null||S.dispose()}}})(),f})())})(ju);var bf=ju.exports;function Sa(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ef(e){if(!e)return"0s";if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m ${e%60}s`;const t=Math.floor(e/3600),r=Math.floor(e%3600/60);return`${t}h ${r}m`}function Rf({agent:e,subscribeTerminal:t,injectMessage:r,sendRaw:i,openAgentTerminal:a,returnAgentTerminal:f,onClose:C}){const l=X.useRef(null),c=X.useRef(null),[d,S]=X.useState(420),[h,_]=X.useState(""),m=X.useRef(!1),x=o=>{const s=o.clientY,n=d;m.current=!0;const p=y=>{S(Math.max(180,Math.min(window.innerHeight*.8,n-(y.clientY-s))))},w=()=>{m.current=!1,window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",w)};window.addEventListener("mousemove",p),window.addEventListener("mouseup",w)};X.useEffect(()=>{if(!l.current||!e)return;const o=e.color||"#F5A623",s=new xf.Terminal({theme:{background:"#030507",foreground:"#E8E8F0",cursor:"#F5A623",selectionBackground:o+"40"},fontFamily:"'DM Mono', monospace",fontSize:12,lineHeight:1.3,cursorBlink:!0,scrollback:5e3}),n=new kf.FitAddon,p=new bf.WebLinksAddon;s.loadAddon(n),s.loadAddon(p),s.open(l.current),requestAnimationFrame(()=>{var b;try{n.fit()}catch{}const g=(b=document.activeElement)==null?void 0:b.tagName;(!g||g==="BODY"||g==="DIV")&&s.focus()}),c.current=s,s.onData(g=>{i(e.id,g)});const w=t(e.id,g=>{s.write(g)}),y=new ResizeObserver(()=>{try{n.fit()}catch{}});y.observe(l.current);const k=g=>{g.key==="Escape"&&C()};return window.addEventListener("keydown",k),()=>{window.removeEventListener("keydown",k),y.disconnect(),w(),s.dispose(),c.current=null}},[e==null?void 0:e.id]);const v=o=>{o.key==="Enter"&&h.trim()&&!e.bridgeActive&&(r(e.id,h.trim()),_(""))};if(!e)return null;const u=e.color||"#F5A623";return R.jsxs("div",{style:{height:d,display:"flex",flexDirection:"column",background:"var(--bg1)",borderTop:"1px solid var(--border)"},children:[R.jsx("div",{onMouseDown:x,style:{height:6,cursor:"ns-resize",background:"transparent",borderTop:"2px solid var(--border)",flexShrink:0}}),R.jsxs("div",{style:{height:36,minHeight:36,display:"flex",alignItems:"center",gap:10,padding:"0 12px",borderBottom:"1px solid var(--border)",fontSize:11},children:[R.jsx("button",{onClick:C,style:{color:"var(--text2)",fontSize:11,padding:"2px 6px",background:"var(--bg2)",borderRadius:3,border:"1px solid var(--border)"},children:"ESC"}),R.jsx("span",{style:{color:u,fontSize:14},children:e.icon}),R.jsx("span",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:13},children:e.name}),R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e.status==="active"?"var(--green)":e.status==="blocked"?"var(--red)":"var(--text3)",animation:e.status==="active"?"pulse 2s infinite":"none"}}),R.jsxs("div",{style:{flex:1,display:"flex",justifyContent:"center",gap:24,color:"var(--text2)"},children:[R.jsxs("span",{children:["Task: ",R.jsx("span",{style:{color:u},children:e.currentTask||"—"})]}),R.jsxs("span",{children:["Tokens: ",Sa(e.tokens||0)," / 200k"]}),R.jsxs("span",{children:["Total: ",Sa(e.aggregatedTokens||0)]}),R.jsxs("span",{children:["Uptime: ",Ef(e.uptime)]})]}),e.status==="active"&&!e.bridgeActive&&!e.printMode&&R.jsx("button",{onClick:()=>a(e.id),style:{color:"var(--text2)",fontSize:11,padding:"3px 8px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4},children:"Open in Terminal"}),e.bridgeActive&&R.jsx("button",{onClick:()=>f(e.id),style:{color:"var(--amber)",fontSize:11,padding:"3px 8px",background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4},children:"Return to Ban Kan"}),R.jsx("button",{onClick:C,style:{color:"var(--text3)",fontSize:14},children:"✕"})]}),R.jsxs("div",{style:{flex:1,overflow:"hidden",position:"relative"},children:[R.jsx("div",{ref:l,style:{width:"100%",height:"100%",padding:4}}),e.printMode&&e.status==="active"&&R.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(3, 5, 7, 0.92)",zIndex:10},children:[R.jsx("div",{style:{width:10,height:10,borderRadius:"50%",background:e.color||"var(--green)",animation:"pulse 1.5s ease-in-out infinite",marginBottom:14}}),R.jsx("div",{style:{fontSize:14,fontFamily:"var(--font-head)",fontWeight:600,color:"var(--text1)",marginBottom:6},children:"Agent is working..."}),R.jsx("div",{style:{fontSize:11,color:"var(--text3)"},children:"Output will appear when complete"})]})]}),!(e.printMode&&e.status==="active")&&R.jsxs("div",{style:{padding:"6px 12px",borderTop:"1px solid var(--border)"},children:[R.jsx("input",{type:"text",value:h,placeholder:e.bridgeActive?"Input moved to Terminal.app while bridged...":"Send message to agent...",disabled:e.status!=="active"||e.bridgeActive,onChange:o=>_(o.target.value),onKeyDown:v,style:{width:"100%",background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,padding:"5px 10px",fontSize:12,caretColor:u,opacity:e.status==="active"&&!e.bridgeActive?1:.55}}),e.bridgeActive&&R.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Terminal.app currently owns input for this live session. Type `/return` there or use the button above to hand control back."}),e.status!=="active"&&!e.bridgeActive&&R.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text3)"},children:"Agent input is unavailable because the session is not running. Resolve the blocker, then retry the task."})]})]})}function Lf({initialPath:e,onSelect:t,onClose:r}){const[i,a]=X.useState(e||""),[f,C]=X.useState(e||""),[l,c]=X.useState([]),[d,S]=X.useState(null),[h,_]=X.useState(null),[m,x]=X.useState(!1),v=async n=>{x(!0),_(null);try{const p=n?`/api/browse-dir?path=${encodeURIComponent(n)}`:"/api/browse-dir",w=await fetch(p);if(!w.ok){const k=await w.json();_(k.error||"Failed to browse directory"),x(!1);return}const y=await w.json();a(y.current),C(y.current),S(y.parent),c(y.dirs)}catch{_("Failed to connect to server")}x(!1)};X.useEffect(()=>{v(e||"")},[]);const u=n=>{v(i+"/"+n)},o=()=>{d&&v(d)},s=n=>{n.key==="Enter"&&v(f)};return R.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:200},children:R.jsxs("div",{onClick:n=>n.stopPropagation(),style:{width:500,maxHeight:"70vh",display:"flex",flexDirection:"column",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:16,marginBottom:16},children:"Select Directory"}),R.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12},children:[R.jsx("input",{type:"text",value:f,onChange:n=>C(n.target.value),onKeyDown:s,style:{flex:1,padding:"6px 10px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"}}),R.jsx("button",{onClick:()=>v(f),style:{padding:"6px 12px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Go"})]}),h&&R.jsx("div",{style:{color:"var(--red)",fontSize:11,marginBottom:8},children:h}),R.jsx("div",{style:{flex:1,overflowY:"auto",minHeight:200,border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:m?R.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"Loading..."}):R.jsxs(R.Fragment,{children:[d&&R.jsxs("div",{onClick:o,style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text2)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:n=>n.currentTarget.style.background="var(--bg2)",onMouseLeave:n=>n.currentTarget.style.background="transparent",children:[R.jsx("span",{style:{fontSize:14},children:".."}),R.jsx("span",{style:{color:"var(--text3)"},children:"(parent)"})]}),l.length===0&&!d&&R.jsx("div",{style:{padding:16,color:"var(--text3)",fontSize:12,textAlign:"center"},children:"No subdirectories"}),l.map(n=>R.jsxs("div",{onClick:()=>u(n),style:{padding:"8px 12px",fontSize:12,cursor:"pointer",color:"var(--text)",borderBottom:"1px solid var(--border)",display:"flex",alignItems:"center",gap:6},onMouseEnter:p=>p.currentTarget.style.background="var(--bg2)",onMouseLeave:p=>p.currentTarget.style.background="transparent",children:[R.jsx("span",{style:{color:"var(--amber)"},children:"📁"}),n]},n))]})}),R.jsxs("div",{style:{marginTop:12,fontSize:11,color:"var(--text3)"},children:["Selected: ",R.jsx("span",{style:{color:"var(--text)"},children:i})]}),R.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:16},children:[R.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),R.jsx("button",{onClick:()=>t(i),style:{padding:"8px 20px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Select"})]})]})})}const Kr={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"},ya={planning:"var(--steel2)",awaiting_approval:"var(--amber)",queued:"var(--text3)",workspace_setup:"var(--steel2)",implementing:"var(--green)",review:"#A78BFA",blocked:"var(--red)",paused:"var(--amber)",backlog:"var(--text3)",aborted:"var(--text3)",done:"var(--green)"};function Df(e,t=120){if(typeof e!="string")return"";const r=e.replace(/\s+/g," ").trim();return r.length<=t?r:r.slice(0,t-1).trimEnd()+"…"}function Tf(e=0){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e||0)}function Af(e,t){if(!e||!t)return null;const r=new Date(e).getTime(),i=new Date(t).getTime();if(Number.isNaN(r)||Number.isNaN(i)||i<r)return null;const a=Math.max(1,Math.floor((i-r)/6e4)),f=Math.floor(a/(60*24)),C=Math.floor(a%(60*24)/60),l=a%60;return f>0?C>0?`${f}d ${C}h`:`${f}d`:C>0?l>0?`${C}h ${l}m`:`${C}h`:`${l}m`}function Mf({task:e,repos:t=[],onClose:r,onApprove:i,onReject:a,onPause:f,onResume:C,onEdit:l,onAbort:c,onReset:d,onRetry:S,onDelete:h,onOpenWorkspace:_}){const[m,x]=X.useState(!1),[v,u]=X.useState(e.title),[o,s]=X.useState(e.description||""),[n,p]=X.useState(e.priority),[w,y]=X.useState(e.repoPath||""),[k,g]=X.useState(!1),[b,T]=X.useState(!1),[I,O]=X.useState(!1),[A,F]=X.useState(""),[W,G]=X.useState(!1),[q,N]=X.useState({}),E=!["done","paused","aborted"].includes(e.status),D=e.status==="paused",M=!["done","aborted"].includes(e.status),B=e.status!=="done",j=e.status==="blocked",$=!!(e.workspacePath&&_),U=Af(e.startedAt,e.completedAt),Q=Array.isArray(e.sessionHistory)?e.sessionHistory.slice().reverse():[],P=()=>{l(e.id,{title:v,description:o,priority:n,repoPath:w}),x(!1)},L=()=>{A.trim()&&(a(e.id,A.trim()),O(!1),F(""))},K=z=>{N(J=>({...J,[z]:!J[z]}))},H={fontSize:10,fontWeight:600,color:"var(--text3)",letterSpacing:1,textTransform:"uppercase",marginBottom:4},Y={fontSize:12,color:"var(--text)",marginBottom:14};return R.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:R.jsxs("div",{onClick:z=>z.stopPropagation(),style:{width:540,maxHeight:"80vh",overflowY:"auto",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10},children:[R.jsx("span",{style:{fontSize:12,color:"var(--text3)"},children:e.id}),R.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:10,background:(ya[e.status]||"var(--text3)")+"20",color:ya[e.status]||"var(--text3)"},children:e.status.replace(/_/g," ")})]}),R.jsx("button",{onClick:r,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),m?R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Title"}),R.jsx("input",{type:"text",value:v,onChange:z=>u(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12}})]}),R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Description"}),R.jsx("textarea",{value:o,onChange:z=>s(z.target.value),rows:3,style:{width:"100%",padding:"6px 10px",fontSize:12,resize:"vertical"}})]}),R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Priority"}),R.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(z=>R.jsx("button",{onClick:()=>p(z),style:{padding:"4px 10px",borderRadius:4,fontSize:11,border:`1px solid ${n===z?Kr[z]:"var(--border)"}`,background:n===z?Kr[z]+"20":"transparent",color:n===z?Kr[z]:"var(--text2)",textTransform:"capitalize"},children:z},z))})]}),t.length>0&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Repository"}),R.jsxs("select",{value:w,onChange:z=>y(z.target.value),style:{width:"100%",padding:"6px 10px",fontSize:12},children:[R.jsx("option",{value:"",children:"No repository"}),t.map(z=>R.jsx("option",{value:z,children:z},z))]})]}),R.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[R.jsx("button",{onClick:()=>x(!1),style:{padding:"6px 14px",color:"var(--text2)",fontSize:12},children:"Cancel"}),R.jsx("button",{onClick:P,style:{padding:"6px 16px",background:"var(--amber)",color:"#000",borderRadius:4,fontWeight:500,fontSize:12},children:"Save"})]})]}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Title"}),R.jsx("div",{style:{...Y,fontSize:14},children:e.title})]}),R.jsxs("div",{style:{display:"flex",gap:20,marginBottom:14},children:[R.jsxs("div",{children:[R.jsx("div",{style:H,children:"Priority"}),R.jsx("span",{style:{padding:"2px 8px",borderRadius:3,fontSize:11,background:(Kr[e.priority]||"var(--text3)")+"20",color:Kr[e.priority]||"var(--text3)",textTransform:"capitalize"},children:e.priority})]}),e.repoPath&&R.jsxs("div",{style:{flex:1},children:[R.jsx("div",{style:H,children:"Repository"}),R.jsx("div",{style:{fontSize:11,color:"var(--text2)",wordBreak:"break-all"},children:e.repoPath})]})]}),R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Total Tokens"}),R.jsx("div",{style:{...Y,fontFamily:"var(--font-mono)"},children:Tf(e.totalTokens||0)})]}),e.description&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Description"}),R.jsx("div",{style:Y,children:e.description})]}),e.branch&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Branch"}),R.jsx("div",{style:{fontSize:12,color:"var(--steel2)"},children:e.branch})]}),R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Review Cycles"}),R.jsxs("div",{style:{fontSize:12,color:"var(--text2)"},children:[e.reviewCycleCount||0," / 3"]})]}),U&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Total Time"}),R.jsx("div",{style:{fontSize:12,color:"var(--text2)"},children:U})]}),e.prUrl&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Pull Request"}),R.jsx("a",{href:e.prUrl,target:"_blank",rel:"noopener noreferrer",style:{fontSize:12,color:"#60A5FA"},children:e.prUrl})]}),e.blockedReason&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Blocked Reason"}),R.jsx("div",{title:e.blockedReason,style:{fontSize:12,color:"var(--red)",lineHeight:1.5},children:Df(e.blockedReason)})]}),e.plan&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsxs("div",{onClick:()=>g(!k),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[k?"▼":"▶"," Plan"]}),k&&R.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:e.plan})]}),e.review&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsxs("div",{onClick:()=>T(!b),style:{...H,cursor:"pointer",display:"flex",alignItems:"center",gap:4,userSelect:"none"},children:[b?"▼":"▶"," Review"]}),b&&R.jsx("pre",{style:{fontSize:11,color:"var(--text2)",background:"var(--bg)",padding:10,borderRadius:4,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflowY:"auto",border:"1px solid var(--border)"},children:e.review})]}),Q.length>0&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"Completed Sessions"}),R.jsx("div",{style:{border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)",overflow:"hidden"},children:Q.map((z,J)=>{const ne=!!q[z.id];return R.jsxs("div",{style:{borderBottom:J<Q.length-1?"1px solid var(--border)":"none"},children:[R.jsxs("button",{onClick:()=>K(z.id),style:{width:"100%",padding:"8px 10px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,background:"transparent",color:"var(--text)",fontSize:11,textAlign:"left"},children:[R.jsxs("span",{children:[ne?"▼":"▶"," ",z.agentName," · ",z.stage," · ",z.outcome]}),R.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.finishedAt).toLocaleString()})]}),ne&&R.jsx("pre",{style:{margin:0,padding:10,fontSize:11,color:"var(--text2)",background:"var(--bg1)",whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:220,overflowY:"auto",borderTop:"1px solid var(--border)"},children:z.transcript||"[No transcript captured]"})]},z.id||J)})})]}),e.log&&e.log.length>0&&R.jsxs("div",{style:{marginBottom:14},children:[R.jsx("div",{style:H,children:"History"}),R.jsx("div",{style:{maxHeight:120,overflowY:"auto",border:"1px solid var(--border)",borderRadius:4,background:"var(--bg)"},children:e.log.slice().reverse().map((z,J)=>R.jsxs("div",{style:{padding:"4px 10px",fontSize:10,borderBottom:"1px solid var(--border)",display:"flex",gap:8},children:[R.jsx("span",{style:{color:"var(--text3)",flexShrink:0},children:new Date(z.ts).toLocaleTimeString()}),R.jsx("span",{style:{color:"var(--text2)"},children:z.message})]},J))})]}),R.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",borderTop:"1px solid var(--border)",paddingTop:16,marginTop:8,flexWrap:"wrap"},children:[R.jsx("button",{onClick:()=>{u(e.title),s(e.description||""),p(e.priority),y(e.repoPath||""),x(!0)},style:{padding:"6px 14px",fontSize:12,background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)"},children:"Edit"}),E&&R.jsx("button",{onClick:()=>f(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.15)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Pause"}),D&&R.jsx("button",{onClick:()=>C(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",border:"1px solid rgba(61, 220, 132, 0.3)",borderRadius:4,color:"var(--green)"},children:"Resume"}),e.status==="awaiting_approval"&&R.jsxs(R.Fragment,{children:[R.jsx("button",{onClick:()=>i(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(61, 220, 132, 0.15)",borderRadius:4,color:"var(--green)"},children:"Approve"}),R.jsx("button",{onClick:()=>O(!0),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.1)",borderRadius:4,color:"var(--text2)"},children:"Revise"})]}),j&&S&&R.jsx("button",{onClick:()=>S(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(100, 160, 255, 0.15)",border:"1px solid rgba(100, 160, 255, 0.3)",borderRadius:4,color:"var(--steel2)"},children:"Retry"}),$&&R.jsx("button",{onClick:()=>_(e.id),title:e.workspacePath,style:{padding:"6px 14px",fontSize:12,background:"rgba(96, 165, 250, 0.12)",border:"1px solid rgba(96, 165, 250, 0.3)",borderRadius:4,color:"#60A5FA"},children:"Open in VSCode"}),B&&d&&R.jsx("button",{onClick:()=>d(e.id),title:"Delete the local workspace and clear plan, review, branch, PR, blockers, and progress before returning to backlog.",style:{padding:"6px 14px",fontSize:12,background:"rgba(245, 166, 35, 0.12)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:4,color:"var(--amber)"},children:"Reset to Backlog"}),M&&c&&R.jsx("button",{onClick:()=>c(e.id),style:{padding:"6px 14px",fontSize:12,background:"rgba(255, 77, 77, 0.15)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:"Abort"}),e.status==="done"&&h&&R.jsx("button",{onClick:()=>{if(W){h(e.id);return}G(!0)},style:{padding:"6px 14px",fontSize:12,background:W?"rgba(255, 77, 77, 0.2)":"rgba(255, 77, 77, 0.1)",border:"1px solid rgba(255, 77, 77, 0.3)",borderRadius:4,color:"var(--red)"},children:W?"Confirm Delete":"Delete from Done"})]}),B&&R.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Reset deletes the local workspace and discards the current plan, review, branch, blocker, and PR state."}),I&&R.jsx("div",{style:{marginTop:10,animation:"fade-in 0.15s ease-out"},children:R.jsx("input",{autoFocus:!0,type:"text",placeholder:"Feedback for planner...",value:A,onChange:z=>F(z.target.value),onKeyDown:z=>{z.key==="Enter"&&L(),z.key==="Escape"&&(O(!1),F(""))},style:{width:"100%",fontSize:11,padding:"6px 10px"}})}),W&&e.status==="done"&&R.jsx("div",{style:{marginTop:10,fontSize:10,color:"var(--text3)",lineHeight:1.5},children:"Delete removes the completed task from Ban Kan state and clears any saved plan/workspace artifacts."})]})]})})}const If="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQwMCIgaGVpZ2h0PSIzNjAiIHZpZXdCb3g9IjAgMCAxNDAwIDM2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8dGl0bGU+QmFuIEthbiBsb2dvPC90aXRsZT4KICA8ZGVzYz5NaW5pbWFsIFNWRyBsb2dvIGZvciBCYW4gS2FuIHdpdGggaGV4YWdvbmFsIG1hcmsgYW5kIHdvcmRtYXJrLjwvZGVzYz4KCiAgPCEtLSBUcmFuc3BhcmVudCBiYWNrZ3JvdW5kIC0tPgoKICA8IS0tIExvZ28gbWFyayAtLT4KICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg0MCw0MCkiIHN0cm9rZT0iI0Y1QTYyMyIgc3Ryb2tlLXdpZHRoPSIxMCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgIDwhLS0gT3V0ZXIgaGV4YWdvbiAtLT4KICAgIDxwYXRoIGQ9Ik0xMjAgMjAgTDIwNi42IDcwIEwyMDYuNiAxNzAgTDEyMCAyMjAgTDMzLjQgMTcwIEwzMy40IDcwIFoiLz4KICAgIDwhLS0gSW5uZXIgYmFycyAvIGthbmJhbiBsYW5lcyAtLT4KICAgIDxnIGZpbGw9IiNGNUE2MjMiIHN0cm9rZT0ibm9uZSI+CiAgICAgIDxwYXRoIGQ9Ik03NCAxNDYgQzc0IDE0Mi43IDc2LjcgMTQwIDgwIDE0MCBIMTA0IEMxMDcuMyAxNDAgMTEwIDE0Mi43IDExMCAxNDYgVjE4MiBDMTEwIDE4NS4zIDEwNy4zIDE4OCAxMDQgMTg4IEg4MCBDNzYuNyAxODggNzQgMTg1LjMgNzQgMTgyIFYxNDYgWiIvPgogICAgICA8cGF0aCBkPSJNMTEyIDExOCBDMTEyIDExNC43IDExNC43IDExMiAxMTggMTEyIEgxNDIgQzE0NS4zIDExMiAxNDggMTE0LjcgMTQ4IDExOCBWMTgyIEMxNDggMTg1LjMgMTQ1LjMgMTg4IDE0MiAxODggSDExOCBDMTE0LjcgMTg4IDExMiAxODUuMyAxMTIgMTgyIFYxMTggWiIvPgogICAgICA8cGF0aCBkPSJNMTUwIDg2IEMxNTAgODIuNyAxNTIuNyA4MCAxNTYgODAgSDE4MCBDMTgzLjMgODAgMTg2IDgyLjcgMTg2IDg2IFYxODIgQzE4NiAxODUuMyAxODMuMyAxODggMTgwIDE4OCBIMTU2IEMxNTIuNyAxODggMTUwIDE4NS4zIDE1MCAxODIgVjg2IFoiLz4KICAgIDwvZz4KICA8L2c+CgogIDwhLS0gV29yZG1hcmsgLS0+CiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzIwLDApIj4KICAgIDx0ZXh0IHg9IjAiIHk9IjIxMCIKICAgICAgICAgIGZpbGw9IiNFOEU4RjAiCiAgICAgICAgICBmb250LXNpemU9IjExOCIKICAgICAgICAgIGZvbnQtd2VpZ2h0PSI4MDAiCiAgICAgICAgICBsZXR0ZXItc3BhY2luZz0iMTAiCiAgICAgICAgICBmb250LWZhbWlseT0iU3luZSwgSW50ZXIsIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWYiPgogICAgICBCQU4gS0FOCiAgICA8L3RleHQ+CiAgPC9nPgo8L3N2Zz4K",Cn={critical:"var(--red)",high:"var(--amber)",medium:"var(--steel2)",low:"var(--text3)"};function Pf(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Bf(e,t){return!Array.isArray(e)||e.length===0?"":t!=null&&t.defaultRepoPath&&e.includes(t.defaultRepoPath)?t.defaultRepoPath:e[0]||""}function Of(){return R.jsx("div",{style:{height:34,display:"flex",alignItems:"center",flexShrink:0},children:R.jsx("img",{src:If,alt:"Ban Kan",style:{height:34,width:"auto",display:"block"}})})}function jf(){const{connected:e,isInitialized:t,agents:r,tasks:i,repos:a,settings:f,notifications:C,addTask:l,approvePlan:c,rejectPlan:d,pauseTask:S,resumeTask:h,editTask:_,abortTask:m,resetTask:x,retryTask:v,deleteTask:u,openTaskWorkspace:o,injectMessage:s,sendRaw:n,updateSettings:p,subscribeTerminal:w,openAgentTerminal:y,returnAgentTerminal:k}=vf(),[g,b]=X.useState(null),[T,I]=X.useState(null),[O,A]=X.useState(!1),[F,W]=X.useState(!1),G=a.length>0,q=G,N=t&&!G&&i.length===0,E=X.useMemo(()=>i.filter(P=>P.status==="awaiting_approval"||P.status==="blocked"),[i]),D=X.useMemo(()=>i.reduce((P,L)=>P+(L.totalTokens||0),0),[i]),M=X.useMemo(()=>r.filter(P=>P.status==="active").length,[r]),B=X.useMemo(()=>r.filter(P=>P.status==="blocked").length,[r]),j=X.useMemo(()=>i.filter(P=>!["backlog","done","aborted"].includes(P.status)),[i]),$=X.useMemo(()=>r.find(P=>P.id===g),[r,g]);X.useEffect(()=>{!q&&O&&A(!1)},[q,O]);const U=P=>{P!=="orch"&&b(L=>L===P?null:P)},Q=()=>{q&&A(!0)};return R.jsxs("div",{style:{height:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[R.jsxs("div",{style:{height:54,minHeight:54,display:"flex",alignItems:"center",gap:16,padding:"0 16px",background:"var(--bg1)",borderBottom:"1px solid var(--border)"},children:[R.jsx("div",{style:{display:"flex",alignItems:"center",minWidth:0},children:R.jsx(Of,{})}),R.jsxs("div",{style:{display:"flex",gap:16,fontSize:11,color:"var(--text2)",marginLeft:24},children:[R.jsxs("span",{children:["Active ",R.jsx("span",{style:{color:"var(--green)"},children:M}),"/",r.length]}),B>0&&R.jsxs("span",{children:["Blocked ",R.jsx("span",{style:{color:"var(--red)"},children:B})]}),R.jsxs("span",{children:["In Flight ",R.jsx("span",{style:{color:"var(--amber)"},children:j.length})]}),R.jsxs("span",{children:["Context ",R.jsx("span",{style:{color:"var(--text)"},children:Pf(D)})]})]}),E.length>0&&R.jsxs("button",{style:{display:"flex",alignItems:"center",gap:6,padding:"4px 10px",background:"rgba(245, 166, 35, 0.1)",border:"1px solid rgba(245, 166, 35, 0.3)",borderRadius:12,color:"var(--amber)",fontSize:11},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--amber)",animation:"pulse 2s infinite"}}),E.length," need",E.length===1?"s":""," attention"]}),R.jsx("div",{style:{flex:1}}),R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e?"var(--green)":"var(--red)"}}),R.jsx("button",{onClick:()=>W(!0),style:{padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,fontSize:14,color:"var(--text2)",cursor:"pointer"},title:"Settings",children:"⚙"}),R.jsx("button",{onClick:Q,disabled:!q,style:{padding:"6px 14px",background:q?"var(--amber)":"var(--bg2)",color:q?"#000":"var(--text3)",border:`1px solid ${q?"var(--amber)":"var(--border)"}`,borderRadius:4,fontWeight:500,fontSize:12,cursor:q?"pointer":"not-allowed",opacity:q?1:.7},title:q?"Add Task":"Configure at least one repository in Settings before adding a task",children:"+ ADD TASK"})]}),R.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[N&&R.jsx("div",{style:{margin:"16px 16px 0",padding:"18px 20px",borderRadius:10,border:"1px solid rgba(245, 166, 35, 0.35)",background:"linear-gradient(135deg, rgba(245, 166, 35, 0.18), rgba(122, 162, 247, 0.08))",boxShadow:"0 12px 32px rgba(0,0,0,0.18)"},children:R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[R.jsxs("div",{style:{maxWidth:720},children:[R.jsx("div",{style:{fontFamily:"var(--font-head)",fontSize:20,fontWeight:700,marginBottom:6},children:"Welcome to Ban Kan"}),R.jsx("div",{style:{fontSize:13,color:"var(--text2)",lineHeight:1.5},children:"Open Settings to add at least one repository, choose a default repository, and review the agent configuration before creating your first task."})]}),R.jsx("button",{onClick:()=>W(!0),style:{padding:"10px 14px",background:"var(--amber)",color:"#000",border:"1px solid var(--amber)",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap"},children:"Open Settings"})]})}),R.jsx(wf,{tasks:i,agents:r,onApprove:c,onReject:d,onAgentClick:U,onAddTask:Q,onTaskClick:P=>I(P),canCreateTask:q})]}),g&&$&&R.jsx(Rf,{agent:$,subscribeTerminal:w,injectMessage:s,sendRaw:n,openAgentTerminal:y,returnAgentTerminal:k,onClose:()=>b(null)}),T&&R.jsx(Mf,{task:i.find(P=>P.id===T.id)||T,repos:a,onClose:()=>I(null),onApprove:P=>{c(P),I(null)},onReject:(P,L)=>{d(P,L),I(null)},onPause:P=>{S(P),I(null)},onResume:P=>{h(P)},onEdit:(P,L)=>{_(P,L)},onAbort:P=>{m(P),I(null)},onReset:P=>{x(P),I(null)},onRetry:P=>{v(P),I(null)},onDelete:P=>{u(P),I(null)},onOpenWorkspace:P=>{o(P)}}),O&&R.jsx(Hf,{repos:a,settings:f,onClose:()=>A(!1),onSubmit:(P,L,K,H)=>{l(P,L,K,H),A(!1)}}),F&&f&&R.jsx(Nf,{settings:f,onClose:()=>W(!1),onApply:P=>{p(P),W(!1)}}),R.jsx("div",{style:{position:"fixed",bottom:16,right:16,display:"flex",flexDirection:"column",gap:8,zIndex:1e3},children:C.map(P=>R.jsx("div",{style:{padding:"10px 14px",background:"var(--bg2)",borderLeft:`3px solid ${P.type==="error"?"var(--red)":P.type==="success"?"var(--green)":P.type==="warning"?"var(--amber)":"var(--steel2)"}`,borderRadius:4,fontSize:12,maxWidth:320,animation:"toast-in 0.3s ease-out",boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:P.msg},P.id))})]})}function Hf({repos:e,settings:t,onClose:r,onSubmit:i}){const[a,f]=X.useState(""),[C,l]=X.useState("medium"),[c,d]=X.useState(""),[S,h]=X.useState(()=>Bf(e,t)),_=()=>{a.trim()&&i(a.trim(),C,c.trim(),S)};return R.jsx("div",{onClick:r,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:R.jsxs("div",{onClick:m=>m.stopPropagation(),style:{width:440,padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18,marginBottom:20},children:"Add Task"}),e.length>0&&R.jsxs("div",{style:{marginBottom:16},children:[R.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Repository"}),R.jsxs("select",{value:S,onChange:m=>h(m.target.value),style:{width:"100%",fontSize:12,padding:"6px 8px"},children:[R.jsx("option",{value:"",children:"No repository"}),e.map(m=>R.jsx("option",{value:m,children:m},m))]})]}),R.jsxs("div",{style:{marginBottom:16},children:[R.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Title"}),R.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:m=>f(m.target.value),onKeyDown:m=>{m.key==="Enter"&&_()},placeholder:"What needs to be built?",style:{width:"100%"}})]}),R.jsxs("div",{style:{marginBottom:16},children:[R.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Priority"}),R.jsx("div",{style:{display:"flex",gap:6},children:["critical","high","medium","low"].map(m=>R.jsx("button",{onClick:()=>l(m),style:{padding:"5px 12px",borderRadius:4,fontSize:12,border:`1px solid ${C===m?Cn[m]:"var(--border)"}`,background:C===m?Cn[m]+"20":"transparent",color:C===m?Cn[m]:"var(--text2)",textTransform:"capitalize"},children:m},m))})]}),R.jsxs("div",{style:{marginBottom:20},children:[R.jsx("label",{style:{fontSize:11,color:"var(--text2)",display:"block",marginBottom:6},children:"Description (optional)"}),R.jsx("textarea",{value:c,onChange:m=>d(m.target.value),placeholder:"Additional context...",rows:3,style:{width:"100%",resize:"vertical"}})]}),R.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[R.jsx("button",{onClick:r,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),R.jsx("button",{onClick:_,disabled:!a.trim(),style:{padding:"8px 20px",background:a.trim()?"var(--amber)":"var(--border)",color:a.trim()?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Add Task"})]})]})})}function Nf({settings:e,onClose:t,onApply:r}){var p,w;const[i,a]=X.useState(()=>JSON.parse(JSON.stringify(e))),[f,C]=X.useState(""),[l,c]=X.useState(!1),[d,S]=X.useState("general"),h=(y,k,g)=>{a(b=>{const T=JSON.parse(JSON.stringify(b));return T.agents[y][k]=g,T})},_=(y,k)=>{a(g=>({...g,prompts:{...g.prompts||{},[y]:k}}))},m=()=>{const y=f.trim();y&&(a(k=>{if((k.repos||[]).includes(y))return k;const g=[...k.repos||[],y];return{...k,repos:g,defaultRepoPath:k.defaultRepoPath||y}}),C(""))},x=y=>{a(k=>{const g=(k.repos||[]).filter(b=>b!==y);return{...k,repos:g,defaultRepoPath:k.defaultRepoPath===y?g[0]||"":k.defaultRepoPath}})},v={planners:{min:0,max:10},implementors:{min:1,max:10},reviewers:{min:0,max:10}},u=!!((p=i.workspaceRoot)!=null&&p.trim())&&Object.entries(i.agents||{}).every(([y,k])=>{const g=v[y]||{min:1,max:10};return k.max>=g.min&&k.max<=g.max})&&["planning","implementation","review"].every(y=>{var k;return typeof((k=i.prompts)==null?void 0:k[y])=="string"}),o=[{key:"general",label:"General"},{key:"planning",label:"Planning"},{key:"implementation",label:"Implementation"},{key:"review",label:"Review"}],s={planning:{roleKey:"planners",promptKey:"planning",description:"Set max agents to 0 to disable planning and skip directly into implementation."},implementation:{roleKey:"implementors",promptKey:"implementation",description:"Implementation cannot be disabled. The prompt body customizes the engineer instructions only."},review:{roleKey:"reviewers",promptKey:"review",description:"Set max agents to 0 to disable review and create the PR immediately after implementation."}},n=y=>{var T;const k=s[y],g=i.agents[k.roleKey],b=v[k.roleKey];return R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:20},children:[R.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:10},children:"AGENTS"}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[R.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"Max:"}),R.jsx("input",{type:"number",min:b.min,max:b.max,value:g.max,onChange:I=>{const O=b.min,A=parseInt(I.target.value,10),F=Number.isNaN(A)?O:Math.max(b.min,Math.min(b.max,A));h(k.roleKey,"max",F)},style:{width:60,padding:"4px 6px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4,textAlign:"center"}})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:8},children:[R.jsx("span",{style:{fontSize:12,color:"var(--text2)",width:45},children:"CLI:"}),R.jsxs("select",{value:g.cli,onChange:I=>h(k.roleKey,"cli",I.target.value),style:{padding:"4px 8px",fontSize:12,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:4},children:[R.jsx("option",{value:"claude",children:"claude"}),R.jsx("option",{value:"codex",children:"codex"})]})]}),R.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:k.description})]}),R.jsxs("div",{style:{marginBottom:18},children:[R.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"PROMPT BODY"}),R.jsx("textarea",{value:((T=i.prompts)==null?void 0:T[k.promptKey])||"",onChange:I=>_(k.promptKey,I.target.value),spellCheck:!1,style:{width:"100%",minHeight:220,resize:"vertical",padding:"10px 12px",fontSize:12,lineHeight:1.5,background:"var(--bg)",border:"1px solid var(--border)",borderRadius:6,color:"var(--text)"}}),R.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"This edits the stage instructions only. Required output markers and parser-critical formatting stay fixed."})]})]})};return R.jsx("div",{onClick:t,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:R.jsxs("div",{onClick:y=>y.stopPropagation(),style:{width:760,maxWidth:"calc(100vw - 32px)",padding:24,background:"var(--bg1)",border:"1px solid var(--border)",borderRadius:8,animation:"fade-in 0.2s ease-out"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[R.jsx("h2",{style:{fontFamily:"var(--font-head)",fontWeight:700,fontSize:18},children:"Settings"}),R.jsx("button",{onClick:t,style:{color:"var(--text3)",fontSize:16},children:"✕"})]}),R.jsx("div",{style:{display:"flex",gap:8,marginBottom:18,flexWrap:"wrap"},children:o.map(y=>R.jsx("button",{onClick:()=>S(y.key),style:{padding:"7px 12px",background:d===y.key?"var(--amber)":"var(--bg2)",color:d===y.key?"#000":"var(--text2)",border:"1px solid",borderColor:d===y.key?"var(--amber)":"var(--border)",borderRadius:999,fontSize:12,fontWeight:600,cursor:"pointer"},children:y.label},y.key))}),R.jsxs("div",{style:{maxHeight:"65vh",overflowY:"auto",paddingRight:4},children:[d==="general"&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:20},children:[R.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"WORKSPACE FOLDER"}),R.jsxs("div",{style:{display:"flex",gap:8,marginBottom:6},children:[R.jsx("input",{type:"text",value:i.workspaceRoot||"",onChange:y=>a(k=>({...k,workspaceRoot:y.target.value})),placeholder:"/path/to/workspaces",style:{flex:1,fontSize:12,padding:"6px 10px"}}),R.jsx("button",{onClick:()=>c(!0),style:{fontSize:12,padding:"6px 10px",background:"var(--bg2)",border:"1px solid var(--border)",borderRadius:4,color:"var(--text)",cursor:"pointer"},children:"Browse"})]}),R.jsx("div",{style:{fontSize:10,color:"var(--text3)"},children:"Local folder used when the app creates per-task working copies."}),l&&R.jsx(Lf,{initialPath:i.workspaceRoot||"",onSelect:y=>{a(k=>({...k,workspaceRoot:y})),c(!1)},onClose:()=>c(!1)})]}),R.jsxs("div",{style:{marginBottom:20},children:[R.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"REPOSITORIES"}),(i.repos||[]).map(y=>R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[R.jsx("span",{style:{flex:1,fontSize:12,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:y,children:y}),R.jsx("button",{onClick:()=>x(y),style:{color:"var(--red)",fontSize:12,flexShrink:0},children:"×"})]},y)),R.jsxs("div",{style:{display:"flex",gap:8,marginTop:10},children:[R.jsx("input",{type:"text",value:f,onChange:y=>C(y.target.value),onKeyDown:y=>{y.key==="Enter"&&m()},placeholder:"https://github.com/org/repo",style:{flex:1,fontSize:12,padding:"6px 10px"}}),R.jsx("button",{onClick:m,disabled:!f.trim(),style:{fontSize:12,padding:"6px 10px",background:f.trim()?"var(--bg2)":"var(--bg)",border:"1px solid var(--border)",borderRadius:4,color:f.trim()?"var(--text)":"var(--text3)",cursor:f.trim()?"pointer":"default"},children:"Add Repo"})]}),R.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"Add repository URLs for task assignment. The workspace folder above controls where the app checks them out locally."})]}),((w=i.repos)==null?void 0:w.length)>0&&R.jsxs("div",{style:{marginBottom:20},children:[R.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text2)",letterSpacing:1,marginBottom:8},children:"DEFAULT REPOSITORY"}),R.jsxs("select",{value:i.defaultRepoPath||"",onChange:y=>a(k=>({...k,defaultRepoPath:y.target.value})),style:{width:"100%",fontSize:12,padding:"6px 10px"},children:[R.jsx("option",{value:"",children:"No default repository"}),(i.repos||[]).map(y=>R.jsx("option",{value:y,children:y},y))]}),R.jsx("div",{style:{fontSize:10,color:"var(--text3)",marginTop:6},children:"New tasks preselect this repository. If it is removed, the first remaining repository becomes the default."})]}),R.jsx("div",{style:{fontSize:11,color:"var(--text3)",marginBottom:16,fontStyle:"italic"},children:"Orchestrator scales agents up on demand, up to the max per role. Planning and Review can be disabled by setting max to 0."})]}),d!=="general"&&n(d)]}),R.jsxs("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[R.jsx("button",{onClick:t,style:{padding:"8px 16px",color:"var(--text2)",fontSize:12},children:"Cancel"}),R.jsx("button",{onClick:()=>r(i),disabled:!u,style:{padding:"8px 20px",background:u?"var(--amber)":"var(--border)",color:u?"#000":"var(--text3)",borderRadius:4,fontWeight:500,fontSize:12},children:"Apply"})]})]})})}Iu(document.getElementById("root")).render(R.jsx(jf,{}));