paneful 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/server/claude-monitor.js +16 -1
- package/dist/server/editor-monitor.js +394 -0
- package/dist/server/git-monitor.js +98 -0
- package/dist/server/index.js +28 -65
- package/dist/server/port-monitor.js +34 -2
- package/dist/server/ws-handler.js +48 -1
- package/dist/web/assets/index-CaxQEraM.css +32 -0
- package/dist/web/assets/index-DZHbyL92.js +394 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CYMQU0Pz.js +0 -349
- package/dist/web/assets/index-Df0yoS2W.css +0 -32
|
@@ -1,349 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const h of n)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&i(m)}).observe(document,{childList:!0,subtree:!0});function r(n){const h={};return n.integrity&&(h.integrity=n.integrity),n.referrerPolicy&&(h.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?h.credentials="include":n.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function i(n){if(n.ep)return;n.ep=!0;const h=r(n);fetch(n.href,h)}})();function cc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var uc={exports:{}},Xs={},hc={exports:{}},ie={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var ji=Symbol.for("react.element"),zh=Symbol.for("react.portal"),Wh=Symbol.for("react.fragment"),Uh=Symbol.for("react.strict_mode"),$h=Symbol.for("react.profiler"),Kh=Symbol.for("react.provider"),Vh=Symbol.for("react.context"),qh=Symbol.for("react.forward_ref"),Gh=Symbol.for("react.suspense"),Xh=Symbol.for("react.memo"),Qh=Symbol.for("react.lazy"),Ka=Symbol.iterator;function Yh(e){return e===null||typeof e!="object"?null:(e=Ka&&e[Ka]||e["@@iterator"],typeof e=="function"?e:null)}var dc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fc=Object.assign,pc={};function Wr(e,t,r){this.props=e,this.context=t,this.refs=pc,this.updater=r||dc}Wr.prototype.isReactComponent={};Wr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Wr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _c(){}_c.prototype=Wr.prototype;function Vo(e,t,r){this.props=e,this.context=t,this.refs=pc,this.updater=r||dc}var qo=Vo.prototype=new _c;qo.constructor=Vo;fc(qo,Wr.prototype);qo.isPureReactComponent=!0;var Va=Array.isArray,vc=Object.prototype.hasOwnProperty,Go={current:null},gc={key:!0,ref:!0,__self:!0,__source:!0};function mc(e,t,r){var i,n={},h=null,m=null;if(t!=null)for(i in t.ref!==void 0&&(m=t.ref),t.key!==void 0&&(h=""+t.key),t)vc.call(t,i)&&!gc.hasOwnProperty(i)&&(n[i]=t[i]);var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){for(var c=Array(a),f=0;f<a;f++)c[f]=arguments[f+2];n.children=c}if(e&&e.defaultProps)for(i in a=e.defaultProps,a)n[i]===void 0&&(n[i]=a[i]);return{$$typeof:ji,type:e,key:h,ref:m,props:n,_owner:Go.current}}function Jh(e,t){return{$$typeof:ji,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Xo(e){return typeof e=="object"&&e!==null&&e.$$typeof===ji}function Zh(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var qa=/\/+/g;function _n(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zh(""+e.key):t.toString(36)}function hs(e,t,r,i,n){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var m=!1;if(e===null)m=!0;else switch(h){case"string":case"number":m=!0;break;case"object":switch(e.$$typeof){case ji:case zh:m=!0}}if(m)return m=e,n=n(m),e=i===""?"."+_n(m,0):i,Va(n)?(r="",e!=null&&(r=e.replace(qa,"$&/")+"/"),hs(n,t,r,"",function(f){return f})):n!=null&&(Xo(n)&&(n=Jh(n,r+(!n.key||m&&m.key===n.key?"":(""+n.key).replace(qa,"$&/")+"/")+e)),t.push(n)),1;if(m=0,i=i===""?".":i+":",Va(e))for(var a=0;a<e.length;a++){h=e[a];var c=i+_n(h,a);m+=hs(h,t,r,c,n)}else if(c=Yh(e),typeof c=="function")for(e=c.call(e),a=0;!(h=e.next()).done;)h=h.value,c=i+_n(h,a++),m+=hs(h,t,r,c,n);else if(h==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return m}function Vi(e,t,r){if(e==null)return e;var i=[],n=0;return hs(e,i,"","",function(h){return t.call(r,h,n++)}),i}function ed(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var He={current:null},ds={transition:null},td={ReactCurrentDispatcher:He,ReactCurrentBatchConfig:ds,ReactCurrentOwner:Go};function Sc(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:Vi,forEach:function(e,t,r){Vi(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Vi(e,function(){t++}),t},toArray:function(e){return Vi(e,function(t){return t})||[]},only:function(e){if(!Xo(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=Wr;ie.Fragment=Wh;ie.Profiler=$h;ie.PureComponent=Vo;ie.StrictMode=Uh;ie.Suspense=Gh;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=td;ie.act=Sc;ie.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=fc({},e.props),n=e.key,h=e.ref,m=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,m=Go.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)vc.call(t,c)&&!gc.hasOwnProperty(c)&&(i[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)i.children=r;else if(1<c){a=Array(c);for(var f=0;f<c;f++)a[f]=arguments[f+2];i.children=a}return{$$typeof:ji,type:e.type,key:n,ref:h,props:i,_owner:m}};ie.createContext=function(e){return e={$$typeof:Vh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Kh,_context:e},e.Consumer=e};ie.createElement=mc;ie.createFactory=function(e){var t=mc.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:qh,render:e}};ie.isValidElement=Xo;ie.lazy=function(e){return{$$typeof:Qh,_payload:{_status:-1,_result:e},_init:ed}};ie.memo=function(e,t){return{$$typeof:Xh,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=ds.transition;ds.transition={};try{e()}finally{ds.transition=t}};ie.unstable_act=Sc;ie.useCallback=function(e,t){return He.current.useCallback(e,t)};ie.useContext=function(e){return He.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return He.current.useDeferredValue(e)};ie.useEffect=function(e,t){return He.current.useEffect(e,t)};ie.useId=function(){return He.current.useId()};ie.useImperativeHandle=function(e,t,r){return He.current.useImperativeHandle(e,t,r)};ie.useInsertionEffect=function(e,t){return He.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return He.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return He.current.useMemo(e,t)};ie.useReducer=function(e,t,r){return He.current.useReducer(e,t,r)};ie.useRef=function(e){return He.current.useRef(e)};ie.useState=function(e){return He.current.useState(e)};ie.useSyncExternalStore=function(e,t,r){return He.current.useSyncExternalStore(e,t,r)};ie.useTransition=function(){return He.current.useTransition()};ie.version="18.3.1";hc.exports=ie;var Q=hc.exports;const yc=cc(Q);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var rd=Q,id=Symbol.for("react.element"),sd=Symbol.for("react.fragment"),nd=Object.prototype.hasOwnProperty,od=rd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ad={key:!0,ref:!0,__self:!0,__source:!0};function wc(e,t,r){var i,n={},h=null,m=null;r!==void 0&&(h=""+r),t.key!==void 0&&(h=""+t.key),t.ref!==void 0&&(m=t.ref);for(i in t)nd.call(t,i)&&!ad.hasOwnProperty(i)&&(n[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)n[i]===void 0&&(n[i]=t[i]);return{$$typeof:id,type:e,key:h,ref:m,props:n,_owner:od.current}}Xs.Fragment=sd;Xs.jsx=wc;Xs.jsxs=wc;uc.exports=Xs;var M=uc.exports,Wn={},Cc={exports:{}},Ye={},xc={exports:{}},kc={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(j,E){var D=j.length;j.push(E);e:for(;0<D;){var P=D-1>>>1,O=j[P];if(0<n(O,E))j[P]=E,j[D]=O,D=P;else break e}}function r(j){return j.length===0?null:j[0]}function i(j){if(j.length===0)return null;var E=j[0],D=j.pop();if(D!==E){j[0]=D;e:for(var P=0,O=j.length,W=O>>>1;P<W;){var V=2*(P+1)-1,Z=j[V],ee=V+1,I=j[ee];if(0>n(Z,D))ee<O&&0>n(I,Z)?(j[P]=I,j[ee]=D,P=ee):(j[P]=Z,j[V]=D,P=V);else if(ee<O&&0>n(I,D))j[P]=I,j[ee]=D,P=ee;else break e}}return E}function n(j,E){var D=j.sortIndex-E.sortIndex;return D!==0?D:j.id-E.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var m=Date,a=m.now();e.unstable_now=function(){return m.now()-a}}var c=[],f=[],g=1,d=null,_=3,S=!1,w=!1,v=!1,u=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function l(j){for(var E=r(f);E!==null;){if(E.callback===null)i(f);else if(E.startTime<=j)i(f),E.sortIndex=E.expirationTime,t(c,E);else break;E=r(f)}}function p(j){if(v=!1,l(j),!w)if(r(c)!==null)w=!0,K(C);else{var E=r(f);E!==null&&G(p,E.startTime-j)}}function C(j,E){w=!1,v&&(v=!1,o(y),y=-1),S=!0;var D=_;try{for(l(E),d=r(c);d!==null&&(!(d.expirationTime>E)||j&&!A());){var P=d.callback;if(typeof P=="function"){d.callback=null,_=d.priorityLevel;var O=P(d.expirationTime<=E);E=e.unstable_now(),typeof O=="function"?d.callback=O:d===r(c)&&i(c),l(E)}else i(c);d=r(c)}if(d!==null)var W=!0;else{var V=r(f);V!==null&&G(p,V.startTime-E),W=!1}return W}finally{d=null,_=D,S=!1}}var x=!1,k=null,y=-1,b=5,R=-1;function A(){return!(e.unstable_now()-R<b)}function B(){if(k!==null){var j=e.unstable_now();R=j;var E=!0;try{E=k(!0,j)}finally{E?T():(x=!1,k=null)}}else x=!1}var T;if(typeof s=="function")T=function(){s(B)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,F=N.port2;N.port1.onmessage=B,T=function(){F.postMessage(null)}}else T=function(){u(B,0)};function K(j){k=j,x||(x=!0,T())}function G(j,E){y=u(function(){j(e.unstable_now())},E)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_continueExecution=function(){w||S||(w=!0,K(C))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):b=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(j){switch(_){case 1:case 2:case 3:var E=3;break;default:E=_}var D=_;_=E;try{return j()}finally{_=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,E){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var D=_;_=j;try{return E()}finally{_=D}},e.unstable_scheduleCallback=function(j,E,D){var P=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?P+D:P):D=P,j){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=D+O,j={id:g++,callback:E,priorityLevel:j,startTime:D,expirationTime:O,sortIndex:-1},D>P?(j.sortIndex=D,t(f,j),r(c)===null&&j===r(f)&&(v?(o(y),y=-1):v=!0,G(p,D-P))):(j.sortIndex=O,t(c,j),w||S||(w=!0,K(C))),j},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(j){var E=_;return function(){var D=_;_=E;try{return j.apply(this,arguments)}finally{_=D}}}})(kc);xc.exports=kc;var ld=xc.exports;/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var cd=Q,Qe=ld;function $(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Ec=new Set,Si={};function dr(e,t){Or(e,t),Or(e+"Capture",t)}function Or(e,t){for(Si[e]=t,e=0;e<t.length;e++)Ec.add(t[e])}var bt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Un=Object.prototype.hasOwnProperty,ud=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ga={},Xa={};function hd(e){return Un.call(Xa,e)?!0:Un.call(Ga,e)?!1:ud.test(e)?Xa[e]=!0:(Ga[e]=!0,!1)}function dd(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function fd(e,t,r,i){if(t===null||typeof t>"u"||dd(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Fe(e,t,r,i,n,h,m){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=m}var Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new Fe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new Fe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new Fe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new Fe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Me[e]=new Fe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new Fe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Me[e]=new Fe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Me[e]=new Fe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Me[e]=new Fe(e,5,!1,e.toLowerCase(),null,!1,!1)});var Qo=/[\-:]([a-z])/g;function Yo(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Qo,Yo);Me[t]=new Fe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Qo,Yo);Me[t]=new Fe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Qo,Yo);Me[t]=new Fe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new Fe(e,1,!1,e.toLowerCase(),null,!1,!1)});Me.xlinkHref=new Fe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Me[e]=new Fe(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jo(e,t,r,i){var n=Me.hasOwnProperty(t)?Me[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(fd(t,r,n,i)&&(r=null),i||n===null?hd(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var Tt=cd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qi=Symbol.for("react.element"),_r=Symbol.for("react.portal"),vr=Symbol.for("react.fragment"),Zo=Symbol.for("react.strict_mode"),$n=Symbol.for("react.profiler"),bc=Symbol.for("react.provider"),Lc=Symbol.for("react.context"),ea=Symbol.for("react.forward_ref"),Kn=Symbol.for("react.suspense"),Vn=Symbol.for("react.suspense_list"),ta=Symbol.for("react.memo"),Ot=Symbol.for("react.lazy"),Dc=Symbol.for("react.offscreen"),Qa=Symbol.iterator;function Xr(e){return e===null||typeof e!="object"?null:(e=Qa&&e[Qa]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,vn;function si(e){if(vn===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);vn=t&&t[1]||""}return`
|
|
34
|
-
`+vn+e}var gn=!1;function mn(e,t){if(!e||gn)return"";gn=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var i=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){i=f}e.call(t.prototype)}else{try{throw Error()}catch(f){i=f}e()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var n=f.stack.split(`
|
|
35
|
-
`),h=i.stack.split(`
|
|
36
|
-
`),m=n.length-1,a=h.length-1;1<=m&&0<=a&&n[m]!==h[a];)a--;for(;1<=m&&0<=a;m--,a--)if(n[m]!==h[a]){if(m!==1||a!==1)do if(m--,a--,0>a||n[m]!==h[a]){var c=`
|
|
37
|
-
`+n[m].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=m&&0<=a);break}}}finally{gn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?si(e):""}function pd(e){switch(e.tag){case 5:return si(e.type);case 16:return si("Lazy");case 13:return si("Suspense");case 19:return si("SuspenseList");case 0:case 2:case 15:return e=mn(e.type,!1),e;case 11:return e=mn(e.type.render,!1),e;case 1:return e=mn(e.type,!0),e;default:return""}}function qn(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 vr:return"Fragment";case _r:return"Portal";case $n:return"Profiler";case Zo:return"StrictMode";case Kn:return"Suspense";case Vn:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lc:return(e.displayName||"Context")+".Consumer";case bc:return(e._context.displayName||"Context")+".Provider";case ea:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ta:return t=e.displayName||null,t!==null?t:qn(e.type)||"Memo";case Ot:t=e._payload,e=e._init;try{return qn(e(t))}catch{}}return null}function _d(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 qn(t);case 8:return t===Zo?"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 Gt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Rc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vd(e){var t=Rc(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 n=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(m){i=""+m,h.call(this,m)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(m){i=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Gi(e){e._valueTracker||(e._valueTracker=vd(e))}function Tc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Rc(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function ks(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 Gn(e,t){var r=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ya(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=Gt(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 Pc(e,t){t=t.checked,t!=null&&Jo(e,"checked",t,!1)}function Xn(e,t){Pc(e,t);var r=Gt(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")?Qn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Qn(e,t.type,Gt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ja(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 Qn(e,t,r){(t!=="number"||ks(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var ni=Array.isArray;function Dr(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=""+Gt(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function Yn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error($(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Za(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error($(92));if(ni(r)){if(1<r.length)throw Error($(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Gt(r)}}function Mc(e,t){var r=Gt(t.value),i=Gt(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 el(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ac(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 Jn(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ac(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Xi,Oc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Xi=Xi||document.createElement("div"),Xi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Xi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var li={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},gd=["Webkit","ms","Moz","O"];Object.keys(li).forEach(function(e){gd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),li[t]=li[e]})});function Bc(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||li.hasOwnProperty(e)&&li[e]?(""+t).trim():t+"px"}function Ic(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=Bc(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var md=ye({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 Zn(e,t){if(t){if(md[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error($(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error($(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error($(61))}if(t.style!=null&&typeof t.style!="object")throw Error($(62))}}function eo(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 to=null;function ra(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ro=null,Rr=null,Tr=null;function tl(e){if(e=Fi(e)){if(typeof ro!="function")throw Error($(280));var t=e.stateNode;t&&(t=en(t),ro(e.stateNode,e.type,t))}}function jc(e){Rr?Tr?Tr.push(e):Tr=[e]:Rr=e}function Nc(){if(Rr){var e=Rr,t=Tr;if(Tr=Rr=null,tl(e),t)for(e=0;e<t.length;e++)tl(t[e])}}function Hc(e,t){return e(t)}function Fc(){}var Sn=!1;function zc(e,t,r){if(Sn)return e(t,r);Sn=!0;try{return Hc(e,t,r)}finally{Sn=!1,(Rr!==null||Tr!==null)&&(Fc(),Nc())}}function wi(e,t){var r=e.stateNode;if(r===null)return null;var i=en(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($(231,t,typeof r));return r}var io=!1;if(bt)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){io=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{io=!1}function Sd(e,t,r,i,n,h,m,a,c){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(g){this.onError(g)}}var ci=!1,Es=null,bs=!1,so=null,yd={onError:function(e){ci=!0,Es=e}};function wd(e,t,r,i,n,h,m,a,c){ci=!1,Es=null,Sd.apply(yd,arguments)}function Cd(e,t,r,i,n,h,m,a,c){if(wd.apply(this,arguments),ci){if(ci){var f=Es;ci=!1,Es=null}else throw Error($(198));bs||(bs=!0,so=f)}}function fr(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 Wc(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 rl(e){if(fr(e)!==e)throw Error($(188))}function xd(e){var t=e.alternate;if(!t){if(t=fr(e),t===null)throw Error($(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var h=n.alternate;if(h===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===h.child){for(h=n.child;h;){if(h===r)return rl(n),e;if(h===i)return rl(n),t;h=h.sibling}throw Error($(188))}if(r.return!==i.return)r=n,i=h;else{for(var m=!1,a=n.child;a;){if(a===r){m=!0,r=n,i=h;break}if(a===i){m=!0,i=n,r=h;break}a=a.sibling}if(!m){for(a=h.child;a;){if(a===r){m=!0,r=h,i=n;break}if(a===i){m=!0,i=h,r=n;break}a=a.sibling}if(!m)throw Error($(189))}}if(r.alternate!==i)throw Error($(190))}if(r.tag!==3)throw Error($(188));return r.stateNode.current===r?e:t}function Uc(e){return e=xd(e),e!==null?$c(e):null}function $c(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$c(e);if(t!==null)return t;e=e.sibling}return null}var Kc=Qe.unstable_scheduleCallback,il=Qe.unstable_cancelCallback,kd=Qe.unstable_shouldYield,Ed=Qe.unstable_requestPaint,xe=Qe.unstable_now,bd=Qe.unstable_getCurrentPriorityLevel,ia=Qe.unstable_ImmediatePriority,Vc=Qe.unstable_UserBlockingPriority,Ls=Qe.unstable_NormalPriority,Ld=Qe.unstable_LowPriority,qc=Qe.unstable_IdlePriority,Qs=null,St=null;function Dd(e){if(St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(Qs,e,void 0,(e.current.flags&128)===128)}catch{}}var dt=Math.clz32?Math.clz32:Pd,Rd=Math.log,Td=Math.LN2;function Pd(e){return e>>>=0,e===0?32:31-(Rd(e)/Td|0)|0}var Qi=64,Yi=4194304;function oi(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 Ds(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,h=e.pingedLanes,m=r&268435455;if(m!==0){var a=m&~n;a!==0?i=oi(a):(h&=m,h!==0&&(i=oi(h)))}else m=r&~n,m!==0?i=oi(m):h!==0&&(i=oi(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&n)&&(n=i&-i,h=t&-t,n>=h||n===16&&(h&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-dt(t),n=1<<r,i|=e[r],t&=~n;return i}function Md(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 Ad(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,h=e.pendingLanes;0<h;){var m=31-dt(h),a=1<<m,c=n[m];c===-1?(!(a&r)||a&i)&&(n[m]=Md(a,t)):c<=t&&(e.expiredLanes|=a),h&=~a}}function no(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gc(){var e=Qi;return Qi<<=1,!(Qi&4194240)&&(Qi=64),e}function yn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ni(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dt(t),e[t]=r}function Od(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 n=31-dt(r),h=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~h}}function sa(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-dt(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var oe=0;function Xc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Qc,na,Yc,Jc,Zc,oo=!1,Ji=[],Ft=null,zt=null,Wt=null,Ci=new Map,xi=new Map,It=[],Bd="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 sl(e,t){switch(e){case"focusin":case"focusout":Ft=null;break;case"dragenter":case"dragleave":zt=null;break;case"mouseover":case"mouseout":Wt=null;break;case"pointerover":case"pointerout":Ci.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xi.delete(t.pointerId)}}function Yr(e,t,r,i,n,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[n]},t!==null&&(t=Fi(t),t!==null&&na(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function Id(e,t,r,i,n){switch(t){case"focusin":return Ft=Yr(Ft,e,t,r,i,n),!0;case"dragenter":return zt=Yr(zt,e,t,r,i,n),!0;case"mouseover":return Wt=Yr(Wt,e,t,r,i,n),!0;case"pointerover":var h=n.pointerId;return Ci.set(h,Yr(Ci.get(h)||null,e,t,r,i,n)),!0;case"gotpointercapture":return h=n.pointerId,xi.set(h,Yr(xi.get(h)||null,e,t,r,i,n)),!0}return!1}function eu(e){var t=tr(e.target);if(t!==null){var r=fr(t);if(r!==null){if(t=r.tag,t===13){if(t=Wc(r),t!==null){e.blockedOn=t,Zc(e.priority,function(){Yc(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 fs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);to=i,r.target.dispatchEvent(i),to=null}else return t=Fi(r),t!==null&&na(t),e.blockedOn=r,!1;t.shift()}return!0}function nl(e,t,r){fs(e)&&r.delete(t)}function jd(){oo=!1,Ft!==null&&fs(Ft)&&(Ft=null),zt!==null&&fs(zt)&&(zt=null),Wt!==null&&fs(Wt)&&(Wt=null),Ci.forEach(nl),xi.forEach(nl)}function Jr(e,t){e.blockedOn===t&&(e.blockedOn=null,oo||(oo=!0,Qe.unstable_scheduleCallback(Qe.unstable_NormalPriority,jd)))}function ki(e){function t(n){return Jr(n,e)}if(0<Ji.length){Jr(Ji[0],e);for(var r=1;r<Ji.length;r++){var i=Ji[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Ft!==null&&Jr(Ft,e),zt!==null&&Jr(zt,e),Wt!==null&&Jr(Wt,e),Ci.forEach(t),xi.forEach(t),r=0;r<It.length;r++)i=It[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<It.length&&(r=It[0],r.blockedOn===null);)eu(r),r.blockedOn===null&&It.shift()}var Pr=Tt.ReactCurrentBatchConfig,Rs=!0;function Nd(e,t,r,i){var n=oe,h=Pr.transition;Pr.transition=null;try{oe=1,oa(e,t,r,i)}finally{oe=n,Pr.transition=h}}function Hd(e,t,r,i){var n=oe,h=Pr.transition;Pr.transition=null;try{oe=4,oa(e,t,r,i)}finally{oe=n,Pr.transition=h}}function oa(e,t,r,i){if(Rs){var n=ao(e,t,r,i);if(n===null)Tn(e,t,i,Ts,r),sl(e,i);else if(Id(n,e,t,r,i))i.stopPropagation();else if(sl(e,i),t&4&&-1<Bd.indexOf(e)){for(;n!==null;){var h=Fi(n);if(h!==null&&Qc(h),h=ao(e,t,r,i),h===null&&Tn(e,t,i,Ts,r),h===n)break;n=h}n!==null&&i.stopPropagation()}else Tn(e,t,i,null,r)}}var Ts=null;function ao(e,t,r,i){if(Ts=null,e=ra(i),e=tr(e),e!==null)if(t=fr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Wc(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 Ts=e,null}function tu(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(bd()){case ia:return 1;case Vc:return 4;case Ls:case Ld:return 16;case qc:return 536870912;default:return 16}default:return 16}}var Nt=null,aa=null,ps=null;function ru(){if(ps)return ps;var e,t=aa,r=t.length,i,n="value"in Nt?Nt.value:Nt.textContent,h=n.length;for(e=0;e<r&&t[e]===n[e];e++);var m=r-e;for(i=1;i<=m&&t[r-i]===n[h-i];i++);return ps=n.slice(e,1<i?1-i:void 0)}function _s(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 Zi(){return!0}function ol(){return!1}function Je(e){function t(r,i,n,h,m){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=h,this.target=m,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(h):h[a]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Zi:ol,this.isPropagationStopped=ol,this}return ye(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=Zi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zi)},persist:function(){},isPersistent:Zi}),t}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},la=Je(Ur),Hi=ye({},Ur,{view:0,detail:0}),Fd=Je(Hi),wn,Cn,Zr,Ys=ye({},Hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ca,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!==Zr&&(Zr&&e.type==="mousemove"?(wn=e.screenX-Zr.screenX,Cn=e.screenY-Zr.screenY):Cn=wn=0,Zr=e),wn)},movementY:function(e){return"movementY"in e?e.movementY:Cn}}),al=Je(Ys),zd=ye({},Ys,{dataTransfer:0}),Wd=Je(zd),Ud=ye({},Hi,{relatedTarget:0}),xn=Je(Ud),$d=ye({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Kd=Je($d),Vd=ye({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qd=Je(Vd),Gd=ye({},Ur,{data:0}),ll=Je(Gd),Xd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qd={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"},Yd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jd(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yd[e])?!!t[e]:!1}function ca(){return Jd}var Zd=ye({},Hi,{key:function(e){if(e.key){var t=Xd[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=_s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ca,charCode:function(e){return e.type==="keypress"?_s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?_s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ef=Je(Zd),tf=ye({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cl=Je(tf),rf=ye({},Hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ca}),sf=Je(rf),nf=ye({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),of=Je(nf),af=ye({},Ys,{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}),lf=Je(af),cf=[9,13,27,32],ua=bt&&"CompositionEvent"in window,ui=null;bt&&"documentMode"in document&&(ui=document.documentMode);var uf=bt&&"TextEvent"in window&&!ui,iu=bt&&(!ua||ui&&8<ui&&11>=ui),ul=" ",hl=!1;function su(e,t){switch(e){case"keyup":return cf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gr=!1;function hf(e,t){switch(e){case"compositionend":return nu(t);case"keypress":return t.which!==32?null:(hl=!0,ul);case"textInput":return e=t.data,e===ul&&hl?null:e;default:return null}}function df(e,t){if(gr)return e==="compositionend"||!ua&&su(e,t)?(e=ru(),ps=aa=Nt=null,gr=!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 iu&&t.locale!=="ko"?null:t.data;default:return null}}var ff={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 dl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ff[e.type]:t==="textarea"}function ou(e,t,r,i){jc(i),t=Ps(t,"onChange"),0<t.length&&(r=new la("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var hi=null,Ei=null;function pf(e){gu(e,0)}function Js(e){var t=yr(e);if(Tc(t))return e}function _f(e,t){if(e==="change")return t}var au=!1;if(bt){var kn;if(bt){var En="oninput"in document;if(!En){var fl=document.createElement("div");fl.setAttribute("oninput","return;"),En=typeof fl.oninput=="function"}kn=En}else kn=!1;au=kn&&(!document.documentMode||9<document.documentMode)}function pl(){hi&&(hi.detachEvent("onpropertychange",lu),Ei=hi=null)}function lu(e){if(e.propertyName==="value"&&Js(Ei)){var t=[];ou(t,Ei,e,ra(e)),zc(pf,t)}}function vf(e,t,r){e==="focusin"?(pl(),hi=t,Ei=r,hi.attachEvent("onpropertychange",lu)):e==="focusout"&&pl()}function gf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Js(Ei)}function mf(e,t){if(e==="click")return Js(t)}function Sf(e,t){if(e==="input"||e==="change")return Js(t)}function yf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pt=typeof Object.is=="function"?Object.is:yf;function bi(e,t){if(pt(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 n=r[i];if(!Un.call(t,n)||!pt(e[n],t[n]))return!1}return!0}function _l(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vl(e,t){var r=_l(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=_l(r)}}function cu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function uu(){for(var e=window,t=ks();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ks(e.document)}return t}function ha(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 wf(e){var t=uu(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&cu(r.ownerDocument.documentElement,r)){if(i!==null&&ha(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 n=r.textContent.length,h=Math.min(i.start,n);i=i.end===void 0?h:Math.min(i.end,n),!e.extend&&h>i&&(n=i,i=h,h=n),n=vl(r,h);var m=vl(r,i);n&&m&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==m.node||e.focusOffset!==m.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(m.node,m.offset)):(t.setEnd(m.node,m.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 Cf=bt&&"documentMode"in document&&11>=document.documentMode,mr=null,lo=null,di=null,co=!1;function gl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;co||mr==null||mr!==ks(i)||(i=mr,"selectionStart"in i&&ha(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}),di&&bi(di,i)||(di=i,i=Ps(lo,"onSelect"),0<i.length&&(t=new la("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=mr)))}function es(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Sr={animationend:es("Animation","AnimationEnd"),animationiteration:es("Animation","AnimationIteration"),animationstart:es("Animation","AnimationStart"),transitionend:es("Transition","TransitionEnd")},bn={},hu={};bt&&(hu=document.createElement("div").style,"AnimationEvent"in window||(delete Sr.animationend.animation,delete Sr.animationiteration.animation,delete Sr.animationstart.animation),"TransitionEvent"in window||delete Sr.transitionend.transition);function Zs(e){if(bn[e])return bn[e];if(!Sr[e])return e;var t=Sr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in hu)return bn[e]=t[r];return e}var du=Zs("animationend"),fu=Zs("animationiteration"),pu=Zs("animationstart"),_u=Zs("transitionend"),vu=new Map,ml="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 Qt(e,t){vu.set(e,t),dr(t,[e])}for(var Ln=0;Ln<ml.length;Ln++){var Dn=ml[Ln],xf=Dn.toLowerCase(),kf=Dn[0].toUpperCase()+Dn.slice(1);Qt(xf,"on"+kf)}Qt(du,"onAnimationEnd");Qt(fu,"onAnimationIteration");Qt(pu,"onAnimationStart");Qt("dblclick","onDoubleClick");Qt("focusin","onFocus");Qt("focusout","onBlur");Qt(_u,"onTransitionEnd");Or("onMouseEnter",["mouseout","mouseover"]);Or("onMouseLeave",["mouseout","mouseover"]);Or("onPointerEnter",["pointerout","pointerover"]);Or("onPointerLeave",["pointerout","pointerover"]);dr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));dr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));dr("onBeforeInput",["compositionend","keypress","textInput","paste"]);dr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));dr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));dr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ai="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(" "),Ef=new Set("cancel close invalid load scroll toggle".split(" ").concat(ai));function Sl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Cd(i,t,void 0,e),e.currentTarget=null}function gu(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var m=i.length-1;0<=m;m--){var a=i[m],c=a.instance,f=a.currentTarget;if(a=a.listener,c!==h&&n.isPropagationStopped())break e;Sl(n,a,f),h=c}else for(m=0;m<i.length;m++){if(a=i[m],c=a.instance,f=a.currentTarget,a=a.listener,c!==h&&n.isPropagationStopped())break e;Sl(n,a,f),h=c}}}if(bs)throw e=so,bs=!1,so=null,e}function ue(e,t){var r=t[_o];r===void 0&&(r=t[_o]=new Set);var i=e+"__bubble";r.has(i)||(mu(t,e,2,!1),r.add(i))}function Rn(e,t,r){var i=0;t&&(i|=4),mu(r,e,i,t)}var ts="_reactListening"+Math.random().toString(36).slice(2);function Li(e){if(!e[ts]){e[ts]=!0,Ec.forEach(function(r){r!=="selectionchange"&&(Ef.has(r)||Rn(r,!1,e),Rn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ts]||(t[ts]=!0,Rn("selectionchange",!1,t))}}function mu(e,t,r,i){switch(tu(t)){case 1:var n=Nd;break;case 4:n=Hd;break;default:n=oa}r=n.bind(null,t,r,e),n=void 0,!io||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function Tn(e,t,r,i,n){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var m=i.tag;if(m===3||m===4){var a=i.stateNode.containerInfo;if(a===n||a.nodeType===8&&a.parentNode===n)break;if(m===4)for(m=i.return;m!==null;){var c=m.tag;if((c===3||c===4)&&(c=m.stateNode.containerInfo,c===n||c.nodeType===8&&c.parentNode===n))return;m=m.return}for(;a!==null;){if(m=tr(a),m===null)return;if(c=m.tag,c===5||c===6){i=h=m;continue e}a=a.parentNode}}i=i.return}zc(function(){var f=h,g=ra(r),d=[];e:{var _=vu.get(e);if(_!==void 0){var S=la,w=e;switch(e){case"keypress":if(_s(r)===0)break e;case"keydown":case"keyup":S=ef;break;case"focusin":w="focus",S=xn;break;case"focusout":w="blur",S=xn;break;case"beforeblur":case"afterblur":S=xn;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":S=al;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":S=Wd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":S=sf;break;case du:case fu:case pu:S=Kd;break;case _u:S=of;break;case"scroll":S=Fd;break;case"wheel":S=lf;break;case"copy":case"cut":case"paste":S=qd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":S=cl}var v=(t&4)!==0,u=!v&&e==="scroll",o=v?_!==null?_+"Capture":null:_;v=[];for(var s=f,l;s!==null;){l=s;var p=l.stateNode;if(l.tag===5&&p!==null&&(l=p,o!==null&&(p=wi(s,o),p!=null&&v.push(Di(s,p,l)))),u)break;s=s.return}0<v.length&&(_=new S(_,w,null,r,g),d.push({event:_,listeners:v}))}}if(!(t&7)){e:{if(_=e==="mouseover"||e==="pointerover",S=e==="mouseout"||e==="pointerout",_&&r!==to&&(w=r.relatedTarget||r.fromElement)&&(tr(w)||w[Lt]))break e;if((S||_)&&(_=g.window===g?g:(_=g.ownerDocument)?_.defaultView||_.parentWindow:window,S?(w=r.relatedTarget||r.toElement,S=f,w=w?tr(w):null,w!==null&&(u=fr(w),w!==u||w.tag!==5&&w.tag!==6)&&(w=null)):(S=null,w=f),S!==w)){if(v=al,p="onMouseLeave",o="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(v=cl,p="onPointerLeave",o="onPointerEnter",s="pointer"),u=S==null?_:yr(S),l=w==null?_:yr(w),_=new v(p,s+"leave",S,r,g),_.target=u,_.relatedTarget=l,p=null,tr(g)===f&&(v=new v(o,s+"enter",w,r,g),v.target=l,v.relatedTarget=u,p=v),u=p,S&&w)t:{for(v=S,o=w,s=0,l=v;l;l=pr(l))s++;for(l=0,p=o;p;p=pr(p))l++;for(;0<s-l;)v=pr(v),s--;for(;0<l-s;)o=pr(o),l--;for(;s--;){if(v===o||o!==null&&v===o.alternate)break t;v=pr(v),o=pr(o)}v=null}else v=null;S!==null&&yl(d,_,S,v,!1),w!==null&&u!==null&&yl(d,u,w,v,!0)}}e:{if(_=f?yr(f):window,S=_.nodeName&&_.nodeName.toLowerCase(),S==="select"||S==="input"&&_.type==="file")var C=_f;else if(dl(_))if(au)C=Sf;else{C=gf;var x=vf}else(S=_.nodeName)&&S.toLowerCase()==="input"&&(_.type==="checkbox"||_.type==="radio")&&(C=mf);if(C&&(C=C(e,f))){ou(d,C,r,g);break e}x&&x(e,_,f),e==="focusout"&&(x=_._wrapperState)&&x.controlled&&_.type==="number"&&Qn(_,"number",_.value)}switch(x=f?yr(f):window,e){case"focusin":(dl(x)||x.contentEditable==="true")&&(mr=x,lo=f,di=null);break;case"focusout":di=lo=mr=null;break;case"mousedown":co=!0;break;case"contextmenu":case"mouseup":case"dragend":co=!1,gl(d,r,g);break;case"selectionchange":if(Cf)break;case"keydown":case"keyup":gl(d,r,g)}var k;if(ua)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else gr?su(e,r)&&(y="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(y="onCompositionStart");y&&(iu&&r.locale!=="ko"&&(gr||y!=="onCompositionStart"?y==="onCompositionEnd"&&gr&&(k=ru()):(Nt=g,aa="value"in Nt?Nt.value:Nt.textContent,gr=!0)),x=Ps(f,y),0<x.length&&(y=new ll(y,e,null,r,g),d.push({event:y,listeners:x}),k?y.data=k:(k=nu(r),k!==null&&(y.data=k)))),(k=uf?hf(e,r):df(e,r))&&(f=Ps(f,"onBeforeInput"),0<f.length&&(g=new ll("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:f}),g.data=k))}gu(d,t)})}function Di(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ps(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,h=n.stateNode;n.tag===5&&h!==null&&(n=h,h=wi(e,r),h!=null&&i.unshift(Di(e,h,n)),h=wi(e,t),h!=null&&i.push(Di(e,h,n))),e=e.return}return i}function pr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yl(e,t,r,i,n){for(var h=t._reactName,m=[];r!==null&&r!==i;){var a=r,c=a.alternate,f=a.stateNode;if(c!==null&&c===i)break;a.tag===5&&f!==null&&(a=f,n?(c=wi(r,h),c!=null&&m.unshift(Di(r,c,a))):n||(c=wi(r,h),c!=null&&m.push(Di(r,c,a)))),r=r.return}m.length!==0&&e.push({event:t,listeners:m})}var bf=/\r\n?/g,Lf=/\u0000|\uFFFD/g;function wl(e){return(typeof e=="string"?e:""+e).replace(bf,`
|
|
38
|
-
`).replace(Lf,"")}function rs(e,t,r){if(t=wl(t),wl(e)!==t&&r)throw Error($(425))}function Ms(){}var uo=null,ho=null;function fo(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 po=typeof setTimeout=="function"?setTimeout:void 0,Df=typeof clearTimeout=="function"?clearTimeout:void 0,Cl=typeof Promise=="function"?Promise:void 0,Rf=typeof queueMicrotask=="function"?queueMicrotask:typeof Cl<"u"?function(e){return Cl.resolve(null).then(e).catch(Tf)}:po;function Tf(e){setTimeout(function(){throw e})}function Pn(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(i===0){e.removeChild(n),ki(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);ki(t)}function Ut(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 xl(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 $r=Math.random().toString(36).slice(2),mt="__reactFiber$"+$r,Ri="__reactProps$"+$r,Lt="__reactContainer$"+$r,_o="__reactEvents$"+$r,Pf="__reactListeners$"+$r,Mf="__reactHandles$"+$r;function tr(e){var t=e[mt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Lt]||r[mt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=xl(e);e!==null;){if(r=e[mt])return r;e=xl(e)}return t}e=r,r=e.parentNode}return null}function Fi(e){return e=e[mt]||e[Lt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function yr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error($(33))}function en(e){return e[Ri]||null}var vo=[],wr=-1;function Yt(e){return{current:e}}function de(e){0>wr||(e.current=vo[wr],vo[wr]=null,wr--)}function ce(e,t){wr++,vo[wr]=e.current,e.current=t}var Xt={},Ie=Yt(Xt),$e=Yt(!1),ar=Xt;function Br(e,t){var r=e.type.contextTypes;if(!r)return Xt;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},h;for(h in r)n[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Ke(e){return e=e.childContextTypes,e!=null}function As(){de($e),de(Ie)}function kl(e,t,r){if(Ie.current!==Xt)throw Error($(168));ce(Ie,t),ce($e,r)}function Su(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error($(108,_d(e)||"Unknown",n));return ye({},r,i)}function Os(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xt,ar=Ie.current,ce(Ie,e),ce($e,$e.current),!0}function El(e,t,r){var i=e.stateNode;if(!i)throw Error($(169));r?(e=Su(e,t,ar),i.__reactInternalMemoizedMergedChildContext=e,de($e),de(Ie),ce(Ie,e)):de($e),ce($e,r)}var Ct=null,tn=!1,Mn=!1;function yu(e){Ct===null?Ct=[e]:Ct.push(e)}function Af(e){tn=!0,yu(e)}function Jt(){if(!Mn&&Ct!==null){Mn=!0;var e=0,t=oe;try{var r=Ct;for(oe=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Ct=null,tn=!1}catch(n){throw Ct!==null&&(Ct=Ct.slice(e+1)),Kc(ia,Jt),n}finally{oe=t,Mn=!1}}return null}var Cr=[],xr=0,Bs=null,Is=0,rt=[],it=0,lr=null,xt=1,kt="";function Zt(e,t){Cr[xr++]=Is,Cr[xr++]=Bs,Bs=e,Is=t}function wu(e,t,r){rt[it++]=xt,rt[it++]=kt,rt[it++]=lr,lr=e;var i=xt;e=kt;var n=32-dt(i)-1;i&=~(1<<n),r+=1;var h=32-dt(t)+n;if(30<h){var m=n-n%5;h=(i&(1<<m)-1).toString(32),i>>=m,n-=m,xt=1<<32-dt(t)+n|r<<n|i,kt=h+e}else xt=1<<h|r<<n|i,kt=e}function da(e){e.return!==null&&(Zt(e,1),wu(e,1,0))}function fa(e){for(;e===Bs;)Bs=Cr[--xr],Cr[xr]=null,Is=Cr[--xr],Cr[xr]=null;for(;e===lr;)lr=rt[--it],rt[it]=null,kt=rt[--it],rt[it]=null,xt=rt[--it],rt[it]=null}var Xe=null,Ge=null,pe=!1,ht=null;function Cu(e,t){var r=st(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 bl(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,Xe=e,Ge=Ut(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Xe=e,Ge=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=lr!==null?{id:xt,overflow:kt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=st(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Xe=e,Ge=null,!0):!1;default:return!1}}function go(e){return(e.mode&1)!==0&&(e.flags&128)===0}function mo(e){if(pe){var t=Ge;if(t){var r=t;if(!bl(e,t)){if(go(e))throw Error($(418));t=Ut(r.nextSibling);var i=Xe;t&&bl(e,t)?Cu(i,r):(e.flags=e.flags&-4097|2,pe=!1,Xe=e)}}else{if(go(e))throw Error($(418));e.flags=e.flags&-4097|2,pe=!1,Xe=e}}}function Ll(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xe=e}function is(e){if(e!==Xe)return!1;if(!pe)return Ll(e),pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fo(e.type,e.memoizedProps)),t&&(t=Ge)){if(go(e))throw xu(),Error($(418));for(;t;)Cu(e,t),t=Ut(t.nextSibling)}if(Ll(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error($(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Ge=Ut(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ge=null}}else Ge=Xe?Ut(e.stateNode.nextSibling):null;return!0}function xu(){for(var e=Ge;e;)e=Ut(e.nextSibling)}function Ir(){Ge=Xe=null,pe=!1}function pa(e){ht===null?ht=[e]:ht.push(e)}var Of=Tt.ReactCurrentBatchConfig;function ei(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($(309));var i=r.stateNode}if(!i)throw Error($(147,e));var n=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(m){var a=n.refs;m===null?delete a[h]:a[h]=m},t._stringRef=h,t)}if(typeof e!="string")throw Error($(284));if(!r._owner)throw Error($(290,e))}return e}function ss(e,t){throw e=Object.prototype.toString.call(t),Error($(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dl(e){var t=e._init;return t(e._payload)}function ku(e){function t(o,s){if(e){var l=o.deletions;l===null?(o.deletions=[s],o.flags|=16):l.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 n(o,s){return o=qt(o,s),o.index=0,o.sibling=null,o}function h(o,s,l){return o.index=l,e?(l=o.alternate,l!==null?(l=l.index,l<s?(o.flags|=2,s):l):(o.flags|=2,s)):(o.flags|=1048576,s)}function m(o){return e&&o.alternate===null&&(o.flags|=2),o}function a(o,s,l,p){return s===null||s.tag!==6?(s=Hn(l,o.mode,p),s.return=o,s):(s=n(s,l),s.return=o,s)}function c(o,s,l,p){var C=l.type;return C===vr?g(o,s,l.props.children,p,l.key):s!==null&&(s.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Ot&&Dl(C)===s.type)?(p=n(s,l.props),p.ref=ei(o,s,l),p.return=o,p):(p=Cs(l.type,l.key,l.props,null,o.mode,p),p.ref=ei(o,s,l),p.return=o,p)}function f(o,s,l,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==l.containerInfo||s.stateNode.implementation!==l.implementation?(s=Fn(l,o.mode,p),s.return=o,s):(s=n(s,l.children||[]),s.return=o,s)}function g(o,s,l,p,C){return s===null||s.tag!==7?(s=nr(l,o.mode,p,C),s.return=o,s):(s=n(s,l),s.return=o,s)}function d(o,s,l){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Hn(""+s,o.mode,l),s.return=o,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case qi:return l=Cs(s.type,s.key,s.props,null,o.mode,l),l.ref=ei(o,null,s),l.return=o,l;case _r:return s=Fn(s,o.mode,l),s.return=o,s;case Ot:var p=s._init;return d(o,p(s._payload),l)}if(ni(s)||Xr(s))return s=nr(s,o.mode,l,null),s.return=o,s;ss(o,s)}return null}function _(o,s,l,p){var C=s!==null?s.key:null;if(typeof l=="string"&&l!==""||typeof l=="number")return C!==null?null:a(o,s,""+l,p);if(typeof l=="object"&&l!==null){switch(l.$$typeof){case qi:return l.key===C?c(o,s,l,p):null;case _r:return l.key===C?f(o,s,l,p):null;case Ot:return C=l._init,_(o,s,C(l._payload),p)}if(ni(l)||Xr(l))return C!==null?null:g(o,s,l,p,null);ss(o,l)}return null}function S(o,s,l,p,C){if(typeof p=="string"&&p!==""||typeof p=="number")return o=o.get(l)||null,a(s,o,""+p,C);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case qi:return o=o.get(p.key===null?l:p.key)||null,c(s,o,p,C);case _r:return o=o.get(p.key===null?l:p.key)||null,f(s,o,p,C);case Ot:var x=p._init;return S(o,s,l,x(p._payload),C)}if(ni(p)||Xr(p))return o=o.get(l)||null,g(s,o,p,C,null);ss(s,p)}return null}function w(o,s,l,p){for(var C=null,x=null,k=s,y=s=0,b=null;k!==null&&y<l.length;y++){k.index>y?(b=k,k=null):b=k.sibling;var R=_(o,k,l[y],p);if(R===null){k===null&&(k=b);break}e&&k&&R.alternate===null&&t(o,k),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R,k=b}if(y===l.length)return r(o,k),pe&&Zt(o,y),C;if(k===null){for(;y<l.length;y++)k=d(o,l[y],p),k!==null&&(s=h(k,s,y),x===null?C=k:x.sibling=k,x=k);return pe&&Zt(o,y),C}for(k=i(o,k);y<l.length;y++)b=S(k,o,y,l[y],p),b!==null&&(e&&b.alternate!==null&&k.delete(b.key===null?y:b.key),s=h(b,s,y),x===null?C=b:x.sibling=b,x=b);return e&&k.forEach(function(A){return t(o,A)}),pe&&Zt(o,y),C}function v(o,s,l,p){var C=Xr(l);if(typeof C!="function")throw Error($(150));if(l=C.call(l),l==null)throw Error($(151));for(var x=C=null,k=s,y=s=0,b=null,R=l.next();k!==null&&!R.done;y++,R=l.next()){k.index>y?(b=k,k=null):b=k.sibling;var A=_(o,k,R.value,p);if(A===null){k===null&&(k=b);break}e&&k&&A.alternate===null&&t(o,k),s=h(A,s,y),x===null?C=A:x.sibling=A,x=A,k=b}if(R.done)return r(o,k),pe&&Zt(o,y),C;if(k===null){for(;!R.done;y++,R=l.next())R=d(o,R.value,p),R!==null&&(s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return pe&&Zt(o,y),C}for(k=i(o,k);!R.done;y++,R=l.next())R=S(k,o,y,R.value,p),R!==null&&(e&&R.alternate!==null&&k.delete(R.key===null?y:R.key),s=h(R,s,y),x===null?C=R:x.sibling=R,x=R);return e&&k.forEach(function(B){return t(o,B)}),pe&&Zt(o,y),C}function u(o,s,l,p){if(typeof l=="object"&&l!==null&&l.type===vr&&l.key===null&&(l=l.props.children),typeof l=="object"&&l!==null){switch(l.$$typeof){case qi:e:{for(var C=l.key,x=s;x!==null;){if(x.key===C){if(C=l.type,C===vr){if(x.tag===7){r(o,x.sibling),s=n(x,l.props.children),s.return=o,o=s;break e}}else if(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Ot&&Dl(C)===x.type){r(o,x.sibling),s=n(x,l.props),s.ref=ei(o,x,l),s.return=o,o=s;break e}r(o,x);break}else t(o,x);x=x.sibling}l.type===vr?(s=nr(l.props.children,o.mode,p,l.key),s.return=o,o=s):(p=Cs(l.type,l.key,l.props,null,o.mode,p),p.ref=ei(o,s,l),p.return=o,o=p)}return m(o);case _r:e:{for(x=l.key;s!==null;){if(s.key===x)if(s.tag===4&&s.stateNode.containerInfo===l.containerInfo&&s.stateNode.implementation===l.implementation){r(o,s.sibling),s=n(s,l.children||[]),s.return=o,o=s;break e}else{r(o,s);break}else t(o,s);s=s.sibling}s=Fn(l,o.mode,p),s.return=o,o=s}return m(o);case Ot:return x=l._init,u(o,s,x(l._payload),p)}if(ni(l))return w(o,s,l,p);if(Xr(l))return v(o,s,l,p);ss(o,l)}return typeof l=="string"&&l!==""||typeof l=="number"?(l=""+l,s!==null&&s.tag===6?(r(o,s.sibling),s=n(s,l),s.return=o,o=s):(r(o,s),s=Hn(l,o.mode,p),s.return=o,o=s),m(o)):r(o,s)}return u}var jr=ku(!0),Eu=ku(!1),js=Yt(null),Ns=null,kr=null,_a=null;function va(){_a=kr=Ns=null}function ga(e){var t=js.current;de(js),e._currentValue=t}function So(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 Mr(e,t){Ns=e,_a=kr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ue=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(_a!==e)if(e={context:e,memoizedValue:t,next:null},kr===null){if(Ns===null)throw Error($(308));kr=e,Ns.dependencies={lanes:0,firstContext:e}}else kr=kr.next=e;return t}var rr=null;function ma(e){rr===null?rr=[e]:rr.push(e)}function bu(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,ma(t)):(r.next=n.next,n.next=r),t.interleaved=r,Dt(e,i)}function Dt(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 Bt=!1;function Sa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Lu(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 Et(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $t(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ne&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,Dt(e,r)}return n=i.interleaved,n===null?(t.next=t,ma(i)):(t.next=n.next,n.next=t),i.interleaved=t,Dt(e,r)}function vs(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,sa(e,r)}}function Rl(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var m={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?n=h=m:h=h.next=m,r=r.next}while(r!==null);h===null?n=h=t:h=h.next=t}else n=h=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:h,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 Hs(e,t,r,i){var n=e.updateQueue;Bt=!1;var h=n.firstBaseUpdate,m=n.lastBaseUpdate,a=n.shared.pending;if(a!==null){n.shared.pending=null;var c=a,f=c.next;c.next=null,m===null?h=f:m.next=f,m=c;var g=e.alternate;g!==null&&(g=g.updateQueue,a=g.lastBaseUpdate,a!==m&&(a===null?g.firstBaseUpdate=f:a.next=f,g.lastBaseUpdate=c))}if(h!==null){var d=n.baseState;m=0,g=f=c=null,a=h;do{var _=a.lane,S=a.eventTime;if((i&_)===_){g!==null&&(g=g.next={eventTime:S,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,v=a;switch(_=t,S=r,v.tag){case 1:if(w=v.payload,typeof w=="function"){d=w.call(S,d,_);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,_=typeof w=="function"?w.call(S,d,_):w,_==null)break e;d=ye({},d,_);break e;case 2:Bt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,_=n.effects,_===null?n.effects=[a]:_.push(a))}else S={eventTime:S,lane:_,tag:a.tag,payload:a.payload,callback:a.callback,next:null},g===null?(f=g=S,c=d):g=g.next=S,m|=_;if(a=a.next,a===null){if(a=n.shared.pending,a===null)break;_=a,a=_.next,_.next=null,n.lastBaseUpdate=_,n.shared.pending=null}}while(!0);if(g===null&&(c=d),n.baseState=c,n.firstBaseUpdate=f,n.lastBaseUpdate=g,t=n.shared.interleaved,t!==null){n=t;do m|=n.lane,n=n.next;while(n!==t)}else h===null&&(n.shared.lanes=0);ur|=m,e.lanes=m,e.memoizedState=d}}function Tl(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!="function")throw Error($(191,n));n.call(i)}}}var zi={},yt=Yt(zi),Ti=Yt(zi),Pi=Yt(zi);function ir(e){if(e===zi)throw Error($(174));return e}function ya(e,t){switch(ce(Pi,t),ce(Ti,e),ce(yt,zi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jn(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jn(t,e)}de(yt),ce(yt,t)}function Nr(){de(yt),de(Ti),de(Pi)}function Du(e){ir(Pi.current);var t=ir(yt.current),r=Jn(t,e.type);t!==r&&(ce(Ti,e),ce(yt,r))}function wa(e){Ti.current===e&&(de(yt),de(Ti))}var ge=Yt(0);function Fs(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 An=[];function Ca(){for(var e=0;e<An.length;e++)An[e]._workInProgressVersionPrimary=null;An.length=0}var gs=Tt.ReactCurrentDispatcher,On=Tt.ReactCurrentBatchConfig,cr=0,Se=null,Ee=null,Le=null,zs=!1,fi=!1,Mi=0,Bf=0;function Ae(){throw Error($(321))}function xa(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!pt(e[r],t[r]))return!1;return!0}function ka(e,t,r,i,n,h){if(cr=h,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gs.current=e===null||e.memoizedState===null?Hf:Ff,e=r(i,n),fi){h=0;do{if(fi=!1,Mi=0,25<=h)throw Error($(301));h+=1,Le=Ee=null,t.updateQueue=null,gs.current=zf,e=r(i,n)}while(fi)}if(gs.current=Ws,t=Ee!==null&&Ee.next!==null,cr=0,Le=Ee=Se=null,zs=!1,t)throw Error($(300));return e}function Ea(){var e=Mi!==0;return Mi=0,e}function gt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?Se.memoizedState=Le=e:Le=Le.next=e,Le}function at(){if(Ee===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Le===null?Se.memoizedState:Le.next;if(t!==null)Le=t,Ee=e;else{if(e===null)throw Error($(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Le===null?Se.memoizedState=Le=e:Le=Le.next=e}return Le}function Ai(e,t){return typeof t=="function"?t(e):t}function Bn(e){var t=at(),r=t.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=e;var i=Ee,n=i.baseQueue,h=r.pending;if(h!==null){if(n!==null){var m=n.next;n.next=h.next,h.next=m}i.baseQueue=n=h,r.pending=null}if(n!==null){h=n.next,i=i.baseState;var a=m=null,c=null,f=h;do{var g=f.lane;if((cr&g)===g)c!==null&&(c=c.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:e(i,f.action);else{var d={lane:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(a=c=d,m=i):c=c.next=d,Se.lanes|=g,ur|=g}f=f.next}while(f!==null&&f!==h);c===null?m=i:c.next=a,pt(i,t.memoizedState)||(Ue=!0),t.memoizedState=i,t.baseState=m,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do h=n.lane,Se.lanes|=h,ur|=h,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function In(e){var t=at(),r=t.queue;if(r===null)throw Error($(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,h=t.memoizedState;if(n!==null){r.pending=null;var m=n=n.next;do h=e(h,m.action),m=m.next;while(m!==n);pt(h,t.memoizedState)||(Ue=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function Ru(){}function Tu(e,t){var r=Se,i=at(),n=t(),h=!pt(i.memoizedState,n);if(h&&(i.memoizedState=n,Ue=!0),i=i.queue,ba(Au.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Le!==null&&Le.memoizedState.tag&1){if(r.flags|=2048,Oi(9,Mu.bind(null,r,i,n,t),void 0,null),De===null)throw Error($(349));cr&30||Pu(r,t,n)}return n}function Pu(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Mu(e,t,r,i){t.value=r,t.getSnapshot=i,Ou(t)&&Bu(e)}function Au(e,t,r){return r(function(){Ou(t)&&Bu(e)})}function Ou(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!pt(e,r)}catch{return!0}}function Bu(e){var t=Dt(e,1);t!==null&&ft(t,e,1,-1)}function Pl(e){var t=gt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:e},t.queue=e,e=e.dispatch=Nf.bind(null,Se,e),[t.memoizedState,e]}function Oi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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 Iu(){return at().memoizedState}function ms(e,t,r,i){var n=gt();Se.flags|=e,n.memoizedState=Oi(1|t,r,void 0,i===void 0?null:i)}function rn(e,t,r,i){var n=at();i=i===void 0?null:i;var h=void 0;if(Ee!==null){var m=Ee.memoizedState;if(h=m.destroy,i!==null&&xa(i,m.deps)){n.memoizedState=Oi(t,r,h,i);return}}Se.flags|=e,n.memoizedState=Oi(1|t,r,h,i)}function Ml(e,t){return ms(8390656,8,e,t)}function ba(e,t){return rn(2048,8,e,t)}function ju(e,t){return rn(4,2,e,t)}function Nu(e,t){return rn(4,4,e,t)}function Hu(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 Fu(e,t,r){return r=r!=null?r.concat([e]):null,rn(4,4,Hu.bind(null,t,e),r)}function La(){}function zu(e,t){var r=at();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&xa(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Wu(e,t){var r=at();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&xa(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Uu(e,t,r){return cr&21?(pt(r,t)||(r=Gc(),Se.lanes|=r,ur|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ue=!0),e.memoizedState=r)}function If(e,t){var r=oe;oe=r!==0&&4>r?r:4,e(!0);var i=On.transition;On.transition={};try{e(!1),t()}finally{oe=r,On.transition=i}}function $u(){return at().memoizedState}function jf(e,t,r){var i=Vt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Ku(e))Vu(t,r);else if(r=bu(e,t,r,i),r!==null){var n=Ne();ft(r,e,i,n),qu(r,t,i)}}function Nf(e,t,r){var i=Vt(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ku(e))Vu(t,n);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var m=t.lastRenderedState,a=h(m,r);if(n.hasEagerState=!0,n.eagerState=a,pt(a,m)){var c=t.interleaved;c===null?(n.next=n,ma(t)):(n.next=c.next,c.next=n),t.interleaved=n;return}}catch{}finally{}r=bu(e,t,n,i),r!==null&&(n=Ne(),ft(r,e,i,n),qu(r,t,i))}}function Ku(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Vu(e,t){fi=zs=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function qu(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,sa(e,r)}}var Ws={readContext:ot,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},Hf={readContext:ot,useCallback:function(e,t){return gt().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:Ml,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,ms(4194308,4,Hu.bind(null,t,e),r)},useLayoutEffect:function(e,t){return ms(4194308,4,e,t)},useInsertionEffect:function(e,t){return ms(4,2,e,t)},useMemo:function(e,t){var r=gt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=gt();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=jf.bind(null,Se,e),[i.memoizedState,e]},useRef:function(e){var t=gt();return e={current:e},t.memoizedState=e},useState:Pl,useDebugValue:La,useDeferredValue:function(e){return gt().memoizedState=e},useTransition:function(){var e=Pl(!1),t=e[0];return e=If.bind(null,e[1]),gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=Se,n=gt();if(pe){if(r===void 0)throw Error($(407));r=r()}else{if(r=t(),De===null)throw Error($(349));cr&30||Pu(i,t,r)}n.memoizedState=r;var h={value:r,getSnapshot:t};return n.queue=h,Ml(Au.bind(null,i,h,e),[e]),i.flags|=2048,Oi(9,Mu.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=gt(),t=De.identifierPrefix;if(pe){var r=kt,i=xt;r=(i&~(1<<32-dt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Mi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Bf++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ff={readContext:ot,useCallback:zu,useContext:ot,useEffect:ba,useImperativeHandle:Fu,useInsertionEffect:ju,useLayoutEffect:Nu,useMemo:Wu,useReducer:Bn,useRef:Iu,useState:function(){return Bn(Ai)},useDebugValue:La,useDeferredValue:function(e){var t=at();return Uu(t,Ee.memoizedState,e)},useTransition:function(){var e=Bn(Ai)[0],t=at().memoizedState;return[e,t]},useMutableSource:Ru,useSyncExternalStore:Tu,useId:$u,unstable_isNewReconciler:!1},zf={readContext:ot,useCallback:zu,useContext:ot,useEffect:ba,useImperativeHandle:Fu,useInsertionEffect:ju,useLayoutEffect:Nu,useMemo:Wu,useReducer:In,useRef:Iu,useState:function(){return In(Ai)},useDebugValue:La,useDeferredValue:function(e){var t=at();return Ee===null?t.memoizedState=e:Uu(t,Ee.memoizedState,e)},useTransition:function(){var e=In(Ai)[0],t=at().memoizedState;return[e,t]},useMutableSource:Ru,useSyncExternalStore:Tu,useId:$u,unstable_isNewReconciler:!1};function ct(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function yo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:ye({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sn={isMounted:function(e){return(e=e._reactInternals)?fr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Ne(),n=Vt(e),h=Et(i,n);h.payload=t,r!=null&&(h.callback=r),t=$t(e,h,n),t!==null&&(ft(t,e,n,i),vs(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Ne(),n=Vt(e),h=Et(i,n);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=$t(e,h,n),t!==null&&(ft(t,e,n,i),vs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ne(),i=Vt(e),n=Et(r,i);n.tag=2,t!=null&&(n.callback=t),t=$t(e,n,i),t!==null&&(ft(t,e,i,r),vs(t,e,i))}};function Al(e,t,r,i,n,h,m){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,m):t.prototype&&t.prototype.isPureReactComponent?!bi(r,i)||!bi(n,h):!0}function Gu(e,t,r){var i=!1,n=Xt,h=t.contextType;return typeof h=="object"&&h!==null?h=ot(h):(n=Ke(t)?ar:Ie.current,i=t.contextTypes,h=(i=i!=null)?Br(e,n):Xt),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sn,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),t}function Ol(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&&sn.enqueueReplaceState(t,t.state,null)}function wo(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},Sa(e);var h=t.contextType;typeof h=="object"&&h!==null?n.context=ot(h):(h=Ke(t)?ar:Ie.current,n.context=Br(e,h)),n.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(yo(e,t,h,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&sn.enqueueReplaceState(n,n.state,null),Hs(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Hr(e,t){try{var r="",i=t;do r+=pd(i),i=i.return;while(i);var n=r}catch(h){n=`
|
|
39
|
-
Error generating stack: `+h.message+`
|
|
40
|
-
`+h.stack}return{value:e,source:t,stack:n,digest:null}}function jn(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Co(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Wf=typeof WeakMap=="function"?WeakMap:Map;function Xu(e,t,r){r=Et(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){$s||($s=!0,Mo=i),Co(e,t)},r}function Qu(e,t,r){r=Et(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){Co(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){Co(e,t),typeof i!="function"&&(Kt===null?Kt=new Set([this]):Kt.add(this));var m=t.stack;this.componentDidCatch(t.value,{componentStack:m!==null?m:""})}),r}function Bl(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Wf;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=rp.bind(null,e,t,r),t.then(e,e))}function Il(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 jl(e,t,r,i,n){return e.mode&1?(e.flags|=65536,e.lanes=n,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=Et(-1,1),t.tag=2,$t(r,t,1))),r.lanes|=1),e)}var Uf=Tt.ReactCurrentOwner,Ue=!1;function je(e,t,r,i){t.child=e===null?Eu(t,null,r,i):jr(t,e.child,r,i)}function Nl(e,t,r,i,n){r=r.render;var h=t.ref;return Mr(t,n),i=ka(e,t,r,i,h,n),r=Ea(),e!==null&&!Ue?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Rt(e,t,n)):(pe&&r&&da(t),t.flags|=1,je(e,t,i,n),t.child)}function Hl(e,t,r,i,n){if(e===null){var h=r.type;return typeof h=="function"&&!Ba(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,Yu(e,t,h,i,n)):(e=Cs(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&n)){var m=h.memoizedProps;if(r=r.compare,r=r!==null?r:bi,r(m,i)&&e.ref===t.ref)return Rt(e,t,n)}return t.flags|=1,e=qt(h,i),e.ref=t.ref,e.return=t,t.child=e}function Yu(e,t,r,i,n){if(e!==null){var h=e.memoizedProps;if(bi(h,i)&&e.ref===t.ref)if(Ue=!1,t.pendingProps=i=h,(e.lanes&n)!==0)e.flags&131072&&(Ue=!0);else return t.lanes=e.lanes,Rt(e,t,n)}return xo(e,t,r,i,n)}function Ju(e,t,r){var i=t.pendingProps,n=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ce(br,qe),qe|=r;else{if(!(r&1073741824))return e=h!==null?h.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ce(br,qe),qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ce(br,qe),qe|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ce(br,qe),qe|=i;return je(e,t,n,r),t.child}function Zu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function xo(e,t,r,i,n){var h=Ke(r)?ar:Ie.current;return h=Br(t,h),Mr(t,n),r=ka(e,t,r,i,h,n),i=Ea(),e!==null&&!Ue?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,Rt(e,t,n)):(pe&&i&&da(t),t.flags|=1,je(e,t,r,n),t.child)}function Fl(e,t,r,i,n){if(Ke(r)){var h=!0;Os(t)}else h=!1;if(Mr(t,n),t.stateNode===null)Ss(e,t),Gu(t,r,i),wo(t,r,i,n),i=!0;else if(e===null){var m=t.stateNode,a=t.memoizedProps;m.props=a;var c=m.context,f=r.contextType;typeof f=="object"&&f!==null?f=ot(f):(f=Ke(r)?ar:Ie.current,f=Br(t,f));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof m.getSnapshotBeforeUpdate=="function";d||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(a!==i||c!==f)&&Ol(t,m,i,f),Bt=!1;var _=t.memoizedState;m.state=_,Hs(t,i,m,n),c=t.memoizedState,a!==i||_!==c||$e.current||Bt?(typeof g=="function"&&(yo(t,r,g,i),c=t.memoizedState),(a=Bt||Al(t,r,a,i,_,c,f))?(d||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),m.props=i,m.state=c,m.context=f,i=a):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,Lu(e,t),a=t.memoizedProps,f=t.type===t.elementType?a:ct(t.type,a),m.props=f,d=t.pendingProps,_=m.context,c=r.contextType,typeof c=="object"&&c!==null?c=ot(c):(c=Ke(r)?ar:Ie.current,c=Br(t,c));var S=r.getDerivedStateFromProps;(g=typeof S=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(a!==d||_!==c)&&Ol(t,m,i,c),Bt=!1,_=t.memoizedState,m.state=_,Hs(t,i,m,n);var w=t.memoizedState;a!==d||_!==w||$e.current||Bt?(typeof S=="function"&&(yo(t,r,S,i),w=t.memoizedState),(f=Bt||Al(t,r,f,i,_,w,c)||!1)?(g||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,w,c),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,w,c)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),m.props=i,m.state=w,m.context=c,i=f):(typeof m.componentDidUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&_===e.memoizedState||(t.flags|=1024),i=!1)}return ko(e,t,r,i,h,n)}function ko(e,t,r,i,n,h){Zu(e,t);var m=(t.flags&128)!==0;if(!i&&!m)return n&&El(t,r,!1),Rt(e,t,h);i=t.stateNode,Uf.current=t;var a=m&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&m?(t.child=jr(t,e.child,null,h),t.child=jr(t,null,a,h)):je(e,t,a,h),t.memoizedState=i.state,n&&El(t,r,!0),t.child}function eh(e){var t=e.stateNode;t.pendingContext?kl(e,t.pendingContext,t.pendingContext!==t.context):t.context&&kl(e,t.context,!1),ya(e,t.containerInfo)}function zl(e,t,r,i,n){return Ir(),pa(n),t.flags|=256,je(e,t,r,i),t.child}var Eo={dehydrated:null,treeContext:null,retryLane:0};function bo(e){return{baseLanes:e,cachePool:null,transitions:null}}function th(e,t,r){var i=t.pendingProps,n=ge.current,h=!1,m=(t.flags&128)!==0,a;if((a=m)||(a=e!==null&&e.memoizedState===null?!1:(n&2)!==0),a?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),ce(ge,n&1),e===null)return mo(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):(m=i.children,e=i.fallback,h?(i=t.mode,h=t.child,m={mode:"hidden",children:m},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=m):h=an(m,i,0,null),e=nr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=bo(r),t.memoizedState=Eo,e):Da(t,m));if(n=e.memoizedState,n!==null&&(a=n.dehydrated,a!==null))return $f(e,t,m,i,a,n,r);if(h){h=i.fallback,m=t.mode,n=e.child,a=n.sibling;var c={mode:"hidden",children:i.children};return!(m&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=qt(n,c),i.subtreeFlags=n.subtreeFlags&14680064),a!==null?h=qt(a,h):(h=nr(h,m,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,m=e.child.memoizedState,m=m===null?bo(r):{baseLanes:m.baseLanes|r,cachePool:null,transitions:m.transitions},h.memoizedState=m,h.childLanes=e.childLanes&~r,t.memoizedState=Eo,i}return h=e.child,e=h.sibling,i=qt(h,{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 Da(e,t){return t=an({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ns(e,t,r,i){return i!==null&&pa(i),jr(t,e.child,null,r),e=Da(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $f(e,t,r,i,n,h,m){if(r)return t.flags&256?(t.flags&=-257,i=jn(Error($(422))),ns(e,t,m,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,n=t.mode,i=an({mode:"visible",children:i.children},n,0,null),h=nr(h,n,m,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&jr(t,e.child,null,m),t.child.memoizedState=bo(m),t.memoizedState=Eo,h);if(!(t.mode&1))return ns(e,t,m,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var a=i.dgst;return i=a,h=Error($(419)),i=jn(h,i,void 0),ns(e,t,m,i)}if(a=(m&e.childLanes)!==0,Ue||a){if(i=De,i!==null){switch(m&-m){case 4:n=2;break;case 16:n=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:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|m)?0:n,n!==0&&n!==h.retryLane&&(h.retryLane=n,Dt(e,n),ft(i,e,n,-1))}return Oa(),i=jn(Error($(421))),ns(e,t,m,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=ip.bind(null,e),n._reactRetry=t,null):(e=h.treeContext,Ge=Ut(n.nextSibling),Xe=t,pe=!0,ht=null,e!==null&&(rt[it++]=xt,rt[it++]=kt,rt[it++]=lr,xt=e.id,kt=e.overflow,lr=t),t=Da(t,i.children),t.flags|=4096,t)}function Wl(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),So(e.return,t,r)}function Nn(e,t,r,i,n){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=n)}function rh(e,t,r){var i=t.pendingProps,n=i.revealOrder,h=i.tail;if(je(e,t,i.children,r),i=ge.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&&Wl(e,r,t);else if(e.tag===19)Wl(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(ce(ge,i),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&Fs(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),Nn(t,!1,n,r,h);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Fs(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}Nn(t,!0,r,null,h);break;case"together":Nn(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Rt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ur|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error($(153));if(t.child!==null){for(e=t.child,r=qt(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=qt(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Kf(e,t,r){switch(t.tag){case 3:eh(t),Ir();break;case 5:Du(t);break;case 1:Ke(t.type)&&Os(t);break;case 4:ya(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;ce(js,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ce(ge,ge.current&1),t.flags|=128,null):r&t.child.childLanes?th(e,t,r):(ce(ge,ge.current&1),e=Rt(e,t,r),e!==null?e.sibling:null);ce(ge,ge.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return rh(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ce(ge,ge.current),i)break;return null;case 22:case 23:return t.lanes=0,Ju(e,t,r)}return Rt(e,t,r)}var ih,Lo,sh,nh;ih=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}};Lo=function(){};sh=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,ir(yt.current);var h=null;switch(r){case"input":n=Gn(e,n),i=Gn(e,i),h=[];break;case"select":n=ye({},n,{value:void 0}),i=ye({},i,{value:void 0}),h=[];break;case"textarea":n=Yn(e,n),i=Yn(e,i),h=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Ms)}Zn(r,i);var m;r=null;for(f in n)if(!i.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var a=n[f];for(m in a)a.hasOwnProperty(m)&&(r||(r={}),r[m]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Si.hasOwnProperty(f)?h||(h=[]):(h=h||[]).push(f,null));for(f in i){var c=i[f];if(a=n!=null?n[f]:void 0,i.hasOwnProperty(f)&&c!==a&&(c!=null||a!=null))if(f==="style")if(a){for(m in a)!a.hasOwnProperty(m)||c&&c.hasOwnProperty(m)||(r||(r={}),r[m]="");for(m in c)c.hasOwnProperty(m)&&a[m]!==c[m]&&(r||(r={}),r[m]=c[m])}else r||(h||(h=[]),h.push(f,r)),r=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(h=h||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(h=h||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Si.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&ue("scroll",e),h||a===c||(h=[])):(h=h||[]).push(f,c))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};nh=function(e,t,r,i){r!==i&&(t.flags|=4)};function ti(e,t){if(!pe)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 Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Vf(e,t,r){var i=t.pendingProps;switch(fa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Ke(t.type)&&As(),Oe(t),null;case 3:return i=t.stateNode,Nr(),de($e),de(Ie),Ca(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(is(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ht!==null&&(Bo(ht),ht=null))),Lo(e,t),Oe(t),null;case 5:wa(t);var n=ir(Pi.current);if(r=t.type,e!==null&&t.stateNode!=null)sh(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error($(166));return Oe(t),null}if(e=ir(yt.current),is(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[mt]=t,i[Ri]=h,e=(t.mode&1)!==0,r){case"dialog":ue("cancel",i),ue("close",i);break;case"iframe":case"object":case"embed":ue("load",i);break;case"video":case"audio":for(n=0;n<ai.length;n++)ue(ai[n],i);break;case"source":ue("error",i);break;case"img":case"image":case"link":ue("error",i),ue("load",i);break;case"details":ue("toggle",i);break;case"input":Ya(i,h),ue("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},ue("invalid",i);break;case"textarea":Za(i,h),ue("invalid",i)}Zn(r,h),n=null;for(var m in h)if(h.hasOwnProperty(m)){var a=h[m];m==="children"?typeof a=="string"?i.textContent!==a&&(h.suppressHydrationWarning!==!0&&rs(i.textContent,a,e),n=["children",a]):typeof a=="number"&&i.textContent!==""+a&&(h.suppressHydrationWarning!==!0&&rs(i.textContent,a,e),n=["children",""+a]):Si.hasOwnProperty(m)&&a!=null&&m==="onScroll"&&ue("scroll",i)}switch(r){case"input":Gi(i),Ja(i,h,!0);break;case"textarea":Gi(i),el(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=Ms)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{m=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ac(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=m.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=m.createElement(r,{is:i.is}):(e=m.createElement(r),r==="select"&&(m=e,i.multiple?m.multiple=!0:i.size&&(m.size=i.size))):e=m.createElementNS(e,r),e[mt]=t,e[Ri]=i,ih(e,t,!1,!1),t.stateNode=e;e:{switch(m=eo(r,i),r){case"dialog":ue("cancel",e),ue("close",e),n=i;break;case"iframe":case"object":case"embed":ue("load",e),n=i;break;case"video":case"audio":for(n=0;n<ai.length;n++)ue(ai[n],e);n=i;break;case"source":ue("error",e),n=i;break;case"img":case"image":case"link":ue("error",e),ue("load",e),n=i;break;case"details":ue("toggle",e),n=i;break;case"input":Ya(e,i),n=Gn(e,i),ue("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=ye({},i,{value:void 0}),ue("invalid",e);break;case"textarea":Za(e,i),n=Yn(e,i),ue("invalid",e);break;default:n=i}Zn(r,n),a=n;for(h in a)if(a.hasOwnProperty(h)){var c=a[h];h==="style"?Ic(e,c):h==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Oc(e,c)):h==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&yi(e,c):typeof c=="number"&&yi(e,""+c):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(Si.hasOwnProperty(h)?c!=null&&h==="onScroll"&&ue("scroll",e):c!=null&&Jo(e,h,c,m))}switch(r){case"input":Gi(e),Ja(e,i,!1);break;case"textarea":Gi(e),el(e);break;case"option":i.value!=null&&e.setAttribute("value",""+Gt(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?Dr(e,!!i.multiple,h,!1):i.defaultValue!=null&&Dr(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Ms)}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 Oe(t),null;case 6:if(e&&t.stateNode!=null)nh(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error($(166));if(r=ir(Pi.current),ir(yt.current),is(t)){if(i=t.stateNode,r=t.memoizedProps,i[mt]=t,(h=i.nodeValue!==r)&&(e=Xe,e!==null))switch(e.tag){case 3:rs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rs(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[mt]=t,t.stateNode=i}return Oe(t),null;case 13:if(de(ge),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pe&&Ge!==null&&t.mode&1&&!(t.flags&128))xu(),Ir(),t.flags|=98560,h=!1;else if(h=is(t),i!==null&&i.dehydrated!==null){if(e===null){if(!h)throw Error($(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error($(317));h[mt]=t}else Ir(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),h=!1}else ht!==null&&(Bo(ht),ht=null),h=!0;if(!h)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||ge.current&1?be===0&&(be=3):Oa())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return Nr(),Lo(e,t),e===null&&Li(t.stateNode.containerInfo),Oe(t),null;case 10:return ga(t.type._context),Oe(t),null;case 17:return Ke(t.type)&&As(),Oe(t),null;case 19:if(de(ge),h=t.memoizedState,h===null)return Oe(t),null;if(i=(t.flags&128)!==0,m=h.rendering,m===null)if(i)ti(h,!1);else{if(be!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(m=Fs(e),m!==null){for(t.flags|=128,ti(h,!1),i=m.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)h=r,e=i,h.flags&=14680066,m=h.alternate,m===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=m.childLanes,h.lanes=m.lanes,h.child=m.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=m.memoizedProps,h.memoizedState=m.memoizedState,h.updateQueue=m.updateQueue,h.type=m.type,e=m.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ce(ge,ge.current&1|2),t.child}e=e.sibling}h.tail!==null&&xe()>Fr&&(t.flags|=128,i=!0,ti(h,!1),t.lanes=4194304)}else{if(!i)if(e=Fs(m),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ti(h,!0),h.tail===null&&h.tailMode==="hidden"&&!m.alternate&&!pe)return Oe(t),null}else 2*xe()-h.renderingStartTime>Fr&&r!==1073741824&&(t.flags|=128,i=!0,ti(h,!1),t.lanes=4194304);h.isBackwards?(m.sibling=t.child,t.child=m):(r=h.last,r!==null?r.sibling=m:t.child=m,h.last=m)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=xe(),t.sibling=null,r=ge.current,ce(ge,i?r&1|2:r&1),t):(Oe(t),null);case 22:case 23:return Aa(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?qe&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error($(156,t.tag))}function qf(e,t){switch(fa(t),t.tag){case 1:return Ke(t.type)&&As(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Nr(),de($e),de(Ie),Ca(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wa(t),null;case 13:if(de(ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error($(340));Ir()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ge),null;case 4:return Nr(),null;case 10:return ga(t.type._context),null;case 22:case 23:return Aa(),null;case 24:return null;default:return null}}var os=!1,Be=!1,Gf=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Er(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){we(e,t,i)}else r.current=null}function Do(e,t,r){try{r()}catch(i){we(e,t,i)}}var Ul=!1;function Xf(e,t){if(uo=Rs,e=uu(),ha(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 n=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var m=0,a=-1,c=-1,f=0,g=0,d=e,_=null;t:for(;;){for(var S;d!==r||n!==0&&d.nodeType!==3||(a=m+n),d!==h||i!==0&&d.nodeType!==3||(c=m+i),d.nodeType===3&&(m+=d.nodeValue.length),(S=d.firstChild)!==null;)_=d,d=S;for(;;){if(d===e)break t;if(_===r&&++f===n&&(a=m),_===h&&++g===i&&(c=m),(S=d.nextSibling)!==null)break;d=_,_=d.parentNode}d=S}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ho={focusedElem:e,selectionRange:r},Rs=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,u=w.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?v:ct(t.type,v),u);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var l=t.stateNode.containerInfo;l.nodeType===1?l.textContent="":l.nodeType===9&&l.documentElement&&l.removeChild(l.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($(163))}}catch(p){we(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return w=Ul,Ul=!1,w}function pi(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var h=n.destroy;n.destroy=void 0,h!==void 0&&Do(t,r,h)}n=n.next}while(n!==i)}}function nn(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 Ro(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 oh(e){var t=e.alternate;t!==null&&(e.alternate=null,oh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[mt],delete t[Ri],delete t[_o],delete t[Pf],delete t[Mf])),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 ah(e){return e.tag===5||e.tag===3||e.tag===4}function $l(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ah(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 To(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=Ms));else if(i!==4&&(e=e.child,e!==null))for(To(e,t,r),e=e.sibling;e!==null;)To(e,t,r),e=e.sibling}function Po(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(Po(e,t,r),e=e.sibling;e!==null;)Po(e,t,r),e=e.sibling}var Re=null,ut=!1;function At(e,t,r){for(r=r.child;r!==null;)lh(e,t,r),r=r.sibling}function lh(e,t,r){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(Qs,r)}catch{}switch(r.tag){case 5:Be||Er(r,t);case 6:var i=Re,n=ut;Re=null,At(e,t,r),Re=i,ut=n,Re!==null&&(ut?(e=Re,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Re.removeChild(r.stateNode));break;case 18:Re!==null&&(ut?(e=Re,r=r.stateNode,e.nodeType===8?Pn(e.parentNode,r):e.nodeType===1&&Pn(e,r),ki(e)):Pn(Re,r.stateNode));break;case 4:i=Re,n=ut,Re=r.stateNode.containerInfo,ut=!0,At(e,t,r),Re=i,ut=n;break;case 0:case 11:case 14:case 15:if(!Be&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var h=n,m=h.destroy;h=h.tag,m!==void 0&&(h&2||h&4)&&Do(r,t,m),n=n.next}while(n!==i)}At(e,t,r);break;case 1:if(!Be&&(Er(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(a){we(r,t,a)}At(e,t,r);break;case 21:At(e,t,r);break;case 22:r.mode&1?(Be=(i=Be)||r.memoizedState!==null,At(e,t,r),Be=i):At(e,t,r);break;default:At(e,t,r)}}function Kl(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Gf),t.forEach(function(i){var n=sp.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function lt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var h=e,m=t,a=m;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,ut=!1;break e;case 3:Re=a.stateNode.containerInfo,ut=!0;break e;case 4:Re=a.stateNode.containerInfo,ut=!0;break e}a=a.return}if(Re===null)throw Error($(160));lh(h,m,n),Re=null,ut=!1;var c=n.alternate;c!==null&&(c.return=null),n.return=null}catch(f){we(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ch(t,e),t=t.sibling}function ch(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lt(t,e),vt(e),i&4){try{pi(3,e,e.return),nn(3,e)}catch(v){we(e,e.return,v)}try{pi(5,e,e.return)}catch(v){we(e,e.return,v)}}break;case 1:lt(t,e),vt(e),i&512&&r!==null&&Er(r,r.return);break;case 5:if(lt(t,e),vt(e),i&512&&r!==null&&Er(r,r.return),e.flags&32){var n=e.stateNode;try{yi(n,"")}catch(v){we(e,e.return,v)}}if(i&4&&(n=e.stateNode,n!=null)){var h=e.memoizedProps,m=r!==null?r.memoizedProps:h,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&h.type==="radio"&&h.name!=null&&Pc(n,h),eo(a,m);var f=eo(a,h);for(m=0;m<c.length;m+=2){var g=c[m],d=c[m+1];g==="style"?Ic(n,d):g==="dangerouslySetInnerHTML"?Oc(n,d):g==="children"?yi(n,d):Jo(n,g,d,f)}switch(a){case"input":Xn(n,h);break;case"textarea":Mc(n,h);break;case"select":var _=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!h.multiple;var S=h.value;S!=null?Dr(n,!!h.multiple,S,!1):_!==!!h.multiple&&(h.defaultValue!=null?Dr(n,!!h.multiple,h.defaultValue,!0):Dr(n,!!h.multiple,h.multiple?[]:"",!1))}n[Ri]=h}catch(v){we(e,e.return,v)}}break;case 6:if(lt(t,e),vt(e),i&4){if(e.stateNode===null)throw Error($(162));n=e.stateNode,h=e.memoizedProps;try{n.nodeValue=h}catch(v){we(e,e.return,v)}}break;case 3:if(lt(t,e),vt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ki(t.containerInfo)}catch(v){we(e,e.return,v)}break;case 4:lt(t,e),vt(e);break;case 13:lt(t,e),vt(e),n=e.child,n.flags&8192&&(h=n.memoizedState!==null,n.stateNode.isHidden=h,!h||n.alternate!==null&&n.alternate.memoizedState!==null||(Pa=xe())),i&4&&Kl(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Be=(f=Be)||g,lt(t,e),Be=f):lt(t,e),vt(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(Y=e,g=e.child;g!==null;){for(d=Y=g;Y!==null;){switch(_=Y,S=_.child,_.tag){case 0:case 11:case 14:case 15:pi(4,_,_.return);break;case 1:Er(_,_.return);var w=_.stateNode;if(typeof w.componentWillUnmount=="function"){i=_,r=_.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){we(i,r,v)}}break;case 5:Er(_,_.return);break;case 22:if(_.memoizedState!==null){ql(d);continue}}S!==null?(S.return=_,Y=S):ql(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{n=d.stateNode,f?(h=n.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(a=d.stateNode,c=d.memoizedProps.style,m=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=Bc("display",m))}catch(v){we(e,e.return,v)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(v){we(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:lt(t,e),vt(e),i&4&&Kl(e);break;case 21:break;default:lt(t,e),vt(e)}}function vt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ah(r)){var i=r;break e}r=r.return}throw Error($(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(yi(n,""),i.flags&=-33);var h=$l(e);Po(e,h,n);break;case 3:case 4:var m=i.stateNode.containerInfo,a=$l(e);To(e,a,m);break;default:throw Error($(161))}}catch(c){we(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qf(e,t,r){Y=e,uh(e)}function uh(e,t,r){for(var i=(e.mode&1)!==0;Y!==null;){var n=Y,h=n.child;if(n.tag===22&&i){var m=n.memoizedState!==null||os;if(!m){var a=n.alternate,c=a!==null&&a.memoizedState!==null||Be;a=os;var f=Be;if(os=m,(Be=c)&&!f)for(Y=n;Y!==null;)m=Y,c=m.child,m.tag===22&&m.memoizedState!==null?Gl(n):c!==null?(c.return=m,Y=c):Gl(n);for(;h!==null;)Y=h,uh(h),h=h.sibling;Y=n,os=a,Be=f}Vl(e)}else n.subtreeFlags&8772&&h!==null?(h.return=n,Y=h):Vl(e)}}function Vl(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Be||nn(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Be)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:ct(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&Tl(t,h,i);break;case 3:var m=t.updateQueue;if(m!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Tl(t,m,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;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 f=t.alternate;if(f!==null){var g=f.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&ki(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error($(163))}Be||t.flags&512&&Ro(t)}catch(_){we(t,t.return,_)}}if(t===e){Y=null;break}if(r=t.sibling,r!==null){r.return=t.return,Y=r;break}Y=t.return}}function ql(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Y=r;break}Y=t.return}}function Gl(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{nn(4,t)}catch(c){we(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(c){we(t,n,c)}}var h=t.return;try{Ro(t)}catch(c){we(t,h,c)}break;case 5:var m=t.return;try{Ro(t)}catch(c){we(t,m,c)}}}catch(c){we(t,t.return,c)}if(t===e){Y=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Y=a;break}Y=t.return}}var Yf=Math.ceil,Us=Tt.ReactCurrentDispatcher,Ra=Tt.ReactCurrentOwner,nt=Tt.ReactCurrentBatchConfig,ne=0,De=null,ke=null,Pe=0,qe=0,br=Yt(0),be=0,Bi=null,ur=0,on=0,Ta=0,_i=null,We=null,Pa=0,Fr=1/0,wt=null,$s=!1,Mo=null,Kt=null,as=!1,Ht=null,Ks=0,vi=0,Ao=null,ys=-1,ws=0;function Ne(){return ne&6?xe():ys!==-1?ys:ys=xe()}function Vt(e){return e.mode&1?ne&2&&Pe!==0?Pe&-Pe:Of.transition!==null?(ws===0&&(ws=Gc()),ws):(e=oe,e!==0||(e=window.event,e=e===void 0?16:tu(e.type)),e):1}function ft(e,t,r,i){if(50<vi)throw vi=0,Ao=null,Error($(185));Ni(e,r,i),(!(ne&2)||e!==De)&&(e===De&&(!(ne&2)&&(on|=r),be===4&&jt(e,Pe)),Ve(e,i),r===1&&ne===0&&!(t.mode&1)&&(Fr=xe()+500,tn&&Jt()))}function Ve(e,t){var r=e.callbackNode;Ad(e,t);var i=Ds(e,e===De?Pe:0);if(i===0)r!==null&&il(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&il(r),t===1)e.tag===0?Af(Xl.bind(null,e)):yu(Xl.bind(null,e)),Rf(function(){!(ne&6)&&Jt()}),r=null;else{switch(Xc(i)){case 1:r=ia;break;case 4:r=Vc;break;case 16:r=Ls;break;case 536870912:r=qc;break;default:r=Ls}r=mh(r,hh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function hh(e,t){if(ys=-1,ws=0,ne&6)throw Error($(327));var r=e.callbackNode;if(Ar()&&e.callbackNode!==r)return null;var i=Ds(e,e===De?Pe:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=Vs(e,i);else{t=i;var n=ne;ne|=2;var h=fh();(De!==e||Pe!==t)&&(wt=null,Fr=xe()+500,sr(e,t));do try{ep();break}catch(a){dh(e,a)}while(!0);va(),Us.current=h,ne=n,ke!==null?t=0:(De=null,Pe=0,t=be)}if(t!==0){if(t===2&&(n=no(e),n!==0&&(i=n,t=Oo(e,n))),t===1)throw r=Bi,sr(e,0),jt(e,i),Ve(e,xe()),r;if(t===6)jt(e,i);else{if(n=e.current.alternate,!(i&30)&&!Jf(n)&&(t=Vs(e,i),t===2&&(h=no(e),h!==0&&(i=h,t=Oo(e,h))),t===1))throw r=Bi,sr(e,0),jt(e,i),Ve(e,xe()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error($(345));case 2:er(e,We,wt);break;case 3:if(jt(e,i),(i&130023424)===i&&(t=Pa+500-xe(),10<t)){if(Ds(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){Ne(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=po(er.bind(null,e,We,wt),t);break}er(e,We,wt);break;case 4:if(jt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var m=31-dt(i);h=1<<m,m=t[m],m>n&&(n=m),i&=~h}if(i=n,i=xe()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Yf(i/1960))-i,10<i){e.timeoutHandle=po(er.bind(null,e,We,wt),i);break}er(e,We,wt);break;case 5:er(e,We,wt);break;default:throw Error($(329))}}}return Ve(e,xe()),e.callbackNode===r?hh.bind(null,e):null}function Oo(e,t){var r=_i;return e.current.memoizedState.isDehydrated&&(sr(e,t).flags|=256),e=Vs(e,t),e!==2&&(t=We,We=r,t!==null&&Bo(t)),e}function Bo(e){We===null?We=e:We.push.apply(We,e)}function Jf(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 n=r[i],h=n.getSnapshot;n=n.value;try{if(!pt(h(),n))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 jt(e,t){for(t&=~Ta,t&=~on,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-dt(t),i=1<<r;e[r]=-1,t&=~i}}function Xl(e){if(ne&6)throw Error($(327));Ar();var t=Ds(e,0);if(!(t&1))return Ve(e,xe()),null;var r=Vs(e,t);if(e.tag!==0&&r===2){var i=no(e);i!==0&&(t=i,r=Oo(e,i))}if(r===1)throw r=Bi,sr(e,0),jt(e,t),Ve(e,xe()),r;if(r===6)throw Error($(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,er(e,We,wt),Ve(e,xe()),null}function Ma(e,t){var r=ne;ne|=1;try{return e(t)}finally{ne=r,ne===0&&(Fr=xe()+500,tn&&Jt())}}function hr(e){Ht!==null&&Ht.tag===0&&!(ne&6)&&Ar();var t=ne;ne|=1;var r=nt.transition,i=oe;try{if(nt.transition=null,oe=1,e)return e()}finally{oe=i,nt.transition=r,ne=t,!(ne&6)&&Jt()}}function Aa(){qe=br.current,de(br)}function sr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Df(r)),ke!==null)for(r=ke.return;r!==null;){var i=r;switch(fa(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&As();break;case 3:Nr(),de($e),de(Ie),Ca();break;case 5:wa(i);break;case 4:Nr();break;case 13:de(ge);break;case 19:de(ge);break;case 10:ga(i.type._context);break;case 22:case 23:Aa()}r=r.return}if(De=e,ke=e=qt(e.current,null),Pe=qe=t,be=0,Bi=null,Ta=on=ur=0,We=_i=null,rr!==null){for(t=0;t<rr.length;t++)if(r=rr[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,h=r.pending;if(h!==null){var m=h.next;h.next=n,i.next=m}r.pending=i}rr=null}return e}function dh(e,t){do{var r=ke;try{if(va(),gs.current=Ws,zs){for(var i=Se.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}zs=!1}if(cr=0,Le=Ee=Se=null,fi=!1,Mi=0,Ra.current=null,r===null||r.return===null){be=1,Bi=t,ke=null;break}e:{var h=e,m=r.return,a=r,c=t;if(t=Pe,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,g=a,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var _=g.alternate;_?(g.updateQueue=_.updateQueue,g.memoizedState=_.memoizedState,g.lanes=_.lanes):(g.updateQueue=null,g.memoizedState=null)}var S=Il(m);if(S!==null){S.flags&=-257,jl(S,m,a,h,t),S.mode&1&&Bl(h,f,t),t=S,c=f;var w=t.updateQueue;if(w===null){var v=new Set;v.add(c),t.updateQueue=v}else w.add(c);break e}else{if(!(t&1)){Bl(h,f,t),Oa();break e}c=Error($(426))}}else if(pe&&a.mode&1){var u=Il(m);if(u!==null){!(u.flags&65536)&&(u.flags|=256),jl(u,m,a,h,t),pa(Hr(c,a));break e}}h=c=Hr(c,a),be!==4&&(be=2),_i===null?_i=[h]:_i.push(h),h=m;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var o=Xu(h,c,t);Rl(h,o);break e;case 1:a=c;var s=h.type,l=h.stateNode;if(!(h.flags&128)&&(typeof s.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Kt===null||!Kt.has(l)))){h.flags|=65536,t&=-t,h.lanes|=t;var p=Qu(h,a,t);Rl(h,p);break e}}h=h.return}while(h!==null)}_h(r)}catch(C){t=C,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function fh(){var e=Us.current;return Us.current=Ws,e===null?Ws:e}function Oa(){(be===0||be===3||be===2)&&(be=4),De===null||!(ur&268435455)&&!(on&268435455)||jt(De,Pe)}function Vs(e,t){var r=ne;ne|=2;var i=fh();(De!==e||Pe!==t)&&(wt=null,sr(e,t));do try{Zf();break}catch(n){dh(e,n)}while(!0);if(va(),ne=r,Us.current=i,ke!==null)throw Error($(261));return De=null,Pe=0,be}function Zf(){for(;ke!==null;)ph(ke)}function ep(){for(;ke!==null&&!kd();)ph(ke)}function ph(e){var t=gh(e.alternate,e,qe);e.memoizedProps=e.pendingProps,t===null?_h(e):ke=t,Ra.current=null}function _h(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=qf(r,t),r!==null){r.flags&=32767,ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{be=6,ke=null;return}}else if(r=Vf(r,t,qe),r!==null){ke=r;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);be===0&&(be=5)}function er(e,t,r){var i=oe,n=nt.transition;try{nt.transition=null,oe=1,tp(e,t,r,i)}finally{nt.transition=n,oe=i}return null}function tp(e,t,r,i){do Ar();while(Ht!==null);if(ne&6)throw Error($(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error($(177));e.callbackNode=null,e.callbackPriority=0;var h=r.lanes|r.childLanes;if(Od(e,h),e===De&&(ke=De=null,Pe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||as||(as=!0,mh(Ls,function(){return Ar(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=nt.transition,nt.transition=null;var m=oe;oe=1;var a=ne;ne|=4,Ra.current=null,Xf(e,r),ch(r,e),wf(ho),Rs=!!uo,ho=uo=null,e.current=r,Qf(r),Ed(),ne=a,oe=m,nt.transition=h}else e.current=r;if(as&&(as=!1,Ht=e,Ks=n),h=e.pendingLanes,h===0&&(Kt=null),Dd(r.stateNode),Ve(e,xe()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if($s)throw $s=!1,e=Mo,Mo=null,e;return Ks&1&&e.tag!==0&&Ar(),h=e.pendingLanes,h&1?e===Ao?vi++:(vi=0,Ao=e):vi=0,Jt(),null}function Ar(){if(Ht!==null){var e=Xc(Ks),t=nt.transition,r=oe;try{if(nt.transition=null,oe=16>e?16:e,Ht===null)var i=!1;else{if(e=Ht,Ht=null,Ks=0,ne&6)throw Error($(331));var n=ne;for(ne|=4,Y=e.current;Y!==null;){var h=Y,m=h.child;if(Y.flags&16){var a=h.deletions;if(a!==null){for(var c=0;c<a.length;c++){var f=a[c];for(Y=f;Y!==null;){var g=Y;switch(g.tag){case 0:case 11:case 15:pi(8,g,h)}var d=g.child;if(d!==null)d.return=g,Y=d;else for(;Y!==null;){g=Y;var _=g.sibling,S=g.return;if(oh(g),g===f){Y=null;break}if(_!==null){_.return=S,Y=_;break}Y=S}}}var w=h.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var u=v.sibling;v.sibling=null,v=u}while(v!==null)}}Y=h}}if(h.subtreeFlags&2064&&m!==null)m.return=h,Y=m;else e:for(;Y!==null;){if(h=Y,h.flags&2048)switch(h.tag){case 0:case 11:case 15:pi(9,h,h.return)}var o=h.sibling;if(o!==null){o.return=h.return,Y=o;break e}Y=h.return}}var s=e.current;for(Y=s;Y!==null;){m=Y;var l=m.child;if(m.subtreeFlags&2064&&l!==null)l.return=m,Y=l;else e:for(m=s;Y!==null;){if(a=Y,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:nn(9,a)}}catch(C){we(a,a.return,C)}if(a===m){Y=null;break e}var p=a.sibling;if(p!==null){p.return=a.return,Y=p;break e}Y=a.return}}if(ne=n,Jt(),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(Qs,e)}catch{}i=!0}return i}finally{oe=r,nt.transition=t}}return!1}function Ql(e,t,r){t=Hr(r,t),t=Xu(e,t,1),e=$t(e,t,1),t=Ne(),e!==null&&(Ni(e,1,t),Ve(e,t))}function we(e,t,r){if(e.tag===3)Ql(e,e,r);else for(;t!==null;){if(t.tag===3){Ql(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Kt===null||!Kt.has(i))){e=Hr(r,e),e=Qu(t,e,1),t=$t(t,e,1),e=Ne(),t!==null&&(Ni(t,1,e),Ve(t,e));break}}t=t.return}}function rp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Ne(),e.pingedLanes|=e.suspendedLanes&r,De===e&&(Pe&r)===r&&(be===4||be===3&&(Pe&130023424)===Pe&&500>xe()-Pa?sr(e,0):Ta|=r),Ve(e,t)}function vh(e,t){t===0&&(e.mode&1?(t=Yi,Yi<<=1,!(Yi&130023424)&&(Yi=4194304)):t=1);var r=Ne();e=Dt(e,t),e!==null&&(Ni(e,t,r),Ve(e,r))}function ip(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),vh(e,r)}function sp(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error($(314))}i!==null&&i.delete(t),vh(e,r)}var gh;gh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||$e.current)Ue=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ue=!1,Kf(e,t,r);Ue=!!(e.flags&131072)}else Ue=!1,pe&&t.flags&1048576&&wu(t,Is,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Ss(e,t),e=t.pendingProps;var n=Br(t,Ie.current);Mr(t,r),n=ka(null,t,i,e,n,r);var h=Ea();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(i)?(h=!0,Os(t)):h=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Sa(t),n.updater=sn,t.stateNode=n,n._reactInternals=t,wo(t,i,e,r),t=ko(null,t,i,!0,h,r)):(t.tag=0,pe&&h&&da(t),je(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=op(i),e=ct(i,e),n){case 0:t=xo(null,t,i,e,r);break e;case 1:t=Fl(null,t,i,e,r);break e;case 11:t=Nl(null,t,i,e,r);break e;case 14:t=Hl(null,t,i,ct(i.type,e),r);break e}throw Error($(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ct(i,n),xo(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ct(i,n),Fl(e,t,i,n,r);case 3:e:{if(eh(t),e===null)throw Error($(387));i=t.pendingProps,h=t.memoizedState,n=h.element,Lu(e,t),Hs(t,i,null,r);var m=t.memoizedState;if(i=m.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){n=Hr(Error($(423)),t),t=zl(e,t,i,r,n);break e}else if(i!==n){n=Hr(Error($(424)),t),t=zl(e,t,i,r,n);break e}else for(Ge=Ut(t.stateNode.containerInfo.firstChild),Xe=t,pe=!0,ht=null,r=Eu(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ir(),i===n){t=Rt(e,t,r);break e}je(e,t,i,r)}t=t.child}return t;case 5:return Du(t),e===null&&mo(t),i=t.type,n=t.pendingProps,h=e!==null?e.memoizedProps:null,m=n.children,fo(i,n)?m=null:h!==null&&fo(i,h)&&(t.flags|=32),Zu(e,t),je(e,t,m,r),t.child;case 6:return e===null&&mo(t),null;case 13:return th(e,t,r);case 4:return ya(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=jr(t,null,i,r):je(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ct(i,n),Nl(e,t,i,n,r);case 7:return je(e,t,t.pendingProps,r),t.child;case 8:return je(e,t,t.pendingProps.children,r),t.child;case 12:return je(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,h=t.memoizedProps,m=n.value,ce(js,i._currentValue),i._currentValue=m,h!==null)if(pt(h.value,m)){if(h.children===n.children&&!$e.current){t=Rt(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var a=h.dependencies;if(a!==null){m=h.child;for(var c=a.firstContext;c!==null;){if(c.context===i){if(h.tag===1){c=Et(-1,r&-r),c.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?c.next=c:(c.next=g.next,g.next=c),f.pending=c}}h.lanes|=r,c=h.alternate,c!==null&&(c.lanes|=r),So(h.return,r,t),a.lanes|=r;break}c=c.next}}else if(h.tag===10)m=h.type===t.type?null:h.child;else if(h.tag===18){if(m=h.return,m===null)throw Error($(341));m.lanes|=r,a=m.alternate,a!==null&&(a.lanes|=r),So(m,r,t),m=h.sibling}else m=h.child;if(m!==null)m.return=h;else for(m=h;m!==null;){if(m===t){m=null;break}if(h=m.sibling,h!==null){h.return=m.return,m=h;break}m=m.return}h=m}je(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,Mr(t,r),n=ot(n),i=i(n),t.flags|=1,je(e,t,i,r),t.child;case 14:return i=t.type,n=ct(i,t.pendingProps),n=ct(i.type,n),Hl(e,t,i,n,r);case 15:return Yu(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:ct(i,n),Ss(e,t),t.tag=1,Ke(i)?(e=!0,Os(t)):e=!1,Mr(t,r),Gu(t,i,n),wo(t,i,n,r),ko(null,t,i,!0,e,r);case 19:return rh(e,t,r);case 22:return Ju(e,t,r)}throw Error($(156,t.tag))};function mh(e,t){return Kc(e,t)}function np(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 st(e,t,r,i){return new np(e,t,r,i)}function Ba(e){return e=e.prototype,!(!e||!e.isReactComponent)}function op(e){if(typeof e=="function")return Ba(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ea)return 11;if(e===ta)return 14}return 2}function qt(e,t){var r=e.alternate;return r===null?(r=st(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 Cs(e,t,r,i,n,h){var m=2;if(i=e,typeof e=="function")Ba(e)&&(m=1);else if(typeof e=="string")m=5;else e:switch(e){case vr:return nr(r.children,n,h,t);case Zo:m=8,n|=8;break;case $n:return e=st(12,r,t,n|2),e.elementType=$n,e.lanes=h,e;case Kn:return e=st(13,r,t,n),e.elementType=Kn,e.lanes=h,e;case Vn:return e=st(19,r,t,n),e.elementType=Vn,e.lanes=h,e;case Dc:return an(r,n,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bc:m=10;break e;case Lc:m=9;break e;case ea:m=11;break e;case ta:m=14;break e;case Ot:m=16,i=null;break e}throw Error($(130,e==null?e:typeof e,""))}return t=st(m,r,t,n),t.elementType=e,t.type=i,t.lanes=h,t}function nr(e,t,r,i){return e=st(7,e,i,t),e.lanes=r,e}function an(e,t,r,i){return e=st(22,e,i,t),e.elementType=Dc,e.lanes=r,e.stateNode={isHidden:!1},e}function Hn(e,t,r){return e=st(6,e,null,t),e.lanes=r,e}function Fn(e,t,r){return t=st(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ap(e,t,r,i,n){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=yn(0),this.expirationTimes=yn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yn(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function Ia(e,t,r,i,n,h,m,a,c){return e=new ap(e,t,r,a,c),t===1?(t=1,h===!0&&(t|=8)):t=0,h=st(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Sa(h),e}function lp(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_r,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function Sh(e){if(!e)return Xt;e=e._reactInternals;e:{if(fr(e)!==e||e.tag!==1)throw Error($(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ke(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error($(171))}if(e.tag===1){var r=e.type;if(Ke(r))return Su(e,r,t)}return t}function yh(e,t,r,i,n,h,m,a,c){return e=Ia(r,i,!0,e,n,h,m,a,c),e.context=Sh(null),r=e.current,i=Ne(),n=Vt(r),h=Et(i,n),h.callback=t??null,$t(r,h,n),e.current.lanes=n,Ni(e,n,i),Ve(e,i),e}function ln(e,t,r,i){var n=t.current,h=Ne(),m=Vt(n);return r=Sh(r),t.context===null?t.context=r:t.pendingContext=r,t=Et(h,m),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=$t(n,t,m),e!==null&&(ft(e,n,m,h),vs(e,n,m)),m}function qs(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 Yl(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function ja(e,t){Yl(e,t),(e=e.alternate)&&Yl(e,t)}function cp(){return null}var wh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Na(e){this._internalRoot=e}cn.prototype.render=Na.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error($(409));ln(e,t,null,null)};cn.prototype.unmount=Na.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hr(function(){ln(null,e,null,null)}),t[Lt]=null}};function cn(e){this._internalRoot=e}cn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jc();e={blockedOn:null,target:e,priority:t};for(var r=0;r<It.length&&t!==0&&t<It[r].priority;r++);It.splice(r,0,e),r===0&&eu(e)}};function Ha(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function un(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jl(){}function up(e,t,r,i,n){if(n){if(typeof i=="function"){var h=i;i=function(){var f=qs(m);h.call(f)}}var m=yh(t,i,e,0,null,!1,!1,"",Jl);return e._reactRootContainer=m,e[Lt]=m.current,Li(e.nodeType===8?e.parentNode:e),hr(),m}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var a=i;i=function(){var f=qs(c);a.call(f)}}var c=Ia(e,0,!1,null,null,!1,!1,"",Jl);return e._reactRootContainer=c,e[Lt]=c.current,Li(e.nodeType===8?e.parentNode:e),hr(function(){ln(t,c,r,i)}),c}function hn(e,t,r,i,n){var h=r._reactRootContainer;if(h){var m=h;if(typeof n=="function"){var a=n;n=function(){var c=qs(m);a.call(c)}}ln(t,m,e,n)}else m=up(r,t,e,n,i);return qs(m)}Qc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=oi(t.pendingLanes);r!==0&&(sa(t,r|1),Ve(t,xe()),!(ne&6)&&(Fr=xe()+500,Jt()))}break;case 13:hr(function(){var i=Dt(e,1);if(i!==null){var n=Ne();ft(i,e,1,n)}}),ja(e,1)}};na=function(e){if(e.tag===13){var t=Dt(e,134217728);if(t!==null){var r=Ne();ft(t,e,134217728,r)}ja(e,134217728)}};Yc=function(e){if(e.tag===13){var t=Vt(e),r=Dt(e,t);if(r!==null){var i=Ne();ft(r,e,t,i)}ja(e,t)}};Jc=function(){return oe};Zc=function(e,t){var r=oe;try{return oe=e,t()}finally{oe=r}};ro=function(e,t,r){switch(t){case"input":if(Xn(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 n=en(i);if(!n)throw Error($(90));Tc(i),Xn(i,n)}}}break;case"textarea":Mc(e,r);break;case"select":t=r.value,t!=null&&Dr(e,!!r.multiple,t,!1)}};Hc=Ma;Fc=hr;var hp={usingClientEntryPoint:!1,Events:[Fi,yr,en,jc,Nc,Ma]},ri={findFiberByHostInstance:tr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dp={bundleType:ri.bundleType,version:ri.version,rendererPackageName:ri.rendererPackageName,rendererConfig:ri.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Uc(e),e===null?null:e.stateNode},findFiberByHostInstance:ri.findFiberByHostInstance||cp,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 ls=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ls.isDisabled&&ls.supportsFiber)try{Qs=ls.inject(dp),St=ls}catch{}}Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hp;Ye.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ha(t))throw Error($(200));return lp(e,t,null,r)};Ye.createRoot=function(e,t){if(!Ha(e))throw Error($(299));var r=!1,i="",n=wh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=Ia(e,1,!1,null,null,r,!1,i,n),e[Lt]=t.current,Li(e.nodeType===8?e.parentNode:e),new Na(t)};Ye.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($(188)):(e=Object.keys(e).join(","),Error($(268,e)));return e=Uc(t),e=e===null?null:e.stateNode,e};Ye.flushSync=function(e){return hr(e)};Ye.hydrate=function(e,t,r){if(!un(t))throw Error($(200));return hn(null,e,t,!0,r)};Ye.hydrateRoot=function(e,t,r){if(!Ha(e))throw Error($(405));var i=r!=null&&r.hydratedSources||null,n=!1,h="",m=wh;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(m=r.onRecoverableError)),t=yh(t,null,e,1,r??null,n,!1,h,m),e[Lt]=t.current,Li(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new cn(t)};Ye.render=function(e,t,r){if(!un(t))throw Error($(200));return hn(null,e,t,!1,r)};Ye.unmountComponentAtNode=function(e){if(!un(e))throw Error($(40));return e._reactRootContainer?(hr(function(){hn(null,null,e,!1,function(){e._reactRootContainer=null,e[Lt]=null})}),!0):!1};Ye.unstable_batchedUpdates=Ma;Ye.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!un(r))throw Error($(200));if(e==null||e._reactInternals===void 0)throw Error($(38));return hn(e,t,r,!1,i)};Ye.version="18.3.1-next-f1338f8080-20240426";function Ch(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ch)}catch(e){console.error(e)}}Ch(),Cc.exports=Ye;var fp=Cc.exports,Zl=fp;Wn.createRoot=Zl.createRoot,Wn.hydrateRoot=Zl.hydrateRoot;const pp={},ec=e=>{let t;const r=new Set,i=(g,d)=>{const _=typeof g=="function"?g(t):g;if(!Object.is(_,t)){const S=t;t=d??(typeof _!="object"||_===null)?_:Object.assign({},t,_),r.forEach(w=>w(t,S))}},n=()=>t,c={setState:i,getState:n,getInitialState:()=>f,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(pp?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=t=e(i,n,c);return c},_p=e=>e?ec(e):ec;var xh={exports:{}},kh={},Eh={exports:{}},bh={};/**
|
|
41
|
-
* @license React
|
|
42
|
-
* use-sync-external-store-shim.production.js
|
|
43
|
-
*
|
|
44
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
-
*
|
|
46
|
-
* This source code is licensed under the MIT license found in the
|
|
47
|
-
* LICENSE file in the root directory of this source tree.
|
|
48
|
-
*/var zr=Q;function vp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gp=typeof Object.is=="function"?Object.is:vp,mp=zr.useState,Sp=zr.useEffect,yp=zr.useLayoutEffect,wp=zr.useDebugValue;function Cp(e,t){var r=t(),i=mp({inst:{value:r,getSnapshot:t}}),n=i[0].inst,h=i[1];return yp(function(){n.value=r,n.getSnapshot=t,zn(n)&&h({inst:n})},[e,r,t]),Sp(function(){return zn(n)&&h({inst:n}),e(function(){zn(n)&&h({inst:n})})},[e]),wp(r),r}function zn(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!gp(e,r)}catch{return!0}}function xp(e,t){return t()}var kp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?xp:Cp;bh.useSyncExternalStore=zr.useSyncExternalStore!==void 0?zr.useSyncExternalStore:kp;Eh.exports=bh;var Ep=Eh.exports;/**
|
|
49
|
-
* @license React
|
|
50
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE file in the root directory of this source tree.
|
|
56
|
-
*/var dn=Q,bp=Ep;function Lp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dp=typeof Object.is=="function"?Object.is:Lp,Rp=bp.useSyncExternalStore,Tp=dn.useRef,Pp=dn.useEffect,Mp=dn.useMemo,Ap=dn.useDebugValue;kh.useSyncExternalStoreWithSelector=function(e,t,r,i,n){var h=Tp(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=Mp(function(){function c(S){if(!f){if(f=!0,g=S,S=i(S),n!==void 0&&m.hasValue){var w=m.value;if(n(w,S))return d=w}return d=S}if(w=d,Dp(g,S))return w;var v=i(S);return n!==void 0&&n(w,v)?(g=S,w):(g=S,d=v)}var f=!1,g,d,_=r===void 0?null:r;return[function(){return c(t())},_===null?void 0:function(){return c(_())}]},[t,r,i,n]);var a=Rp(e,h[0],h[1]);return Pp(function(){m.hasValue=!0,m.value=a},[a]),Ap(a),a};xh.exports=kh;var Op=xh.exports;const Bp=cc(Op),Lh={},{useDebugValue:Ip}=yc,{useSyncExternalStoreWithSelector:jp}=Bp;let tc=!1;const Np=e=>e;function Hp(e,t=Np,r){(Lh?"production":void 0)!=="production"&&r&&!tc&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),tc=!0);const i=jp(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return Ip(i),i}const rc=e=>{(Lh?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?_p(e):e,r=(i,n)=>Hp(t,i,n);return Object.assign(r,t),r},Wi=e=>e?rc(e):rc,me=Wi((e,t)=>({sessions:{},activePorts:{},claudeStatus:{},createSession:(r,i)=>e(n=>({sessions:{...n.sessions,[r]:{terminalId:r,projectId:i,terminal:null,title:"Terminal",alive:!0}}})),setTerminalInstance:(r,i)=>e(n=>{const h=n.sessions[r];return h?{sessions:{...n.sessions,[r]:{...h,terminal:i}}}:n}),setTitle:(r,i)=>e(n=>{const h=n.sessions[r];return h?{sessions:{...n.sessions,[r]:{...h,title:i}}}:n}),markDead:r=>e(i=>{const n=i.sessions[r];return n?{sessions:{...i.sessions,[r]:{...n,alive:!1}}}:i}),removeSession:r=>e(i=>{const{[r]:n,...h}=i.sessions;return{sessions:h}}),getSession:r=>t().sessions[r],getProjectSessions:r=>Object.values(t().sessions).filter(i=>i.projectId===r),setActivePorts:r=>e({activePorts:r}),setClaudeStatus:r=>e({claudeStatus:r})}));let cs=null,ii=null;function gi(e){ii=ii?{...ii,...e}:{...e},cs&&clearTimeout(cs),cs=setTimeout(()=>{const t=ii;ii=null,cs=null,fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})},300)}const he=Wi()((e,t)=>({projects:{},activeProjectId:null,setActiveProject:r=>{e({activeProjectId:r}),gi({activeProjectId:r})},addProject:r=>e(i=>({projects:{...i.projects,[r.id]:r},activeProjectId:i.activeProjectId??r.id})),removeProject:r=>e(i=>{const{[r]:n,...h}=i.projects,m=i.activeProjectId===r?Object.keys(h)[0]??null:i.activeProjectId;return{projects:h,activeProjectId:m}}),addTerminalToProject:(r,i)=>e(n=>{const h=n.projects[r];return!h||h.terminalIds.includes(i)?n:{projects:{...n.projects,[r]:{...h,terminalIds:[...h.terminalIds,i]}}}}),removeTerminalFromProject:(r,i)=>e(n=>{const h=n.projects[r];return h?{projects:{...n.projects,[r]:{...h,terminalIds:h.terminalIds.filter(m=>m!==i)}}}:n}),clearProjectTerminals:r=>e(i=>{const n=i.projects[r];return n?{projects:{...i.projects,[r]:{...n,terminalIds:[]}}}:i}),getActiveProject:()=>{const{projects:r,activeProjectId:i}=t();return i?r[i]??null:null},hydrateFromServer:async()=>{try{const[r,i]=await Promise.all([fetch("/api/projects"),fetch("/api/settings")]),n=await r.json(),h=await i.json(),m={};for(const c of n)m[c.id]={id:c.id,name:c.name,cwd:c.cwd,terminalIds:[]};const a=h.activeProjectId&&m[h.activeProjectId]?h.activeProjectId:Object.keys(m)[0]??null;e({projects:m,activeProjectId:a})}catch{}}})),Fp=.1,zp=.9,Wp=16,Up={background:"#0a0a0f",foreground:"#ececf1",cursor:"#ececf1",cursorAccent:"#0a0a0f",selectionBackground:"#5b5bd640",selectionForeground:"#ececf1",black:"#1a1a24",red:"#e5484d",green:"#30a46c",yellow:"#f5d90a",blue:"#5b5bd6",magenta:"#ab4aba",cyan:"#12a594",white:"#ececf1",brightBlack:"#6b6b80",brightRed:"#ff6369",brightGreen:"#3dd68c",brightYellow:"#ffef5c",brightBlue:"#849dff",brightMagenta:"#d19dff",brightCyan:"#0ac5b3",brightWhite:"#ffffff"},$p={background:"#ffffff",foreground:"#1a1a2e",cursor:"#1a1a2e",cursorAccent:"#ffffff",selectionBackground:"#5b5bd630",selectionForeground:"#1a1a2e",black:"#1a1a2e",red:"#dc3545",green:"#1a8f5c",yellow:"#b58900",blue:"#5b5bd6",magenta:"#9b3bb0",cyan:"#0f8a7e",white:"#d0d0d8",brightBlack:"#8888a0",brightRed:"#e5484d",brightGreen:"#30a46c",brightYellow:"#d4a017",brightBlue:"#6e6ee6",brightMagenta:"#ab4aba",brightCyan:"#12a594",brightWhite:"#d0d0d8"};function Ce(e){return e?e.type==="leaf"?[e.terminalId]:[...Ce(e.first),...Ce(e.second)]:[]}function Io(e,t){if(e.type==="leaf")return null;const r=Ce(e.first),i=Ce(e.second);return r.includes(t)||i.includes(t)?e.direction:Io(e.first,t)??Io(e.second,t)}function Kp(e,t,r,i){if(!e)return{type:"leaf",terminalId:r};const n=i??(Io(e,t)==="vertical"?"horizontal":"vertical");return jo(e,t,r,n)}function jo(e,t,r,i){return e.type==="leaf"?e.terminalId===t?{type:"split",direction:i,ratio:.5,first:e,second:{type:"leaf",terminalId:r}}:e:{...e,first:jo(e.first,t,r,i),second:jo(e.second,t,r,i)}}function Gs(e,t){if(!e)return null;if(e.type==="leaf")return e.terminalId===t?null:e;const r=Ce(e.first),i=Ce(e.second);if(e.first.type==="leaf"&&e.first.terminalId===t)return e.second;if(e.second.type==="leaf"&&e.second.terminalId===t)return e.first;if(r.includes(t)){const n=Gs(e.first,t);return n?{...e,first:n}:e.second}if(i.includes(t)){const n=Gs(e.second,t);return n?{...e,second:n}:e.first}return e}function No(e,t,r){const i=Math.max(Fp,Math.min(zp,r));if(t.length===0)return e.type==="split"?{...e,ratio:i}:e;if(e.type==="leaf")return e;const[n,...h]=t;return n===0?{...e,first:No(e.first,h,i)}:{...e,second:No(e.second,h,i)}}function Ho(e,t,r){return e.type==="leaf"?e.terminalId===t?{...e,terminalId:r}:e.terminalId===r?{...e,terminalId:t}:e:{...e,first:Ho(e.first,t,r),second:Ho(e.second,t,r)}}function Vp(e,t,r,i){const n=Gs(e,t);return n?Fo(n,r,t,i==="left"||i==="right"?"vertical":"horizontal",i==="left"||i==="top"):null}function Fo(e,t,r,i,n){if(e.type==="leaf"){if(e.terminalId===t){const h={type:"leaf",terminalId:r};return{type:"split",direction:i,ratio:.5,first:n?h:e,second:n?e:h}}return e}return{...e,first:Fo(e.first,t,r,i,n),second:Fo(e.second,t,r,i,n)}}const mi=["even-horizontal","even-vertical","main-left","main-top","grid"];function Ii(e,t){if(e.length===0)return null;if(e.length===1)return{type:"leaf",terminalId:e[0]};switch(t){case"even-horizontal":return or(e,"horizontal");case"even-vertical":return or(e,"vertical");case"main-left":return ic(e,"vertical");case"main-top":return ic(e,"horizontal");case"grid":return qp(e)}}function or(e,t){if(e.length===1)return{type:"leaf",terminalId:e[0]};if(e.length===2)return{type:"split",direction:t,ratio:.5,first:{type:"leaf",terminalId:e[0]},second:{type:"leaf",terminalId:e[1]}};const r=1/e.length;return{type:"split",direction:t,ratio:r,first:{type:"leaf",terminalId:e[0]},second:or(e.slice(1),t)}}function ic(e,t,r){const[i,...n]=e,m=or(n,t==="vertical"?"horizontal":"vertical");return{type:"split",direction:t,ratio:.6,first:{type:"leaf",terminalId:i},second:m}}function qp(e){if(e.length<=2)return or(e,"vertical");const t=Math.ceil(e.length/2),r=e.slice(0,t),i=e.slice(t);return{type:"split",direction:"horizontal",ratio:.5,first:or(r,"vertical"),second:i.length>0?or(i,"vertical"):{type:"leaf",terminalId:r[r.length-1]}}}function sc(e,t,r){const i=Ce(e),n=i.indexOf(t);return n===-1?null:r==="left"||r==="up"?n>0?i[n-1]:null:n<i.length-1?i[n+1]:null}const se=Wi((e,t)=>({layouts:{},currentPresetIndex:0,getLayout:r=>t().layouts[r]??null,setLayout:(r,i)=>e(n=>({layouts:{...n.layouts,[r]:i}})),addPaneToProject:(r,i,n,h)=>e(m=>{const a=m.layouts[r]??null,c=Kp(a,i,n,h);return{layouts:{...m.layouts,[r]:c}}}),removePaneFromProject:(r,i)=>e(n=>{const h=n.layouts[r];if(!h)return n;const m=Gs(h,i);return{layouts:{...n.layouts,[r]:m}}}),resizePaneInProject:(r,i,n)=>e(h=>{const m=h.layouts[r];if(!m)return h;const a=No(m,i,n);return{layouts:{...h.layouts,[r]:a}}}),swapPanesInProject:(r,i,n)=>e(h=>{const m=h.layouts[r];if(!m)return h;const a=Ho(m,i,n);return{layouts:{...h.layouts,[r]:a}}}),movePaneInProject:(r,i,n,h)=>e(m=>{const a=m.layouts[r];if(!a)return m;const c=Vp(a,i,n,h);return{layouts:{...m.layouts,[r]:c}}}),applyPresetToProject:(r,i)=>e(n=>{const h=mi[n.currentPresetIndex],m=Ii(i,h);return{layouts:{...n.layouts,[r]:m}}}),cyclePreset:(r,i)=>e(n=>{const h=(n.currentPresetIndex+1)%mi.length,m=mi[h],a=Ii(i,m);return{currentPresetIndex:h,layouts:{...n.layouts,[r]:a}}}),removeProjectLayout:r=>e(i=>{const{[r]:n,...h}=i.layouts;return{layouts:h}})}));function xs(e){document.documentElement.setAttribute("data-theme",e)}function zo(e){return e==="system"?window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":e}const Dh=localStorage.getItem("paneful:theme")||"system";xs(Dh);function us(e){const{theme:t,sidebarWidth:r,editorSyncEnabled:i}=e();gi({ui:{theme:t,sidebarWidth:r,editorSyncEnabled:i}})}const te=Wi((e,t)=>({focusedTerminalId:null,sidebarOpen:!0,sidebarWidth:224,draggingTerminalId:null,dropTarget:null,connectionStatus:"connecting",editorSyncEnabled:!0,theme:Dh,syncToast:null,setFocusedTerminal:r=>e({focusedTerminalId:r}),toggleSidebar:()=>e(r=>({sidebarOpen:!r.sidebarOpen})),setSidebarOpen:r=>e({sidebarOpen:r}),setSidebarWidth:r=>{const i=Math.min(400,Math.max(160,r));e({sidebarWidth:i}),us(t)},setDragging:r=>e({draggingTerminalId:r}),setDropTarget:r=>e({dropTarget:r}),setConnectionStatus:r=>e({connectionStatus:r}),toggleEditorSync:()=>{e(r=>({editorSyncEnabled:!r.editorSyncEnabled})),us(t)},setTheme:r=>{localStorage.setItem("paneful:theme",r),xs(r),e({theme:r}),us(t)},cycleTheme:()=>{const r=["system","light","dark"],i=t().theme,n=r[(r.indexOf(i)+1)%r.length];localStorage.setItem("paneful:theme",n),xs(n),e({theme:n}),us(t)},showSyncToast:r=>{e({syncToast:{projectName:r,id:Date.now()}})},dismissSyncToast:()=>e({syncToast:null}),hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();if(i.ui){const{theme:n,sidebarWidth:h,editorSyncEnabled:m}=i.ui;n&&(localStorage.setItem("paneful:theme",n),xs(n)),e({...n?{theme:n}:{},...h!==void 0?{sidebarWidth:h}:{},...m!==void 0?{editorSyncEnabled:m}:{}})}}catch{}}}));var Rh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(m,a,c){var f=this&&this.__decorate||function(s,l,p,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,p):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,p,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,p,y):x(l,p))||y);return k>3&&y&&Object.defineProperty(l,p,y),y},g=this&&this.__param||function(s,l){return function(p,C){l(p,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const d=c(9042),_=c(9924),S=c(844),w=c(4725),v=c(2585),u=c(3656);let o=a.AccessibilityManager=class extends S.Disposable{constructor(s,l,p,C){super(),this._terminal=s,this._coreBrowserService=p,this._renderService=C,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,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(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
57
|
-
`))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.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,S.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(s){for(let l=0;l<s;l++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
|
|
58
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.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,l){this._liveRegionDebouncer.refresh(s,l,this._terminal.rows)}_renderRows(s,l){const p=this._terminal.buffer,C=p.lines.length.toString();for(let x=s;x<=l;x++){const k=p.lines.get(p.ydisp+x),y=[],b=(k==null?void 0:k.translateToString(!0,void 0,void 0,y))||"",R=(p.ydisp+x+1).toString(),A=this._rowElements[x];A&&(b.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=b,this._rowColumns.set(A,y)),A.setAttribute("aria-posinset",R),A.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,l){const p=s.target,C=this._rowElements[l===0?1:this._rowElements.length-2];if(p.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==C)return;let x,k;if(l===0?(x=p,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(x=this._rowElements.shift(),k=p,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),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 l={node:s.anchorNode,offset:s.anchorOffset},p={node:s.focusNode,offset:s.focusOffset};if((l.node.compareDocumentPosition(p.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===p.node&&l.offset>p.offset)&&([l,p]=[p,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const C=this._rowElements.slice(-1)[0];if(p.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(p={node:C,offset:((b=C.textContent)==null?void 0:b.length)??0}),!this._rowContainer.contains(p.node))return;const x=({node:R,offset:A})=>{const B=R instanceof Text?R.parentNode:R;let T=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(T))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(B);if(!N)return console.warn("columns is null. Race condition?"),null;let F=A<N.length?N[A]:N.slice(-1)[0]+1;return F>=this._terminal.cols&&(++T,F=0),{row:T,column:F}},k=x(l),y=x(p);if(k&&y){if(k.row>y.row||k.row===y.row&&k.column>=y.column)throw new Error("invalid range");this._terminal.select(k.column,k.row,(y.row-k.row)*this._terminal.cols-k.column+y.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>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`}};a.AccessibilityManager=o=f([g(1,v.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],o)},3614:(m,a)=>{function c(_){return _.replace(/\r?\n/g,"\r")}function f(_,S){return S?"\x1B[200~"+_+"\x1B[201~":_}function g(_,S,w,v){_=f(_=c(_),w.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(_,!0),S.value=""}function d(_,S,w){const v=w.getBoundingClientRect(),u=_.clientX-v.left-10,o=_.clientY-v.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${u}px`,S.style.top=`${o}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=f,a.copyHandler=function(_,S){_.clipboardData&&_.clipboardData.setData("text/plain",S.selectionText),_.preventDefault()},a.handlePasteEvent=function(_,S,w,v){_.stopPropagation(),_.clipboardData&&g(_.clipboardData.getData("text/plain"),S,w,v)},a.paste=g,a.moveTextAreaUnderMouseCursor=d,a.rightClickHandler=function(_,S,w,v,u){d(_,S,w),u&&v.rightClickSelect(_),S.value=v.selectionText,S.select()}},7239:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const f=c(1505);a.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(g,d,_){this._css.set(g,d,_)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,_){this._color.set(g,d,_)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,f,g,d){c.addEventListener(f,g,d);let _=!1;return{dispose:()=>{_||(_=!0,c.removeEventListener(f,g,d))}}}},3551:function(m,a,c){var f=this&&this.__decorate||function(o,s,l,p){var C,x=arguments.length,k=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,p);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,p){s(l,p,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const d=c(3656),_=c(8460),S=c(844),w=c(2585),v=c(4725);let u=a.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(o,s,l,p,C){super(),this._element=o,this._mouseService=s,this._renderService=l,this._bufferService=p,this._linkProviderService=C,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,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)(()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.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 l=o.composedPath();for(let p=0;p<l.length;p++){const C=l[p];if(C.classList.contains("xterm"))break;if(C.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,C;this._activeProviderReplies&&s||((p=this._activeProviderReplies)==null||p.forEach(x=>{x==null||x.forEach(k=>{k.link.dispose&&k.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=o.y);let l=!1;for(const[x,k]of this._linkProviderService.linkProviders.entries())s?(C=this._activeProviderReplies)!=null&&C.get(x)&&(l=this._checkLinkProviderResult(x,o,l)):k.provideLinks(o.y,y=>{var R,A;if(this._isMouseOut)return;const b=y==null?void 0:y.map(B=>({link:B}));(R=this._activeProviderReplies)==null||R.set(x,b),l=this._checkLinkProviderResult(x,o,l),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(o.y,this._activeProviderReplies)})}_removeIntersectingLinks(o,s){const l=new Set;for(let p=0;p<s.size;p++){const C=s.get(p);if(C)for(let x=0;x<C.length;x++){const k=C[x],y=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 R=y;R<=b;R++){if(l.has(R)){C.splice(x--,1);break}l.add(R)}}}}_checkLinkProviderResult(o,s,l){var x;if(!this._activeProviderReplies)return l;const p=this._activeProviderReplies.get(o);let C=!1;for(let k=0;k<o;k++)this._activeProviderReplies.has(k)&&!this._activeProviderReplies.get(k)||(C=!0);if(!C&&p){const k=p.find(y=>this._linkAtPosition(y.link,s));k&&(l=!0,this._handleNewLink(k))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let k=0;k<this._activeProviderReplies.size;k++){const y=(x=this._activeProviderReplies.get(k))==null?void 0:x.find(b=>this._linkAtPosition(b.link,s));if(y){l=!0,this._handleNewLink(y);break}}return l}_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,S.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 l,p;return(p=(l=this._currentLink)==null?void 0:l.state)==null?void 0:p.decorations.pointerCursor},set:l=>{var p;(p=this._currentLink)!=null&&p.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,p;return(p=(l=this._currentLink)==null?void 0:l.state)==null?void 0:p.decorations.underline},set:l=>{var p,C,x;(p=this._currentLink)!=null&&p.state&&((x=(C=this._currentLink)==null?void 0:C.state)==null?void 0:x.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(o.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const p=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(p,C),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(o,s,l){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(l,s.text)}_fireUnderlineEvent(o,s){const l=o.range,p=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-p-1,l.end.x,l.end.y-p-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(o,s,l){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(l,s.text)}_linkAtPosition(o,s){const l=o.range.start.y*this._bufferService.cols+o.range.start.x,p=o.range.end.y*this._bufferService.cols+o.range.end.x,C=s.y*this._bufferService.cols+s.x;return l<=C&&C<=p}_positionFromMouseEvent(o,s,l){const p=l.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,l,p,C){return{x1:o,y1:s,x2:l,y2:p,cols:this._bufferService.cols,fg:C}}};a.Linkifier=u=f([g(1,v.IMouseService),g(2,v.IRenderService),g(3,w.IBufferService),g(4,v.ILinkProviderService)],u)},9042:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(m,a,c){var f=this&&this.__decorate||function(v,u,o,s){var l,p=arguments.length,C=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,u,o,s);else for(var x=v.length-1;x>=0;x--)(l=v[x])&&(C=(p<3?l(C):p>3?l(u,o,C):l(u,o))||C);return p>3&&C&&Object.defineProperty(u,o,C),C},g=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const d=c(511),_=c(2585);let S=a.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=[],l=this._optionsService.rawOptions.linkHandler,p=new d.CellData,C=o.getTrimmedLength();let x=-1,k=-1,y=!1;for(let R=0;R<C;R++)if(k!==-1||o.hasContent(R)){if(o.loadCell(R,p),p.hasExtendedAttrs()&&p.extended.urlId){if(k===-1){k=R,x=p.extended.urlId;continue}y=p.extended.urlId!==x}else k!==-1&&(y=!0);if(y||k!==-1&&R===C-1){const A=(b=this._oscLinkService.getLinkData(x))==null?void 0:b.uri;if(A){const B={start:{x:k+1,y:v},end:{x:R+(y||R!==C-1?0:1),y:v}};let T=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const N=new URL(A);["http:","https:"].includes(N.protocol)||(T=!0)}catch{T=!0}T||s.push({text:A,range:B,activate:(N,F)=>l?l.activate(N,F,B):w(0,F),hover:(N,F)=>{var K;return(K=l==null?void 0:l.hover)==null?void 0:K.call(l,N,F,B)},leave:(N,F)=>{var K;return(K=l==null?void 0:l.leave)==null?void 0:K.call(l,N,F,B)}})}y=!1,p.hasExtendedAttrs()&&p.extended.urlId?(k=R,x=p.extended.urlId):(k=-1,x=-1)}}u(s)}};function w(v,u){if(confirm(`Do you want to navigate to ${u}?
|
|
59
|
-
|
|
60
|
-
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")}}a.OscLinkProvider=S=f([g(0,_.IBufferService),g(1,_.IOptionsService),g(2,_.IOscLinkService)],S)},6193:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,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,f,g){this._rowCount=g,c=c!==void 0?c:0,f=f!==void 0?f: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,f):f,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),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const f=c(3614),g=c(3656),d=c(3551),_=c(9042),S=c(3730),w=c(1680),v=c(3107),u=c(5744),o=c(2950),s=c(1296),l=c(428),p=c(4269),C=c(5114),x=c(8934),k=c(3230),y=c(9312),b=c(4725),R=c(6731),A=c(8055),B=c(8969),T=c(8460),N=c(844),F=c(6114),K=c(8437),G=c(2584),j=c(7399),E=c(5941),D=c(9074),P=c(2585),O=c(5435),W=c(4567),V=c(779);class Z extends B.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(I={}){super(I),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new N.MutableDisposable),this._onCursorMove=this.register(new T.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new T.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new T.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new T.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new T.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new T.EventEmitter),this._onBlur=this.register(new T.EventEmitter),this._onA11yCharEmitter=this.register(new T.EventEmitter),this._onA11yTabEmitter=this.register(new T.EventEmitter),this._onWillOpen=this.register(new T.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(D.DecorationService),this._instantiationService.setService(P.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(b.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((L,U)=>this.refresh(L,U))),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,T.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,T.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,T.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(L=>this._afterResize(L.cols,L.rows))),this.register((0,N.toDisposable)(()=>{var L,U;this._customKeyEventHandler=void 0,(U=(L=this.element)==null?void 0:L.parentNode)==null||U.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const L of I){let U,H="";switch(L.index){case 256:U="foreground",H="10";break;case 257:U="background",H="11";break;case 258:U="cursor",H="12";break;default:U="ansi",H="4;"+L.index}switch(L.type){case 0:const X=A.color.toColorRGB(U==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[U]);this.coreService.triggerDataEvent(`${G.C0.ESC}]${H};${(0,E.toRgbString)(X)}${G.C1_ESCAPED.ST}`);break;case 1:if(U==="ansi")this._themeService.modifyColors(q=>q.ansi[L.index]=A.channels.toColor(...L.color));else{const q=U;this._themeService.modifyColors(re=>re[q]=A.channels.toColor(...L.color))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(G.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 I=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(I);if(!L)return;const U=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,X=L.getWidth(U),q=this._renderService.dimensions.css.cell.width*X,re=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=U*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=re+"px",this.textarea.style.width=q+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",L=>{this.hasSelection()&&(0,f.copyHandler)(L,this._selectionService)}));const I=L=>(0,f.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,g.addDisposableDomListener)(this.element,"paste",I)),F.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",L=>{L.button===2&&(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",L=>{(0,f.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",L=>{L.button===1&&(0,f.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",I=>this._inputEvent(I),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(I){var U;if(!I)throw new Error("Terminal requires a parent element.");if(I.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((U=this.element)==null?void 0:U.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=I.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"),I.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,g.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),F.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(C.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(b.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.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(x.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.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(w.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(y.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,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(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 I=this,L=this.element;function U(q){const re=I._mouseService.getMouseReportCoords(q,I.screenElement);if(!re)return!1;let _e,fe;switch(q.overrideType||q.type){case"mousemove":fe=32,q.buttons===void 0?(_e=3,q.button!==void 0&&(_e=q.button<3?q.button:3)):_e=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":fe=0,_e=q.button<3?q.button:3;break;case"mousedown":fe=1,_e=q.button<3?q.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(q)===!1||I.viewport.getLinesScrolled(q)===0)return!1;fe=q.deltaY<0?0:1,_e=4;break;default:return!1}return!(fe===void 0||_e===void 0||_e>4)&&I.coreMouseService.triggerMouseEvent({col:re.col,row:re.row,x:re.x,y:re.y,button:_e,action:fe,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},X={mouseup:q=>(U(q),q.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(q)),wheel:q=>(U(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&U(q)},mousemove:q=>{q.buttons||U(q)}};this.register(this.coreMouseService.onProtocolChange(q=>{q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(q)),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&q?H.mousemove||(L.addEventListener("mousemove",X.mousemove),H.mousemove=X.mousemove):(L.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&q?H.wheel||(L.addEventListener("wheel",X.wheel,{passive:!1}),H.wheel=X.wheel):(L.removeEventListener("wheel",H.wheel),H.wheel=null),2&q?H.mouseup||(H.mouseup=X.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&q?H.mousedrag||(H.mousedrag=X.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(L,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return U(q),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(q)})),this.register((0,g.addDisposableDomListener)(L,"wheel",q=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const re=this.viewport.getLinesScrolled(q);if(re===0)return;const _e=G.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let fe="";for(let z=0;z<Math.abs(re);z++)fe+=_e;return this.coreService.triggerDataEvent(fe,!0),this.cancel(q,!0)}return this.viewport.handleWheel(q)?this.cancel(q):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(L,"touchstart",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,g.addDisposableDomListener)(L,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(I,L){var U;(U=this._renderService)==null||U.refreshRows(I,L)}updateCursorStyle(I){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(I)?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(I,L,U=0){var H;U===1?(super.scrollLines(I,L,U),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(I)}paste(I){(0,f.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,L,U){this._selectionService.setSelection(I,L,U)}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 I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,L){var U;(U=this._selectionService)==null||U.selectLines(I,L)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!L&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const U=(0,j.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),U.type===3||U.type===2){const H=this.rows-1;return this.scrollLines(U.type===2?-H:H),this.cancel(I,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(U.cancel&&this.cancel(I,!0),!U.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(U.key!==G.C0.ETX&&U.key!==G.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(U.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,L){const U=I.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||I.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||I.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?U:U&&(!L.keyCode||L.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)L=I.charCode;else if(I.which===null||I.which===void 0)L=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;L=I.which}return!(!L||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=I.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(I),!0}return!1}resize(I,L){I!==this.cols||L!==this.rows?super.resize(I,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,L){var U,H;(U=this._charSizeService)==null||U.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var I;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(K.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var L,U;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(U=this.viewport)==null||U.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(G.C0.ESC+"[I"):this.coreService.triggerDataEvent(G.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case O.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),U=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[4;${U};${L}t`);break;case O.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),X=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${G.C0.ESC}[6;${X};${H}t`)}}cancel(I,L){if(this.options.cancelEvents||L)return I.preventDefault(),I.stopPropagation(),!1}}a.Terminal=Z},9924:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,g){this._rowCount=g,c=c!==void 0?c:0,f=f!==void 0?f: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,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=d-this._lastRefreshMs,S=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(m,a,c){var f=this&&this.__decorate||function(o,s,l,p){var C,x=arguments.length,k=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,p);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,p){s(l,p,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const d=c(3656),_=c(4725),S=c(8460),w=c(844),v=c(2585);let u=a.Viewport=class extends w.Disposable{constructor(o,s,l,p,C,x,k,y){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=l,this._optionsService=p,this._charSizeService=C,this._renderService=x,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 S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.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(y.colors),this.register(y.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 l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&l<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 y;let l,p="";const C=[],x=s??this._bufferService.buffer.lines.length,k=this._bufferService.buffer.lines;for(let b=o;b<x;b++){const R=k.get(b);if(!R)continue;const A=(y=k.get(b+1))==null?void 0:y.isWrapped;if(p+=R.translateToString(!A),!A||b===k.length-1){const B=document.createElement("div");B.textContent=p,C.push(B),p.length>0&&(l=B),p=""}}return{bufferElements:C,cursorElement:l}}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 l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&s.altKey||l==="ctrl"&&s.ctrlKey||l==="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))}};a.Viewport=u=f([g(2,v.IBufferService),g(3,v.IOptionsService),g(4,_.ICharSizeService),g(5,_.IRenderService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],u)},3107:function(m,a,c){var f=this&&this.__decorate||function(v,u,o,s){var l,p=arguments.length,C=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,u,o,s);else for(var x=v.length-1;x>=0;x--)(l=v[x])&&(C=(p<3?l(C):p>3?l(u,o,C):l(u,o))||C);return p>3&&C&&Object.defineProperty(u,o,C),C},g=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const d=c(4725),_=c(844),S=c(2585);let w=a.BufferDecorationRenderer=class extends _.Disposable{constructor(v,u,o,s,l){super(),this._screenElement=v,this._bufferService=u,this._coreBrowserService=o,this._decorationService=s,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(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()}};a.BufferDecorationRenderer=w=f([g(1,S.IBufferService),g(2,d.ICoreBrowserService),g(3,S.IDecorationService),g(4,d.IRenderService)],w)},5871:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.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 f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,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,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,g){return f>=c.startBufferLine-this._linePadding[g||"full"]&&f<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(m,a,c){var f=this&&this.__decorate||function(l,p,C,x){var k,y=arguments.length,b=y<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,p,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(p,C,b):k(p,C))||b);return y>3&&b&&Object.defineProperty(p,C,b),b},g=this&&this.__param||function(l,p){return function(C,x){p(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const d=c(5871),_=c(4725),S=c(844),w=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=a.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,p,C,x,k,y,b){var A;super(),this._viewportElement=l,this._screenElement=p,this._bufferService=C,this._decorationService=x,this._renderService=k,this._optionsService=y,this._coreBrowserService=b,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)(()=>{var B;(B=this._canvas)==null||B.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const l=Math.floor(this._canvas.width/3),p=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=l,u.center=p,u.right=l,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 l=this._canvas.height/this._bufferService.buffer.lines.length,p=Math.round(Math.max(Math.min(l,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 l=this._colorZoneStore.zones;for(const p of l)p.position!=="full"&&this._renderColorZone(p);for(const p of l)p.position==="full"&&this._renderColorZone(p);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(o[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-v[l.position||"full"]/2),u[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[l.position||"full"]))}_queueRefresh(l,p){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=p||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};a.OverviewRulerRenderer=s=f([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,_.IRenderService),g(5,w.IOptionsService),g(6,_.ICoreBrowserService)],s)},2950:function(m,a,c){var f=this&&this.__decorate||function(v,u,o,s){var l,p=arguments.length,C=p<3?u:s===null?s=Object.getOwnPropertyDescriptor(u,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,u,o,s);else for(var x=v.length-1;x>=0;x--)(l=v[x])&&(C=(p<3?l(C):p>3?l(u,o,C):l(u,o))||C);return p>3&&C&&Object.defineProperty(u,o,C),C},g=this&&this.__param||function(v,u){return function(o,s){u(o,s,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const d=c(4725),_=c(2585),S=c(2584);let w=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,u,o,s,l,p){this._textarea=v,this._compositionView=u,this._bufferService=o,this._optionsService=s,this._coreService=l,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(`${S.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,l=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"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=l+"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)}}};a.CompositionHelper=w=f([g(2,_.IBufferService),g(3,_.IOptionsService),g(4,_.ICoreService),g(5,d.IRenderService)],w)},9806:(m,a)=>{function c(f,g,d){const _=d.getBoundingClientRect(),S=f.getComputedStyle(d),w=parseInt(S.getPropertyValue("padding-left")),v=parseInt(S.getPropertyValue("padding-top"));return[g.clientX-_.left-w,g.clientY-_.top-v]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(f,g,d,_,S,w,v,u,o){if(!w)return;const s=c(f,g,d);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),S),s):void 0}},9504:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const f=c(2584);function g(u,o,s,l){const p=u-d(u,s),C=o-d(o,s),x=Math.abs(p-C)-function(k,y,b){let R=0;const A=k-d(k,b),B=y-d(y,b);for(let T=0;T<Math.abs(A-B);T++){const N=_(k,y)==="A"?-1:1,F=b.buffer.lines.get(A+N*T);F!=null&&F.isWrapped&&R++}return R}(u,o,s);return v(x,w(_(u,o),l))}function d(u,o){let s=0,l=o.buffer.lines.get(u),p=l==null?void 0:l.isWrapped;for(;p&&u>=0&&u<o.rows;)s++,l=o.buffer.lines.get(--u),p=l==null?void 0:l.isWrapped;return s}function _(u,o){return u>o?"A":"B"}function S(u,o,s,l,p,C){let x=u,k=o,y="";for(;x!==s||k!==l;)x+=p?1:-1,p&&x>C.cols-1?(y+=C.buffer.translateBufferLineToString(k,!1,u,x),x=0,u=0,k++):!p&&x<0&&(y+=C.buffer.translateBufferLineToString(k,!1,0,u+1),x=C.cols-1,u=x,k--);return y+C.buffer.translateBufferLineToString(k,!1,u,x)}function w(u,o){const s=o?"O":"[";return f.C0.ESC+s+u}function v(u,o){u=Math.floor(u);let s="";for(let l=0;l<u;l++)s+=o;return s}a.moveToCellSequence=function(u,o,s,l){const p=s.buffer.x,C=s.buffer.y;if(!s.buffer.hasScrollback)return function(y,b,R,A,B,T){return g(b,A,B,T).length===0?"":v(S(y,b,y,b-d(b,B),!1,B).length,w("D",T))}(p,C,0,o,s,l)+g(C,o,s,l)+function(y,b,R,A,B,T){let N;N=g(b,A,B,T).length>0?A-d(A,B):b;const F=A,K=function(G,j,E,D,P,O){let W;return W=g(E,D,P,O).length>0?D-d(D,P):j,G<E&&W<=D||G>=E&&W<D?"C":"D"}(y,b,R,A,B,T);return v(S(y,N,R,F,K==="C",B).length,w(K,T))}(p,C,u,o,s,l);let x;if(C===o)return x=p>u?"D":"C",v(Math.abs(p-u),w(x,l));x=C>o?"D":"C";const k=Math.abs(C-o);return v(function(y,b){return b.cols-y}(C>o?u:p,s)+(k-1)*s.cols+1+((C>o?p:u)-1),w(x,l))}},1296:function(m,a,c){var f=this&&this.__decorate||function(T,N,F,K){var G,j=arguments.length,E=j<3?N:K===null?K=Object.getOwnPropertyDescriptor(N,F):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(T,N,F,K);else for(var D=T.length-1;D>=0;D--)(G=T[D])&&(E=(j<3?G(E):j>3?G(N,F,E):G(N,F))||E);return j>3&&E&&Object.defineProperty(N,F,E),E},g=this&&this.__param||function(T,N){return function(F,K){N(F,K,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const d=c(3787),_=c(2550),S=c(2223),w=c(6171),v=c(6052),u=c(4725),o=c(8055),s=c(8460),l=c(844),p=c(2585),C="xterm-dom-renderer-owner-",x="xterm-rows",k="xterm-fg-",y="xterm-bg-",b="xterm-focus",R="xterm-selection";let A=1,B=a.DomRenderer=class extends l.Disposable{constructor(T,N,F,K,G,j,E,D,P,O,W,V,Z){super(),this._terminal=T,this._document=N,this._element=F,this._screenElement=K,this._viewportElement=G,this._helperContainer=j,this._linkifier2=E,this._charSizeService=P,this._optionsService=O,this._bufferService=W,this._coreBrowserService=V,this._themeService=Z,this._terminalClass=A++,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(x),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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(ee=>this._injectCss(ee))),this._injectCss(this._themeService.colors),this._rowFactory=D.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(ee=>this._handleLinkHover(ee))),this.register(this._linkifier2.onHideLinkUnderline(ee=>this._handleLinkLeave(ee))),this.register((0,l.toDisposable)(()=>{this._element.classList.remove(C+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 T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const N=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=N,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(T){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let N=`${this._terminalSelector} .${x} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;N+=`${this._terminalSelector} .${x} .xterm-dim { color: ${o.color.multiplyOpacity(T.foreground,.5).css};}`,N+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,K=`blink_bar_${this._terminalClass}`,G=`blink_block_${this._terminalClass}`;N+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,N+=`@keyframes ${K} { 50% { box-shadow: none; }}`,N+=`@keyframes ${G} { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,N+=`${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${x}.${b} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${T.cursor.css} !important; color: ${T.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,N+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[j,E]of T.ansi.entries())N+=`${this._terminalSelector} .${k}${j} { color: ${E.css}; }${this._terminalSelector} .${k}${j}.xterm-dim { color: ${o.color.multiplyOpacity(E,.5).css}; }${this._terminalSelector} .${y}${j} { background-color: ${E.css}; }`;N+=`${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR} { color: ${o.color.opaque(T.background).css}; }${this._terminalSelector} .${k}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${o.color.multiplyOpacity(o.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${y}${S.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=N}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,N){for(let F=this._rowElements.length;F<=N;F++){const K=this._document.createElement("div");this._rowContainer.appendChild(K),this._rowElements.push(K)}for(;this._rowElements.length>N;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,N){this._refreshRowElements(T,N),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(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(T,N,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,N,F),this.renderRows(0,this._bufferService.rows-1),!T||!N)return;this._selectionRenderModel.update(this._terminal,T,N,F);const K=this._selectionRenderModel.viewportStartRow,G=this._selectionRenderModel.viewportEndRow,j=this._selectionRenderModel.viewportCappedStartRow,E=this._selectionRenderModel.viewportCappedEndRow;if(j>=this._bufferService.rows||E<0)return;const D=this._document.createDocumentFragment();if(F){const P=T[0]>N[0];D.appendChild(this._createSelectionElement(j,P?N[0]:T[0],P?T[0]:N[0],E-j+1))}else{const P=K===j?T[0]:0,O=j===G?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(j,P,O));const W=E-j-1;if(D.appendChild(this._createSelectionElement(j+1,0,this._bufferService.cols,W)),j!==E){const V=G===E?N[0]:this._bufferService.cols;D.appendChild(this._createSelectionElement(E,0,V))}}this._selectionContainer.appendChild(D)}_createSelectionElement(T,N,F,K=1){const G=this._document.createElement("div"),j=N*this.dimensions.css.cell.width;let E=this.dimensions.css.cell.width*(F-N);return j+E>this.dimensions.css.canvas.width&&(E=this.dimensions.css.canvas.width-j),G.style.height=K*this.dimensions.css.cell.height+"px",G.style.top=T*this.dimensions.css.cell.height+"px",G.style.left=`${j}px`,G.style.width=`${E}px`,G}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 T of this._rowElements)T.replaceChildren()}renderRows(T,N){const F=this._bufferService.buffer,K=F.ybase+F.y,G=Math.min(F.x,this._bufferService.cols-1),j=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,D=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=T;P<=N;P++){const O=P+F.ydisp,W=this._rowElements[P],V=F.lines.get(O);if(!W||!V)break;W.replaceChildren(...this._rowFactory.createRow(V,O,O===K,E,D,G,j,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,N,F,K,G,j){F<0&&(T=0),K<0&&(N=0);const E=this._bufferService.rows-1;F=Math.max(Math.min(F,E),0),K=Math.max(Math.min(K,E),0),G=Math.min(G,this._bufferService.cols);const D=this._bufferService.buffer,P=D.ybase+D.y,O=Math.min(D.x,G-1),W=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let ee=F;ee<=K;++ee){const I=ee+D.ydisp,L=this._rowElements[ee],U=D.lines.get(I);if(!L||!U)break;L.replaceChildren(...this._rowFactory.createRow(U,I,I===P,V,Z,O,W,this.dimensions.css.cell.width,this._widthCache,j?ee===F?T:0:-1,j?(ee===K?N:G)-1:-1))}}};a.DomRenderer=B=f([g(7,p.IInstantiationService),g(8,u.ICharSizeService),g(9,p.IOptionsService),g(10,p.IBufferService),g(11,u.ICoreBrowserService),g(12,u.IThemeService)],B)},3787:function(m,a,c){var f=this&&this.__decorate||function(x,k,y,b){var R,A=arguments.length,B=A<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,y):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(x,k,y,b);else for(var T=x.length-1;T>=0;T--)(R=x[T])&&(B=(A<3?R(B):A>3?R(k,y,B):R(k,y))||B);return A>3&&B&&Object.defineProperty(k,y,B),B},g=this&&this.__param||function(x,k){return function(y,b){k(y,b,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const d=c(2223),_=c(643),S=c(511),w=c(2585),v=c(8055),u=c(4725),o=c(4269),s=c(6171),l=c(3734);let p=a.DomRendererRowFactory=class{constructor(x,k,y,b,R,A,B){this._document=x,this._characterJoinerService=k,this._optionsService=y,this._coreBrowserService=b,this._coreService=R,this._decorationService=A,this._themeService=B,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,k,y){this._selectionStart=x,this._selectionEnd=k,this._columnSelectMode=y}createRow(x,k,y,b,R,A,B,T,N,F,K){const G=[],j=this._characterJoinerService.getJoinedCharacters(k),E=this._themeService.colors;let D,P=x.getNoBgTrimmedLength();y&&P<A+1&&(P=A+1);let O=0,W="",V=0,Z=0,ee=0,I=!1,L=0,U=!1,H=0;const X=[],q=F!==-1&&K!==-1;for(let re=0;re<P;re++){x.loadCell(re,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let fe=!1,z=re,J=this._workCell;if(j.length>0&&re===j[0][0]){fe=!0;const ve=j.shift();J=new o.JoinedCellData(this._workCell,x.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),z=ve[1]-1,_e=J.getWidth()}const le=this._isCellInSelection(re,k),ze=y&&re===A,Ze=q&&re>=F&&re<=K;let Kr=!1;this._decorationService.forEachDecorationAtCell(re,k,void 0,ve=>{Kr=!0});let $i=J.getChars()||_.WHITESPACE_CELL_CHAR;if($i===" "&&(J.isUnderline()||J.isOverline())&&($i=" "),H=_e*T-N.get($i,J.isBold(),J.isItalic()),D){if(O&&(le&&U||!le&&!U&&J.bg===V)&&(le&&U&&E.selectionForeground||J.fg===Z)&&J.extended.ext===ee&&Ze===I&&H===L&&!ze&&!fe&&!Kr){J.isInvisible()?W+=_.WHITESPACE_CELL_CHAR:W+=$i,O++;continue}O&&(D.textContent=W),D=this._document.createElement("span"),O=0,W=""}else D=this._document.createElement("span");if(V=J.bg,Z=J.fg,ee=J.extended.ext,I=Ze,L=H,U=le,fe&&A>=re&&A<=z&&(A=re),!this._coreService.isCursorHidden&&ze&&this._coreService.isCursorInitialized){if(X.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&X.push("xterm-cursor-blink"),X.push(b==="bar"?"xterm-cursor-bar":b==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":X.push("xterm-cursor-outline");break;case"block":X.push("xterm-cursor-block");break;case"bar":X.push("xterm-cursor-bar");break;case"underline":X.push("xterm-cursor-underline")}}if(J.isBold()&&X.push("xterm-bold"),J.isItalic()&&X.push("xterm-italic"),J.isDim()&&X.push("xterm-dim"),W=J.isInvisible()?_.WHITESPACE_CELL_CHAR:J.getChars()||_.WHITESPACE_CELL_CHAR,J.isUnderline()&&(X.push(`xterm-underline-${J.extended.underlineStyle}`),W===" "&&(W=" "),!J.isUnderlineColorDefault()))if(J.isUnderlineColorRGB())D.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(J.getUnderlineColor()).join(",")})`;else{let ve=J.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&J.isBold()&&ve<8&&(ve+=8),D.style.textDecorationColor=E.ansi[ve].css}J.isOverline()&&(X.push("xterm-overline"),W===" "&&(W=" ")),J.isStrikethrough()&&X.push("xterm-strikethrough"),Ze&&(D.style.textDecoration="underline");let et=J.getFgColor(),Vr=J.getFgColorMode(),_t=J.getBgColor(),qr=J.getBgColorMode();const pn=!!J.isInverse();if(pn){const ve=et;et=_t,_t=ve;const Fh=Vr;Vr=qr,qr=Fh}let Pt,Ki,Mt,Gr=!1;switch(this._decorationService.forEachDecorationAtCell(re,k,void 0,ve=>{ve.options.layer!=="top"&&Gr||(ve.backgroundColorRGB&&(qr=50331648,_t=ve.backgroundColorRGB.rgba>>8&16777215,Pt=ve.backgroundColorRGB),ve.foregroundColorRGB&&(Vr=50331648,et=ve.foregroundColorRGB.rgba>>8&16777215,Ki=ve.foregroundColorRGB),Gr=ve.options.layer==="top")}),!Gr&&le&&(Pt=this._coreBrowserService.isFocused?E.selectionBackgroundOpaque:E.selectionInactiveBackgroundOpaque,_t=Pt.rgba>>8&16777215,qr=50331648,Gr=!0,E.selectionForeground&&(Vr=50331648,et=E.selectionForeground.rgba>>8&16777215,Ki=E.selectionForeground)),Gr&&X.push("xterm-decoration-top"),qr){case 16777216:case 33554432:Mt=E.ansi[_t],X.push(`xterm-bg-${_t}`);break;case 50331648:Mt=v.channels.toColor(_t>>16,_t>>8&255,255&_t),this._addStyle(D,`background-color:#${C((_t>>>0).toString(16),"0",6)}`);break;default:pn?(Mt=E.foreground,X.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Mt=E.background}switch(Pt||J.isDim()&&(Pt=v.color.multiplyOpacity(Mt,.5)),Vr){case 16777216:case 33554432:J.isBold()&&et<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(et+=8),this._applyMinimumContrast(D,Mt,E.ansi[et],J,Pt,void 0)||X.push(`xterm-fg-${et}`);break;case 50331648:const ve=v.channels.toColor(et>>16&255,et>>8&255,255&et);this._applyMinimumContrast(D,Mt,ve,J,Pt,Ki)||this._addStyle(D,`color:#${C(et.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(D,Mt,E.foreground,J,Pt,Ki)||pn&&X.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}X.length&&(D.className=X.join(" "),X.length=0),ze||fe||Kr?D.textContent=W:O++,H!==this.defaultSpacing&&(D.style.letterSpacing=`${H}px`),G.push(D),re=z}return D&&O&&(D.textContent=W),G}_applyMinimumContrast(x,k,y,b,R,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(b.getCode()))return!1;const B=this._getContrastCache(b);let T;if(R||A||(T=B.getColor(k.rgba,y.rgba)),T===void 0){const N=this._optionsService.rawOptions.minimumContrastRatio/(b.isDim()?2:1);T=v.color.ensureContrastRatio(R||k,A||y,N),B.setColor((R||k).rgba,(A||y).rgba,T??null)}return!!T&&(this._addStyle(x,`color:${T.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,k){x.setAttribute("style",`${x.getAttribute("style")||""}${k};`)}_isCellInSelection(x,k){const y=this._selectionStart,b=this._selectionEnd;return!(!y||!b)&&(this._columnSelectMode?y[0]<=b[0]?x>=y[0]&&k>=y[1]&&x<b[0]&&k<=b[1]:x<y[0]&&k>=y[1]&&x>=b[0]&&k<=b[1]:k>y[1]&&k<b[1]||y[1]===b[1]&&k===y[1]&&x>=y[0]&&x<b[0]||y[1]<b[1]&&k===b[1]&&x<b[0]||y[1]<b[1]&&k===y[1]&&x>=y[0])}};function C(x,k,y){for(;x.length<y;)x=k+x;return x}a.DomRendererRowFactory=p=f([g(1,u.ICharacterJoinerService),g(2,w.IOptionsService),g(3,u.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,u.IThemeService)],p)},2550:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,f){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 g=c.createElement("span");g.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const S=c.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[g,d,_,S],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(_),this._container.appendChild(S),f.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,f,g,d){c===this._font&&f===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,g){let d=0;if(!f&&!g&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const w=this._measure(c,0);return w>0&&(this._flat[d]=w),w}let _=c;f&&(_+="B"),g&&(_+="I");let S=this._holey.get(_);if(S===void 0){let w=0;f&&(w|=1),g&&(w|=2),S=this._measure(c,w),S>0&&this._holey.set(_,S)}return S}_measure(c,f){const g=this._measureElements[f];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(m,a)=>{function c(g){return 57508<=g&&g<=57558}function f(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},a.isEmoji=f,a.allowRescaling=function(g,d,_,S){return d===1&&_>Math.ceil(1.5*S)&&g!==void 0&&g>255&&!f(g)&&!c(g)&&!function(w){return 57344<=w&&w<=63743}(g)},a.treatGlyphAsBackgroundColor=function(g){return c(g)||function(d){return 9472<=d&&d<=9631}(g)},a.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}}}},a.computeNextVariantOffset=function(g,d,_=0){return(g-(2*Math.round(d)-_))%(2*Math.round(d))}},6052:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.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(g,d,_,S=!1){if(this.selectionStart=d,this.selectionEnd=_,!d||!_||d[0]===_[0]&&d[1]===_[1])return void this.clear();const w=g.buffers.active.ydisp,v=d[1]-w,u=_[1]-w,o=Math.max(v,0),s=Math.min(u,g.rows-1);o>=g.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=v,this.viewportEndRow=u,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=d[0],this.endCol=_[0])}isCellSelected(g,d,_){return!!this.hasSelection&&(_-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&_>=this.viewportCappedStartRow&&d<this.endCol&&_<=this.viewportCappedEndRow:d<this.startCol&&_>=this.viewportCappedStartRow&&d>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&d>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.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,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[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(m,a,c){var f=this&&this.__decorate||function(s,l,p,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,p):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,p,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,p,y):x(l,p))||y);return k>3&&y&&Object.defineProperty(l,p,y),y},g=this&&this.__param||function(s,l){return function(p,C){l(p,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const d=c(2585),_=c(8460),S=c(844);let w=a.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,l,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,l,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())}};a.CharSizeService=w=f([g(2,d.IOptionsService)],w);class v extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,p){l!==void 0&&l>0&&p!==void 0&&p>0&&(this._result.width=l,this._result.height=p)}}class u extends v{constructor(l,p,C){super(),this._document=l,this._parentElement=p,this._optionsService=C,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(l){super(),this._optionsService=l,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 l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(m,a,c){var f=this&&this.__decorate||function(o,s,l,p){var C,x=arguments.length,k=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,l):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,s,l,p);else for(var y=o.length-1;y>=0;y--)(C=o[y])&&(k=(x<3?C(k):x>3?C(s,l,k):C(s,l))||k);return x>3&&k&&Object.defineProperty(s,l,k),k},g=this&&this.__param||function(o,s){return function(l,p){s(l,p,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const d=c(3734),_=c(643),S=c(511),w=c(2585);class v extends d.AttributeData{constructor(s,l,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=l,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()]}}a.JoinedCellData=v;let u=a.CharacterJoinerService=class Th{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(s){const l={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(l),l.id}deregister(s){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===s)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(s);if(!l||l.length===0)return[];const p=[],C=l.translateToString(!0);let x=0,k=0,y=0,b=l.getFg(0),R=l.getBg(0);for(let A=0;A<l.getTrimmedLength();A++)if(l.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==b||this._workCell.bg!==R){if(A-x>1){const B=this._getJoinedRanges(C,y,k,l,x);for(let T=0;T<B.length;T++)p.push(B[T])}x=A,y=k,b=this._workCell.fg,R=this._workCell.bg}k+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const A=this._getJoinedRanges(C,y,k,l,x);for(let B=0;B<A.length;B++)p.push(A[B])}return p}_getJoinedRanges(s,l,p,C,x){const k=s.substring(l,p);let y=[];try{y=this._characterJoiners[0].handler(k)}catch(b){console.error(b)}for(let b=1;b<this._characterJoiners.length;b++)try{const R=this._characterJoiners[b].handler(k);for(let A=0;A<R.length;A++)Th._mergeRanges(y,R[A])}catch(R){console.error(R)}return this._stringRangesToCellRanges(y,C,x),y}_stringRangesToCellRanges(s,l,p){let C=0,x=!1,k=0,y=s[C];if(y){for(let b=p;b<this._bufferService.cols;b++){const R=l.getWidth(b),A=l.getString(b).length||_.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!x&&y[0]<=k&&(y[0]=b,x=!0),y[1]<=k){if(y[1]=b,y=s[++C],!y)break;y[0]<=k?(y[0]=b,x=!0):x=!1}k+=A}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(s,l){let p=!1;for(let C=0;C<s.length;C++){const x=s[C];if(p){if(l[1]<=x[0])return s[C-1][1]=l[1],s;if(l[1]<=x[1])return s[C-1][1]=Math.max(l[1],x[1]),s.splice(C,1),s;s.splice(C,1),C--}else{if(l[1]<=x[0])return s.splice(C,0,l),s;if(l[1]<=x[1])return x[0]=Math.min(l[0],x[0]),s;l[0]<x[1]&&(x[0]=Math.min(l[0],x[0]),p=!0)}}return p?s[s.length-1][1]=l[1]:s.push(l),s}};a.CharacterJoinerService=u=f([g(0,w.IBufferService)],u)},5114:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const f=c(844),g=c(8460),d=c(3656);class _ extends f.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 S(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this.register((0,g.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}}a.CoreBrowserService=_;class S extends f.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)(()=>this.clearListener()))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.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:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const f=c(844);class g extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const S=this.linkProviders.indexOf(_);S!==-1&&this.linkProviders.splice(S,1)}}}}a.LinkProviderService=g},8934:function(m,a,c){var f=this&&this.__decorate||function(w,v,u,o){var s,l=arguments.length,p=l<3?v:o===null?o=Object.getOwnPropertyDescriptor(v,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(w,v,u,o);else for(var C=w.length-1;C>=0;C--)(s=w[C])&&(p=(l<3?s(p):l>3?s(v,u,p):s(v,u))||p);return l>3&&p&&Object.defineProperty(v,u,p),p},g=this&&this.__param||function(w,v){return function(u,o){v(u,o,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const d=c(4725),_=c(9806);let S=a.MouseService=class{constructor(w,v){this._renderService=w,this._charSizeService=v}getCoords(w,v,u,o,s){return(0,_.getCoords)(window,w,v,u,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(w,v){const u=(0,_.getCoordsRelativeToElement)(window,w,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])}}};a.MouseService=S=f([g(0,d.IRenderService),g(1,d.ICharSizeService)],S)},3230:function(m,a,c){var f=this&&this.__decorate||function(s,l,p,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,p):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,p,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,p,y):x(l,p))||y);return k>3&&y&&Object.defineProperty(l,p,y),y},g=this&&this.__param||function(s,l){return function(p,C){l(p,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const d=c(6193),_=c(4725),S=c(8460),w=c(844),v=c(7226),u=c(2585);let o=a.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,l,p,C,x,k,y,b){super(),this._rowCount=s,this._charSizeService=C,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new w.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 S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((R,A)=>this._renderRows(R,A),y),this.register(this._renderDebouncer),this.register(y.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.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(y.window,l),this.register(y.onWindowChange(R=>this._registerIntersectionObserver(R,l)))}_registerIntersectionObserver(s,l){if("IntersectionObserver"in s){const p=new s.IntersectionObserver(C=>this._handleIntersectionChange(C[C.length-1]),{threshold:0});p.observe(l),this._observerDisposable.value=(0,w.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,l,p=!1){this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,l,this._rowCount))}_renderRows(s,l){this._renderer.value&&(s=Math.min(s,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(s,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:l}),this._onRender.fire({start:s,end:l}),this._isNextRenderRedrawOnly=!0)}resize(s,l){this._rowCount=l,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw(l=>this.refreshRows(l.start,l.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,l;this._renderer.value&&((l=(s=this._renderer.value).clearTextureAtlas)==null||l.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var p;return(p=this._renderer.value)==null?void 0:p.handleResize(s,l)}):this._renderer.value.handleResize(s,l),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,l,p){var C;this._selectionState.start=s,this._selectionState.end=l,this._selectionState.columnSelectMode=p,(C=this._renderer.value)==null||C.handleSelectionChanged(s,l,p)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};a.RenderService=o=f([g(2,u.IOptionsService),g(3,_.ICharSizeService),g(4,u.IDecorationService),g(5,u.IBufferService),g(6,_.ICoreBrowserService),g(7,_.IThemeService)],o)},9312:function(m,a,c){var f=this&&this.__decorate||function(y,b,R,A){var B,T=arguments.length,N=T<3?b:A===null?A=Object.getOwnPropertyDescriptor(b,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(y,b,R,A);else for(var F=y.length-1;F>=0;F--)(B=y[F])&&(N=(T<3?B(N):T>3?B(b,R,N):B(b,R))||N);return T>3&&N&&Object.defineProperty(b,R,N),N},g=this&&this.__param||function(y,b){return function(R,A){b(R,A,y)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const d=c(9806),_=c(9504),S=c(456),w=c(4725),v=c(8460),u=c(844),o=c(6114),s=c(4841),l=c(511),p=c(2585),C=" ",x=new RegExp(C,"g");let k=a.SelectionService=class extends u.Disposable{constructor(y,b,R,A,B,T,N,F,K){super(),this._element=y,this._screenElement=b,this._linkifier=R,this._bufferService=A,this._coreService=B,this._mouseService=T,this._optionsService=N,this._renderService=F,this._coreBrowserService=K,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new 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=G=>this._handleMouseMove(G),this._mouseUpListener=G=>this._handleMouseUp(G),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(G=>this._handleTrim(G)),this.register(this._bufferService.buffers.onBufferActivate(G=>this._handleBufferActivate(G))),this.enable(),this._model=new S.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 y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!y||!b||y[0]===b[0]&&y[1]===b[1])}get selectionText(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!y||!b)return"";const R=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(y[0]===b[0])return"";const B=y[0]<b[0]?y[0]:b[0],T=y[0]<b[0]?b[0]:y[0];for(let N=y[1];N<=b[1];N++){const F=R.translateBufferLineToString(N,!0,B,T);A.push(F)}}else{const B=y[1]===b[1]?b[0]:void 0;A.push(R.translateBufferLineToString(y[1],!0,y[0],B));for(let T=y[1]+1;T<=b[1]-1;T++){const N=R.lines.get(T),F=R.translateBufferLineToString(T,!0);N!=null&&N.isWrapped?A[A.length-1]+=F:A.push(F)}if(y[1]!==b[1]){const T=R.lines.get(b[1]),N=R.translateBufferLineToString(b[1],!0,0,b[0]);T&&T.isWrapped?A[A.length-1]+=N:A.push(N)}}return A.map(B=>B.replace(x," ")).join(o.isWindows?`\r
|
|
61
|
-
`:`
|
|
62
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&y&&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(y){const b=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(R&&A&&b)&&this._areCoordsInSelection(b,R,A)}isCellInSelection(y,b){const R=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!R||!A)&&this._areCoordsInSelection([y,b],R,A)}_areCoordsInSelection(y,b,R){return y[1]>b[1]&&y[1]<R[1]||b[1]===R[1]&&y[1]===b[1]&&y[0]>=b[0]&&y[0]<R[0]||b[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||b[1]<R[1]&&y[1]===b[1]&&y[0]>=b[0]}_selectWordAtCursor(y,b){var B,T;const R=(T=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:T.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(y);return!!A&&(this._selectWordAt(A,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,b){this._model.clearSelection(),y=Math.max(y,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const b=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(y){let b=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=R?0:(b>R&&(b-=R),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(y){return o.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!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(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const b=this._getMouseBufferCoords(y);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.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(y),!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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const A=R.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}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 y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const b=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const A=(0,_.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,R=!(!y||!b||y[0]===b[0]&&y[1]===b[1]);R?y&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,b,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,b,R)}_fireOnSelectionChange(y,b,R){this._oldSelectionStart=y,this._oldSelectionEnd=b,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(y,b){let R=b;for(let A=0;b>=A;A++){const B=y.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:B>1&&b!==A&&(R+=B-1)}return R}setSelection(y,b,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,b],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,b,R=!0,A=!0){if(y[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,T=B.lines.get(y[1]);if(!T)return;const N=B.translateBufferLineToString(y[1],!1);let F=this._convertViewportColToCharacterIndex(T,y[0]),K=F;const G=y[0]-F;let j=0,E=0,D=0,P=0;if(N.charAt(F)===" "){for(;F>0&&N.charAt(F-1)===" ";)F--;for(;K<N.length&&N.charAt(K+1)===" ";)K++}else{let V=y[0],Z=y[0];T.getWidth(V)===0&&(j++,V--),T.getWidth(Z)===2&&(E++,Z++);const ee=T.getString(Z).length;for(ee>1&&(P+=ee-1,K+=ee-1);V>0&&F>0&&!this._isCharWordSeparator(T.loadCell(V-1,this._workCell));){T.loadCell(V-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,V--):I>1&&(D+=I-1,F-=I-1),F--,V--}for(;Z<T.length&&K+1<N.length&&!this._isCharWordSeparator(T.loadCell(Z+1,this._workCell));){T.loadCell(Z+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,Z++):I>1&&(P+=I-1,K+=I-1),K++,Z++}}K++;let O=F+G-j+D,W=Math.min(this._bufferService.cols,K-F+j+E-D-P);if(b||N.slice(F,K).trim()!==""){if(R&&O===0&&T.getCodePoint(0)!==32){const V=B.lines.get(y[1]-1);if(V&&T.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(Z){const ee=this._bufferService.cols-Z.start;O-=ee,W+=ee}}}if(A&&O+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(y[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const Z=this._getWordAt([0,y[1]+1],!1,!1,!0);Z&&(W+=Z.length)}}return{start:O,length:W}}}_selectWordAt(y,b){const R=this._getWordAt(y,b);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[R.start,y[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(y){const b=this._getWordAt(y,!0);if(b){let R=y[1];for(;b.start<0;)b.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const b=this._bufferService.buffer.getWrappedRangeForLine(y),R={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)(R,this._bufferService.cols)}};a.SelectionService=k=f([g(3,p.IBufferService),g(4,p.ICoreService),g(5,w.IMouseService),g(6,p.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],k)},4725:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=c(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(m,a,c){var f=this&&this.__decorate||function(k,y,b,R){var A,B=arguments.length,T=B<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,y,b,R);else for(var N=k.length-1;N>=0;N--)(A=k[N])&&(T=(B<3?A(T):B>3?A(y,b,T):A(y,b))||T);return B>3&&T&&Object.defineProperty(y,b,T),T},g=this&&this.__param||function(k,y){return function(b,R){y(b,R,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),_=c(8055),S=c(8460),w=c(844),v=c(2585),u=_.css.toColor("#ffffff"),o=_.css.toColor("#000000"),s=_.css.toColor("#ffffff"),l=_.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.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")],y=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=y[b/36%6|0],A=y[b/6%6|0],B=y[b%6];k.push({css:_.channels.toCss(R,A,B),rgba:_.channels.toRgba(R,A,B)})}for(let b=0;b<24;b++){const R=8+10*b;k.push({css:_.channels.toCss(R,R,R),rgba:_.channels.toRgba(R,R,R)})}return k})());let C=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:o,cursor:s,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:_.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:_.color.blend(o,p),ansi:a.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 y=this._colors;if(y.foreground=x(k.foreground,u),y.background=x(k.background,o),y.cursor=x(k.cursor,s),y.cursorAccent=x(k.cursorAccent,l),y.selectionBackgroundTransparent=x(k.selectionBackground,p),y.selectionBackgroundOpaque=_.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(k.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=_.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=k.selectionForeground?x(k.selectionForeground,_.NULL_COLOR):void 0,y.selectionForeground===_.NULL_COLOR&&(y.selectionForeground=void 0),_.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=_.color.opacity(y.selectionBackgroundTransparent,.3)),_.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=_.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=a.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(k.black,a.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(k.red,a.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(k.green,a.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(k.yellow,a.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(k.blue,a.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(k.magenta,a.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(k.cyan,a.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(k.white,a.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(k.brightBlack,a.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(k.brightRed,a.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(k.brightGreen,a.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(k.brightYellow,a.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(k.brightBlue,a.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(k.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(k.brightCyan,a.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(k.brightWhite,a.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(y.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<b;R++)y.ansi[R+16]=x(k.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+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 y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}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 x(k,y){if(k!==void 0)try{return _.css.toColor(k)}catch{}return y}a.ThemeService=C=f([g(0,v.IOptionsService)],C)},6349:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(S){if(this._maxLength===S)return;const w=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)w[v]=this._array[this._getCyclicIndex(v)];this._array=w,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let w=this._length;w<S;w++)this._array[w]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,w){this._array[this._getCyclicIndex(S)]=w}push(S){this._array[this._getCyclicIndex(this._length)]=S,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(S,w,...v){if(w){for(let u=S;u<this._length-w;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let u=this._length-1;u>=S;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(S+u)]=v[u];if(v.length&&this.onInsertEmitter.fire({index:S,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(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,v){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let o=w-1;o>=0;o--)this.set(S+o+v,this.get(S+o));const u=S+w+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<w;u++)this.set(S+u+v,this.get(S+u))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(f,g=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const _ in f)d[_]=g<=1?f[_]:f[_]&&c(f[_],g-1);return d}},8055:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,f=0,g=0,d=0;var _,S,w,v,u;function o(l){const p=l.toString(16);return p.length<2?"0"+p:p}function s(l,p){return l<p?(p+.05)/(l+.05):(l+.05)/(p+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(l){l.toCss=function(p,C,x,k){return k!==void 0?`#${o(p)}${o(C)}${o(x)}${o(k)}`:`#${o(p)}${o(C)}${o(x)}`},l.toRgba=function(p,C,x,k=255){return(p<<24|C<<16|x<<8|k)>>>0},l.toColor=function(p,C,x,k){return{css:l.toCss(p,C,x,k),rgba:l.toRgba(p,C,x,k)}}}(_||(a.channels=_={})),function(l){function p(C,x){return d=Math.round(255*x),[c,f,g]=u.toChannels(C.rgba),{css:_.toCss(c,f,g,d),rgba:_.toRgba(c,f,g,d)}}l.blend=function(C,x){if(d=(255&x.rgba)/255,d===1)return{css:x.css,rgba:x.rgba};const k=x.rgba>>24&255,y=x.rgba>>16&255,b=x.rgba>>8&255,R=C.rgba>>24&255,A=C.rgba>>16&255,B=C.rgba>>8&255;return c=R+Math.round((k-R)*d),f=A+Math.round((y-A)*d),g=B+Math.round((b-B)*d),{css:_.toCss(c,f,g),rgba:_.toRgba(c,f,g)}},l.isOpaque=function(C){return(255&C.rgba)==255},l.ensureContrastRatio=function(C,x,k){const y=u.ensureContrastRatio(C.rgba,x.rgba,k);if(y)return _.toColor(y>>24&255,y>>16&255,y>>8&255)},l.opaque=function(C){const x=(255|C.rgba)>>>0;return[c,f,g]=u.toChannels(x),{css:_.toCss(c,f,g),rgba:x}},l.opacity=p,l.multiplyOpacity=function(C,x){return d=255&C.rgba,p(C,d*x/255)},l.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(S||(a.color=S={})),function(l){let p,C;try{const x=document.createElement("canvas");x.width=1,x.height=1;const k=x.getContext("2d",{willReadFrequently:!0});k&&(p=k,p.globalCompositeOperation="copy",C=p.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),_.toColor(c,f,g);case 5:return c=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),d=parseInt(x.slice(4,5).repeat(2),16),_.toColor(c,f,g,d);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const k=x.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]),f=parseInt(k[2]),g=parseInt(k[3]),d=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),_.toColor(c,f,g,d);if(!p||!C)throw new Error("css.toColor: Unsupported css format");if(p.fillStyle=C,p.fillStyle=x,typeof p.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(p.fillRect(0,0,1,1),[c,f,g,d]=p.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(c,f,g,d),css:x}}}(w||(a.css=w={})),function(l){function p(C,x,k){const y=C/255,b=x/255,R=k/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}l.relativeLuminance=function(C){return p(C>>16&255,C>>8&255,255&C)},l.relativeLuminance2=p}(v||(a.rgb=v={})),function(l){function p(x,k,y){const b=x>>24&255,R=x>>16&255,A=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,A));for(;F<y&&(B>0||T>0||N>0);)B-=Math.max(0,Math.ceil(.1*B)),T-=Math.max(0,Math.ceil(.1*T)),N-=Math.max(0,Math.ceil(.1*N)),F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,A));return(B<<24|T<<16|N<<8|255)>>>0}function C(x,k,y){const b=x>>24&255,R=x>>16&255,A=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,A));for(;F<y&&(B<255||T<255||N<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),T=Math.min(255,T+Math.ceil(.1*(255-T))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=s(v.relativeLuminance2(B,T,N),v.relativeLuminance2(b,R,A));return(B<<24|T<<16|N<<8|255)>>>0}l.blend=function(x,k){if(d=(255&k)/255,d===1)return k;const y=k>>24&255,b=k>>16&255,R=k>>8&255,A=x>>24&255,B=x>>16&255,T=x>>8&255;return c=A+Math.round((y-A)*d),f=B+Math.round((b-B)*d),g=T+Math.round((R-T)*d),_.toRgba(c,f,g)},l.ensureContrastRatio=function(x,k,y){const b=v.relativeLuminance(x>>8),R=v.relativeLuminance(k>>8);if(s(b,R)<y){if(R<b){const T=p(x,k,y),N=s(b,v.relativeLuminance(T>>8));if(N<y){const F=C(x,k,y);return N>s(b,v.relativeLuminance(F>>8))?T:F}return T}const A=C(x,k,y),B=s(b,v.relativeLuminance(A>>8));if(B<y){const T=p(x,k,y);return B>s(b,v.relativeLuminance(T>>8))?A:T}return A}},l.reduceLuminance=p,l.increaseLuminance=C,l.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(u||(a.rgba=u={})),a.toPaddedHex=o,a.contrastRatio=s},8969:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=c(844),g=c(2585),d=c(4348),_=c(7866),S=c(744),w=c(7302),v=c(6975),u=c(8460),o=c(1753),s=c(1480),l=c(7994),p=c(9282),C=c(5435),x=c(5981),k=c(2660);let y=!1;class b extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(A=>{var B;(B=this._onScrollApi)==null||B.fire(A.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(A){for(const B in A)this.optionsService.options[B]=A[B]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new f.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 d.InstantiationService,this.optionsService=this.register(new w.OptionsService(A)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.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(B=>{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(B=>{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 x.WriteBuffer((B,T)=>this._inputHandler.parse(B,T))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,B){this._writeBuffer.write(A,B)}writeSync(A,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(A,B)}input(A,B=!0){this.coreService.triggerDataEvent(A,B)}resize(A,B){isNaN(A)||isNaN(B)||(A=Math.max(A,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(A,B))}scroll(A,B=!1){this._bufferService.scroll(A,B)}scrollLines(A,B,T){this._bufferService.scrollLines(A,B,T)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const B=A-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(A,B){return this._inputHandler.registerEscHandler(A,B)}registerDcsHandler(A,B){return this._inputHandler.registerDcsHandler(A,B)}registerCsiHandler(A,B){return this._inputHandler.registerCsiHandler(A,B)}registerOscHandler(A,B){return this._inputHandler.registerOscHandler(A,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?A=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const B of A)B.dispose()})}}}a.CoreTerminal=b},8460:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.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 f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,f){return c(g=>f.fire(g))},a.runAndSubscribe=function(c,f){return f(void 0),c(g=>f(g))}},5435:function(m,a,c){var f=this&&this.__decorate||function(j,E,D,P){var O,W=arguments.length,V=W<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,E,D,P);else for(var Z=j.length-1;Z>=0;Z--)(O=j[Z])&&(V=(W<3?O(V):W>3?O(E,D,V):O(E,D))||V);return W>3&&V&&Object.defineProperty(E,D,V),V},g=this&&this.__param||function(j,E){return function(D,P){E(D,P,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=c(2584),_=c(7116),S=c(2015),w=c(844),v=c(482),u=c(8437),o=c(8460),s=c(643),l=c(511),p=c(3734),C=c(2585),x=c(1480),k=c(6242),y=c(6351),b=c(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function B(j,E){if(j>24)return E.setWinLines||!1;switch(j){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 T;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let N=0;class F extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,P,O,W,V,Z,ee,I=new S.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=P,this._logService=O,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=Z,this._unicodeService=ee,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new l.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 K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:U.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,U,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:U,data:H})}),this._parser.setDcsHandlerFallback((L,U,H)=>{U==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:U,payload:H})}),this._parser.setPrintHandler((L,U,H)=>this.print(L,U,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(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.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 y.DcsHandler((L,U)=>this.requestStatusString(L,U)))}_preserveStack(E,D,P,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=P,this._parseStack.position=O}_logSlowResolvingAsync(E){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,P)=>setTimeout(()=>P("#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 P,O=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const Z=this._parseStack.paused;if(Z){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(P),P;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>A&&(V=this._parseStack.position+A)}if(this._logService.logLevel<=C.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<A&&(this._parseBuffer=new Uint32Array(Math.min(E.length,A))),Z||this._dirtyRowTracker.clearRange(),E.length>A)for(let L=V;L<E.length;L+=A){const U=L+A<E.length?L+A:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(L,U),this._parseBuffer):this._utf8Decoder.decode(E.subarray(L,U),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,H))return this._preserveStack(O,W,H,L),this._logSlowResolvingAsync(P),P}else if(!Z){const L=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,L))return this._preserveStack(O,W,L,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const ee=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(ee,this._bufferService.rows-1))}print(E,D,P){let O,W;const V=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,ee=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,U=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let X=this._parser.precedingJoinState;for(let q=D;q<P;++q){if(O=E[q],O<127&&V){const z=V[String.fromCharCode(O)];z&&(O=z.charCodeAt(0))}const re=this._unicodeService.charProperties(O,X);W=x.UnicodeService.extractWidth(re);const _e=x.UnicodeService.extractShouldJoin(re),fe=_e?x.UnicodeService.extractWidth(X):0;if(X=re,Z&&this._onA11yChar.fire((0,v.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-fe>ee){if(I){const z=H;let J=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(z,J,0,fe,!1);J<ee;)z.setCellFromCodepoint(J++,0,1,U)}else if(this._activeBuffer.x=ee-1,W===2)continue}if(_e&&this._activeBuffer.x){const z=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-z,O,W);for(let J=W-fe;--J>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(L&&(H.insertCells(this._activeBuffer.x,W-fe,this._activeBuffer.getNullCell(U)),H.getWidth(ee-1)===2&&H.setCellFromCodepoint(ee-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,U)),H.setCellFromCodepoint(this._activeBuffer.x++,O,W,U),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=X,this._activeBuffer.x<ee&&P-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,U),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,P=>!B(P.params[0],this._optionsService.rawOptions.windowOptions)||D(P))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new y.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,P,O=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);V.replaceCells(D,P,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(V.isWrapped=!1)}_resetBufferLine(E,D=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,D=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);P<this._bufferService.rows;P++)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(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 P=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;D--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(P,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 P=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;D--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(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 P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.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 P=E.params[0]||1,O=x.UnicodeService.extractWidth(D),W=this._activeBuffer.x-O,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),Z=new Uint32Array(V.length*P);let ee=0;for(let L=0;L<V.length;){const U=V.codePointAt(L)||0;Z[ee++]=U,L+=U>65535?2:1}let I=ee;for(let L=1;L<P;++L)Z.copyWithin(I,0,ee),I+=ee;return this.print(Z,0,I),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.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 P=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:Z,cols:ee}=this._bufferService,{active:I,alt:L}=Z,U=this._optionsService.rawOptions,H=_e=>_e?1:2,X=E.params[0];return q=X,re=D?X===2?4:X===4?H(V.modes.insertMode):X===12?3:X===20?H(U.convertEol):0:X===1?H(P.applicationCursorKeys):X===3?U.windowOptions.setWinLines?ee===80?2:ee===132?1:0:0:X===6?H(P.origin):X===7?H(P.wraparound):X===8?3:X===9?H(O==="X10"):X===12?H(U.cursorBlink):X===25?H(!V.isCursorHidden):X===45?H(P.reverseWraparound):X===66?H(P.applicationKeypad):X===67?4:X===1e3?H(O==="VT200"):X===1002?H(O==="DRAG"):X===1003?H(O==="ANY"):X===1004?H(P.sendFocus):X===1005?4:X===1006?H(W==="SGR"):X===1015?4:X===1016?H(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?H(I===L):X===2004?H(P.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${D?"":"?"}${q};${re}$y`),!0;var q,re}_updateAttrColor(E,D,P,O,W){return D===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([P,O,W])):D===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,D,P){const O=[0,0,-1,0,0,0];let W=0,V=0;do{if(O[V+W]=E.params[D+V],E.hasSubParams(D+V)){const Z=E.getSubParams(D+V);let ee=0;do O[1]===5&&(W=1),O[V+ee+1+W]=Z[ee];while(++ee<Z.length&&ee+V+1+W<O.length);break}if(O[1]===5&&V+W>=2||O[1]===2&&V+W>=5)break;O[1]&&(W=1)}while(++V+D<E.length&&V+W<O.length);for(let Z=2;Z<O.length;++Z)O[Z]===-1&&(O[Z]=0);switch(O[0]){case 38:P.fg=this._updateAttrColor(P.fg,O[1],O[3],O[4],O[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,O[1],O[3],O[4],O[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,O[1],O[3],O[4],O[5])}return V}_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 P;const O=this._curAttrData;for(let W=0;W<D;W++)P=E.params[W],P>=30&&P<=37?(O.fg&=-50331904,O.fg|=16777216|P-30):P>=40&&P<=47?(O.bg&=-50331904,O.bg|=16777216|P-40):P>=90&&P<=97?(O.fg&=-50331904,O.fg|=16777224|P-90):P>=100&&P<=107?(O.bg&=-50331904,O.bg|=16777224|P-100):P===0?this._processSGR0(O):P===1?O.fg|=134217728:P===3?O.bg|=67108864:P===4?(O.fg|=268435456,this._processUnderline(E.hasSubParams(W)?E.getSubParams(W)[0]:1,O)):P===5?O.fg|=536870912:P===7?O.fg|=67108864:P===8?O.fg|=1073741824:P===9?O.fg|=2147483648:P===2?O.bg|=134217728:P===21?this._processUnderline(2,O):P===22?(O.fg&=-134217729,O.bg&=-134217729):P===23?O.bg&=-67108865:P===24?(O.fg&=-268435457,this._processUnderline(0,O)):P===25?O.fg&=-536870913:P===27?O.fg&=-67108865:P===28?O.fg&=-1073741825:P===29?O.fg&=2147483647:P===39?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):P===49?(O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?W+=this._extractColor(E,W,O):P===53?O.bg|=1073741824:P===55?O.bg&=-1073741825:P===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):P===100?(O.fg&=-67108864,O.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${D};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${D};${P}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 P=D%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const D=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!B(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(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.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=[],P=E.split(";");for(;P.length>1;){const O=P.shift(),W=P.shift();if(/^\d+$/.exec(O)){const V=parseInt(O);if(G(V))if(W==="?")D.push({type:0,index:V});else{const Z=(0,b.parseColor)(W);Z&&D.push({type:1,index:V,color:Z})}}}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 P=E.split(":");let O;const W=P.findIndex(V=>V.startsWith("id="));return W!==-1&&(O=P[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,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 P=E.split(";");for(let O=0;O<P.length&&!(D>=this._specialColors.length);++O,++D)if(P[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,b.parseColor)(P[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}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=[],P=E.split(";");for(let O=0;O<P.length;++O)if(/^\d+$/.exec(P[O])){const W=parseInt(P[O]);G(W)&&D.push({type:2,index:W})}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(R[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 l.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 P=this._activeBuffer.ybase+this._activeBuffer.y+D,O=this._activeBuffer.lines.get(P);O&&(O.fill(E),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const P=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}a.InputHandler=F;let K=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function G(j){return 0<=j&&j<256}K=f([g(0,C.IBufferService)],K)},844:(m,a)=>{function c(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=c,a.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,_){this._data[g]||(this._data[g]={}),this._data[g][d]=_}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(f,g,d,_,S){this._data.get(f,g)||this._data.set(f,g,new c),this._data.get(f,g).set(d,_,S)}get(f,g,d,_){var S;return(S=this._data.get(f,g))==null?void 0:S.get(d,_)}clear(){this._data.clear()}}},6114:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,g){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let g=0,d=this._array.length-1;for(;d>=g;){let _=g+d>>1;const S=this._getKey(this._array[_]);if(S>f)d=_-1;else{if(!(S<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}g=_+1}}return g}}},7226:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),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(S){this._idleCallback=void 0;let w=0,v=0,u=S.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),v=Math.max(w,v),o=S.timeRemaining(),1.5*v>o)return u-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-w))}ms`),void this._start();u=o}this.clear()}}class d extends g{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=c(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),_=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&_&&(S.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}a.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,_=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=c(6349),g=c(7226),d=c(3734),_=c(8437),S=c(4634),w=c(511),v=c(643),u=c(4863),o=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(s,l,p){this._hasScrollback=s,this._optionsService=l,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=w.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.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 d.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 d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,l){return new _.BufferLine(this._bufferService.cols,this.getNullCell(s),l)}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 l=s+this._optionsService.rawOptions.scrollback;return l>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:l}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=_.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,l){const p=this.getNullCell(_.DEFAULT_ATTR_DATA);let C=0;const x=this._getCorrectBufferLength(l);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let y=0;y<this.lines.length;y++)C+=+this.lines.get(y).resize(s,p);let k=0;if(this._rows<l)for(let y=this._rows;y<l;y++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.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 y=this._rows;y>l;y--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const y=this.lines.length-x;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,l-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(s,l),this._cols>s))for(let k=0;k<this.lines.length;k++)C+=+this.lines.get(k).resize(s,p);this._cols=s,this._rows=l,this._memoryCleanupQueue.clear(),C>.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 l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>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,l){this._cols!==s&&(s>this._cols?this._reflowLarger(s,l):this._reflowSmaller(s,l))}_reflowLarger(s,l){const p=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(p.length>0){const C=(0,S.reflowLargerCreateNewLayout)(this.lines,p);(0,S.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(s,l,C.countRemoved)}}_reflowLargerAdjustViewport(s,l,p){const C=this.getNullCell(_.DEFAULT_ATTR_DATA);let x=p;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new _.BufferLine(s,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,l){const p=this.getNullCell(_.DEFAULT_ATTR_DATA),C=[];let x=0;for(let k=this.lines.length-1;k>=0;k--){let y=this.lines.get(k);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const b=[y];for(;y.isWrapped&&k>0;)y=this.lines.get(--k),b.unshift(y);const R=this.ybase+this.y;if(R>=k&&R<k+b.length)continue;const A=b[b.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(b,this._cols,s),T=B.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const F=[];for(let P=0;P<T;P++){const O=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);F.push(O)}F.length>0&&(C.push({start:k+b.length+x,newLines:F}),x+=F.length),b.push(...F);let K=B.length-1,G=B[K];G===0&&(K--,G=B[K]);let j=b.length-T-1,E=A;for(;j>=0;){const P=Math.min(E,G);if(b[K]===void 0)break;if(b[K].copyCellsFrom(b[j],E-P,G-P,P,!0),G-=P,G===0&&(K--,G=B[K]),E-=P,E===0){j--;const O=Math.max(j,0);E=(0,S.getWrappedLineTrimmedLength)(b,O,this._cols)}}for(let P=0;P<b.length;P++)B[P]<s&&b[P].setCell(B[P],p);let D=T-N;for(;D-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+l-1)}if(C.length>0){const k=[],y=[];for(let K=0;K<this.lines.length;K++)y.push(this.lines.get(K));const b=this.lines.length;let R=b-1,A=0,B=C[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let T=0;for(let K=Math.min(this.lines.maxLength-1,b+x-1);K>=0;K--)if(B&&B.start>R+T){for(let G=B.newLines.length-1;G>=0;G--)this.lines.set(K--,B.newLines[G]);K++,k.push({index:R+1,amount:B.newLines.length}),T+=B.newLines.length,B=C[++A]}else this.lines.set(K,y[R--]);let N=0;for(let K=k.length-1;K>=0;K--)k[K].index+=N,this.lines.onInsertEmitter.fire(k[K]),N+=k[K].amount;const F=Math.max(0,b+x-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(s,l,p=0,C){const x=this.lines.get(s);return x?x.translateToString(l,p,C):""}getWrappedRangeForLine(s){let l=s,p=s;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:l,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 l=0;l<this.markers.length;l++)this.markers[l].line===s&&(this.markers[l].dispose(),this.markers.splice(l--,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 l=new u.Marker(s);return this.markers.push(l),l.register(this.lines.onTrim(p=>{l.line-=p,l.line<0&&l.dispose()})),l.register(this.lines.onInsert(p=>{l.line>=p.index&&(l.line+=p.amount)})),l.register(this.lines.onDelete(p=>{l.line>=p.index&&l.line<p.index+p.amount&&l.dispose(),l.line>p.index&&(l.line-=p.amount)})),l.register(l.onDispose(()=>this._removeMarker(l))),l}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=c(3734),g=c(511),d=c(643),_=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class w{constructor(u,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const l=o||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let p=0;p<u;++p)this.setCell(p,l);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[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=o[1],this._data[3*u+0]=2097152|u|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.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 S=3*u,o.content=this._data[S+0],o.fg=this._data[S+1],o.bg=this._data[S+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,l){268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=o|s<<22,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}addCodepointToCell(u,o,s){let l=this._data[3*u+0];2097152&l?this._combined[u]+=(0,_.stringFromCodePoint)(o):2097151&l?(this._combined[u]=(0,_.stringFromCodePoint)(2097151&l)+(0,_.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,s&&(l&=-12582913,l|=s<<22),this._data[3*u+0]=l}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 l=new g.CellData;for(let p=this.length-u-o-1;p>=0;--p)this.setCell(u+o+p,this.loadCell(u+p,l));for(let p=0;p<o;++p)this.setCell(u+p,s)}else for(let l=u;l<this.length;++l)this.setCell(l,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 l=new g.CellData;for(let p=0;p<this.length-u-o;++p)this.setCell(u+p,this.loadCell(u+o+p,l));for(let p=this.length-o;p<this.length;++p)this.setCell(p,s)}else for(let l=u;l<this.length;++l)this.setCell(l,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,l=!1){if(l)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 l=new Uint32Array(s);l.set(this._data),this._data=l}for(let l=this.length;l<u;++l)this.setCell(l,o)}else{this._data=this._data.subarray(0,s);const l=Object.keys(this._combined);for(let C=0;C<l.length;C++){const x=parseInt(l[C],10);x>=u&&delete this._combined[x]}const p=Object.keys(this._extendedAttrs);for(let C=0;C<p.length;C++){const x=parseInt(p[C],10);x>=u&&delete this._extendedAttrs[x]}}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 w(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,l,p){const C=u._data;if(p)for(let k=l-1;k>=0;k--){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}else for(let k=0;k<l;k++){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=u._extendedAttrs[o+k])}const x=Object.keys(u._combined);for(let k=0;k<x.length;k++){const y=parseInt(x[k],10);y>=o&&(this._combined[y-o+s]=u._combined[y])}}translateToString(u,o,s,l){o=o??0,s=s??this.length,u&&(s=Math.min(s,this.getTrimmedLength())),l&&(l.length=0);let p="";for(;o<s;){const C=this._data[3*o+0],x=2097151&C,k=2097152&C?this._combined[o]:x?(0,_.stringFromCodePoint)(x):d.WHITESPACE_CELL_CHAR;if(p+=k,l)for(let y=0;y<k.length;++y)l.push(o);o+=C>>22||1}return l&&l.push(o),p}}a.BufferLine=w},4841:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,f){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 f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(m,a)=>{function c(f,g,d){if(g===f.length-1)return f[g].getTrimmedLength();const _=!f[g].hasContent(d-1)&&f[g].getWidth(d-1)===1,S=f[g+1].getWidth(0)===2;return _&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,g,d,_,S){const w=[];for(let v=0;v<f.length-1;v++){let u=v,o=f.get(++u);if(!o.isWrapped)continue;const s=[f.get(v)];for(;u<f.length&&o.isWrapped;)s.push(o),o=f.get(++u);if(_>=v&&_<u){v+=s.length-1;continue}let l=0,p=c(s,l,g),C=1,x=0;for(;C<s.length;){const y=c(s,C,g),b=y-x,R=d-p,A=Math.min(b,R);s[l].copyCellsFrom(s[C],x,p,A,!1),p+=A,p===d&&(l++,p=0),x+=A,x===y&&(C++,x=0),p===0&&l!==0&&s[l-1].getWidth(d-1)===2&&(s[l].copyCellsFrom(s[l-1],d-1,p++,1,!1),s[l-1].setCell(d-1,S))}s[l].replaceCells(p,d,S);let k=0;for(let y=s.length-1;y>0&&(y>l||s[y].getTrimmedLength()===0);y--)k++;k>0&&(w.push(v+s.length-k),w.push(k)),v+=s.length-1}return w},a.reflowLargerCreateNewLayout=function(f,g){const d=[];let _=0,S=g[_],w=0;for(let v=0;v<f.length;v++)if(S===v){const u=g[++_];f.onDeleteEmitter.fire({index:v-w,amount:u}),v+=u-1,w+=u,S=g[++_]}else d.push(v);return{layout:d,countRemoved:w}},a.reflowLargerApplyNewLayout=function(f,g){const d=[];for(let _=0;_<g.length;_++)d.push(f.get(g[_]));for(let _=0;_<d.length;_++)f.set(_,d[_]);f.length=g.length},a.reflowSmallerGetNewLineLengths=function(f,g,d){const _=[],S=f.map((o,s)=>c(f,s,g)).reduce((o,s)=>o+s);let w=0,v=0,u=0;for(;u<S;){if(S-u<d){_.push(S-u);break}w+=d;const o=c(f,v,g);w>o&&(w-=o,v++);const s=f[v].getWidth(w-1)===2;s&&w--;const l=s?d-1:d;_.push(l),u+=l}return _},a.getWrappedLineTrimmedLength=c},5295:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=c(8460),g=c(844),d=c(9092);class _ extends g.Disposable{constructor(w,v){super(),this._optionsService=w,this._bufferService=v,this._onBufferActivate=this.register(new f.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,v){this._normal.resize(w,v),this._alt.resize(w,v),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=_},511:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=c(482),g=c(643),d=c(3734);class _ extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const v=new _;return v.setFromCharData(w),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const u=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(u-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=_},643:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=c(8460),g=c(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,a)=>{var c,f,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
63
|
-
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(c||(a.C0=c={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(f||(a.C1=f={})),function(d){d.ST=`${c.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=c(2584),g={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:["'",'"']};a.evaluateKeyboardEvent=function(d,_,S,w){const v={type:0,cancel:!1,key:void 0},u=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?v.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?v.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?v.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(v.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:v.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(v.key=f.C0.ESC+v.key);break;case 9:if(d.shiftKey){v.key=f.C0.ESC+"[Z";break}v.key=f.C0.HT,v.cancel=!0;break;case 13:v.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,v.cancel=!0;break;case 27:v.key=f.C0.ESC,d.altKey&&(v.key=f.C0.ESC+f.C0.ESC),v.cancel=!0;break;case 37:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"D",v.key===f.C0.ESC+"[1;3D"&&(v.key=f.C0.ESC+(S?"b":"[1;5D"))):v.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"C",v.key===f.C0.ESC+"[1;3C"&&(v.key=f.C0.ESC+(S?"f":"[1;5C"))):v.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"A",S||v.key!==f.C0.ESC+"[1;3A"||(v.key=f.C0.ESC+"[1;5A")):v.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"B",S||v.key!==f.C0.ESC+"[1;3B"||(v.key=f.C0.ESC+"[1;5B")):v.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(v.key=f.C0.ESC+"[2~");break;case 46:v.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:v.key=u?f.C0.ESC+"[1;"+(u+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:v.key=u?f.C0.ESC+"[1;"+(u+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?v.type=2:d.ctrlKey?v.key=f.C0.ESC+"[5;"+(u+1)+"~":v.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?v.type=3:d.ctrlKey?v.key=f.C0.ESC+"[6;"+(u+1)+"~":v.key=f.C0.ESC+"[6~";break;case 112:v.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:v.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:v.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:v.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:v.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:v.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:v.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:v.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:v.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:v.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:v.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:v.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!w||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?v.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(v.key=f.C0.US),d.key==="@"&&(v.key=f.C0.NUL)):d.keyCode===65&&(v.type=1);else{const o=g[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)v.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const l=d.ctrlKey?d.keyCode-64:d.keyCode+32;let p=String.fromCharCode(l);d.shiftKey&&(p=p.toUpperCase()),v.key=f.C0.ESC+p}else if(d.keyCode===32)v.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let l=d.code.slice(3,4);d.shiftKey||(l=l.toLowerCase()),v.key=f.C0.ESC+l,v.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?v.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?v.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?v.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?v.key=f.C0.DEL:d.keyCode===219?v.key=f.C0.ESC:d.keyCode===220?v.key=f.C0.FS:d.keyCode===221&&(v.key=f.C0.GS)}return v}},482:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,f=0,g=c.length){let d="";for(let _=f;_<g;++_){let S=c[_];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const g=c.length;if(!g)return 0;let d=0,_=0;if(this._interim){const S=c.charCodeAt(_++);56320<=S&&S<=57343?f[d++]=1024*(this._interim-55296)+S-56320+65536:(f[d++]=this._interim,f[d++]=S),this._interim=0}for(let S=_;S<g;++S){const w=c.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=g)return this._interim=w,d;const v=c.charCodeAt(S);56320<=v&&v<=57343?f[d++]=1024*(w-55296)+v-56320+65536:(f[d++]=w,f[d++]=v)}else w!==65279&&(f[d++]=w)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const g=c.length;if(!g)return 0;let d,_,S,w,v=0,u=0,o=0;if(this.interim[0]){let p=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let x,k=0;for(;(x=63&this.interim[++k])&&k<4;)C<<=6,C|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=y-k;for(;o<b;){if(o>=g)return 0;if(x=c[o++],(192&x)!=128){o--,p=!0;break}this.interim[k++]=x,C<<=6,C|=63&x}p||(y===2?C<128?o--:f[v++]=C:y===3?C<2048||C>=55296&&C<=57343||C===65279||(f[v++]=C):C<65536||C>1114111||(f[v++]=C)),this.interim.fill(0)}const s=g-4;let l=o;for(;l<g;){for(;!(!(l<s)||128&(d=c[l])||128&(_=c[l+1])||128&(S=c[l+2])||128&(w=c[l+3]));)f[v++]=d,f[v++]=_,f[v++]=S,f[v++]=w,l+=4;if(d=c[l++],d<128)f[v++]=d;else if((224&d)==192){if(l>=g)return this.interim[0]=d,v;if(_=c[l++],(192&_)!=128){l--;continue}if(u=(31&d)<<6|63&_,u<128){l--;continue}f[v++]=u}else if((240&d)==224){if(l>=g)return this.interim[0]=d,v;if(_=c[l++],(192&_)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=_,v;if(S=c[l++],(192&S)!=128){l--;continue}if(u=(15&d)<<12|(63&_)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[v++]=u}else if((248&d)==240){if(l>=g)return this.interim[0]=d,v;if(_=c[l++],(192&_)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=_,v;if(S=c[l++],(192&S)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=_,this.interim[2]=S,v;if(w=c[l++],(192&w)!=128){l--;continue}if(u=(7&d)<<18|(63&_)<<12|(63&S)<<6|63&w,u<65536||u>1114111)continue;f[v++]=u}}return v}}},225:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=c(1480),g=[[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]],d=[[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 _;a.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 S=0;S<g.length;++S)_.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?_[S]:function(w,v){let u,o=0,s=v.length-1;if(w<v[0][0]||w>v[s][1])return!1;for(;s>=o;)if(u=o+s>>1,w>v[u][1])o=u+1;else{if(!(w<v[u][0]))return!0;s=u-1}return!1}(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let v=this.wcwidth(S),u=v===0&&w!==0;if(u){const o=f.UnicodeService.extractWidth(w);o===0?u=!1:o>v&&(v=o)}return f.UnicodeService.createPropertyValue(0,v,u)}}},5981:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),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(S,w){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+=S.length,this._writeBuffer.push(S),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w)}_innerWrite(S=0,w=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],o=this._action(u,w);if(o){const l=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(l)}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()}}a.WriteBuffer=d},5941:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.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})$/,f=/^[\da-f]+$/;function g(d,_){const S=d.toString(16),w=S.length<2?"0"+S:S;switch(_){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(d){if(!d)return;let _=d.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const S=c.exec(_);if(S){const w=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/w*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/w*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/w*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const S=_.length/3,w=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(_.slice(S*v,S*v+S),16);w[v]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return w}},a.toRgbString=function(d,_=16){const[S,w,v]=d;return`rgb:${g(S,_)}/${g(w,_)}/${g(v,_)}`}},5770:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=c(482),g=c(8742),d=c(5770),_=[];a.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(w,v){this._handlers[w]===void 0&&(this._handlers[w]=[]);const u=this._handlers[w];return u.push(v),{dispose:()=>{const o=u.indexOf(v);o!==-1&&u.splice(o,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(w,v){if(this.reset(),this._ident=w,this._active=this._handlers[w]||_,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(w,v,u){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,v,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,v,u))}unhook(w,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(w),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",w);this._active=_,this._ident=0}};const S=new g.Params;S.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=S,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():S,this._data="",this._hitLimit=!1}put(w,v,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,v,u),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let v=!1;if(this._hitLimit)v=!1;else if(w&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=c(844),g=c(8742),d=c(6242),_=c(6351);class S{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,l,p){this.table[s<<8|o]=l<<4|p}addMany(o,s,l,p){for(let C=0;C<o.length;C++)this.table[s<<8|o[C]]=l<<4|p}}a.TransitionTable=S;const w=160;a.VT500_TRANSITION_TABLE=function(){const u=new S(4095),o=Array.apply(null,Array(256)).map((k,y)=>y),s=(k,y)=>o.slice(k,y),l=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const C=s(0,14);let x;for(x in u.setDefault(1,0),u.addMany(l,0,2,0),C)u.addMany([24,26,153,154],x,3,0),u.addMany(s(128,144),x,3,0),u.addMany(s(144,152),x,3,0),u.add(156,x,0,0),u.add(27,x,11,1),u.add(157,x,4,8),u.addMany([152,158,159],x,0,7),u.add(155,x,11,3),u.add(144,x,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(l,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(l,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(l,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(w,0,2,0),u.add(w,8,5,8),u.add(w,6,0,6),u.add(w,11,0,11),u.add(w,13,13,13),u}();class v extends f.Disposable{constructor(o=a.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 g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,l,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,l)=>{},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,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let l=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=o.prefix.charCodeAt(0),l&&60>l||l>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 C=0;C<o.intermediates.length;++C){const x=o.intermediates.charCodeAt(C);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=x}}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 l<<=8,l|=p,l}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 l=this._identifier(o,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const p=this._escHandlers[l];return p.push(s),{dispose:()=>{const C=p.indexOf(s);C!==-1&&p.splice(C,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 l=this._identifier(o);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const p=this._csiHandlers[l];return p.push(s),{dispose:()=>{const C=p.indexOf(s);C!==-1&&p.splice(C,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,l,p,C){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=l,this._parseStack.transition=p,this._parseStack.chunkPos=C}parse(o,s,l){let p,C=0,x=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&b>-1){for(;b>=0&&(p=y[b](this._params),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 4:if(l===!1&&b>-1){for(;b>=0&&(p=y[b](),p!==!0);b--)if(p instanceof Promise)return this._parseStack.handlerPos=b,p}this._parseStack.handlers=[];break;case 6:if(C=o[this._parseStack.chunkPos],p=this._dcsParser.unhook(C!==24&&C!==26,l),p)return p;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=o[this._parseStack.chunkPos],p=this._oscParser.end(C!==24&&C!==26,l),p)return p;C===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 y=k;y<s;++y){switch(C=o[y],x=this._transitions.table[this.currentState<<8|(C<160?C:w)],x>>4){case 2:for(let T=y+1;;++T){if(T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|C];let R=b?b.length-1:-1;for(;R>=0&&(p=b[R](this._params),p!==!0);R--)if(p instanceof Promise)return this._preserveStack(3,b,R,x,y),p;R<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++y<s&&(C=o[y])>47&&C<60);y--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const A=this._escHandlers[this._collect<<8|C];let B=A?A.length-1:-1;for(;B>=0&&(p=A[B](),p!==!0);B--)if(p instanceof Promise)return this._preserveStack(4,A,B,x,y),p;B<0&&this._escHandlerFb(this._collect<<8|C),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|C,this._params);break;case 13:for(let T=y+1;;++T)if(T>=s||(C=o[T])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(o,y,T),y=T-1;break}break;case 14:if(p=this._dcsParser.unhook(C!==24&&C!==26),p)return this._preserveStack(6,[],0,x,y),p;C===27&&(x|=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 T=y+1;;T++)if(T>=s||(C=o[T])<32||C>127&&C<w){this._oscParser.put(o,y,T),y=T-1;break}break;case 6:if(p=this._oscParser.end(C!==24&&C!==26),p)return this._preserveStack(5,[],0,x,y),p;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}a.EscapeSequenceParser=v},6242:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=c(5770),g=c(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,S){this._handlers[_]===void 0&&(this._handlers[_]=[]);const w=this._handlers[_];return w.push(S),{dispose:()=>{const v=w.indexOf(S);v!==-1&&w.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}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=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,S,w){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,S,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(_,S,w))}start(){this.reset(),this._state=1}put(_,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const v=_[S++];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&&w-S>0&&this._put(_,S,w)}}end(_,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,w=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&w===!1){for(;v>=0&&(w=this._active[v].end(_),w!==!0);v--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,w;v--}for(;v>=0;v--)if(w=this._active[v].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",_);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,S,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(_,S,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let S=!1;if(this._hitLimit)S=!1;else if(_&&(S=this._handler(this._data),S instanceof Promise))return S.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,S}}},8742:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class f{static fromArray(d){const _=new f;if(!d.length)return _;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const w=d[S];if(Array.isArray(w))for(let v=0;v<w.length;++v)_.addSubParam(w[v]);else _.addParam(w)}return _}constructor(d=32,_=32){if(this.maxLength=d,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let _=0;_<this.length;++_){d.push(this.params[_]);const S=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const _=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-_>0?this._subParams.subarray(_,S):null}getSubParamsAll(){const d={};for(let _=0;_<this.length;++_){const S=this._subParamsIdx[_]>>8,w=255&this._subParamsIdx[_];w-S>0&&(d[_]=this._subParams.slice(S,w))}return d}addDigit(d){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[_-1];S[_-1]=~w?Math.min(10*w+d,c):d}}a.Params=f},5741:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){f=g;break}if(f===-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(f,1)}}},8771:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=c(3785),g=c(511);a.BufferApiView=class{constructor(d,_){this._buffer=d,this.type=_}init(d){return this._buffer=d,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(d){const _=this._buffer.lines.get(d);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new g.CellData}}},3785:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=c(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new f.CellData)}translateToString(g,d,_){return this._line.translateToString(g,d,_)}}},8285:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=c(8771),g=c(8460),d=c(844);class _ extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}a.BufferNamespaceApi=_},7975:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,g=>f(g.toArray()))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,(g,d)=>f(g,d.toArray()))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.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(m,a,c){var f=this&&this.__decorate||function(u,o,s,l){var p,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,o,s,l);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(x=(C<3?p(x):C>3?p(o,s,x):p(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(u,o){return function(s,l){o(s,l,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=c(8460),_=c(844),S=c(5295),w=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let v=a.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.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 l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===u.fg&&l.getBg(0)===u.bg||(l=s.getBlankLine(u,o),this._cachedBlankLine=l),l.isWrapped=o;const p=s.ybase+s.scrollTop,C=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;C===s.lines.length-1?x?s.lines.recycle().copyFrom(l):s.lines.push(l.clone()):s.lines.splice(C+1,0,l.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=C-p+1;s.lines.shiftElements(p+1,x-1,-1),s.lines.set(C,l.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,o,s){const l=this.buffer;if(u<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else u+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const p=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+u,l.ybase),0),p!==l.ydisp&&(o||this._onScroll.fire(l.ydisp))}};a.BufferService=v=f([g(0,w.IOptionsService)],v)},7994:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.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,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(m,a,c){var f=this&&this.__decorate||function(l,p,C,x){var k,y=arguments.length,b=y<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,p,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(p,C,b):k(p,C))||b);return y>3&&b&&Object.defineProperty(p,C,b),b},g=this&&this.__param||function(l,p){return function(C,x){p(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=c(2585),_=c(8460),S=c(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function v(l,p){let C=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(C|=64,C|=l.action):(C|=3&l.button,4&l.button&&(C|=64),8&l.button&&(C|=128),l.action===32?C|=32:l.action!==0||p||(C|=3)),C}const u=String.fromCharCode,o={DEFAULT:l=>{const p=[v(l,!1)+32,l.col+32,l.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${u(p[0])}${u(p[1])}${u(p[2])}`},SGR:l=>{const p=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.col};${l.row}${p}`},SGR_PIXELS:l=>{const p=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.x};${l.y}${p}`}};let s=a.CoreMouseService=class extends S.Disposable{constructor(l,p){super(),this._bufferService=l,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 C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(o))this.addEncoding(C,o[C]);this.reset()}addProtocol(l,p){this._protocols[l]=p}addEncoding(l,p){this._encodings[l]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const p=this._encodings[this._activeEncoding](l);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,p,C){if(C){if(l.x!==p.x||l.y!==p.y)return!1}else if(l.col!==p.col||l.row!==p.row)return!1;return l.button===p.button&&l.action===p.action&&l.ctrl===p.ctrl&&l.alt===p.alt&&l.shift===p.shift}};a.CoreMouseService=s=f([g(0,d.IBufferService),g(1,d.ICoreService)],s)},6975:function(m,a,c){var f=this&&this.__decorate||function(s,l,p,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,p):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,p,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,p,y):x(l,p))||y);return k>3&&y&&Object.defineProperty(l,p,y),y},g=this&&this.__param||function(s,l){return function(p,C){l(p,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=c(1439),_=c(8460),S=c(844),w=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=a.CoreService=class extends S.Disposable{constructor(s,l,p){super(),this._bufferService=s,this._logService=l,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,d.clone)(v),this.decPrivateModes=(0,d.clone)(u)}reset(){this.modes=(0,d.clone)(v),this.decPrivateModes=(0,d.clone)(u)}triggerDataEvent(s,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(C=>C.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(l=>l.charCodeAt(0))),this._onBinary.fire(s))}};a.CoreService=o=f([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],o)},9074:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=c(8055),g=c(8460),d=c(844),_=c(6106);let S=0,w=0;class v extends d.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 g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const l=new u(s);if(l){const p=l.marker.onDispose(()=>l.dispose());l.onDispose(()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),p.dispose())}),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,l,p){let C=0,x=0;for(const k of this._decorations.getKeyIterator(l))C=k.options.x??0,x=C+(k.options.width??1),s>=C&&s<x&&(!p||(k.options.layer??"bottom")===p)&&(yield k)}forEachDecorationAtCell(s,l,p,C){this._decorations.forEachByKey(l,x=>{S=x.options.x??0,w=S+(x.options.width??1),s>=S&&s<w&&(!p||(x.options.layer??"bottom")===p)&&C(x)})}}a.DecorationService=v;class u extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.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:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=c(2585),g=c(8343);class d{constructor(...S){this._entries=new Map;for(const[w,v]of S)this.set(w,v)}set(S,w){const v=this._entries.get(S);return this._entries.set(S,w),v}forEach(S){for(const[w,v]of this._entries.entries())S(w,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(_,S){this._services.set(_,S)}getService(_){return this._services.get(_)}createInstance(_,...S){const w=(0,g.getServiceDependencies)(_).sort((o,s)=>o.index-s.index),v=[];for(const o of w){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=w.length>0?w[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new _(...S,...v)}}},7866:function(m,a,c){var f=this&&this.__decorate||function(u,o,s,l){var p,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(u,o,s,l);else for(var k=u.length-1;k>=0;k--)(p=u[k])&&(x=(C<3?p(x):C>3?p(o,s,x):p(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(u,o){return function(s,l){o(s,l,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=c(844),_=c(2585),S={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let w,v=a.LogService=class extends d.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())),w=this}_updateLogLevel(){this._logLevel=S[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)}};a.LogService=v=f([g(0,_.IOptionsService)],v),a.setTraceLogger=function(u){w=u},a.traceCall=function(u,o,s){if(typeof s.value!="function")throw new Error("not supported");const l=s.value;s.value=function(...p){if(w.logLevel!==_.LogLevelEnum.TRACE)return l.apply(this,p);w.trace(`GlyphRenderer#${l.name}(${p.map(x=>JSON.stringify(x)).join(", ")})`);const C=l.apply(this,p);return w.trace(`GlyphRenderer#${l.name} return`,C),C}}},7302:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=c(8460),g=c(844),d=c(6114);a.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:d.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 S extends g.Disposable{constructor(v){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...a.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,g.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 a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},u=(o,s)=>{if(!(o in a.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=a.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=a.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=_.includes(u)?u:a.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}}a.OptionsService=S},2660:function(m,a,c){var f=this&&this.__decorate||function(S,w,v,u){var o,s=arguments.length,l=s<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,w,v,u);else for(var p=S.length-1;p>=0;p--)(o=S[p])&&(l=(s<3?o(l):s>3?o(w,v,l):o(w,v))||l);return s>3&&l&&Object.defineProperty(w,v,l),l},g=this&&this.__param||function(S,w){return function(v,u){w(v,u,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=c(2585);let _=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const w=this._bufferService.buffer;if(S.id===void 0){const p=w.addMarker(w.ybase+w.y),C={data:S,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(C,p)),this._dataByLinkId.set(C.id,C),C.id}const v=S,u=this._getEntryIdKey(v),o=this._entriesWithId.get(u);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),l={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(l,s)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,w){const v=this._dataByLinkId.get(S);if(v&&v.lines.every(u=>u.line!==w)){const u=this._bufferService.buffer.addMarker(w);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(S){var w;return(w=this._dataByLinkId.get(S))==null?void 0:w.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,w){const v=S.lines.indexOf(w);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=_=f([g(0,d.IBufferService)],_)},8343:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(_,S,w){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[f].push({id:v,index:o}):(u[f]=[{id:v,index:o}],u[c]=u)})(d,_,w)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=c(8343);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(m,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=c(8460),g=c(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,v=!1){return(16777215&S)<<3|(3&w)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,v=0;const u=S.length;for(let o=0;o<u;++o){let s=S.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=u)return w+this.wcwidth(s);const C=S.charCodeAt(o);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:w+=this.wcwidth(C)}const l=this.charProperties(s,v);let p=d.extractWidth(l);d.extractShouldJoin(l)&&(p-=d.extractWidth(v)),w+=p,v=l}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}a.UnicodeService=d}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var c=i[m]={exports:{}};return r[m].call(c.exports,c,c.exports,n),c.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const a=n(9042),c=n(3236),f=n(844),g=n(5741),d=n(8285),_=n(7975),S=n(7090),w=["cols","rows"];class v extends f.Disposable{constructor(o){super(),this._core=this.register(new c.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const s=p=>this._core.options[p],l=(p,C)=>{this._checkReadonlyOptions(p),this._core.options[p]=C};for(const p in this._core.options){const C={get:s.bind(this,p),set:l.bind(this,p)};Object.defineProperty(this._publicOptions,p,C)}}_checkReadonlyOptions(o){if(w.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 S.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 d.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,l){this._verifyIntegers(o,s,l),this._core.select(o,s,l)}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
|
|
64
|
-
`,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 a}_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")}}m.Terminal=v})(),h})())})(Rh);var Gp=Rh.exports,Ph={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(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),_=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(_/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Ph);var nc=Ph.exports,Mh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(m,a)=>{function c(g){try{const d=new URL(g),_=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,_,S={}){this._terminal=g,this._regex=d,this._handler=_,this._options=S}provideLinks(g,d){const _=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(_))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(_,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(_,S,w)}},d))}};class f{static computeLink(d,_,S,w){const v=new RegExp(_.source,(_.flags||"")+"g"),[u,o]=f._getWindowedLineStrings(d-1,S),s=u.join("");let l;const p=[];for(;l=v.exec(s);){const C=l[0];if(!c(C))continue;const[x,k]=f._mapStrIdx(S,o,0,l.index),[y,b]=f._mapStrIdx(S,x,k,C.length);if(x===-1||k===-1||y===-1||b===-1)continue;const R={start:{x:k+1,y:x+1},end:{x:b,y:y+1}};p.push({range:R,text:C,activate:w})}return p}static _getWindowedLineStrings(d,_){let S,w=d,v=d,u=0,o="";const s=[];if(S=_.buffer.active.getLine(d)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(u=0;(S=_.buffer.active.getLine(--w))&&u<2048&&(o=S.translateToString(!0),u+=o.length,s.push(o),S.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(l),u=0;(S=_.buffer.active.getLine(++v))&&S.isWrapped&&u<2048&&(o=S.translateToString(!0),u+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,_,S,w){const v=d.buffer.active,u=v.getNullCell();let o=S;for(;w;){const s=v.getLine(_);if(!s)return[-1,-1];for(let l=o;l<s.length;++l){s.getCell(l,u);const p=u.getChars();if(u.getWidth()&&(w-=p.length||1,l===s.length-1&&p==="")){const C=v.getLine(_+1);C&&C.isWrapped&&(C.getCell(0,u),u.getWidth()===2&&(w+=1))}if(w<0)return[_,l]}_++,o=0}return[_,o]}}a.LinkComputer=f}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var c=i[m]={exports:{}};return r[m](c,c.exports,n),c.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.WebLinksAddon=void 0;const a=n(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}m.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,_=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,_,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(Mh);var Xp=Mh.exports;function oc(){const e=te.getState().theme;return zo(e)==="light"?$p:Up}const Wo=new Set,Uo=new Map,$o=new Map;function Qp(e,t){$o.set(e,t)}function Yp(e){const t=$o.get(e);return t!==void 0?($o.delete(e),t):null}function Jp({terminalId:e,projectId:t,cwd:r}){const i=Q.useRef(null),n=Q.useRef(null),h=Q.useRef(null),m=Q.useRef(null),a=me(_=>_.setTerminalInstance),c=me(_=>_.createSession),f=te(_=>_.setFocusedTerminal);Q.useEffect(()=>{const _=i.current;if(!_)return;_.innerHTML="";const S=me.getState().sessions[e],w=Uo.get(e);if(S!=null&&S.terminal&&w){const p=S.terminal;n.current=p,_.appendChild(w);const C=new nc.FitAddon;return p.loadAddon(C),h.current=C,requestAnimationFrame(()=>{try{C.fit(),p.scrollToBottom();const{cols:x,rows:k}=p;m.current={cols:x,rows:k},Te({type:"pty:resize",terminalId:e,cols:x,rows:k})}catch{}}),()=>{}}const v=oc(),u=zo(te.getState().theme)==="light",o=new Gp.Terminal({theme:v,fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4,minimumContrastRatio:u?7:1}),s=new nc.FitAddon,l=new Xp.WebLinksAddon;return o.loadAddon(s),o.loadAddon(l),o.open(_),n.current=o,h.current=s,o.element&&Uo.set(e,o.element),c(e,t),a(e,o),o.attachCustomKeyEventHandler(p=>{if(p.key==="Enter"&&p.shiftKey)return p.type==="keydown"&&Te({type:"pty:input",terminalId:e,data:`
|
|
65
|
-
`}),!1;if(p.metaKey&&!p.altKey&&!p.ctrlKey&&!p.shiftKey&&p.type==="keydown"){if(p.key==="ArrowLeft")return Te({type:"pty:input",terminalId:e,data:""}),!1;if(p.key==="ArrowRight")return Te({type:"pty:input",terminalId:e,data:""}),!1;if(p.key==="Backspace")return Te({type:"pty:input",terminalId:e,data:""}),!1}return!(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(p.key)&&p.shiftKey&&!p.metaKey&&!p.altKey)}),o.onData(p=>{Te({type:"pty:input",terminalId:e,data:p})}),o.onTitleChange(p=>{me.getState().setTitle(e,p)}),Wo.has(e)||(Wo.add(e),requestAnimationFrame(()=>{try{s.fit()}catch{}Te({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),Te({type:"pty:resize",terminalId:e,cols:o.cols,rows:o.rows}),m.current={cols:o.cols,rows:o.rows},o.focus(),f(e)})),()=>{}},[e,t,r,c,a]),Q.useEffect(()=>{const _=()=>{const o=n.current;if(o){const s=zo(te.getState().theme)==="light";o.options.theme=oc(),o.options.minimumContrastRatio=s?7:1}};let S=te.getState().theme;const w=te.subscribe(o=>{o.theme!==S&&(S=o.theme,_())}),v=window.matchMedia("(prefers-color-scheme: light)"),u=()=>{te.getState().theme==="system"&&_()};return v.addEventListener("change",u),()=>{w(),v.removeEventListener("change",u)}},[]);const g=Q.useCallback(()=>{const _=h.current,S=n.current;if(!(!_||!S))try{_.fit(),S.scrollToBottom();const{cols:w,rows:v}=S,u=m.current;(!u||u.cols!==w||u.rows!==v)&&(m.current={cols:w,rows:v},Te({type:"pty:resize",terminalId:e,cols:w,rows:v}))}catch{}},[e]),d=Q.useCallback(()=>{var _;(_=n.current)==null||_.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function fn(e){Wo.delete(e),Uo.delete(e)}let tt=null;function Zp(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function Te(e){(tt==null?void 0:tt.readyState)===WebSocket.OPEN&&tt.send(JSON.stringify(e))}function e_(){const e=te(h=>h.setConnectionStatus),t=he(h=>h.addProject),r=he(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((tt==null?void 0:tt.readyState)===WebSocket.OPEN||(tt==null?void 0:tt.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(Zp());tt=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,c,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=me.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const _=Yp(g.terminalId);_&&Te({type:"pty:input",terminalId:g.terminalId,data:_});return}if(g.type==="pty:exit"){const d=g.terminalId,_=me.getState().sessions[d],S=_==null?void 0:_.projectId;if((c=_==null?void 0:_.terminal)==null||c.dispose(),me.getState().removeSession(d),fn(d),S){se.getState().removePaneFromProject(S,d),he.getState().removeTerminalFromProject(S,d);const w=Ce(se.getState().getLayout(S)),v=te.getState().focusedTerminalId;if(v===d&&w.length>0){const u=w[0];te.getState().setFocusedTerminal(u);const o=me.getState().sessions[u];(f=o==null?void 0:o.terminal)==null||f.focus()}else v===d&&te.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(he.getState().projects).find(_=>_.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="port:status"){me.getState().setActivePorts(g.ports);return}if(g.type==="claude:status"){me.getState().setClaudeStatus(g.statuses);return}if(g.type==="editor:active"){if(!te.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:_}=he.getState(),S=Object.values(d).find(w=>{const v=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||v===g.projectName});S&&S.id!==_&&(te.getState().showSyncToast(S.name),r(S.id))}}catch{}},h.onclose=()=>{e("disconnected"),me.getState().setActivePorts({}),me.getState().setClaudeStatus({}),tt=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const t_=new Set(["n","w","t","d","r"]);function r_(){const e=te(r=>r.toggleSidebar),t=te(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var _,S,w;const n=i.key.toLowerCase();if(i.ctrlKey&&i.shiftKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=he.getState().activeProjectId;if(!v)return;const u=se.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=sc(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(l){t(l);const p=me.getState().sessions[l];(_=p==null?void 0:p.terminal)==null||_.focus()}return}if(i.shiftKey&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const v=he.getState().activeProjectId;if(!v)return;const u=se.getState().getLayout(v),o=te.getState().focusedTerminalId;if(!o||!u)return;const l=sc(u,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&se.getState().swapPanesInProject(v,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;if((n==="="||n==="+"||n==="-"||n==="0")&&!i.shiftKey&&!("chrome"in window)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent)){i.preventDefault(),i.stopPropagation();const u=parseFloat(document.documentElement.style.zoom||"1");n==="="||n==="+"?document.documentElement.style.zoom=String(Math.min(u+.1,2)):n==="-"?document.documentElement.style.zoom=String(Math.max(u-.1,.5)):document.documentElement.style.zoom="1",window.dispatchEvent(new Event("resize"));return}(t_.has(n)||n>="1"&&n<="9")&&(i.preventDefault(),i.stopPropagation());const a=he.getState().activeProjectId;if(!a)return;const c=se.getState().getLayout(a),f=te.getState().focusedTerminalId,g=he.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const v=crypto.randomUUID(),u=Ce(c);if(u.length>0){const o=f??u[u.length-1],s=i.shiftKey?"horizontal":"vertical";se.getState().addPaneToProject(a,o,v,s)}else se.getState().setLayout(a,{type:"leaf",terminalId:v});he.getState().addTerminalToProject(a,v),t(v);return}if(n==="w"&&!i.shiftKey){if(!f||!c)return;Te({type:"pty:kill",terminalId:f}),se.getState().removePaneFromProject(a,f),he.getState().removeTerminalFromProject(a,f);const v=me.getState().sessions[f];(S=v==null?void 0:v.terminal)==null||S.dispose(),me.getState().removeSession(f),fn(f);const u=Ce(se.getState().getLayout(a));t(u[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const v=Ce(c);v.length>0&&se.getState().cyclePreset(a,v);return}if(n==="r"&&!i.shiftKey){const v=Ce(c);if(v.length===0)return;let u;v.length<=2?u="even-vertical":v.length===3?u="main-left":u="grid";const o=Ii(v,u);o&&se.getState().setLayout(a,o);return}const d=parseInt(n);if(d>=1&&d<=9){const u=Ce(c)[d-1];if(u){t(u);const o=me.getState().sessions[u];(w=o==null?void 0:o.terminal)==null||w.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}const Lr=Wi()((e,t)=>({favourites:{},addFavourite:r=>{e(i=>({favourites:{...i.favourites,[r.id]:r}})),gi({favourites:{...t().favourites}})},updateFavourite:(r,i)=>{e(n=>{const h=n.favourites[r];return h?{favourites:{...n.favourites,[r]:{...h,...i}}}:n}),gi({favourites:{...t().favourites}})},removeFavourite:r=>{e(i=>{const{[r]:n,...h}=i.favourites;return{favourites:h}}),gi({favourites:{...t().favourites}})},hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();i.favourites&&e({favourites:i.favourites})}catch{}}}));/**
|
|
66
|
-
* @license lucide-react v0.400.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const i_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ah=(...e)=>e.filter((t,r,i)=>!!t&&i.indexOf(t)===r).join(" ");/**
|
|
71
|
-
* @license lucide-react v0.400.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/var s_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
76
|
-
* @license lucide-react v0.400.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const n_=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:n="",children:h,iconNode:m,...a},c)=>Q.createElement("svg",{ref:c,...s_,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Ah("lucide",n),...a},[...m.map(([f,g])=>Q.createElement(f,g)),...Array.isArray(h)?h:[h]]));/**
|
|
81
|
-
* @license lucide-react v0.400.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/const ae=(e,t)=>{const r=Q.forwardRef(({className:i,...n},h)=>Q.createElement(n_,{ref:h,iconNode:t,className:Ah(`lucide-${i_(e)}`,i),...n}));return r.displayName=`${e}`,r};/**
|
|
86
|
-
* @license lucide-react v0.400.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const o_=ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
91
|
-
* @license lucide-react v0.400.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const a_=ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
96
|
-
* @license lucide-react v0.400.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const l_=ae("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
101
|
-
* @license lucide-react v0.400.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const c_=ae("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
106
|
-
* @license lucide-react v0.400.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const Fa=ae("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
111
|
-
* @license lucide-react v0.400.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const u_=ae("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
116
|
-
* @license lucide-react v0.400.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Oh=ae("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
121
|
-
* @license lucide-react v0.400.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const h_=ae("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
126
|
-
* @license lucide-react v0.400.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const d_=ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
131
|
-
* @license lucide-react v0.400.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const f_=ae("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
136
|
-
* @license lucide-react v0.400.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const p_=ae("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
141
|
-
* @license lucide-react v0.400.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/const Bh=ae("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
|
|
146
|
-
* @license lucide-react v0.400.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const __=ae("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
151
|
-
* @license lucide-react v0.400.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const v_=ae("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
156
|
-
* @license lucide-react v0.400.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const g_=ae("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
161
|
-
* @license lucide-react v0.400.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const m_=ae("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
166
|
-
* @license lucide-react v0.400.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const Ih=ae("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
171
|
-
* @license lucide-react v0.400.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const jh=ae("PanelTop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);/**
|
|
176
|
-
* @license lucide-react v0.400.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const S_=ae("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
181
|
-
* @license lucide-react v0.400.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const y_=ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
186
|
-
* @license lucide-react v0.400.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const za=ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
191
|
-
* @license lucide-react v0.400.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const Wa=ae("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/**
|
|
196
|
-
* @license lucide-react v0.400.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const Nh=ae("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
201
|
-
* @license lucide-react v0.400.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const w_=ae("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
206
|
-
* @license lucide-react v0.400.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const Ua=ae("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
211
|
-
* @license lucide-react v0.400.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const $a=ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
216
|
-
* @license lucide-react v0.400.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const C_=ae("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
221
|
-
* @license lucide-react v0.400.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const Ui=ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ac(e){const t=se.getState().getLayout(e);Ce(t).forEach(i=>{var h;const n=me.getState().sessions[i];(h=n==null?void 0:n.terminal)==null||h.dispose(),me.getState().removeSession(i),fn(i)}),Te({type:"project:kill",projectId:e}),se.getState().setLayout(e,null),he.getState().clearProjectTerminals(e)}function x_({project:e,isActive:t,hasActivePorts:r,claudeStatus:i,onClick:n,onKill:h,onRemove:m}){const a=e.terminalIds.length;return M.jsxs("div",{onClick:n,className:`
|
|
226
|
-
group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
|
|
227
|
-
transition-colors duration-100
|
|
228
|
-
${t?"bg-accent/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]"}
|
|
229
|
-
`,children:[M.jsx(u_,{size:14,className:t?"text-accent":"text-[var(--text-muted)]"}),M.jsxs("div",{className:"flex-1 min-w-0",children:[M.jsxs("div",{className:"text-xs font-medium truncate flex items-center gap-1.5",children:[e.name,i&&M.jsx("span",{className:`shrink-0 text-[8px] font-bold leading-none px-1 py-0.5 rounded ${i==="active"?"bg-purple-500/20 text-purple-400 animate-pulse":"bg-purple-500/10 text-purple-400/50"}`,title:i==="active"?"Agent is working":"Agent session open",children:"AI"}),r&&M.jsx("span",{className:"shrink-0 w-1.5 h-1.5 rounded-full bg-[var(--success)]",title:"Dev server running"})]}),M.jsx("div",{className:"text-[10px] text-[var(--text-muted)] truncate font-mono",children:e.cwd})]}),a>0&&M.jsxs("span",{className:"text-[10px] tabular-nums px-1.5 py-0.5 rounded-full bg-[var(--surface-3)] text-[var(--text-muted)] flex items-center gap-0.5",children:[M.jsx(Ua,{size:8}),a]}),M.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[a>0&&M.jsx("button",{onClick:c=>{c.stopPropagation(),h()},title:"Kill all terminals",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:M.jsx(c_,{size:12})}),M.jsx("button",{onClick:c=>{c.stopPropagation(),m()},title:"Remove project",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:M.jsx($a,{size:12})})]})]})}function k_({open:e,onClose:t,onCreate:r,initialName:i,initialCwd:n}){const[h,m]=Q.useState(""),[a,c]=Q.useState("~"),[f,g]=Q.useState(null),[d,_]=Q.useState(!1),S=Q.useRef(null);Q.useEffect(()=>{e&&(m(i??""),c(n??"~"),g(null),setTimeout(()=>{var v;return(v=S.current)==null?void 0:v.focus()},50))},[e,i,n]);const w=Q.useCallback(async v=>{if(v.preventDefault(),!h.trim())return;const u=a.trim()||"~",s=Object.values(he.getState().projects).find(l=>l.cwd===u);if(s){g(`Project "${s.name}" already uses this directory`);return}_(!0),g(null);try{const l=await fetch("/api/validate-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:u})}),{valid:p}=await l.json();if(!p){g("Directory does not exist"),_(!1);return}}catch{g("Could not validate path"),_(!1);return}_(!1),r(h.trim(),u),t()},[h,a,r,t]);return e?M.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:M.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[400px] shadow-2xl animate-fade-in",onClick:v=>v.stopPropagation(),children:[M.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[M.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"New Project"}),M.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:M.jsx(Ui,{size:14})})]}),M.jsxs("form",{onSubmit:w,className:"p-4 space-y-4",children:[M.jsxs("div",{children:[M.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Project Name"}),M.jsx("input",{ref:S,value:h,onChange:v=>m(v.target.value),placeholder:"my-project",className:`
|
|
230
|
-
w-full px-3 py-2 text-sm
|
|
231
|
-
bg-[var(--surface-0)] border border-[var(--border)]
|
|
232
|
-
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
233
|
-
rounded-lg outline-none
|
|
234
|
-
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
235
|
-
transition-colors
|
|
236
|
-
`})]}),M.jsxs("div",{children:[M.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Working Directory"}),M.jsx("input",{value:a,onChange:v=>{c(v.target.value),g(null)},placeholder:"/path/to/project",className:`
|
|
237
|
-
w-full px-3 py-2 text-sm font-mono
|
|
238
|
-
bg-[var(--surface-0)] border
|
|
239
|
-
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
240
|
-
rounded-lg outline-none
|
|
241
|
-
transition-colors
|
|
242
|
-
${f?"border-[var(--danger)] focus:border-[var(--danger)] focus:ring-1 focus:ring-[var(--danger)]/30":"border-[var(--border)] focus:border-accent focus:ring-1 focus:ring-accent/30"}
|
|
243
|
-
`}),f&&M.jsx("p",{className:"mt-1.5 text-[11px] text-[var(--danger)]",children:f})]}),M.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[M.jsx("button",{type:"button",onClick:t,className:`
|
|
244
|
-
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
245
|
-
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
246
|
-
rounded-lg transition-colors
|
|
247
|
-
`,children:"Cancel"}),M.jsx("button",{type:"submit",disabled:!h.trim()||d,className:`
|
|
248
|
-
px-3 py-1.5 text-xs font-medium
|
|
249
|
-
bg-accent hover:bg-accent/80
|
|
250
|
-
disabled:opacity-40 disabled:cursor-not-allowed
|
|
251
|
-
text-white rounded-lg transition-colors
|
|
252
|
-
`,children:d?"Checking...":"Create"})]})]})]})}):null}const E_={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function b_({favourite:e,onLaunch:t,onEdit:r,onDelete:i}){const n=`${E_[e.preset]??e.preset}, ${e.slots.length} terminal${e.slots.length!==1?"s":""}`;return M.jsxs("div",{className:`
|
|
253
|
-
group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
|
|
254
|
-
text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]
|
|
255
|
-
transition-colors duration-100
|
|
256
|
-
`,onClick:t,children:[M.jsx(Nh,{size:14,className:"text-[var(--text-muted)] flex-shrink-0"}),M.jsxs("div",{className:"flex-1 min-w-0",children:[M.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),M.jsxs("div",{className:"text-[10px] text-[var(--text-muted)] truncate flex items-center gap-0.5",children:[M.jsx(Ua,{size:8}),n]})]}),M.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[M.jsx("button",{onClick:h=>{h.stopPropagation(),t()},title:"Launch",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--success)] hover:bg-green-500/10 transition-colors",children:M.jsx(y_,{size:12})}),M.jsx("button",{onClick:h=>{h.stopPropagation(),r()},title:"Edit",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:M.jsx(S_,{size:12})}),M.jsx("button",{onClick:h=>{h.stopPropagation(),i()},title:"Delete",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:M.jsx($a,{size:12})})]})]})}function L_({favourites:e,onLaunch:t,onEdit:r,onDelete:i}){const[n,h]=Q.useState(!1);return e.length===0?null:M.jsxs("div",{children:[M.jsxs("button",{onClick:()=>h(!n),className:`
|
|
257
|
-
flex items-center gap-1 w-full px-4 py-1.5
|
|
258
|
-
text-[10px] font-semibold uppercase tracking-wider
|
|
259
|
-
text-[var(--text-muted)] hover:text-[var(--text-secondary)]
|
|
260
|
-
transition-colors
|
|
261
|
-
`,children:[n?M.jsx(a_,{size:10}):M.jsx(o_,{size:10}),"Favourites"]}),!n&&M.jsx("div",{children:e.map(m=>M.jsx(b_,{favourite:m,onLaunch:()=>t(m),onEdit:()=>r(m),onDelete:()=>i(m.id)},m.id))})]})}const D_={"even-horizontal":M.jsx(Wa,{size:16}),"even-vertical":M.jsx(Fa,{size:16}),"main-left":M.jsx(Ih,{size:16}),"main-top":M.jsx(jh,{size:16}),grid:M.jsx(Oh,{size:16})},lc={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function Hh({open:e,onClose:t,onSave:r,editingFavourite:i,defaultPreset:n,defaultSlotCount:h}){const[m,a]=Q.useState(""),[c,f]=Q.useState("even-horizontal"),[g,d]=Q.useState([{label:"",command:""}]),_=Q.useRef(null);if(Q.useEffect(()=>{if(e){if(i)a(i.name),f(i.preset),d(i.slots.map(o=>({...o})));else{a(""),f(n??"even-horizontal");const o=h??1;d(Array.from({length:o},()=>({label:"",command:""})))}setTimeout(()=>{var o;return(o=_.current)==null?void 0:o.focus()},50)}},[e,i,n,h]),!e)return null;const S=o=>{o.preventDefault(),!(!m.trim()||g.length===0)&&(r(m.trim(),c,g),t())},w=()=>{d([...g,{label:"",command:""}])},v=o=>{g.length<=1||d(g.filter((s,l)=>l!==o))},u=(o,s,l)=>{d(g.map((p,C)=>C===o?{...p,[s]:l}:p))};return M.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:M.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in max-h-[80vh] flex flex-col",onClick:o=>o.stopPropagation(),children:[M.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[M.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:i?"Edit Favourite":"Save Favourite"}),M.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:M.jsx(Ui,{size:14})})]}),M.jsxs("form",{onSubmit:S,className:"p-4 space-y-4 overflow-y-auto",children:[M.jsxs("div",{children:[M.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Name"}),M.jsx("input",{ref:_,value:m,onChange:o=>a(o.target.value),placeholder:"My Workspace",className:`
|
|
262
|
-
w-full px-3 py-2 text-sm
|
|
263
|
-
bg-[var(--surface-0)] border border-[var(--border)]
|
|
264
|
-
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
265
|
-
rounded-lg outline-none
|
|
266
|
-
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
267
|
-
transition-colors
|
|
268
|
-
`})]}),M.jsxs("div",{children:[M.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Layout"}),M.jsx("div",{className:"flex gap-1",children:mi.map(o=>M.jsxs("button",{type:"button",onClick:()=>f(o),className:`
|
|
269
|
-
flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors
|
|
270
|
-
${c===o?"bg-accent/15 text-accent border border-accent/30":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] border border-transparent"}
|
|
271
|
-
`,title:lc[o],children:[D_[o],M.jsx("span",{className:"hidden sm:inline",children:lc[o]})]},o))})]}),M.jsxs("div",{children:[M.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[M.jsx("label",{className:"text-xs text-[var(--text-secondary)]",children:"Terminal Slots"}),M.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-0.5 text-[10px] text-accent hover:text-accent/80 transition-colors",children:[M.jsx(za,{size:10}),"Add"]})]}),M.jsx("div",{className:"space-y-2",children:g.map((o,s)=>M.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--surface-0)] border border-[var(--border)]",children:[M.jsxs("div",{className:"flex-1 space-y-1.5",children:[M.jsx("input",{value:o.label,onChange:l=>u(s,"label",l.target.value),placeholder:`Terminal ${s+1}`,className:`
|
|
272
|
-
w-full px-2 py-1 text-xs
|
|
273
|
-
bg-transparent border border-[var(--border)]
|
|
274
|
-
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
275
|
-
rounded outline-none
|
|
276
|
-
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
277
|
-
transition-colors
|
|
278
|
-
`}),M.jsx("input",{value:o.command,onChange:l=>u(s,"command",l.target.value),placeholder:"Command (optional)",className:`
|
|
279
|
-
w-full px-2 py-1 text-xs font-mono
|
|
280
|
-
bg-transparent border border-[var(--border)]
|
|
281
|
-
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
282
|
-
rounded outline-none
|
|
283
|
-
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
284
|
-
transition-colors
|
|
285
|
-
`})]}),g.length>1&&M.jsx("button",{type:"button",onClick:()=>v(s),className:"p-1 mt-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:M.jsx($a,{size:12})})]},s))})]}),M.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[M.jsx("button",{type:"button",onClick:t,className:`
|
|
286
|
-
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
287
|
-
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
288
|
-
rounded-lg transition-colors
|
|
289
|
-
`,children:"Cancel"}),M.jsx("button",{type:"submit",disabled:!m.trim()||g.length===0,className:`
|
|
290
|
-
px-3 py-1.5 text-xs font-medium
|
|
291
|
-
bg-accent hover:bg-accent/80
|
|
292
|
-
disabled:opacity-40 disabled:cursor-not-allowed
|
|
293
|
-
text-white rounded-lg transition-colors
|
|
294
|
-
`,children:i?"Update":"Save"})]})]})]})})}function R_({open:e,onClose:t,onConfirm:r,terminalCount:i,favouriteName:n}){return e?M.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:M.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[380px] shadow-2xl animate-fade-in",onClick:h=>h.stopPropagation(),children:[M.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[M.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Launch Favourite"}),M.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:M.jsx(Ui,{size:14})})]}),M.jsxs("div",{className:"p-4 space-y-4",children:[M.jsxs("div",{className:"flex items-start gap-3",children:[M.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/10",children:M.jsx(C_,{size:16,className:"text-yellow-500"})}),M.jsxs("div",{className:"text-sm text-[var(--text-secondary)]",children:["Launching ",M.jsx("span",{className:"font-medium text-[var(--text-primary)]",children:n})," will close ",i," existing terminal",i!==1?"s":"",". Continue?"]})]}),M.jsxs("div",{className:"flex justify-end gap-2",children:[M.jsx("button",{onClick:t,className:`
|
|
295
|
-
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
296
|
-
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
297
|
-
rounded-lg transition-colors
|
|
298
|
-
`,children:"Cancel"}),M.jsx("button",{onClick:()=>{r(),t()},className:`
|
|
299
|
-
px-3 py-1.5 text-xs font-medium
|
|
300
|
-
bg-accent hover:bg-accent/80
|
|
301
|
-
text-white rounded-lg transition-colors
|
|
302
|
-
`,children:"Launch"})]})]})]})}):null}function T_(){const[e,t]=Q.useState(!1),[r,i]=Q.useState(!1),[n,h]=Q.useState(!1),[m,a]=Q.useState(null),[c,f]=Q.useState(null),[g,d]=Q.useState(null),[_,S]=Q.useState(!1),[w,v]=Q.useState(null);Q.useEffect(()=>{fetch("/api/version").then(z=>z.json()).then(z=>{z.latest&&P_(z.latest,z.current)&&v({current:z.current,latest:z.latest})}).catch(()=>{})},[]);const u=he(z=>z.projects),o=he(z=>z.activeProjectId),s=he(z=>z.setActiveProject),l=he(z=>z.addProject),p=he(z=>z.removeProject),C=he(z=>z.addTerminalToProject),x=te(z=>z.sidebarOpen),k=te(z=>z.sidebarWidth),y=te(z=>z.setSidebarWidth),b=te(z=>z.toggleSidebar),R=te(z=>z.connectionStatus),A=Q.useRef(!1),B=te(z=>z.editorSyncEnabled),T=te(z=>z.toggleEditorSync),N=te(z=>z.theme),F=te(z=>z.cycleTheme),K=me(z=>z.activePorts),G=me(z=>z.claudeStatus),j=Lr(z=>z.favourites);Lr(z=>z.addFavourite);const E=Lr(z=>z.updateFavourite),D=Lr(z=>z.removeFavourite),P=(z,J)=>{const le=Object.values(u).find(Ze=>Ze.cwd===J);if(le){s(le.id);return}const ze=crypto.randomUUID();l({id:ze,name:z,cwd:J,terminalIds:[]}),Te({type:"project:create",projectId:ze,name:z,cwd:J}),s(ze)},O=z=>{ac(z)},W=z=>{O(z),Te({type:"project:remove",projectId:z}),se.getState().removeProjectLayout(z),p(z)},V=z=>{if(!o||!u[o])return;ac(o);const le=z.slots.map(()=>crypto.randomUUID());z.slots.forEach((Ze,Kr)=>{Ze.command.trim()&&Qp(le[Kr],Ze.command+`
|
|
303
|
-
`)});const ze=Ii(le,z.preset);se.getState().setLayout(o,ze),le.forEach(Ze=>{C(o,Ze)}),le.length>0&&te.getState().setFocusedTerminal(le[0])},Z=z=>{if(!o)return;const J=se.getState().getLayout(o);Ce(J).length>0?(f(z),h(!0)):V(z)},ee=z=>{a(z),i(!0)},I=(z,J,le)=>{m&&E(m.id,{name:z,preset:J,slots:le}),a(null)},L=Q.useCallback(z=>{z.dataTransfer.types.includes("Files")&&(z.preventDefault(),z.dataTransfer.dropEffect="copy",S(!0))},[]),U=Q.useCallback(z=>{z.currentTarget.contains(z.relatedTarget)||S(!1)},[]),H=Q.useCallback(z=>{z.preventDefault(),A.current=!0;const J=ze=>{y(ze.clientX)},le=()=>{A.current=!1,window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",le),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",J),window.addEventListener("mouseup",le)},[y]),X=Q.useCallback(z=>{if(S(!1),!z.dataTransfer.types.includes("Files")||z.dataTransfer.files.length===0)return;z.preventDefault(),z.stopPropagation();const J=z.dataTransfer.files[0];fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:J.name,size:J.size,lastModified:J.lastModified})}).then(le=>le.json()).then(le=>{if(!le.path||!le.isDirectory)return;const ze=le.path,Ze=ze.split("/").pop()||J.name;d({name:Ze,cwd:ze}),t(!0)}).catch(()=>{})},[]);if(!x)return null;const q=Object.values(u),re=Object.values(j),fe=(o?u[o]:null)?Ce(se.getState().getLayout(o)).length:0;return M.jsxs("div",{className:`relative flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full ${_?"ring-2 ring-inset ring-[var(--accent)]":""}`,style:{width:k},onDragOver:L,onDragLeave:U,onDrop:X,children:[M.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize z-10 hover:bg-[var(--accent)] active:bg-[var(--accent)] opacity-0 hover:opacity-40 active:opacity-60 transition-opacity",onMouseDown:H}),M.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[M.jsxs("div",{className:"flex items-center gap-2",children:[M.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),M.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${R==="connected"?"bg-[var(--success)]":R==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:R})]}),M.jsxs("div",{className:"flex items-center gap-1",children:[M.jsx("button",{onClick:F,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:`Theme: ${N}. Click to cycle.`,children:N==="light"?M.jsx(w_,{size:14}):N==="dark"?M.jsx(v_,{size:14}):M.jsx(__,{size:14})}),M.jsx("button",{onClick:T,className:`p-1 rounded transition-colors ${B?"text-[var(--accent)] hover:bg-[var(--surface-3)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]"}`,title:B?"Editor sync ON — auto-switches project based on your active editor. Click to disable.":"Editor sync OFF — click to enable. Requires: (1) Paneful (or Terminal, if running from CLI) in System Settings → Privacy & Security → Accessibility, (2) Editor window title includes folder name (default in VS Code/Cursor). Note: after updating paneful, you may need to remove and re-add it in Accessibility settings.",children:M.jsx(Bh,{size:14})}),M.jsx("button",{onClick:b,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:M.jsx(g_,{size:14})})]})]}),M.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:q.length===0&&re.length===0?M.jsx("div",{className:"px-4 py-8 text-center",children:M.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):M.jsxs(M.Fragment,{children:[q.map(z=>{var J;return M.jsx(x_,{project:z,isActive:z.id===o,hasActivePorts:(((J=K[z.id])==null?void 0:J.length)??0)>0,claudeStatus:G[z.id]??null,onClick:()=>s(z.id),onKill:()=>O(z.id),onRemove:()=>W(z.id)},z.id)}),M.jsx(L_,{favourites:re,onLaunch:Z,onEdit:ee,onDelete:D})]})}),M.jsxs("div",{className:"mx-3 mb-2 px-3 py-2.5 rounded-lg bg-[var(--surface-2)] text-[10px] text-[var(--text-muted)] leading-relaxed flex flex-col items-center gap-1.5 text-center",children:[M.jsx(p_,{size:12,className:"text-yellow-500"}),"Drag a folder into this sidebar to create a project"]}),M.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:M.jsxs("button",{onClick:()=>t(!0),className:`
|
|
304
|
-
w-full flex items-center justify-center gap-1.5
|
|
305
|
-
px-3 py-2 text-xs
|
|
306
|
-
text-[var(--text-secondary)] hover:text-[var(--text-primary)]
|
|
307
|
-
bg-[var(--surface-2)] hover:bg-[var(--surface-3)]
|
|
308
|
-
rounded-lg transition-colors
|
|
309
|
-
`,children:[M.jsx(za,{size:14}),"New Project"]})}),w&&M.jsxs("div",{className:"px-4 py-3 border-t border-[var(--border)]",children:[M.jsxs("a",{href:"https://www.npmjs.com/package/paneful",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs text-[var(--accent)] hover:underline",children:[M.jsx(l_,{size:14}),M.jsxs("span",{children:["v",w.latest," available (current: v",w.current,")"]})]}),M.jsx("p",{className:"text-[10px] text-[var(--text-muted)] mt-1",children:"paneful update"})]}),M.jsx(k_,{open:e,onClose:()=>{t(!1),d(null)},onCreate:P,initialName:g==null?void 0:g.name,initialCwd:g==null?void 0:g.cwd}),M.jsx(Hh,{open:r,onClose:()=>{i(!1),a(null)},onSave:I,editingFavourite:m}),M.jsx(R_,{open:n,onClose:()=>{h(!1),f(null)},onConfirm:()=>{c&&V(c)},terminalCount:fe,favouriteName:(c==null?void 0:c.name)??""})]})}function P_(e,t){const r=e.split(".").map(Number),i=t.split(".").map(Number);for(let n=0;n<3;n++){if((r[n]||0)>(i[n]||0))return!0;if((r[n]||0)<(i[n]||0))return!1}return!1}const M_="border border-[var(--border)] rounded-md px-1.5 py-0.5 bg-[var(--surface-0)] text-[11px] font-mono min-w-[24px] text-center inline-flex items-center justify-center shadow-[0_1px_0_var(--border)]",A_=[{keys:["⌘","N"],action:"New pane (vertical)"},{keys:["⌘","⇧","N"],action:"New pane (horizontal)"},{keys:["⌘","W"],action:"Close pane"},{keys:["⌘","D"],action:"Toggle sidebar"},{keys:["⌘","T"],action:"Cycle layout"},{keys:["⌘","R"],action:"Auto reorganize"},{keys:["⌘","1-9"],action:"Focus pane by number"},{keys:["⌘","←→↑↓"],action:"Move focus"},{keys:["⌘","⇧","←→↑↓"],action:"Swap panes"},{keys:["⌥","←→↑↓"],action:"Swap panes"},{keys:["Shift","Enter"],action:"Insert new line"}];function O_({open:e,onClose:t}){return e?M.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:M.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in",onClick:r=>r.stopPropagation(),children:[M.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[M.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Keyboard Shortcuts"}),M.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:M.jsx(Ui,{size:14})})]}),M.jsx("div",{className:"p-4 space-y-2",children:A_.map((r,i)=>M.jsxs("div",{className:"flex items-center justify-between py-1",children:[M.jsx("div",{className:"flex items-center gap-1",children:r.keys.map((n,h)=>M.jsx("kbd",{className:M_,children:n},h))}),M.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:r.action})]},i))})]})}):null}const B_={"even-horizontal":M.jsx(Wa,{size:14}),"even-vertical":M.jsx(Fa,{size:14}),"main-left":M.jsx(Ih,{size:14}),"main-top":M.jsx(jh,{size:14}),grid:M.jsx(Oh,{size:14})},I_={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function j_({onNewPane:e}){const[t,r]=Q.useState(!1),[i,n]=Q.useState(!1),h=te(u=>u.sidebarOpen),m=te(u=>u.toggleSidebar),a=he(u=>u.activeProjectId),c=se(u=>u.currentPresetIndex),f=se(u=>u.cyclePreset),g=Lr(u=>u.addFavourite),d=()=>{if(!a)return;const u=se.getState().getLayout(a),o=Ce(u);o.length>0&&f(a,o)},_=()=>{if(!a)return;const u=se.getState().getLayout(a),o=Ce(u);if(o.length===0)return;let s;o.length<=2?s="even-vertical":o.length===3?s="main-left":s="grid";const l=Ii(o,s);l&&se.getState().setLayout(a,l)},S=(u,o,s)=>{g({id:crypto.randomUUID(),name:u,preset:o,slots:s})},w=mi[c],v=a?Ce(se.getState().getLayout(a)).length:0;return M.jsxs("div",{className:"h-9 flex-shrink-0 flex items-center px-2 gap-1 bg-[var(--surface-1)] border-b border-[var(--border)]",children:[!h&&M.jsx("button",{onClick:m,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Show sidebar (Cmd+D)",children:M.jsx(m_,{size:14})}),M.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),M.jsx("button",{onClick:()=>e("vertical"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split vertical (Cmd+N)",children:M.jsx(Fa,{size:14})}),M.jsx("button",{onClick:()=>e("horizontal"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split horizontal (Cmd+Shift+N)",children:M.jsx(Wa,{size:14})}),M.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),M.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 px-2 py-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors text-xs",title:"Cycle layout (Cmd+T)",children:[B_[w],M.jsx("span",{className:"hidden sm:inline",children:I_[w]})]}),M.jsx("button",{onClick:_,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Auto reorganize (Cmd+R)",children:M.jsx(f_,{size:14})}),M.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),M.jsx("button",{onClick:()=>r(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-yellow-400 hover:bg-[var(--surface-3)] transition-colors",title:"Save as favourite",children:M.jsx(Nh,{size:14})}),M.jsx("div",{className:"flex-1"}),M.jsx("button",{onClick:()=>n(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Keyboard shortcuts",children:M.jsx(d_,{size:14})}),M.jsx(Hh,{open:t,onClose:()=>r(!1),onSave:S,defaultPreset:w,defaultSlotCount:Math.max(v,1)}),M.jsx(O_,{open:i,onClose:()=>n(!1)})]})}function N_(e,t){const r=Q.useRef();Q.useEffect(()=>{const i=e.current;if(!i)return;const n=new ResizeObserver(()=>{clearTimeout(r.current),r.current=setTimeout(t,Wp)});return n.observe(i),()=>{n.disconnect(),clearTimeout(r.current)}},[e,t])}function H_(e,t){const r=te(_=>_.setDragging),i=te(_=>_.setDropTarget),n=te(_=>_.draggingTerminalId),h=se(_=>_.movePaneInProject),m=se(_=>_.swapPanesInProject),a=Q.useCallback(_=>{_.dataTransfer.setData("text/plain",e),_.dataTransfer.effectAllowed="move",r(e)},[e,r]),c=Q.useCallback(()=>{r(null),i(null)},[r,i]),f=Q.useCallback(_=>{if(_.preventDefault(),_.dataTransfer.dropEffect="move",!n||n===e){i(null);return}const S=_.currentTarget.getBoundingClientRect(),w=(_.clientX-S.left)/S.width,v=(_.clientY-S.top)/S.height;let u="center";const o=.2;w<o?u="left":w>1-o?u="right":v<o?u="top":v>1-o&&(u="bottom"),i({terminalId:e,edge:u})},[e,n,i]),g=Q.useCallback(()=>{i(null)},[i]),d=Q.useCallback(_=>{_.preventDefault();const S=_.dataTransfer.getData("text/plain");if(!S||S===e)return;const w=te.getState().dropTarget;w&&(w.edge==="center"?m(t,S,e):h(t,S,e,w.edge),r(null),i(null))},[e,t,h,m,r,i]);return{onDragStart:a,onDragEnd:c,onDragOver:f,onDragLeave:g,onDrop:d}}function F_({terminalId:e,projectId:t,isFocused:r,onClose:i,dragProps:n}){const h=me(d=>d.sessions[e]),m=(h==null?void 0:h.title)??"Terminal",a=(h==null?void 0:h.alive)??!0,c=se(d=>d.getLayout(t)),g=Ce(c).indexOf(e)+1;return M.jsxs("div",{draggable:!0,onDragStart:n.onDragStart,onDragEnd:n.onDragEnd,className:`
|
|
310
|
-
flex items-center h-7 px-2 gap-1.5 flex-shrink-0
|
|
311
|
-
border-b transition-colors duration-100
|
|
312
|
-
select-none cursor-grab active:cursor-grabbing
|
|
313
|
-
${r?"bg-[var(--surface-3)] border-[var(--accent)]":"bg-[var(--surface-2)] border-[var(--border)]"}
|
|
314
|
-
`,children:[M.jsx("div",{className:"text-[var(--text-muted)]",children:M.jsx(h_,{size:12})}),M.jsx("span",{className:"text-[10px] font-medium text-[var(--text-muted)] tabular-nums",children:g}),M.jsx("span",{className:"text-xs text-[var(--text-secondary)] truncate flex-1",children:m}),!a&&M.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--danger)]"}),M.jsx("button",{onClick:d=>{d.stopPropagation(),i()},onMouseDown:d=>d.stopPropagation(),draggable:!1,className:`
|
|
315
|
-
p-0.5 rounded text-[var(--text-muted)]
|
|
316
|
-
hover:text-[var(--danger)] hover:bg-[var(--danger-dim)]
|
|
317
|
-
transition-colors
|
|
318
|
-
`,children:M.jsx(Ui,{size:12})})]})}function z_({terminalId:e}){const t=te(h=>h.dropTarget);if(!t||t.terminalId!==e)return null;const r=t.edge,i=r==="center",n={left:"left-0 top-0 bottom-0 w-1/2",right:"right-0 top-0 bottom-0 w-1/2",top:"left-0 right-0 top-0 h-1/2",bottom:"left-0 right-0 bottom-0 h-1/2",center:"inset-0"};return M.jsx("div",{className:`
|
|
319
|
-
absolute ${n[r]??"inset-0"}
|
|
320
|
-
pointer-events-none z-20
|
|
321
|
-
${i?"bg-accent/15 border-2 border-accent/40":"bg-accent/20 border-2 border-accent/50"}
|
|
322
|
-
rounded-sm transition-all duration-100
|
|
323
|
-
`})}function W_({terminalId:e,projectId:t,cwd:r}){const i=te(w=>w.focusedTerminalId),n=te(w=>w.draggingTerminalId),h=i===e,m=n===e,{containerRef:a,fit:c,focus:f}=Jp({terminalId:e,projectId:t,cwd:r}),g=H_(e,t);N_(a,c);const d=Q.useCallback(()=>{var u;Te({type:"pty:kill",terminalId:e}),se.getState().removePaneFromProject(t,e),he.getState().removeTerminalFromProject(t,e);const w=me.getState().sessions[e];(u=w==null?void 0:w.terminal)==null||u.dispose(),me.getState().removeSession(e),fn(e);const v=Ce(se.getState().getLayout(t));te.getState().setFocusedTerminal(v[0]??null)},[e,t]),_=Q.useCallback(w=>{if(!(te.getState().draggingTerminalId!=null)&&(w.dataTransfer.types.includes("codefiles")||w.dataTransfer.types.includes("text/plain"))){const u=w.dataTransfer.getData("codefiles");let o=[];if(u)try{o=JSON.parse(u)}catch{}if(o.length===0){const s=w.dataTransfer.getData("text/plain").trim();s&&s.startsWith("/")&&(o=s.split(`
|
|
324
|
-
`).map(l=>l.trim()).filter(Boolean))}if(o.length>0&&!w.dataTransfer.types.includes("Files")){w.preventDefault(),w.stopPropagation();const s=o.map(l=>/[ ()'"]/.test(l)?`'${l.replace(/'/g,"'\\''")}'`:l);Te({type:"pty:input",terminalId:e,data:s.join(" ")}),f();return}}if(w.dataTransfer.types.includes("Files")&&w.dataTransfer.files.length>0){w.preventDefault(),w.stopPropagation();const u=Array.from(w.dataTransfer.files);Promise.all(u.map(o=>fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:o.name,size:o.size,lastModified:o.lastModified})}).then(s=>s.json()).then(s=>s.path).catch(()=>null))).then(o=>{const s=o.filter(Boolean);if(s.length>0){const l=s.map(p=>/[ ()'"]/.test(p)?`'${p.replace(/'/g,"'\\''")}'`:p);Te({type:"pty:input",terminalId:e,data:l.join(" ")}),f()}});return}g.onDrop(w)},[e,g,f]),S=Q.useCallback(w=>{if(te.getState().draggingTerminalId!=null){g.onDragOver(w);return}if(w.dataTransfer.types.includes("Files")||w.dataTransfer.types.includes("codefiles")||w.dataTransfer.types.includes("text/plain")){w.preventDefault(),w.dataTransfer.dropEffect="copy";return}g.onDragOver(w)},[g]);return M.jsxs("div",{style:{borderColor:h?"var(--accent)":"transparent"},className:`
|
|
325
|
-
flex flex-col h-full w-full relative border
|
|
326
|
-
${m?"opacity-40":""}
|
|
327
|
-
transition-colors duration-100
|
|
328
|
-
`,onClick:f,onDragOver:S,onDragLeave:g.onDragLeave,onDrop:_,children:[M.jsx(F_,{terminalId:e,projectId:t,isFocused:h,onClose:d,dragProps:{onDragStart:g.onDragStart,onDragEnd:g.onDragEnd}}),M.jsx("div",{ref:a,className:"flex-1 min-h-0 min-w-0 overflow-hidden"}),M.jsx(z_,{terminalId:e})]})}function U_({projectId:e,path:t,direction:r}){const i=se(m=>m.resizePaneInProject),n=Q.useRef(null);return{onMouseDown:Q.useCallback(m=>{var _;m.preventDefault(),m.stopPropagation();const a=(_=n.current)==null?void 0:_.parentElement;if(!a)return;const c=a.getBoundingClientRect();r==="vertical"?m.clientX:m.clientY;const f=r==="vertical"?c.width:c.height,g=S=>{const w=r==="vertical"?S.clientX:S.clientY,v=r==="vertical"?c.left:c.top,u=(w-v)/f;i(e,t,u)},d=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",g),document.addEventListener("mouseup",d),document.body.style.cursor=r==="vertical"?"col-resize":"row-resize",document.body.style.userSelect="none"},[e,t,r,i]),containerRef:n}}function $_({projectId:e,path:t,direction:r}){const{onMouseDown:i,containerRef:n}=U_({projectId:e,path:t,direction:r}),h=r==="vertical";return M.jsxs("div",{ref:n,className:`
|
|
329
|
-
relative z-10 flex-shrink-0
|
|
330
|
-
${h?"w-[4px] cursor-col-resize":"h-[4px] cursor-row-resize"}
|
|
331
|
-
group
|
|
332
|
-
`,onMouseDown:i,children:[M.jsx("div",{className:`
|
|
333
|
-
absolute
|
|
334
|
-
${h?"inset-y-0 -left-[2px] w-[8px]":"inset-x-0 -top-[2px] h-[8px]"}
|
|
335
|
-
transition-colors duration-150
|
|
336
|
-
hover:bg-accent/40
|
|
337
|
-
group-active:bg-accent/60
|
|
338
|
-
`}),M.jsx("div",{className:`
|
|
339
|
-
${h?"w-full h-full":"h-full w-full"}
|
|
340
|
-
bg-[var(--border)]
|
|
341
|
-
transition-colors duration-150
|
|
342
|
-
group-hover:bg-accent/60
|
|
343
|
-
group-active:bg-accent
|
|
344
|
-
`})]})}function Ko({node:e,projectId:t,cwd:r,path:i=[]}){if(e.type==="leaf")return M.jsx(W_,{terminalId:e.terminalId,projectId:t,cwd:r});const n=e.direction==="vertical",h=`${e.ratio*100}%`,m=`${(1-e.ratio)*100}%`;return M.jsxs("div",{className:`flex ${n?"flex-row":"flex-col"} h-full w-full`,children:[M.jsx("div",{style:{flexBasis:h,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:M.jsx(Ko,{node:e.first,projectId:t,cwd:r,path:[...i,0]})}),M.jsx($_,{projectId:t,path:i,direction:e.direction}),M.jsx("div",{style:{flexBasis:m,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:M.jsx(Ko,{node:e.second,projectId:t,cwd:r,path:[...i,1]})})]})}function K_(){const[e,t]=Q.useState(null);return Q.useEffect(()=>{let r=!1;return Math.random()<.5?fetch("https://dummyjson.com/quotes/random").then(n=>n.json()).then(n=>{!r&&(n!=null&&n.quote)&&t({text:n.quote,attribution:n.author})}).catch(()=>{}):fetch("https://uselessfacts.jsph.pl/api/v2/facts/random?language=en").then(n=>n.json()).then(n=>{!r&&(n!=null&&n.text)&&t({text:n.text})}).catch(()=>{}),()=>{r=!0}},[]),e}function V_({onNewTerminal:e,projectName:t}){const r=K_();return M.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--surface-0)]",children:M.jsxs("div",{className:"flex flex-col items-center gap-6 text-center max-w-lg px-8",children:[M.jsx("div",{className:"w-16 h-16 rounded-2xl bg-[var(--surface-2)] border border-[var(--border)] flex items-center justify-center",children:M.jsx(Ua,{size:28,className:"text-[var(--text-muted)]"})}),M.jsxs("div",{children:[M.jsx("h2",{className:"text-lg font-medium text-[var(--text-primary)] mb-1",children:t??"No project selected"}),M.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t?"This project has no active terminals.":"Create a project to get started."})]}),t&&M.jsxs("button",{onClick:e,className:`
|
|
345
|
-
flex items-center gap-2 px-4 py-2
|
|
346
|
-
bg-accent hover:bg-accent/80
|
|
347
|
-
text-white text-sm font-medium
|
|
348
|
-
rounded-lg transition-colors
|
|
349
|
-
`,children:[M.jsx(za,{size:16}),"New Terminal"]}),r&&M.jsxs("div",{className:"mt-4 max-w-sm",children:[M.jsxs("p",{className:"text-sm italic text-[var(--text-muted)] leading-relaxed",children:['"',r.text,'"']}),r.attribution&&M.jsxs("p",{className:"text-xs text-[var(--text-muted)]/60 mt-2",children:["— ",r.attribution]})]})]})})}function q_(){const e=te(n=>n.syncToast),t=te(n=>n.dismissSyncToast),[r,i]=Q.useState(!1);return Q.useEffect(()=>{if(!e){i(!1);return}requestAnimationFrame(()=>i(!0));const n=setTimeout(()=>{i(!1),setTimeout(t,200)},3e3);return()=>clearTimeout(n)},[e==null?void 0:e.id]),e?M.jsxs("div",{onClick:()=>{i(!1),setTimeout(t,200)},style:{position:"absolute",top:16,left:"50%",zIndex:9999,display:"flex",alignItems:"center",gap:8,padding:"8px 14px",borderRadius:8,background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border)",fontSize:13,cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",opacity:r?1:0,transform:r?"translate(-50%, 0)":"translate(-50%, -8px)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:r?"auto":"none"},children:[M.jsx(Bh,{size:15,style:{color:"var(--accent)",flexShrink:0}}),M.jsxs("span",{children:["Synced to ",M.jsx("strong",{children:e.projectName})]})]}):null}function G_(){e_(),r_(),Q.useEffect(()=>{he.getState().hydrateFromServer(),Lr.getState().hydrateFromServer(),te.getState().hydrateFromServer()},[]);const e=he(c=>c.activeProjectId),t=he(c=>c.activeProjectId?c.projects[c.activeProjectId]:null),r=se(c=>e?c.getLayout(e):null),i=te(c=>c.focusedTerminalId),n=te(c=>c.setFocusedTerminal),h=he(c=>c.addTerminalToProject),m=Q.useCallback(c=>{if(!e||!t)return;const f=crypto.randomUUID(),g=Ce(r),d=i??g[0];d?se.getState().addPaneToProject(e,d,f,c):se.getState().setLayout(e,{type:"leaf",terminalId:f}),h(e,f),n(f)},[e,t,r,i,h,n]),a=Q.useCallback(()=>{m("vertical")},[m]);return M.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-[var(--surface-0)]",children:[M.jsx(T_,{}),M.jsxs("div",{className:"relative flex-1 flex flex-col min-w-0",children:[M.jsx(q_,{}),M.jsx(j_,{onNewPane:m}),M.jsx("div",{className:"flex-1 min-h-0 min-w-0",children:r?M.jsx(Ko,{node:r,projectId:e,cwd:(t==null?void 0:t.cwd)??"/"},e):M.jsx(V_,{onNewTerminal:a,projectName:t==null?void 0:t.name})})]})]})}Wn.createRoot(document.getElementById("root")).render(M.jsx(yc.StrictMode,{children:M.jsx(G_,{})}));
|