deckide 3.5.33 → 3.5.35

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.
@@ -0,0 +1,178 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))g(_);new MutationObserver(_=>{for(const k of _)if(k.type==="childList")for(const R of k.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&g(R)}).observe(document,{childList:!0,subtree:!0});function n(_){const k={};return _.integrity&&(k.integrity=_.integrity),_.referrerPolicy&&(k.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?k.credentials="include":_.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function g(_){if(_.ep)return;_.ep=!0;const k=n(_);fetch(_.href,k)}})();function Af(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Zl={exports:{}},pn={},ec={exports:{}},He={};/**
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 yd;function yv(){if(yd)return He;yd=1;var r=Symbol.for("react.element"),i=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),R=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),f=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=f&&A[f]||A["@@iterator"],typeof A=="function"?A:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,w={};function c(A,H,Q){this.props=A,this.context=H,this.refs=w,this.updater=Q||b}c.prototype.isReactComponent={},c.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,H,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function u(){}u.prototype=c.prototype;function l(A,H,Q){this.props=A,this.context=H,this.refs=w,this.updater=Q||b}var h=l.prototype=new u;h.constructor=l,M(h,c.prototype),h.isPureReactComponent=!0;var v=Array.isArray,C=Object.prototype.hasOwnProperty,L={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function E(A,H,Q){var ne,oe={},ue=null,Y=null;if(H!=null)for(ne in H.ref!==void 0&&(Y=H.ref),H.key!==void 0&&(ue=""+H.key),H)C.call(H,ne)&&!T.hasOwnProperty(ne)&&(oe[ne]=H[ne]);var j=arguments.length-2;if(j===1)oe.children=Q;else if(1<j){for(var se=Array(j),re=0;re<j;re++)se[re]=arguments[re+2];oe.children=se}if(A&&A.defaultProps)for(ne in j=A.defaultProps,j)oe[ne]===void 0&&(oe[ne]=j[ne]);return{$$typeof:r,type:A,key:ue,ref:Y,props:oe,_owner:L.current}}function N(A,H){return{$$typeof:r,type:A.type,key:H,ref:A.ref,props:A.props,_owner:A._owner}}function W(A){return typeof A=="object"&&A!==null&&A.$$typeof===r}function K(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Q){return H[Q]})}var I=/\/+/g;function B(A,H){return typeof A=="object"&&A!==null&&A.key!=null?K(""+A.key):H.toString(36)}function U(A,H,Q,ne,oe){var ue=typeof A;(ue==="undefined"||ue==="boolean")&&(A=null);var Y=!1;if(A===null)Y=!0;else switch(ue){case"string":case"number":Y=!0;break;case"object":switch(A.$$typeof){case r:case i:Y=!0}}if(Y)return Y=A,oe=oe(Y),A=ne===""?"."+B(Y,0):ne,v(oe)?(Q="",A!=null&&(Q=A.replace(I,"$&/")+"/"),U(oe,H,Q,"",function(re){return re})):oe!=null&&(W(oe)&&(oe=N(oe,Q+(!oe.key||Y&&Y.key===oe.key?"":(""+oe.key).replace(I,"$&/")+"/")+A)),H.push(oe)),1;if(Y=0,ne=ne===""?".":ne+":",v(A))for(var j=0;j<A.length;j++){ue=A[j];var se=ne+B(ue,j);Y+=U(ue,H,Q,se,oe)}else if(se=S(A),typeof se=="function")for(A=se.call(A),j=0;!(ue=A.next()).done;)ue=ue.value,se=ne+B(ue,j++),Y+=U(ue,H,Q,se,oe);else if(ue==="object")throw H=String(A),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return Y}function $(A,H,Q){if(A==null)return A;var ne=[],oe=0;return U(A,ne,"","",function(ue){return H.call(Q,ue,oe++)}),ne}function V(A){if(A._status===-1){var H=A._result;H=H(),H.then(function(Q){(A._status===0||A._status===-1)&&(A._status=1,A._result=Q)},function(Q){(A._status===0||A._status===-1)&&(A._status=2,A._result=Q)}),A._status===-1&&(A._status=0,A._result=H)}if(A._status===1)return A._result.default;throw A._result}var X={current:null},z={transition:null},D={ReactCurrentDispatcher:X,ReactCurrentBatchConfig:z,ReactCurrentOwner:L};function O(){throw Error("act(...) is not supported in production builds of React.")}return He.Children={map:$,forEach:function(A,H,Q){$(A,function(){H.apply(this,arguments)},Q)},count:function(A){var H=0;return $(A,function(){H++}),H},toArray:function(A){return $(A,function(H){return H})||[]},only:function(A){if(!W(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},He.Component=c,He.Fragment=n,He.Profiler=_,He.PureComponent=l,He.StrictMode=g,He.Suspense=d,He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,He.act=O,He.cloneElement=function(A,H,Q){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var ne=M({},A.props),oe=A.key,ue=A.ref,Y=A._owner;if(H!=null){if(H.ref!==void 0&&(ue=H.ref,Y=L.current),H.key!==void 0&&(oe=""+H.key),A.type&&A.type.defaultProps)var j=A.type.defaultProps;for(se in H)C.call(H,se)&&!T.hasOwnProperty(se)&&(ne[se]=H[se]===void 0&&j!==void 0?j[se]:H[se])}var se=arguments.length-2;if(se===1)ne.children=Q;else if(1<se){j=Array(se);for(var re=0;re<se;re++)j[re]=arguments[re+2];ne.children=j}return{$$typeof:r,type:A.type,key:oe,ref:ue,props:ne,_owner:Y}},He.createContext=function(A){return A={$$typeof:R,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:k,_context:A},A.Consumer=A},He.createElement=E,He.createFactory=function(A){var H=E.bind(null,A);return H.type=A,H},He.createRef=function(){return{current:null}},He.forwardRef=function(A){return{$$typeof:a,render:A}},He.isValidElement=W,He.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:V}},He.memo=function(A,H){return{$$typeof:p,type:A,compare:H===void 0?null:H}},He.startTransition=function(A){var H=z.transition;z.transition={};try{A()}finally{z.transition=H}},He.unstable_act=O,He.useCallback=function(A,H){return X.current.useCallback(A,H)},He.useContext=function(A){return X.current.useContext(A)},He.useDebugValue=function(){},He.useDeferredValue=function(A){return X.current.useDeferredValue(A)},He.useEffect=function(A,H){return X.current.useEffect(A,H)},He.useId=function(){return X.current.useId()},He.useImperativeHandle=function(A,H,Q){return X.current.useImperativeHandle(A,H,Q)},He.useInsertionEffect=function(A,H){return X.current.useInsertionEffect(A,H)},He.useLayoutEffect=function(A,H){return X.current.useLayoutEffect(A,H)},He.useMemo=function(A,H){return X.current.useMemo(A,H)},He.useReducer=function(A,H,Q){return X.current.useReducer(A,H,Q)},He.useRef=function(A){return X.current.useRef(A)},He.useState=function(A){return X.current.useState(A)},He.useSyncExternalStore=function(A,H,Q){return X.current.useSyncExternalStore(A,H,Q)},He.useTransition=function(){return X.current.useTransition()},He.version="18.3.1",He}var wd;function Kc(){return wd||(wd=1,ec.exports=yv()),ec.exports}/**
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 Sd;function wv(){if(Sd)return pn;Sd=1;var r=Kc(),i=Symbol.for("react.element"),n=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,_=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,k={key:!0,ref:!0,__self:!0,__source:!0};function R(a,d,p){var y,f={},S=null,b=null;p!==void 0&&(S=""+p),d.key!==void 0&&(S=""+d.key),d.ref!==void 0&&(b=d.ref);for(y in d)g.call(d,y)&&!k.hasOwnProperty(y)&&(f[y]=d[y]);if(a&&a.defaultProps)for(y in d=a.defaultProps,d)f[y]===void 0&&(f[y]=d[y]);return{$$typeof:i,type:a,key:S,ref:b,props:f,_owner:_.current}}return pn.Fragment=n,pn.jsx=R,pn.jsxs=R,pn}var Cd;function Sv(){return Cd||(Cd=1,Zl.exports=wv()),Zl.exports}var P=Sv(),q=Kc();const qi=Af(q);var zo={},tc={exports:{}},ir={},rc={exports:{}},ic={};/**
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
+ */var xd;function Cv(){return xd||(xd=1,(function(r){function i(z,D){var O=z.length;z.push(D);e:for(;0<O;){var A=O-1>>>1,H=z[A];if(0<_(H,D))z[A]=D,z[O]=H,O=A;else break e}}function n(z){return z.length===0?null:z[0]}function g(z){if(z.length===0)return null;var D=z[0],O=z.pop();if(O!==D){z[0]=O;e:for(var A=0,H=z.length,Q=H>>>1;A<Q;){var ne=2*(A+1)-1,oe=z[ne],ue=ne+1,Y=z[ue];if(0>_(oe,O))ue<H&&0>_(Y,oe)?(z[A]=Y,z[ue]=O,A=ue):(z[A]=oe,z[ne]=O,A=ne);else if(ue<H&&0>_(Y,O))z[A]=Y,z[ue]=O,A=ue;else break e}}return D}function _(z,D){var O=z.sortIndex-D.sortIndex;return O!==0?O:z.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var k=performance;r.unstable_now=function(){return k.now()}}else{var R=Date,a=R.now();r.unstable_now=function(){return R.now()-a}}var d=[],p=[],y=1,f=null,S=3,b=!1,M=!1,w=!1,c=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(z){for(var D=n(p);D!==null;){if(D.callback===null)g(p);else if(D.startTime<=z)g(p),D.sortIndex=D.expirationTime,i(d,D);else break;D=n(p)}}function v(z){if(w=!1,h(z),!M)if(n(d)!==null)M=!0,V(C);else{var D=n(p);D!==null&&X(v,D.startTime-z)}}function C(z,D){M=!1,w&&(w=!1,u(E),E=-1),b=!0;var O=S;try{for(h(D),f=n(d);f!==null&&(!(f.expirationTime>D)||z&&!K());){var A=f.callback;if(typeof A=="function"){f.callback=null,S=f.priorityLevel;var H=A(f.expirationTime<=D);D=r.unstable_now(),typeof H=="function"?f.callback=H:f===n(d)&&g(d),h(D)}else g(d);f=n(d)}if(f!==null)var Q=!0;else{var ne=n(p);ne!==null&&X(v,ne.startTime-D),Q=!1}return Q}finally{f=null,S=O,b=!1}}var L=!1,T=null,E=-1,N=5,W=-1;function K(){return!(r.unstable_now()-W<N)}function I(){if(T!==null){var z=r.unstable_now();W=z;var D=!0;try{D=T(!0,z)}finally{D?B():(L=!1,T=null)}}else L=!1}var B;if(typeof l=="function")B=function(){l(I)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,$=U.port2;U.port1.onmessage=I,B=function(){$.postMessage(null)}}else B=function(){c(I,0)};function V(z){T=z,L||(L=!0,B())}function X(z,D){E=c(function(){z(r.unstable_now())},D)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(z){z.callback=null},r.unstable_continueExecution=function(){M||b||(M=!0,V(C))},r.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<z?Math.floor(1e3/z):5},r.unstable_getCurrentPriorityLevel=function(){return S},r.unstable_getFirstCallbackNode=function(){return n(d)},r.unstable_next=function(z){switch(S){case 1:case 2:case 3:var D=3;break;default:D=S}var O=S;S=D;try{return z()}finally{S=O}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(z,D){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var O=S;S=z;try{return D()}finally{S=O}},r.unstable_scheduleCallback=function(z,D,O){var A=r.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?A+O:A):O=A,z){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=O+H,z={id:y++,callback:D,priorityLevel:z,startTime:O,expirationTime:H,sortIndex:-1},O>A?(z.sortIndex=O,i(p,z),n(d)===null&&z===n(p)&&(w?(u(E),E=-1):w=!0,X(v,O-A))):(z.sortIndex=H,i(d,z),M||b||(M=!0,V(C))),z},r.unstable_shouldYield=K,r.unstable_wrapCallback=function(z){var D=S;return function(){var O=S;S=D;try{return z.apply(this,arguments)}finally{S=O}}}})(ic)),ic}var bd;function xv(){return bd||(bd=1,rc.exports=Cv()),rc.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 Ed;function bv(){if(Ed)return ir;Ed=1;var r=Kc(),i=xv();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);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 g=new Set,_={};function k(e,t){R(e,t),R(e+"Capture",t)}function R(e,t){for(_[e]=t,e=0;e<t.length;e++)g.add(t[e])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,y={},f={};function S(e){return d.call(f,e)?!0:d.call(y,e)?!1:p.test(e)?f[e]=!0:(y[e]=!0,!1)}function b(e,t,s,o){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function M(e,t,s,o){if(t===null||typeof t>"u"||b(e,t,s,o))return!0;if(o)return!1;if(s!==null)switch(s.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 w(e,t,s,o,m,x,F){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=m,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=x,this.removeEmptyString=F}var c={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){c[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];c[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){c[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){c[e]=new w(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){c[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){c[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){c[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){c[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){c[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function l(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(u,l);c[t]=new w(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(u,l);c[t]=new w(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(u,l);c[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){c[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),c.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){c[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function h(e,t,s,o){var m=c.hasOwnProperty(t)?c[t]:null;(m!==null?m.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(M(t,s,m,o)&&(s=null),o||m===null?S(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):m.mustUseProperty?e[m.propertyName]=s===null?m.type===3?!1:"":s:(t=m.attributeName,o=m.attributeNamespace,s===null?e.removeAttribute(t):(m=m.type,s=m===3||m===4&&s===!0?"":""+s,o?e.setAttributeNS(o,t,s):e.setAttribute(t,s))))}var v=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for("react.element"),L=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),K=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),z=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=z&&e[z]||e["@@iterator"],typeof e=="function"?e:null)}var O=Object.assign,A;function H(e){if(A===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);A=t&&t[1]||""}return`
34
+ `+A+e}var Q=!1;function ne(e,t){if(!e||Q)return"";Q=!0;var s=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(ie){var o=ie}Reflect.construct(e,[],t)}else{try{t.call()}catch(ie){o=ie}e.call(t.prototype)}else{try{throw Error()}catch(ie){o=ie}e()}}catch(ie){if(ie&&o&&typeof ie.stack=="string"){for(var m=ie.stack.split(`
35
+ `),x=o.stack.split(`
36
+ `),F=m.length-1,G=x.length-1;1<=F&&0<=G&&m[F]!==x[G];)G--;for(;1<=F&&0<=G;F--,G--)if(m[F]!==x[G]){if(F!==1||G!==1)do if(F--,G--,0>G||m[F]!==x[G]){var J=`
37
+ `+m[F].replace(" at new "," at ");return e.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",e.displayName)),J}while(1<=F&&0<=G);break}}}finally{Q=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?H(e):""}function oe(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function ue(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 T:return"Fragment";case L:return"Portal";case N:return"Profiler";case E:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K:return(e.displayName||"Context")+".Consumer";case W:return(e._context.displayName||"Context")+".Provider";case I:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case $:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}function Y(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 ue(t);case 8:return t===E?"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 j(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function se(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function re(e){var t=se(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var m=s.get,x=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(F){o=""+F,x.call(this,F)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return o},setValue:function(F){o=""+F},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ve(e){e._valueTracker||(e._valueTracker=re(e))}function _e(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),o="";return e&&(o=se(e)?e.checked?"true":"false":e.value),e=o,e!==s?(t.setValue(e),!0):!1}function Re(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 Se(e,t){var s=t.checked;return O({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function $e(e,t){var s=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;s=j(t.value!=null?t.value:s),e._wrapperState={initialChecked:o,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function je(e,t){t=t.checked,t!=null&&h(e,"checked",t,!1)}function xe(e,t){je(e,t);var s=j(t.value),o=t.type;if(s!=null)o==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ft(e,t.type,s):t.hasOwnProperty("defaultValue")&&ft(e,t.type,j(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xe(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function ft(e,t,s){(t!=="number"||Re(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var _t=Array.isArray;function Ye(e,t,s,o){if(e=e.options,t){t={};for(var m=0;m<s.length;m++)t["$"+s[m]]=!0;for(s=0;s<e.length;s++)m=t.hasOwnProperty("$"+e[s].value),e[s].selected!==m&&(e[s].selected=m),m&&o&&(e[s].defaultSelected=!0)}else{for(s=""+j(s),t=null,m=0;m<e.length;m++){if(e[m].value===s){e[m].selected=!0,o&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function Ge(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(n(91));return O({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ke(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(n(92));if(_t(s)){if(1<s.length)throw Error(n(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:j(s)}}function Ft(e,t){var s=j(t.value),o=j(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),o!=null&&(e.defaultValue=""+o)}function it(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ut(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 le(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ut(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ce,Ee=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,o,m){MSApp.execUnsafeLocalFunction(function(){return e(t,s,o,m)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ce=ce||document.createElement("div"),ce.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function De(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var We={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},Ae=["Webkit","ms","Moz","O"];Object.keys(We).forEach(function(e){Ae.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),We[t]=We[e]})});function Wt(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||We.hasOwnProperty(e)&&We[e]?(""+t).trim():t+"px"}function ge(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var o=s.indexOf("--")===0,m=Wt(s,t[s],o);s==="float"&&(s="cssFloat"),o?e.setProperty(s,m):e[s]=m}}var ke=O({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 Pe(e,t){if(t){if(ke[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(n(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(n(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(t.style!=null&&typeof t.style!="object")throw Error(n(62))}}function ze(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 gt=null;function Ne(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vt=null,Je=null,Kt=null;function Ir(e){if(e=Zs(e)){if(typeof Vt!="function")throw Error(n(280));var t=e.stateNode;t&&(t=ro(t),Vt(e.stateNode,e.type,t))}}function Xi(e){Je?Kt?Kt.push(e):Kt=[e]:Je=e}function Ji(){if(Je){var e=Je,t=Kt;if(Kt=Je=null,Ir(e),t)for(e=0;e<t.length;e++)Ir(t[e])}}function Qi(e,t){return e(t)}function Tn(){}var Bs=!1;function Dn(e,t,s){if(Bs)return e(t,s);Bs=!0;try{return Qi(e,t,s)}finally{Bs=!1,(Je!==null||Kt!==null)&&(Tn(),Ji())}}function Mi(e,t){var s=e.stateNode;if(s===null)return null;var o=ro(s);if(o===null)return null;s=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(n(231,t,typeof s));return s}var Ps=!1;if(a)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){Ps=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{Ps=!1}function An(e,t,s,o,m,x,F,G,J){var ie=Array.prototype.slice.call(arguments,3);try{t.apply(s,ie)}catch(de){this.onError(de)}}var ei=!1,ti=null,Jt=!1,ri=null,Os={onError:function(e){ei=!0,ti=e}};function ua(e,t,s,o,m,x,F,G,J){ei=!1,ti=null,An.apply(Os,arguments)}function da(e,t,s,o,m,x,F,G,J){if(ua.apply(this,arguments),ei){if(ei){var ie=ti;ei=!1,ti=null}else throw Error(n(198));Jt||(Jt=!0,ri=ie)}}function Fr(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function Bn(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 Pn(e){if(Fr(e)!==e)throw Error(n(188))}function fa(e){var t=e.alternate;if(!t){if(t=Fr(e),t===null)throw Error(n(188));return t!==e?null:e}for(var s=e,o=t;;){var m=s.return;if(m===null)break;var x=m.alternate;if(x===null){if(o=m.return,o!==null){s=o;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===s)return Pn(m),e;if(x===o)return Pn(m),t;x=x.sibling}throw Error(n(188))}if(s.return!==o.return)s=m,o=x;else{for(var F=!1,G=m.child;G;){if(G===s){F=!0,s=m,o=x;break}if(G===o){F=!0,o=m,s=x;break}G=G.sibling}if(!F){for(G=x.child;G;){if(G===s){F=!0,s=x,o=m;break}if(G===o){F=!0,o=x,s=m;break}G=G.sibling}if(!F)throw Error(n(189))}}if(s.alternate!==o)throw Error(n(190))}if(s.tag!==3)throw Error(n(188));return s.stateNode.current===s?e:t}function On(e){return e=fa(e),e!==null?Nn(e):null}function Nn(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nn(e);if(t!==null)return t;e=e.sibling}return null}var In=i.unstable_scheduleCallback,Fn=i.unstable_cancelCallback,_a=i.unstable_shouldYield,pa=i.unstable_requestPaint,st=i.unstable_now,va=i.unstable_getCurrentPriorityLevel,Ns=i.unstable_ImmediatePriority,jn=i.unstable_UserBlockingPriority,Di=i.unstable_NormalPriority,ga=i.unstable_LowPriority,Hn=i.unstable_IdlePriority,Zi=null,ur=null;function ma(e){if(ur&&typeof ur.onCommitFiberRoot=="function")try{ur.onCommitFiberRoot(Zi,e,void 0,(e.current.flags&128)===128)}catch{}}var nr=Math.clz32?Math.clz32:Sa,ya=Math.log,wa=Math.LN2;function Sa(e){return e>>>=0,e===0?32:31-(ya(e)/wa|0)|0}var es=64,ts=4194304;function Ai(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 ae(e,t){var s=e.pendingLanes;if(s===0)return 0;var o=0,m=e.suspendedLanes,x=e.pingedLanes,F=s&268435455;if(F!==0){var G=F&~m;G!==0?o=Ai(G):(x&=F,x!==0&&(o=Ai(x)))}else F=s&~m,F!==0?o=Ai(F):x!==0&&(o=Ai(x));if(o===0)return 0;if(t!==0&&t!==o&&(t&m)===0&&(m=o&-o,x=t&-t,m>=x||m===16&&(x&4194240)!==0))return t;if((o&4)!==0&&(o|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)s=31-nr(t),m=1<<s,o|=e[s],t&=~m;return o}function me(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 Ie(e,t){for(var s=e.suspendedLanes,o=e.pingedLanes,m=e.expirationTimes,x=e.pendingLanes;0<x;){var F=31-nr(x),G=1<<F,J=m[F];J===-1?((G&s)===0||(G&o)!==0)&&(m[F]=me(G,t)):J<=t&&(e.expiredLanes|=G),x&=~G}}function Oe(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Sr(){var e=es;return es<<=1,(es&4194240)===0&&(es=64),e}function ii(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function jr(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-nr(t),e[t]=s}function si(e,t){var s=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 o=e.eventTimes;for(e=e.expirationTimes;0<s;){var m=31-nr(s),x=1<<m;t[m]=0,o[m]=-1,e[m]=-1,s&=~x}}function Ca(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var o=31-nr(s),m=1<<o;m&t|e[o]&t&&(e[o]|=t),s&=~m}}var qe=0;function Jc(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Qc,xa,Zc,eh,th,ba=!1,$n=[],ni=null,oi=null,ai=null,Is=new Map,Fs=new Map,li=[],$_="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 rh(e,t){switch(e){case"focusin":case"focusout":ni=null;break;case"dragenter":case"dragleave":oi=null;break;case"mouseover":case"mouseout":ai=null;break;case"pointerover":case"pointerout":Is.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fs.delete(t.pointerId)}}function js(e,t,s,o,m,x){return e===null||e.nativeEvent!==x?(e={blockedOn:t,domEventName:s,eventSystemFlags:o,nativeEvent:x,targetContainers:[m]},t!==null&&(t=Zs(t),t!==null&&xa(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function z_(e,t,s,o,m){switch(t){case"focusin":return ni=js(ni,e,t,s,o,m),!0;case"dragenter":return oi=js(oi,e,t,s,o,m),!0;case"mouseover":return ai=js(ai,e,t,s,o,m),!0;case"pointerover":var x=m.pointerId;return Is.set(x,js(Is.get(x)||null,e,t,s,o,m)),!0;case"gotpointercapture":return x=m.pointerId,Fs.set(x,js(Fs.get(x)||null,e,t,s,o,m)),!0}return!1}function ih(e){var t=Bi(e.target);if(t!==null){var s=Fr(t);if(s!==null){if(t=s.tag,t===13){if(t=Bn(s),t!==null){e.blockedOn=t,th(e.priority,function(){Zc(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=La(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);gt=o,s.target.dispatchEvent(o),gt=null}else return t=Zs(s),t!==null&&xa(t),e.blockedOn=s,!1;t.shift()}return!0}function sh(e,t,s){zn(e)&&s.delete(t)}function U_(){ba=!1,ni!==null&&zn(ni)&&(ni=null),oi!==null&&zn(oi)&&(oi=null),ai!==null&&zn(ai)&&(ai=null),Is.forEach(sh),Fs.forEach(sh)}function Hs(e,t){e.blockedOn===t&&(e.blockedOn=null,ba||(ba=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,U_)))}function $s(e){function t(m){return Hs(m,e)}if(0<$n.length){Hs($n[0],e);for(var s=1;s<$n.length;s++){var o=$n[s];o.blockedOn===e&&(o.blockedOn=null)}}for(ni!==null&&Hs(ni,e),oi!==null&&Hs(oi,e),ai!==null&&Hs(ai,e),Is.forEach(t),Fs.forEach(t),s=0;s<li.length;s++)o=li[s],o.blockedOn===e&&(o.blockedOn=null);for(;0<li.length&&(s=li[0],s.blockedOn===null);)ih(s),s.blockedOn===null&&li.shift()}var rs=v.ReactCurrentBatchConfig,Un=!0;function W_(e,t,s,o){var m=qe,x=rs.transition;rs.transition=null;try{qe=1,Ea(e,t,s,o)}finally{qe=m,rs.transition=x}}function V_(e,t,s,o){var m=qe,x=rs.transition;rs.transition=null;try{qe=4,Ea(e,t,s,o)}finally{qe=m,rs.transition=x}}function Ea(e,t,s,o){if(Un){var m=La(e,t,s,o);if(m===null)Ua(e,t,o,Wn,s),rh(e,o);else if(z_(m,e,t,s,o))o.stopPropagation();else if(rh(e,o),t&4&&-1<$_.indexOf(e)){for(;m!==null;){var x=Zs(m);if(x!==null&&Qc(x),x=La(e,t,s,o),x===null&&Ua(e,t,o,Wn,s),x===m)break;m=x}m!==null&&o.stopPropagation()}else Ua(e,t,o,null,s)}}var Wn=null;function La(e,t,s,o){if(Wn=null,e=Ne(o),e=Bi(e),e!==null)if(t=Fr(e),t===null)e=null;else if(s=t.tag,s===13){if(e=Bn(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wn=e,null}function nh(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(va()){case Ns:return 1;case jn:return 4;case Di:case ga:return 16;case Hn:return 536870912;default:return 16}default:return 16}}var ci=null,ka=null,Vn=null;function oh(){if(Vn)return Vn;var e,t=ka,s=t.length,o,m="value"in ci?ci.value:ci.textContent,x=m.length;for(e=0;e<s&&t[e]===m[e];e++);var F=s-e;for(o=1;o<=F&&t[s-o]===m[x-o];o++);return Vn=m.slice(e,1<o?1-o:void 0)}function Kn(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 qn(){return!0}function ah(){return!1}function or(e){function t(s,o,m,x,F){this._reactName=s,this._targetInst=m,this.type=o,this.nativeEvent=x,this.target=F,this.currentTarget=null;for(var G in e)e.hasOwnProperty(G)&&(s=e[G],this[G]=s?s(x):x[G]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?qn:ah,this.isPropagationStopped=ah,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=qn)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=qn)},persist:function(){},isPersistent:qn}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ra=or(is),zs=O({},is,{view:0,detail:0}),K_=or(zs),Ma,Ta,Us,Gn=O({},zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Aa,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!==Us&&(Us&&e.type==="mousemove"?(Ma=e.screenX-Us.screenX,Ta=e.screenY-Us.screenY):Ta=Ma=0,Us=e),Ma)},movementY:function(e){return"movementY"in e?e.movementY:Ta}}),lh=or(Gn),q_=O({},Gn,{dataTransfer:0}),G_=or(q_),Y_=O({},zs,{relatedTarget:0}),Da=or(Y_),X_=O({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),J_=or(X_),Q_=O({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Z_=or(Q_),ep=O({},is,{data:0}),ch=or(ep),tp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rp={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"},ip={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ip[e])?!!t[e]:!1}function Aa(){return sp}var np=O({},zs,{key:function(e){if(e.key){var t=tp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Kn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Aa,charCode:function(e){return e.type==="keypress"?Kn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Kn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),op=or(np),ap=O({},Gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hh=or(ap),lp=O({},zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Aa}),cp=or(lp),hp=O({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),up=or(hp),dp=O({},Gn,{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}),fp=or(dp),_p=[9,13,27,32],Ba=a&&"CompositionEvent"in window,Ws=null;a&&"documentMode"in document&&(Ws=document.documentMode);var pp=a&&"TextEvent"in window&&!Ws,uh=a&&(!Ba||Ws&&8<Ws&&11>=Ws),dh=" ",fh=!1;function _h(e,t){switch(e){case"keyup":return _p.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ph(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ss=!1;function vp(e,t){switch(e){case"compositionend":return ph(t);case"keypress":return t.which!==32?null:(fh=!0,dh);case"textInput":return e=t.data,e===dh&&fh?null:e;default:return null}}function gp(e,t){if(ss)return e==="compositionend"||!Ba&&_h(e,t)?(e=oh(),Vn=ka=ci=null,ss=!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 uh&&t.locale!=="ko"?null:t.data;default:return null}}var mp={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 vh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!mp[e.type]:t==="textarea"}function gh(e,t,s,o){Xi(o),t=Zn(t,"onChange"),0<t.length&&(s=new Ra("onChange","change",null,s,o),e.push({event:s,listeners:t}))}var Vs=null,Ks=null;function yp(e){Oh(e,0)}function Yn(e){var t=cs(e);if(_e(t))return e}function wp(e,t){if(e==="change")return t}var mh=!1;if(a){var Pa;if(a){var Oa="oninput"in document;if(!Oa){var yh=document.createElement("div");yh.setAttribute("oninput","return;"),Oa=typeof yh.oninput=="function"}Pa=Oa}else Pa=!1;mh=Pa&&(!document.documentMode||9<document.documentMode)}function wh(){Vs&&(Vs.detachEvent("onpropertychange",Sh),Ks=Vs=null)}function Sh(e){if(e.propertyName==="value"&&Yn(Ks)){var t=[];gh(t,Ks,e,Ne(e)),Dn(yp,t)}}function Sp(e,t,s){e==="focusin"?(wh(),Vs=t,Ks=s,Vs.attachEvent("onpropertychange",Sh)):e==="focusout"&&wh()}function Cp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yn(Ks)}function xp(e,t){if(e==="click")return Yn(t)}function bp(e,t){if(e==="input"||e==="change")return Yn(t)}function Ep(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cr=typeof Object.is=="function"?Object.is:Ep;function qs(e,t){if(Cr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var m=s[o];if(!d.call(t,m)||!Cr(e[m],t[m]))return!1}return!0}function Ch(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xh(e,t){var s=Ch(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=t&&o>=t)return{node:s,offset:t-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ch(s)}}function bh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?bh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Eh(){for(var e=window,t=Re();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Re(e.document)}return t}function Na(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 Lp(e){var t=Eh(),s=e.focusedElem,o=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&bh(s.ownerDocument.documentElement,s)){if(o!==null&&Na(s)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var m=s.textContent.length,x=Math.min(o.start,m);o=o.end===void 0?x:Math.min(o.end,m),!e.extend&&x>o&&(m=o,o=x,x=m),m=xh(s,x);var F=xh(s,o);m&&F&&(e.rangeCount!==1||e.anchorNode!==m.node||e.anchorOffset!==m.offset||e.focusNode!==F.node||e.focusOffset!==F.offset)&&(t=t.createRange(),t.setStart(m.node,m.offset),e.removeAllRanges(),x>o?(e.addRange(t),e.extend(F.node,F.offset)):(t.setEnd(F.node,F.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kp=a&&"documentMode"in document&&11>=document.documentMode,ns=null,Ia=null,Gs=null,Fa=!1;function Lh(e,t,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Fa||ns==null||ns!==Re(o)||(o=ns,"selectionStart"in o&&Na(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Gs&&qs(Gs,o)||(Gs=o,o=Zn(Ia,"onSelect"),0<o.length&&(t=new Ra("onSelect","select",null,t,s),e.push({event:t,listeners:o}),t.target=ns)))}function Xn(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var os={animationend:Xn("Animation","AnimationEnd"),animationiteration:Xn("Animation","AnimationIteration"),animationstart:Xn("Animation","AnimationStart"),transitionend:Xn("Transition","TransitionEnd")},ja={},kh={};a&&(kh=document.createElement("div").style,"AnimationEvent"in window||(delete os.animationend.animation,delete os.animationiteration.animation,delete os.animationstart.animation),"TransitionEvent"in window||delete os.transitionend.transition);function Jn(e){if(ja[e])return ja[e];if(!os[e])return e;var t=os[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in kh)return ja[e]=t[s];return e}var Rh=Jn("animationend"),Mh=Jn("animationiteration"),Th=Jn("animationstart"),Dh=Jn("transitionend"),Ah=new Map,Bh="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 hi(e,t){Ah.set(e,t),k(t,[e])}for(var Ha=0;Ha<Bh.length;Ha++){var $a=Bh[Ha],Rp=$a.toLowerCase(),Mp=$a[0].toUpperCase()+$a.slice(1);hi(Rp,"on"+Mp)}hi(Rh,"onAnimationEnd"),hi(Mh,"onAnimationIteration"),hi(Th,"onAnimationStart"),hi("dblclick","onDoubleClick"),hi("focusin","onFocus"),hi("focusout","onBlur"),hi(Dh,"onTransitionEnd"),R("onMouseEnter",["mouseout","mouseover"]),R("onMouseLeave",["mouseout","mouseover"]),R("onPointerEnter",["pointerout","pointerover"]),R("onPointerLeave",["pointerout","pointerover"]),k("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),k("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),k("onBeforeInput",["compositionend","keypress","textInput","paste"]),k("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),k("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),k("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ys="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(" "),Tp=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ys));function Ph(e,t,s){var o=e.type||"unknown-event";e.currentTarget=s,da(o,t,void 0,e),e.currentTarget=null}function Oh(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],m=o.event;o=o.listeners;e:{var x=void 0;if(t)for(var F=o.length-1;0<=F;F--){var G=o[F],J=G.instance,ie=G.currentTarget;if(G=G.listener,J!==x&&m.isPropagationStopped())break e;Ph(m,G,ie),x=J}else for(F=0;F<o.length;F++){if(G=o[F],J=G.instance,ie=G.currentTarget,G=G.listener,J!==x&&m.isPropagationStopped())break e;Ph(m,G,ie),x=J}}}if(Jt)throw e=ri,Jt=!1,ri=null,e}function Ze(e,t){var s=t[Ya];s===void 0&&(s=t[Ya]=new Set);var o=e+"__bubble";s.has(o)||(Nh(t,e,2,!1),s.add(o))}function za(e,t,s){var o=0;t&&(o|=4),Nh(s,e,o,t)}var Qn="_reactListening"+Math.random().toString(36).slice(2);function Xs(e){if(!e[Qn]){e[Qn]=!0,g.forEach(function(s){s!=="selectionchange"&&(Tp.has(s)||za(s,!1,e),za(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qn]||(t[Qn]=!0,za("selectionchange",!1,t))}}function Nh(e,t,s,o){switch(nh(t)){case 1:var m=W_;break;case 4:m=V_;break;default:m=Ea}s=m.bind(null,t,s,e),m=void 0,!Ps||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),o?m!==void 0?e.addEventListener(t,s,{capture:!0,passive:m}):e.addEventListener(t,s,!0):m!==void 0?e.addEventListener(t,s,{passive:m}):e.addEventListener(t,s,!1)}function Ua(e,t,s,o,m){var x=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var F=o.tag;if(F===3||F===4){var G=o.stateNode.containerInfo;if(G===m||G.nodeType===8&&G.parentNode===m)break;if(F===4)for(F=o.return;F!==null;){var J=F.tag;if((J===3||J===4)&&(J=F.stateNode.containerInfo,J===m||J.nodeType===8&&J.parentNode===m))return;F=F.return}for(;G!==null;){if(F=Bi(G),F===null)return;if(J=F.tag,J===5||J===6){o=x=F;continue e}G=G.parentNode}}o=o.return}Dn(function(){var ie=x,de=Ne(s),fe=[];e:{var he=Ah.get(e);if(he!==void 0){var ye=Ra,Ce=e;switch(e){case"keypress":if(Kn(s)===0)break e;case"keydown":case"keyup":ye=op;break;case"focusin":Ce="focus",ye=Da;break;case"focusout":Ce="blur",ye=Da;break;case"beforeblur":case"afterblur":ye=Da;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=lh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=G_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=cp;break;case Rh:case Mh:case Th:ye=J_;break;case Dh:ye=up;break;case"scroll":ye=K_;break;case"wheel":ye=fp;break;case"copy":case"cut":case"paste":ye=Z_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=hh}var be=(t&4)!==0,dt=!be&&e==="scroll",ee=be?he!==null?he+"Capture":null:he;be=[];for(var Z=ie,te;Z!==null;){te=Z;var pe=te.stateNode;if(te.tag===5&&pe!==null&&(te=pe,ee!==null&&(pe=Mi(Z,ee),pe!=null&&be.push(Js(Z,pe,te)))),dt)break;Z=Z.return}0<be.length&&(he=new ye(he,Ce,null,s,de),fe.push({event:he,listeners:be}))}}if((t&7)===0){e:{if(he=e==="mouseover"||e==="pointerover",ye=e==="mouseout"||e==="pointerout",he&&s!==gt&&(Ce=s.relatedTarget||s.fromElement)&&(Bi(Ce)||Ce[Hr]))break e;if((ye||he)&&(he=de.window===de?de:(he=de.ownerDocument)?he.defaultView||he.parentWindow:window,ye?(Ce=s.relatedTarget||s.toElement,ye=ie,Ce=Ce?Bi(Ce):null,Ce!==null&&(dt=Fr(Ce),Ce!==dt||Ce.tag!==5&&Ce.tag!==6)&&(Ce=null)):(ye=null,Ce=ie),ye!==Ce)){if(be=lh,pe="onMouseLeave",ee="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(be=hh,pe="onPointerLeave",ee="onPointerEnter",Z="pointer"),dt=ye==null?he:cs(ye),te=Ce==null?he:cs(Ce),he=new be(pe,Z+"leave",ye,s,de),he.target=dt,he.relatedTarget=te,pe=null,Bi(de)===ie&&(be=new be(ee,Z+"enter",Ce,s,de),be.target=te,be.relatedTarget=dt,pe=be),dt=pe,ye&&Ce)t:{for(be=ye,ee=Ce,Z=0,te=be;te;te=as(te))Z++;for(te=0,pe=ee;pe;pe=as(pe))te++;for(;0<Z-te;)be=as(be),Z--;for(;0<te-Z;)ee=as(ee),te--;for(;Z--;){if(be===ee||ee!==null&&be===ee.alternate)break t;be=as(be),ee=as(ee)}be=null}else be=null;ye!==null&&Ih(fe,he,ye,be,!1),Ce!==null&&dt!==null&&Ih(fe,dt,Ce,be,!0)}}e:{if(he=ie?cs(ie):window,ye=he.nodeName&&he.nodeName.toLowerCase(),ye==="select"||ye==="input"&&he.type==="file")var Le=wp;else if(vh(he))if(mh)Le=bp;else{Le=Cp;var Me=Sp}else(ye=he.nodeName)&&ye.toLowerCase()==="input"&&(he.type==="checkbox"||he.type==="radio")&&(Le=xp);if(Le&&(Le=Le(e,ie))){gh(fe,Le,s,de);break e}Me&&Me(e,he,ie),e==="focusout"&&(Me=he._wrapperState)&&Me.controlled&&he.type==="number"&&ft(he,"number",he.value)}switch(Me=ie?cs(ie):window,e){case"focusin":(vh(Me)||Me.contentEditable==="true")&&(ns=Me,Ia=ie,Gs=null);break;case"focusout":Gs=Ia=ns=null;break;case"mousedown":Fa=!0;break;case"contextmenu":case"mouseup":case"dragend":Fa=!1,Lh(fe,s,de);break;case"selectionchange":if(kp)break;case"keydown":case"keyup":Lh(fe,s,de)}var Te;if(Ba)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else ss?_h(e,s)&&(Be="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Be="onCompositionStart");Be&&(uh&&s.locale!=="ko"&&(ss||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&ss&&(Te=oh()):(ci=de,ka="value"in ci?ci.value:ci.textContent,ss=!0)),Me=Zn(ie,Be),0<Me.length&&(Be=new ch(Be,e,null,s,de),fe.push({event:Be,listeners:Me}),Te?Be.data=Te:(Te=ph(s),Te!==null&&(Be.data=Te)))),(Te=pp?vp(e,s):gp(e,s))&&(ie=Zn(ie,"onBeforeInput"),0<ie.length&&(de=new ch("onBeforeInput","beforeinput",null,s,de),fe.push({event:de,listeners:ie}),de.data=Te))}Oh(fe,t)})}function Js(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Zn(e,t){for(var s=t+"Capture",o=[];e!==null;){var m=e,x=m.stateNode;m.tag===5&&x!==null&&(m=x,x=Mi(e,s),x!=null&&o.unshift(Js(e,x,m)),x=Mi(e,t),x!=null&&o.push(Js(e,x,m))),e=e.return}return o}function as(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ih(e,t,s,o,m){for(var x=t._reactName,F=[];s!==null&&s!==o;){var G=s,J=G.alternate,ie=G.stateNode;if(J!==null&&J===o)break;G.tag===5&&ie!==null&&(G=ie,m?(J=Mi(s,x),J!=null&&F.unshift(Js(s,J,G))):m||(J=Mi(s,x),J!=null&&F.push(Js(s,J,G)))),s=s.return}F.length!==0&&e.push({event:t,listeners:F})}var Dp=/\r\n?/g,Ap=/\u0000|\uFFFD/g;function Fh(e){return(typeof e=="string"?e:""+e).replace(Dp,`
38
+ `).replace(Ap,"")}function eo(e,t,s){if(t=Fh(t),Fh(e)!==t&&s)throw Error(n(425))}function to(){}var Wa=null,Va=null;function Ka(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 qa=typeof setTimeout=="function"?setTimeout:void 0,Bp=typeof clearTimeout=="function"?clearTimeout:void 0,jh=typeof Promise=="function"?Promise:void 0,Pp=typeof queueMicrotask=="function"?queueMicrotask:typeof jh<"u"?function(e){return jh.resolve(null).then(e).catch(Op)}:qa;function Op(e){setTimeout(function(){throw e})}function Ga(e,t){var s=t,o=0;do{var m=s.nextSibling;if(e.removeChild(s),m&&m.nodeType===8)if(s=m.data,s==="/$"){if(o===0){e.removeChild(m),$s(t);return}o--}else s!=="$"&&s!=="$?"&&s!=="$!"||o++;s=m}while(s);$s(t)}function ui(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 Hh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var ls=Math.random().toString(36).slice(2),Tr="__reactFiber$"+ls,Qs="__reactProps$"+ls,Hr="__reactContainer$"+ls,Ya="__reactEvents$"+ls,Np="__reactListeners$"+ls,Ip="__reactHandles$"+ls;function Bi(e){var t=e[Tr];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Hr]||s[Tr]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Hh(e);e!==null;){if(s=e[Tr])return s;e=Hh(e)}return t}e=s,s=e.parentNode}return null}function Zs(e){return e=e[Tr]||e[Hr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(n(33))}function ro(e){return e[Qs]||null}var Xa=[],hs=-1;function di(e){return{current:e}}function et(e){0>hs||(e.current=Xa[hs],Xa[hs]=null,hs--)}function Qe(e,t){hs++,Xa[hs]=e.current,e.current=t}var fi={},jt=di(fi),Qt=di(!1),Pi=fi;function us(e,t){var s=e.type.contextTypes;if(!s)return fi;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var m={},x;for(x in s)m[x]=t[x];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=m),m}function Zt(e){return e=e.childContextTypes,e!=null}function io(){et(Qt),et(jt)}function $h(e,t,s){if(jt.current!==fi)throw Error(n(168));Qe(jt,t),Qe(Qt,s)}function zh(e,t,s){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return s;o=o.getChildContext();for(var m in o)if(!(m in t))throw Error(n(108,Y(e)||"Unknown",m));return O({},s,o)}function so(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Pi=jt.current,Qe(jt,e),Qe(Qt,Qt.current),!0}function Uh(e,t,s){var o=e.stateNode;if(!o)throw Error(n(169));s?(e=zh(e,t,Pi),o.__reactInternalMemoizedMergedChildContext=e,et(Qt),et(jt),Qe(jt,e)):et(Qt),Qe(Qt,s)}var $r=null,no=!1,Ja=!1;function Wh(e){$r===null?$r=[e]:$r.push(e)}function Fp(e){no=!0,Wh(e)}function _i(){if(!Ja&&$r!==null){Ja=!0;var e=0,t=qe;try{var s=$r;for(qe=1;e<s.length;e++){var o=s[e];do o=o(!0);while(o!==null)}$r=null,no=!1}catch(m){throw $r!==null&&($r=$r.slice(e+1)),In(Ns,_i),m}finally{qe=t,Ja=!1}}return null}var ds=[],fs=0,oo=null,ao=0,dr=[],fr=0,Oi=null,zr=1,Ur="";function Ni(e,t){ds[fs++]=ao,ds[fs++]=oo,oo=e,ao=t}function Vh(e,t,s){dr[fr++]=zr,dr[fr++]=Ur,dr[fr++]=Oi,Oi=e;var o=zr;e=Ur;var m=32-nr(o)-1;o&=~(1<<m),s+=1;var x=32-nr(t)+m;if(30<x){var F=m-m%5;x=(o&(1<<F)-1).toString(32),o>>=F,m-=F,zr=1<<32-nr(t)+m|s<<m|o,Ur=x+e}else zr=1<<x|s<<m|o,Ur=e}function Qa(e){e.return!==null&&(Ni(e,1),Vh(e,1,0))}function Za(e){for(;e===oo;)oo=ds[--fs],ds[fs]=null,ao=ds[--fs],ds[fs]=null;for(;e===Oi;)Oi=dr[--fr],dr[fr]=null,Ur=dr[--fr],dr[fr]=null,zr=dr[--fr],dr[fr]=null}var ar=null,lr=null,nt=!1,xr=null;function Kh(e,t){var s=gr(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function qh(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ar=e,lr=ui(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ar=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=Oi!==null?{id:zr,overflow:Ur}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=gr(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,ar=e,lr=null,!0):!1;default:return!1}}function el(e){return(e.mode&1)!==0&&(e.flags&128)===0}function tl(e){if(nt){var t=lr;if(t){var s=t;if(!qh(e,t)){if(el(e))throw Error(n(418));t=ui(s.nextSibling);var o=ar;t&&qh(e,t)?Kh(o,s):(e.flags=e.flags&-4097|2,nt=!1,ar=e)}}else{if(el(e))throw Error(n(418));e.flags=e.flags&-4097|2,nt=!1,ar=e}}}function Gh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ar=e}function lo(e){if(e!==ar)return!1;if(!nt)return Gh(e),nt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ka(e.type,e.memoizedProps)),t&&(t=lr)){if(el(e))throw Yh(),Error(n(418));for(;t;)Kh(e,t),t=ui(t.nextSibling)}if(Gh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){lr=ui(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=ar?ui(e.stateNode.nextSibling):null;return!0}function Yh(){for(var e=lr;e;)e=ui(e.nextSibling)}function _s(){lr=ar=null,nt=!1}function rl(e){xr===null?xr=[e]:xr.push(e)}var jp=v.ReactCurrentBatchConfig;function en(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(n(309));var o=s.stateNode}if(!o)throw Error(n(147,e));var m=o,x=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===x?t.ref:(t=function(F){var G=m.refs;F===null?delete G[x]:G[x]=F},t._stringRef=x,t)}if(typeof e!="string")throw Error(n(284));if(!s._owner)throw Error(n(290,e))}return e}function co(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Xh(e){var t=e._init;return t(e._payload)}function Jh(e){function t(ee,Z){if(e){var te=ee.deletions;te===null?(ee.deletions=[Z],ee.flags|=16):te.push(Z)}}function s(ee,Z){if(!e)return null;for(;Z!==null;)t(ee,Z),Z=Z.sibling;return null}function o(ee,Z){for(ee=new Map;Z!==null;)Z.key!==null?ee.set(Z.key,Z):ee.set(Z.index,Z),Z=Z.sibling;return ee}function m(ee,Z){return ee=Ci(ee,Z),ee.index=0,ee.sibling=null,ee}function x(ee,Z,te){return ee.index=te,e?(te=ee.alternate,te!==null?(te=te.index,te<Z?(ee.flags|=2,Z):te):(ee.flags|=2,Z)):(ee.flags|=1048576,Z)}function F(ee){return e&&ee.alternate===null&&(ee.flags|=2),ee}function G(ee,Z,te,pe){return Z===null||Z.tag!==6?(Z=ql(te,ee.mode,pe),Z.return=ee,Z):(Z=m(Z,te),Z.return=ee,Z)}function J(ee,Z,te,pe){var Le=te.type;return Le===T?de(ee,Z,te.props.children,pe,te.key):Z!==null&&(Z.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===V&&Xh(Le)===Z.type)?(pe=m(Z,te.props),pe.ref=en(ee,Z,te),pe.return=ee,pe):(pe=Po(te.type,te.key,te.props,null,ee.mode,pe),pe.ref=en(ee,Z,te),pe.return=ee,pe)}function ie(ee,Z,te,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==te.containerInfo||Z.stateNode.implementation!==te.implementation?(Z=Gl(te,ee.mode,pe),Z.return=ee,Z):(Z=m(Z,te.children||[]),Z.return=ee,Z)}function de(ee,Z,te,pe,Le){return Z===null||Z.tag!==7?(Z=Wi(te,ee.mode,pe,Le),Z.return=ee,Z):(Z=m(Z,te),Z.return=ee,Z)}function fe(ee,Z,te){if(typeof Z=="string"&&Z!==""||typeof Z=="number")return Z=ql(""+Z,ee.mode,te),Z.return=ee,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case C:return te=Po(Z.type,Z.key,Z.props,null,ee.mode,te),te.ref=en(ee,null,Z),te.return=ee,te;case L:return Z=Gl(Z,ee.mode,te),Z.return=ee,Z;case V:var pe=Z._init;return fe(ee,pe(Z._payload),te)}if(_t(Z)||D(Z))return Z=Wi(Z,ee.mode,te,null),Z.return=ee,Z;co(ee,Z)}return null}function he(ee,Z,te,pe){var Le=Z!==null?Z.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Le!==null?null:G(ee,Z,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case C:return te.key===Le?J(ee,Z,te,pe):null;case L:return te.key===Le?ie(ee,Z,te,pe):null;case V:return Le=te._init,he(ee,Z,Le(te._payload),pe)}if(_t(te)||D(te))return Le!==null?null:de(ee,Z,te,pe,null);co(ee,te)}return null}function ye(ee,Z,te,pe,Le){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return ee=ee.get(te)||null,G(Z,ee,""+pe,Le);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case C:return ee=ee.get(pe.key===null?te:pe.key)||null,J(Z,ee,pe,Le);case L:return ee=ee.get(pe.key===null?te:pe.key)||null,ie(Z,ee,pe,Le);case V:var Me=pe._init;return ye(ee,Z,te,Me(pe._payload),Le)}if(_t(pe)||D(pe))return ee=ee.get(te)||null,de(Z,ee,pe,Le,null);co(Z,pe)}return null}function Ce(ee,Z,te,pe){for(var Le=null,Me=null,Te=Z,Be=Z=0,bt=null;Te!==null&&Be<te.length;Be++){Te.index>Be?(bt=Te,Te=null):bt=Te.sibling;var Ve=he(ee,Te,te[Be],pe);if(Ve===null){Te===null&&(Te=bt);break}e&&Te&&Ve.alternate===null&&t(ee,Te),Z=x(Ve,Z,Be),Me===null?Le=Ve:Me.sibling=Ve,Me=Ve,Te=bt}if(Be===te.length)return s(ee,Te),nt&&Ni(ee,Be),Le;if(Te===null){for(;Be<te.length;Be++)Te=fe(ee,te[Be],pe),Te!==null&&(Z=x(Te,Z,Be),Me===null?Le=Te:Me.sibling=Te,Me=Te);return nt&&Ni(ee,Be),Le}for(Te=o(ee,Te);Be<te.length;Be++)bt=ye(Te,ee,Be,te[Be],pe),bt!==null&&(e&&bt.alternate!==null&&Te.delete(bt.key===null?Be:bt.key),Z=x(bt,Z,Be),Me===null?Le=bt:Me.sibling=bt,Me=bt);return e&&Te.forEach(function(xi){return t(ee,xi)}),nt&&Ni(ee,Be),Le}function be(ee,Z,te,pe){var Le=D(te);if(typeof Le!="function")throw Error(n(150));if(te=Le.call(te),te==null)throw Error(n(151));for(var Me=Le=null,Te=Z,Be=Z=0,bt=null,Ve=te.next();Te!==null&&!Ve.done;Be++,Ve=te.next()){Te.index>Be?(bt=Te,Te=null):bt=Te.sibling;var xi=he(ee,Te,Ve.value,pe);if(xi===null){Te===null&&(Te=bt);break}e&&Te&&xi.alternate===null&&t(ee,Te),Z=x(xi,Z,Be),Me===null?Le=xi:Me.sibling=xi,Me=xi,Te=bt}if(Ve.done)return s(ee,Te),nt&&Ni(ee,Be),Le;if(Te===null){for(;!Ve.done;Be++,Ve=te.next())Ve=fe(ee,Ve.value,pe),Ve!==null&&(Z=x(Ve,Z,Be),Me===null?Le=Ve:Me.sibling=Ve,Me=Ve);return nt&&Ni(ee,Be),Le}for(Te=o(ee,Te);!Ve.done;Be++,Ve=te.next())Ve=ye(Te,ee,Be,Ve.value,pe),Ve!==null&&(e&&Ve.alternate!==null&&Te.delete(Ve.key===null?Be:Ve.key),Z=x(Ve,Z,Be),Me===null?Le=Ve:Me.sibling=Ve,Me=Ve);return e&&Te.forEach(function(mv){return t(ee,mv)}),nt&&Ni(ee,Be),Le}function dt(ee,Z,te,pe){if(typeof te=="object"&&te!==null&&te.type===T&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case C:e:{for(var Le=te.key,Me=Z;Me!==null;){if(Me.key===Le){if(Le=te.type,Le===T){if(Me.tag===7){s(ee,Me.sibling),Z=m(Me,te.props.children),Z.return=ee,ee=Z;break e}}else if(Me.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===V&&Xh(Le)===Me.type){s(ee,Me.sibling),Z=m(Me,te.props),Z.ref=en(ee,Me,te),Z.return=ee,ee=Z;break e}s(ee,Me);break}else t(ee,Me);Me=Me.sibling}te.type===T?(Z=Wi(te.props.children,ee.mode,pe,te.key),Z.return=ee,ee=Z):(pe=Po(te.type,te.key,te.props,null,ee.mode,pe),pe.ref=en(ee,Z,te),pe.return=ee,ee=pe)}return F(ee);case L:e:{for(Me=te.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===te.containerInfo&&Z.stateNode.implementation===te.implementation){s(ee,Z.sibling),Z=m(Z,te.children||[]),Z.return=ee,ee=Z;break e}else{s(ee,Z);break}else t(ee,Z);Z=Z.sibling}Z=Gl(te,ee.mode,pe),Z.return=ee,ee=Z}return F(ee);case V:return Me=te._init,dt(ee,Z,Me(te._payload),pe)}if(_t(te))return Ce(ee,Z,te,pe);if(D(te))return be(ee,Z,te,pe);co(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,Z!==null&&Z.tag===6?(s(ee,Z.sibling),Z=m(Z,te),Z.return=ee,ee=Z):(s(ee,Z),Z=ql(te,ee.mode,pe),Z.return=ee,ee=Z),F(ee)):s(ee,Z)}return dt}var ps=Jh(!0),Qh=Jh(!1),ho=di(null),uo=null,vs=null,il=null;function sl(){il=vs=uo=null}function nl(e){var t=ho.current;et(ho),e._currentValue=t}function ol(e,t,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===s)break;e=e.return}}function gs(e,t){uo=e,il=vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(er=!0),e.firstContext=null)}function _r(e){var t=e._currentValue;if(il!==e)if(e={context:e,memoizedValue:t,next:null},vs===null){if(uo===null)throw Error(n(308));vs=e,uo.dependencies={lanes:0,firstContext:e}}else vs=vs.next=e;return t}var Ii=null;function al(e){Ii===null?Ii=[e]:Ii.push(e)}function Zh(e,t,s,o){var m=t.interleaved;return m===null?(s.next=s,al(t)):(s.next=m.next,m.next=s),t.interleaved=s,Wr(e,o)}function Wr(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var pi=!1;function ll(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eu(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 Vr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vi(e,t,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Ue&2)!==0){var m=o.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),o.pending=t,Wr(e,s)}return m=o.interleaved,m===null?(t.next=t,al(o)):(t.next=m.next,m.next=t),o.interleaved=t,Wr(e,s)}function fo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Ca(e,s)}}function tu(e,t){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var m=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var F={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};x===null?m=x=F:x=x.next=F,s=s.next}while(s!==null);x===null?m=x=t:x=x.next=t}else m=x=t;s={baseState:o.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:o.shared,effects:o.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function _o(e,t,s,o){var m=e.updateQueue;pi=!1;var x=m.firstBaseUpdate,F=m.lastBaseUpdate,G=m.shared.pending;if(G!==null){m.shared.pending=null;var J=G,ie=J.next;J.next=null,F===null?x=ie:F.next=ie,F=J;var de=e.alternate;de!==null&&(de=de.updateQueue,G=de.lastBaseUpdate,G!==F&&(G===null?de.firstBaseUpdate=ie:G.next=ie,de.lastBaseUpdate=J))}if(x!==null){var fe=m.baseState;F=0,de=ie=J=null,G=x;do{var he=G.lane,ye=G.eventTime;if((o&he)===he){de!==null&&(de=de.next={eventTime:ye,lane:0,tag:G.tag,payload:G.payload,callback:G.callback,next:null});e:{var Ce=e,be=G;switch(he=t,ye=s,be.tag){case 1:if(Ce=be.payload,typeof Ce=="function"){fe=Ce.call(ye,fe,he);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=be.payload,he=typeof Ce=="function"?Ce.call(ye,fe,he):Ce,he==null)break e;fe=O({},fe,he);break e;case 2:pi=!0}}G.callback!==null&&G.lane!==0&&(e.flags|=64,he=m.effects,he===null?m.effects=[G]:he.push(G))}else ye={eventTime:ye,lane:he,tag:G.tag,payload:G.payload,callback:G.callback,next:null},de===null?(ie=de=ye,J=fe):de=de.next=ye,F|=he;if(G=G.next,G===null){if(G=m.shared.pending,G===null)break;he=G,G=he.next,he.next=null,m.lastBaseUpdate=he,m.shared.pending=null}}while(!0);if(de===null&&(J=fe),m.baseState=J,m.firstBaseUpdate=ie,m.lastBaseUpdate=de,t=m.shared.interleaved,t!==null){m=t;do F|=m.lane,m=m.next;while(m!==t)}else x===null&&(m.shared.lanes=0);Hi|=F,e.lanes=F,e.memoizedState=fe}}function ru(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],m=o.callback;if(m!==null){if(o.callback=null,o=s,typeof m!="function")throw Error(n(191,m));m.call(o)}}}var tn={},Dr=di(tn),rn=di(tn),sn=di(tn);function Fi(e){if(e===tn)throw Error(n(174));return e}function cl(e,t){switch(Qe(sn,t),Qe(rn,e),Qe(Dr,tn),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:le(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=le(t,e)}et(Dr),Qe(Dr,t)}function ms(){et(Dr),et(rn),et(sn)}function iu(e){Fi(sn.current);var t=Fi(Dr.current),s=le(t,e.type);t!==s&&(Qe(rn,e),Qe(Dr,s))}function hl(e){rn.current===e&&(et(Dr),et(rn))}var ot=di(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)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 ul=[];function dl(){for(var e=0;e<ul.length;e++)ul[e]._workInProgressVersionPrimary=null;ul.length=0}var vo=v.ReactCurrentDispatcher,fl=v.ReactCurrentBatchConfig,ji=0,at=null,mt=null,Ct=null,go=!1,nn=!1,on=0,Hp=0;function Ht(){throw Error(n(321))}function _l(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Cr(e[s],t[s]))return!1;return!0}function pl(e,t,s,o,m,x){if(ji=x,at=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,vo.current=e===null||e.memoizedState===null?Wp:Vp,e=s(o,m),nn){x=0;do{if(nn=!1,on=0,25<=x)throw Error(n(301));x+=1,Ct=mt=null,t.updateQueue=null,vo.current=Kp,e=s(o,m)}while(nn)}if(vo.current=wo,t=mt!==null&&mt.next!==null,ji=0,Ct=mt=at=null,go=!1,t)throw Error(n(300));return e}function vl(){var e=on!==0;return on=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?at.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function pr(){if(mt===null){var e=at.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var t=Ct===null?at.memoizedState:Ct.next;if(t!==null)Ct=t,mt=e;else{if(e===null)throw Error(n(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Ct===null?at.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function an(e,t){return typeof t=="function"?t(e):t}function gl(e){var t=pr(),s=t.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=e;var o=mt,m=o.baseQueue,x=s.pending;if(x!==null){if(m!==null){var F=m.next;m.next=x.next,x.next=F}o.baseQueue=m=x,s.pending=null}if(m!==null){x=m.next,o=o.baseState;var G=F=null,J=null,ie=x;do{var de=ie.lane;if((ji&de)===de)J!==null&&(J=J.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),o=ie.hasEagerState?ie.eagerState:e(o,ie.action);else{var fe={lane:de,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};J===null?(G=J=fe,F=o):J=J.next=fe,at.lanes|=de,Hi|=de}ie=ie.next}while(ie!==null&&ie!==x);J===null?F=o:J.next=G,Cr(o,t.memoizedState)||(er=!0),t.memoizedState=o,t.baseState=F,t.baseQueue=J,s.lastRenderedState=o}if(e=s.interleaved,e!==null){m=e;do x=m.lane,at.lanes|=x,Hi|=x,m=m.next;while(m!==e)}else m===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function ml(e){var t=pr(),s=t.queue;if(s===null)throw Error(n(311));s.lastRenderedReducer=e;var o=s.dispatch,m=s.pending,x=t.memoizedState;if(m!==null){s.pending=null;var F=m=m.next;do x=e(x,F.action),F=F.next;while(F!==m);Cr(x,t.memoizedState)||(er=!0),t.memoizedState=x,t.baseQueue===null&&(t.baseState=x),s.lastRenderedState=x}return[x,o]}function su(){}function nu(e,t){var s=at,o=pr(),m=t(),x=!Cr(o.memoizedState,m);if(x&&(o.memoizedState=m,er=!0),o=o.queue,yl(lu.bind(null,s,o,e),[e]),o.getSnapshot!==t||x||Ct!==null&&Ct.memoizedState.tag&1){if(s.flags|=2048,ln(9,au.bind(null,s,o,m,t),void 0,null),xt===null)throw Error(n(349));(ji&30)!==0||ou(s,t,m)}return m}function ou(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=at.updateQueue,t===null?(t={lastEffect:null,stores:null},at.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function au(e,t,s,o){t.value=s,t.getSnapshot=o,cu(t)&&hu(e)}function lu(e,t,s){return s(function(){cu(t)&&hu(e)})}function cu(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Cr(e,s)}catch{return!0}}function hu(e){var t=Wr(e,1);t!==null&&kr(t,e,1,-1)}function uu(e){var t=Ar();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:an,lastRenderedState:e},t.queue=e,e=e.dispatch=Up.bind(null,at,e),[t.memoizedState,e]}function ln(e,t,s,o){return e={tag:e,create:t,destroy:s,deps:o,next:null},t=at.updateQueue,t===null?(t={lastEffect:null,stores:null},at.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,t.lastEffect=e)),e}function du(){return pr().memoizedState}function mo(e,t,s,o){var m=Ar();at.flags|=e,m.memoizedState=ln(1|t,s,void 0,o===void 0?null:o)}function yo(e,t,s,o){var m=pr();o=o===void 0?null:o;var x=void 0;if(mt!==null){var F=mt.memoizedState;if(x=F.destroy,o!==null&&_l(o,F.deps)){m.memoizedState=ln(t,s,x,o);return}}at.flags|=e,m.memoizedState=ln(1|t,s,x,o)}function fu(e,t){return mo(8390656,8,e,t)}function yl(e,t){return yo(2048,8,e,t)}function _u(e,t){return yo(4,2,e,t)}function pu(e,t){return yo(4,4,e,t)}function vu(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 gu(e,t,s){return s=s!=null?s.concat([e]):null,yo(4,4,vu.bind(null,t,e),s)}function wl(){}function mu(e,t){var s=pr();t=t===void 0?null:t;var o=s.memoizedState;return o!==null&&t!==null&&_l(t,o[1])?o[0]:(s.memoizedState=[e,t],e)}function yu(e,t){var s=pr();t=t===void 0?null:t;var o=s.memoizedState;return o!==null&&t!==null&&_l(t,o[1])?o[0]:(e=e(),s.memoizedState=[e,t],e)}function wu(e,t,s){return(ji&21)===0?(e.baseState&&(e.baseState=!1,er=!0),e.memoizedState=s):(Cr(s,t)||(s=Sr(),at.lanes|=s,Hi|=s,e.baseState=!0),t)}function $p(e,t){var s=qe;qe=s!==0&&4>s?s:4,e(!0);var o=fl.transition;fl.transition={};try{e(!1),t()}finally{qe=s,fl.transition=o}}function Su(){return pr().memoizedState}function zp(e,t,s){var o=wi(e);if(s={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null},Cu(e))xu(t,s);else if(s=Zh(e,t,s,o),s!==null){var m=Gt();kr(s,e,o,m),bu(s,t,o)}}function Up(e,t,s){var o=wi(e),m={lane:o,action:s,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))xu(t,m);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=t.lastRenderedReducer,x!==null))try{var F=t.lastRenderedState,G=x(F,s);if(m.hasEagerState=!0,m.eagerState=G,Cr(G,F)){var J=t.interleaved;J===null?(m.next=m,al(t)):(m.next=J.next,J.next=m),t.interleaved=m;return}}catch{}finally{}s=Zh(e,t,m,o),s!==null&&(m=Gt(),kr(s,e,o,m),bu(s,t,o))}}function Cu(e){var t=e.alternate;return e===at||t!==null&&t===at}function xu(e,t){nn=go=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function bu(e,t,s){if((s&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,s|=o,t.lanes=s,Ca(e,s)}}var wo={readContext:_r,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},Wp={readContext:_r,useCallback:function(e,t){return Ar().memoizedState=[e,t===void 0?null:t],e},useContext:_r,useEffect:fu,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,mo(4194308,4,vu.bind(null,t,e),s)},useLayoutEffect:function(e,t){return mo(4194308,4,e,t)},useInsertionEffect:function(e,t){return mo(4,2,e,t)},useMemo:function(e,t){var s=Ar();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var o=Ar();return t=s!==void 0?s(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=zp.bind(null,at,e),[o.memoizedState,e]},useRef:function(e){var t=Ar();return e={current:e},t.memoizedState=e},useState:uu,useDebugValue:wl,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=uu(!1),t=e[0];return e=$p.bind(null,e[1]),Ar().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var o=at,m=Ar();if(nt){if(s===void 0)throw Error(n(407));s=s()}else{if(s=t(),xt===null)throw Error(n(349));(ji&30)!==0||ou(o,t,s)}m.memoizedState=s;var x={value:s,getSnapshot:t};return m.queue=x,fu(lu.bind(null,o,x,e),[e]),o.flags|=2048,ln(9,au.bind(null,o,x,s,t),void 0,null),s},useId:function(){var e=Ar(),t=xt.identifierPrefix;if(nt){var s=Ur,o=zr;s=(o&~(1<<32-nr(o)-1)).toString(32)+s,t=":"+t+"R"+s,s=on++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=Hp++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vp={readContext:_r,useCallback:mu,useContext:_r,useEffect:yl,useImperativeHandle:gu,useInsertionEffect:_u,useLayoutEffect:pu,useMemo:yu,useReducer:gl,useRef:du,useState:function(){return gl(an)},useDebugValue:wl,useDeferredValue:function(e){var t=pr();return wu(t,mt.memoizedState,e)},useTransition:function(){var e=gl(an)[0],t=pr().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:nu,useId:Su,unstable_isNewReconciler:!1},Kp={readContext:_r,useCallback:mu,useContext:_r,useEffect:yl,useImperativeHandle:gu,useInsertionEffect:_u,useLayoutEffect:pu,useMemo:yu,useReducer:ml,useRef:du,useState:function(){return ml(an)},useDebugValue:wl,useDeferredValue:function(e){var t=pr();return mt===null?t.memoizedState=e:wu(t,mt.memoizedState,e)},useTransition:function(){var e=ml(an)[0],t=pr().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:nu,useId:Su,unstable_isNewReconciler:!1};function br(e,t){if(e&&e.defaultProps){t=O({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function Sl(e,t,s,o){t=e.memoizedState,s=s(o,t),s=s==null?t:O({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var So={isMounted:function(e){return(e=e._reactInternals)?Fr(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var o=Gt(),m=wi(e),x=Vr(o,m);x.payload=t,s!=null&&(x.callback=s),t=vi(e,x,m),t!==null&&(kr(t,e,m,o),fo(t,e,m))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var o=Gt(),m=wi(e),x=Vr(o,m);x.tag=1,x.payload=t,s!=null&&(x.callback=s),t=vi(e,x,m),t!==null&&(kr(t,e,m,o),fo(t,e,m))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Gt(),o=wi(e),m=Vr(s,o);m.tag=2,t!=null&&(m.callback=t),t=vi(e,m,o),t!==null&&(kr(t,e,o,s),fo(t,e,o))}};function Eu(e,t,s,o,m,x,F){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,x,F):t.prototype&&t.prototype.isPureReactComponent?!qs(s,o)||!qs(m,x):!0}function Lu(e,t,s){var o=!1,m=fi,x=t.contextType;return typeof x=="object"&&x!==null?x=_r(x):(m=Zt(t)?Pi:jt.current,o=t.contextTypes,x=(o=o!=null)?us(e,m):fi),t=new t(s,x),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=So,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=m,e.__reactInternalMemoizedMaskedChildContext=x),t}function ku(e,t,s,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,o),t.state!==e&&So.enqueueReplaceState(t,t.state,null)}function Cl(e,t,s,o){var m=e.stateNode;m.props=s,m.state=e.memoizedState,m.refs={},ll(e);var x=t.contextType;typeof x=="object"&&x!==null?m.context=_r(x):(x=Zt(t)?Pi:jt.current,m.context=us(e,x)),m.state=e.memoizedState,x=t.getDerivedStateFromProps,typeof x=="function"&&(Sl(e,t,x,s),m.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(t=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),t!==m.state&&So.enqueueReplaceState(m,m.state,null),_o(e,s,m,o),m.state=e.memoizedState),typeof m.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,t){try{var s="",o=t;do s+=oe(o),o=o.return;while(o);var m=s}catch(x){m=`
39
+ Error generating stack: `+x.message+`
40
+ `+x.stack}return{value:e,source:t,stack:m,digest:null}}function xl(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function bl(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var qp=typeof WeakMap=="function"?WeakMap:Map;function Ru(e,t,s){s=Vr(-1,s),s.tag=3,s.payload={element:null};var o=t.value;return s.callback=function(){Ro||(Ro=!0,jl=o),bl(e,t)},s}function Mu(e,t,s){s=Vr(-1,s),s.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var m=t.value;s.payload=function(){return o(m)},s.callback=function(){bl(e,t)}}var x=e.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(s.callback=function(){bl(e,t),typeof o!="function"&&(mi===null?mi=new Set([this]):mi.add(this));var F=t.stack;this.componentDidCatch(t.value,{componentStack:F!==null?F:""})}),s}function Tu(e,t,s){var o=e.pingCache;if(o===null){o=e.pingCache=new qp;var m=new Set;o.set(t,m)}else m=o.get(t),m===void 0&&(m=new Set,o.set(t,m));m.has(s)||(m.add(s),e=av.bind(null,e,t,s),t.then(e,e))}function Du(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 Au(e,t,s,o,m){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=Vr(-1,1),t.tag=2,vi(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=m,e)}var Gp=v.ReactCurrentOwner,er=!1;function qt(e,t,s,o){t.child=e===null?Qh(t,null,s,o):ps(t,e.child,s,o)}function Bu(e,t,s,o,m){s=s.render;var x=t.ref;return gs(t,m),o=pl(e,t,s,o,x,m),s=vl(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~m,Kr(e,t,m)):(nt&&s&&Qa(t),t.flags|=1,qt(e,t,o,m),t.child)}function Pu(e,t,s,o,m){if(e===null){var x=s.type;return typeof x=="function"&&!Kl(x)&&x.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=x,Ou(e,t,x,o,m)):(e=Po(s.type,null,o,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(x=e.child,(e.lanes&m)===0){var F=x.memoizedProps;if(s=s.compare,s=s!==null?s:qs,s(F,o)&&e.ref===t.ref)return Kr(e,t,m)}return t.flags|=1,e=Ci(x,o),e.ref=t.ref,e.return=t,t.child=e}function Ou(e,t,s,o,m){if(e!==null){var x=e.memoizedProps;if(qs(x,o)&&e.ref===t.ref)if(er=!1,t.pendingProps=o=x,(e.lanes&m)!==0)(e.flags&131072)!==0&&(er=!0);else return t.lanes=e.lanes,Kr(e,t,m)}return El(e,t,s,o,m)}function Nu(e,t,s){var o=t.pendingProps,m=o.children,x=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(Ss,cr),cr|=s;else{if((s&1073741824)===0)return e=x!==null?x.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Qe(Ss,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=x!==null?x.baseLanes:s,Qe(Ss,cr),cr|=o}else x!==null?(o=x.baseLanes|s,t.memoizedState=null):o=s,Qe(Ss,cr),cr|=o;return qt(e,t,m,s),t.child}function Iu(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function El(e,t,s,o,m){var x=Zt(s)?Pi:jt.current;return x=us(t,x),gs(t,m),s=pl(e,t,s,o,x,m),o=vl(),e!==null&&!er?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~m,Kr(e,t,m)):(nt&&o&&Qa(t),t.flags|=1,qt(e,t,s,m),t.child)}function Fu(e,t,s,o,m){if(Zt(s)){var x=!0;so(t)}else x=!1;if(gs(t,m),t.stateNode===null)xo(e,t),Lu(t,s,o),Cl(t,s,o,m),o=!0;else if(e===null){var F=t.stateNode,G=t.memoizedProps;F.props=G;var J=F.context,ie=s.contextType;typeof ie=="object"&&ie!==null?ie=_r(ie):(ie=Zt(s)?Pi:jt.current,ie=us(t,ie));var de=s.getDerivedStateFromProps,fe=typeof de=="function"||typeof F.getSnapshotBeforeUpdate=="function";fe||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(G!==o||J!==ie)&&ku(t,F,o,ie),pi=!1;var he=t.memoizedState;F.state=he,_o(t,o,F,m),J=t.memoizedState,G!==o||he!==J||Qt.current||pi?(typeof de=="function"&&(Sl(t,s,de,o),J=t.memoizedState),(G=pi||Eu(t,s,G,o,he,J,ie))?(fe||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(t.flags|=4194308)):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=J),F.props=o,F.state=J,F.context=ie,o=G):(typeof F.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{F=t.stateNode,eu(e,t),G=t.memoizedProps,ie=t.type===t.elementType?G:br(t.type,G),F.props=ie,fe=t.pendingProps,he=F.context,J=s.contextType,typeof J=="object"&&J!==null?J=_r(J):(J=Zt(s)?Pi:jt.current,J=us(t,J));var ye=s.getDerivedStateFromProps;(de=typeof ye=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(G!==fe||he!==J)&&ku(t,F,o,J),pi=!1,he=t.memoizedState,F.state=he,_o(t,o,F,m);var Ce=t.memoizedState;G!==fe||he!==Ce||Qt.current||pi?(typeof ye=="function"&&(Sl(t,s,ye,o),Ce=t.memoizedState),(ie=pi||Eu(t,s,ie,o,he,Ce,J)||!1)?(de||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(o,Ce,J),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(o,Ce,J)),typeof F.componentDidUpdate=="function"&&(t.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof F.componentDidUpdate!="function"||G===e.memoizedProps&&he===e.memoizedState||(t.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&he===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=Ce),F.props=o,F.state=Ce,F.context=J,o=ie):(typeof F.componentDidUpdate!="function"||G===e.memoizedProps&&he===e.memoizedState||(t.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||G===e.memoizedProps&&he===e.memoizedState||(t.flags|=1024),o=!1)}return Ll(e,t,s,o,x,m)}function Ll(e,t,s,o,m,x){Iu(e,t);var F=(t.flags&128)!==0;if(!o&&!F)return m&&Uh(t,s,!1),Kr(e,t,x);o=t.stateNode,Gp.current=t;var G=F&&typeof s.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&F?(t.child=ps(t,e.child,null,x),t.child=ps(t,null,G,x)):qt(e,t,G,x),t.memoizedState=o.state,m&&Uh(t,s,!0),t.child}function ju(e){var t=e.stateNode;t.pendingContext?$h(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$h(e,t.context,!1),cl(e,t.containerInfo)}function Hu(e,t,s,o,m){return _s(),rl(m),t.flags|=256,qt(e,t,s,o),t.child}var kl={dehydrated:null,treeContext:null,retryLane:0};function Rl(e){return{baseLanes:e,cachePool:null,transitions:null}}function $u(e,t,s){var o=t.pendingProps,m=ot.current,x=!1,F=(t.flags&128)!==0,G;if((G=F)||(G=e!==null&&e.memoizedState===null?!1:(m&2)!==0),G?(x=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(m|=1),Qe(ot,m&1),e===null)return tl(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(F=o.children,e=o.fallback,x?(o=t.mode,x=t.child,F={mode:"hidden",children:F},(o&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=F):x=Oo(F,o,0,null),e=Wi(e,o,s,null),x.return=t,e.return=t,x.sibling=e,t.child=x,t.child.memoizedState=Rl(s),t.memoizedState=kl,e):Ml(t,F));if(m=e.memoizedState,m!==null&&(G=m.dehydrated,G!==null))return Yp(e,t,F,o,G,m,s);if(x){x=o.fallback,F=t.mode,m=e.child,G=m.sibling;var J={mode:"hidden",children:o.children};return(F&1)===0&&t.child!==m?(o=t.child,o.childLanes=0,o.pendingProps=J,t.deletions=null):(o=Ci(m,J),o.subtreeFlags=m.subtreeFlags&14680064),G!==null?x=Ci(G,x):(x=Wi(x,F,s,null),x.flags|=2),x.return=t,o.return=t,o.sibling=x,t.child=o,o=x,x=t.child,F=e.child.memoizedState,F=F===null?Rl(s):{baseLanes:F.baseLanes|s,cachePool:null,transitions:F.transitions},x.memoizedState=F,x.childLanes=e.childLanes&~s,t.memoizedState=kl,o}return x=e.child,e=x.sibling,o=Ci(x,{mode:"visible",children:o.children}),(t.mode&1)===0&&(o.lanes=s),o.return=t,o.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=o,t.memoizedState=null,o}function Ml(e,t){return t=Oo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Co(e,t,s,o){return o!==null&&rl(o),ps(t,e.child,null,s),e=Ml(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Yp(e,t,s,o,m,x,F){if(s)return t.flags&256?(t.flags&=-257,o=xl(Error(n(422))),Co(e,t,F,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(x=o.fallback,m=t.mode,o=Oo({mode:"visible",children:o.children},m,0,null),x=Wi(x,m,F,null),x.flags|=2,o.return=t,x.return=t,o.sibling=x,t.child=o,(t.mode&1)!==0&&ps(t,e.child,null,F),t.child.memoizedState=Rl(F),t.memoizedState=kl,x);if((t.mode&1)===0)return Co(e,t,F,null);if(m.data==="$!"){if(o=m.nextSibling&&m.nextSibling.dataset,o)var G=o.dgst;return o=G,x=Error(n(419)),o=xl(x,o,void 0),Co(e,t,F,o)}if(G=(F&e.childLanes)!==0,er||G){if(o=xt,o!==null){switch(F&-F){case 4:m=2;break;case 16:m=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:m=32;break;case 536870912:m=268435456;break;default:m=0}m=(m&(o.suspendedLanes|F))!==0?0:m,m!==0&&m!==x.retryLane&&(x.retryLane=m,Wr(e,m),kr(o,e,m,-1))}return Vl(),o=xl(Error(n(421))),Co(e,t,F,o)}return m.data==="$?"?(t.flags|=128,t.child=e.child,t=lv.bind(null,e),m._reactRetry=t,null):(e=x.treeContext,lr=ui(m.nextSibling),ar=t,nt=!0,xr=null,e!==null&&(dr[fr++]=zr,dr[fr++]=Ur,dr[fr++]=Oi,zr=e.id,Ur=e.overflow,Oi=t),t=Ml(t,o.children),t.flags|=4096,t)}function zu(e,t,s){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),ol(e.return,t,s)}function Tl(e,t,s,o,m){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:m}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=o,x.tail=s,x.tailMode=m)}function Uu(e,t,s){var o=t.pendingProps,m=o.revealOrder,x=o.tail;if(qt(e,t,o.children,s),o=ot.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zu(e,s,t);else if(e.tag===19)zu(e,s,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}o&=1}if(Qe(ot,o),(t.mode&1)===0)t.memoizedState=null;else switch(m){case"forwards":for(s=t.child,m=null;s!==null;)e=s.alternate,e!==null&&po(e)===null&&(m=s),s=s.sibling;s=m,s===null?(m=t.child,t.child=null):(m=s.sibling,s.sibling=null),Tl(t,!1,m,s,x);break;case"backwards":for(s=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&po(e)===null){t.child=m;break}e=m.sibling,m.sibling=s,s=m,m=e}Tl(t,!0,s,null,x);break;case"together":Tl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kr(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Hi|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(n(153));if(t.child!==null){for(e=t.child,s=Ci(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ci(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Xp(e,t,s){switch(t.tag){case 3:ju(t),_s();break;case 5:iu(t);break;case 1:Zt(t.type)&&so(t);break;case 4:cl(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,m=t.memoizedProps.value;Qe(ho,o._currentValue),o._currentValue=m;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Qe(ot,ot.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?$u(e,t,s):(Qe(ot,ot.current&1),e=Kr(e,t,s),e!==null?e.sibling:null);Qe(ot,ot.current&1);break;case 19:if(o=(s&t.childLanes)!==0,(e.flags&128)!==0){if(o)return Uu(e,t,s);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Qe(ot,ot.current),o)break;return null;case 22:case 23:return t.lanes=0,Nu(e,t,s)}return Kr(e,t,s)}var Wu,Dl,Vu,Ku;Wu=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Dl=function(){},Vu=function(e,t,s,o){var m=e.memoizedProps;if(m!==o){e=t.stateNode,Fi(Dr.current);var x=null;switch(s){case"input":m=Se(e,m),o=Se(e,o),x=[];break;case"select":m=O({},m,{value:void 0}),o=O({},o,{value:void 0}),x=[];break;case"textarea":m=Ge(e,m),o=Ge(e,o),x=[];break;default:typeof m.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=to)}Pe(s,o);var F;s=null;for(ie in m)if(!o.hasOwnProperty(ie)&&m.hasOwnProperty(ie)&&m[ie]!=null)if(ie==="style"){var G=m[ie];for(F in G)G.hasOwnProperty(F)&&(s||(s={}),s[F]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(_.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in o){var J=o[ie];if(G=m!=null?m[ie]:void 0,o.hasOwnProperty(ie)&&J!==G&&(J!=null||G!=null))if(ie==="style")if(G){for(F in G)!G.hasOwnProperty(F)||J&&J.hasOwnProperty(F)||(s||(s={}),s[F]="");for(F in J)J.hasOwnProperty(F)&&G[F]!==J[F]&&(s||(s={}),s[F]=J[F])}else s||(x||(x=[]),x.push(ie,s)),s=J;else ie==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,G=G?G.__html:void 0,J!=null&&G!==J&&(x=x||[]).push(ie,J)):ie==="children"?typeof J!="string"&&typeof J!="number"||(x=x||[]).push(ie,""+J):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(_.hasOwnProperty(ie)?(J!=null&&ie==="onScroll"&&Ze("scroll",e),x||G===J||(x=[])):(x=x||[]).push(ie,J))}s&&(x=x||[]).push("style",s);var ie=x;(t.updateQueue=ie)&&(t.flags|=4)}},Ku=function(e,t,s,o){s!==o&&(t.flags|=4)};function cn(e,t){if(!nt)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function $t(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(t)for(var m=e.child;m!==null;)s|=m.lanes|m.childLanes,o|=m.subtreeFlags&14680064,o|=m.flags&14680064,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)s|=m.lanes|m.childLanes,o|=m.subtreeFlags,o|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=o,e.childLanes=s,t}function Jp(e,t,s){var o=t.pendingProps;switch(Za(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $t(t),null;case 1:return Zt(t.type)&&io(),$t(t),null;case 3:return o=t.stateNode,ms(),et(Qt),et(jt),dl(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(lo(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xr!==null&&(zl(xr),xr=null))),Dl(e,t),$t(t),null;case 5:hl(t);var m=Fi(sn.current);if(s=t.type,e!==null&&t.stateNode!=null)Vu(e,t,s,o,m),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(n(166));return $t(t),null}if(e=Fi(Dr.current),lo(t)){o=t.stateNode,s=t.type;var x=t.memoizedProps;switch(o[Tr]=t,o[Qs]=x,e=(t.mode&1)!==0,s){case"dialog":Ze("cancel",o),Ze("close",o);break;case"iframe":case"object":case"embed":Ze("load",o);break;case"video":case"audio":for(m=0;m<Ys.length;m++)Ze(Ys[m],o);break;case"source":Ze("error",o);break;case"img":case"image":case"link":Ze("error",o),Ze("load",o);break;case"details":Ze("toggle",o);break;case"input":$e(o,x),Ze("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!x.multiple},Ze("invalid",o);break;case"textarea":Ke(o,x),Ze("invalid",o)}Pe(s,x),m=null;for(var F in x)if(x.hasOwnProperty(F)){var G=x[F];F==="children"?typeof G=="string"?o.textContent!==G&&(x.suppressHydrationWarning!==!0&&eo(o.textContent,G,e),m=["children",G]):typeof G=="number"&&o.textContent!==""+G&&(x.suppressHydrationWarning!==!0&&eo(o.textContent,G,e),m=["children",""+G]):_.hasOwnProperty(F)&&G!=null&&F==="onScroll"&&Ze("scroll",o)}switch(s){case"input":ve(o),Xe(o,x,!0);break;case"textarea":ve(o),it(o);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(o.onclick=to)}o=m,t.updateQueue=o,o!==null&&(t.flags|=4)}else{F=m.nodeType===9?m:m.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ut(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=F.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=F.createElement(s,{is:o.is}):(e=F.createElement(s),s==="select"&&(F=e,o.multiple?F.multiple=!0:o.size&&(F.size=o.size))):e=F.createElementNS(e,s),e[Tr]=t,e[Qs]=o,Wu(e,t,!1,!1),t.stateNode=e;e:{switch(F=ze(s,o),s){case"dialog":Ze("cancel",e),Ze("close",e),m=o;break;case"iframe":case"object":case"embed":Ze("load",e),m=o;break;case"video":case"audio":for(m=0;m<Ys.length;m++)Ze(Ys[m],e);m=o;break;case"source":Ze("error",e),m=o;break;case"img":case"image":case"link":Ze("error",e),Ze("load",e),m=o;break;case"details":Ze("toggle",e),m=o;break;case"input":$e(e,o),m=Se(e,o),Ze("invalid",e);break;case"option":m=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},m=O({},o,{value:void 0}),Ze("invalid",e);break;case"textarea":Ke(e,o),m=Ge(e,o),Ze("invalid",e);break;default:m=o}Pe(s,m),G=m;for(x in G)if(G.hasOwnProperty(x)){var J=G[x];x==="style"?ge(e,J):x==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ee(e,J)):x==="children"?typeof J=="string"?(s!=="textarea"||J!=="")&&De(e,J):typeof J=="number"&&De(e,""+J):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(_.hasOwnProperty(x)?J!=null&&x==="onScroll"&&Ze("scroll",e):J!=null&&h(e,x,J,F))}switch(s){case"input":ve(e),Xe(e,o,!1);break;case"textarea":ve(e),it(e);break;case"option":o.value!=null&&e.setAttribute("value",""+j(o.value));break;case"select":e.multiple=!!o.multiple,x=o.value,x!=null?Ye(e,!!o.multiple,x,!1):o.defaultValue!=null&&Ye(e,!!o.multiple,o.defaultValue,!0);break;default:typeof m.onClick=="function"&&(e.onclick=to)}switch(s){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $t(t),null;case 6:if(e&&t.stateNode!=null)Ku(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(n(166));if(s=Fi(sn.current),Fi(Dr.current),lo(t)){if(o=t.stateNode,s=t.memoizedProps,o[Tr]=t,(x=o.nodeValue!==s)&&(e=ar,e!==null))switch(e.tag){case 3:eo(o.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&eo(o.nodeValue,s,(e.mode&1)!==0)}x&&(t.flags|=4)}else o=(s.nodeType===9?s:s.ownerDocument).createTextNode(o),o[Tr]=t,t.stateNode=o}return $t(t),null;case 13:if(et(ot),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(nt&&lr!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Yh(),_s(),t.flags|=98560,x=!1;else if(x=lo(t),o!==null&&o.dehydrated!==null){if(e===null){if(!x)throw Error(n(318));if(x=t.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[Tr]=t}else _s(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;$t(t),x=!1}else xr!==null&&(zl(xr),xr=null),x=!0;if(!x)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=s,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(ot.current&1)!==0?yt===0&&(yt=3):Vl())),t.updateQueue!==null&&(t.flags|=4),$t(t),null);case 4:return ms(),Dl(e,t),e===null&&Xs(t.stateNode.containerInfo),$t(t),null;case 10:return nl(t.type._context),$t(t),null;case 17:return Zt(t.type)&&io(),$t(t),null;case 19:if(et(ot),x=t.memoizedState,x===null)return $t(t),null;if(o=(t.flags&128)!==0,F=x.rendering,F===null)if(o)cn(x,!1);else{if(yt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(F=po(e),F!==null){for(t.flags|=128,cn(x,!1),o=F.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=s,s=t.child;s!==null;)x=s,e=o,x.flags&=14680066,F=x.alternate,F===null?(x.childLanes=0,x.lanes=e,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=F.childLanes,x.lanes=F.lanes,x.child=F.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=F.memoizedProps,x.memoizedState=F.memoizedState,x.updateQueue=F.updateQueue,x.type=F.type,e=F.dependencies,x.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Qe(ot,ot.current&1|2),t.child}e=e.sibling}x.tail!==null&&st()>Cs&&(t.flags|=128,o=!0,cn(x,!1),t.lanes=4194304)}else{if(!o)if(e=po(F),e!==null){if(t.flags|=128,o=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),cn(x,!0),x.tail===null&&x.tailMode==="hidden"&&!F.alternate&&!nt)return $t(t),null}else 2*st()-x.renderingStartTime>Cs&&s!==1073741824&&(t.flags|=128,o=!0,cn(x,!1),t.lanes=4194304);x.isBackwards?(F.sibling=t.child,t.child=F):(s=x.last,s!==null?s.sibling=F:t.child=F,x.last=F)}return x.tail!==null?(t=x.tail,x.rendering=t,x.tail=t.sibling,x.renderingStartTime=st(),t.sibling=null,s=ot.current,Qe(ot,o?s&1|2:s&1),t):($t(t),null);case 22:case 23:return Wl(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(cr&1073741824)!==0&&($t(t),t.subtreeFlags&6&&(t.flags|=8192)):$t(t),null;case 24:return null;case 25:return null}throw Error(n(156,t.tag))}function Qp(e,t){switch(Za(t),t.tag){case 1:return Zt(t.type)&&io(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ms(),et(Qt),et(jt),dl(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return hl(t),null;case 13:if(et(ot),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(n(340));_s()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return et(ot),null;case 4:return ms(),null;case 10:return nl(t.type._context),null;case 22:case 23:return Wl(),null;case 24:return null;default:return null}}var bo=!1,zt=!1,Zp=typeof WeakSet=="function"?WeakSet:Set,we=null;function ws(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(o){lt(e,t,o)}else s.current=null}function Al(e,t,s){try{s()}catch(o){lt(e,t,o)}}var qu=!1;function ev(e,t){if(Wa=Un,e=Eh(),Na(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var m=o.anchorOffset,x=o.focusNode;o=o.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var F=0,G=-1,J=-1,ie=0,de=0,fe=e,he=null;t:for(;;){for(var ye;fe!==s||m!==0&&fe.nodeType!==3||(G=F+m),fe!==x||o!==0&&fe.nodeType!==3||(J=F+o),fe.nodeType===3&&(F+=fe.nodeValue.length),(ye=fe.firstChild)!==null;)he=fe,fe=ye;for(;;){if(fe===e)break t;if(he===s&&++ie===m&&(G=F),he===x&&++de===o&&(J=F),(ye=fe.nextSibling)!==null)break;fe=he,he=fe.parentNode}fe=ye}s=G===-1||J===-1?null:{start:G,end:J}}else s=null}s=s||{start:0,end:0}}else s=null;for(Va={focusedElem:e,selectionRange:s},Un=!1,we=t;we!==null;)if(t=we,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,we=e;else for(;we!==null;){t=we;try{var Ce=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Ce!==null){var be=Ce.memoizedProps,dt=Ce.memoizedState,ee=t.stateNode,Z=ee.getSnapshotBeforeUpdate(t.elementType===t.type?be:br(t.type,be),dt);ee.__reactInternalSnapshotBeforeUpdate=Z}break;case 3:var te=t.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(pe){lt(t,t.return,pe)}if(e=t.sibling,e!==null){e.return=t.return,we=e;break}we=t.return}return Ce=qu,qu=!1,Ce}function hn(e,t,s){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var m=o=o.next;do{if((m.tag&e)===e){var x=m.destroy;m.destroy=void 0,x!==void 0&&Al(t,s,x)}m=m.next}while(m!==o)}}function Eo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var o=s.create;s.destroy=o()}s=s.next}while(s!==t)}}function Bl(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function Gu(e){var t=e.alternate;t!==null&&(e.alternate=null,Gu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tr],delete t[Qs],delete t[Ya],delete t[Np],delete t[Ip])),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 Yu(e){return e.tag===5||e.tag===3||e.tag===4}function Xu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yu(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 Pl(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=to));else if(o!==4&&(e=e.child,e!==null))for(Pl(e,t,s),e=e.sibling;e!==null;)Pl(e,t,s),e=e.sibling}function Ol(e,t,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(Ol(e,t,s),e=e.sibling;e!==null;)Ol(e,t,s),e=e.sibling}var Tt=null,Er=!1;function gi(e,t,s){for(s=s.child;s!==null;)Ju(e,t,s),s=s.sibling}function Ju(e,t,s){if(ur&&typeof ur.onCommitFiberUnmount=="function")try{ur.onCommitFiberUnmount(Zi,s)}catch{}switch(s.tag){case 5:zt||ws(s,t);case 6:var o=Tt,m=Er;Tt=null,gi(e,t,s),Tt=o,Er=m,Tt!==null&&(Er?(e=Tt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Tt.removeChild(s.stateNode));break;case 18:Tt!==null&&(Er?(e=Tt,s=s.stateNode,e.nodeType===8?Ga(e.parentNode,s):e.nodeType===1&&Ga(e,s),$s(e)):Ga(Tt,s.stateNode));break;case 4:o=Tt,m=Er,Tt=s.stateNode.containerInfo,Er=!0,gi(e,t,s),Tt=o,Er=m;break;case 0:case 11:case 14:case 15:if(!zt&&(o=s.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){m=o=o.next;do{var x=m,F=x.destroy;x=x.tag,F!==void 0&&((x&2)!==0||(x&4)!==0)&&Al(s,t,F),m=m.next}while(m!==o)}gi(e,t,s);break;case 1:if(!zt&&(ws(s,t),o=s.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=s.memoizedProps,o.state=s.memoizedState,o.componentWillUnmount()}catch(G){lt(s,t,G)}gi(e,t,s);break;case 21:gi(e,t,s);break;case 22:s.mode&1?(zt=(o=zt)||s.memoizedState!==null,gi(e,t,s),zt=o):gi(e,t,s);break;default:gi(e,t,s)}}function Qu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new Zp),t.forEach(function(o){var m=cv.bind(null,e,o);s.has(o)||(s.add(o),o.then(m,m))})}}function Lr(e,t){var s=t.deletions;if(s!==null)for(var o=0;o<s.length;o++){var m=s[o];try{var x=e,F=t,G=F;e:for(;G!==null;){switch(G.tag){case 5:Tt=G.stateNode,Er=!1;break e;case 3:Tt=G.stateNode.containerInfo,Er=!0;break e;case 4:Tt=G.stateNode.containerInfo,Er=!0;break e}G=G.return}if(Tt===null)throw Error(n(160));Ju(x,F,m),Tt=null,Er=!1;var J=m.alternate;J!==null&&(J.return=null),m.return=null}catch(ie){lt(m,t,ie)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Zu(t,e),t=t.sibling}function Zu(e,t){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Lr(t,e),Br(e),o&4){try{hn(3,e,e.return),Eo(3,e)}catch(be){lt(e,e.return,be)}try{hn(5,e,e.return)}catch(be){lt(e,e.return,be)}}break;case 1:Lr(t,e),Br(e),o&512&&s!==null&&ws(s,s.return);break;case 5:if(Lr(t,e),Br(e),o&512&&s!==null&&ws(s,s.return),e.flags&32){var m=e.stateNode;try{De(m,"")}catch(be){lt(e,e.return,be)}}if(o&4&&(m=e.stateNode,m!=null)){var x=e.memoizedProps,F=s!==null?s.memoizedProps:x,G=e.type,J=e.updateQueue;if(e.updateQueue=null,J!==null)try{G==="input"&&x.type==="radio"&&x.name!=null&&je(m,x),ze(G,F);var ie=ze(G,x);for(F=0;F<J.length;F+=2){var de=J[F],fe=J[F+1];de==="style"?ge(m,fe):de==="dangerouslySetInnerHTML"?Ee(m,fe):de==="children"?De(m,fe):h(m,de,fe,ie)}switch(G){case"input":xe(m,x);break;case"textarea":Ft(m,x);break;case"select":var he=m._wrapperState.wasMultiple;m._wrapperState.wasMultiple=!!x.multiple;var ye=x.value;ye!=null?Ye(m,!!x.multiple,ye,!1):he!==!!x.multiple&&(x.defaultValue!=null?Ye(m,!!x.multiple,x.defaultValue,!0):Ye(m,!!x.multiple,x.multiple?[]:"",!1))}m[Qs]=x}catch(be){lt(e,e.return,be)}}break;case 6:if(Lr(t,e),Br(e),o&4){if(e.stateNode===null)throw Error(n(162));m=e.stateNode,x=e.memoizedProps;try{m.nodeValue=x}catch(be){lt(e,e.return,be)}}break;case 3:if(Lr(t,e),Br(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{$s(t.containerInfo)}catch(be){lt(e,e.return,be)}break;case 4:Lr(t,e),Br(e);break;case 13:Lr(t,e),Br(e),m=e.child,m.flags&8192&&(x=m.memoizedState!==null,m.stateNode.isHidden=x,!x||m.alternate!==null&&m.alternate.memoizedState!==null||(Fl=st())),o&4&&Qu(e);break;case 22:if(de=s!==null&&s.memoizedState!==null,e.mode&1?(zt=(ie=zt)||de,Lr(t,e),zt=ie):Lr(t,e),Br(e),o&8192){if(ie=e.memoizedState!==null,(e.stateNode.isHidden=ie)&&!de&&(e.mode&1)!==0)for(we=e,de=e.child;de!==null;){for(fe=we=de;we!==null;){switch(he=we,ye=he.child,he.tag){case 0:case 11:case 14:case 15:hn(4,he,he.return);break;case 1:ws(he,he.return);var Ce=he.stateNode;if(typeof Ce.componentWillUnmount=="function"){o=he,s=he.return;try{t=o,Ce.props=t.memoizedProps,Ce.state=t.memoizedState,Ce.componentWillUnmount()}catch(be){lt(o,s,be)}}break;case 5:ws(he,he.return);break;case 22:if(he.memoizedState!==null){rd(fe);continue}}ye!==null?(ye.return=he,we=ye):rd(fe)}de=de.sibling}e:for(de=null,fe=e;;){if(fe.tag===5){if(de===null){de=fe;try{m=fe.stateNode,ie?(x=m.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(G=fe.stateNode,J=fe.memoizedProps.style,F=J!=null&&J.hasOwnProperty("display")?J.display:null,G.style.display=Wt("display",F))}catch(be){lt(e,e.return,be)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=ie?"":fe.memoizedProps}catch(be){lt(e,e.return,be)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===e)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===e)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===e)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Lr(t,e),Br(e),o&4&&Qu(e);break;case 21:break;default:Lr(t,e),Br(e)}}function Br(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(Yu(s)){var o=s;break e}s=s.return}throw Error(n(160))}switch(o.tag){case 5:var m=o.stateNode;o.flags&32&&(De(m,""),o.flags&=-33);var x=Xu(e);Ol(e,x,m);break;case 3:case 4:var F=o.stateNode.containerInfo,G=Xu(e);Pl(e,G,F);break;default:throw Error(n(161))}}catch(J){lt(e,e.return,J)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tv(e,t,s){we=e,ed(e)}function ed(e,t,s){for(var o=(e.mode&1)!==0;we!==null;){var m=we,x=m.child;if(m.tag===22&&o){var F=m.memoizedState!==null||bo;if(!F){var G=m.alternate,J=G!==null&&G.memoizedState!==null||zt;G=bo;var ie=zt;if(bo=F,(zt=J)&&!ie)for(we=m;we!==null;)F=we,J=F.child,F.tag===22&&F.memoizedState!==null?id(m):J!==null?(J.return=F,we=J):id(m);for(;x!==null;)we=x,ed(x),x=x.sibling;we=m,bo=G,zt=ie}td(e)}else(m.subtreeFlags&8772)!==0&&x!==null?(x.return=m,we=x):td(e)}}function td(e){for(;we!==null;){var t=we;if((t.flags&8772)!==0){var s=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:zt||Eo(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!zt)if(s===null)o.componentDidMount();else{var m=t.elementType===t.type?s.memoizedProps:br(t.type,s.memoizedProps);o.componentDidUpdate(m,s.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var x=t.updateQueue;x!==null&&ru(t,x,o);break;case 3:var F=t.updateQueue;if(F!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}ru(t,F,s)}break;case 5:var G=t.stateNode;if(s===null&&t.flags&4){s=G;var J=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&s.focus();break;case"img":J.src&&(s.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var ie=t.alternate;if(ie!==null){var de=ie.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&$s(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}zt||t.flags&512&&Bl(t)}catch(he){lt(t,t.return,he)}}if(t===e){we=null;break}if(s=t.sibling,s!==null){s.return=t.return,we=s;break}we=t.return}}function rd(e){for(;we!==null;){var t=we;if(t===e){we=null;break}var s=t.sibling;if(s!==null){s.return=t.return,we=s;break}we=t.return}}function id(e){for(;we!==null;){var t=we;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{Eo(4,t)}catch(J){lt(t,s,J)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var m=t.return;try{o.componentDidMount()}catch(J){lt(t,m,J)}}var x=t.return;try{Bl(t)}catch(J){lt(t,x,J)}break;case 5:var F=t.return;try{Bl(t)}catch(J){lt(t,F,J)}}}catch(J){lt(t,t.return,J)}if(t===e){we=null;break}var G=t.sibling;if(G!==null){G.return=t.return,we=G;break}we=t.return}}var rv=Math.ceil,Lo=v.ReactCurrentDispatcher,Nl=v.ReactCurrentOwner,vr=v.ReactCurrentBatchConfig,Ue=0,xt=null,pt=null,Dt=0,cr=0,Ss=di(0),yt=0,un=null,Hi=0,ko=0,Il=0,dn=null,tr=null,Fl=0,Cs=1/0,qr=null,Ro=!1,jl=null,mi=null,Mo=!1,yi=null,To=0,fn=0,Hl=null,Do=-1,Ao=0;function Gt(){return(Ue&6)!==0?st():Do!==-1?Do:Do=st()}function wi(e){return(e.mode&1)===0?1:(Ue&2)!==0&&Dt!==0?Dt&-Dt:jp.transition!==null?(Ao===0&&(Ao=Sr()),Ao):(e=qe,e!==0||(e=window.event,e=e===void 0?16:nh(e.type)),e)}function kr(e,t,s,o){if(50<fn)throw fn=0,Hl=null,Error(n(185));jr(e,s,o),((Ue&2)===0||e!==xt)&&(e===xt&&((Ue&2)===0&&(ko|=s),yt===4&&Si(e,Dt)),rr(e,o),s===1&&Ue===0&&(t.mode&1)===0&&(Cs=st()+500,no&&_i()))}function rr(e,t){var s=e.callbackNode;Ie(e,t);var o=ae(e,e===xt?Dt:0);if(o===0)s!==null&&Fn(s),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(s!=null&&Fn(s),t===1)e.tag===0?Fp(nd.bind(null,e)):Wh(nd.bind(null,e)),Pp(function(){(Ue&6)===0&&_i()}),s=null;else{switch(Jc(o)){case 1:s=Ns;break;case 4:s=jn;break;case 16:s=Di;break;case 536870912:s=Hn;break;default:s=Di}s=fd(s,sd.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function sd(e,t){if(Do=-1,Ao=0,(Ue&6)!==0)throw Error(n(327));var s=e.callbackNode;if(xs()&&e.callbackNode!==s)return null;var o=ae(e,e===xt?Dt:0);if(o===0)return null;if((o&30)!==0||(o&e.expiredLanes)!==0||t)t=Bo(e,o);else{t=o;var m=Ue;Ue|=2;var x=ad();(xt!==e||Dt!==t)&&(qr=null,Cs=st()+500,zi(e,t));do try{nv();break}catch(G){od(e,G)}while(!0);sl(),Lo.current=x,Ue=m,pt!==null?t=0:(xt=null,Dt=0,t=yt)}if(t!==0){if(t===2&&(m=Oe(e),m!==0&&(o=m,t=$l(e,m))),t===1)throw s=un,zi(e,0),Si(e,o),rr(e,st()),s;if(t===6)Si(e,o);else{if(m=e.current.alternate,(o&30)===0&&!iv(m)&&(t=Bo(e,o),t===2&&(x=Oe(e),x!==0&&(o=x,t=$l(e,x))),t===1))throw s=un,zi(e,0),Si(e,o),rr(e,st()),s;switch(e.finishedWork=m,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:Ui(e,tr,qr);break;case 3:if(Si(e,o),(o&130023424)===o&&(t=Fl+500-st(),10<t)){if(ae(e,0)!==0)break;if(m=e.suspendedLanes,(m&o)!==o){Gt(),e.pingedLanes|=e.suspendedLanes&m;break}e.timeoutHandle=qa(Ui.bind(null,e,tr,qr),t);break}Ui(e,tr,qr);break;case 4:if(Si(e,o),(o&4194240)===o)break;for(t=e.eventTimes,m=-1;0<o;){var F=31-nr(o);x=1<<F,F=t[F],F>m&&(m=F),o&=~x}if(o=m,o=st()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*rv(o/1960))-o,10<o){e.timeoutHandle=qa(Ui.bind(null,e,tr,qr),o);break}Ui(e,tr,qr);break;case 5:Ui(e,tr,qr);break;default:throw Error(n(329))}}}return rr(e,st()),e.callbackNode===s?sd.bind(null,e):null}function $l(e,t){var s=dn;return e.current.memoizedState.isDehydrated&&(zi(e,t).flags|=256),e=Bo(e,t),e!==2&&(t=tr,tr=s,t!==null&&zl(t)),e}function zl(e){tr===null?tr=e:tr.push.apply(tr,e)}function iv(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var o=0;o<s.length;o++){var m=s[o],x=m.getSnapshot;m=m.value;try{if(!Cr(x(),m))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Si(e,t){for(t&=~Il,t&=~ko,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-nr(t),o=1<<s;e[s]=-1,t&=~o}}function nd(e){if((Ue&6)!==0)throw Error(n(327));xs();var t=ae(e,0);if((t&1)===0)return rr(e,st()),null;var s=Bo(e,t);if(e.tag!==0&&s===2){var o=Oe(e);o!==0&&(t=o,s=$l(e,o))}if(s===1)throw s=un,zi(e,0),Si(e,t),rr(e,st()),s;if(s===6)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ui(e,tr,qr),rr(e,st()),null}function Ul(e,t){var s=Ue;Ue|=1;try{return e(t)}finally{Ue=s,Ue===0&&(Cs=st()+500,no&&_i())}}function $i(e){yi!==null&&yi.tag===0&&(Ue&6)===0&&xs();var t=Ue;Ue|=1;var s=vr.transition,o=qe;try{if(vr.transition=null,qe=1,e)return e()}finally{qe=o,vr.transition=s,Ue=t,(Ue&6)===0&&_i()}}function Wl(){cr=Ss.current,et(Ss)}function zi(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,Bp(s)),pt!==null)for(s=pt.return;s!==null;){var o=s;switch(Za(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&io();break;case 3:ms(),et(Qt),et(jt),dl();break;case 5:hl(o);break;case 4:ms();break;case 13:et(ot);break;case 19:et(ot);break;case 10:nl(o.type._context);break;case 22:case 23:Wl()}s=s.return}if(xt=e,pt=e=Ci(e.current,null),Dt=cr=t,yt=0,un=null,Il=ko=Hi=0,tr=dn=null,Ii!==null){for(t=0;t<Ii.length;t++)if(s=Ii[t],o=s.interleaved,o!==null){s.interleaved=null;var m=o.next,x=s.pending;if(x!==null){var F=x.next;x.next=m,o.next=F}s.pending=o}Ii=null}return e}function od(e,t){do{var s=pt;try{if(sl(),vo.current=wo,go){for(var o=at.memoizedState;o!==null;){var m=o.queue;m!==null&&(m.pending=null),o=o.next}go=!1}if(ji=0,Ct=mt=at=null,nn=!1,on=0,Nl.current=null,s===null||s.return===null){yt=1,un=t,pt=null;break}e:{var x=e,F=s.return,G=s,J=t;if(t=Dt,G.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ie=J,de=G,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var he=de.alternate;he?(de.updateQueue=he.updateQueue,de.memoizedState=he.memoizedState,de.lanes=he.lanes):(de.updateQueue=null,de.memoizedState=null)}var ye=Du(F);if(ye!==null){ye.flags&=-257,Au(ye,F,G,x,t),ye.mode&1&&Tu(x,ie,t),t=ye,J=ie;var Ce=t.updateQueue;if(Ce===null){var be=new Set;be.add(J),t.updateQueue=be}else Ce.add(J);break e}else{if((t&1)===0){Tu(x,ie,t),Vl();break e}J=Error(n(426))}}else if(nt&&G.mode&1){var dt=Du(F);if(dt!==null){(dt.flags&65536)===0&&(dt.flags|=256),Au(dt,F,G,x,t),rl(ys(J,G));break e}}x=J=ys(J,G),yt!==4&&(yt=2),dn===null?dn=[x]:dn.push(x),x=F;do{switch(x.tag){case 3:x.flags|=65536,t&=-t,x.lanes|=t;var ee=Ru(x,J,t);tu(x,ee);break e;case 1:G=J;var Z=x.type,te=x.stateNode;if((x.flags&128)===0&&(typeof Z.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(mi===null||!mi.has(te)))){x.flags|=65536,t&=-t,x.lanes|=t;var pe=Mu(x,G,t);tu(x,pe);break e}}x=x.return}while(x!==null)}cd(s)}catch(Le){t=Le,pt===s&&s!==null&&(pt=s=s.return);continue}break}while(!0)}function ad(){var e=Lo.current;return Lo.current=wo,e===null?wo:e}function Vl(){(yt===0||yt===3||yt===2)&&(yt=4),xt===null||(Hi&268435455)===0&&(ko&268435455)===0||Si(xt,Dt)}function Bo(e,t){var s=Ue;Ue|=2;var o=ad();(xt!==e||Dt!==t)&&(qr=null,zi(e,t));do try{sv();break}catch(m){od(e,m)}while(!0);if(sl(),Ue=s,Lo.current=o,pt!==null)throw Error(n(261));return xt=null,Dt=0,yt}function sv(){for(;pt!==null;)ld(pt)}function nv(){for(;pt!==null&&!_a();)ld(pt)}function ld(e){var t=dd(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?cd(e):pt=t,Nl.current=null}function cd(e){var t=e;do{var s=t.alternate;if(e=t.return,(t.flags&32768)===0){if(s=Jp(s,t,cr),s!==null){pt=s;return}}else{if(s=Qp(s,t),s!==null){s.flags&=32767,pt=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{yt=6,pt=null;return}}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);yt===0&&(yt=5)}function Ui(e,t,s){var o=qe,m=vr.transition;try{vr.transition=null,qe=1,ov(e,t,s,o)}finally{vr.transition=m,qe=o}return null}function ov(e,t,s,o){do xs();while(yi!==null);if((Ue&6)!==0)throw Error(n(327));s=e.finishedWork;var m=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var x=s.lanes|s.childLanes;if(si(e,x),e===xt&&(pt=xt=null,Dt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Mo||(Mo=!0,fd(Di,function(){return xs(),null})),x=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||x){x=vr.transition,vr.transition=null;var F=qe;qe=1;var G=Ue;Ue|=4,Nl.current=null,ev(e,s),Zu(s,e),Lp(Va),Un=!!Wa,Va=Wa=null,e.current=s,tv(s),pa(),Ue=G,qe=F,vr.transition=x}else e.current=s;if(Mo&&(Mo=!1,yi=e,To=m),x=e.pendingLanes,x===0&&(mi=null),ma(s.stateNode),rr(e,st()),t!==null)for(o=e.onRecoverableError,s=0;s<t.length;s++)m=t[s],o(m.value,{componentStack:m.stack,digest:m.digest});if(Ro)throw Ro=!1,e=jl,jl=null,e;return(To&1)!==0&&e.tag!==0&&xs(),x=e.pendingLanes,(x&1)!==0?e===Hl?fn++:(fn=0,Hl=e):fn=0,_i(),null}function xs(){if(yi!==null){var e=Jc(To),t=vr.transition,s=qe;try{if(vr.transition=null,qe=16>e?16:e,yi===null)var o=!1;else{if(e=yi,yi=null,To=0,(Ue&6)!==0)throw Error(n(331));var m=Ue;for(Ue|=4,we=e.current;we!==null;){var x=we,F=x.child;if((we.flags&16)!==0){var G=x.deletions;if(G!==null){for(var J=0;J<G.length;J++){var ie=G[J];for(we=ie;we!==null;){var de=we;switch(de.tag){case 0:case 11:case 15:hn(8,de,x)}var fe=de.child;if(fe!==null)fe.return=de,we=fe;else for(;we!==null;){de=we;var he=de.sibling,ye=de.return;if(Gu(de),de===ie){we=null;break}if(he!==null){he.return=ye,we=he;break}we=ye}}}var Ce=x.alternate;if(Ce!==null){var be=Ce.child;if(be!==null){Ce.child=null;do{var dt=be.sibling;be.sibling=null,be=dt}while(be!==null)}}we=x}}if((x.subtreeFlags&2064)!==0&&F!==null)F.return=x,we=F;else e:for(;we!==null;){if(x=we,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:hn(9,x,x.return)}var ee=x.sibling;if(ee!==null){ee.return=x.return,we=ee;break e}we=x.return}}var Z=e.current;for(we=Z;we!==null;){F=we;var te=F.child;if((F.subtreeFlags&2064)!==0&&te!==null)te.return=F,we=te;else e:for(F=Z;we!==null;){if(G=we,(G.flags&2048)!==0)try{switch(G.tag){case 0:case 11:case 15:Eo(9,G)}}catch(Le){lt(G,G.return,Le)}if(G===F){we=null;break e}var pe=G.sibling;if(pe!==null){pe.return=G.return,we=pe;break e}we=G.return}}if(Ue=m,_i(),ur&&typeof ur.onPostCommitFiberRoot=="function")try{ur.onPostCommitFiberRoot(Zi,e)}catch{}o=!0}return o}finally{qe=s,vr.transition=t}}return!1}function hd(e,t,s){t=ys(s,t),t=Ru(e,t,1),e=vi(e,t,1),t=Gt(),e!==null&&(jr(e,1,t),rr(e,t))}function lt(e,t,s){if(e.tag===3)hd(e,e,s);else for(;t!==null;){if(t.tag===3){hd(t,e,s);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(mi===null||!mi.has(o))){e=ys(s,e),e=Mu(t,e,1),t=vi(t,e,1),e=Gt(),t!==null&&(jr(t,1,e),rr(t,e));break}}t=t.return}}function av(e,t,s){var o=e.pingCache;o!==null&&o.delete(t),t=Gt(),e.pingedLanes|=e.suspendedLanes&s,xt===e&&(Dt&s)===s&&(yt===4||yt===3&&(Dt&130023424)===Dt&&500>st()-Fl?zi(e,0):Il|=s),rr(e,t)}function ud(e,t){t===0&&((e.mode&1)===0?t=1:(t=ts,ts<<=1,(ts&130023424)===0&&(ts=4194304)));var s=Gt();e=Wr(e,t),e!==null&&(jr(e,t,s),rr(e,s))}function lv(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),ud(e,s)}function cv(e,t){var s=0;switch(e.tag){case 13:var o=e.stateNode,m=e.memoizedState;m!==null&&(s=m.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}o!==null&&o.delete(t),ud(e,s)}var dd;dd=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qt.current)er=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return er=!1,Xp(e,t,s);er=(e.flags&131072)!==0}else er=!1,nt&&(t.flags&1048576)!==0&&Vh(t,ao,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;xo(e,t),e=t.pendingProps;var m=us(t,jt.current);gs(t,s),m=pl(null,t,o,e,m,s);var x=vl();return t.flags|=1,typeof m=="object"&&m!==null&&typeof m.render=="function"&&m.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Zt(o)?(x=!0,so(t)):x=!1,t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,ll(t),m.updater=So,t.stateNode=m,m._reactInternals=t,Cl(t,o,e,s),t=Ll(null,t,o,!0,x,s)):(t.tag=0,nt&&x&&Qa(t),qt(null,t,m,s),t=t.child),t;case 16:o=t.elementType;e:{switch(xo(e,t),e=t.pendingProps,m=o._init,o=m(o._payload),t.type=o,m=t.tag=uv(o),e=br(o,e),m){case 0:t=El(null,t,o,e,s);break e;case 1:t=Fu(null,t,o,e,s);break e;case 11:t=Bu(null,t,o,e,s);break e;case 14:t=Pu(null,t,o,br(o.type,e),s);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,m=t.pendingProps,m=t.elementType===o?m:br(o,m),El(e,t,o,m,s);case 1:return o=t.type,m=t.pendingProps,m=t.elementType===o?m:br(o,m),Fu(e,t,o,m,s);case 3:e:{if(ju(t),e===null)throw Error(n(387));o=t.pendingProps,x=t.memoizedState,m=x.element,eu(e,t),_o(t,o,null,s);var F=t.memoizedState;if(o=F.element,x.isDehydrated)if(x={element:o,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},t.updateQueue.baseState=x,t.memoizedState=x,t.flags&256){m=ys(Error(n(423)),t),t=Hu(e,t,o,s,m);break e}else if(o!==m){m=ys(Error(n(424)),t),t=Hu(e,t,o,s,m);break e}else for(lr=ui(t.stateNode.containerInfo.firstChild),ar=t,nt=!0,xr=null,s=Qh(t,null,o,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(_s(),o===m){t=Kr(e,t,s);break e}qt(e,t,o,s)}t=t.child}return t;case 5:return iu(t),e===null&&tl(t),o=t.type,m=t.pendingProps,x=e!==null?e.memoizedProps:null,F=m.children,Ka(o,m)?F=null:x!==null&&Ka(o,x)&&(t.flags|=32),Iu(e,t),qt(e,t,F,s),t.child;case 6:return e===null&&tl(t),null;case 13:return $u(e,t,s);case 4:return cl(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=ps(t,null,o,s):qt(e,t,o,s),t.child;case 11:return o=t.type,m=t.pendingProps,m=t.elementType===o?m:br(o,m),Bu(e,t,o,m,s);case 7:return qt(e,t,t.pendingProps,s),t.child;case 8:return qt(e,t,t.pendingProps.children,s),t.child;case 12:return qt(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(o=t.type._context,m=t.pendingProps,x=t.memoizedProps,F=m.value,Qe(ho,o._currentValue),o._currentValue=F,x!==null)if(Cr(x.value,F)){if(x.children===m.children&&!Qt.current){t=Kr(e,t,s);break e}}else for(x=t.child,x!==null&&(x.return=t);x!==null;){var G=x.dependencies;if(G!==null){F=x.child;for(var J=G.firstContext;J!==null;){if(J.context===o){if(x.tag===1){J=Vr(-1,s&-s),J.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var de=ie.pending;de===null?J.next=J:(J.next=de.next,de.next=J),ie.pending=J}}x.lanes|=s,J=x.alternate,J!==null&&(J.lanes|=s),ol(x.return,s,t),G.lanes|=s;break}J=J.next}}else if(x.tag===10)F=x.type===t.type?null:x.child;else if(x.tag===18){if(F=x.return,F===null)throw Error(n(341));F.lanes|=s,G=F.alternate,G!==null&&(G.lanes|=s),ol(F,s,t),F=x.sibling}else F=x.child;if(F!==null)F.return=x;else for(F=x;F!==null;){if(F===t){F=null;break}if(x=F.sibling,x!==null){x.return=F.return,F=x;break}F=F.return}x=F}qt(e,t,m.children,s),t=t.child}return t;case 9:return m=t.type,o=t.pendingProps.children,gs(t,s),m=_r(m),o=o(m),t.flags|=1,qt(e,t,o,s),t.child;case 14:return o=t.type,m=br(o,t.pendingProps),m=br(o.type,m),Pu(e,t,o,m,s);case 15:return Ou(e,t,t.type,t.pendingProps,s);case 17:return o=t.type,m=t.pendingProps,m=t.elementType===o?m:br(o,m),xo(e,t),t.tag=1,Zt(o)?(e=!0,so(t)):e=!1,gs(t,s),Lu(t,o,m),Cl(t,o,m,s),Ll(null,t,o,!0,e,s);case 19:return Uu(e,t,s);case 22:return Nu(e,t,s)}throw Error(n(156,t.tag))};function fd(e,t){return In(e,t)}function hv(e,t,s,o){this.tag=e,this.key=s,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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gr(e,t,s,o){return new hv(e,t,s,o)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function uv(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===I)return 11;if(e===$)return 14}return 2}function Ci(e,t){var s=e.alternate;return s===null?(s=gr(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Po(e,t,s,o,m,x){var F=2;if(o=e,typeof e=="function")Kl(e)&&(F=1);else if(typeof e=="string")F=5;else e:switch(e){case T:return Wi(s.children,m,x,t);case E:F=8,m|=8;break;case N:return e=gr(12,s,t,m|2),e.elementType=N,e.lanes=x,e;case B:return e=gr(13,s,t,m),e.elementType=B,e.lanes=x,e;case U:return e=gr(19,s,t,m),e.elementType=U,e.lanes=x,e;case X:return Oo(s,m,x,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case W:F=10;break e;case K:F=9;break e;case I:F=11;break e;case $:F=14;break e;case V:F=16,o=null;break e}throw Error(n(130,e==null?e:typeof e,""))}return t=gr(F,s,t,m),t.elementType=e,t.type=o,t.lanes=x,t}function Wi(e,t,s,o){return e=gr(7,e,o,t),e.lanes=s,e}function Oo(e,t,s,o){return e=gr(22,e,o,t),e.elementType=X,e.lanes=s,e.stateNode={isHidden:!1},e}function ql(e,t,s){return e=gr(6,e,null,t),e.lanes=s,e}function Gl(e,t,s){return t=gr(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function dv(e,t,s,o,m){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=ii(0),this.expirationTimes=ii(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ii(0),this.identifierPrefix=o,this.onRecoverableError=m,this.mutableSourceEagerHydrationData=null}function Yl(e,t,s,o,m,x,F,G,J){return e=new dv(e,t,s,G,J),t===1?(t=1,x===!0&&(t|=8)):t=0,x=gr(3,null,null,t),e.current=x,x.stateNode=e,x.memoizedState={element:o,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},ll(x),e}function fv(e,t,s){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:o==null?null:""+o,children:e,containerInfo:t,implementation:s}}function _d(e){if(!e)return fi;e=e._reactInternals;e:{if(Fr(e)!==e||e.tag!==1)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Zt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(n(171))}if(e.tag===1){var s=e.type;if(Zt(s))return zh(e,s,t)}return t}function pd(e,t,s,o,m,x,F,G,J){return e=Yl(s,o,!0,e,m,x,F,G,J),e.context=_d(null),s=e.current,o=Gt(),m=wi(s),x=Vr(o,m),x.callback=t??null,vi(s,x,m),e.current.lanes=m,jr(e,m,o),rr(e,o),e}function No(e,t,s,o){var m=t.current,x=Gt(),F=wi(m);return s=_d(s),t.context===null?t.context=s:t.pendingContext=s,t=Vr(x,F),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=vi(m,t,F),e!==null&&(kr(e,m,F,x),fo(e,m,F)),F}function Io(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 vd(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Xl(e,t){vd(e,t),(e=e.alternate)&&vd(e,t)}function _v(){return null}var gd=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}Fo.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(n(409));No(e,t,null,null)},Fo.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;$i(function(){No(null,e,null,null)}),t[Hr]=null}};function Fo(e){this._internalRoot=e}Fo.prototype.unstable_scheduleHydration=function(e){if(e){var t=eh();e={blockedOn:null,target:e,priority:t};for(var s=0;s<li.length&&t!==0&&t<li[s].priority;s++);li.splice(s,0,e),s===0&&ih(e)}};function Ql(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function jo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function md(){}function pv(e,t,s,o,m){if(m){if(typeof o=="function"){var x=o;o=function(){var ie=Io(F);x.call(ie)}}var F=pd(t,o,e,0,null,!1,!1,"",md);return e._reactRootContainer=F,e[Hr]=F.current,Xs(e.nodeType===8?e.parentNode:e),$i(),F}for(;m=e.lastChild;)e.removeChild(m);if(typeof o=="function"){var G=o;o=function(){var ie=Io(J);G.call(ie)}}var J=Yl(e,0,!1,null,null,!1,!1,"",md);return e._reactRootContainer=J,e[Hr]=J.current,Xs(e.nodeType===8?e.parentNode:e),$i(function(){No(t,J,s,o)}),J}function Ho(e,t,s,o,m){var x=s._reactRootContainer;if(x){var F=x;if(typeof m=="function"){var G=m;m=function(){var J=Io(F);G.call(J)}}No(t,F,e,m)}else F=pv(s,t,e,m,o);return Io(F)}Qc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=Ai(t.pendingLanes);s!==0&&(Ca(t,s|1),rr(t,st()),(Ue&6)===0&&(Cs=st()+500,_i()))}break;case 13:$i(function(){var o=Wr(e,1);if(o!==null){var m=Gt();kr(o,e,1,m)}}),Xl(e,1)}},xa=function(e){if(e.tag===13){var t=Wr(e,134217728);if(t!==null){var s=Gt();kr(t,e,134217728,s)}Xl(e,134217728)}},Zc=function(e){if(e.tag===13){var t=wi(e),s=Wr(e,t);if(s!==null){var o=Gt();kr(s,e,t,o)}Xl(e,t)}},eh=function(){return qe},th=function(e,t){var s=qe;try{return qe=e,t()}finally{qe=s}},Vt=function(e,t,s){switch(t){case"input":if(xe(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var o=s[t];if(o!==e&&o.form===e.form){var m=ro(o);if(!m)throw Error(n(90));_e(o),xe(o,m)}}}break;case"textarea":Ft(e,s);break;case"select":t=s.value,t!=null&&Ye(e,!!s.multiple,t,!1)}},Qi=Ul,Tn=$i;var vv={usingClientEntryPoint:!1,Events:[Zs,cs,ro,Xi,Ji,Ul]},_n={findFiberByHostInstance:Bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},gv={bundleType:_n.bundleType,version:_n.version,rendererPackageName:_n.rendererPackageName,rendererConfig:_n.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:v.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=On(e),e===null?null:e.stateNode},findFiberByHostInstance:_n.findFiberByHostInstance||_v,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 $o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$o.isDisabled&&$o.supportsFiber)try{Zi=$o.inject(gv),ur=$o}catch{}}return ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vv,ir.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ql(t))throw Error(n(200));return fv(e,t,null,s)},ir.createRoot=function(e,t){if(!Ql(e))throw Error(n(299));var s=!1,o="",m=gd;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(m=t.onRecoverableError)),t=Yl(e,1,!1,null,null,s,!1,o,m),e[Hr]=t.current,Xs(e.nodeType===8?e.parentNode:e),new Jl(t)},ir.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(n(188)):(e=Object.keys(e).join(","),Error(n(268,e)));return e=On(t),e=e===null?null:e.stateNode,e},ir.flushSync=function(e){return $i(e)},ir.hydrate=function(e,t,s){if(!jo(t))throw Error(n(200));return Ho(null,e,t,!0,s)},ir.hydrateRoot=function(e,t,s){if(!Ql(e))throw Error(n(405));var o=s!=null&&s.hydratedSources||null,m=!1,x="",F=gd;if(s!=null&&(s.unstable_strictMode===!0&&(m=!0),s.identifierPrefix!==void 0&&(x=s.identifierPrefix),s.onRecoverableError!==void 0&&(F=s.onRecoverableError)),t=pd(t,null,e,1,s??null,m,!1,x,F),e[Hr]=t.current,Xs(e),o)for(e=0;e<o.length;e++)s=o[e],m=s._getVersion,m=m(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,m]:t.mutableSourceEagerHydrationData.push(s,m);return new Fo(t)},ir.render=function(e,t,s){if(!jo(t))throw Error(n(200));return Ho(null,e,t,!1,s)},ir.unmountComponentAtNode=function(e){if(!jo(e))throw Error(n(40));return e._reactRootContainer?($i(function(){Ho(null,null,e,!1,function(){e._reactRootContainer=null,e[Hr]=null})}),!0):!1},ir.unstable_batchedUpdates=Ul,ir.unstable_renderSubtreeIntoContainer=function(e,t,s,o){if(!jo(s))throw Error(n(200));if(e==null||e._reactInternals===void 0)throw Error(n(38));return Ho(e,t,s,!1,o)},ir.version="18.3.1-next-f1338f8080-20240426",ir}var Ld;function Ev(){if(Ld)return tc.exports;Ld=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(i){console.error(i)}}return r(),tc.exports=bv(),tc.exports}var kd;function Lv(){if(kd)return zo;kd=1;var r=Ev();return zo.createRoot=r.createRoot,zo.hydrateRoot=r.hydrateRoot,zo}var kv=Lv();const Rv=Af(kv);function Bf(r){var i,n,g="";if(typeof r=="string"||typeof r=="number")g+=r;else if(typeof r=="object")if(Array.isArray(r)){var _=r.length;for(i=0;i<_;i++)r[i]&&(n=Bf(r[i]))&&(g&&(g+=" "),g+=n)}else for(n in r)r[n]&&(g&&(g+=" "),g+=n);return g}function Ot(){for(var r,i,n=0,g="",_=arguments.length;n<_;n++)(r=arguments[n])&&(i=Bf(r))&&(g&&(g+=" "),g+=i);return g}function Pf(r,i){const n=q.useRef(null);return q.useEffect(()=>{if(!r)return;const g=n.current;if(!g)return;const _=()=>Array.from(g.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const R=_(),a=R.find(d=>d.tagName!=="BUTTON")??R[0];a==null||a.focus()});const k=R=>{if(R.key==="Escape"){R.preventDefault(),i();return}if(R.key!=="Tab")return;const a=_();if(a.length===0)return;const d=a[0],p=a[a.length-1];R.shiftKey?document.activeElement===d&&(R.preventDefault(),p.focus()):document.activeElement===p&&(R.preventDefault(),d.focus())};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r,i]),n}const Mv=({isOpen:r,workspaces:i,onSubmit:n,onClose:g})=>{var S;const[_,k]=q.useState(((S=i[0])==null?void 0:S.id)||""),[R,a]=q.useState(""),[d,p]=q.useState(!1),y=Pf(r,g);q.useEffect(()=>{r&&i.length>0&&!_&&k(i[0].id)},[r,i,_]);const f=async b=>{if(b.preventDefault(),!d){p(!0);try{await n(R.trim(),_),a("")}finally{p(!1)}}};return r?P.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:P.jsxs("form",{className:"modal",ref:y,onSubmit:f,children:[P.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),P.jsxs("label",{className:"grid gap-1 text-xs",children:[P.jsx("span",{children:"デッキ名 (任意)"}),P.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:R,placeholder:"空白のままでもOK",maxLength:100,onChange:b=>a(b.target.value)})]}),P.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[P.jsx("span",{children:"ワークスペース"}),P.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:_,onChange:b=>k(b.target.value),children:i.map(b=>P.jsx("option",{value:b.id,children:b.path},b.id))})]}),P.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[P.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:g,disabled:d,children:"キャンセル"}),P.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:d,children:d?"作成中...":"作成"})]})]})}):null};function Tv({activeView:r,onSelect:i,theme:n,onToggleTheme:g,onOpenSettings:_}){return P.jsxs("nav",{className:"activity-bar",children:[P.jsxs("div",{className:"activity-bar-top",children:[P.jsx("button",{type:"button",className:Ot("activity-bar-item",r==="workspace"&&"active"),onClick:()=>i("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),P.jsx("button",{type:"button",className:Ot("activity-bar-item",r==="terminal"&&"active"),onClick:()=>i("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:P.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[P.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),P.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),P.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})}),P.jsx("button",{type:"button",className:Ot("activity-bar-item",r==="browser"&&"active"),onClick:()=>i("browser"),"aria-label":"Browser",title:"Browser",children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M12 2a10 10 0 100 20 10 10 0 000-20zm6.93 9h-3.02a15.7 15.7 0 00-1.12-5.03A8.03 8.03 0 0118.93 11zM12 4c.64 0 1.58 1.19 2.03 3.5.2 1.02.33 2.2.37 3.5H9.6c.04-1.3.17-2.48.37-3.5C10.42 5.19 11.36 4 12 4zM4.07 13h3.02c.11 1.9.5 3.64 1.12 5.03A8.03 8.03 0 014.07 13zm3.02-2H4.07a8.03 8.03 0 014.14-5.03A15.7 15.7 0 007.09 11zM12 20c-.64 0-1.58-1.19-2.03-3.5A18.4 18.4 0 019.6 13h4.8a18.4 18.4 0 01-.37 3.5C13.58 18.81 12.64 20 12 20zm3.79-1.97c.62-1.39 1.01-3.13 1.12-5.03h3.02a8.03 8.03 0 01-4.14 5.03z",fill:"currentColor"})})})]}),P.jsxs("div",{className:"activity-bar-bottom",children:[P.jsx("button",{type:"button",className:"activity-bar-item",onClick:g,"aria-label":"Toggle Theme",title:n==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:n==="dark"?P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),P.jsx("button",{type:"button",className:"activity-bar-item",onClick:_,"aria-label":"Settings",title:"Settings",children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const Dv=({message:r})=>r?P.jsx("div",{className:"status-float",role:"status",children:r}):null,Av="",Bv="",Of="保存しました。",Pv="デッキを作成する前にワークスペースを追加してください。",Ov="ワークスペースを選択してください。",Nv=2e3,Nf='"JetBrains Mono", monospace',If=14,Iv='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", "Noto Sans Mono CJK JP", "Source Han Mono", "MS Gothic", monospace',Fv=13,Ac="#000000",Ff="#ffffff",St=["#1e1e1e","#f44747","#23d18b","#e5c07b","#4aa5f0","#c586c0","#29b8db","#d4d4d4","#666666","#ff6e6e","#5ff967","#f5f543","#6ab7ff","#d670d6","#62e8f5","#ffffff"],jv="#ffffff",Hv="#264f78",jf="deck-theme",$v=204;async function Fe(r,i={}){const n=await fetch(`${Av}${r}`,{...i,credentials:"include"});if(!n.ok){const g=await n.text();throw new Error(g||`Request failed (${n.status})`)}return n.status===$v?null:n.json()}const Nt="application/json",It="POST",Hf="PUT",Rn="DELETE";function zv(){return window.location.origin.replace(/^http/,"ws")}function Bc(){return Fe("/api/ws-token")}function Uv(){return Fe("/api/workspaces")}function Wv(){return Fe("/api/config")}function Vv(r){return Fe("/api/workspaces",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({path:r})})}function Kv(r){return Fe(`/api/workspaces/${r}`,{method:Rn})}function qv(){return Fe("/api/decks")}function Gv(r,i){return Fe("/api/decks",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({name:r,workspaceId:i})})}function Yv(r){return Fe(`/api/decks/${r}`,{method:Rn})}function Xv(r){return Fe("/api/decks/order",{method:Hf,headers:{"Content-Type":Nt},body:JSON.stringify({deckIds:r})})}function Rd(r,i=""){const n=new URLSearchParams({workspaceId:r,path:i});return Fe(`/api/files?${n.toString()}`)}function Md(r,i=""){const n=new URLSearchParams({path:r,subpath:i});return Fe(`/api/preview?${n.toString()}`)}function Jv(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Fe(`/api/file?${n.toString()}`)}function Qv(r,i,n){return Fe("/api/file",{method:Hf,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,path:i,contents:n})})}function Zv(r,i,n=""){return Fe("/api/file",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,path:i,contents:n})})}function eg(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Fe(`/api/file?${n.toString()}`,{method:Rn})}function tg(r,i){return Fe("/api/dir",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,path:i})})}function rg(r,i){const n=new URLSearchParams({workspaceId:r,path:i});return Fe(`/api/dir?${n.toString()}`,{method:Rn})}function ig(r,i,n){return Fe("/api/terminals",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({deckId:r,title:i,command:n})})}function sg(r){const i=new URLSearchParams({deckId:r});return Fe(`/api/terminals?${i.toString()}`)}function ng(r){return Fe(`/api/terminals/${r}`,{method:Rn})}function og(){return Fe("/api/browser/status")}function ag(){return Fe("/api/browser/start",{method:It})}function lg(){return Fe("/api/browser/stop",{method:It})}function cg(r){return Fe("/api/browser/navigate",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({url:r})})}function $f(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const g=new URLSearchParams(n);return Fe(`/api/git/status?${g.toString()}`)}function hg(r){const i=new URLSearchParams({workspaceId:r});return Fe(`/api/git/repos?${i.toString()}`)}function zf(r,i,n){return Fe("/api/git/stage",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function Uf(r,i,n){return Fe("/api/git/unstage",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function ug(r,i,n){return Fe("/api/git/commit",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,message:i,repoPath:n})})}function dg(r,i,n){return Fe("/api/git/discard",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,paths:i,repoPath:n})})}function fg(r,i,n,g){const _={workspaceId:r,path:i,staged:n.toString()};g!==void 0&&(_.repoPath=g);const k=new URLSearchParams(_);return Fe(`/api/git/diff?${k.toString()}`)}function _g(r,i){return Fe("/api/git/push",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function pg(r,i){return Fe("/api/git/pull",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function vg(r,i){return Fe("/api/git/fetch",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,repoPath:i})})}function Wf(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const g=new URLSearchParams(n);return Fe(`/api/git/branch-status?${g.toString()}`)}function Vf(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const g=new URLSearchParams(n);return Fe(`/api/git/remotes?${g.toString()}`)}function gg(r,i){const n={workspaceId:r};i!==void 0&&(n.repoPath=i);const g=new URLSearchParams(n);return Fe(`/api/git/branches?${g.toString()}`)}function mg(r,i,n){return Fe("/api/git/checkout",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,branchName:i,repoPath:n})})}function yg(r,i,n=!0,g){return Fe("/api/git/create-branch",{method:It,headers:{"Content-Type":Nt},body:JSON.stringify({workspaceId:r,branchName:i,checkout:n,repoPath:g})})}function wg(r,i=50,n){const g={workspaceId:r,limit:String(i)};n!==void 0&&(g.repoPath=n);const _=new URLSearchParams(g);return Fe(`/api/git/log?${_.toString()}`)}const Sg='audio/webm; codecs="opus"',Cg=64;function Td(r){let i=0;return r.altKey&&(i|=1),r.ctrlKey&&(i|=2),r.metaKey&&(i|=4),r.shiftKey&&(i|=8),i}function vn(r){let i=0;return r.altKey&&(i|=1),r.ctrlKey&&(i|=2),r.metaKey&&(i|=4),r.shiftKey&&(i|=8),i}function xg(r){return r===0?"left":r===1?"middle":r===2?"right":"none"}function Dd(r){return r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement||r instanceof HTMLElement&&r.isContentEditable}function Kf(r){return!r||r==="about:blank"}function Uo(r){return Kf(r)?null:r}function bg({wsBase:r}){const i=q.useRef(null),n=q.useRef(null),g=q.useRef(null),_=q.useRef(null),k=q.useRef(null),R=q.useRef({width:0,height:0}),a=q.useRef(!1),d=q.useRef(!1),p=q.useRef(null),y=q.useRef(null),f=q.useRef(null),S=q.useRef(null),b=q.useRef([]),M=q.useRef({width:0,height:0}),w=q.useRef(!1),c=q.useRef("none"),u=q.useRef(null),l=q.useRef(0),[h,v]=q.useState(null),[C,L]=q.useState(""),[T,E]=q.useState(!1),[N,W]=q.useState(!1),[K,I]=q.useState(!1),[B,U]=q.useState(null),[$,V]=q.useState(!1),[X,z]=q.useState(null),[D,O]=q.useState(null),A=q.useCallback(le=>{const ce=i.current;!ce||ce.readyState!==WebSocket.OPEN||ce.send(JSON.stringify(le))},[]),H=q.useCallback(()=>{const{width:le,height:ce}=M.current;le>0&&ce>0&&A({type:"resize",width:le,height:ce})},[A]),Q=q.useCallback(()=>{d.current=!1,R.current={width:0,height:0},E(!1);const le=_.current;le&&k.current&&k.current.clearRect(0,0,le.width,le.height)},[]),ne=q.useCallback(le=>{a.current||(a.current=!0,createImageBitmap(new Blob([le],{type:"image/jpeg"})).then(ce=>{const Ee=_.current;if(!Ee){ce.close();return}k.current||(k.current=Ee.getContext("2d"));const De=k.current;if(!De){ce.close();return}(Ee.width!==ce.width||Ee.height!==ce.height)&&(Ee.width=ce.width,Ee.height=ce.height),R.current={width:ce.width,height:ce.height},De.drawImage(ce,0,0),ce.close(),d.current||(d.current=!0,E(!0))}).catch(()=>{}).finally(()=>{a.current=!1}))},[]);q.useEffect(()=>{let le=!0;return og().then(ce=>{if(!le)return;v(ce),U(ce.audio);const Ee=Uo(ce.pageUrl);Ee&&L(Ee),ce.error&&z(ce.error)}).catch(ce=>{le&&z(ce instanceof Error?ce.message:"Browser status failed")}),()=>{le=!1}},[]),q.useEffect(()=>{const le=g.current;if(!le)return;const ce=new ResizeObserver(([Ee])=>{const De=Math.floor(Ee.contentRect.width),We=Math.floor(Ee.contentRect.height);De<=0||We<=0||M.current.width===De&&M.current.height===We||(M.current={width:De,height:We},A({type:"resize",width:De,height:We}))});return ce.observe(le),()=>ce.disconnect()},[A]),q.useEffect(()=>{let le=!1;const ce=()=>{u.current&&(clearTimeout(u.current),u.current=null)},Ee=async()=>{if(!le){ce();try{const{token:De,authEnabled:We}=await Bc();if(le)return;const Ae=`${r}/api/browser/ws`,Wt=We?`${Ae}?token=${encodeURIComponent(De)}`:Ae,ge=new WebSocket(Wt);ge.binaryType="arraybuffer",i.current=ge,ge.addEventListener("open",()=>{l.current=0,W(!0),z(null),H()}),ge.addEventListener("message",ke=>{if(ke.data instanceof ArrayBuffer){ne(ke.data);return}if(typeof ke.data!="string")return;let Pe;try{Pe=JSON.parse(ke.data)}catch{return}if(Pe.type==="status"){v(Pe.status),U(Pe.status.audio);const ze=Uo(Pe.status.pageUrl);ze&&L(ze),Pe.status.error&&z(Pe.status.error);return}Pe.type==="error"&&z(Pe.error)}),ge.addEventListener("close",()=>{if(i.current===ge&&(i.current=null),W(!1),le)return;const ke=Math.min(l.current+1,6);l.current=ke,u.current=setTimeout(Ee,500*Math.pow(2,ke-1))}),ge.addEventListener("error",()=>{W(!1)})}catch(De){if(le)return;z(De instanceof Error?De.message:"Browser connection failed");const We=Math.min(l.current+1,6);l.current=We,u.current=setTimeout(Ee,500*Math.pow(2,We-1))}}};return Ee(),()=>{le=!0,ce(),i.current&&(i.current.close(),i.current=null)}},[ne,H,r]);const oe=q.useCallback(()=>{const le=f.current;if(!le||le.updating)return;const ce=b.current.shift();if(ce)try{le.appendBuffer(ce)}catch(Ee){b.current.unshift(ce),O(Ee instanceof Error?Ee.message:"Browser audio append failed")}},[]),ue=q.useCallback(le=>{const ce=le.slice(0),Ee=f.current;if(!Ee||Ee.updating||b.current.length>0){b.current.length<Cg&&b.current.push(ce);return}try{Ee.appendBuffer(ce)}catch(De){O(De instanceof Error?De.message:"Browser audio append failed")}},[]),Y=q.useCallback(()=>{const le=n.current;n.current=null,le&&le.readyState!==WebSocket.CLOSED&&le.readyState!==WebSocket.CLOSING&&le.close(),b.current=[],f.current=null;const ce=y.current;if(y.current=null,(ce==null?void 0:ce.readyState)==="open")try{ce.endOfStream()}catch{}const Ee=p.current;Ee&&(Ee.pause(),Ee.removeAttribute("src"),Ee.load()),S.current&&(URL.revokeObjectURL(S.current),S.current=null),I(!1)},[]),j=q.useCallback(async()=>{var We;if(((We=n.current)==null?void 0:We.readyState)===WebSocket.OPEN)return;const le=(B==null?void 0:B.mimeType)||Sg;if(typeof MediaSource>"u"||!MediaSource.isTypeSupported(le)){O(`This browser cannot play ${le}`),I(!1);return}Y(),O(null),I(!0);const ce=new MediaSource;y.current=ce;const Ee=URL.createObjectURL(ce);S.current=Ee;const De=p.current;De&&(De.src=Ee,De.autoplay=!0,De.play().catch(()=>{})),ce.addEventListener("sourceopen",()=>{if(y.current===ce)try{const Ae=ce.addSourceBuffer(le);Ae.mode="sequence",f.current=Ae,Ae.addEventListener("updateend",oe),oe()}catch(Ae){O(Ae instanceof Error?Ae.message:"Browser audio setup failed"),I(!1)}},{once:!0});try{const{token:Ae,authEnabled:Wt}=await Bc(),ge=`${r}/api/browser/audio/ws`,ke=Wt?`${ge}?token=${encodeURIComponent(Ae)}`:ge,Pe=new WebSocket(ke);Pe.binaryType="arraybuffer",n.current=Pe,Pe.addEventListener("message",ze=>{var gt;if(typeof ze.data=="string"){let Ne;try{Ne=JSON.parse(ze.data)}catch{return}if(Ne.type==="audio-status"){U(Ne.status),Ne.status.error?O(Ne.status.error):Ne.status.available&&O(null);return}Ne.type==="audio-error"&&(O(Ne.error),I(!1));return}ze.data instanceof ArrayBuffer&&(ue(ze.data),(gt=p.current)==null||gt.play().catch(()=>{}))}),Pe.addEventListener("close",()=>{n.current===Pe&&(n.current=null),I(!1)}),Pe.addEventListener("error",()=>{O("Browser audio connection failed"),I(!1)})}catch(Ae){Y(),O(Ae instanceof Error?Ae.message:"Browser audio failed")}},[ue,B,oe,Y,r]);q.useEffect(()=>()=>Y(),[Y]);const se=q.useCallback(()=>{if(K||n.current){Y();return}j()},[K,j,Y]),re=q.useCallback(async()=>{V(!0),z(null);try{const le=await ag();v(le),U(le.audio);const ce=Uo(le.pageUrl);ce&&L(ce)}catch(le){z(le instanceof Error?le.message:"Browser start failed")}finally{V(!1)}},[]),ve=q.useCallback(async()=>{V(!0),z(null);try{const le=await lg();v(le),U(le.audio),Q(),Y()}catch(le){z(le instanceof Error?le.message:"Browser stop failed")}finally{V(!1)}},[Q,Y]),_e=q.useCallback(async()=>{const le=C.trim();if(le){V(!0),z(null);try{const ce=await cg(le);v(ce),U(ce.audio);const Ee=Uo(ce.pageUrl);Ee&&L(Ee)}catch(ce){z(ce instanceof Error?ce.message:"Navigate failed")}finally{V(!1)}}},[C]),Re=q.useCallback((le,ce)=>{const Ee=_.current;if(!Ee)return null;const De=Ee.getBoundingClientRect();if(De.width<=0||De.height<=0)return null;const We=R.current.width||Ee.width||M.current.width||1280,Ae=R.current.height||Ee.height||M.current.height||720,Wt=Math.max(0,Math.min(We,(le-De.left)/De.width*We)),ge=Math.max(0,Math.min(Ae,(ce-De.top)/De.height*Ae));return{x:Wt,y:ge}},[]),Se=q.useCallback(le=>Re(le.clientX,le.clientY),[Re]),$e=q.useCallback(le=>{const ce=Se(le);ce&&A({type:"mouse",eventType:"mouseMoved",x:ce.x,y:ce.y,button:w.current?c.current:"none",modifiers:vn(le)})},[Se,A]),je=q.useCallback(le=>{var Ee;const ce=Se(le);ce&&(le.preventDefault(),(Ee=g.current)==null||Ee.focus({preventScroll:!0}),w.current=!0,c.current=xg(le.button),A({type:"mouse",eventType:"mousePressed",x:ce.x,y:ce.y,button:c.current,clickCount:le.detail||1,modifiers:vn(le)}))},[Se,A]),xe=q.useCallback(le=>{const ce=Se(le);if(!ce)return;le.preventDefault();const Ee=c.current;w.current=!1,c.current="none",A({type:"mouse",eventType:"mouseReleased",x:ce.x,y:ce.y,button:Ee,clickCount:le.detail||1,modifiers:vn(le)})},[Se,A]);q.useEffect(()=>{const le=ce=>{if(!w.current)return;const Ee=Re(ce.clientX,ce.clientY),De=c.current;w.current=!1,c.current="none",Ee&&A({type:"mouse",eventType:"mouseReleased",x:Ee.x,y:Ee.y,button:De,clickCount:1,modifiers:vn(ce)})};return window.addEventListener("mouseup",le),()=>window.removeEventListener("mouseup",le)},[Re,A]);const Xe=q.useCallback(le=>{const ce=Se(le);ce&&(le.preventDefault(),A({type:"mouse",eventType:"mouseWheel",x:ce.x,y:ce.y,button:"none",deltaX:le.deltaX,deltaY:le.deltaY,modifiers:vn(le)}))},[Se,A]),ft=q.useCallback(le=>{if(Dd(le.target))return;le.preventDefault();const ce=!le.ctrlKey&&!le.metaKey&&!le.altKey&&le.key.length===1?le.key:void 0;A({type:"key",eventType:"keyDown",key:le.key,code:le.code,text:ce,modifiers:Td(le)})},[A]),_t=q.useCallback(le=>{Dd(le.target)||(le.preventDefault(),A({type:"key",eventType:"keyUp",key:le.key,code:le.code,modifiers:Td(le)}))},[A]),Ye=(B==null?void 0:B.reason)||D||(K?"Stop audio":"Start audio"),Ge=(h==null?void 0:h.running)??!1,Ke=(h==null?void 0:h.launching)??!1,it=T&&!Kf(h==null?void 0:h.pageUrl)?"page":!Ge&&!Ke?"stopped":Ke?"launching":N?"ready":"connecting",ut=N?Ke?"launching":K?"connected · audio":"connected":"offline";return P.jsxs("section",{className:"browser-layout",children:[P.jsxs("div",{className:"browser-toolbar",children:[P.jsxs("div",{className:"browser-address-group",children:[P.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:re,disabled:$||(h==null?void 0:h.running),title:"Start","aria-label":"Start browser",children:"▶"}),P.jsx("button",{type:"button",className:"browser-toolbar-button",onClick:ve,disabled:$||!(h!=null&&h.running),title:"Stop","aria-label":"Stop browser",children:"■"}),P.jsx("button",{type:"button",className:K?"browser-toolbar-button browser-toolbar-button-active":"browser-toolbar-button",onClick:se,disabled:$||!(h!=null&&h.running),title:Ye,"aria-label":"Browser audio",children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M4 9v6h4l5 4V5L8 9H4zm11.5-1.5v9a5 5 0 000-9zm2.5-2.5v14a8 8 0 000-14z",fill:"currentColor"})})}),P.jsxs("form",{className:"browser-address-form",onSubmit:le=>{le.preventDefault(),_e()},children:[P.jsx("input",{className:"browser-address-input",value:C,onChange:le=>L(le.target.value),placeholder:"URLを入力 (例: example.com)",spellCheck:!1,autoCapitalize:"off",autoComplete:"off","aria-label":"URL"}),P.jsx("button",{type:"submit",className:"browser-go-button",disabled:$,title:"Go","aria-label":"Go",children:"→"})]})]}),P.jsxs("div",{className:"browser-status-line",title:(h==null?void 0:h.profileDir)||"",children:[P.jsx("span",{className:Ge?"browser-dot browser-dot-running":"browser-dot"}),P.jsx("span",{children:ut})]})]}),(X||D)&&P.jsx("div",{className:"browser-error",children:X||D}),P.jsx("audio",{ref:p,className:"browser-audio"}),P.jsxs("div",{ref:g,className:"browser-viewport",tabIndex:0,onKeyDown:ft,onKeyUp:_t,children:[P.jsx("canvas",{ref:_,className:"browser-frame",style:{display:it==="page"?"block":"none"},onMouseMove:$e,onMouseDown:je,onMouseUp:xe,onWheel:Xe,onContextMenu:le=>le.preventDefault()}),it==="stopped"&&P.jsxs("div",{className:"browser-state",children:[P.jsx("div",{className:"browser-state-title",children:"ブラウザは停止中です"}),P.jsx("button",{type:"button",className:"browser-state-action",onClick:re,disabled:$,children:"▶ 起動する"})]}),it==="launching"&&P.jsxs("div",{className:"browser-state",children:[P.jsx("div",{className:"browser-spinner","aria-hidden":"true"}),P.jsx("div",{className:"browser-state-title",children:"ブラウザを起動中…"})]}),it==="connecting"&&P.jsxs("div",{className:"browser-state",children:[P.jsx("div",{className:"browser-spinner","aria-hidden":"true"}),P.jsx("div",{className:"browser-state-title",children:"接続中…"})]}),it==="ready"&&P.jsxs("div",{className:"browser-state",children:[P.jsx("div",{className:"browser-state-title",children:"準備完了"}),P.jsx("div",{className:"browser-state-hint",children:"上のバーにURLを入力してEnterでアクセスできます"})]})]})]})}function ra(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function ia(){return{terminals:[],activeTerminalId:null}}function qf(r,i){var n;return i&&r.some(g=>g.id===i)?i:((n=r[0])==null?void 0:n.id)??null}function Eg(r){const i=r.lastIndexOf(".");return i===-1||i===0?"":r.slice(i+1).toLowerCase()}function Lg(r){const i=Eg(r);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[i]||"plaintext"}function Lt(r){return r instanceof Error?r.message:String(r)}function sa(r){return r.map(i=>({...i,expanded:!1,loading:!1,children:i.type==="dir"?[]:void 0}))}function Gf(r){return Lg(r)}function Pc(r,i,n){return i?r.map(g=>{if(g.path===i&&g.type==="dir"){const k=[...g.children||[],n].sort((R,a)=>R.type!==a.type?R.type==="dir"?-1:1:R.name.localeCompare(a.name));return{...g,children:k,expanded:!0}}return g.children?{...g,children:Pc(g.children,i,n)}:g}):[...r,n].sort((_,k)=>_.type!==k.type?_.type==="dir"?-1:1:_.name.localeCompare(k.name))}function Oc(r,i){return r.filter(n=>n.path===i?!1:(n.children&&(n.children=Oc(n.children,i)),!0))}function Ls(r,i,n){return r.map(g=>g.path===i?n(g):g.children?{...g,children:Ls(g.children,i,n)}:g)}function Ad(r){return r.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function kg(r){return r.includes("\\")?"\\":"/"}function Rg(r,i){const n=kg(r),g=r.replace(/[\\/]+$/,"");return g?`${g}${n}${i}`:i}function Bd(r){const i=r.replace(/[\\/]+$/,"");if(!i)return r;if(/^[A-Za-z]:$/.test(i))return`${i}\\`;if(i==="/")return"/";const n=Math.max(i.lastIndexOf("/"),i.lastIndexOf("\\"));if(i.startsWith("/")&&n===0)return"/";if(n<=0)return i;const g=i.slice(0,n);return/^[A-Za-z]:$/.test(g)?`${g}\\`:g}function Yf(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const r=new URLSearchParams(window.location.search),i=r.get("view"),n=r.get("mode"),g=r.get("decks")||r.get("deck"),_=g?g.split(",").filter(Boolean):[];return{view:i==="workspace"||i==="browser"?i:"terminal",workspaceId:r.get("workspace"),deckIds:_,workspaceMode:n==="editor"?"editor":"list"}}function Mg(){if(typeof window>"u")return"light";const r=window.localStorage.getItem(jf);return r==="light"||r==="dark"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Pt(r,i=1e4){return Promise.race([r,new Promise((n,g)=>setTimeout(()=>g(new Error("Request timeout")),i))])}var sc={exports:{}},Pd;function Tg(){return Pd||(Pd=1,(function(r,i){(function(n,g){r.exports=g()})(globalThis,(()=>(()=>{var n={4567:function(R,a,d){var p=this&&this.__decorate||function(l,h,v,C){var L,T=arguments.length,E=T<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,h,v,C);else for(var N=l.length-1;N>=0;N--)(L=l[N])&&(E=(T<3?L(E):T>3?L(h,v,E):L(h,v))||E);return T>3&&E&&Object.defineProperty(h,v,E),E},y=this&&this.__param||function(l,h){return function(v,C){h(v,C,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const f=d(9042),S=d(9924),b=d(844),M=d(4725),w=d(2585),c=d(3656);let u=a.AccessibilityManager=class extends b.Disposable{constructor(l,h,v,C){super(),this._terminal=l,this._coreBrowserService=v,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 L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,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 S.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((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
41
+ `)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,c.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let h=0;h<l;h++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,h){this._liveRegionDebouncer.refresh(l,h,this._terminal.rows)}_renderRows(l,h){const v=this._terminal.buffer,C=v.lines.length.toString();for(let L=l;L<=h;L++){const T=v.lines.get(v.ydisp+L),E=[],N=(T==null?void 0:T.translateToString(!0,void 0,void 0,E))||"",W=(v.ydisp+L+1).toString(),K=this._rowElements[L];K&&(N.length===0?(K.innerText=" ",this._rowColumns.set(K,[0,1])):(K.textContent=N,this._rowColumns.set(K,E)),K.setAttribute("aria-posinset",W),K.setAttribute("aria-setsize",C))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,h){const v=l.target,C=this._rowElements[h===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(h===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==C)return;let L,T;if(h===0?(L=v,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(L=this._rowElements.shift(),T=v,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),h===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(h===0?-1:1),this._rowElements[h===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var N;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let h={node:l.anchorNode,offset:l.anchorOffset},v={node:l.focusNode,offset:l.focusOffset};if((h.node.compareDocumentPosition(v.node)&Node.DOCUMENT_POSITION_PRECEDING||h.node===v.node&&h.offset>v.offset)&&([h,v]=[v,h]),h.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(h={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(h.node))return;const C=this._rowElements.slice(-1)[0];if(v.node.compareDocumentPosition(C)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(v={node:C,offset:((N=C.textContent)==null?void 0:N.length)??0}),!this._rowContainer.contains(v.node))return;const L=({node:W,offset:K})=>{const I=W instanceof Text?W.parentNode:W;let B=parseInt(I==null?void 0:I.getAttribute("aria-posinset"),10)-1;if(isNaN(B))return console.warn("row is invalid. Race condition?"),null;const U=this._rowColumns.get(I);if(!U)return console.warn("columns is null. Race condition?"),null;let $=K<U.length?U[K]:U.slice(-1)[0]+1;return $>=this._terminal.cols&&(++B,$=0),{row:B,column:$}},T=L(h),E=L(v);if(T&&E){if(T.row>E.row||T.row===E.row&&T.column>=E.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(E.row-T.row)*this._terminal.cols-T.column+E.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let h=this._rowContainer.children.length;h<this._terminal.rows;h++)this._rowElements[h]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[h]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=u=p([y(1,w.IInstantiationService),y(2,M.ICoreBrowserService),y(3,M.IRenderService)],u)},3614:(R,a)=>{function d(S){return S.replace(/\r?\n/g,"\r")}function p(S,b){return b?"\x1B[200~"+S+"\x1B[201~":S}function y(S,b,M,w){S=p(S=d(S),M.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),M.triggerDataEvent(S,!0),b.value=""}function f(S,b,M){const w=M.getBoundingClientRect(),c=S.clientX-w.left-10,u=S.clientY-w.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${c}px`,b.style.top=`${u}px`,b.style.zIndex="1000",b.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=d,a.bracketTextForPaste=p,a.copyHandler=function(S,b){S.clipboardData&&S.clipboardData.setData("text/plain",b.selectionText),S.preventDefault()},a.handlePasteEvent=function(S,b,M,w){S.stopPropagation(),S.clipboardData&&y(S.clipboardData.getData("text/plain"),b,M,w)},a.paste=y,a.moveTextAreaUnderMouseCursor=f,a.rightClickHandler=function(S,b,M,w,c){f(S,b,M),c&&w.rightClickSelect(S),b.value=w.selectionText,b.select()}},7239:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const p=d(1505);a.ColorContrastCache=class{constructor(){this._color=new p.TwoKeyMap,this._css=new p.TwoKeyMap}setCss(y,f,S){this._css.set(y,f,S)}getCss(y,f){return this._css.get(y,f)}setColor(y,f,S){this._color.set(y,f,S)}getColor(y,f){return this._color.get(y,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(d,p,y,f){d.addEventListener(p,y,f);let S=!1;return{dispose:()=>{S||(S=!0,d.removeEventListener(p,y,f))}}}},3551:function(R,a,d){var p=this&&this.__decorate||function(u,l,h,v){var C,L=arguments.length,T=L<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,l,h,v);else for(var E=u.length-1;E>=0;E--)(C=u[E])&&(T=(L<3?C(T):L>3?C(l,h,T):C(l,h))||T);return L>3&&T&&Object.defineProperty(l,h,T),T},y=this&&this.__param||function(u,l){return function(h,v){l(h,v,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const f=d(3656),S=d(8460),b=d(844),M=d(2585),w=d(4725);let c=a.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(u,l,h,v,C){super(),this._element=u,this._mouseService=l,this._renderService=h,this._bufferService=v,this._linkProviderService=C,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var L;this._lastMouseEvent=void 0,(L=this._activeProviderReplies)==null||L.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const h=u.composedPath();for(let v=0;v<h.length;v++){const C=h[v];if(C.classList.contains("xterm"))break;if(C.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,l){var v,C;this._activeProviderReplies&&l||((v=this._activeProviderReplies)==null||v.forEach((L=>{L==null||L.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let h=!1;for(const[L,T]of this._linkProviderService.linkProviders.entries())l?(C=this._activeProviderReplies)!=null&&C.get(L)&&(h=this._checkLinkProviderResult(L,u,h)):T.provideLinks(u.y,(E=>{var W,K;if(this._isMouseOut)return;const N=E==null?void 0:E.map((I=>({link:I})));(W=this._activeProviderReplies)==null||W.set(L,N),h=this._checkLinkProviderResult(L,u,h),((K=this._activeProviderReplies)==null?void 0:K.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,l){const h=new Set;for(let v=0;v<l.size;v++){const C=l.get(v);if(C)for(let L=0;L<C.length;L++){const T=C[L],E=T.link.range.start.y<u?0:T.link.range.start.x,N=T.link.range.end.y>u?this._bufferService.cols:T.link.range.end.x;for(let W=E;W<=N;W++){if(h.has(W)){C.splice(L--,1);break}h.add(W)}}}}_checkLinkProviderResult(u,l,h){var L;if(!this._activeProviderReplies)return h;const v=this._activeProviderReplies.get(u);let C=!1;for(let T=0;T<u;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(C=!0);if(!C&&v){const T=v.find((E=>this._linkAtPosition(E.link,l)));T&&(h=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!h)for(let T=0;T<this._activeProviderReplies.size;T++){const E=(L=this._activeProviderReplies.get(T))==null?void 0:L.find((N=>this._linkAtPosition(N.link,l)));if(E){h=!0,this._handleNewLink(E);break}}return h}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const l=this._positionFromMouseEvent(u,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,l){this._currentLink&&this._lastMouseEvent&&(!u||!l||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(u.link,l)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var h,v;return(v=(h=this._currentLink)==null?void 0:h.state)==null?void 0:v.decorations.pointerCursor},set:h=>{var v;(v=this._currentLink)!=null&&v.state&&this._currentLink.state.decorations.pointerCursor!==h&&(this._currentLink.state.decorations.pointerCursor=h,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",h))}},underline:{get:()=>{var h,v;return(v=(h=this._currentLink)==null?void 0:h.state)==null?void 0:v.decorations.underline},set:h=>{var v,C,L;(v=this._currentLink)!=null&&v.state&&((L=(C=this._currentLink)==null?void 0:C.state)==null?void 0:L.decorations.underline)!==h&&(this._currentLink.state.decorations.underline=h,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,h))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((h=>{if(!this._currentLink)return;const v=h.start===0?0:h.start+1+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.ydisp+1+h.end;if(this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=C&&(this._clearCurrentLink(v,C),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(u,l,h){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(h,l.text)}_fireUnderlineEvent(u,l){const h=u.range,v=this._bufferService.buffer.ydisp,C=this._createLinkUnderlineEvent(h.start.x-1,h.start.y-v-1,h.end.x,h.end.y-v-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(C)}_linkLeave(u,l,h){var v;(v=this._currentLink)!=null&&v.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(h,l.text)}_linkAtPosition(u,l){const h=u.range.start.y*this._bufferService.cols+u.range.start.x,v=u.range.end.y*this._bufferService.cols+u.range.end.x,C=l.y*this._bufferService.cols+l.x;return h<=C&&C<=v}_positionFromMouseEvent(u,l,h){const v=h.getCoords(u,l,this._bufferService.cols,this._bufferService.rows);if(v)return{x:v[0],y:v[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,l,h,v,C){return{x1:u,y1:l,x2:h,y2:v,cols:this._bufferService.cols,fg:C}}};a.Linkifier=c=p([y(1,w.IMouseService),y(2,w.IRenderService),y(3,M.IBufferService),y(4,w.ILinkProviderService)],c)},9042:(R,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(R,a,d){var p=this&&this.__decorate||function(w,c,u,l){var h,v=arguments.length,C=v<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,c,u,l);else for(var L=w.length-1;L>=0;L--)(h=w[L])&&(C=(v<3?h(C):v>3?h(c,u,C):h(c,u))||C);return v>3&&C&&Object.defineProperty(c,u,C),C},y=this&&this.__param||function(w,c){return function(u,l){c(u,l,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const f=d(511),S=d(2585);let b=a.OscLinkProvider=class{constructor(w,c,u){this._bufferService=w,this._optionsService=c,this._oscLinkService=u}provideLinks(w,c){var N;const u=this._bufferService.buffer.lines.get(w-1);if(!u)return void c(void 0);const l=[],h=this._optionsService.rawOptions.linkHandler,v=new f.CellData,C=u.getTrimmedLength();let L=-1,T=-1,E=!1;for(let W=0;W<C;W++)if(T!==-1||u.hasContent(W)){if(u.loadCell(W,v),v.hasExtendedAttrs()&&v.extended.urlId){if(T===-1){T=W,L=v.extended.urlId;continue}E=v.extended.urlId!==L}else T!==-1&&(E=!0);if(E||T!==-1&&W===C-1){const K=(N=this._oscLinkService.getLinkData(L))==null?void 0:N.uri;if(K){const I={start:{x:T+1,y:w},end:{x:W+(E||W!==C-1?0:1),y:w}};let B=!1;if(!(h!=null&&h.allowNonHttpProtocols))try{const U=new URL(K);["http:","https:"].includes(U.protocol)||(B=!0)}catch{B=!0}B||l.push({text:K,range:I,activate:(U,$)=>h?h.activate(U,$,I):M(0,$),hover:(U,$)=>{var V;return(V=h==null?void 0:h.hover)==null?void 0:V.call(h,U,$,I)},leave:(U,$)=>{var V;return(V=h==null?void 0:h.leave)==null?void 0:V.call(h,U,$,I)}})}E=!1,v.hasExtendedAttrs()&&v.extended.urlId?(T=W,L=v.extended.urlId):(T=-1,L=-1)}}c(l)}};function M(w,c){if(confirm(`Do you want to navigate to ${c}?
43
+
44
+ WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=b=p([y(0,S.IBufferService),y(1,S.IOptionsService),y(2,S.IOscLinkService)],b)},6193:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(d,p){this._renderCallback=d,this._coreBrowserService=p,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,p,y){this._rowCount=y,d=d!==void 0?d:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p,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 d=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,p),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const p=d(3614),y=d(3656),f=d(3551),S=d(9042),b=d(3730),M=d(1680),w=d(3107),c=d(5744),u=d(2950),l=d(1296),h=d(428),v=d(4269),C=d(5114),L=d(8934),T=d(3230),E=d(9312),N=d(4725),W=d(6731),K=d(8055),I=d(8969),B=d(8460),U=d(844),$=d(6114),V=d(8437),X=d(2584),z=d(7399),D=d(5941),O=d(9074),A=d(2585),H=d(5435),Q=d(4567),ne=d(779);class oe extends I.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Y={}){super(Y),this.browser=$,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,se)=>this.refresh(j,se)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((j=>this._reportWindowsOptions(j)))),this.register(this._inputHandler.onColor((j=>this._handleColorEvent(j)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((j=>this._afterResize(j.cols,j.rows)))),this.register((0,U.toDisposable)((()=>{var j,se;this._customKeyEventHandler=void 0,(se=(j=this.element)==null?void 0:j.parentNode)==null||se.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const j of Y){let se,re="";switch(j.index){case 256:se="foreground",re="10";break;case 257:se="background",re="11";break;case 258:se="cursor",re="12";break;default:se="ansi",re="4;"+j.index}switch(j.type){case 0:const ve=K.color.toColorRGB(se==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[se]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${re};${(0,D.toRgbString)(ve)}${X.C1_ESCAPED.ST}`);break;case 1:if(se==="ansi")this._themeService.modifyColors((_e=>_e.ansi[j.index]=K.channels.toColor(...j.color)));else{const _e=se;this._themeService.modifyColors((Re=>Re[_e]=K.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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 Y=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(Y);if(!j)return;const se=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,ve=j.getWidth(se),_e=this._renderService.dimensions.css.cell.width*ve,Re=this.buffer.y*this._renderService.dimensions.css.cell.height,Se=se*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Se+"px",this.textarea.style.top=Re+"px",this.textarea.style.width=_e+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(j=>{this.hasSelection()&&(0,p.copyHandler)(j,this._selectionService)})));const Y=j=>(0,p.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Y)),$.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,p.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,p.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),$.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,p.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var se;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((se=this.element)==null?void 0:se.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.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"),Y.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.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,y.addDisposableDomListener)(this.screenElement,"mousemove",(re=>this.updateCursorStyle(re)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",S.promptLabel),$.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,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(re=>this._handleTextAreaFocus(re)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(v.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((re=>this._onRender.fire(re)))),this.onResize((re=>this._renderService.resize(re.cols,re.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(M.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((re=>this.scrollLines(re.amount,re.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(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((re=>this.scrollLines(re.amount,re.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((re=>this._renderService.handleSelectionChanged(re.start,re.end,re.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((re=>{this.textarea.value=re,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((re=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(re=>this._selectionService.handleMouseDown(re)))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(re=>this._handleScreenReaderModeOptionChange(re)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(re=>{!this._overviewRulerRenderer&&re&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(c.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,j=this.element;function se(_e){const Re=Y._mouseService.getMouseReportCoords(_e,Y.screenElement);if(!Re)return!1;let Se,$e;switch(_e.overrideType||_e.type){case"mousemove":$e=32,_e.buttons===void 0?(Se=3,_e.button!==void 0&&(Se=_e.button<3?_e.button:3)):Se=1&_e.buttons?0:4&_e.buttons?1:2&_e.buttons?2:3;break;case"mouseup":$e=0,Se=_e.button<3?_e.button:3;break;case"mousedown":$e=1,Se=_e.button<3?_e.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(_e)===!1||Y.viewport.getLinesScrolled(_e)===0)return!1;$e=_e.deltaY<0?0:1,Se=4;break;default:return!1}return!($e===void 0||Se===void 0||Se>4)&&Y.coreMouseService.triggerMouseEvent({col:Re.col,row:Re.row,x:Re.x,y:Re.y,button:Se,action:$e,ctrl:_e.ctrlKey,alt:_e.altKey,shift:_e.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:_e=>(se(_e),_e.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(_e)),wheel:_e=>(se(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&se(_e)},mousemove:_e=>{_e.buttons||se(_e)}};this.register(this.coreMouseService.onProtocolChange((_e=>{_e?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(_e)),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&_e?re.mousemove||(j.addEventListener("mousemove",ve.mousemove),re.mousemove=ve.mousemove):(j.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&_e?re.wheel||(j.addEventListener("wheel",ve.wheel,{passive:!1}),re.wheel=ve.wheel):(j.removeEventListener("wheel",re.wheel),re.wheel=null),2&_e?re.mouseup||(re.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&_e?re.mousedrag||(re.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return se(_e),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(_e)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(_e=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(_e)===!1)return!1;if(!this.buffer.hasScrollback){const Re=this.viewport.getLinesScrolled(_e);if(Re===0)return;const Se=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let $e="";for(let je=0;je<Math.abs(Re);je++)$e+=Se;return this.coreService.triggerDataEvent($e,!0),this.cancel(_e,!0)}return this.viewport.handleWheel(_e)?this.cancel(_e):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(Y,j){var se;(se=this._renderService)==null||se.refreshRows(Y,j)}updateCursorStyle(Y){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(Y)?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(Y,j,se=0){var re;se===1?(super.scrollLines(Y,j,se),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(Y)}paste(Y){(0,p.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,j,se){this._selectionService.setSelection(Y,j,se)}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 Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,j){var se;(se=this._selectionService)==null||se.selectLines(Y,j)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!j&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const se=(0,z.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),se.type===3||se.type===2){const re=this.rows-1;return this.scrollLines(se.type===2?-re:re),this.cancel(Y,!0)}return se.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(se.cancel&&this.cancel(Y,!0),!se.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(se.key!==X.C0.ETX&&se.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:se.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(se.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,j){const se=Y.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||Y.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||Y.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?se:se&&(!j.keyCode||j.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)j=Y.charCode;else if(Y.which===null||Y.which===void 0)j=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;j=Y.which}return!(!j||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=Y.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(Y),!0}return!1}resize(Y,j){Y!==this.cols||j!==this.rows?super.resize(Y,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,j){var se,re;(se=this._charSizeService)==null||se.measure(),(re=this.viewport)==null||re.syncScrollArea(!0)}clear(){var Y;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var j,se;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(se=this.viewport)==null||se.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),se=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${se};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ve};${re}t`)}}cancel(Y,j){if(this.options.cancelEvents||j)return Y.preventDefault(),Y.stopPropagation(),!1}}a.Terminal=oe},9924:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(d,p=1e3){this._renderCallback=d,this._debounceThresholdMS=p,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,p,y){this._rowCount=y,d=d!==void 0?d:0,p=p!==void 0?p:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,p):p;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const S=f-this._lastRefreshMs,b=this._debounceThresholdMS-S;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const d=Math.max(this._rowStart,0),p=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,p)}}},1680:function(R,a,d){var p=this&&this.__decorate||function(u,l,h,v){var C,L=arguments.length,T=L<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,l,h,v);else for(var E=u.length-1;E>=0;E--)(C=u[E])&&(T=(L<3?C(T):L>3?C(l,h,T):C(l,h))||T);return L>3&&T&&Object.defineProperty(l,h,T),T},y=this&&this.__param||function(u,l){return function(h,v){l(h,v,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const f=d(3656),S=d(4725),b=d(8460),M=d(844),w=d(2585);let c=a.Viewport=class extends M.Disposable{constructor(u,l,h,v,C,L,T,E){super(),this._viewportElement=u,this._scrollArea=l,this._bufferService=h,this._optionsService=v,this._charSizeService=C,this._renderService=L,this._coreBrowserService=T,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,f.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.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(u){if(u)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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<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(u,l){const h=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&h<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const l=this._getPixelsScrolled(u);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(u,l){var E;let h,v="";const C=[],L=l??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let N=u;N<L;N++){const W=T.get(N);if(!W)continue;const K=(E=T.get(N+1))==null?void 0:E.isWrapped;if(v+=W.translateToString(!K),!K||N===T.length-1){const I=document.createElement("div");I.textContent=v,C.push(I),v.length>0&&(h=I),v=""}}return{bufferElements:C,cursorElement:h}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let l=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(u,l){const h=this._optionsService.rawOptions.fastScrollModifier;return h==="alt"&&l.altKey||h==="ctrl"&&l.ctrlKey||h==="shift"&&l.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const l=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(u,l))}};a.Viewport=c=p([y(2,w.IBufferService),y(3,w.IOptionsService),y(4,S.ICharSizeService),y(5,S.IRenderService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],c)},3107:function(R,a,d){var p=this&&this.__decorate||function(w,c,u,l){var h,v=arguments.length,C=v<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,c,u,l);else for(var L=w.length-1;L>=0;L--)(h=w[L])&&(C=(v<3?h(C):v>3?h(c,u,C):h(c,u))||C);return v>3&&C&&Object.defineProperty(c,u,C),C},y=this&&this.__param||function(w,c){return function(u,l){c(u,l,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const f=d(4725),S=d(844),b=d(2585);let M=a.BufferDecorationRenderer=class extends S.Disposable{constructor(w,c,u,l,h){super(),this._screenElement=w,this._bufferService=c,this._coreBrowserService=u,this._decorationService=l,this._renderService=h,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((v=>this._removeDecoration(v)))),this.register((0,S.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var l;const c=this._coreBrowserService.mainDocument.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((l=w==null?void 0:w.options)==null?void 0:l.layer)==="top"),c.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=w.options.x??0;return u&&u>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(w,c),c}_refreshStyle(w){const c=w.marker.line-this._bufferService.buffers.active.ydisp;if(c<0||c>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let u=this._decorationElements.get(w);u||(u=this._createElement(w),w.element=u,this._decorationElements.set(w,u),this._container.appendChild(u),w.onDispose((()=>{this._decorationElements.delete(w),u.remove()}))),u.style.top=c*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(u)}}_refreshXPosition(w,c=w.element){if(!c)return;const u=w.options.x??0;(w.options.anchor||"left")==="right"?c.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":c.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var c;(c=this._decorationElements.get(w))==null||c.remove(),this._decorationElements.delete(w),w.dispose()}};a.BufferDecorationRenderer=M=p([y(1,b.IBufferService),y(2,f.ICoreBrowserService),y(3,b.IDecorationService),y(4,f.IRenderService)],M)},5871:(R,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(d){if(d.options.overviewRulerOptions){for(const p of this._zones)if(p.color===d.options.overviewRulerOptions.color&&p.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(p,d.marker.line))return;if(this._lineAdjacentToZone(p,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(p,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,p){return p>=d.startBufferLine&&p<=d.endBufferLine}_lineAdjacentToZone(d,p,y){return p>=d.startBufferLine-this._linePadding[y||"full"]&&p<=d.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(d,p){d.startBufferLine=Math.min(d.startBufferLine,p),d.endBufferLine=Math.max(d.endBufferLine,p)}}},5744:function(R,a,d){var p=this&&this.__decorate||function(h,v,C,L){var T,E=arguments.length,N=E<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(h,v,C,L);else for(var W=h.length-1;W>=0;W--)(T=h[W])&&(N=(E<3?T(N):E>3?T(v,C,N):T(v,C))||N);return E>3&&N&&Object.defineProperty(v,C,N),N},y=this&&this.__param||function(h,v){return function(C,L){v(C,L,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const f=d(5871),S=d(4725),b=d(844),M=d(2585),w={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let l=a.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(h,v,C,L,T,E,N){var K;super(),this._viewportElement=h,this._screenElement=v,this._bufferService=C,this._decorationService=L,this._renderService=T,this._optionsService=E,this._coreBrowserService=N,this._colorZoneStore=new f.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(),(K=this._viewportElement.parentElement)==null||K.insertBefore(this._canvas,this._viewportElement);const W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var I;(I=this._canvas)==null||I.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const h=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);c.full=this._canvas.width,c.left=h,c.center=v,c.right=h,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=c.left,u.right=c.left+c.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const h=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(h,12),6)*this._coreBrowserService.dpr);w.left=v,w.center=v,w.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const h=this._colorZoneStore.zones;for(const v of h)v.position!=="full"&&this._renderColorZone(v);for(const v of h)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(h){this._ctx.fillStyle=h.color,this._ctx.fillRect(u[h.position||"full"],Math.round((this._canvas.height-1)*(h.startBufferLine/this._bufferService.buffers.active.lines.length)-w[h.position||"full"]/2),c[h.position||"full"],Math.round((this._canvas.height-1)*((h.endBufferLine-h.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[h.position||"full"]))}_queueRefresh(h,v){this._shouldUpdateDimensions=h||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=l=p([y(2,M.IBufferService),y(3,M.IDecorationService),y(4,S.IRenderService),y(5,M.IOptionsService),y(6,S.ICoreBrowserService)],l)},2950:function(R,a,d){var p=this&&this.__decorate||function(w,c,u,l){var h,v=arguments.length,C=v<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,u):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(w,c,u,l);else for(var L=w.length-1;L>=0;L--)(h=w[L])&&(C=(v<3?h(C):v>3?h(c,u,C):h(c,u))||C);return v>3&&C&&Object.defineProperty(c,u,C),C},y=this&&this.__param||function(w,c){return function(u,l){c(u,l,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const f=d(4725),S=d(2585),b=d(2584);let M=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,c,u,l,h,v){this._textarea=w,this._compositionView=c,this._bufferService=u,this._optionsService=l,this._coreService=h,this._renderService=v,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const c={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,c.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(c.start,c.end):this._textarea.value.substring(c.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const c=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(c,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const c=this._textarea.value,u=c.replace(w,"");this._dataAlreadySent=u,c.length>w.length?this._coreService.triggerDataEvent(u,!0):c.length<w.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):c.length===w.length&&c!==w&&this._coreService.triggerDataEvent(c,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const c=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,h=c*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=h+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const v=this._compositionView.getBoundingClientRect();this._textarea.style.left=h+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(v.width,1)+"px",this._textarea.style.height=Math.max(v.height,1)+"px",this._textarea.style.lineHeight=v.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=M=p([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,S.ICoreService),y(5,f.IRenderService)],M)},9806:(R,a)=>{function d(p,y,f){const S=f.getBoundingClientRect(),b=p.getComputedStyle(f),M=parseInt(b.getPropertyValue("padding-left")),w=parseInt(b.getPropertyValue("padding-top"));return[y.clientX-S.left-M,y.clientY-S.top-w]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=d,a.getCoords=function(p,y,f,S,b,M,w,c,u){if(!M)return;const l=d(p,y,f);return l?(l[0]=Math.ceil((l[0]+(u?w/2:0))/w),l[1]=Math.ceil(l[1]/c),l[0]=Math.min(Math.max(l[0],1),S+(u?1:0)),l[1]=Math.min(Math.max(l[1],1),b),l):void 0}},9504:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const p=d(2584);function y(c,u,l,h){const v=c-f(c,l),C=u-f(u,l),L=Math.abs(v-C)-(function(T,E,N){let W=0;const K=T-f(T,N),I=E-f(E,N);for(let B=0;B<Math.abs(K-I);B++){const U=S(T,E)==="A"?-1:1,$=N.buffer.lines.get(K+U*B);$!=null&&$.isWrapped&&W++}return W})(c,u,l);return w(L,M(S(c,u),h))}function f(c,u){let l=0,h=u.buffer.lines.get(c),v=h==null?void 0:h.isWrapped;for(;v&&c>=0&&c<u.rows;)l++,h=u.buffer.lines.get(--c),v=h==null?void 0:h.isWrapped;return l}function S(c,u){return c>u?"A":"B"}function b(c,u,l,h,v,C){let L=c,T=u,E="";for(;L!==l||T!==h;)L+=v?1:-1,v&&L>C.cols-1?(E+=C.buffer.translateBufferLineToString(T,!1,c,L),L=0,c=0,T++):!v&&L<0&&(E+=C.buffer.translateBufferLineToString(T,!1,0,c+1),L=C.cols-1,c=L,T--);return E+C.buffer.translateBufferLineToString(T,!1,c,L)}function M(c,u){const l=u?"O":"[";return p.C0.ESC+l+c}function w(c,u){c=Math.floor(c);let l="";for(let h=0;h<c;h++)l+=u;return l}a.moveToCellSequence=function(c,u,l,h){const v=l.buffer.x,C=l.buffer.y;if(!l.buffer.hasScrollback)return(function(E,N,W,K,I,B){return y(N,K,I,B).length===0?"":w(b(E,N,E,N-f(N,I),!1,I).length,M("D",B))})(v,C,0,u,l,h)+y(C,u,l,h)+(function(E,N,W,K,I,B){let U;U=y(N,K,I,B).length>0?K-f(K,I):N;const $=K,V=(function(X,z,D,O,A,H){let Q;return Q=y(D,O,A,H).length>0?O-f(O,A):z,X<D&&Q<=O||X>=D&&Q<O?"C":"D"})(E,N,W,K,I,B);return w(b(E,U,W,$,V==="C",I).length,M(V,B))})(v,C,c,u,l,h);let L;if(C===u)return L=v>c?"D":"C",w(Math.abs(v-c),M(L,h));L=C>u?"D":"C";const T=Math.abs(C-u);return w((function(E,N){return N.cols-E})(C>u?c:v,l)+(T-1)*l.cols+1+((C>u?v:c)-1),M(L,h))}},1296:function(R,a,d){var p=this&&this.__decorate||function(B,U,$,V){var X,z=arguments.length,D=z<3?U:V===null?V=Object.getOwnPropertyDescriptor(U,$):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(B,U,$,V);else for(var O=B.length-1;O>=0;O--)(X=B[O])&&(D=(z<3?X(D):z>3?X(U,$,D):X(U,$))||D);return z>3&&D&&Object.defineProperty(U,$,D),D},y=this&&this.__param||function(B,U){return function($,V){U($,V,B)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const f=d(3787),S=d(2550),b=d(2223),M=d(6171),w=d(6052),c=d(4725),u=d(8055),l=d(8460),h=d(844),v=d(2585),C="xterm-dom-renderer-owner-",L="xterm-rows",T="xterm-fg-",E="xterm-bg-",N="xterm-focus",W="xterm-selection";let K=1,I=a.DomRenderer=class extends h.Disposable{constructor(B,U,$,V,X,z,D,O,A,H,Q,ne,oe){super(),this._terminal=B,this._document=U,this._element=$,this._screenElement=V,this._viewportElement=X,this._helperContainer=z,this._linkifier2=D,this._charSizeService=A,this._optionsService=H,this._bufferService=Q,this._coreBrowserService=ne,this._themeService=oe,this._terminalClass=K++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(W),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,M.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(C+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,h.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 S.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 B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),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 $ of this._rowElements)$.style.width=`${this.dimensions.css.canvas.width}px`,$.style.height=`${this.dimensions.css.cell.height}px`,$.style.lineHeight=`${this.dimensions.css.cell.height}px`,$.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const U=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=U,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(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let U=`${this._terminalSelector} .${L} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;U+=`${this._terminalSelector} .${L} .xterm-dim { color: ${u.color.multiplyOpacity(B.foreground,.5).css};}`,U+=`${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 $=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;U+=`@keyframes ${$} { 50% { border-bottom-style: hidden; }}`,U+=`@keyframes ${V} { 50% { box-shadow: none; }}`,U+=`@keyframes ${X} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,U+=`${this._terminalSelector} .${L}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${L}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${L}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,U+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[z,D]of B.ansi.entries())U+=`${this._terminalSelector} .${T}${z} { color: ${D.css}; }${this._terminalSelector} .${T}${z}.xterm-dim { color: ${u.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${E}${z} { background-color: ${D.css}; }`;U+=`${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(B.background).css}; }${this._terminalSelector} .${T}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${E}${b.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=U}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,U){for(let $=this._rowElements.length;$<=U;$++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>U;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,U){this._refreshRowElements(B,U),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,U,$){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,U,$),this.renderRows(0,this._bufferService.rows-1),!B||!U)return;this._selectionRenderModel.update(this._terminal,B,U,$);const V=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,z=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(z>=this._bufferService.rows||D<0)return;const O=this._document.createDocumentFragment();if($){const A=B[0]>U[0];O.appendChild(this._createSelectionElement(z,A?U[0]:B[0],A?B[0]:U[0],D-z+1))}else{const A=V===z?B[0]:0,H=z===X?U[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(z,A,H));const Q=D-z-1;if(O.appendChild(this._createSelectionElement(z+1,0,this._bufferService.cols,Q)),z!==D){const ne=X===D?U[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(D,0,ne))}}this._selectionContainer.appendChild(O)}_createSelectionElement(B,U,$,V=1){const X=this._document.createElement("div"),z=U*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*($-U);return z+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-z),X.style.height=V*this.dimensions.css.cell.height+"px",X.style.top=B*this.dimensions.css.cell.height+"px",X.style.left=`${z}px`,X.style.width=`${D}px`,X}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 B of this._rowElements)B.replaceChildren()}renderRows(B,U){const $=this._bufferService.buffer,V=$.ybase+$.y,X=Math.min($.x,this._bufferService.cols-1),z=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=B;A<=U;A++){const H=A+$.ydisp,Q=this._rowElements[A],ne=$.lines.get(H);if(!Q||!ne)break;Q.replaceChildren(...this._rowFactory.createRow(ne,H,H===V,D,O,X,z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${C}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,U,$,V,X,z){$<0&&(B=0),V<0&&(U=0);const D=this._bufferService.rows-1;$=Math.max(Math.min($,D),0),V=Math.max(Math.min(V,D),0),X=Math.min(X,this._bufferService.cols);const O=this._bufferService.buffer,A=O.ybase+O.y,H=Math.min(O.x,X-1),Q=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=$;ue<=V;++ue){const Y=ue+O.ydisp,j=this._rowElements[ue],se=O.lines.get(Y);if(!j||!se)break;j.replaceChildren(...this._rowFactory.createRow(se,Y,Y===A,ne,oe,H,Q,this.dimensions.css.cell.width,this._widthCache,z?ue===$?B:0:-1,z?(ue===V?U:X)-1:-1))}}};a.DomRenderer=I=p([y(7,v.IInstantiationService),y(8,c.ICharSizeService),y(9,v.IOptionsService),y(10,v.IBufferService),y(11,c.ICoreBrowserService),y(12,c.IThemeService)],I)},3787:function(R,a,d){var p=this&&this.__decorate||function(L,T,E,N){var W,K=arguments.length,I=K<3?T:N===null?N=Object.getOwnPropertyDescriptor(T,E):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(L,T,E,N);else for(var B=L.length-1;B>=0;B--)(W=L[B])&&(I=(K<3?W(I):K>3?W(T,E,I):W(T,E))||I);return K>3&&I&&Object.defineProperty(T,E,I),I},y=this&&this.__param||function(L,T){return function(E,N){T(E,N,L)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const f=d(2223),S=d(643),b=d(511),M=d(2585),w=d(8055),c=d(4725),u=d(4269),l=d(6171),h=d(3734);let v=a.DomRendererRowFactory=class{constructor(L,T,E,N,W,K,I){this._document=L,this._characterJoinerService=T,this._optionsService=E,this._coreBrowserService=N,this._coreService=W,this._decorationService=K,this._themeService=I,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,T,E){this._selectionStart=L,this._selectionEnd=T,this._columnSelectMode=E}createRow(L,T,E,N,W,K,I,B,U,$,V){const X=[],z=this._characterJoinerService.getJoinedCharacters(T),D=this._themeService.colors;let O,A=L.getNoBgTrimmedLength();E&&A<K+1&&(A=K+1);let H=0,Q="",ne=0,oe=0,ue=0,Y=!1,j=0,se=!1,re=0;const ve=[],_e=$!==-1&&V!==-1;for(let Re=0;Re<A;Re++){L.loadCell(Re,this._workCell);let Se=this._workCell.getWidth();if(Se===0)continue;let $e=!1,je=Re,xe=this._workCell;if(z.length>0&&Re===z[0][0]){$e=!0;const Ae=z.shift();xe=new u.JoinedCellData(this._workCell,L.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),je=Ae[1]-1,Se=xe.getWidth()}const Xe=this._isCellInSelection(Re,T),ft=E&&Re===K,_t=_e&&Re>=$&&Re<=V;let Ye=!1;this._decorationService.forEachDecorationAtCell(Re,T,void 0,(Ae=>{Ye=!0}));let Ge=xe.getChars()||S.WHITESPACE_CELL_CHAR;if(Ge===" "&&(xe.isUnderline()||xe.isOverline())&&(Ge=" "),re=Se*B-U.get(Ge,xe.isBold(),xe.isItalic()),O){if(H&&(Xe&&se||!Xe&&!se&&xe.bg===ne)&&(Xe&&se&&D.selectionForeground||xe.fg===oe)&&xe.extended.ext===ue&&_t===Y&&re===j&&!ft&&!$e&&!Ye){xe.isInvisible()?Q+=S.WHITESPACE_CELL_CHAR:Q+=Ge,H++;continue}H&&(O.textContent=Q),O=this._document.createElement("span"),H=0,Q=""}else O=this._document.createElement("span");if(ne=xe.bg,oe=xe.fg,ue=xe.extended.ext,Y=_t,j=re,se=Xe,$e&&K>=Re&&K<=je&&(K=Re),!this._coreService.isCursorHidden&&ft&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)I&&ve.push("xterm-cursor-blink"),ve.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(xe.isBold()&&ve.push("xterm-bold"),xe.isItalic()&&ve.push("xterm-italic"),xe.isDim()&&ve.push("xterm-dim"),Q=xe.isInvisible()?S.WHITESPACE_CELL_CHAR:xe.getChars()||S.WHITESPACE_CELL_CHAR,xe.isUnderline()&&(ve.push(`xterm-underline-${xe.extended.underlineStyle}`),Q===" "&&(Q=" "),!xe.isUnderlineColorDefault()))if(xe.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${h.AttributeData.toColorRGB(xe.getUnderlineColor()).join(",")})`;else{let Ae=xe.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&xe.isBold()&&Ae<8&&(Ae+=8),O.style.textDecorationColor=D.ansi[Ae].css}xe.isOverline()&&(ve.push("xterm-overline"),Q===" "&&(Q=" ")),xe.isStrikethrough()&&ve.push("xterm-strikethrough"),_t&&(O.style.textDecoration="underline");let Ke=xe.getFgColor(),Ft=xe.getFgColorMode(),it=xe.getBgColor(),ut=xe.getBgColorMode();const le=!!xe.isInverse();if(le){const Ae=Ke;Ke=it,it=Ae;const Wt=Ft;Ft=ut,ut=Wt}let ce,Ee,De,We=!1;switch(this._decorationService.forEachDecorationAtCell(Re,T,void 0,(Ae=>{Ae.options.layer!=="top"&&We||(Ae.backgroundColorRGB&&(ut=50331648,it=Ae.backgroundColorRGB.rgba>>8&16777215,ce=Ae.backgroundColorRGB),Ae.foregroundColorRGB&&(Ft=50331648,Ke=Ae.foregroundColorRGB.rgba>>8&16777215,Ee=Ae.foregroundColorRGB),We=Ae.options.layer==="top")})),!We&&Xe&&(ce=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,it=ce.rgba>>8&16777215,ut=50331648,We=!0,D.selectionForeground&&(Ft=50331648,Ke=D.selectionForeground.rgba>>8&16777215,Ee=D.selectionForeground)),We&&ve.push("xterm-decoration-top"),ut){case 16777216:case 33554432:De=D.ansi[it],ve.push(`xterm-bg-${it}`);break;case 50331648:De=w.channels.toColor(it>>16,it>>8&255,255&it),this._addStyle(O,`background-color:#${C((it>>>0).toString(16),"0",6)}`);break;default:le?(De=D.foreground,ve.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):De=D.background}switch(ce||xe.isDim()&&(ce=w.color.multiplyOpacity(De,.5)),Ft){case 16777216:case 33554432:xe.isBold()&&Ke<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Ke+=8),this._applyMinimumContrast(O,De,D.ansi[Ke],xe,ce,void 0)||ve.push(`xterm-fg-${Ke}`);break;case 50331648:const Ae=w.channels.toColor(Ke>>16&255,Ke>>8&255,255&Ke);this._applyMinimumContrast(O,De,Ae,xe,ce,Ee)||this._addStyle(O,`color:#${C(Ke.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,De,D.foreground,xe,ce,Ee)||le&&ve.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}ve.length&&(O.className=ve.join(" "),ve.length=0),ft||$e||Ye?O.textContent=Q:H++,re!==this.defaultSpacing&&(O.style.letterSpacing=`${re}px`),X.push(O),Re=je}return O&&H&&(O.textContent=Q),X}_applyMinimumContrast(L,T,E,N,W,K){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const I=this._getContrastCache(N);let B;if(W||K||(B=I.getColor(T.rgba,E.rgba)),B===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);B=w.color.ensureContrastRatio(W||T,K||E,U),I.setColor((W||T).rgba,(K||E).rgba,B??null)}return!!B&&(this._addStyle(L,`color:${B.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,T){L.setAttribute("style",`${L.getAttribute("style")||""}${T};`)}_isCellInSelection(L,T){const E=this._selectionStart,N=this._selectionEnd;return!(!E||!N)&&(this._columnSelectMode?E[0]<=N[0]?L>=E[0]&&T>=E[1]&&L<N[0]&&T<=N[1]:L<E[0]&&T>=E[1]&&L>=N[0]&&T<=N[1]:T>E[1]&&T<N[1]||E[1]===N[1]&&T===E[1]&&L>=E[0]&&L<N[0]||E[1]<N[1]&&T===N[1]&&L<N[0]||E[1]<N[1]&&T===E[1]&&L>=E[0])}};function C(L,T,E){for(;L.length<E;)L=T+L;return L}a.DomRendererRowFactory=v=p([y(1,c.ICharacterJoinerService),y(2,M.IOptionsService),y(3,c.ICoreBrowserService),y(4,M.ICoreService),y(5,M.IDecorationService),y(6,c.IThemeService)],v)},2550:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(d,p){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.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 y=d.createElement("span");y.classList.add("xterm-char-measure-element");const f=d.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const S=d.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontStyle="italic";const b=d.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[y,f,S,b],this._container.appendChild(y),this._container.appendChild(f),this._container.appendChild(S),this._container.appendChild(b),p.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(d,p,y,f){d===this._font&&p===this._fontSize&&y===this._weight&&f===this._weightBold||(this._font=d,this._fontSize=p,this._weight=y,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(d,p,y){let f=0;if(!p&&!y&&d.length===1&&(f=d.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const M=this._measure(d,0);return M>0&&(this._flat[f]=M),M}let S=d;p&&(S+="B"),y&&(S+="I");let b=this._holey.get(S);if(b===void 0){let M=0;p&&(M|=1),y&&(M|=2),b=this._measure(d,M),b>0&&this._holey.set(S,b)}return b}_measure(d,p){const y=this._measureElements[p];return y.textContent=d.repeat(32),y.offsetWidth/32}}},2223:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const p=d(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=p.isFirefox||p.isLegacyEdge?"bottom":"ideographic"},6171:(R,a)=>{function d(y){return 57508<=y&&y<=57558}function p(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=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(y){if(!y)throw new Error("value must not be falsy");return y},a.isPowerlineGlyph=d,a.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},a.isEmoji=p,a.allowRescaling=function(y,f,S,b){return f===1&&S>Math.ceil(1.5*b)&&y!==void 0&&y>255&&!p(y)&&!d(y)&&!(function(M){return 57344<=M&&M<=63743})(y)},a.treatGlyphAsBackgroundColor=function(y){return d(y)||(function(f){return 9472<=f&&f<=9631})(y)},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(y,f,S=0){return(y-(2*Math.round(f)-S))%(2*Math.round(f))}},6052:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class d{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(y,f,S,b=!1){if(this.selectionStart=f,this.selectionEnd=S,!f||!S||f[0]===S[0]&&f[1]===S[1])return void this.clear();const M=y.buffers.active.ydisp,w=f[1]-M,c=S[1]-M,u=Math.max(w,0),l=Math.min(c,y.rows-1);u>=y.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=w,this.viewportEndRow=c,this.viewportCappedStartRow=u,this.viewportCappedEndRow=l,this.startCol=f[0],this.endCol=S[0])}isCellSelected(y,f,S){return!!this.hasSelection&&(S-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&S>=this.viewportCappedStartRow&&f<this.endCol&&S<=this.viewportCappedEndRow:f<this.startCol&&S>=this.viewportCappedStartRow&&f>=this.endCol&&S<=this.viewportCappedEndRow:S>this.viewportStartRow&&S<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&S===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&S===this.viewportStartRow&&f>=this.startCol)}}a.createSelectionRenderModel=function(){return new d}},456:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(d){this._bufferService=d,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 d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,p=this.selectionEnd;return!(!d||!p)&&(d[1]>p[1]||d[1]===p[1]&&d[0]>p[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,a,d){var p=this&&this.__decorate||function(l,h,v,C){var L,T=arguments.length,E=T<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,h,v,C);else for(var N=l.length-1;N>=0;N--)(L=l[N])&&(E=(T<3?L(E):T>3?L(h,v,E):L(h,v))||E);return T>3&&E&&Object.defineProperty(h,v,E),E},y=this&&this.__param||function(l,h){return function(v,C){h(v,C,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const f=d(2585),S=d(8460),b=d(844);let M=a.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,h,v){super(),this._optionsService=v,this.width=0,this.height=0,this._onCharSizeChange=this.register(new S.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new c(l,h,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};a.CharSizeService=M=p([y(2,f.IOptionsService)],M);class w extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(h,v){h!==void 0&&h>0&&v!==void 0&&v>0&&(this._result.width=h,this._result.height=v)}}class c extends w{constructor(h,v,C){super(),this._document=h,this._parentElement=v,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 u extends w{constructor(h){super(),this._optionsService=h,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const v=this._ctx.measureText("W");if(!("width"in v&&"fontBoundingBoxAscent"in v&&"fontBoundingBoxDescent"in v))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const h=this._ctx.measureText("W");return this._validateAndSet(h.width,h.fontBoundingBoxAscent+h.fontBoundingBoxDescent),this._result}}},4269:function(R,a,d){var p=this&&this.__decorate||function(u,l,h,v){var C,L=arguments.length,T=L<3?l:v===null?v=Object.getOwnPropertyDescriptor(l,h):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(u,l,h,v);else for(var E=u.length-1;E>=0;E--)(C=u[E])&&(T=(L<3?C(T):L>3?C(l,h,T):C(l,h))||T);return L>3&&T&&Object.defineProperty(l,h,T),T},y=this&&this.__param||function(u,l){return function(h,v){l(h,v,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const f=d(3734),S=d(643),b=d(511),M=d(2585);class w extends f.AttributeData{constructor(l,h,v){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=h,this._width=v}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=w;let c=a.CharacterJoinerService=class Xf{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const h={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(h),h.id}deregister(l){for(let h=0;h<this._characterJoiners.length;h++)if(this._characterJoiners[h].id===l)return this._characterJoiners.splice(h,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const h=this._bufferService.buffer.lines.get(l);if(!h||h.length===0)return[];const v=[],C=h.translateToString(!0);let L=0,T=0,E=0,N=h.getFg(0),W=h.getBg(0);for(let K=0;K<h.getTrimmedLength();K++)if(h.loadCell(K,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==W){if(K-L>1){const I=this._getJoinedRanges(C,E,T,h,L);for(let B=0;B<I.length;B++)v.push(I[B])}L=K,E=T,N=this._workCell.fg,W=this._workCell.bg}T+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const K=this._getJoinedRanges(C,E,T,h,L);for(let I=0;I<K.length;I++)v.push(K[I])}return v}_getJoinedRanges(l,h,v,C,L){const T=l.substring(h,v);let E=[];try{E=this._characterJoiners[0].handler(T)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const W=this._characterJoiners[N].handler(T);for(let K=0;K<W.length;K++)Xf._mergeRanges(E,W[K])}catch(W){console.error(W)}return this._stringRangesToCellRanges(E,C,L),E}_stringRangesToCellRanges(l,h,v){let C=0,L=!1,T=0,E=l[C];if(E){for(let N=v;N<this._bufferService.cols;N++){const W=h.getWidth(N),K=h.getString(N).length||S.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!L&&E[0]<=T&&(E[0]=N,L=!0),E[1]<=T){if(E[1]=N,E=l[++C],!E)break;E[0]<=T?(E[0]=N,L=!0):L=!1}T+=K}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(l,h){let v=!1;for(let C=0;C<l.length;C++){const L=l[C];if(v){if(h[1]<=L[0])return l[C-1][1]=h[1],l;if(h[1]<=L[1])return l[C-1][1]=Math.max(h[1],L[1]),l.splice(C,1),l;l.splice(C,1),C--}else{if(h[1]<=L[0])return l.splice(C,0,h),l;if(h[1]<=L[1])return L[0]=Math.min(h[0],L[0]),l;h[0]<L[1]&&(L[0]=Math.min(h[0],L[0]),v=!0)}}return v?l[l.length-1][1]=h[1]:l.push(h),l}};a.CharacterJoinerService=c=p([y(0,M.IBufferService)],c)},5114:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const p=d(844),y=d(8460),f=d(3656);class S extends p.Disposable{constructor(w,c,u){super(),this._textarea=w,this._window=c,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,y.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(w){this._window!==w&&(this._window=w,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=S;class b extends p.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new p.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,p.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,f.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const p=d(844);class y extends p.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,p.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(S){return this.linkProviders.push(S),{dispose:()=>{const b=this.linkProviders.indexOf(S);b!==-1&&this.linkProviders.splice(b,1)}}}}a.LinkProviderService=y},8934:function(R,a,d){var p=this&&this.__decorate||function(M,w,c,u){var l,h=arguments.length,v=h<3?w:u===null?u=Object.getOwnPropertyDescriptor(w,c):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(M,w,c,u);else for(var C=M.length-1;C>=0;C--)(l=M[C])&&(v=(h<3?l(v):h>3?l(w,c,v):l(w,c))||v);return h>3&&v&&Object.defineProperty(w,c,v),v},y=this&&this.__param||function(M,w){return function(c,u){w(c,u,M)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const f=d(4725),S=d(9806);let b=a.MouseService=class{constructor(M,w){this._renderService=M,this._charSizeService=w}getCoords(M,w,c,u,l){return(0,S.getCoords)(window,M,w,c,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(M,w){const c=(0,S.getCoordsRelativeToElement)(window,M,w);if(this._charSizeService.hasValidSize)return c[0]=Math.min(Math.max(c[0],0),this._renderService.dimensions.css.canvas.width-1),c[1]=Math.min(Math.max(c[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(c[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(c[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(c[0]),y:Math.floor(c[1])}}};a.MouseService=b=p([y(0,f.IRenderService),y(1,f.ICharSizeService)],b)},3230:function(R,a,d){var p=this&&this.__decorate||function(l,h,v,C){var L,T=arguments.length,E=T<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,h,v,C);else for(var N=l.length-1;N>=0;N--)(L=l[N])&&(E=(T<3?L(E):T>3?L(h,v,E):L(h,v))||E);return T>3&&E&&Object.defineProperty(h,v,E),E},y=this&&this.__param||function(l,h){return function(v,C){h(v,C,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const f=d(6193),S=d(4725),b=d(8460),M=d(844),w=d(7226),c=d(2585);let u=a.RenderService=class extends M.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,h,v,C,L,T,E,N){super(),this._rowCount=l,this._charSizeService=C,this._renderer=this.register(new M.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new M.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((W,K)=>this._renderRows(W,K)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var W;return(W=this._renderer.value)==null?void 0:W.clear()}))),this.register(v.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(v.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(v.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,h),this.register(E.onWindowChange((W=>this._registerIntersectionObserver(W,h))))}_registerIntersectionObserver(l,h){if("IntersectionObserver"in l){const v=new l.IntersectionObserver((C=>this._handleIntersectionChange(C[C.length-1])),{threshold:0});v.observe(h),this._observerDisposable.value=(0,M.toDisposable)((()=>v.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,h,v=!1){this._isPaused?this._needsFullRefresh=!0:(v||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,h,this._rowCount))}_renderRows(l,h){this._renderer.value&&(l=Math.min(l,this._rowCount-1),h=Math.min(h,this._rowCount-1),this._renderer.value.renderRows(l,h),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:h}),this._onRender.fire({start:l,end:h}),this._isNextRenderRedrawOnly=!0)}resize(l,h){this._rowCount=h,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((h=>this.refreshRows(h.start,h.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,h;this._renderer.value&&((h=(l=this._renderer.value).clearTextureAtlas)==null||h.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,h){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var v;return(v=this._renderer.value)==null?void 0:v.handleResize(l,h)})):this._renderer.value.handleResize(l,h),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,h,v){var C;this._selectionState.start=l,this._selectionState.end=h,this._selectionState.columnSelectMode=v,(C=this._renderer.value)==null||C.handleSelectionChanged(l,h,v)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};a.RenderService=u=p([y(2,c.IOptionsService),y(3,S.ICharSizeService),y(4,c.IDecorationService),y(5,c.IBufferService),y(6,S.ICoreBrowserService),y(7,S.IThemeService)],u)},9312:function(R,a,d){var p=this&&this.__decorate||function(E,N,W,K){var I,B=arguments.length,U=B<3?N:K===null?K=Object.getOwnPropertyDescriptor(N,W):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(E,N,W,K);else for(var $=E.length-1;$>=0;$--)(I=E[$])&&(U=(B<3?I(U):B>3?I(N,W,U):I(N,W))||U);return B>3&&U&&Object.defineProperty(N,W,U),U},y=this&&this.__param||function(E,N){return function(W,K){N(W,K,E)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const f=d(9806),S=d(9504),b=d(456),M=d(4725),w=d(8460),c=d(844),u=d(6114),l=d(4841),h=d(511),v=d(2585),C=" ",L=new RegExp(C,"g");let T=a.SelectionService=class extends c.Disposable{constructor(E,N,W,K,I,B,U,$,V){super(),this._element=E,this._screenElement=N,this._linkifier=W,this._bufferService=K,this._coreService=I,this._mouseService=B,this._optionsService=U,this._renderService=$,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,c.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 E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!E||!N||E[0]===N[0]&&E[1]===N[1])}get selectionText(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!E||!N)return"";const W=this._bufferService.buffer,K=[];if(this._activeSelectionMode===3){if(E[0]===N[0])return"";const I=E[0]<N[0]?E[0]:N[0],B=E[0]<N[0]?N[0]:E[0];for(let U=E[1];U<=N[1];U++){const $=W.translateBufferLineToString(U,!0,I,B);K.push($)}}else{const I=E[1]===N[1]?N[0]:void 0;K.push(W.translateBufferLineToString(E[1],!0,E[0],I));for(let B=E[1]+1;B<=N[1]-1;B++){const U=W.lines.get(B),$=W.translateBufferLineToString(B,!0);U!=null&&U.isWrapped?K[K.length-1]+=$:K.push($)}if(E[1]!==N[1]){const B=W.lines.get(N[1]),U=W.translateBufferLineToString(N[1],!0,0,N[0]);B&&B.isWrapped?K[K.length-1]+=U:K.push(U)}}return K.map((I=>I.replace(L," "))).join(u.isWindows?`\r
45
+ `:`
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&E&&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(E){const N=this._getMouseBufferCoords(E),W=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!!(W&&K&&N)&&this._areCoordsInSelection(N,W,K)}isCellInSelection(E,N){const W=this._model.finalSelectionStart,K=this._model.finalSelectionEnd;return!(!W||!K)&&this._areCoordsInSelection([E,N],W,K)}_areCoordsInSelection(E,N,W){return E[1]>N[1]&&E[1]<W[1]||N[1]===W[1]&&E[1]===N[1]&&E[0]>=N[0]&&E[0]<W[0]||N[1]<W[1]&&E[1]===W[1]&&E[0]<W[0]||N[1]<W[1]&&E[1]===N[1]&&E[0]>=N[0]}_selectWordAtCursor(E,N){var I,B;const W=(B=(I=this._linkifier.currentLink)==null?void 0:I.link)==null?void 0:B.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const K=this._getMouseBufferCoords(E);return!!K&&(this._selectWordAt(K,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,N){this._model.clearSelection(),E=Math.max(E,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const N=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(E){let N=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=W?0:(N>W&&(N-=W),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(E){return u.isMac?E.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:E.shiftKey}handleMouseDown(E){if(this._mouseDownTimeStamp=E.timeStamp,(E.button!==2||!this.hasSelection)&&E.button===0){if(!this._enabled){if(!this.shouldForceSelection(E))return;E.stopPropagation()}E.preventDefault(),this._dragScrollAmount=0,this._enabled&&E.shiftKey?this._handleIncrementalClick(E):E.detail===1?this._handleSingleClick(E):E.detail===2?this._handleDoubleClick(E):E.detail===3&&this._handleTripleClick(E),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(E){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(E))}_handleSingleClick(E){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(E)?3:0,this._model.selectionStart=this._getMouseBufferCoords(E),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const N=this._getMouseBufferCoords(E);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(E){return E.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const N=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!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(E),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const K=W.lines.get(this._model.selectionEnd[1]);K&&K.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 E=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(E.ydisp+this._bufferService.rows,E.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=E.ydisp),this.refresh()}}_handleMouseUp(E){const N=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const K=(0,S.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(K,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,W=!(!E||!N||E[0]===N[0]&&E[1]===N[1]);W?E&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,N,W)):this._oldHasSelection&&this._fireOnSelectionChange(E,N,W)}_fireOnSelectionChange(E,N,W){this._oldSelectionStart=E,this._oldSelectionEnd=N,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(E,N){let W=N;for(let K=0;N>=K;K++){const I=E.loadCell(K,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:I>1&&N!==K&&(W+=I-1)}return W}setSelection(E,N,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,N],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,N,W=!0,K=!0){if(E[0]>=this._bufferService.cols)return;const I=this._bufferService.buffer,B=I.lines.get(E[1]);if(!B)return;const U=I.translateBufferLineToString(E[1],!1);let $=this._convertViewportColToCharacterIndex(B,E[0]),V=$;const X=E[0]-$;let z=0,D=0,O=0,A=0;if(U.charAt($)===" "){for(;$>0&&U.charAt($-1)===" ";)$--;for(;V<U.length&&U.charAt(V+1)===" ";)V++}else{let ne=E[0],oe=E[0];B.getWidth(ne)===0&&(z++,ne--),B.getWidth(oe)===2&&(D++,oe++);const ue=B.getString(oe).length;for(ue>1&&(A+=ue-1,V+=ue-1);ne>0&&$>0&&!this._isCharWordSeparator(B.loadCell(ne-1,this._workCell));){B.loadCell(ne-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(z++,ne--):Y>1&&(O+=Y-1,$-=Y-1),$--,ne--}for(;oe<B.length&&V+1<U.length&&!this._isCharWordSeparator(B.loadCell(oe+1,this._workCell));){B.loadCell(oe+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,oe++):Y>1&&(A+=Y-1,V+=Y-1),V++,oe++}}V++;let H=$+X-z+O,Q=Math.min(this._bufferService.cols,V-$+z+D-O-A);if(N||U.slice($,V).trim()!==""){if(W&&H===0&&B.getCodePoint(0)!==32){const ne=I.lines.get(E[1]-1);if(ne&&B.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const oe=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(oe){const ue=this._bufferService.cols-oe.start;H-=ue,Q+=ue}}}if(K&&H+Q===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const ne=I.lines.get(E[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const oe=this._getWordAt([0,E[1]+1],!1,!1,!0);oe&&(Q+=oe.length)}}return{start:H,length:Q}}}_selectWordAt(E,N){const W=this._getWordAt(E,N);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[W.start,E[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(E){const N=this._getWordAt(E,!0);if(N){let W=E[1];for(;N.start<0;)N.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,W]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const N=this._bufferService.buffer.getWrappedRangeForLine(E),W={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(W,this._bufferService.cols)}};a.SelectionService=T=p([y(3,v.IBufferService),y(4,v.ICoreService),y(5,M.IMouseService),y(6,v.IOptionsService),y(7,M.IRenderService),y(8,M.ICoreBrowserService)],T)},4725:(R,a,d)=>{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 p=d(8343);a.ICharSizeService=(0,p.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,p.createDecorator)("CoreBrowserService"),a.IMouseService=(0,p.createDecorator)("MouseService"),a.IRenderService=(0,p.createDecorator)("RenderService"),a.ISelectionService=(0,p.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,p.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,p.createDecorator)("ThemeService"),a.ILinkProviderService=(0,p.createDecorator)("LinkProviderService")},6731:function(R,a,d){var p=this&&this.__decorate||function(T,E,N,W){var K,I=arguments.length,B=I<3?E:W===null?W=Object.getOwnPropertyDescriptor(E,N):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(T,E,N,W);else for(var U=T.length-1;U>=0;U--)(K=T[U])&&(B=(I<3?K(B):I>3?K(E,N,B):K(E,N))||B);return I>3&&B&&Object.defineProperty(E,N,B),B},y=this&&this.__param||function(T,E){return function(N,W){E(N,W,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const f=d(7239),S=d(8055),b=d(8460),M=d(844),w=d(2585),c=S.css.toColor("#ffffff"),u=S.css.toColor("#000000"),l=S.css.toColor("#ffffff"),h=S.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let N=0;N<216;N++){const W=E[N/36%6|0],K=E[N/6%6|0],I=E[N%6];T.push({css:S.channels.toCss(W,K,I),rgba:S.channels.toRgba(W,K,I)})}for(let N=0;N<24;N++){const W=8+10*N;T.push({css:S.channels.toCss(W,W,W),rgba:S.channels.toRgba(W,W,W)})}return T})());let C=a.ThemeService=class extends M.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:u,cursor:l,cursorAccent:h,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:S.color.blend(u,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:S.color.blend(u,v),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(T={}){const E=this._colors;if(E.foreground=L(T.foreground,c),E.background=L(T.background,u),E.cursor=L(T.cursor,l),E.cursorAccent=L(T.cursorAccent,h),E.selectionBackgroundTransparent=L(T.selectionBackground,v),E.selectionBackgroundOpaque=S.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=L(T.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=S.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=T.selectionForeground?L(T.selectionForeground,S.NULL_COLOR):void 0,E.selectionForeground===S.NULL_COLOR&&(E.selectionForeground=void 0),S.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=S.color.opacity(E.selectionBackgroundTransparent,.3)),S.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=S.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=a.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=L(T.black,a.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=L(T.red,a.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=L(T.green,a.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=L(T.yellow,a.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=L(T.blue,a.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=L(T.magenta,a.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=L(T.cyan,a.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=L(T.white,a.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=L(T.brightBlack,a.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=L(T.brightRed,a.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=L(T.brightGreen,a.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=L(T.brightYellow,a.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=L(T.brightBlue,a.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=L(T.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=L(T.brightCyan,a.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=L(T.brightWhite,a.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const N=Math.min(E.ansi.length-16,T.extendedAnsi.length);for(let W=0;W<N;W++)E.ansi[W+16]=L(T.extendedAnsi[W],a.DEFAULT_ANSI_COLORS[W+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){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[T]=this._restoreColors.ansi[T]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(T){T(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 L(T,E){if(T!==void 0)try{return S.css.toColor(T)}catch{}return E}a.ThemeService=C=p([y(0,w.IOptionsService)],C)},6349:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const p=d(8460),y=d(844);class f extends y.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new p.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new p.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new p.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(b){if(this._maxLength===b)return;const M=new Array(b);for(let w=0;w<Math.min(b,this.length);w++)M[w]=this._array[this._getCyclicIndex(w)];this._array=M,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let M=this._length;M<b;M++)this._array[M]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,M){this._array[this._getCyclicIndex(b)]=M}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,M,...w){if(M){for(let c=b;c<this._length-M;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+M)];this._length-=M,this.onDeleteEmitter.fire({index:b,amount:M})}for(let c=this._length-1;c>=b;c--)this._array[this._getCyclicIndex(c+w.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<w.length;c++)this._array[this._getCyclicIndex(b+c)]=w[c];if(w.length&&this.onInsertEmitter.fire({index:b,amount:w.length}),this._length+w.length>this._maxLength){const c=this._length+w.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=w.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,M,w){if(!(M<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let u=M-1;u>=0;u--)this.set(b+u+w,this.get(b+u));const c=b+M+w-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<M;c++)this.set(b+c+w,this.get(b+c))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}a.CircularList=f},1439:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function d(p,y=5){if(typeof p!="object")return p;const f=Array.isArray(p)?[]:{};for(const S in p)f[S]=y<=1?p[S]:p[S]&&d(p[S],y-1);return f}},8055:(R,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 d=0,p=0,y=0,f=0;var S,b,M,w,c;function u(h){const v=h.toString(16);return v.length<2?"0"+v:v}function l(h,v){return h<v?(v+.05)/(h+.05):(h+.05)/(v+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(h){h.toCss=function(v,C,L,T){return T!==void 0?`#${u(v)}${u(C)}${u(L)}${u(T)}`:`#${u(v)}${u(C)}${u(L)}`},h.toRgba=function(v,C,L,T=255){return(v<<24|C<<16|L<<8|T)>>>0},h.toColor=function(v,C,L,T){return{css:h.toCss(v,C,L,T),rgba:h.toRgba(v,C,L,T)}}})(S||(a.channels=S={})),(function(h){function v(C,L){return f=Math.round(255*L),[d,p,y]=c.toChannels(C.rgba),{css:S.toCss(d,p,y,f),rgba:S.toRgba(d,p,y,f)}}h.blend=function(C,L){if(f=(255&L.rgba)/255,f===1)return{css:L.css,rgba:L.rgba};const T=L.rgba>>24&255,E=L.rgba>>16&255,N=L.rgba>>8&255,W=C.rgba>>24&255,K=C.rgba>>16&255,I=C.rgba>>8&255;return d=W+Math.round((T-W)*f),p=K+Math.round((E-K)*f),y=I+Math.round((N-I)*f),{css:S.toCss(d,p,y),rgba:S.toRgba(d,p,y)}},h.isOpaque=function(C){return(255&C.rgba)==255},h.ensureContrastRatio=function(C,L,T){const E=c.ensureContrastRatio(C.rgba,L.rgba,T);if(E)return S.toColor(E>>24&255,E>>16&255,E>>8&255)},h.opaque=function(C){const L=(255|C.rgba)>>>0;return[d,p,y]=c.toChannels(L),{css:S.toCss(d,p,y),rgba:L}},h.opacity=v,h.multiplyOpacity=function(C,L){return f=255&C.rgba,v(C,f*L/255)},h.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}})(b||(a.color=b={})),(function(h){let v,C;try{const L=document.createElement("canvas");L.width=1,L.height=1;const T=L.getContext("2d",{willReadFrequently:!0});T&&(v=T,v.globalCompositeOperation="copy",C=v.createLinearGradient(0,0,1,1))}catch{}h.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return d=parseInt(L.slice(1,2).repeat(2),16),p=parseInt(L.slice(2,3).repeat(2),16),y=parseInt(L.slice(3,4).repeat(2),16),S.toColor(d,p,y);case 5:return d=parseInt(L.slice(1,2).repeat(2),16),p=parseInt(L.slice(2,3).repeat(2),16),y=parseInt(L.slice(3,4).repeat(2),16),f=parseInt(L.slice(4,5).repeat(2),16),S.toColor(d,p,y,f);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const T=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return d=parseInt(T[1]),p=parseInt(T[2]),y=parseInt(T[3]),f=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),S.toColor(d,p,y,f);if(!v||!C)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=C,v.fillStyle=L,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[d,p,y,f]=v.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(d,p,y,f),css:L}}})(M||(a.css=M={})),(function(h){function v(C,L,T){const E=C/255,N=L/255,W=T/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}h.relativeLuminance=function(C){return v(C>>16&255,C>>8&255,255&C)},h.relativeLuminance2=v})(w||(a.rgb=w={})),(function(h){function v(L,T,E){const N=L>>24&255,W=L>>16&255,K=L>>8&255;let I=T>>24&255,B=T>>16&255,U=T>>8&255,$=l(w.relativeLuminance2(I,B,U),w.relativeLuminance2(N,W,K));for(;$<E&&(I>0||B>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),B-=Math.max(0,Math.ceil(.1*B)),U-=Math.max(0,Math.ceil(.1*U)),$=l(w.relativeLuminance2(I,B,U),w.relativeLuminance2(N,W,K));return(I<<24|B<<16|U<<8|255)>>>0}function C(L,T,E){const N=L>>24&255,W=L>>16&255,K=L>>8&255;let I=T>>24&255,B=T>>16&255,U=T>>8&255,$=l(w.relativeLuminance2(I,B,U),w.relativeLuminance2(N,W,K));for(;$<E&&(I<255||B<255||U<255);)I=Math.min(255,I+Math.ceil(.1*(255-I))),B=Math.min(255,B+Math.ceil(.1*(255-B))),U=Math.min(255,U+Math.ceil(.1*(255-U))),$=l(w.relativeLuminance2(I,B,U),w.relativeLuminance2(N,W,K));return(I<<24|B<<16|U<<8|255)>>>0}h.blend=function(L,T){if(f=(255&T)/255,f===1)return T;const E=T>>24&255,N=T>>16&255,W=T>>8&255,K=L>>24&255,I=L>>16&255,B=L>>8&255;return d=K+Math.round((E-K)*f),p=I+Math.round((N-I)*f),y=B+Math.round((W-B)*f),S.toRgba(d,p,y)},h.ensureContrastRatio=function(L,T,E){const N=w.relativeLuminance(L>>8),W=w.relativeLuminance(T>>8);if(l(N,W)<E){if(W<N){const B=v(L,T,E),U=l(N,w.relativeLuminance(B>>8));if(U<E){const $=C(L,T,E);return U>l(N,w.relativeLuminance($>>8))?B:$}return B}const K=C(L,T,E),I=l(N,w.relativeLuminance(K>>8));if(I<E){const B=v(L,T,E);return I>l(N,w.relativeLuminance(B>>8))?K:B}return K}},h.reduceLuminance=v,h.increaseLuminance=C,h.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(c||(a.rgba=c={})),a.toPaddedHex=u,a.contrastRatio=l},8969:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const p=d(844),y=d(2585),f=d(4348),S=d(7866),b=d(744),M=d(7302),w=d(6975),c=d(8460),u=d(1753),l=d(1480),h=d(7994),v=d(9282),C=d(5435),L=d(5981),T=d(2660);let E=!1;class N extends p.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event((K=>{var I;(I=this._onScrollApi)==null||I.fire(K.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(K){for(const I in K)this.optionsService.options[I]=K[I]}constructor(K){super(),this._windowsWrappingHeuristics=this.register(new p.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new M.OptionsService(K)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(h.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(y.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,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((I=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((I=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((I,B)=>this._inputHandler.parse(I,B)))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(K,I){this._writeBuffer.write(K,I)}writeSync(K,I){this._logService.logLevel<=y.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(K,I)}input(K,I=!0){this.coreService.triggerDataEvent(K,I)}resize(K,I){isNaN(K)||isNaN(I)||(K=Math.max(K,b.MINIMUM_COLS),I=Math.max(I,b.MINIMUM_ROWS),this._bufferService.resize(K,I))}scroll(K,I=!1){this._bufferService.scroll(K,I)}scrollLines(K,I,B){this._bufferService.scrollLines(K,I,B)}scrollPages(K){this.scrollLines(K*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(K){const I=K-this._bufferService.buffer.ydisp;I!==0&&this.scrollLines(I)}registerEscHandler(K,I){return this._inputHandler.registerEscHandler(K,I)}registerDcsHandler(K,I){return this._inputHandler.registerDcsHandler(K,I)}registerCsiHandler(K,I){return this._inputHandler.registerCsiHandler(K,I)}registerOscHandler(K,I){return this._inputHandler.registerOscHandler(K,I)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let K=!1;const I=this.optionsService.rawOptions.windowsPty;I&&I.buildNumber!==void 0&&I.buildNumber!==void 0?K=I.backend==="conpty"&&I.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(K=!0),K?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const K=[];K.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),K.push(this.registerCsiHandler({final:"H"},(()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,p.toDisposable)((()=>{for(const I of K)I.dispose()}))}}}a.CoreTerminal=N},8460:(R,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=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let p=0;p<this._listeners.length;p++)if(this._listeners[p]===d)return void this._listeners.splice(p,1)}}})),this._event}fire(d,p){const y=[];for(let f=0;f<this._listeners.length;f++)y.push(this._listeners[f]);for(let f=0;f<y.length;f++)y[f].call(void 0,d,p)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(d,p){return d((y=>p.fire(y)))},a.runAndSubscribe=function(d,p){return p(void 0),d((y=>p(y)))}},5435:function(R,a,d){var p=this&&this.__decorate||function(z,D,O,A){var H,Q=arguments.length,ne=Q<3?D:A===null?A=Object.getOwnPropertyDescriptor(D,O):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(z,D,O,A);else for(var oe=z.length-1;oe>=0;oe--)(H=z[oe])&&(ne=(Q<3?H(ne):Q>3?H(D,O,ne):H(D,O))||ne);return Q>3&&ne&&Object.defineProperty(D,O,ne),ne},y=this&&this.__param||function(z,D){return function(O,A){D(O,A,z)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const f=d(2584),S=d(7116),b=d(2015),M=d(844),w=d(482),c=d(8437),u=d(8460),l=d(643),h=d(511),v=d(3734),C=d(2585),L=d(1480),T=d(6242),E=d(6351),N=d(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},K=131072;function I(z,D){if(z>24)return D.setWinLines||!1;switch(z){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var B;(function(z){z[z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",z[z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(a.WindowsOptionsReportType=B={}));let U=0;class $ extends M.Disposable{getAttrData(){return this._curAttrData}constructor(D,O,A,H,Q,ne,oe,ue,Y=new b.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=O,this._coreService=A,this._logService=H,this._optionsService=Q,this._oscLinkService=ne,this._coreMouseService=oe,this._unicodeService=ue,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new h.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,se)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:se.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,se,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:se,data:re})})),this._parser.setDcsHandlerFallback(((j,se,re)=>{se==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:se,payload:re})})),this._parser.setPrintHandler(((j,se,re)=>this.print(j,se,re))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(f.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(f.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(f.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(f.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(f.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(f.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(f.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(f.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(f.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(f.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new T.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new T.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new T.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new T.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new T.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new T.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new T.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new T.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new T.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new T.OscHandler((j=>this.restoreCursorColor(j)))),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 j in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((j,se)=>this.requestStatusString(j,se))))}_preserveStack(D,O,A,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=A,this._parseStack.position=H}_logSlowResolvingAsync(D){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([D,new Promise(((O,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((O=>{if(O!=="#SLOW_TIMEOUT")throw O;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,O){let A,H=this._activeBuffer.x,Q=this._activeBuffer.y,ne=0;const oe=this._parseStack.paused;if(oe){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(A),A;H=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>K&&(ne=this._parseStack.position+K)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,(j=>String.fromCharCode(j))).join("")}"`),typeof D=="string"?D.split("").map((j=>j.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<K&&(this._parseBuffer=new Uint32Array(Math.min(D.length,K))),oe||this._dirtyRowTracker.clearRange(),D.length>K)for(let j=ne;j<D.length;j+=K){const se=j+K<D.length?j+K:D.length,re=typeof D=="string"?this._stringDecoder.decode(D.substring(j,se),this._parseBuffer):this._utf8Decoder.decode(D.subarray(j,se),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,re))return this._preserveStack(H,Q,re,j),this._logSlowResolvingAsync(A),A}else if(!oe){const j=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,Q,j,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===H&&this._activeBuffer.y===Q||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(D,O,A){let H,Q;const ne=this._charsetService.charset,oe=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,se=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-O>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,se);let ve=this._parser.precedingJoinState;for(let _e=O;_e<A;++_e){if(H=D[_e],H<127&&ne){const je=ne[String.fromCharCode(H)];je&&(H=je.charCodeAt(0))}const Re=this._unicodeService.charProperties(H,ve);Q=L.UnicodeService.extractWidth(Re);const Se=L.UnicodeService.extractShouldJoin(Re),$e=Se?L.UnicodeService.extractWidth(ve):0;if(ve=Re,oe&&this._onA11yChar.fire((0,w.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-$e>ue){if(Y){const je=re;let xe=this._activeBuffer.x-$e;for(this._activeBuffer.x=$e,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),$e>0&&re instanceof c.BufferLine&&re.copyCellsFrom(je,xe,0,$e,!1);xe<ue;)je.setCellFromCodepoint(xe++,0,1,se)}else if(this._activeBuffer.x=ue-1,Q===2)continue}if(Se&&this._activeBuffer.x){const je=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-je,H,Q);for(let xe=Q-$e;--xe>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}else if(j&&(re.insertCells(this._activeBuffer.x,Q-$e,this._activeBuffer.getNullCell(se)),re.getWidth(ue-1)===2&&re.setCellFromCodepoint(ue-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,se)),re.setCellFromCodepoint(this._activeBuffer.x++,H,Q,se),Q>0)for(;--Q;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,se)}this._parser.precedingJoinState=ve,this._activeBuffer.x<ue&&A-O>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,se),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,O){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,O):this._parser.registerCsiHandler(D,(A=>!I(A.params[0],this._optionsService.rawOptions.windowOptions)||O(A)))}registerDcsHandler(D,O){return this._parser.registerDcsHandler(D,new E.DcsHandler(O))}registerEscHandler(D,O){return this._parser.registerEscHandler(D,O)}registerOscHandler(D,O){return this._parser.registerOscHandler(D,new T.OscHandler(O))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var D;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&D.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);O.hasWidth(this._activeBuffer.x)&&!O.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(D,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=D,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+O)}cursorUp(D){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const O=D.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=D.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=D.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const O=D.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,O,A,H=!1,Q=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);ne.replaceCells(O,A,this._activeBuffer.getNullCell(this._eraseAttrData()),Q),H&&(ne.isWrapped=!1)}_resetBufferLine(D,O=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),A.isWrapped=!1)}eraseInDisplay(D,O=!1){let A;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);A<this._bufferService.rows;A++)this._resetBufferLine(A,O);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,O);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(D,O=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,O);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,O)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let O=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;O--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let O=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;O--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let O=D.params[0]||1;for(;O--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(D){let O=D.params[0]||1;for(;O--;)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(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);H.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);H.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);H.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=D.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);H.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const O=this._parser.precedingJoinState;if(!O)return!0;const A=D.params[0]||1,H=L.UnicodeService.extractWidth(O),Q=this._activeBuffer.x-H,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),oe=new Uint32Array(ne.length*A);let ue=0;for(let j=0;j<ne.length;){const se=ne.codePointAt(j)||0;oe[ue++]=se,j+=se>65535?2:1}let Y=ue;for(let j=1;j<A;++j)oe.copyWithin(Y,0,ue),Y+=ue;return this.print(oe,0,Y),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let O=0;O<D.length;O++)switch(D.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),D.params[O]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(D,O){const A=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Q}=this._coreMouseService,ne=this._coreService,{buffers:oe,cols:ue}=this._bufferService,{active:Y,alt:j}=oe,se=this._optionsService.rawOptions,re=Se=>Se?1:2,ve=D.params[0];return _e=ve,Re=O?ve===2?4:ve===4?re(ne.modes.insertMode):ve===12?3:ve===20?re(se.convertEol):0:ve===1?re(A.applicationCursorKeys):ve===3?se.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:ve===6?re(A.origin):ve===7?re(A.wraparound):ve===8?3:ve===9?re(H==="X10"):ve===12?re(se.cursorBlink):ve===25?re(!ne.isCursorHidden):ve===45?re(A.reverseWraparound):ve===66?re(A.applicationKeypad):ve===67?4:ve===1e3?re(H==="VT200"):ve===1002?re(H==="DRAG"):ve===1003?re(H==="ANY"):ve===1004?re(A.sendFocus):ve===1005?4:ve===1006?re(Q==="SGR"):ve===1015?4:ve===1016?re(Q==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?re(Y===j):ve===2004?re(A.bracketedPasteMode):0,ne.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${_e};${Re}$y`),!0;var _e,Re}_updateAttrColor(D,O,A,H,Q){return O===2?(D|=50331648,D&=-16777216,D|=v.AttributeData.fromColorRGB([A,H,Q])):O===5&&(D&=-50331904,D|=33554432|255&A),D}_extractColor(D,O,A){const H=[0,0,-1,0,0,0];let Q=0,ne=0;do{if(H[ne+Q]=D.params[O+ne],D.hasSubParams(O+ne)){const oe=D.getSubParams(O+ne);let ue=0;do H[1]===5&&(Q=1),H[ne+ue+1+Q]=oe[ue];while(++ue<oe.length&&ue+ne+1+Q<H.length);break}if(H[1]===5&&ne+Q>=2||H[1]===2&&ne+Q>=5)break;H[1]&&(Q=1)}while(++ne+O<D.length&&ne+Q<H.length);for(let oe=2;oe<H.length;++oe)H[oe]===-1&&(H[oe]=0);switch(H[0]){case 38:A.fg=this._updateAttrColor(A.fg,H[1],H[3],H[4],H[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,H[1],H[3],H[4],H[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,H[1],H[3],H[4],H[5])}return ne}_processUnderline(D,O){O.extended=O.extended.clone(),(!~D||D>5)&&(D=1),O.extended.underlineStyle=D,O.fg|=268435456,D===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(D){D.fg=c.DEFAULT_ATTR_DATA.fg,D.bg=c.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=D.length;let A;const H=this._curAttrData;for(let Q=0;Q<O;Q++)A=D.params[Q],A>=30&&A<=37?(H.fg&=-50331904,H.fg|=16777216|A-30):A>=40&&A<=47?(H.bg&=-50331904,H.bg|=16777216|A-40):A>=90&&A<=97?(H.fg&=-50331904,H.fg|=16777224|A-90):A>=100&&A<=107?(H.bg&=-50331904,H.bg|=16777224|A-100):A===0?this._processSGR0(H):A===1?H.fg|=134217728:A===3?H.bg|=67108864:A===4?(H.fg|=268435456,this._processUnderline(D.hasSubParams(Q)?D.getSubParams(Q)[0]:1,H)):A===5?H.fg|=536870912:A===7?H.fg|=67108864:A===8?H.fg|=1073741824:A===9?H.fg|=2147483648:A===2?H.bg|=134217728:A===21?this._processUnderline(2,H):A===22?(H.fg&=-134217729,H.bg&=-134217729):A===23?H.bg&=-67108865:A===24?(H.fg&=-268435457,this._processUnderline(0,H)):A===25?H.fg&=-536870913:A===27?H.fg&=-67108865:A===28?H.fg&=-1073741825:A===29?H.fg&=2147483647:A===39?(H.fg&=-67108864,H.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):A===49?(H.bg&=-67108864,H.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?Q+=this._extractColor(D,Q,H):A===53?H.bg|=1073741824:A===55?H.bg&=-1073741825:A===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):A===100?(H.fg&=-67108864,H.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${A}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const O=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${A}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(D){const O=D.params[0]||1;switch(O){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 A=O%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(D){const O=D.params[0]||1;let A;return(D.length<2||(A=D.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(D){if(!I(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${f.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:O!==0&&O!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),O!==0&&O!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:O!==0&&O!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),O!==0&&O!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(D){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const O=[],A=D.split(";");for(;A.length>1;){const H=A.shift(),Q=A.shift();if(/^\d+$/.exec(H)){const ne=parseInt(H);if(X(ne))if(Q==="?")O.push({type:0,index:ne});else{const oe=(0,N.parseColor)(Q);oe&&O.push({type:1,index:ne,color:oe})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(D){const O=D.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(D,O){this._getCurrentLinkId()&&this._finishHyperlink();const A=D.split(":");let H;const Q=A.findIndex((ne=>ne.startsWith("id=")));return Q!==-1&&(H=A[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:O}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,O){const A=D.split(";");for(let H=0;H<A.length&&!(O>=this._specialColors.length);++H,++O)if(A[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const Q=(0,N.parseColor)(A[H]);Q&&this._onColor.fire([{type:1,index:this._specialColors[O],color:Q}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const O=[],A=D.split(";");for(let H=0;H<A.length;++H)if(/^\d+$/.exec(A[H])){const Q=parseInt(A[H]);X(Q)&&O.push({type:2,index:Q})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(W[D[0]],S.CHARSETS[D[1]]||S.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new h.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const A=this._activeBuffer.ybase+this._activeBuffer.y+O,H=this._activeBuffer.lines.get(A);H&&(H.fill(D),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,O){const A=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Q}${f.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,O){this._dirtyRowTracker.markRangeDirty(D,O)}}a.InputHandler=$;let V=class{constructor(z){this._bufferService=z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(z){z<this.start?this.start=z:z>this.end&&(this.end=z)}markRangeDirty(z,D){z>D&&(U=z,z=D,D=U),z<this.start&&(this.start=z),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(z){return 0<=z&&z<256}V=p([y(0,C.IBufferService)],V)},844:(R,a)=>{function d(p){for(const y of p)y.dispose();p.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 p of this._disposables)p.dispose();this._disposables.length=0}register(p){return this._disposables.push(p),p}unregister(p){const y=this._disposables.indexOf(p);y!==-1&&this._disposables.splice(y,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(p){var y;this._isDisposed||p===this._value||((y=this._value)==null||y.dispose(),this._value=p)}clear(){this.value=void 0}dispose(){var p;this._isDisposed=!0,(p=this._value)==null||p.dispose(),this._value=void 0}},a.toDisposable=function(p){return{dispose:p}},a.disposeArray=d,a.getDisposeArrayDisposable=function(p){return{dispose:()=>d(p)}}},1505:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(y,f,S){this._data[y]||(this._data[y]={}),this._data[y][f]=S}get(y,f){return this._data[y]?this._data[y][f]:void 0}clear(){this._data={}}}a.TwoKeyMap=d,a.FourKeyMap=class{constructor(){this._data=new d}set(p,y,f,S,b){this._data.get(p,y)||this._data.set(p,y,new d),this._data.get(p,y).set(f,S,b)}get(p,y,f,S){var b;return(b=this._data.get(p,y))==null?void 0:b.get(f,S)}clear(){this._data.clear()}}},6114:(R,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 d=a.isNode?"node":navigator.userAgent,p=a.isNode?"node":navigator.platform;a.isFirefox=d.includes("Firefox"),a.isLegacyEdge=d.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(d),a.getSafariVersion=function(){if(!a.isSafari)return 0;const y=d.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(p),a.isIpad=p==="iPad",a.isIphone=p==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(p),a.isLinux=p.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(d)},6106:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let d=0;a.SortedList=class{constructor(p){this._getKey=p,this._array=[]}clear(){this._array.length=0}insert(p){this._array.length!==0?(d=this._search(this._getKey(p)),this._array.splice(d,0,p)):this._array.push(p)}delete(p){if(this._array.length===0)return!1;const y=this._getKey(p);if(y===void 0||(d=this._search(y),d===-1)||this._getKey(this._array[d])!==y)return!1;do if(this._array[d]===p)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===y);return!1}*getKeyIterator(p){if(this._array.length!==0&&(d=this._search(p),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===p))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===p)}forEachByKey(p,y){if(this._array.length!==0&&(d=this._search(p),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===p))do y(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===p)}values(){return[...this._array].values()}_search(p){let y=0,f=this._array.length-1;for(;f>=y;){let S=y+f>>1;const b=this._getKey(this._array[S]);if(b>p)f=S-1;else{if(!(b<p)){for(;S>0&&this._getKey(this._array[S-1])===p;)S--;return S}y=S+1}}return y}}},7226:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const p=d(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let M=0,w=0,c=b.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(M=Date.now(),this._tasks[this._i]()||this._i++,M=Math.max(1,Date.now()-M),w=Math.max(M,w),u=b.timeRemaining(),1.5*w>u)return c-M<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-M))}ms`),void this._start();c=u}this.clear()}}class f extends y{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const M=Date.now()+b;return{timeRemaining:()=>Math.max(0,M-Date.now())}}}a.PriorityTaskQueue=f,a.IdleTaskQueue=!p.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:f,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const p=d(643);a.updateWindowsModeWrappedState=function(y){const f=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),S=f==null?void 0:f.get(y.cols-1),b=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);b&&S&&(b.isWrapped=S[p.CHAR_DATA_CODE_INDEX]!==p.NULL_CELL_CODE&&S[p.CHAR_DATA_CODE_INDEX]!==p.WHITESPACE_CELL_CODE)}},3734:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new p}static toColorRGB(f){return[f>>>16&255,f>>>8&255,255&f]}static fromColorRGB(f){return(255&f[0])<<16|(255&f[1])<<8|255&f[2]}clone(){const f=new d;return f.fg=this.fg,f.bg=this.bg,f.extended=this.extended.clone(),f}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=d;class p{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(f){this._ext=f}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(f){this._ext&=-469762049,this._ext|=f<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(f){this._ext&=-67108864,this._ext|=67108863&f}get urlId(){return this._urlId}set urlId(f){this._urlId=f}get underlineVariantOffset(){const f=(3758096384&this._ext)>>29;return f<0?4294967288^f:f}set underlineVariantOffset(f){this._ext&=536870911,this._ext|=f<<29&3758096384}constructor(f=0,S=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=S}clone(){return new p(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=p},9092:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const p=d(6349),y=d(7226),f=d(3734),S=d(8437),b=d(4634),M=d(511),w=d(643),c=d(4863),u=d(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(l,h,v){this._hasScrollback=l,this._optionsService=h,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=M.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=M.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,h){return new S.BufferLine(this._bufferService.cols,this.getNullCell(l),h)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const h=l+this._optionsService.rawOptions.scrollback;return h>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:h}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=S.DEFAULT_ATTR_DATA);let h=this._rows;for(;h--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new p.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,h){const v=this.getNullCell(S.DEFAULT_ATTR_DATA);let C=0;const L=this._getCorrectBufferLength(h);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<l)for(let E=0;E<this.lines.length;E++)C+=+this.lines.get(E).resize(l,v);let T=0;if(this._rows<h)for(let E=this._rows;E<h;E++)this.lines.length<h+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(l,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(l,v)));else for(let E=this._rows;E>h;E--)this.lines.length>h+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const E=this.lines.length-L;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=L}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,h-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=h-1,this._isReflowEnabled&&(this._reflow(l,h),this._cols>l))for(let T=0;T<this.lines.length;T++)C+=+this.lines.get(T).resize(l,v);this._cols=l,this._rows=h,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let h=0;for(;this._memoryCleanupPosition<this.lines.length;)if(h+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),h>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,h){this._cols!==l&&(l>this._cols?this._reflowLarger(l,h):this._reflowSmaller(l,h))}_reflowLarger(l,h){const v=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(v.length>0){const C=(0,b.reflowLargerCreateNewLayout)(this.lines,v);(0,b.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(l,h,C.countRemoved)}}_reflowLargerAdjustViewport(l,h,v){const C=this.getNullCell(S.DEFAULT_ATTR_DATA);let L=v;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<h&&this.lines.push(new S.BufferLine(l,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(l,h){const v=this.getNullCell(S.DEFAULT_ATTR_DATA),C=[];let L=0;for(let T=this.lines.length-1;T>=0;T--){let E=this.lines.get(T);if(!E||!E.isWrapped&&E.getTrimmedLength()<=l)continue;const N=[E];for(;E.isWrapped&&T>0;)E=this.lines.get(--T),N.unshift(E);const W=this.ybase+this.y;if(W>=T&&W<T+N.length)continue;const K=N[N.length-1].getTrimmedLength(),I=(0,b.reflowSmallerGetNewLineLengths)(N,this._cols,l),B=I.length-N.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const $=[];for(let A=0;A<B;A++){const H=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);$.push(H)}$.length>0&&(C.push({start:T+N.length+L,newLines:$}),L+=$.length),N.push(...$);let V=I.length-1,X=I[V];X===0&&(V--,X=I[V]);let z=N.length-B-1,D=K;for(;z>=0;){const A=Math.min(D,X);if(N[V]===void 0)break;if(N[V].copyCellsFrom(N[z],D-A,X-A,A,!0),X-=A,X===0&&(V--,X=I[V]),D-=A,D===0){z--;const H=Math.max(z,0);D=(0,b.getWrappedLineTrimmedLength)(N,H,this._cols)}}for(let A=0;A<N.length;A++)I[A]<l&&N[A].setCell(I[A],v);let O=B-U;for(;O-- >0;)this.ybase===0?this.y<h-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-h&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+h-1)}if(C.length>0){const T=[],E=[];for(let V=0;V<this.lines.length;V++)E.push(this.lines.get(V));const N=this.lines.length;let W=N-1,K=0,I=C[K];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let B=0;for(let V=Math.min(this.lines.maxLength-1,N+L-1);V>=0;V--)if(I&&I.start>W+B){for(let X=I.newLines.length-1;X>=0;X--)this.lines.set(V--,I.newLines[X]);V++,T.push({index:W+1,amount:I.newLines.length}),B+=I.newLines.length,I=C[++K]}else this.lines.set(V,E[W--]);let U=0;for(let V=T.length-1;V>=0;V--)T[V].index+=U,this.lines.onInsertEmitter.fire(T[V]),U+=T[V].amount;const $=Math.max(0,N+L-this.lines.maxLength);$>0&&this.lines.onTrimEmitter.fire($)}}translateBufferLineToString(l,h,v=0,C){const L=this.lines.get(l);return L?L.translateToString(h,v,C):""}getWrappedRangeForLine(l){let h=l,v=l;for(;h>0&&this.lines.get(h).isWrapped;)h--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:h,last:v}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].line===l&&(this.markers[h].dispose(),this.markers.splice(h--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const h=new c.Marker(l);return this.markers.push(h),h.register(this.lines.onTrim((v=>{h.line-=v,h.line<0&&h.dispose()}))),h.register(this.lines.onInsert((v=>{h.line>=v.index&&(h.line+=v.amount)}))),h.register(this.lines.onDelete((v=>{h.line>=v.index&&h.line<v.index+v.amount&&h.dispose(),h.line>v.index&&(h.line-=v.amount)}))),h.register(h.onDispose((()=>this._removeMarker(h)))),h}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const p=d(3734),y=d(511),f=d(643),S=d(482);a.DEFAULT_ATTR_DATA=Object.freeze(new p.AttributeData);let b=0;class M{constructor(c,u,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const h=u||y.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let v=0;v<c;++v)this.setCell(v,h);this.length=c}get(c){const u=this._data[3*c+0],l=2097151&u;return[this._data[3*c+1],2097152&u?this._combined[c]:l?(0,S.stringFromCodePoint)(l):"",u>>22,2097152&u?this._combined[c].charCodeAt(this._combined[c].length-1):l]}set(c,u){this._data[3*c+1]=u[f.CHAR_DATA_ATTR_INDEX],u[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=u[1],this._data[3*c+0]=2097152|c|u[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=u[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const u=this._data[3*c+0];return 2097152&u?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&u}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const u=this._data[3*c+0];return 2097152&u?this._combined[c]:2097151&u?(0,S.stringFromCodePoint)(2097151&u):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,u){return b=3*c,u.content=this._data[b+0],u.fg=this._data[b+1],u.bg=this._data[b+2],2097152&u.content&&(u.combinedData=this._combined[c]),268435456&u.bg&&(u.extended=this._extendedAttrs[c]),u}setCell(c,u){2097152&u.content&&(this._combined[c]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[c]=u.extended),this._data[3*c+0]=u.content,this._data[3*c+1]=u.fg,this._data[3*c+2]=u.bg}setCellFromCodepoint(c,u,l,h){268435456&h.bg&&(this._extendedAttrs[c]=h.extended),this._data[3*c+0]=u|l<<22,this._data[3*c+1]=h.fg,this._data[3*c+2]=h.bg}addCodepointToCell(c,u,l){let h=this._data[3*c+0];2097152&h?this._combined[c]+=(0,S.stringFromCodePoint)(u):2097151&h?(this._combined[c]=(0,S.stringFromCodePoint)(2097151&h)+(0,S.stringFromCodePoint)(u),h&=-2097152,h|=2097152):h=u|4194304,l&&(h&=-12582913,h|=l<<22),this._data[3*c+0]=h}insertCells(c,u,l){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length-c){const h=new y.CellData;for(let v=this.length-c-u-1;v>=0;--v)this.setCell(c+u+v,this.loadCell(c+v,h));for(let v=0;v<u;++v)this.setCell(c+v,l)}else for(let h=c;h<this.length;++h)this.setCell(h,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(c,u,l){if(c%=this.length,u<this.length-c){const h=new y.CellData;for(let v=0;v<this.length-c-u;++v)this.setCell(c+v,this.loadCell(c+u+v,h));for(let v=this.length-u;v<this.length;++v)this.setCell(v,l)}else for(let h=c;h<this.length;++h)this.setCell(h,l);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,l)}replaceCells(c,u,l,h=!1){if(h)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,l);c<u&&c<this.length;)this.isProtected(c)||this.setCell(c,l),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,l),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,l);c<u&&c<this.length;)this.setCell(c++,l)}resize(c,u){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const h=new Uint32Array(l);h.set(this._data),this._data=h}for(let h=this.length;h<c;++h)this.setCell(h,u)}else{this._data=this._data.subarray(0,l);const h=Object.keys(this._combined);for(let C=0;C<h.length;C++){const L=parseInt(h[C],10);L>=c&&delete this._combined[L]}const v=Object.keys(this._extendedAttrs);for(let C=0;C<v.length;C++){const L=parseInt(v[C],10);L>=c&&delete this._extendedAttrs[L]}}return this.length=c,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,u=!1){if(u)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,c);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const u in c._combined)this._combined[u]=c._combined[u];this._extendedAttrs={};for(const u in c._extendedAttrs)this._extendedAttrs[u]=c._extendedAttrs[u];this.isWrapped=c.isWrapped}clone(){const c=new M(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const u in this._combined)c._combined[u]=this._combined[u];for(const u in this._extendedAttrs)c._extendedAttrs[u]=this._extendedAttrs[u];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,u,l,h,v){const C=c._data;if(v)for(let T=h-1;T>=0;T--){for(let E=0;E<3;E++)this._data[3*(l+T)+E]=C[3*(u+T)+E];268435456&C[3*(u+T)+2]&&(this._extendedAttrs[l+T]=c._extendedAttrs[u+T])}else for(let T=0;T<h;T++){for(let E=0;E<3;E++)this._data[3*(l+T)+E]=C[3*(u+T)+E];268435456&C[3*(u+T)+2]&&(this._extendedAttrs[l+T]=c._extendedAttrs[u+T])}const L=Object.keys(c._combined);for(let T=0;T<L.length;T++){const E=parseInt(L[T],10);E>=u&&(this._combined[E-u+l]=c._combined[E])}}translateToString(c,u,l,h){u=u??0,l=l??this.length,c&&(l=Math.min(l,this.getTrimmedLength())),h&&(h.length=0);let v="";for(;u<l;){const C=this._data[3*u+0],L=2097151&C,T=2097152&C?this._combined[u]:L?(0,S.stringFromCodePoint)(L):f.WHITESPACE_CELL_CHAR;if(v+=T,h)for(let E=0;E<T.length;++E)h.push(u);u+=C>>22||1}return h&&h.push(u),v}}a.BufferLine=M},4841:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(d,p){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return p*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(R,a)=>{function d(p,y,f){if(y===p.length-1)return p[y].getTrimmedLength();const S=!p[y].hasContent(f-1)&&p[y].getWidth(f-1)===1,b=p[y+1].getWidth(0)===2;return S&&b?f-1:f}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(p,y,f,S,b){const M=[];for(let w=0;w<p.length-1;w++){let c=w,u=p.get(++c);if(!u.isWrapped)continue;const l=[p.get(w)];for(;c<p.length&&u.isWrapped;)l.push(u),u=p.get(++c);if(S>=w&&S<c){w+=l.length-1;continue}let h=0,v=d(l,h,y),C=1,L=0;for(;C<l.length;){const E=d(l,C,y),N=E-L,W=f-v,K=Math.min(N,W);l[h].copyCellsFrom(l[C],L,v,K,!1),v+=K,v===f&&(h++,v=0),L+=K,L===E&&(C++,L=0),v===0&&h!==0&&l[h-1].getWidth(f-1)===2&&(l[h].copyCellsFrom(l[h-1],f-1,v++,1,!1),l[h-1].setCell(f-1,b))}l[h].replaceCells(v,f,b);let T=0;for(let E=l.length-1;E>0&&(E>h||l[E].getTrimmedLength()===0);E--)T++;T>0&&(M.push(w+l.length-T),M.push(T)),w+=l.length-1}return M},a.reflowLargerCreateNewLayout=function(p,y){const f=[];let S=0,b=y[S],M=0;for(let w=0;w<p.length;w++)if(b===w){const c=y[++S];p.onDeleteEmitter.fire({index:w-M,amount:c}),w+=c-1,M+=c,b=y[++S]}else f.push(w);return{layout:f,countRemoved:M}},a.reflowLargerApplyNewLayout=function(p,y){const f=[];for(let S=0;S<y.length;S++)f.push(p.get(y[S]));for(let S=0;S<f.length;S++)p.set(S,f[S]);p.length=y.length},a.reflowSmallerGetNewLineLengths=function(p,y,f){const S=[],b=p.map(((u,l)=>d(p,l,y))).reduce(((u,l)=>u+l));let M=0,w=0,c=0;for(;c<b;){if(b-c<f){S.push(b-c);break}M+=f;const u=d(p,w,y);M>u&&(M-=u,w++);const l=p[w].getWidth(M-1)===2;l&&M--;const h=l?f-1:f;S.push(h),c+=h}return S},a.getWrappedLineTrimmedLength=d},5295:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const p=d(8460),y=d(844),f=d(9092);class S extends y.Disposable{constructor(M,w){super(),this._optionsService=M,this._bufferService=w,this._onBufferActivate=this.register(new p.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 f.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new f.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(M){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(M),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(M,w){this._normal.resize(M,w),this._alt.resize(M,w),this.setupTabStops(M)}setupTabStops(M){this._normal.setupTabStops(M),this._alt.setupTabStops(M)}}a.BufferSet=S},511:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const p=d(482),y=d(643),f=d(3734);class S extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(M){const w=new S;return w.setFromCharData(M),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,p.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(M){this.fg=M[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(M[y.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(M[y.CHAR_DATA_CHAR_INDEX].length===2){const c=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const u=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(c-55296)+u-56320+65536|M[y.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[y.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=M[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|M[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=S},643:(R,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:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const p=d(8460),y=d(844);class f{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}a.Marker=f,f._nextId=1},7116:(R,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:(R,a)=>{var d,p,y;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(f){f.NUL="\0",f.SOH="",f.STX="",f.ETX="",f.EOT="",f.ENQ="",f.ACK="",f.BEL="\x07",f.BS="\b",f.HT=" ",f.LF=`
47
+ `,f.VT="\v",f.FF="\f",f.CR="\r",f.SO="",f.SI="",f.DLE="",f.DC1="",f.DC2="",f.DC3="",f.DC4="",f.NAK="",f.SYN="",f.ETB="",f.CAN="",f.EM="",f.SUB="",f.ESC="\x1B",f.FS="",f.GS="",f.RS="",f.US="",f.SP=" ",f.DEL=""})(d||(a.C0=d={})),(function(f){f.PAD="€",f.HOP="",f.BPH="‚",f.NBH="ƒ",f.IND="„",f.NEL="…",f.SSA="†",f.ESA="‡",f.HTS="ˆ",f.HTJ="‰",f.VTS="Š",f.PLD="‹",f.PLU="Œ",f.RI="",f.SS2="Ž",f.SS3="",f.DCS="",f.PU1="‘",f.PU2="’",f.STS="“",f.CCH="”",f.MW="•",f.SPA="–",f.EPA="—",f.SOS="˜",f.SGCI="™",f.SCI="š",f.CSI="›",f.ST="œ",f.OSC="",f.PM="ž",f.APC="Ÿ"})(p||(a.C1=p={})),(function(f){f.ST=`${d.ESC}\\`})(y||(a.C1_ESCAPED=y={}))},7399:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const p=d(2584),y={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(f,S,b,M){const w={type:0,cancel:!1,key:void 0},c=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?w.key=S?p.C0.ESC+"OA":p.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?w.key=S?p.C0.ESC+"OD":p.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?w.key=S?p.C0.ESC+"OC":p.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(w.key=S?p.C0.ESC+"OB":p.C0.ESC+"[B");break;case 8:w.key=f.ctrlKey?"\b":p.C0.DEL,f.altKey&&(w.key=p.C0.ESC+w.key);break;case 9:if(f.shiftKey){w.key=p.C0.ESC+"[Z";break}w.key=p.C0.HT,w.cancel=!0;break;case 13:w.key=f.altKey?p.C0.ESC+p.C0.CR:p.C0.CR,w.cancel=!0;break;case 27:w.key=p.C0.ESC,f.altKey&&(w.key=p.C0.ESC+p.C0.ESC),w.cancel=!0;break;case 37:if(f.metaKey)break;c?(w.key=p.C0.ESC+"[1;"+(c+1)+"D",w.key===p.C0.ESC+"[1;3D"&&(w.key=p.C0.ESC+(b?"b":"[1;5D"))):w.key=S?p.C0.ESC+"OD":p.C0.ESC+"[D";break;case 39:if(f.metaKey)break;c?(w.key=p.C0.ESC+"[1;"+(c+1)+"C",w.key===p.C0.ESC+"[1;3C"&&(w.key=p.C0.ESC+(b?"f":"[1;5C"))):w.key=S?p.C0.ESC+"OC":p.C0.ESC+"[C";break;case 38:if(f.metaKey)break;c?(w.key=p.C0.ESC+"[1;"+(c+1)+"A",b||w.key!==p.C0.ESC+"[1;3A"||(w.key=p.C0.ESC+"[1;5A")):w.key=S?p.C0.ESC+"OA":p.C0.ESC+"[A";break;case 40:if(f.metaKey)break;c?(w.key=p.C0.ESC+"[1;"+(c+1)+"B",b||w.key!==p.C0.ESC+"[1;3B"||(w.key=p.C0.ESC+"[1;5B")):w.key=S?p.C0.ESC+"OB":p.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(w.key=p.C0.ESC+"[2~");break;case 46:w.key=c?p.C0.ESC+"[3;"+(c+1)+"~":p.C0.ESC+"[3~";break;case 36:w.key=c?p.C0.ESC+"[1;"+(c+1)+"H":S?p.C0.ESC+"OH":p.C0.ESC+"[H";break;case 35:w.key=c?p.C0.ESC+"[1;"+(c+1)+"F":S?p.C0.ESC+"OF":p.C0.ESC+"[F";break;case 33:f.shiftKey?w.type=2:f.ctrlKey?w.key=p.C0.ESC+"[5;"+(c+1)+"~":w.key=p.C0.ESC+"[5~";break;case 34:f.shiftKey?w.type=3:f.ctrlKey?w.key=p.C0.ESC+"[6;"+(c+1)+"~":w.key=p.C0.ESC+"[6~";break;case 112:w.key=c?p.C0.ESC+"[1;"+(c+1)+"P":p.C0.ESC+"OP";break;case 113:w.key=c?p.C0.ESC+"[1;"+(c+1)+"Q":p.C0.ESC+"OQ";break;case 114:w.key=c?p.C0.ESC+"[1;"+(c+1)+"R":p.C0.ESC+"OR";break;case 115:w.key=c?p.C0.ESC+"[1;"+(c+1)+"S":p.C0.ESC+"OS";break;case 116:w.key=c?p.C0.ESC+"[15;"+(c+1)+"~":p.C0.ESC+"[15~";break;case 117:w.key=c?p.C0.ESC+"[17;"+(c+1)+"~":p.C0.ESC+"[17~";break;case 118:w.key=c?p.C0.ESC+"[18;"+(c+1)+"~":p.C0.ESC+"[18~";break;case 119:w.key=c?p.C0.ESC+"[19;"+(c+1)+"~":p.C0.ESC+"[19~";break;case 120:w.key=c?p.C0.ESC+"[20;"+(c+1)+"~":p.C0.ESC+"[20~";break;case 121:w.key=c?p.C0.ESC+"[21;"+(c+1)+"~":p.C0.ESC+"[21~";break;case 122:w.key=c?p.C0.ESC+"[23;"+(c+1)+"~":p.C0.ESC+"[23~";break;case 123:w.key=c?p.C0.ESC+"[24;"+(c+1)+"~":p.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(b&&!M||!f.altKey||f.metaKey)!b||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?w.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(w.key=p.C0.US),f.key==="@"&&(w.key=p.C0.NUL)):f.keyCode===65&&(w.type=1);else{const u=y[f.keyCode],l=u==null?void 0:u[f.shiftKey?1:0];if(l)w.key=p.C0.ESC+l;else if(f.keyCode>=65&&f.keyCode<=90){const h=f.ctrlKey?f.keyCode-64:f.keyCode+32;let v=String.fromCharCode(h);f.shiftKey&&(v=v.toUpperCase()),w.key=p.C0.ESC+v}else if(f.keyCode===32)w.key=p.C0.ESC+(f.ctrlKey?p.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let h=f.code.slice(3,4);f.shiftKey||(h=h.toLowerCase()),w.key=p.C0.ESC+h,w.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?w.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?w.key=p.C0.NUL:f.keyCode>=51&&f.keyCode<=55?w.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?w.key=p.C0.DEL:f.keyCode===219?w.key=p.C0.ESC:f.keyCode===220?w.key=p.C0.FS:f.keyCode===221&&(w.key=p.C0.GS)}return w}},482:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},a.utf32ToString=function(d,p=0,y=d.length){let f="";for(let S=p;S<y;++S){let b=d[S];b>65535?(b-=65536,f+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):f+=String.fromCharCode(b)}return f},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,p){const y=d.length;if(!y)return 0;let f=0,S=0;if(this._interim){const b=d.charCodeAt(S++);56320<=b&&b<=57343?p[f++]=1024*(this._interim-55296)+b-56320+65536:(p[f++]=this._interim,p[f++]=b),this._interim=0}for(let b=S;b<y;++b){const M=d.charCodeAt(b);if(55296<=M&&M<=56319){if(++b>=y)return this._interim=M,f;const w=d.charCodeAt(b);56320<=w&&w<=57343?p[f++]=1024*(M-55296)+w-56320+65536:(p[f++]=M,p[f++]=w)}else M!==65279&&(p[f++]=M)}return f}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,p){const y=d.length;if(!y)return 0;let f,S,b,M,w=0,c=0,u=0;if(this.interim[0]){let v=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let L,T=0;for(;(L=63&this.interim[++T])&&T<4;)C<<=6,C|=L;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=E-T;for(;u<N;){if(u>=y)return 0;if(L=d[u++],(192&L)!=128){u--,v=!0;break}this.interim[T++]=L,C<<=6,C|=63&L}v||(E===2?C<128?u--:p[w++]=C:E===3?C<2048||C>=55296&&C<=57343||C===65279||(p[w++]=C):C<65536||C>1114111||(p[w++]=C)),this.interim.fill(0)}const l=y-4;let h=u;for(;h<y;){for(;!(!(h<l)||128&(f=d[h])||128&(S=d[h+1])||128&(b=d[h+2])||128&(M=d[h+3]));)p[w++]=f,p[w++]=S,p[w++]=b,p[w++]=M,h+=4;if(f=d[h++],f<128)p[w++]=f;else if((224&f)==192){if(h>=y)return this.interim[0]=f,w;if(S=d[h++],(192&S)!=128){h--;continue}if(c=(31&f)<<6|63&S,c<128){h--;continue}p[w++]=c}else if((240&f)==224){if(h>=y)return this.interim[0]=f,w;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=y)return this.interim[0]=f,this.interim[1]=S,w;if(b=d[h++],(192&b)!=128){h--;continue}if(c=(15&f)<<12|(63&S)<<6|63&b,c<2048||c>=55296&&c<=57343||c===65279)continue;p[w++]=c}else if((248&f)==240){if(h>=y)return this.interim[0]=f,w;if(S=d[h++],(192&S)!=128){h--;continue}if(h>=y)return this.interim[0]=f,this.interim[1]=S,w;if(b=d[h++],(192&b)!=128){h--;continue}if(h>=y)return this.interim[0]=f,this.interim[1]=S,this.interim[2]=b,w;if(M=d[h++],(192&M)!=128){h--;continue}if(c=(7&f)<<18|(63&S)<<12|(63&b)<<6|63&M,c<65536||c>1114111)continue;p[w++]=c}}return w}}},225:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const p=d(1480),y=[[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]],f=[[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 S;a.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let b=0;b<y.length;++b)S.fill(0,y[b][0],y[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?S[b]:(function(M,w){let c,u=0,l=w.length-1;if(M<w[0][0]||M>w[l][1])return!1;for(;l>=u;)if(c=u+l>>1,M>w[c][1])u=c+1;else{if(!(M<w[c][0]))return!0;l=c-1}return!1})(b,f)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,M){let w=this.wcwidth(b),c=w===0&&M!==0;if(c){const u=p.UnicodeService.extractWidth(M);u===0?c=!1:u>w&&(w=u)}return p.UnicodeService.createPropertyValue(0,w,c)}}},5981:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const p=d(8460),y=d(844);class f extends y.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,M){if(M!==void 0&&this._syncCalls>M)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,M){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(M),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(M)}_innerWrite(b=0,M=!0){const w=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],u=this._action(c,M);if(u){const h=v=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,v))):this._innerWrite(w,v);return void u.catch((v=>(queueMicrotask((()=>{throw v})),Promise.resolve(!1)))).then(h)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=c.length,Date.now()-w>=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=f},5941:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const d=/^([\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})$/,p=/^[\da-f]+$/;function y(f,S){const b=f.toString(16),M=b.length<2?"0"+b:b;switch(S){case 4:return b[0];case 8:return M;case 12:return(M+M).slice(0,3);default:return M+M}}a.parseColor=function(f){if(!f)return;let S=f.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const b=d.exec(S);if(b){const M=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/M*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/M*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/M*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),p.exec(S)&&[3,6,9,12].includes(S.length))){const b=S.length/3,M=[0,0,0];for(let w=0;w<3;++w){const c=parseInt(S.slice(b*w,b*w+b),16);M[w]=b===1?c<<4:b===2?c:b===3?c>>4:c>>8}return M}},a.toRgbString=function(f,S=16){const[b,M,w]=f;return`rgb:${y(b,S)}/${y(M,S)}/${y(w,S)}`}},5770:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const p=d(482),y=d(8742),f=d(5770),S=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(M,w){this._handlers[M]===void 0&&(this._handlers[M]=[]);const c=this._handlers[M];return c.push(w),{dispose:()=>{const u=c.indexOf(w);u!==-1&&c.splice(u,1)}}}clearHandler(M){this._handlers[M]&&delete this._handlers[M]}setHandlerFallback(M){this._handlerFb=M}reset(){if(this._active.length)for(let M=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;M>=0;--M)this._active[M].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(M,w){if(this.reset(),this._ident=M,this._active=this._handlers[M]||S,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(M,w,c){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(M,w,c);else this._handlerFb(this._ident,"PUT",(0,p.utf32ToString)(M,w,c))}unhook(M,w=!0){if(this._active.length){let c=!1,u=this._active.length-1,l=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,c=w,l=this._stack.fallThrough,this._stack.paused=!1),!l&&c===!1){for(;u>=0&&(c=this._active[u].unhook(M),c!==!0);u--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,c;u--}for(;u>=0;u--)if(c=this._active[u].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",M);this._active=S,this._ident=0}};const b=new y.Params;b.addParam(0),a.DcsHandler=class{constructor(M){this._handler=M,this._data="",this._params=b,this._hitLimit=!1}hook(M){this._params=M.length>1||M.params[0]?M.clone():b,this._data="",this._hitLimit=!1}put(M,w,c){this._hitLimit||(this._data+=(0,p.utf32ToString)(M,w,c),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(M){let w=!1;if(this._hitLimit)w=!1;else if(M&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((c=>(this._params=b,this._data="",this._hitLimit=!1,c)));return this._params=b,this._data="",this._hitLimit=!1,w}}},2015:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const p=d(844),y=d(8742),f=d(6242),S=d(6351);class b{constructor(u){this.table=new Uint8Array(u)}setDefault(u,l){this.table.fill(u<<4|l)}add(u,l,h,v){this.table[l<<8|u]=h<<4|v}addMany(u,l,h,v){for(let C=0;C<u.length;C++)this.table[l<<8|u[C]]=h<<4|v}}a.TransitionTable=b;const M=160;a.VT500_TRANSITION_TABLE=(function(){const c=new b(4095),u=Array.apply(null,Array(256)).map(((T,E)=>E)),l=(T,E)=>u.slice(T,E),h=l(32,127),v=l(0,24);v.push(25),v.push.apply(v,l(28,32));const C=l(0,14);let L;for(L in c.setDefault(1,0),c.addMany(h,0,2,0),C)c.addMany([24,26,153,154],L,3,0),c.addMany(l(128,144),L,3,0),c.addMany(l(144,152),L,3,0),c.add(156,L,0,0),c.add(27,L,11,1),c.add(157,L,4,8),c.addMany([152,158,159],L,0,7),c.add(155,L,11,3),c.add(144,L,11,9);return c.addMany(v,0,3,0),c.addMany(v,1,3,1),c.add(127,1,0,1),c.addMany(v,8,0,8),c.addMany(v,3,3,3),c.add(127,3,0,3),c.addMany(v,4,3,4),c.add(127,4,0,4),c.addMany(v,6,3,6),c.addMany(v,5,3,5),c.add(127,5,0,5),c.addMany(v,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(h,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(l(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(h,7,0,7),c.addMany(v,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(l(64,127),3,7,0),c.addMany(l(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(l(48,60),4,8,4),c.addMany(l(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(l(32,64),6,0,6),c.add(127,6,0,6),c.addMany(l(64,127),6,0,0),c.addMany(l(32,48),3,9,5),c.addMany(l(32,48),5,9,5),c.addMany(l(48,64),5,0,6),c.addMany(l(64,127),5,7,0),c.addMany(l(32,48),4,9,5),c.addMany(l(32,48),1,9,2),c.addMany(l(32,48),2,9,2),c.addMany(l(48,127),2,10,0),c.addMany(l(48,80),1,10,0),c.addMany(l(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(l(96,127),1,10,0),c.add(80,1,11,9),c.addMany(v,9,0,9),c.add(127,9,0,9),c.addMany(l(28,32),9,0,9),c.addMany(l(32,48),9,9,12),c.addMany(l(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(v,11,0,11),c.addMany(l(32,128),11,0,11),c.addMany(l(28,32),11,0,11),c.addMany(v,10,0,10),c.add(127,10,0,10),c.addMany(l(28,32),10,0,10),c.addMany(l(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(l(32,48),10,9,12),c.addMany(v,12,0,12),c.add(127,12,0,12),c.addMany(l(28,32),12,0,12),c.addMany(l(32,48),12,9,12),c.addMany(l(48,64),12,0,11),c.addMany(l(64,127),12,12,13),c.addMany(l(64,127),10,12,13),c.addMany(l(64,127),9,12,13),c.addMany(v,13,13,13),c.addMany(h,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(M,0,2,0),c.add(M,8,5,8),c.add(M,6,0,6),c.add(M,11,0,11),c.add(M,13,13,13),c})();class w extends p.Disposable{constructor(u=a.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,h,v)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,h)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,p.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new f.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,l=[64,126]){let h=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(h=u.prefix.charCodeAt(0),h&&60>h||h>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<u.intermediates.length;++C){const L=u.intermediates.charCodeAt(C);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");h<<=8,h|=L}}if(u.final.length!==1)throw new Error("final must be a single byte");const v=u.final.charCodeAt(0);if(l[0]>v||v>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return h<<=8,h|=v,h}identToString(u){const l=[];for(;u;)l.push(String.fromCharCode(255&u)),u>>=8;return l.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,l){const h=this._identifier(u,[48,126]);this._escHandlers[h]===void 0&&(this._escHandlers[h]=[]);const v=this._escHandlers[h];return v.push(l),{dispose:()=>{const C=v.indexOf(l);C!==-1&&v.splice(C,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,l){this._executeHandlers[u.charCodeAt(0)]=l}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,l){const h=this._identifier(u);this._csiHandlers[h]===void 0&&(this._csiHandlers[h]=[]);const v=this._csiHandlers[h];return v.push(l),{dispose:()=>{const C=v.indexOf(l);C!==-1&&v.splice(C,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,l){return this._dcsParser.registerHandler(this._identifier(u),l)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,l){return this._oscParser.registerHandler(u,l)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}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(u,l,h,v,C){this._parseStack.state=u,this._parseStack.handlers=l,this._parseStack.handlerPos=h,this._parseStack.transition=v,this._parseStack.chunkPos=C}parse(u,l,h){let v,C=0,L=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(h===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(h===!1&&N>-1){for(;N>=0&&(v=E[N](this._params),v!==!0);N--)if(v instanceof Promise)return this._parseStack.handlerPos=N,v}this._parseStack.handlers=[];break;case 4:if(h===!1&&N>-1){for(;N>=0&&(v=E[N](),v!==!0);N--)if(v instanceof Promise)return this._parseStack.handlerPos=N,v}this._parseStack.handlers=[];break;case 6:if(C=u[this._parseStack.chunkPos],v=this._dcsParser.unhook(C!==24&&C!==26,h),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=u[this._parseStack.chunkPos],v=this._oscParser.end(C!==24&&C!==26,h),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=T;E<l;++E){switch(C=u[E],L=this._transitions.table[this.currentState<<8|(C<160?C:M)],L>>4){case 2:for(let B=E+1;;++B){if(B>=l||(C=u[B])<32||C>126&&C<M){this._printHandler(u,E,B),E=B-1;break}if(++B>=l||(C=u[B])<32||C>126&&C<M){this._printHandler(u,E,B),E=B-1;break}if(++B>=l||(C=u[B])<32||C>126&&C<M){this._printHandler(u,E,B),E=B-1;break}if(++B>=l||(C=u[B])<32||C>126&&C<M){this._printHandler(u,E,B),E=B-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:E,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|C];let W=N?N.length-1:-1;for(;W>=0&&(v=N[W](this._params),v!==!0);W--)if(v instanceof Promise)return this._preserveStack(3,N,W,L,E),v;W<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(++E<l&&(C=u[E])>47&&C<60);E--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const K=this._escHandlers[this._collect<<8|C];let I=K?K.length-1:-1;for(;I>=0&&(v=K[I](),v!==!0);I--)if(v instanceof Promise)return this._preserveStack(4,K,I,L,E),v;I<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 B=E+1;;++B)if(B>=l||(C=u[B])===24||C===26||C===27||C>127&&C<M){this._dcsParser.put(u,E,B),E=B-1;break}break;case 14:if(v=this._dcsParser.unhook(C!==24&&C!==26),v)return this._preserveStack(6,[],0,L,E),v;C===27&&(L|=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 B=E+1;;B++)if(B>=l||(C=u[B])<32||C>127&&C<M){this._oscParser.put(u,E,B),E=B-1;break}break;case 6:if(v=this._oscParser.end(C!==24&&C!==26),v)return this._preserveStack(5,[],0,L,E),v;C===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}a.EscapeSequenceParser=w},6242:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const p=d(5770),y=d(482),f=[];a.OscParser=class{constructor(){this._state=0,this._active=f,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,b){this._handlers[S]===void 0&&(this._handlers[S]=[]);const M=this._handlers[S];return M.push(b),{dispose:()=>{const w=M.indexOf(b);w!==-1&&M.splice(w,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=f,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||f,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,b,M){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(S,b,M);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(S,b,M))}start(){this.reset(),this._state=1}put(S,b,M){if(this._state!==3){if(this._state===1)for(;b<M;){const w=S[b++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&M-b>0&&this._put(S,b,M)}}end(S,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let M=!1,w=this._active.length-1,c=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,M=b,c=this._stack.fallThrough,this._stack.paused=!1),!c&&M===!1){for(;w>=0&&(M=this._active[w].end(S),M!==!0);w--)if(M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,M;w--}for(;w>=0;w--)if(M=this._active[w].end(!1),M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,M}else this._handlerFb(this._id,"END",S);this._active=f,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,b,M){this._hitLimit||(this._data+=(0,y.utf32ToString)(S,b,M),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let b=!1;if(this._hitLimit)b=!1;else if(S&&(b=this._handler(this._data),b instanceof Promise))return b.then((M=>(this._data="",this._hitLimit=!1,M)));return this._data="",this._hitLimit=!1,b}}},8742:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const d=2147483647;class p{static fromArray(f){const S=new p;if(!f.length)return S;for(let b=Array.isArray(f[0])?1:0;b<f.length;++b){const M=f[b];if(Array.isArray(M))for(let w=0;w<M.length;++w)S.addSubParam(M[w]);else S.addParam(M)}return S}constructor(f=32,S=32){if(this.maxLength=f,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new p(this.maxLength,this.maxSubParamsLength);return f.params.set(this.params),f.length=this.length,f._subParams.set(this._subParams),f._subParamsLength=this._subParamsLength,f._subParamsIdx.set(this._subParamsIdx),f._rejectDigits=this._rejectDigits,f._rejectSubDigits=this._rejectSubDigits,f._digitIsSub=this._digitIsSub,f}toArray(){const f=[];for(let S=0;S<this.length;++S){f.push(this.params[S]);const b=this._subParamsIdx[S]>>8,M=255&this._subParamsIdx[S];M-b>0&&f.push(Array.prototype.slice.call(this._subParams,b,M))}return f}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(f){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=f>d?d:f}}addSubParam(f){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(f<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=f>d?d:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const S=this._subParamsIdx[f]>>8,b=255&this._subParamsIdx[f];return b-S>0?this._subParams.subarray(S,b):null}getSubParamsAll(){const f={};for(let S=0;S<this.length;++S){const b=this._subParamsIdx[S]>>8,M=255&this._subParamsIdx[S];M-b>0&&(f[S]=this._subParams.slice(b,M))}return f}addDigit(f){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,M=b[S-1];b[S-1]=~M?Math.min(10*M+f,d):f}}a.Params=p},5741:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,p){const y={instance:p,dispose:p.dispose,isDisposed:!1};this._addons.push(y),p.dispose=()=>this._wrappedAddonDispose(y),p.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let p=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===d){p=y;break}if(p===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(p,1)}}},8771:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const p=d(3785),y=d(511);a.BufferApiView=class{constructor(f,S){this._buffer=f,this.type=S}init(f){return this._buffer=f,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(f){const S=this._buffer.lines.get(f);if(S)return new p.BufferLineApiView(S)}getNullCell(){return new y.CellData}}},3785:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const p=d(511);a.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,f){if(!(y<0||y>=this._line.length))return f?(this._line.loadCell(y,f),f):this._line.loadCell(y,new p.CellData)}translateToString(y,f,S){return this._line.translateToString(y,f,S)}}},8285:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const p=d(8771),y=d(8460),f=d(844);class S extends f.Disposable{constructor(M){super(),this._core=M,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new p.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new p.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=S},7975:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,p){return this._core.registerCsiHandler(d,(y=>p(y.toArray())))}addCsiHandler(d,p){return this.registerCsiHandler(d,p)}registerDcsHandler(d,p){return this._core.registerDcsHandler(d,((y,f)=>p(y,f.toArray())))}addDcsHandler(d,p){return this.registerDcsHandler(d,p)}registerEscHandler(d,p){return this._core.registerEscHandler(d,p)}addEscHandler(d,p){return this.registerEscHandler(d,p)}registerOscHandler(d,p){return this._core.registerOscHandler(d,p)}addOscHandler(d,p){return this.registerOscHandler(d,p)}}},7090:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(R,a,d){var p=this&&this.__decorate||function(c,u,l,h){var v,C=arguments.length,L=C<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(c,u,l,h);else for(var T=c.length-1;T>=0;T--)(v=c[T])&&(L=(C<3?v(L):C>3?v(u,l,L):v(u,l))||L);return C>3&&L&&Object.defineProperty(u,l,L),L},y=this&&this.__param||function(c,u){return function(l,h){u(l,h,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const f=d(8460),S=d(844),b=d(5295),M=d(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let w=a.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new f.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(c,this))}resize(c,u){this.cols=c,this.rows=u,this.buffers.resize(c,u),this._onResize.fire({cols:c,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,u=!1){const l=this.buffer;let h;h=this._cachedBlankLine,h&&h.length===this.cols&&h.getFg(0)===c.fg&&h.getBg(0)===c.bg||(h=l.getBlankLine(c,u),this._cachedBlankLine=h),h.isWrapped=u;const v=l.ybase+l.scrollTop,C=l.ybase+l.scrollBottom;if(l.scrollTop===0){const L=l.lines.isFull;C===l.lines.length-1?L?l.lines.recycle().copyFrom(h):l.lines.push(h.clone()):l.lines.splice(C+1,0,h.clone()),L?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const L=C-v+1;l.lines.shiftElements(v+1,L-1,-1),l.lines.set(C,h.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(c,u,l){const h=this.buffer;if(c<0){if(h.ydisp===0)return;this.isUserScrolling=!0}else c+h.ydisp>=h.ybase&&(this.isUserScrolling=!1);const v=h.ydisp;h.ydisp=Math.max(Math.min(h.ydisp+c,h.ybase),0),v!==h.ydisp&&(u||this._onScroll.fire(h.ydisp))}};a.BufferService=w=p([y(0,M.IOptionsService)],w)},7994:(R,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(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,p){this._charsets[d]=p,this.glevel===d&&(this.charset=p)}}},1753:function(R,a,d){var p=this&&this.__decorate||function(h,v,C,L){var T,E=arguments.length,N=E<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(h,v,C,L);else for(var W=h.length-1;W>=0;W--)(T=h[W])&&(N=(E<3?T(N):E>3?T(v,C,N):T(v,C))||N);return E>3&&N&&Object.defineProperty(v,C,N),N},y=this&&this.__param||function(h,v){return function(C,L){v(C,L,h)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const f=d(2585),S=d(8460),b=d(844),M={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:h=>h.button!==4&&h.action===1&&(h.ctrl=!1,h.alt=!1,h.shift=!1,!0)},VT200:{events:19,restrict:h=>h.action!==32},DRAG:{events:23,restrict:h=>h.action!==32||h.button!==3},ANY:{events:31,restrict:h=>!0}};function w(h,v){let C=(h.ctrl?16:0)|(h.shift?4:0)|(h.alt?8:0);return h.button===4?(C|=64,C|=h.action):(C|=3&h.button,4&h.button&&(C|=64),8&h.button&&(C|=128),h.action===32?C|=32:h.action!==0||v||(C|=3)),C}const c=String.fromCharCode,u={DEFAULT:h=>{const v=[w(h,!1)+32,h.col+32,h.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${c(v[0])}${c(v[1])}${c(v[2])}`},SGR:h=>{const v=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${w(h,!0)};${h.col};${h.row}${v}`},SGR_PIXELS:h=>{const v=h.action===0&&h.button!==4?"m":"M";return`\x1B[<${w(h,!0)};${h.x};${h.y}${v}`}};let l=a.CoreMouseService=class extends b.Disposable{constructor(h,v){super(),this._bufferService=h,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(M))this.addProtocol(C,M[C]);for(const C of Object.keys(u))this.addEncoding(C,u[C]);this.reset()}addProtocol(h,v){this._protocols[h]=v}addEncoding(h,v){this._encodings[h]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(h){if(!this._protocols[h])throw new Error(`unknown protocol "${h}"`);this._activeProtocol=h,this._onProtocolChange.fire(this._protocols[h].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(h){if(!this._encodings[h])throw new Error(`unknown encoding "${h}"`);this._activeEncoding=h}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(h){if(h.col<0||h.col>=this._bufferService.cols||h.row<0||h.row>=this._bufferService.rows||h.button===4&&h.action===32||h.button===3&&h.action!==32||h.button!==4&&(h.action===2||h.action===3)||(h.col++,h.row++,h.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,h,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(h))return!1;const v=this._encodings[this._activeEncoding](h);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=h,!0}explainEvents(h){return{down:!!(1&h),up:!!(2&h),drag:!!(4&h),move:!!(8&h),wheel:!!(16&h)}}_equalEvents(h,v,C){if(C){if(h.x!==v.x||h.y!==v.y)return!1}else if(h.col!==v.col||h.row!==v.row)return!1;return h.button===v.button&&h.action===v.action&&h.ctrl===v.ctrl&&h.alt===v.alt&&h.shift===v.shift}};a.CoreMouseService=l=p([y(0,f.IBufferService),y(1,f.ICoreService)],l)},6975:function(R,a,d){var p=this&&this.__decorate||function(l,h,v,C){var L,T=arguments.length,E=T<3?h:C===null?C=Object.getOwnPropertyDescriptor(h,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,h,v,C);else for(var N=l.length-1;N>=0;N--)(L=l[N])&&(E=(T<3?L(E):T>3?L(h,v,E):L(h,v))||E);return T>3&&E&&Object.defineProperty(h,v,E),E},y=this&&this.__param||function(l,h){return function(v,C){h(v,C,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const f=d(1439),S=d(8460),b=d(844),M=d(2585),w=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=a.CoreService=class extends b.Disposable{constructor(l,h,v){super(),this._bufferService=l,this._logService=h,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(c)}reset(){this.modes=(0,f.clone)(w),this.decPrivateModes=(0,f.clone)(c)}triggerDataEvent(l,h=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;h&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),h&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((C=>C.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((h=>h.charCodeAt(0))))),this._onBinary.fire(l))}};a.CoreService=u=p([y(0,M.IBufferService),y(1,M.ILogService),y(2,M.IOptionsService)],u)},9074:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const p=d(8055),y=d(8460),f=d(844),S=d(6106);let b=0,M=0;class w extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((l=>l==null?void 0:l.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const h=new c(l);if(h){const v=h.marker.onDispose((()=>h.dispose()));h.onDispose((()=>{h&&(this._decorations.delete(h)&&this._onDecorationRemoved.fire(h),v.dispose())})),this._decorations.insert(h),this._onDecorationRegistered.fire(h)}return h}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,h,v){let C=0,L=0;for(const T of this._decorations.getKeyIterator(h))C=T.options.x??0,L=C+(T.options.width??1),l>=C&&l<L&&(!v||(T.options.layer??"bottom")===v)&&(yield T)}forEachDecorationAtCell(l,h,v,C){this._decorations.forEachByKey(h,(L=>{b=L.options.x??0,M=b+(L.options.width??1),l>=b&&l<M&&(!v||(L.options.layer??"bottom")===v)&&C(L)}))}}a.DecorationService=w;class c extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=p.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=p.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const p=d(2585),y=d(8343);class f{constructor(...b){this._entries=new Map;for(const[M,w]of b)this.set(M,w)}set(b,M){const w=this._entries.get(b);return this._entries.set(b,M),w}forEach(b){for(const[M,w]of this._entries.entries())b(M,w)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}a.ServiceCollection=f,a.InstantiationService=class{constructor(){this._services=new f,this._services.set(p.IInstantiationService,this)}setService(S,b){this._services.set(S,b)}getService(S){return this._services.get(S)}createInstance(S,...b){const M=(0,y.getServiceDependencies)(S).sort(((u,l)=>u.index-l.index)),w=[];for(const u of M){const l=this._services.get(u.id);if(!l)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${u.id}.`);w.push(l)}const c=M.length>0?M[0].index:b.length;if(b.length!==c)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${c+1} conflicts with ${b.length} static arguments`);return new S(...b,...w)}}},7866:function(R,a,d){var p=this&&this.__decorate||function(c,u,l,h){var v,C=arguments.length,L=C<3?u:h===null?h=Object.getOwnPropertyDescriptor(u,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(c,u,l,h);else for(var T=c.length-1;T>=0;T--)(v=c[T])&&(L=(C<3?v(L):C>3?v(u,l,L):v(u,l))||L);return C>3&&L&&Object.defineProperty(u,l,L),L},y=this&&this.__param||function(c,u){return function(l,h){u(l,h,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const f=d(844),S=d(2585),b={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let M,w=a.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),M=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let u=0;u<c.length;u++)typeof c[u]=="function"&&(c[u]=c[u]())}_log(c,u,l){this._evalLazyOptionalParams(l),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...l)}trace(c,...u){var l;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,c,u)}debug(c,...u){var l;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,c,u)}info(c,...u){var l;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,c,u)}warn(c,...u){var l;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,c,u)}error(c,...u){var l;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,c,u)}};a.LogService=w=p([y(0,S.IOptionsService)],w),a.setTraceLogger=function(c){M=c},a.traceCall=function(c,u,l){if(typeof l.value!="function")throw new Error("not supported");const h=l.value;l.value=function(...v){if(M.logLevel!==S.LogLevelEnum.TRACE)return h.apply(this,v);M.trace(`GlyphRenderer#${h.name}(${v.map((L=>JSON.stringify(L))).join(", ")})`);const C=h.apply(this,v);return M.trace(`GlyphRenderer#${h.name} return`,C),C}}},7302:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const p=d(8460),y=d(844),f=d(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:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends y.Disposable{constructor(w){super(),this._onOptionChange=this.register(new p.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...a.DEFAULT_OPTIONS};for(const u in w)if(u in c)try{const l=w[u];c[u]=this._sanitizeAndValidateOption(u,l)}catch(l){console.error(l)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,c){return this.onOptionChange((u=>{u===w&&c(this.rawOptions[w])}))}onMultipleOptionChange(w,c){return this.onOptionChange((u=>{w.indexOf(u)!==-1&&c()}))}_setupOptions(){const w=u=>{if(!(u in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},c=(u,l)=>{if(!(u in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);l=this._sanitizeAndValidateOption(u,l),this.rawOptions[u]!==l&&(this.rawOptions[u]=l,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const l={get:w.bind(this,u),set:c.bind(this,u)};Object.defineProperty(this.options,u,l)}}_sanitizeAndValidateOption(w,c){switch(w){case"cursorStyle":if(c||(c=a.DEFAULT_OPTIONS[w]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(c))throw new Error(`"${c}" is not a valid value for ${w}`);break;case"wordSeparator":c||(c=a.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=S.includes(c)?c:a.DEFAULT_OPTIONS[w];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${w} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${w} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}a.OptionsService=b},2660:function(R,a,d){var p=this&&this.__decorate||function(b,M,w,c){var u,l=arguments.length,h=l<3?M:c===null?c=Object.getOwnPropertyDescriptor(M,w):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(b,M,w,c);else for(var v=b.length-1;v>=0;v--)(u=b[v])&&(h=(l<3?u(h):l>3?u(M,w,h):u(M,w))||h);return l>3&&h&&Object.defineProperty(M,w,h),h},y=this&&this.__param||function(b,M){return function(w,c){M(w,c,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const f=d(2585);let S=a.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const M=this._bufferService.buffer;if(b.id===void 0){const v=M.addMarker(M.ybase+M.y),C={data:b,id:this._nextId++,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(C,v))),this._dataByLinkId.set(C.id,C),C.id}const w=b,c=this._getEntryIdKey(w),u=this._entriesWithId.get(c);if(u)return this.addLineToLink(u.id,M.ybase+M.y),u.id;const l=M.addMarker(M.ybase+M.y),h={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(h,l))),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(b,M){const w=this._dataByLinkId.get(b);if(w&&w.lines.every((c=>c.line!==M))){const c=this._bufferService.buffer.addMarker(M);w.lines.push(c),c.onDispose((()=>this._removeMarkerFromLink(w,c)))}}getLinkData(b){var M;return(M=this._dataByLinkId.get(b))==null?void 0:M.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,M){const w=b.lines.indexOf(M);w!==-1&&(b.lines.splice(w,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};a.OscLinkService=S=p([y(0,f.IBufferService)],S)},8343:(R,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const d="di$target",p="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(y){return y[p]||[]},a.createDecorator=function(y){if(a.serviceRegistry.has(y))return a.serviceRegistry.get(y);const f=function(S,b,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,c,u){c[d]===c?c[p].push({id:w,index:u}):(c[p]=[{id:w,index:u}],c[d]=c)})(f,S,M)};return f.toString=()=>y,a.serviceRegistry.set(y,f),f}},2585:(R,a,d)=>{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 p=d(8343);var y;a.IBufferService=(0,p.createDecorator)("BufferService"),a.ICoreMouseService=(0,p.createDecorator)("CoreMouseService"),a.ICoreService=(0,p.createDecorator)("CoreService"),a.ICharsetService=(0,p.createDecorator)("CharsetService"),a.IInstantiationService=(0,p.createDecorator)("InstantiationService"),(function(f){f[f.TRACE=0]="TRACE",f[f.DEBUG=1]="DEBUG",f[f.INFO=2]="INFO",f[f.WARN=3]="WARN",f[f.ERROR=4]="ERROR",f[f.OFF=5]="OFF"})(y||(a.LogLevelEnum=y={})),a.ILogService=(0,p.createDecorator)("LogService"),a.IOptionsService=(0,p.createDecorator)("OptionsService"),a.IOscLinkService=(0,p.createDecorator)("OscLinkService"),a.IUnicodeService=(0,p.createDecorator)("UnicodeService"),a.IDecorationService=(0,p.createDecorator)("DecorationService")},1480:(R,a,d)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const p=d(8460),y=d(225);class f{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,M,w=!1){return(16777215&b)<<3|(3&M)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new p.EventEmitter,this.onChange=this._onChange.event;const b=new y.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let M=0,w=0;const c=b.length;for(let u=0;u<c;++u){let l=b.charCodeAt(u);if(55296<=l&&l<=56319){if(++u>=c)return M+this.wcwidth(l);const C=b.charCodeAt(u);56320<=C&&C<=57343?l=1024*(l-55296)+C-56320+65536:M+=this.wcwidth(C)}const h=this.charProperties(l,w);let v=f.extractWidth(h);f.extractShouldJoin(h)&&(v-=f.extractWidth(w)),M+=v,w=h}return M}charProperties(b,M){return this._activeProvider.charProperties(b,M)}}a.UnicodeService=f}},g={};function _(R){var a=g[R];if(a!==void 0)return a.exports;var d=g[R]={exports:{}};return n[R].call(d.exports,d,d.exports,_),d.exports}var k={};return(()=>{var R=k;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const a=_(9042),d=_(3236),p=_(844),y=_(5741),f=_(8285),S=_(7975),b=_(7090),M=["cols","rows"];class w extends p.Disposable{constructor(u){super(),this._core=this.register(new d.Terminal(u)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const l=v=>this._core.options[v],h=(v,C)=>{this._checkReadonlyOptions(v),this._core.options[v]=C};for(const v in this._core.options){const C={get:l.bind(this,v),set:h.bind(this,v)};Object.defineProperty(this._publicOptions,v,C)}}_checkReadonlyOptions(u){if(M.includes(u))throw new Error(`Option "${u}" 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 S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 f.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const l in u)this._publicOptions[l]=u[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,l=!0){this._core.input(u,l)}resize(u,l){this._verifyIntegers(u,l),this._core.resize(u,l)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,l,h){this._verifyIntegers(u,l,h),this._core.select(u,l,h)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,l){this._verifyIntegers(u,l),this._core.selectLines(u,l)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,l){this._core.write(u,l)}writeln(u,l){this._core.write(u),this._core.write(`\r
48
+ `,l)}paste(u){this._core.paste(u)}refresh(u,l){this._verifyIntegers(u,l),this._core.refresh(u,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return a}_verifyIntegers(...u){for(const l of u)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const l of u)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}R.Terminal=w})(),k})()))})(sc)),sc.exports}var Dg=Tg();/**
49
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
50
+ * @license MIT
51
+ *
52
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
53
+ * @license MIT
54
+ *
55
+ * Originally forked from (with the author's permission):
56
+ * Fabrice Bellard's javascript vt100 for jslinux:
57
+ * http://bellard.org/jslinux/
58
+ * Copyright (c) 2011 Fabrice Bellard
59
+ */var Ag=2,Bg=1,Pg=class{activate(r){this._terminal=r}dispose(){}fit(){let r=this.proposeDimensions();if(!r||!this._terminal||isNaN(r.cols)||isNaN(r.rows))return;let i=this._terminal._core;(this._terminal.rows!==r.rows||this._terminal.cols!==r.cols)&&(i._renderService.clear(),this._terminal.resize(r.cols,r.rows))}proposeDimensions(){var f;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let r=this._terminal._core._renderService.dimensions;if(r.css.cell.width===0||r.css.cell.height===0)return;let i=this._terminal.options.scrollback===0?0:((f=this._terminal.options.overviewRuler)==null?void 0:f.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),g=parseInt(n.getPropertyValue("height")),_=Math.max(0,parseInt(n.getPropertyValue("width"))),k=window.getComputedStyle(this._terminal.element),R={top:parseInt(k.getPropertyValue("padding-top")),bottom:parseInt(k.getPropertyValue("padding-bottom")),right:parseInt(k.getPropertyValue("padding-right")),left:parseInt(k.getPropertyValue("padding-left"))},a=R.top+R.bottom,d=R.right+R.left,p=g-a,y=_-d-i;return{cols:Math.max(Ag,Math.floor(y/r.css.cell.width)),rows:Math.max(Bg,Math.floor(p/r.css.cell.height))}}};/**
60
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
61
+ * @license MIT
62
+ *
63
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
64
+ * @license MIT
65
+ *
66
+ * Originally forked from (with the author's permission):
67
+ * Fabrice Bellard's javascript vt100 for jslinux:
68
+ * http://bellard.org/jslinux/
69
+ * Copyright (c) 2011 Fabrice Bellard
70
+ */var nc=[[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]],Og=[[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]],wt;function Ng(r,i){let n=0,g=i.length-1,_;if(r<i[0][0]||r>i[g][1])return!1;for(;g>=n;)if(_=n+g>>1,r>i[_][1])n=_+1;else if(r<i[_][0])g=_-1;else return!0;return!1}var Ig=class{constructor(){if(this.version="6",!wt){wt=new Uint8Array(65536),wt.fill(1),wt[0]=0,wt.fill(0,1,32),wt.fill(0,127,160),wt.fill(2,4352,4448),wt[9001]=2,wt[9002]=2,wt.fill(2,11904,42192),wt[12351]=1,wt.fill(2,44032,55204),wt.fill(2,63744,64256),wt.fill(2,65040,65050),wt.fill(2,65072,65136),wt.fill(2,65280,65377),wt.fill(2,65504,65511);for(let i=0;i<nc.length;++i)wt.fill(0,nc[i][0],nc[i][1]+1)}}wcwidth(i){return i<32?0:i<127?1:i<65536?wt[i]:Ng(i,Og)?0:i>=131072&&i<=196605||i>=196608&&i<=262141?2:1}charProperties(i,n){let g=this.wcwidth(i),_=g===0&&n!==0;if(_){let k=oa.extractWidth(n);k===0?_=!1:k>g&&(g=k)}return oa.createPropertyValue(0,g,_)}},Fg=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(i){setTimeout(()=>{throw i.stack?Od.isErrorNoTelemetry(i)?new Od(i.message+`
71
+
72
+ `+i.stack):new Error(i.message+`
73
+
74
+ `+i.stack):i},0)}}addListener(i){return this.listeners.push(i),()=>{this._removeListener(i)}}emit(i){this.listeners.forEach(n=>{n(i)})}_removeListener(i){this.listeners.splice(this.listeners.indexOf(i),1)}setUnexpectedErrorHandler(i){this.unexpectedErrorHandler=i}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(i){this.unexpectedErrorHandler(i),this.emit(i)}onUnexpectedExternalError(i){this.unexpectedErrorHandler(i)}},jg=new Fg;function oc(r){Hg(r)||jg.onUnexpectedError(r)}var Nc="Canceled";function Hg(r){return r instanceof $g?!0:r instanceof Error&&r.name===Nc&&r.message===Nc}var $g=class extends Error{constructor(){super(Nc),this.name=this.message}},Od=class Ic extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof Ic)return i;let n=new Ic;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}};function zg(r,i){let n=this,g=!1,_;return function(){return g||(g=!0,i||(_=r.apply(n,arguments))),_}}var Ug;(r=>{function i(k){return k<0}r.isLessThan=i;function n(k){return k<=0}r.isLessThanOrEqual=n;function g(k){return k>0}r.isGreaterThan=g;function _(k){return k===0}r.isNeitherLessOrGreaterThan=_,r.greaterThan=1,r.lessThan=-1,r.neitherLessOrGreaterThan=0})(Ug||(Ug={}));var Jf;(r=>{function i(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}r.is=i;let n=Object.freeze([]);function g(){return n}r.empty=g;function*_(v){yield v}r.single=_;function k(v){return i(v)?v:_(v)}r.wrap=k;function R(v){return v||n}r.from=R;function*a(v){for(let C=v.length-1;C>=0;C--)yield v[C]}r.reverse=a;function d(v){return!v||v[Symbol.iterator]().next().done===!0}r.isEmpty=d;function p(v){return v[Symbol.iterator]().next().value}r.first=p;function y(v,C){let L=0;for(let T of v)if(C(T,L++))return!0;return!1}r.some=y;function f(v,C){for(let L of v)if(C(L))return L}r.find=f;function*S(v,C){for(let L of v)C(L)&&(yield L)}r.filter=S;function*b(v,C){let L=0;for(let T of v)yield C(T,L++)}r.map=b;function*M(v,C){let L=0;for(let T of v)yield*C(T,L++)}r.flatMap=M;function*w(...v){for(let C of v)yield*C}r.concat=w;function c(v,C,L){let T=L;for(let E of v)T=C(T,E);return T}r.reduce=c;function*u(v,C,L=v.length){for(C<0&&(C+=v.length),L<0?L+=v.length:L>v.length&&(L=v.length);C<L;C++)yield v[C]}r.slice=u;function l(v,C=Number.POSITIVE_INFINITY){let L=[];if(C===0)return[L,v];let T=v[Symbol.iterator]();for(let E=0;E<C;E++){let N=T.next();if(N.done)return[L,r.empty()];L.push(N.value)}return[L,{[Symbol.iterator](){return T}}]}r.consume=l;async function h(v){let C=[];for await(let L of v)C.push(L);return Promise.resolve(C)}r.asyncToArray=h})(Jf||(Jf={}));function Qf(r){if(Jf.is(r)){let i=[];for(let n of r)if(n)try{n.dispose()}catch(g){i.push(g)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function Wg(...r){return Zf(()=>Qf(r))}function Zf(r){return{dispose:zg(()=>{r()})}}var e_=class t_{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Qf(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?t_.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};e_.DISABLE_DISPOSED_WARNING=!1;var qc=e_,na=class{constructor(){this._store=new qc,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};na.None=Object.freeze({dispose(){}});var Vg=globalThis.performance&&typeof globalThis.performance.now=="function",Kg=class r_{static create(i){return new r_(i)}constructor(i){this._now=Vg&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},qg;(r=>{r.None=()=>na.None;function i(I,B){return f(I,()=>{},0,void 0,!0,void 0,B)}r.defer=i;function n(I){return(B,U=null,$)=>{let V=!1,X;return X=I(z=>{if(!V)return X?X.dispose():V=!0,B.call(U,z)},null,$),V&&X.dispose(),X}}r.once=n;function g(I,B,U){return p(($,V=null,X)=>I(z=>$.call(V,B(z)),null,X),U)}r.map=g;function _(I,B,U){return p(($,V=null,X)=>I(z=>{B(z),$.call(V,z)},null,X),U)}r.forEach=_;function k(I,B,U){return p(($,V=null,X)=>I(z=>B(z)&&$.call(V,z),null,X),U)}r.filter=k;function R(I){return I}r.signal=R;function a(...I){return(B,U=null,$)=>{let V=Wg(...I.map(X=>X(z=>B.call(U,z))));return y(V,$)}}r.any=a;function d(I,B,U,$){let V=U;return g(I,X=>(V=B(V,X),V),$)}r.reduce=d;function p(I,B){let U,$={onWillAddFirstListener(){U=I(V.fire,V)},onDidRemoveLastListener(){U==null||U.dispose()}},V=new Ei($);return B==null||B.add(V),V.event}function y(I,B){return B instanceof Array?B.push(I):B&&B.add(I),I}function f(I,B,U=100,$=!1,V=!1,X,z){let D,O,A,H=0,Q,ne={leakWarningThreshold:X,onWillAddFirstListener(){D=I(ue=>{H++,O=B(O,ue),$&&!A&&(oe.fire(O),O=void 0),Q=()=>{let Y=O;O=void 0,A=void 0,(!$||H>1)&&oe.fire(Y),H=0},typeof U=="number"?(clearTimeout(A),A=setTimeout(Q,U)):A===void 0&&(A=0,queueMicrotask(Q))})},onWillRemoveListener(){V&&H>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,D.dispose()}},oe=new Ei(ne);return z==null||z.add(oe),oe.event}r.debounce=f;function S(I,B=0,U){return r.debounce(I,($,V)=>$?($.push(V),$):[V],B,void 0,!0,void 0,U)}r.accumulate=S;function b(I,B=($,V)=>$===V,U){let $=!0,V;return k(I,X=>{let z=$||!B(X,V);return $=!1,V=X,z},U)}r.latch=b;function M(I,B,U){return[r.filter(I,B,U),r.filter(I,$=>!B($),U)]}r.split=M;function w(I,B=!1,U=[],$){let V=U.slice(),X=I(O=>{V?V.push(O):D.fire(O)});$&&$.add(X);let z=()=>{V==null||V.forEach(O=>D.fire(O)),V=null},D=new Ei({onWillAddFirstListener(){X||(X=I(O=>D.fire(O)),$&&$.add(X))},onDidAddFirstListener(){V&&(B?setTimeout(z):z())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return $&&$.add(D),D.event}r.buffer=w;function c(I,B){return(U,$,V)=>{let X=B(new l);return I(function(z){let D=X.evaluate(z);D!==u&&U.call($,D)},void 0,V)}}r.chain=c;let u=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(U=>(B(U),U)),this}filter(B){return this.steps.push(U=>B(U)?U:u),this}reduce(B,U){let $=U;return this.steps.push(V=>($=B($,V),$)),this}latch(B=(U,$)=>U===$){let U=!0,$;return this.steps.push(V=>{let X=U||!B(V,$);return U=!1,$=V,X?V:u}),this}evaluate(B){for(let U of this.steps)if(B=U(B),B===u)break;return B}}function h(I,B,U=$=>$){let $=(...D)=>z.fire(U(...D)),V=()=>I.on(B,$),X=()=>I.removeListener(B,$),z=new Ei({onWillAddFirstListener:V,onDidRemoveLastListener:X});return z.event}r.fromNodeEventEmitter=h;function v(I,B,U=$=>$){let $=(...D)=>z.fire(U(...D)),V=()=>I.addEventListener(B,$),X=()=>I.removeEventListener(B,$),z=new Ei({onWillAddFirstListener:V,onDidRemoveLastListener:X});return z.event}r.fromDOMEventEmitter=v;function C(I){return new Promise(B=>n(I)(B))}r.toPromise=C;function L(I){let B=new Ei;return I.then(U=>{B.fire(U)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}r.fromPromise=L;function T(I,B){return I(U=>B.fire(U))}r.forward=T;function E(I,B,U){return B(U),I($=>B($))}r.runAndSubscribe=E;class N{constructor(B,U){this._observable=B,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Ei($),U&&U.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,U){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(I,B){return new N(I,B).emitter.event}r.fromObservable=W;function K(I){return(B,U,$)=>{let V=0,X=!1,z={beginUpdate(){V++},endUpdate(){V--,V===0&&(I.reportChanges(),X&&(X=!1,B.call(U)))},handlePossibleChange(){},handleChange(){X=!0}};I.addObserver(z),I.reportChanges();let D={dispose(){I.removeObserver(z)}};return $ instanceof qc?$.add(D):Array.isArray($)&&$.push(D),D}}r.fromObservableLight=K})(qg||(qg={}));var Fc=class jc{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${jc._idPool++}`,jc.all.add(this)}start(i){this._stopWatch=new Kg,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Fc.all=new Set,Fc._idPool=0;var Gg=Fc,Yg=-1,i_=class s_{constructor(i,n,g=(s_._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=g,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let g=this.threshold;if(g<=0||n<g)return;this._stacks||(this._stacks=new Map);let _=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,_+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=g*.5;let[k,R]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${R}):`;console.warn(a),console.warn(k);let d=new Qg(a,k);this._errorHandler(d)}return()=>{let k=this._stacks.get(i.value)||0;this._stacks.set(i.value,k-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[g,_]of this._stacks)(!i||n<_)&&(i=[g,_],n=_);return i}};i_._idPool=1;var Xg=i_,Jg=class n_{constructor(i){this.value=i}static create(){let i=new Error;return new n_(i.stack??"")}print(){console.warn(this.value.split(`
75
+ `).slice(2).join(`
76
+ `))}},Qg=class extends Error{constructor(i,n){super(i),this.name="ListenerLeakError",this.stack=n}},Zg=class extends Error{constructor(i,n){super(i),this.name="ListenerRefusalError",this.stack=n}},em=0,ac=class{constructor(r){this.value=r,this.id=em++}},tm=2,rm,Ei=class{constructor(i){var n,g,_,k;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new Xg((i==null?void 0:i.onListenerError)??oc,((g=this._options)==null?void 0:g.leakWarningThreshold)??Yg):void 0,this._perfMon=(_=this._options)!=null&&_._profName?new Gg(this._options._profName):void 0,this._deliveryQueue=(k=this._options)==null?void 0:k.deliveryQueue}dispose(){var i,n,g,_;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(g=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||g.call(n),(_=this._leakageMon)==null||_.dispose())}get event(){return this._event??(this._event=(i,n,g)=>{var a,d,p,y,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let S=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(S);let b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],M=new Zg(`${S}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((a=this._options)==null?void 0:a.onListenerError)||oc)(M),na.None}if(this._disposed)return na.None;n&&(i=i.bind(n));let _=new ac(i),k;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(_.stack=Jg.create(),k=this._leakageMon.check(_.stack,this._size+1)),this._listeners?this._listeners instanceof ac?(this._deliveryQueue??(this._deliveryQueue=new im),this._listeners=[this._listeners,_]):this._listeners.push(_):((p=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||p.call(d,this),this._listeners=_,(f=(y=this._options)==null?void 0:y.onDidAddFirstListener)==null||f.call(y,this)),this._size++;let R=Zf(()=>{k==null||k(),this._removeListener(_)});return g instanceof qc?g.add(R):Array.isArray(g)&&g.push(R),R}),this._event}_removeListener(i){var k,R,a,d;if((R=(k=this._options)==null?void 0:k.onWillRemoveListener)==null||R.call(k,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||d.call(a,this),this._size=0;return}let n=this._listeners,g=n.indexOf(i);if(g===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[g]=void 0;let _=this._deliveryQueue.current===this;if(this._size*tm<=n.length){let p=0;for(let y=0;y<n.length;y++)n[y]?n[p++]=n[y]:_&&(this._deliveryQueue.end--,p<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=p}}_deliver(i,n){var _;if(!i)return;let g=((_=this._options)==null?void 0:_.onListenerError)||oc;if(!g){i.value(n);return}try{i.value(n)}catch(k){g(k)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,g,_,k;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(g=this._perfMon)==null||g.stop()),(_=this._perfMon)==null||_.start(this._size),this._listeners)if(this._listeners instanceof ac)this._deliver(this._listeners,i);else{let R=this._deliveryQueue;R.enqueue(this,i,this._listeners.length),this._deliverQueue(R)}(k=this._perfMon)==null||k.stop()}hasListeners(){return this._size>0}},im=class{constructor(){this.i=-1,this.end=0}enqueue(r,i,n){this.i=0,this.end=n,this.current=r,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},oa=class Jo{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ei,this.onChange=this._onChange.event;let i=new Ig;this.register(i),this._active=i.version,this._activeProvider=i}static extractShouldJoin(i){return(i&1)!==0}static extractWidth(i){return i>>1&3}static extractCharKind(i){return i>>3}static createPropertyValue(i,n,g=!1){return(i&16777215)<<3|(n&3)<<1|(g?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(i){if(!this._providers[i])throw new Error(`unknown Unicode version "${i}"`);this._active=i,this._activeProvider=this._providers[i],this._onChange.fire(i)}register(i){this._providers[i.version]=i}wcwidth(i){return this._activeProvider.wcwidth(i)}getStringCellWidth(i){let n=0,g=0,_=i.length;for(let k=0;k<_;++k){let R=i.charCodeAt(k);if(55296<=R&&R<=56319){if(++k>=_)return n+this.wcwidth(R);let p=i.charCodeAt(k);56320<=p&&p<=57343?R=(R-55296)*1024+p-56320+65536:n+=this.wcwidth(p)}let a=this.charProperties(R,g),d=Jo.extractWidth(a);Jo.extractShouldJoin(a)&&(d-=Jo.extractWidth(g)),n+=d,g=a}return n}charProperties(i,n){return this._activeProvider.charProperties(i,n)}},lc=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],sm=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],cc=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],nm=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],Gr;function Nd(r,i){let n=0,g=i.length-1,_;if(r<i[0][0]||r>i[g][1])return!1;for(;g>=n;)if(_=n+g>>1,r>i[_][1])n=_+1;else if(r<i[_][0])g=_-1;else return!0;return!1}var om=class{constructor(){if(this.version="11",!Gr){Gr=new Uint8Array(65536),Gr.fill(1),Gr[0]=0,Gr.fill(0,1,32),Gr.fill(0,127,160);for(let i=0;i<lc.length;++i)Gr.fill(0,lc[i][0],lc[i][1]+1);for(let i=0;i<cc.length;++i)Gr.fill(2,cc[i][0],cc[i][1]+1)}}wcwidth(i){return i<32?0:i<127?1:i<65536?Gr[i]:Nd(i,sm)?0:Nd(i,nm)?2:1}charProperties(i,n){let g=this.wcwidth(i),_=g===0&&n!==0;if(_){let k=oa.extractWidth(n);k===0?_=!1:k>g&&(g=k)}return oa.createPropertyValue(0,g,_)}},am=class{activate(r){r.unicode.register(new om)}dispose(){}};/**
77
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
78
+ * @license MIT
79
+ *
80
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
81
+ * @license MIT
82
+ *
83
+ * Originally forked from (with the author's permission):
84
+ * Fabrice Bellard's javascript vt100 for jslinux:
85
+ * http://bellard.org/jslinux/
86
+ * Copyright (c) 2011 Fabrice Bellard
87
+ */var lm=class{constructor(i,n,g,_={}){this._terminal=i,this._regex=n,this._handler=g,this._options=_}provideLinks(i,n){let g=hm.computeLink(i,this._regex,this._terminal,this._handler);n(this._addCallbacks(g))}_addCallbacks(i){return i.map(n=>(n.leave=this._options.leave,n.hover=(g,_)=>{if(this._options.hover){let{range:k}=n;this._options.hover(g,_,k)}},n))}};function cm(r){try{let i=new URL(r),n=i.password&&i.username?`${i.protocol}//${i.username}:${i.password}@${i.host}`:i.username?`${i.protocol}//${i.username}@${i.host}`:`${i.protocol}//${i.host}`;return r.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var hm=class Qo{static computeLink(i,n,g,_){let k=new RegExp(n.source,(n.flags||"")+"g"),[R,a]=Qo._getWindowedLineStrings(i-1,g),d=R.join(""),p,y=[];for(;p=k.exec(d);){let f=p[0];if(!cm(f))continue;let[S,b]=Qo._mapStrIdx(g,a,0,p.index),[M,w]=Qo._mapStrIdx(g,S,b,f.length);if(S===-1||b===-1||M===-1||w===-1)continue;let c={start:{x:b+1,y:S+1},end:{x:w,y:M+1}};y.push({range:c,text:f,activate:_})}return y}static _getWindowedLineStrings(i,n){let g,_=i,k=i,R=0,a="",d=[];if(g=n.buffer.active.getLine(i)){let p=g.translateToString(!0);if(g.isWrapped&&p[0]!==" "){for(R=0;(g=n.buffer.active.getLine(--_))&&R<2048&&(a=g.translateToString(!0),R+=a.length,d.push(a),!(!g.isWrapped||a.indexOf(" ")!==-1)););d.reverse()}for(d.push(p),R=0;(g=n.buffer.active.getLine(++k))&&g.isWrapped&&R<2048&&(a=g.translateToString(!0),R+=a.length,d.push(a),a.indexOf(" ")===-1););}return[d,_]}static _mapStrIdx(i,n,g,_){let k=i.buffer.active,R=k.getNullCell(),a=g;for(;_;){let d=k.getLine(n);if(!d)return[-1,-1];for(let p=a;p<d.length;++p){d.getCell(p,R);let y=R.getChars();if(R.getWidth()&&(_-=y.length||1,p===d.length-1&&y==="")){let f=k.getLine(n+1);f&&f.isWrapped&&(f.getCell(0,R),R.getWidth()===2&&(_+=1))}if(_<0)return[n,p]}n++,a=0}return[n,a]}},um=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function dm(r,i){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=i}else console.warn("Opening link blocked as opener could not be cleared")}var fm=class{constructor(r=dm,i={}){this._handler=r,this._options=i}activate(r){this._terminal=r;let i=this._options,n=i.urlRegex||um;this._linkProvider=this._terminal.registerLinkProvider(new lm(this._terminal,n,this._handler,i))}dispose(){var r;(r=this._linkProvider)==null||r.dispose()}};/**
88
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
89
+ * @license MIT
90
+ *
91
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
92
+ * @license MIT
93
+ *
94
+ * Originally forked from (with the author's permission):
95
+ * Fabrice Bellard's javascript vt100 for jslinux:
96
+ * http://bellard.org/jslinux/
97
+ * Copyright (c) 2011 Fabrice Bellard
98
+ */var _m=(r,i,n,g)=>{for(var _=i,k=r.length-1,R;k>=0;k--)(R=r[k])&&(_=R(_)||_);return _},pm=(r,i)=>(n,g)=>i(n,g,r),vm=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(r){setTimeout(()=>{throw r.stack?Id.isErrorNoTelemetry(r)?new Id(r.message+`
99
+
100
+ `+r.stack):new Error(r.message+`
101
+
102
+ `+r.stack):r},0)}}addListener(r){return this.listeners.push(r),()=>{this._removeListener(r)}}emit(r){this.listeners.forEach(i=>{i(r)})}_removeListener(r){this.listeners.splice(this.listeners.indexOf(r),1)}setUnexpectedErrorHandler(r){this.unexpectedErrorHandler=r}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(r){this.unexpectedErrorHandler(r),this.emit(r)}onUnexpectedExternalError(r){this.unexpectedErrorHandler(r)}},gm=new vm;function hc(r){mm(r)||gm.onUnexpectedError(r)}var Hc="Canceled";function mm(r){return r instanceof ym?!0:r instanceof Error&&r.name===Hc&&r.message===Hc}var ym=class extends Error{constructor(){super(Hc),this.name=this.message}},Id=class $c extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof $c)return i;let n=new $c;return n.message=i.message,n.stack=i.stack,n}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},wm;(r=>{function i(k){return k<0}r.isLessThan=i;function n(k){return k<=0}r.isLessThanOrEqual=n;function g(k){return k>0}r.isGreaterThan=g;function _(k){return k===0}r.isNeitherLessOrGreaterThan=_,r.greaterThan=1,r.lessThan=-1,r.neitherLessOrGreaterThan=0})(wm||(wm={}));function Sm(r,i){let n=this,g=!1,_;return function(){return g||(g=!0,i||(_=r.apply(n,arguments))),_}}var o_;(r=>{function i(v){return v&&typeof v=="object"&&typeof v[Symbol.iterator]=="function"}r.is=i;let n=Object.freeze([]);function g(){return n}r.empty=g;function*_(v){yield v}r.single=_;function k(v){return i(v)?v:_(v)}r.wrap=k;function R(v){return v||n}r.from=R;function*a(v){for(let C=v.length-1;C>=0;C--)yield v[C]}r.reverse=a;function d(v){return!v||v[Symbol.iterator]().next().done===!0}r.isEmpty=d;function p(v){return v[Symbol.iterator]().next().value}r.first=p;function y(v,C){let L=0;for(let T of v)if(C(T,L++))return!0;return!1}r.some=y;function f(v,C){for(let L of v)if(C(L))return L}r.find=f;function*S(v,C){for(let L of v)C(L)&&(yield L)}r.filter=S;function*b(v,C){let L=0;for(let T of v)yield C(T,L++)}r.map=b;function*M(v,C){let L=0;for(let T of v)yield*C(T,L++)}r.flatMap=M;function*w(...v){for(let C of v)yield*C}r.concat=w;function c(v,C,L){let T=L;for(let E of v)T=C(T,E);return T}r.reduce=c;function*u(v,C,L=v.length){for(C<0&&(C+=v.length),L<0?L+=v.length:L>v.length&&(L=v.length);C<L;C++)yield v[C]}r.slice=u;function l(v,C=Number.POSITIVE_INFINITY){let L=[];if(C===0)return[L,v];let T=v[Symbol.iterator]();for(let E=0;E<C;E++){let N=T.next();if(N.done)return[L,r.empty()];L.push(N.value)}return[L,{[Symbol.iterator](){return T}}]}r.consume=l;async function h(v){let C=[];for await(let L of v)C.push(L);return Promise.resolve(C)}r.asyncToArray=h})(o_||(o_={}));function a_(r){if(o_.is(r)){let i=[];for(let n of r)if(n)try{n.dispose()}catch(g){i.push(g)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(r)?[]:r}else if(r)return r.dispose(),r}function l_(...r){return Ut(()=>a_(r))}function Ut(r){return{dispose:Sm(()=>{r()})}}var c_=class h_{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{a_(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?h_.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};c_.DISABLE_DISPOSED_WARNING=!1;var Ds=c_,Mr=class{constructor(){this._store=new Ds,this._store}dispose(){this._store.dispose()}_register(r){if(r===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(r)}};Mr.None=Object.freeze({dispose(){}});var gn=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){var n;this._isDisposed||i===this._value||((n=this._value)==null||n.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){var i;this._isDisposed=!0,(i=this._value)==null||i.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},Gc=typeof process<"u"&&"title"in process,ca=Gc?"node":navigator.userAgent,Cm=Gc?"node":navigator.platform,xm=ca.includes("Firefox"),bm=ca.includes("Edge"),u_=/^((?!chrome|android).)*safari/i.test(ca);function Em(){if(!u_)return 0;let r=ca.match(/Version\/(\d+)/);return r===null||r.length<2?0:parseInt(r[1])}Cm.indexOf("Linux")>=0;var Lm="",kt=0,Rt=0,Mt=0,ht=0,mr={css:"#00000000",rgba:0},Xt;(r=>{function i(_,k,R,a){return a!==void 0?`#${Vi(_)}${Vi(k)}${Vi(R)}${Vi(a)}`:`#${Vi(_)}${Vi(k)}${Vi(R)}`}r.toCss=i;function n(_,k,R,a=255){return(_<<24|k<<16|R<<8|a)>>>0}r.toRgba=n;function g(_,k,R,a){return{css:r.toCss(_,k,R,a),rgba:r.toRgba(_,k,R,a)}}r.toColor=g})(Xt||(Xt={}));var Cn;(r=>{function i(d,p){if(ht=(p.rgba&255)/255,ht===1)return{css:p.css,rgba:p.rgba};let y=p.rgba>>24&255,f=p.rgba>>16&255,S=p.rgba>>8&255,b=d.rgba>>24&255,M=d.rgba>>16&255,w=d.rgba>>8&255;kt=b+Math.round((y-b)*ht),Rt=M+Math.round((f-M)*ht),Mt=w+Math.round((S-w)*ht);let c=Xt.toCss(kt,Rt,Mt),u=Xt.toRgba(kt,Rt,Mt);return{css:c,rgba:u}}r.blend=i;function n(d){return(d.rgba&255)===255}r.isOpaque=n;function g(d,p,y){let f=Gi.ensureContrastRatio(d.rgba,p.rgba,y);if(f)return Xt.toColor(f>>24&255,f>>16&255,f>>8&255)}r.ensureContrastRatio=g;function _(d){let p=(d.rgba|255)>>>0;return[kt,Rt,Mt]=Gi.toChannels(p),{css:Xt.toCss(kt,Rt,Mt),rgba:p}}r.opaque=_;function k(d,p){return ht=Math.round(p*255),[kt,Rt,Mt]=Gi.toChannels(d.rgba),{css:Xt.toCss(kt,Rt,Mt,ht),rgba:Xt.toRgba(kt,Rt,Mt,ht)}}r.opacity=k;function R(d,p){return ht=d.rgba&255,k(d,ht*p/255)}r.multiplyOpacity=R;function a(d){return[d.rgba>>24&255,d.rgba>>16&255,d.rgba>>8&255]}r.toColorRGB=a})(Cn||(Cn={}));var km;(r=>{let i,n;try{let _=document.createElement("canvas");_.width=1,_.height=1;let k=_.getContext("2d",{willReadFrequently:!0});k&&(i=k,i.globalCompositeOperation="copy",n=i.createLinearGradient(0,0,1,1))}catch{}function g(_){if(_.match(/#[\da-f]{3,8}/i))switch(_.length){case 4:return kt=parseInt(_.slice(1,2).repeat(2),16),Rt=parseInt(_.slice(2,3).repeat(2),16),Mt=parseInt(_.slice(3,4).repeat(2),16),Xt.toColor(kt,Rt,Mt);case 5:return kt=parseInt(_.slice(1,2).repeat(2),16),Rt=parseInt(_.slice(2,3).repeat(2),16),Mt=parseInt(_.slice(3,4).repeat(2),16),ht=parseInt(_.slice(4,5).repeat(2),16),Xt.toColor(kt,Rt,Mt,ht);case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}let k=_.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 kt=parseInt(k[1]),Rt=parseInt(k[2]),Mt=parseInt(k[3]),ht=Math.round((k[5]===void 0?1:parseFloat(k[5]))*255),Xt.toColor(kt,Rt,Mt,ht);if(!i||!n)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=n,i.fillStyle=_,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[kt,Rt,Mt,ht]=i.getImageData(0,0,1,1).data,ht!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Xt.toRgba(kt,Rt,Mt,ht),css:_}}r.toColor=g})(km||(km={}));var Yt;(r=>{function i(g){return n(g>>16&255,g>>8&255,g&255)}r.relativeLuminance=i;function n(g,_,k){let R=g/255,a=_/255,d=k/255,p=R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4),y=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4);return p*.2126+y*.7152+f*.0722}r.relativeLuminance2=n})(Yt||(Yt={}));var Gi;(r=>{function i(R,a){if(ht=(a&255)/255,ht===1)return a;let d=a>>24&255,p=a>>16&255,y=a>>8&255,f=R>>24&255,S=R>>16&255,b=R>>8&255;return kt=f+Math.round((d-f)*ht),Rt=S+Math.round((p-S)*ht),Mt=b+Math.round((y-b)*ht),Xt.toRgba(kt,Rt,Mt)}r.blend=i;function n(R,a,d){let p=Yt.relativeLuminance(R>>8),y=Yt.relativeLuminance(a>>8);if(Yr(p,y)<d){if(y<p){let b=g(R,a,d),M=Yr(p,Yt.relativeLuminance(b>>8));if(M<d){let w=_(R,a,d),c=Yr(p,Yt.relativeLuminance(w>>8));return M>c?b:w}return b}let f=_(R,a,d),S=Yr(p,Yt.relativeLuminance(f>>8));if(S<d){let b=g(R,a,d),M=Yr(p,Yt.relativeLuminance(b>>8));return S>M?f:b}return f}}r.ensureContrastRatio=n;function g(R,a,d){let p=R>>24&255,y=R>>16&255,f=R>>8&255,S=a>>24&255,b=a>>16&255,M=a>>8&255,w=Yr(Yt.relativeLuminance2(S,b,M),Yt.relativeLuminance2(p,y,f));for(;w<d&&(S>0||b>0||M>0);)S-=Math.max(0,Math.ceil(S*.1)),b-=Math.max(0,Math.ceil(b*.1)),M-=Math.max(0,Math.ceil(M*.1)),w=Yr(Yt.relativeLuminance2(S,b,M),Yt.relativeLuminance2(p,y,f));return(S<<24|b<<16|M<<8|255)>>>0}r.reduceLuminance=g;function _(R,a,d){let p=R>>24&255,y=R>>16&255,f=R>>8&255,S=a>>24&255,b=a>>16&255,M=a>>8&255,w=Yr(Yt.relativeLuminance2(S,b,M),Yt.relativeLuminance2(p,y,f));for(;w<d&&(S<255||b<255||M<255);)S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),M=Math.min(255,M+Math.ceil((255-M)*.1)),w=Yr(Yt.relativeLuminance2(S,b,M),Yt.relativeLuminance2(p,y,f));return(S<<24|b<<16|M<<8|255)>>>0}r.increaseLuminance=_;function k(R){return[R>>24&255,R>>16&255,R>>8&255,R&255]}r.toChannels=k})(Gi||(Gi={}));function Vi(r){let i=r.toString(16);return i.length<2?"0"+i:i}function Yr(r,i){return r<i?(i+.05)/(r+.05):(r+.05)/(i+.05)}function vt(r){if(!r)throw new Error("value must not be falsy");return r}function Yc(r){return 57508<=r&&r<=57558}function Rm(r){return 57520<=r&&r<=57527}function Mm(r){return 57344<=r&&r<=63743}function Tm(r){return 9472<=r&&r<=9631}function Dm(r){return r>=128512&&r<=128591||r>=127744&&r<=128511||r>=128640&&r<=128767||r>=9728&&r<=9983||r>=9984&&r<=10175||r>=65024&&r<=65039||r>=129280&&r<=129535||r>=127462&&r<=127487}function Am(r,i,n,g){return i===1&&n>Math.ceil(g*1.5)&&r!==void 0&&r>255&&!Dm(r)&&!Yc(r)&&!Mm(r)}function d_(r){return Yc(r)||Tm(r)}function Bm(){return{css:{canvas:Wo(),cell:Wo()},device:{canvas:Wo(),cell:Wo(),char:{width:0,height:0,left:0,top:0}}}}function Wo(){return{width:0,height:0}}function Pm(r,i,n=0){return(r-(Math.round(i)*2-n))%(Math.round(i)*2)}var At=0,Et=0,Pr=!1,Xr=!1,Vo=!1,sr,uc=0,Om=class{constructor(r,i,n,g,_,k){this._terminal=r,this._optionService=i,this._selectionRenderModel=n,this._decorationService=g,this._coreBrowserService=_,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(r,i,n,g){if(this.result.bg=r.bg,this.result.fg=r.fg,this.result.ext=r.bg&268435456?r.extended.ext:0,Et=0,At=0,Xr=!1,Pr=!1,Vo=!1,sr=this._themeService.colors,uc=0,r.getCode()!==0&&r.extended.underlineStyle===4){let _=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));uc=i*g%(Math.round(_)*2)}if(this._decorationService.forEachDecorationAtCell(i,n,"bottom",_=>{_.backgroundColorRGB&&(Et=_.backgroundColorRGB.rgba>>8&16777215,Xr=!0),_.foregroundColorRGB&&(At=_.foregroundColorRGB.rgba>>8&16777215,Pr=!0)}),Vo=this._selectionRenderModel.isCellSelected(this._terminal,i,n),Vo){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Et=(this.result.fg&16777215)<<8|255;break;case 0:default:Et=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Et=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Et=(this.result.bg&16777215)<<8|255;break}Et=Gi.blend(Et,(this._coreBrowserService.isFocused?sr.selectionBackgroundOpaque:sr.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Et=(this._coreBrowserService.isFocused?sr.selectionBackgroundOpaque:sr.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Xr=!0,sr.selectionForeground&&(At=sr.selectionForeground.rgba>>8&16777215,Pr=!0),d_(r.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)At=(this._coreBrowserService.isFocused?sr.selectionBackgroundOpaque:sr.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:At=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:At=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:At=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:At=(this.result.fg&16777215)<<8|255;break;case 0:default:At=this._themeService.colors.foreground.rgba}At=Gi.blend(At,(this._coreBrowserService.isFocused?sr.selectionBackgroundOpaque:sr.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Pr=!0}}this._decorationService.forEachDecorationAtCell(i,n,"top",_=>{_.backgroundColorRGB&&(Et=_.backgroundColorRGB.rgba>>8&16777215,Xr=!0),_.foregroundColorRGB&&(At=_.foregroundColorRGB.rgba>>8&16777215,Pr=!0)}),Xr&&(Vo?Et=r.bg&-16777216&-134217729|Et|50331648:Et=r.bg&-16777216|Et|50331648),Pr&&(At=r.fg&-16777216&-67108865|At|50331648),this.result.fg&67108864&&(Xr&&!Pr&&((this.result.bg&50331648)===0?At=this.result.fg&-134217728|sr.background.rgba>>8&16777215&16777215|50331648:At=this.result.fg&-134217728|this.result.bg&67108863,Pr=!0),!Xr&&Pr&&((this.result.fg&50331648)===0?Et=this.result.bg&-67108864|sr.foreground.rgba>>8&16777215&16777215|50331648:Et=this.result.bg&-67108864|this.result.fg&67108863,Xr=!0)),sr=void 0,this.result.bg=Xr?Et:this.result.bg,this.result.fg=Pr?At:this.result.fg,this.result.ext&=536870911,this.result.ext|=uc<<29&3758096384}},Nm=.5,f_=xm||bm?"bottom":"ideographic",Im={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},Fm={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},jm={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"║":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╒":{1:(r,i)=>`M.5,1 L.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╓":{1:(r,i)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"╔":{1:(r,i)=>`M1,${.5-i} L${.5-r},${.5-i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1`},"╕":{1:(r,i)=>`M0,${.5-i} L.5,${.5-i} L.5,1 M0,${.5+i} L.5,${.5+i}`},"╖":{1:(r,i)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"╗":{1:(r,i)=>`M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M0,${.5-i} L${.5+r},${.5-i} L${.5+r},1`},"╘":{1:(r,i)=>`M.5,0 L.5,${.5+i} L1,${.5+i} M.5,${.5-i} L1,${.5-i}`},"╙":{1:(r,i)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╚":{1:(r,i)=>`M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0 M1,${.5+i} L${.5-r},${.5+i} L${.5-r},0`},"╛":{1:(r,i)=>`M0,${.5+i} L.5,${.5+i} L.5,0 M0,${.5-i} L.5,${.5-i}`},"╜":{1:(r,i)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"╝":{1:(r,i)=>`M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M0,${.5+i} L${.5+r},${.5+i} L${.5+r},0`},"╞":{1:(r,i)=>`M.5,0 L.5,1 M.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╟":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"╠":{1:(r,i)=>`M${.5-r},0 L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0`},"╡":{1:(r,i)=>`M.5,0 L.5,1 M0,${.5-i} L.5,${.5-i} M0,${.5+i} L.5,${.5+i}`},"╢":{1:(r,i)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╣":{1:(r,i)=>`M${.5+r},0 L${.5+r},1 M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0`},"╤":{1:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i} M.5,${.5+i} L.5,1`},"╥":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"╦":{1:(r,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1`},"╧":{1:(r,i)=>`M.5,0 L.5,${.5-i} M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╨":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"╩":{1:(r,i)=>`M0,${.5+i} L1,${.5+i} M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0`},"╪":{1:(r,i)=>`M.5,0 L.5,1 M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╫":{1:(r,i)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"╬":{1:(r,i)=>`M0,${.5+i} L${.5-r},${.5+i} L${.5-r},1 M1,${.5+i} L${.5+r},${.5+i} L${.5+r},1 M0,${.5-i} L${.5-r},${.5-i} L${.5-r},0 M1,${.5-i} L${.5+r},${.5-i} L${.5+r},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(r,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,1,.5`},"╮":{1:(r,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,0,.5`},"╯":{1:(r,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,0,.5`},"╰":{1:(r,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,1,.5`}},Ln={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Ln[""]=Ln[""];Ln[""]=Ln[""];function Hm(r,i,n,g,_,k,R,a){let d=Im[i];if(d)return $m(r,d,n,g,_,k),!0;let p=Fm[i];if(p)return zm(r,p,n,g,_,k),!0;let y=jm[i];if(y)return Um(r,y,n,g,_,k,a),!0;let f=Ln[i];return f?(Wm(r,f,n,g,_,k,R,a),!0):!1}function $m(r,i,n,g,_,k){for(let R=0;R<i.length;R++){let a=i[R],d=_/8,p=k/8;r.fillRect(n+a.x*d,g+a.y*p,a.w*d,a.h*p)}}var Fd=new Map;function zm(r,i,n,g,_,k){let R=Fd.get(i);R||(R=new Map,Fd.set(i,R));let a=r.fillStyle;if(typeof a!="string")throw new Error(`Unexpected fillStyle type "${a}"`);let d=R.get(a);if(!d){let p=i[0].length,y=i.length,f=r.canvas.ownerDocument.createElement("canvas");f.width=p,f.height=y;let S=vt(f.getContext("2d")),b=new ImageData(p,y),M,w,c,u;if(a.startsWith("#"))M=parseInt(a.slice(1,3),16),w=parseInt(a.slice(3,5),16),c=parseInt(a.slice(5,7),16),u=a.length>7&&parseInt(a.slice(7,9),16)||1;else if(a.startsWith("rgba"))[M,w,c,u]=a.substring(5,a.length-1).split(",").map(l=>parseFloat(l));else throw new Error(`Unexpected fillStyle color format "${a}" when drawing pattern glyph`);for(let l=0;l<y;l++)for(let h=0;h<p;h++)b.data[(l*p+h)*4]=M,b.data[(l*p+h)*4+1]=w,b.data[(l*p+h)*4+2]=c,b.data[(l*p+h)*4+3]=i[l][h]*(u*255);S.putImageData(b,0,0),d=vt(r.createPattern(f,null)),R.set(a,d)}r.fillStyle=d,r.fillRect(n,g,_,k)}function Um(r,i,n,g,_,k,R){r.strokeStyle=r.fillStyle;for(let[a,d]of Object.entries(i)){r.beginPath(),r.lineWidth=R*Number.parseInt(a);let p;if(typeof d=="function"){let y=.15/k*_;p=d(.15,y)}else p=d;for(let y of p.split(" ")){let f=y[0],S=__[f];if(!S){console.error(`Could not find drawing instructions for "${f}"`);continue}let b=y.substring(1).split(",");!b[0]||!b[1]||S(r,p_(b,_,k,n,g,!0,R))}r.stroke(),r.closePath()}}function Wm(r,i,n,g,_,k,R,a){let d=new Path2D;d.rect(n,g,_,k),r.clip(d),r.beginPath();let p=R/12;r.lineWidth=a*p;for(let y of i.d.split(" ")){let f=y[0],S=__[f];if(!S){console.error(`Could not find drawing instructions for "${f}"`);continue}let b=y.substring(1).split(",");!b[0]||!b[1]||S(r,p_(b,_,k,n,g,!1,a,(i.leftPadding??0)*(p/2),(i.rightPadding??0)*(p/2)))}i.type===1?(r.strokeStyle=r.fillStyle,r.stroke()):r.fill(),r.closePath()}function jd(r,i,n=0){return Math.max(Math.min(r,i),n)}var __={C:(r,i)=>r.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]),L:(r,i)=>r.lineTo(i[0],i[1]),M:(r,i)=>r.moveTo(i[0],i[1])};function p_(r,i,n,g,_,k,R,a=0,d=0){let p=r.map(y=>parseFloat(y)||parseInt(y));if(p.length<2)throw new Error("Too few arguments for instruction");for(let y=0;y<p.length;y+=2)p[y]*=i-a*R-d*R,k&&p[y]!==0&&(p[y]=jd(Math.round(p[y]+.5)-.5,i,0)),p[y]+=g+a*R;for(let y=1;y<p.length;y+=2)p[y]*=n,k&&p[y]!==0&&(p[y]=jd(Math.round(p[y]+.5)-.5,n,0)),p[y]+=_;return p}var Hd=class{constructor(){this._data={}}set(r,i,n){this._data[r]||(this._data[r]={}),this._data[r][i]=n}get(r,i){return this._data[r]?this._data[r][i]:void 0}clear(){this._data={}}},$d=class{constructor(){this._data=new Hd}set(r,i,n,g,_){this._data.get(r,i)||this._data.set(r,i,new Hd),this._data.get(r,i).set(n,g,_)}get(r,i,n,g){var _;return(_=this._data.get(r,i))==null?void 0:_.get(n,g)}clear(){this._data.clear()}},v_=class{constructor(){this._tasks=[],this._i=0}enqueue(i){this._tasks.push(i),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(i){this._idleCallback=void 0;let n=0,g=0,_=i.timeRemaining(),k=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),g=Math.max(n,g),k=i.timeRemaining(),g*1.5>k){_-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-n))}ms`),this._start();return}_=k}this.clear()}},Vm=class extends v_{_requestCallback(r){return setTimeout(()=>r(this._createDeadline(16)))}_cancelCallback(r){clearTimeout(r)}_createDeadline(r){let i=performance.now()+r;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},Km=class extends v_{_requestCallback(r){return requestIdleCallback(r)}_cancelCallback(r){cancelIdleCallback(r)}},qm=!Gc&&"requestIdleCallback"in window?Km:Vm,Rs=class g_{constructor(){this.fg=0,this.bg=0,this.extended=new m_}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new g_;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},m_=class y_{constructor(i=0,n=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new y_(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Gm=globalThis.performance&&typeof globalThis.performance.now=="function",Ym=class w_{static create(i){return new w_(i)}constructor(i){this._now=Gm&&i===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Zr;(r=>{r.None=()=>Mr.None;function i(I,B){return f(I,()=>{},0,void 0,!0,void 0,B)}r.defer=i;function n(I){return(B,U=null,$)=>{let V=!1,X;return X=I(z=>{if(!V)return X?X.dispose():V=!0,B.call(U,z)},null,$),V&&X.dispose(),X}}r.once=n;function g(I,B,U){return p(($,V=null,X)=>I(z=>$.call(V,B(z)),null,X),U)}r.map=g;function _(I,B,U){return p(($,V=null,X)=>I(z=>{B(z),$.call(V,z)},null,X),U)}r.forEach=_;function k(I,B,U){return p(($,V=null,X)=>I(z=>B(z)&&$.call(V,z),null,X),U)}r.filter=k;function R(I){return I}r.signal=R;function a(...I){return(B,U=null,$)=>{let V=l_(...I.map(X=>X(z=>B.call(U,z))));return y(V,$)}}r.any=a;function d(I,B,U,$){let V=U;return g(I,X=>(V=B(V,X),V),$)}r.reduce=d;function p(I,B){let U,$={onWillAddFirstListener(){U=I(V.fire,V)},onDidRemoveLastListener(){U==null||U.dispose()}},V=new rt($);return B==null||B.add(V),V.event}function y(I,B){return B instanceof Array?B.push(I):B&&B.add(I),I}function f(I,B,U=100,$=!1,V=!1,X,z){let D,O,A,H=0,Q,ne={leakWarningThreshold:X,onWillAddFirstListener(){D=I(ue=>{H++,O=B(O,ue),$&&!A&&(oe.fire(O),O=void 0),Q=()=>{let Y=O;O=void 0,A=void 0,(!$||H>1)&&oe.fire(Y),H=0},typeof U=="number"?(clearTimeout(A),A=setTimeout(Q,U)):A===void 0&&(A=0,queueMicrotask(Q))})},onWillRemoveListener(){V&&H>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,D.dispose()}},oe=new rt(ne);return z==null||z.add(oe),oe.event}r.debounce=f;function S(I,B=0,U){return r.debounce(I,($,V)=>$?($.push(V),$):[V],B,void 0,!0,void 0,U)}r.accumulate=S;function b(I,B=($,V)=>$===V,U){let $=!0,V;return k(I,X=>{let z=$||!B(X,V);return $=!1,V=X,z},U)}r.latch=b;function M(I,B,U){return[r.filter(I,B,U),r.filter(I,$=>!B($),U)]}r.split=M;function w(I,B=!1,U=[],$){let V=U.slice(),X=I(O=>{V?V.push(O):D.fire(O)});$&&$.add(X);let z=()=>{V==null||V.forEach(O=>D.fire(O)),V=null},D=new rt({onWillAddFirstListener(){X||(X=I(O=>D.fire(O)),$&&$.add(X))},onDidAddFirstListener(){V&&(B?setTimeout(z):z())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return $&&$.add(D),D.event}r.buffer=w;function c(I,B){return(U,$,V)=>{let X=B(new l);return I(function(z){let D=X.evaluate(z);D!==u&&U.call($,D)},void 0,V)}}r.chain=c;let u=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(U=>(B(U),U)),this}filter(B){return this.steps.push(U=>B(U)?U:u),this}reduce(B,U){let $=U;return this.steps.push(V=>($=B($,V),$)),this}latch(B=(U,$)=>U===$){let U=!0,$;return this.steps.push(V=>{let X=U||!B(V,$);return U=!1,$=V,X?V:u}),this}evaluate(B){for(let U of this.steps)if(B=U(B),B===u)break;return B}}function h(I,B,U=$=>$){let $=(...D)=>z.fire(U(...D)),V=()=>I.on(B,$),X=()=>I.removeListener(B,$),z=new rt({onWillAddFirstListener:V,onDidRemoveLastListener:X});return z.event}r.fromNodeEventEmitter=h;function v(I,B,U=$=>$){let $=(...D)=>z.fire(U(...D)),V=()=>I.addEventListener(B,$),X=()=>I.removeEventListener(B,$),z=new rt({onWillAddFirstListener:V,onDidRemoveLastListener:X});return z.event}r.fromDOMEventEmitter=v;function C(I){return new Promise(B=>n(I)(B))}r.toPromise=C;function L(I){let B=new rt;return I.then(U=>{B.fire(U)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}r.fromPromise=L;function T(I,B){return I(U=>B.fire(U))}r.forward=T;function E(I,B,U){return B(U),I($=>B($))}r.runAndSubscribe=E;class N{constructor(B,U){this._observable=B,this._counter=0,this._hasChanged=!1;let $={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new rt($),U&&U.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,U){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(I,B){return new N(I,B).emitter.event}r.fromObservable=W;function K(I){return(B,U,$)=>{let V=0,X=!1,z={beginUpdate(){V++},endUpdate(){V--,V===0&&(I.reportChanges(),X&&(X=!1,B.call(U)))},handlePossibleChange(){},handleChange(){X=!0}};I.addObserver(z),I.reportChanges();let D={dispose(){I.removeObserver(z)}};return $ instanceof Ds?$.add(D):Array.isArray($)&&$.push(D),D}}r.fromObservableLight=K})(Zr||(Zr={}));var zc=class Uc{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${Uc._idPool++}`,Uc.all.add(this)}start(i){this._stopWatch=new Ym,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};zc.all=new Set,zc._idPool=0;var Xm=zc,Jm=-1,S_=class C_{constructor(i,n,g=(C_._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=n,this.name=g,this._warnCountdown=0}dispose(){var i;(i=this._stacks)==null||i.clear()}check(i,n){let g=this.threshold;if(g<=0||n<g)return;this._stacks||(this._stacks=new Map);let _=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,_+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=g*.5;let[k,R]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${R}):`;console.warn(a),console.warn(k);let d=new e0(a,k);this._errorHandler(d)}return()=>{let k=this._stacks.get(i.value)||0;this._stacks.set(i.value,k-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,n=0;for(let[g,_]of this._stacks)(!i||n<_)&&(i=[g,_],n=_);return i}};S_._idPool=1;var Qm=S_,Zm=class x_{constructor(i){this.value=i}static create(){let i=new Error;return new x_(i.stack??"")}print(){console.warn(this.value.split(`
103
+ `).slice(2).join(`
104
+ `))}},e0=class extends Error{constructor(r,i){super(r),this.name="ListenerLeakError",this.stack=i}},t0=class extends Error{constructor(r,i){super(r),this.name="ListenerRefusalError",this.stack=i}},r0=0,dc=class{constructor(r){this.value=r,this.id=r0++}},i0=2,s0,rt=class{constructor(i){var n,g,_,k;this._size=0,this._options=i,this._leakageMon=(n=this._options)!=null&&n.leakWarningThreshold?new Qm((i==null?void 0:i.onListenerError)??hc,((g=this._options)==null?void 0:g.leakWarningThreshold)??Jm):void 0,this._perfMon=(_=this._options)!=null&&_._profName?new Xm(this._options._profName):void 0,this._deliveryQueue=(k=this._options)==null?void 0:k.deliveryQueue}dispose(){var i,n,g,_;this._disposed||(this._disposed=!0,((i=this._deliveryQueue)==null?void 0:i.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(g=(n=this._options)==null?void 0:n.onDidRemoveLastListener)==null||g.call(n),(_=this._leakageMon)==null||_.dispose())}get event(){return this._event??(this._event=(i,n,g)=>{var a,d,p,y,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let S=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(S);let b=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],M=new t0(`${S}. HINT: Stack shows most frequent listener (${b[1]}-times)`,b[0]);return(((a=this._options)==null?void 0:a.onListenerError)||hc)(M),Mr.None}if(this._disposed)return Mr.None;n&&(i=i.bind(n));let _=new dc(i),k;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(_.stack=Zm.create(),k=this._leakageMon.check(_.stack,this._size+1)),this._listeners?this._listeners instanceof dc?(this._deliveryQueue??(this._deliveryQueue=new n0),this._listeners=[this._listeners,_]):this._listeners.push(_):((p=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||p.call(d,this),this._listeners=_,(f=(y=this._options)==null?void 0:y.onDidAddFirstListener)==null||f.call(y,this)),this._size++;let R=Ut(()=>{k==null||k(),this._removeListener(_)});return g instanceof Ds?g.add(R):Array.isArray(g)&&g.push(R),R}),this._event}_removeListener(i){var k,R,a,d;if((R=(k=this._options)==null?void 0:k.onWillRemoveListener)==null||R.call(k,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||d.call(a,this),this._size=0;return}let n=this._listeners,g=n.indexOf(i);if(g===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[g]=void 0;let _=this._deliveryQueue.current===this;if(this._size*i0<=n.length){let p=0;for(let y=0;y<n.length;y++)n[y]?n[p++]=n[y]:_&&(this._deliveryQueue.end--,p<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=p}}_deliver(i,n){var _;if(!i)return;let g=((_=this._options)==null?void 0:_.onListenerError)||hc;if(!g){i.value(n);return}try{i.value(n)}catch(k){g(k)}}_deliverQueue(i){let n=i.current._listeners;for(;i.i<i.end;)this._deliver(n[i.i++],i.value);i.reset()}fire(i){var n,g,_,k;if((n=this._deliveryQueue)!=null&&n.current&&(this._deliverQueue(this._deliveryQueue),(g=this._perfMon)==null||g.stop()),(_=this._perfMon)==null||_.start(this._size),this._listeners)if(this._listeners instanceof dc)this._deliver(this._listeners,i);else{let R=this._deliveryQueue;R.enqueue(this,i,this._listeners.length),this._deliverQueue(R)}(k=this._perfMon)==null||k.stop()}hasListeners(){return this._size>0}},n0=class{constructor(){this.i=-1,this.end=0}enqueue(r,i,n){this.i=0,this.end=n,this.current=r,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},zd={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},mn=2,yn,Li=class ks{constructor(i,n,g){this._document=i,this._config=n,this._unicodeService=g,this._didWarmUp=!1,this._cacheMap=new $d,this._cacheMapCombined=new $d,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Rs,this._textureSize=512,this._onAddTextureAtlasCanvas=new rt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new rt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=b_(i,this._config.deviceCellWidth*4+mn*2,this._config.deviceCellHeight+mn*2),this._tmpCtx=vt(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let i of this.pages)i.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let i=new qm;for(let n=33;n<126;n++)i.enqueue(()=>{if(!this._cacheMap.get(n,0,0,0)){let g=this._drawToCache(n,0,0,0,!1,void 0);this._cacheMap.set(n,0,0,0,g)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let i of this._pages)i.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(ks.maxAtlasPages&&this._pages.length>=Math.max(4,ks.maxAtlasPages)){let n=this._pages.filter(p=>p.canvas.width*2<=(ks.maxTextureSize||4096)).sort((p,y)=>y.canvas.width!==p.canvas.width?y.canvas.width-p.canvas.width:y.percentageUsed-p.percentageUsed),g=-1,_=0;for(let p=0;p<n.length;p++)if(n[p].canvas.width!==_)g=p,_=n[p].canvas.width;else if(p-g===3)break;let k=n.slice(g,g+4),R=k.map(p=>p.glyphs[0].texturePage).sort((p,y)=>p>y?1:-1),a=this.pages.length-k.length,d=this._mergePages(k,a);d.version++;for(let p=R.length-1;p>=0;p--)this._deletePage(R[p]);this.pages.push(d),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(d.canvas)}let i=new fc(this._document,this._textureSize);return this._pages.push(i),this._activePages.push(i),this._onAddTextureAtlasCanvas.fire(i.canvas),i}_mergePages(i,n){let g=i[0].canvas.width*2,_=new fc(this._document,g,i);for(let[k,R]of i.entries()){let a=k*R.canvas.width%g,d=Math.floor(k/2)*R.canvas.height;_.ctx.drawImage(R.canvas,a,d);for(let y of R.glyphs)y.texturePage=n,y.sizeClipSpace.x=y.size.x/g,y.sizeClipSpace.y=y.size.y/g,y.texturePosition.x+=a,y.texturePosition.y+=d,y.texturePositionClipSpace.x=y.texturePosition.x/g,y.texturePositionClipSpace.y=y.texturePosition.y/g;this._onRemoveTextureAtlasCanvas.fire(R.canvas);let p=this._activePages.indexOf(R);p!==-1&&this._activePages.splice(p,1)}return _}_deletePage(i){this._pages.splice(i,1);for(let n=i;n<this._pages.length;n++){let g=this._pages[n];for(let _ of g.glyphs)_.texturePage--;g.version++}}getRasterizedGlyphCombinedChar(i,n,g,_,k,R){return this._getFromCacheMap(this._cacheMapCombined,i,n,g,_,k,R)}getRasterizedGlyph(i,n,g,_,k,R){return this._getFromCacheMap(this._cacheMap,i,n,g,_,k,R)}_getFromCacheMap(i,n,g,_,k,R,a){return yn=i.get(n,g,_,k),yn||(yn=this._drawToCache(n,g,_,k,R,a),i.set(n,g,_,k,yn)),yn}_getColorFromAnsiIndex(i){if(i>=this._config.colors.ansi.length)throw new Error("No color found for idx "+i);return this._config.colors.ansi[i]}_getBackgroundColor(i,n,g,_){if(this._config.allowTransparency)return mr;let k;switch(i){case 16777216:case 33554432:k=this._getColorFromAnsiIndex(n);break;case 50331648:let R=Rs.toColorRGB(n);k=Xt.toColor(R[0],R[1],R[2]);break;case 0:default:g?k=Cn.opaque(this._config.colors.foreground):k=this._config.colors.background;break}return this._config.allowTransparency||(k=Cn.opaque(k)),k}_getForegroundColor(i,n,g,_,k,R,a,d,p,y){let f=this._getMinimumContrastColor(i,n,g,_,k,R,a,p,d,y);if(f)return f;let S;switch(k){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&p&&R<8&&(R+=8),S=this._getColorFromAnsiIndex(R);break;case 50331648:let b=Rs.toColorRGB(R);S=Xt.toColor(b[0],b[1],b[2]);break;case 0:default:a?S=this._config.colors.background:S=this._config.colors.foreground}return this._config.allowTransparency&&(S=Cn.opaque(S)),d&&(S=Cn.multiplyOpacity(S,Nm)),S}_resolveBackgroundRgba(i,n,g){switch(i){case 16777216:case 33554432:return this._getColorFromAnsiIndex(n).rgba;case 50331648:return n<<8;case 0:default:return g?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(i,n,g,_){switch(i){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&_&&n<8&&(n+=8),this._getColorFromAnsiIndex(n).rgba;case 50331648:return n<<8;case 0:default:return g?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(i,n,g,_,k,R,a,d,p,y){if(this._config.minimumContrastRatio===1||y)return;let f=this._getContrastCache(p),S=f.getColor(i,_);if(S!==void 0)return S||void 0;let b=this._resolveBackgroundRgba(n,g,a),M=this._resolveForegroundRgba(k,R,a,d),w=Gi.ensureContrastRatio(b,M,this._config.minimumContrastRatio/(p?2:1));if(!w){f.setColor(i,_,null);return}let c=Xt.toColor(w>>24&255,w>>16&255,w>>8&255);return f.setColor(i,_,c),c}_getContrastCache(i){return i?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(i,n,g,_,k,R){let a=typeof i=="number"?String.fromCharCode(i):i;R&&this._tmpCanvas.parentElement!==R&&(this._tmpCanvas.style.display="none",R.append(this._tmpCanvas));let d=Math.min(this._config.deviceCellWidth*Math.max(a.length,2)+mn*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<d&&(this._tmpCanvas.width=d);let p=Math.min(this._config.deviceCellHeight+mn*4,this._textureSize);if(this._tmpCanvas.height<p&&(this._tmpCanvas.height=p),this._tmpCtx.save(),this._workAttributeData.fg=g,this._workAttributeData.bg=n,this._workAttributeData.extended.ext=_,!!this._workAttributeData.isInvisible())return zd;let y=!!this._workAttributeData.isBold(),f=!!this._workAttributeData.isInverse(),S=!!this._workAttributeData.isDim(),b=!!this._workAttributeData.isItalic(),M=!!this._workAttributeData.isUnderline(),w=!!this._workAttributeData.isStrikethrough(),c=!!this._workAttributeData.isOverline(),u=this._workAttributeData.getFgColor(),l=this._workAttributeData.getFgColorMode(),h=this._workAttributeData.getBgColor(),v=this._workAttributeData.getBgColorMode();if(f){let O=u;u=h,h=O;let A=l;l=v,v=A}let C=this._getBackgroundColor(v,h,f,S);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=C.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=y?this._config.fontWeightBold:this._config.fontWeight,T=b?"italic":"";this._tmpCtx.font=`${T} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=f_;let E=a.length===1&&Yc(a.charCodeAt(0)),N=a.length===1&&Rm(a.charCodeAt(0)),W=this._getForegroundColor(n,v,h,g,l,u,f,S,y,d_(a.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let K=N?0:mn*2,I=!1;this._config.customGlyphs!==!1&&(I=Hm(this._tmpCtx,a,K,K,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!E,U;if(typeof i=="number"?U=this._unicodeService.wcwidth(i):U=this._unicodeService.getStringCellWidth(i),M){this._tmpCtx.save();let O=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),A=O%2===1?.5:0;if(this._tmpCtx.lineWidth=O,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Rs.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let Y=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Y<8&&(Y+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Y).css}this._tmpCtx.beginPath();let H=K,Q=Math.ceil(K+this._config.deviceCharHeight)-A-(k?O*2:0),ne=Q+O,oe=Q+O*2,ue=this._workAttributeData.getUnderlineVariantOffset();for(let Y=0;Y<U;Y++){this._tmpCtx.save();let j=H+Y*this._config.deviceCellWidth,se=H+(Y+1)*this._config.deviceCellWidth,re=j+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(j,Q),this._tmpCtx.lineTo(se,Q),this._tmpCtx.moveTo(j,oe),this._tmpCtx.lineTo(se,oe);break;case 3:let ve=O<=1?oe:Math.ceil(K+this._config.deviceCharHeight-O/2)-A,_e=O<=1?Q:Math.ceil(K+this._config.deviceCharHeight+O/2)-A,Re=new Path2D;Re.rect(j,Q,this._config.deviceCellWidth,oe-Q),this._tmpCtx.clip(Re),this._tmpCtx.moveTo(j-this._config.deviceCellWidth/2,ne),this._tmpCtx.bezierCurveTo(j-this._config.deviceCellWidth/2,_e,j,_e,j,ne),this._tmpCtx.bezierCurveTo(j,ve,re,ve,re,ne),this._tmpCtx.bezierCurveTo(re,_e,se,_e,se,ne),this._tmpCtx.bezierCurveTo(se,ve,se+this._config.deviceCellWidth/2,ve,se+this._config.deviceCellWidth/2,ne);break;case 4:let Se=ue===0?0:ue>=O?O*2-ue:O-ue;ue>=O||Se===0?(this._tmpCtx.setLineDash([Math.round(O),Math.round(O)]),this._tmpCtx.moveTo(j+Se,Q),this._tmpCtx.lineTo(se,Q)):(this._tmpCtx.setLineDash([Math.round(O),Math.round(O)]),this._tmpCtx.moveTo(j,Q),this._tmpCtx.lineTo(j+Se,Q),this._tmpCtx.moveTo(j+Se+O,Q),this._tmpCtx.lineTo(se,Q)),ue=Pm(se-j,O,ue);break;case 5:let $e=.6,je=.3,xe=se-j,Xe=Math.floor($e*xe),ft=Math.floor(je*xe),_t=xe-Xe-ft;this._tmpCtx.setLineDash([Xe,ft,_t]),this._tmpCtx.moveTo(j,Q),this._tmpCtx.lineTo(se,Q);break;case 1:default:this._tmpCtx.moveTo(j,Q),this._tmpCtx.lineTo(se,Q);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!I&&this._config.fontSize>=12&&!this._config.allowTransparency&&a!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Y=this._tmpCtx.measureText(a);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Y&&Y.actualBoundingBoxDescent>0){this._tmpCtx.save();let j=new Path2D;j.rect(H,Q-Math.ceil(O/2),this._config.deviceCellWidth*U,oe-Q+Math.ceil(O/2)),this._tmpCtx.clip(j),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=C.css,this._tmpCtx.strokeText(a,K,K+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(c){let O=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),A=O%2===1?.5:0;this._tmpCtx.lineWidth=O,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+A),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*U,K+A),this._tmpCtx.stroke()}if(I||this._tmpCtx.fillText(a,K,K+this._config.deviceCharHeight),a==="_"&&!this._config.allowTransparency){let O=_c(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),C,W,B);if(O)for(let A=1;A<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=C.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(a,K,K+this._config.deviceCharHeight-A),O=_c(this._tmpCtx.getImageData(K,K,this._config.deviceCellWidth,this._config.deviceCellHeight),C,W,B),!!O);A++);}if(w){let O=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),A=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=O,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(K,K+Math.floor(this._config.deviceCharHeight/2)-A),this._tmpCtx.lineTo(K+this._config.deviceCharWidth*U,K+Math.floor(this._config.deviceCharHeight/2)-A),this._tmpCtx.stroke()}this._tmpCtx.restore();let $=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),V;if(this._config.allowTransparency?V=o0($):V=_c($,C,W,B),V)return zd;let X=this._findGlyphBoundingBox($,this._workBoundingBox,d,N,I,K),z,D;for(;;){if(this._activePages.length===0){let O=this._createNewPage();z=O,D=O.currentRow,D.height=X.size.y;break}z=this._activePages[this._activePages.length-1],D=z.currentRow;for(let O of this._activePages)X.size.y<=O.currentRow.height&&(z=O,D=O.currentRow);for(let O=this._activePages.length-1;O>=0;O--)for(let A of this._activePages[O].fixedRows)A.height<=D.height&&X.size.y<=A.height&&(z=this._activePages[O],D=A);if(X.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new fc(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),z=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+X.size.x>=z.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+X.size.y>=z.canvas.height||D.height>X.size.y+2){let O=!1;if(z.currentRow.y+z.currentRow.height+X.size.y>=z.canvas.height){let A;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+X.size.y<H.canvas.height){A=H;break}if(A)z=A;else if(ks.maxAtlasPages&&this._pages.length>=ks.maxAtlasPages&&D.y+X.size.y<=z.canvas.height&&D.height>=X.size.y&&D.x+X.size.x<=z.canvas.width)O=!0;else{let H=this._createNewPage();z=H,D=H.currentRow,D.height=X.size.y,O=!0}}O||(z.currentRow.height>0&&z.fixedRows.push(z.currentRow),D={x:0,y:z.currentRow.y+z.currentRow.height,height:X.size.y},z.fixedRows.push(D),z.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+X.size.x<=z.canvas.width)break;D===z.currentRow?(D.x=0,D.y+=D.height,D.height=0):z.fixedRows.splice(z.fixedRows.indexOf(D),1)}return X.texturePage=this._pages.indexOf(z),X.texturePosition.x=D.x,X.texturePosition.y=D.y,X.texturePositionClipSpace.x=D.x/z.canvas.width,X.texturePositionClipSpace.y=D.y/z.canvas.height,X.sizeClipSpace.x/=z.canvas.width,X.sizeClipSpace.y/=z.canvas.height,D.height=Math.max(D.height,X.size.y),D.x+=X.size.x,z.ctx.putImageData($,X.texturePosition.x-this._workBoundingBox.left,X.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,X.size.x,X.size.y),z.addGlyph(X),z.version++,X}_findGlyphBoundingBox(i,n,g,_,k,R){n.top=0;let a=_?this._config.deviceCellHeight:this._tmpCanvas.height,d=_?this._config.deviceCellWidth:g,p=!1;for(let y=0;y<a;y++){for(let f=0;f<d;f++){let S=y*this._tmpCanvas.width*4+f*4+3;if(i.data[S]!==0){n.top=y,p=!0;break}}if(p)break}n.left=0,p=!1;for(let y=0;y<R+d;y++){for(let f=0;f<a;f++){let S=f*this._tmpCanvas.width*4+y*4+3;if(i.data[S]!==0){n.left=y,p=!0;break}}if(p)break}n.right=d,p=!1;for(let y=R+d-1;y>=R;y--){for(let f=0;f<a;f++){let S=f*this._tmpCanvas.width*4+y*4+3;if(i.data[S]!==0){n.right=y,p=!0;break}}if(p)break}n.bottom=a,p=!1;for(let y=a-1;y>=0;y--){for(let f=0;f<d;f++){let S=y*this._tmpCanvas.width*4+f*4+3;if(i.data[S]!==0){n.bottom=y,p=!0;break}}if(p)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:n.right-n.left+1,y:n.bottom-n.top+1},sizeClipSpace:{x:n.right-n.left+1,y:n.bottom-n.top+1},offset:{x:-n.left+R+(_||k?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-n.top+R+(_||k?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},fc=class{constructor(r,i,n){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],n)for(let g of n)this._glyphs.push(...g.glyphs),this._usedPixels+=g._usedPixels;this.canvas=b_(r,i,i),this.ctx=vt(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(r){this._glyphs.push(r),this._usedPixels+=r.size.x*r.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function _c(r,i,n,g){let _=i.rgba>>>24,k=i.rgba>>>16&255,R=i.rgba>>>8&255,a=n.rgba>>>24,d=n.rgba>>>16&255,p=n.rgba>>>8&255,y=Math.floor((Math.abs(_-a)+Math.abs(k-d)+Math.abs(R-p))/12),f=!0;for(let S=0;S<r.data.length;S+=4)r.data[S]===_&&r.data[S+1]===k&&r.data[S+2]===R||g&&Math.abs(r.data[S]-_)+Math.abs(r.data[S+1]-k)+Math.abs(r.data[S+2]-R)<y?r.data[S+3]=0:f=!1;return f}function o0(r){for(let i=0;i<r.data.length;i+=4)if(r.data[i+3]>0)return!1;return!0}function b_(r,i,n){let g=r.createElement("canvas");return g.width=i,g.height=n,g}function a0(r,i,n,g,_,k,R,a){let d={foreground:k.foreground,background:k.background,cursor:mr,cursorAccent:mr,selectionForeground:mr,selectionBackgroundTransparent:mr,selectionBackgroundOpaque:mr,selectionInactiveBackgroundTransparent:mr,selectionInactiveBackgroundOpaque:mr,overviewRulerBorder:mr,scrollbarSliderBackground:mr,scrollbarSliderHoverBackground:mr,scrollbarSliderActiveBackground:mr,ansi:k.ansi.slice(),contrastCache:k.contrastCache,halfContrastCache:k.halfContrastCache};return{customGlyphs:_.customGlyphs,devicePixelRatio:R,deviceMaxTextureSize:a,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:r,deviceCellHeight:i,deviceCharWidth:n,deviceCharHeight:g,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:d}}function Ud(r,i){for(let n=0;n<r.colors.ansi.length;n++)if(r.colors.ansi[n].rgba!==i.colors.ansi[n].rgba)return!1;return r.devicePixelRatio===i.devicePixelRatio&&r.customGlyphs===i.customGlyphs&&r.lineHeight===i.lineHeight&&r.letterSpacing===i.letterSpacing&&r.fontFamily===i.fontFamily&&r.fontSize===i.fontSize&&r.fontWeight===i.fontWeight&&r.fontWeightBold===i.fontWeightBold&&r.allowTransparency===i.allowTransparency&&r.deviceCharWidth===i.deviceCharWidth&&r.deviceCharHeight===i.deviceCharHeight&&r.drawBoldTextInBrightColors===i.drawBoldTextInBrightColors&&r.minimumContrastRatio===i.minimumContrastRatio&&r.colors.foreground.rgba===i.colors.foreground.rgba&&r.colors.background.rgba===i.colors.background.rgba}function l0(r){return(r&50331648)===16777216||(r&50331648)===33554432}var wr=[];function E_(r,i,n,g,_,k,R,a,d){let p=a0(g,_,k,R,i,n,a,d);for(let S=0;S<wr.length;S++){let b=wr[S],M=b.ownedBy.indexOf(r);if(M>=0){if(Ud(b.config,p))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),wr.splice(S,1)):b.ownedBy.splice(M,1);break}}for(let S=0;S<wr.length;S++){let b=wr[S];if(Ud(b.config,p))return b.ownedBy.push(r),b.atlas}let y=r._core,f={atlas:new Li(document,p,y.unicodeService),config:p,ownedBy:[r]};return wr.push(f),f.atlas}function Wd(r){for(let i=0;i<wr.length;i++){let n=wr[i].ownedBy.indexOf(r);if(n!==-1){wr[i].ownedBy.length===1?(wr[i].atlas.dispose(),wr.splice(i,1)):wr[i].ownedBy.splice(n,1);break}}}var Ko=600,c0=class{constructor(r,i){this._renderCallback=r,this._coreBrowserService=i,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(r=Ko){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let i=Ko-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0){this._restartInterval(i);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let i=Ko-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(i);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Ko)},r)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function Vd(r,i,n){let g=new i.ResizeObserver(_=>{let k=_.find(d=>d.target===r);if(!k)return;if(!("devicePixelContentBoxSize"in k)){g==null||g.disconnect(),g=void 0;return}let R=k.devicePixelContentBoxSize[0].inlineSize,a=k.devicePixelContentBoxSize[0].blockSize;R>0&&a>0&&n(R,a)});try{g.observe(r,{box:["device-pixel-content-box"]})}catch{g.disconnect(),g=void 0}return Ut(()=>g==null?void 0:g.disconnect())}function h0(r){return r>65535?(r-=65536,String.fromCharCode((r>>10)+55296)+String.fromCharCode(r%1024+56320)):String.fromCharCode(r)}var Kd=class L_ extends Rs{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m_,this.combinedData=""}static fromCharData(i){let n=new L_;return n.setFromCharData(i),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?h0(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let n=!1;if(i[1].length>2)n=!0;else if(i[1].length===2){let g=i[1].charCodeAt(0);if(55296<=g&&g<=56319){let _=i[1].charCodeAt(1);56320<=_&&_<=57343?this.content=(g-55296)*1024+_-56320+65536|i[2]<<22:n=!0}else n=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;n&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},k_=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function R_(r,i,n){let g=vt(r.createProgram());if(r.attachShader(g,vt(qd(r,r.VERTEX_SHADER,i))),r.attachShader(g,vt(qd(r,r.FRAGMENT_SHADER,n))),r.linkProgram(g),r.getProgramParameter(g,r.LINK_STATUS))return g;console.error(r.getProgramInfoLog(g)),r.deleteProgram(g)}function qd(r,i,n){let g=vt(r.createShader(i));if(r.shaderSource(g,n),r.compileShader(g),r.getShaderParameter(g,r.COMPILE_STATUS))return g;console.error(r.getShaderInfoLog(g)),r.deleteShader(g)}function u0(r,i){let n=Math.min(r.length*2,i),g=new Float32Array(n);for(let _=0;_<r.length;_++)g[_]=r[_];return g}var d0=class{constructor(r){this.texture=r,this.version=-1}},f0=`#version 300 es
105
+ layout (location = 0) in vec2 a_unitquad;
106
+ layout (location = 1) in vec2 a_cellpos;
107
+ layout (location = 2) in vec2 a_offset;
108
+ layout (location = 3) in vec2 a_size;
109
+ layout (location = 4) in float a_texpage;
110
+ layout (location = 5) in vec2 a_texcoord;
111
+ layout (location = 6) in vec2 a_texsize;
112
+
113
+ uniform mat4 u_projection;
114
+ uniform vec2 u_resolution;
115
+
116
+ out vec2 v_texcoord;
117
+ flat out int v_texpage;
118
+
119
+ void main() {
120
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
121
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
122
+ v_texpage = int(a_texpage);
123
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
124
+ }`;function _0(r){let i="";for(let n=1;n<r;n++)i+=` else if (v_texpage == ${n}) { outColor = texture(u_texture[${n}], v_texcoord); }`;return`#version 300 es
125
+ precision lowp float;
126
+
127
+ in vec2 v_texcoord;
128
+ flat in int v_texpage;
129
+
130
+ uniform sampler2D u_texture[${r}];
131
+
132
+ out vec4 outColor;
133
+
134
+ void main() {
135
+ if (v_texpage == 0) {
136
+ outColor = texture(u_texture[0], v_texcoord);
137
+ } ${i}
138
+ }`}var ki=11,bs=ki*Float32Array.BYTES_PER_ELEMENT,p0=2,ct=0,tt,pc=0,wn=0,v0=class extends Mr{constructor(r,i,n,g){super(),this._terminal=r,this._gl=i,this._dimensions=n,this._optionsService=g,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let _=this._gl;Li.maxAtlasPages===void 0&&(Li.maxAtlasPages=Math.min(32,vt(_.getParameter(_.MAX_TEXTURE_IMAGE_UNITS))),Li.maxTextureSize=vt(_.getParameter(_.MAX_TEXTURE_SIZE))),this._program=vt(R_(_,f0,_0(Li.maxAtlasPages))),this._register(Ut(()=>_.deleteProgram(this._program))),this._projectionLocation=vt(_.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=vt(_.getUniformLocation(this._program,"u_resolution")),this._textureLocation=vt(_.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=_.createVertexArray(),_.bindVertexArray(this._vertexArrayObject);let k=new Float32Array([0,0,1,0,0,1,1,1]),R=_.createBuffer();this._register(Ut(()=>_.deleteBuffer(R))),_.bindBuffer(_.ARRAY_BUFFER,R),_.bufferData(_.ARRAY_BUFFER,k,_.STATIC_DRAW),_.enableVertexAttribArray(0),_.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),d=_.createBuffer();this._register(Ut(()=>_.deleteBuffer(d))),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,d),_.bufferData(_.ELEMENT_ARRAY_BUFFER,a,_.STATIC_DRAW),this._attributesBuffer=vt(_.createBuffer()),this._register(Ut(()=>_.deleteBuffer(this._attributesBuffer))),_.bindBuffer(_.ARRAY_BUFFER,this._attributesBuffer),_.enableVertexAttribArray(2),_.vertexAttribPointer(2,2,_.FLOAT,!1,bs,0),_.vertexAttribDivisor(2,1),_.enableVertexAttribArray(3),_.vertexAttribPointer(3,2,_.FLOAT,!1,bs,2*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(3,1),_.enableVertexAttribArray(4),_.vertexAttribPointer(4,1,_.FLOAT,!1,bs,4*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(4,1),_.enableVertexAttribArray(5),_.vertexAttribPointer(5,2,_.FLOAT,!1,bs,5*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(5,1),_.enableVertexAttribArray(6),_.vertexAttribPointer(6,2,_.FLOAT,!1,bs,7*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(6,1),_.enableVertexAttribArray(1),_.vertexAttribPointer(1,2,_.FLOAT,!1,bs,9*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(1,1),_.useProgram(this._program);let p=new Int32Array(Li.maxAtlasPages);for(let y=0;y<Li.maxAtlasPages;y++)p[y]=y;_.uniform1iv(this._textureLocation,p),_.uniformMatrix4fv(this._projectionLocation,!1,k_),this._atlasTextures=[];for(let y=0;y<Li.maxAtlasPages;y++){let f=new d0(vt(_.createTexture()));this._register(Ut(()=>_.deleteTexture(f.texture))),_.activeTexture(_.TEXTURE0+y),_.bindTexture(_.TEXTURE_2D,f.texture),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,_.CLAMP_TO_EDGE),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,_.CLAMP_TO_EDGE),_.texImage2D(_.TEXTURE_2D,0,_.RGBA,1,1,0,_.RGBA,_.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[y]=f}_.enable(_.BLEND),_.blendFunc(_.SRC_ALPHA,_.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(r,i,n,g,_,k,R,a,d){this._updateCell(this._vertices.attributes,r,i,n,g,_,k,R,a,d)}_updateCell(r,i,n,g,_,k,R,a,d,p){if(ct=(n*this._terminal.cols+i)*ki,g===0||g===void 0){r.fill(0,ct,ct+ki-1-p0);return}this._atlas&&(a&&a.length>1?tt=this._atlas.getRasterizedGlyphCombinedChar(a,_,k,R,!1,this._terminal.element):tt=this._atlas.getRasterizedGlyph(g,_,k,R,!1,this._terminal.element),pc=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),_!==p&&tt.offset.x>pc?(wn=tt.offset.x-pc,r[ct]=-(tt.offset.x-wn)+this._dimensions.device.char.left,r[ct+1]=-tt.offset.y+this._dimensions.device.char.top,r[ct+2]=(tt.size.x-wn)/this._dimensions.device.canvas.width,r[ct+3]=tt.size.y/this._dimensions.device.canvas.height,r[ct+4]=tt.texturePage,r[ct+5]=tt.texturePositionClipSpace.x+wn/this._atlas.pages[tt.texturePage].canvas.width,r[ct+6]=tt.texturePositionClipSpace.y,r[ct+7]=tt.sizeClipSpace.x-wn/this._atlas.pages[tt.texturePage].canvas.width,r[ct+8]=tt.sizeClipSpace.y):(r[ct]=-tt.offset.x+this._dimensions.device.char.left,r[ct+1]=-tt.offset.y+this._dimensions.device.char.top,r[ct+2]=tt.size.x/this._dimensions.device.canvas.width,r[ct+3]=tt.size.y/this._dimensions.device.canvas.height,r[ct+4]=tt.texturePage,r[ct+5]=tt.texturePositionClipSpace.x,r[ct+6]=tt.texturePositionClipSpace.y,r[ct+7]=tt.sizeClipSpace.x,r[ct+8]=tt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&Am(g,d,tt.size.x,this._dimensions.device.cell.width)&&(r[ct+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let r=this._terminal,i=r.cols*r.rows*ki;this._vertices.count!==i?this._vertices.attributes=new Float32Array(i):this._vertices.attributes.fill(0);let n=0;for(;n<this._vertices.attributesBuffers.length;n++)this._vertices.count!==i?this._vertices.attributesBuffers[n]=new Float32Array(i):this._vertices.attributesBuffers[n].fill(0);this._vertices.count=i,n=0;for(let g=0;g<r.rows;g++)for(let _=0;_<r.cols;_++)this._vertices.attributes[n+9]=_/r.cols,this._vertices.attributes[n+10]=g/r.rows,n+=ki}handleResize(){let r=this._gl;r.useProgram(this._program),r.viewport(0,0,r.canvas.width,r.canvas.height),r.uniform2f(this._resolutionLocation,r.canvas.width,r.canvas.height),this.clear()}render(r){if(!this._atlas)return;let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let n=this._vertices.attributesBuffers[this._activeBuffer],g=0;for(let _=0;_<r.lineLengths.length;_++){let k=_*this._terminal.cols*ki,R=this._vertices.attributes.subarray(k,k+r.lineLengths[_]*ki);n.set(R,g),g+=R.length}i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,n.subarray(0,g),i.STREAM_DRAW);for(let _=0;_<this._atlas.pages.length;_++)this._atlas.pages[_].version!==this._atlasTextures[_].version&&this._bindAtlasPageTexture(i,this._atlas,_);i.drawElementsInstanced(i.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,g/ki)}setAtlas(r){this._atlas=r;for(let i of this._atlasTextures)i.version=-1}_bindAtlasPageTexture(r,i,n){r.activeTexture(r.TEXTURE0+n),r.bindTexture(r.TEXTURE_2D,this._atlasTextures[n].texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,i.pages[n].canvas),r.generateMipmap(r.TEXTURE_2D),this._atlasTextures[n].version=i.pages[n].version}setDimensions(r){this._dimensions=r}},g0=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(r,i,n,g=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let _=r.buffers.active.ydisp,k=i[1]-_,R=n[1]-_,a=Math.max(k,0),d=Math.min(R,r.rows-1);if(a>=r.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=g,this.viewportStartRow=k,this.viewportEndRow=R,this.viewportCappedStartRow=a,this.viewportCappedEndRow=d,this.startCol=i[0],this.endCol=n[0]}isCellSelected(r,i,n){return this.hasSelection?(n-=r.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function m0(){return new g0}var aa=4,Zo=1,ea=2,vc=3,y0=2147483648,w0=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=m0()}resize(r,i){let n=r*i*aa;n!==this.cells.length&&(this.cells=new Uint32Array(n),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},S0=`#version 300 es
139
+ layout (location = 0) in vec2 a_position;
140
+ layout (location = 1) in vec2 a_size;
141
+ layout (location = 2) in vec4 a_color;
142
+ layout (location = 3) in vec2 a_unitquad;
143
+
144
+ uniform mat4 u_projection;
145
+
146
+ out vec4 v_color;
147
+
148
+ void main() {
149
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
150
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
151
+ v_color = a_color;
152
+ }`,C0=`#version 300 es
153
+ precision lowp float;
154
+
155
+ in vec4 v_color;
156
+
157
+ out vec4 outColor;
158
+
159
+ void main() {
160
+ outColor = v_color;
161
+ }`,Qr=8,gc=Qr*Float32Array.BYTES_PER_ELEMENT,x0=20*Qr,Gd=class{constructor(){this.attributes=new Float32Array(x0),this.count=0}},Jr=0,Yd=0,Xd=0,Jd=0,Qd=0,Zd=0,ef=0,b0=class extends Mr{constructor(r,i,n,g){super(),this._terminal=r,this._gl=i,this._dimensions=n,this._themeService=g,this._vertices=new Gd,this._verticesCursor=new Gd;let _=this._gl;this._program=vt(R_(_,S0,C0)),this._register(Ut(()=>_.deleteProgram(this._program))),this._projectionLocation=vt(_.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=_.createVertexArray(),_.bindVertexArray(this._vertexArrayObject);let k=new Float32Array([0,0,1,0,0,1,1,1]),R=_.createBuffer();this._register(Ut(()=>_.deleteBuffer(R))),_.bindBuffer(_.ARRAY_BUFFER,R),_.bufferData(_.ARRAY_BUFFER,k,_.STATIC_DRAW),_.enableVertexAttribArray(3),_.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),d=_.createBuffer();this._register(Ut(()=>_.deleteBuffer(d))),_.bindBuffer(_.ELEMENT_ARRAY_BUFFER,d),_.bufferData(_.ELEMENT_ARRAY_BUFFER,a,_.STATIC_DRAW),this._attributesBuffer=vt(_.createBuffer()),this._register(Ut(()=>_.deleteBuffer(this._attributesBuffer))),_.bindBuffer(_.ARRAY_BUFFER,this._attributesBuffer),_.enableVertexAttribArray(0),_.vertexAttribPointer(0,2,_.FLOAT,!1,gc,0),_.vertexAttribDivisor(0,1),_.enableVertexAttribArray(1),_.vertexAttribPointer(1,2,_.FLOAT,!1,gc,2*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(1,1),_.enableVertexAttribArray(2),_.vertexAttribPointer(2,4,_.FLOAT,!1,gc,4*Float32Array.BYTES_PER_ELEMENT),_.vertexAttribDivisor(2,1),this._updateCachedColors(g.colors),this._register(this._themeService.onChangeColors(p=>{this._updateCachedColors(p),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(r){let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),i.uniformMatrix4fv(this._projectionLocation,!1,k_),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,r.attributes,i.DYNAMIC_DRAW),i.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,r.count)}handleResize(){this._updateViewportRectangle()}setDimensions(r){this._dimensions=r}_updateCachedColors(r){this._bgFloat=this._colorToFloat32Array(r.background),this._cursorFloat=this._colorToFloat32Array(r.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(r){let i=this._terminal,n=this._vertices,g=1,_,k,R,a,d,p,y,f,S,b,M;for(_=0;_<i.rows;_++){for(R=-1,a=0,d=0,p=!1,k=0;k<i.cols;k++)y=(_*i.cols+k)*aa,f=r.cells[y+Zo],S=r.cells[y+ea],b=!!(S&67108864),(f!==a||S!==d&&(p||b))&&((a!==0||p&&d!==0)&&(M=g++*Qr,this._updateRectangle(n,M,d,a,R,k,_)),R=k,a=f,d=S,p=b);(a!==0||p&&d!==0)&&(M=g++*Qr,this._updateRectangle(n,M,d,a,R,i.cols,_))}n.count=g}updateCursor(r){let i=this._verticesCursor,n=r.cursor;if(!n||n.style==="block"){i.count=0;return}let g,_=0;(n.style==="bar"||n.style==="outline")&&(g=_++*Qr,this._addRectangleFloat(i.attributes,g,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.style==="bar"?n.dpr*n.cursorWidth:n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(n.style==="underline"||n.style==="outline")&&(g=_++*Qr,this._addRectangleFloat(i.attributes,g,n.x*this._dimensions.device.cell.width,(n.y+1)*this._dimensions.device.cell.height-n.dpr,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat)),n.style==="outline"&&(g=_++*Qr,this._addRectangleFloat(i.attributes,g,n.x*this._dimensions.device.cell.width,n.y*this._dimensions.device.cell.height,n.width*this._dimensions.device.cell.width,n.dpr,this._cursorFloat),g=_++*Qr,this._addRectangleFloat(i.attributes,g,(n.x+n.width)*this._dimensions.device.cell.width-n.dpr,n.y*this._dimensions.device.cell.height,n.dpr,this._dimensions.device.cell.height,this._cursorFloat)),i.count=_}_updateRectangle(r,i,n,g,_,k,R){if(n&67108864)switch(n&50331648){case 16777216:case 33554432:Jr=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:Jr=(n&16777215)<<8;break;case 0:default:Jr=this._themeService.colors.foreground.rgba}else switch(g&50331648){case 16777216:case 33554432:Jr=this._themeService.colors.ansi[g&255].rgba;break;case 50331648:Jr=(g&16777215)<<8;break;case 0:default:Jr=this._themeService.colors.background.rgba}r.attributes.length<i+4&&(r.attributes=u0(r.attributes,this._terminal.rows*this._terminal.cols*Qr)),Yd=_*this._dimensions.device.cell.width,Xd=R*this._dimensions.device.cell.height,Jd=(Jr>>24&255)/255,Qd=(Jr>>16&255)/255,Zd=(Jr>>8&255)/255,ef=1,this._addRectangle(r.attributes,i,Yd,Xd,(k-_)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Jd,Qd,Zd,ef)}_addRectangle(r,i,n,g,_,k,R,a,d,p){r[i]=n/this._dimensions.device.canvas.width,r[i+1]=g/this._dimensions.device.canvas.height,r[i+2]=_/this._dimensions.device.canvas.width,r[i+3]=k/this._dimensions.device.canvas.height,r[i+4]=R,r[i+5]=a,r[i+6]=d,r[i+7]=p}_addRectangleFloat(r,i,n,g,_,k,R){r[i]=n/this._dimensions.device.canvas.width,r[i+1]=g/this._dimensions.device.canvas.height,r[i+2]=_/this._dimensions.device.canvas.width,r[i+3]=k/this._dimensions.device.canvas.height,r[i+4]=R[0],r[i+5]=R[1],r[i+6]=R[2],r[i+7]=R[3]}_colorToFloat32Array(r){return new Float32Array([(r.rgba>>24&255)/255,(r.rgba>>16&255)/255,(r.rgba>>8&255)/255,(r.rgba&255)/255])}},E0=class extends Mr{constructor(r,i,n,g,_,k,R,a){super(),this._container=i,this._alpha=_,this._coreBrowserService=k,this._optionsService=R,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=g.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(d=>{this._refreshCharAtlas(r,d),this.reset(r)})),this._register(Ut(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=vt(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(r){}handleFocus(r){}handleCursorMove(r){}handleGridChanged(r,i,n){}handleSelectionChanged(r,i,n,g=!1){}_setTransparency(r,i){if(i===this._alpha)return;let n=this._canvas;this._alpha=i,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(r,this._themeService.colors),this.handleGridChanged(r,0,r.rows-1)}_refreshCharAtlas(r,i){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=E_(r,this._optionsService.rawOptions,i,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(r,i){this._deviceCellWidth=i.device.cell.width,this._deviceCellHeight=i.device.cell.height,this._deviceCharWidth=i.device.char.width,this._deviceCharHeight=i.device.char.height,this._deviceCharLeft=i.device.char.left,this._deviceCharTop=i.device.char.top,this._canvas.width=i.device.canvas.width,this._canvas.height=i.device.canvas.height,this._canvas.style.width=`${i.css.canvas.width}px`,this._canvas.style.height=`${i.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(r,this._themeService.colors)}_fillBottomLineAtCells(r,i,n=1){this._ctx.fillRect(r*this._deviceCellWidth,(i+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(r,i,n,g){this._alpha?this._ctx.clearRect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,g*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,g*this._deviceCellHeight))}_fillCharTrueColor(r,i,n,g){this._ctx.font=this._getFont(r,!1,!1),this._ctx.textBaseline=f_,this._clipCell(n,g,i.getWidth()),this._ctx.fillText(i.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,g*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(r,i,n){this._ctx.beginPath(),this._ctx.rect(r*this._deviceCellWidth,i*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(r,i,n){let g=i?r.options.fontWeightBold:r.options.fontWeight;return`${n?"italic":""} ${g} ${r.options.fontSize*this._coreBrowserService.dpr}px ${r.options.fontFamily}`}},L0=class extends E0{constructor(r,i,n,g,_,k,R){super(n,r,"link",i,!0,_,k,R),this._register(g.onShowLinkUnderline(a=>this._handleShowLinkUnderline(a))),this._register(g.onHideLinkUnderline(a=>this._handleHideLinkUnderline(a)))}resize(r,i){super.resize(r,i),this._state=void 0}reset(r){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let r=this._state.y2-this._state.y1-1;r>0&&this._clearCells(0,this._state.y1+1,this._state.cols,r),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(r){if(r.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:r.fg!==void 0&&l0(r.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[r.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,r.y1===r.y2)this._fillBottomLineAtCells(r.x1,r.y1,r.x2-r.x1);else{this._fillBottomLineAtCells(r.x1,r.y1,r.cols-r.x1);for(let i=r.y1+1;i<r.y2;i++)this._fillBottomLineAtCells(0,i,r.cols);this._fillBottomLineAtCells(0,r.y2,r.x2)}this._state=r}_handleHideLinkUnderline(r){this._clearCurrentLink()}},Ki=typeof window=="object"?window:globalThis,Wc=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new rt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,n){if(this.getZoomLevel(n)===i)return;let g=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(g,i),this._onDidChangeZoomLevel.fire(g)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),i)}setFullscreen(i,n){if(this.isFullscreen(n)===i)return;let g=this.getWindowId(n);this.mapWindowIdToFullScreen.set(g,i),this._onDidChangeFullscreen.fire(g)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};Wc.INSTANCE=new Wc;var M_=Wc;function k0(r,i,n){typeof i=="string"&&(i=r.matchMedia(i)),i.addEventListener("change",n)}M_.INSTANCE.onDidChangeZoomLevel;M_.INSTANCE.onDidChangeFullscreen;var As=typeof navigator=="object"?navigator.userAgent:"";As.indexOf("Firefox")>=0;As.indexOf("AppleWebKit")>=0;var R0=As.indexOf("Chrome")>=0;!R0&&As.indexOf("Safari")>=0;As.indexOf("Electron/")>=0;As.indexOf("Android")>=0;var mc=!1;if(typeof Ki.matchMedia=="function"){let r=Ki.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Ki.matchMedia("(display-mode: fullscreen)");mc=r.matches,k0(Ki,r,({matches:n})=>{mc&&i.matches||(mc=n)})}var Ms="en",yc=!1,T_=!1,qo,ta=Ms,tf=Ms,M0,Rr,Yi=globalThis,Bt,Mf;typeof Yi.vscode<"u"&&typeof Yi.vscode.process<"u"?Bt=Yi.vscode.process:typeof process<"u"&&typeof((Mf=process==null?void 0:process.versions)==null?void 0:Mf.node)=="string"&&(Bt=process);var Tf,T0=typeof((Tf=Bt==null?void 0:Bt.versions)==null?void 0:Tf.electron)=="string",D0=T0&&(Bt==null?void 0:Bt.type)==="renderer",Df;if(typeof Bt=="object"){Bt.platform,Bt.platform,yc=Bt.platform==="linux",yc&&Bt.env.SNAP&&Bt.env.SNAP_REVISION,Bt.env.CI||Bt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,qo=Ms,ta=Ms;let r=Bt.env.VSCODE_NLS_CONFIG;if(r)try{let i=JSON.parse(r);qo=i.userLocale,tf=i.osLocale,ta=i.resolvedLanguage||Ms,M0=(Df=i.languagePack)==null?void 0:Df.translationsConfigFile}catch{}T_=!0}else typeof navigator=="object"&&!D0?(Rr=navigator.userAgent,Rr.indexOf("Windows")>=0,Rr.indexOf("Macintosh")>=0,(Rr.indexOf("Macintosh")>=0||Rr.indexOf("iPad")>=0||Rr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,yc=Rr.indexOf("Linux")>=0,(Rr==null?void 0:Rr.indexOf("Mobi"))>=0,ta=globalThis._VSCODE_NLS_LANGUAGE||Ms,qo=navigator.language.toLowerCase(),tf=qo):console.error("Unable to resolve platform.");var rf=T_,Or=Rr,bi=ta,A0;(r=>{function i(){return bi}r.value=i;function n(){return bi.length===2?bi==="en":bi.length>=3?bi[0]==="e"&&bi[1]==="n"&&bi[2]==="-":!1}r.isDefaultVariant=n;function g(){return bi==="en"}r.isDefault=g})(A0||(A0={}));var B0=typeof Yi.postMessage=="function"&&!Yi.importScripts;(()=>{if(B0){let r=[];Yi.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let g=0,_=r.length;g<_;g++){let k=r[g];if(k.id===n.data.vscodeScheduleAsyncWork){r.splice(g,1),k.callback();return}}});let i=0;return n=>{let g=++i;r.push({id:g,callback:n}),Yi.postMessage({vscodeScheduleAsyncWork:g},"*")}}return r=>setTimeout(r)})();var P0=!!(Or&&Or.indexOf("Chrome")>=0);Or&&Or.indexOf("Firefox")>=0;!P0&&Or&&Or.indexOf("Safari")>=0;Or&&Or.indexOf("Edg/")>=0;Or&&Or.indexOf("Android")>=0;var Es=typeof navigator=="object"?navigator:{};rf||document.queryCommandSupported&&document.queryCommandSupported("copy")||Es&&Es.clipboard&&Es.clipboard.writeText,rf||Es&&Es.clipboard&&Es.clipboard.readText;var Xc=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(r,i){this._keyCodeToStr[r]=i,this._strToKeyCode[i.toLowerCase()]=r}keyCodeToStr(r){return this._keyCodeToStr[r]}strToKeyCode(r){return this._strToKeyCode[r.toLowerCase()]||0}},wc=new Xc,sf=new Xc,nf=new Xc;new Array(230);var O0;(r=>{function i(a){return wc.keyCodeToStr(a)}r.toString=i;function n(a){return wc.strToKeyCode(a)}r.fromString=n;function g(a){return sf.keyCodeToStr(a)}r.toUserSettingsUS=g;function _(a){return nf.keyCodeToStr(a)}r.toUserSettingsGeneral=_;function k(a){return sf.strToKeyCode(a)||nf.strToKeyCode(a)}r.fromUserSettings=k;function R(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return wc.keyCodeToStr(a)}r.toElectronAccelerator=R})(O0||(O0={}));var D_=Object.freeze(function(r,i){let n=setTimeout(r.bind(i),0);return{dispose(){clearTimeout(n)}}}),N0;(r=>{function i(n){return n===r.None||n===r.Cancelled||n instanceof I0?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}r.isCancellationToken=i,r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Zr.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:D_})})(N0||(N0={}));var I0=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?D_:(this._emitter||(this._emitter=new rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},F0;(r=>{async function i(g){let _,k=await Promise.all(g.map(R=>R.then(a=>a,a=>{_||(_=a)})));if(typeof _<"u")throw _;return k}r.settled=i;function n(g){return new Promise(async(_,k)=>{try{await g(_,k)}catch(R){k(R)}})}r.withAsyncBody=n})(F0||(F0={}));var of=class yr{static fromArray(i){return new yr(n=>{n.emitMany(i)})}static fromPromise(i){return new yr(async n=>{n.emitMany(await i)})}static fromPromises(i){return new yr(async n=>{await Promise.all(i.map(async g=>n.emitOne(await g)))})}static merge(i){return new yr(async n=>{await Promise.all(i.map(async g=>{for await(let _ of g)n.emitOne(_)}))})}constructor(i,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new rt,queueMicrotask(async()=>{let g={emitOne:_=>this.emitOne(_),emitMany:_=>this.emitMany(_),reject:_=>this.reject(_)};try{await Promise.resolve(i(g)),this.resolve()}catch(_){this.reject(_)}finally{g.emitOne=void 0,g.emitMany=void 0,g.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await Zr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(i,n){return new yr(async g=>{for await(let _ of i)g.emitOne(n(_))})}map(i){return yr.map(this,i)}static filter(i,n){return new yr(async g=>{for await(let _ of i)n(_)&&g.emitOne(_)})}filter(i){return yr.filter(this,i)}static coalesce(i){return yr.filter(i,n=>!!n)}coalesce(){return yr.coalesce(this)}static async toPromise(i){let n=[];for await(let g of i)n.push(g);return n}toPromise(){return yr.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};of.EMPTY=of.fromArray([]);var{getWindow:j0}=(function(){let r=new Map,i={window:Ki,disposables:new Ds};r.set(Ki.vscodeWindowId,i);let n=new rt,g=new rt,_=new rt;function k(R,a){return(typeof R=="number"?r.get(R):void 0)??(a?i:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:_.event,onDidUnregisterWindow:g.event,registerWindow(R){if(r.has(R.vscodeWindowId))return Mr.None;let a=new Ds,d={window:R,disposables:a.add(new Ds)};return r.set(R.vscodeWindowId,d),a.add(Ut(()=>{r.delete(R.vscodeWindowId),g.fire(R)})),a.add(Vc(R,$0.BEFORE_UNLOAD,()=>{_.fire(R)})),n.fire(d),a},getWindows(){return r.values()},getWindowsCount(){return r.size},getWindowId(R){return R.vscodeWindowId},hasWindow(R){return r.has(R)},getWindowById:k,getWindow(R){var p;let a=R;if((p=a==null?void 0:a.ownerDocument)!=null&&p.defaultView)return a.ownerDocument.defaultView.window;let d=R;return d!=null&&d.view?d.view.window:Ki},getDocument(R){return j0(R).document}}})(),H0=class{constructor(r,i,n,g){this._node=r,this._type=i,this._handler=n,this._options=g||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Vc(r,i,n,g){return new H0(r,i,n,g)}var $0={BEFORE_UNLOAD:"beforeunload"},z0=class extends Mr{constructor(r,i,n,g,_,k,R,a,d){super(),this._terminal=r,this._characterJoinerService=i,this._charSizeService=n,this._coreBrowserService=g,this._coreService=_,this._decorationService=k,this._optionsService=R,this._themeService=a,this._cursorBlinkStateManager=new gn,this._charAtlasDisposable=this._register(new gn),this._observerDisposable=this._register(new gn),this._model=new w0,this._workCell=new Kd,this._workCell2=new Kd,this._rectangleRenderer=this._register(new gn),this._glyphRenderer=this._register(new gn),this._onChangeTextureAtlas=this._register(new rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new rt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new rt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let p={antialias:!1,depth:!1,preserveDrawingBuffer:d};if(this._gl=this._canvas.getContext("webgl2",p),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new Om(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new L0(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,R,this._themeService)],this.dimensions=Bm(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(R.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Vc(this._canvas,"webglcontextlost",y=>{console.log("webglcontextlost event received"),y.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(y)},3e3)})),this._register(Vc(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,Wd(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Vd(this._canvas,this._coreBrowserService.window,(y,f)=>this._setCanvasDevicePixelDimensions(y,f)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=Vd(this._canvas,y,(f,S)=>this._setCanvasDevicePixelDimensions(f,S))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Ut(()=>{var y;for(let f of this._renderLayers)f.dispose();(y=this._canvas.parentElement)==null||y.removeChild(this._canvas),Wd(this._terminal)}))}get textureAtlas(){var r;return(r=this._charAtlas)==null?void 0:r.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(r,i){var n,g,_,k;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let R of this._renderLayers)R.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(n=this._rectangleRenderer.value)==null||n.setDimensions(this.dimensions),(g=this._rectangleRenderer.value)==null||g.handleResize(),(_=this._glyphRenderer.value)==null||_.setDimensions(this.dimensions),(k=this._glyphRenderer.value)==null||k.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var r;for(let i of this._renderLayers)i.handleBlur(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._requestRedrawViewport()}handleFocus(){var r;for(let i of this._renderLayers)i.handleFocus(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._requestRedrawViewport()}handleSelectionChanged(r,i,n){for(let g of this._renderLayers)g.handleSelectionChanged(this._terminal,r,i,n);this._model.selection.update(this._core,r,i,n),this._requestRedrawViewport()}handleCursorMove(){var r;for(let i of this._renderLayers)i.handleCursorMove(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b0(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new v0(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var i;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let r=E_(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==r&&(this._onChangeTextureAtlas.fire(r.pages[0].canvas),this._charAtlasDisposable.value=l_(Zr.forward(r.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Zr.forward(r.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=r,this._charAtlas.warmUp(),(i=this._glyphRenderer.value)==null||i.setAtlas(this._charAtlas)}_clearModel(r){var i;this._model.clear(),r&&((i=this._glyphRenderer.value)==null||i.clear())}clearTextureAtlas(){var r;(r=this._charAtlas)==null||r.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var r;this._clearModel(!0);for(let i of this._renderLayers)i.reset(this._terminal);(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(r,i){var n;if(!this._isAttached)if((n=this._core.screenElement)!=null&&n.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let g of this._renderLayers)g.handleGridChanged(this._terminal,r,i);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(r,i),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new c0(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(r,i){let n=this._core,g=this._workCell,_,k,R,a,d,p,y=0,f=!0,S,b,M,w,c,u,l,h,v;r=af(r,n.rows-1,0),i=af(i,n.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,T=L-n.buffer.ydisp,E=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),N=-1,W=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let K=!1;for(k=r;k<=i;k++)for(R=k+n.buffer.ydisp,a=n.buffer.lines.get(R),this._model.lineLengths[k]=0,M=L===R,y=0,d=this._characterJoinerService.getJoinedCharacters(R),h=0;h<n.cols;h++){if(_=this._cellColorResolver.result.bg,a.loadCell(h,g),h===0&&(_=this._cellColorResolver.result.bg),p=!1,f=h>=y,S=h,d.length>0&&h===d[0][0]&&f){b=d.shift();let I=this._model.selection.isCellSelected(this._terminal,b[0],R);for(l=b[0]+1;l<b[1];l++)f&&(f=I===this._model.selection.isCellSelected(this._terminal,l,R));f&&(f=!M||E<b[0]||E>=b[1]),f?(p=!0,g=new U0(g,a.translateToString(!0,b[0],b[1]),b[1]-b[0]),S=b[1]-1):y=b[1]}if(w=g.getChars(),c=g.getCode(),l=(k*n.cols+h)*aa,this._cellColorResolver.resolve(g,h,R,this.dimensions.device.cell.width),W&&R===L&&(h===E&&(this._model.cursor={x:E,y:T,width:g.getWidth(),style:this._coreBrowserService.isFocused?C:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},N=E+g.getWidth()-1),h>=E&&h<=N&&(this._coreBrowserService.isFocused&&C==="block"||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),c!==0&&(this._model.lineLengths[k]=h+1),!(this._model.cells[l]===c&&this._model.cells[l+Zo]===this._cellColorResolver.result.bg&&this._model.cells[l+ea]===this._cellColorResolver.result.fg&&this._model.cells[l+vc]===this._cellColorResolver.result.ext)&&(K=!0,w.length>1&&(c|=y0),this._model.cells[l]=c,this._model.cells[l+Zo]=this._cellColorResolver.result.bg,this._model.cells[l+ea]=this._cellColorResolver.result.fg,this._model.cells[l+vc]=this._cellColorResolver.result.ext,u=g.getWidth(),this._glyphRenderer.value.updateCell(h,k,c,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,w,u,_),p)){for(g=this._workCell,h++;h<=S;h++)v=(k*n.cols+h)*aa,this._glyphRenderer.value.updateCell(h,k,0,0,0,0,Lm,0,0),this._model.cells[v]=0,this._model.cells[v+Zo]=this._cellColorResolver.result.bg,this._model.cells[v+ea]=this._cellColorResolver.result.fg,this._model.cells[v+vc]=this._cellColorResolver.result.ext;h--}}K&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(r,i){this._canvas.width===r&&this._canvas.height===i||(this._canvas.width=r,this._canvas.height=i,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let r=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:r,end:r})}},U0=class extends Rs{constructor(r,i,n){super(),this.content=0,this.combinedData="",this.fg=r.fg,this.bg=r.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(r){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function af(r,i,n=0){return Math.max(Math.min(r,i),n)}var lf="di$target",cf="di$dependencies",Sc=new Map;function Nr(r){if(Sc.has(r))return Sc.get(r);let i=function(n,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");W0(i,n,_)};return i._id=r,Sc.set(r,i),i}function W0(r,i,n){i[lf]===i?i[cf].push({id:r,index:n}):(i[cf]=[{id:r,index:n}],i[lf]=i)}Nr("BufferService");Nr("CoreMouseService");Nr("CoreService");Nr("CharsetService");Nr("InstantiationService");Nr("LogService");var V0=Nr("OptionsService");Nr("OscLinkService");Nr("UnicodeService");Nr("DecorationService");var K0={trace:0,debug:1,info:2,warn:3,error:4,off:5},q0="xterm.js: ",hf=class extends Mr{constructor(r){super(),this._optionsService=r,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=K0[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let i=0;i<r.length;i++)typeof r[i]=="function"&&(r[i]=r[i]())}_log(r,i,n){this._evalLazyOptionalParams(n),r.call(console,(this._optionsService.options.logger?"":q0)+i,...n)}trace(r,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,r,i)}debug(r,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,r,i)}info(r,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,r,i)}warn(r,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,r,i)}error(r,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,r,i)}};hf=_m([pm(0,V0)],hf);var G0=class extends Mr{constructor(r){if(u_&&Em()<16){let i={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",i))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=r,this._onChangeTextureAtlas=this._register(new rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new rt),this.onContextLoss=this._onContextLoss.event}activate(r){let i=r._core;if(!r.element){this._register(i.onWillOpen(()=>this.activate(r)));return}this._terminal=r;let n=i.coreService,g=i.optionsService,_=i,k=_._renderService,R=_._characterJoinerService,a=_._charSizeService,d=_._coreBrowserService,p=_._decorationService;_._logService;let y=_._themeService;this._renderer=this._register(new z0(r,R,a,d,n,p,g,y,this._preserveDrawingBuffer)),this._register(Zr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Zr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Zr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Zr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),k.setRenderer(this._renderer),this._register(Ut(()=>{if(this._terminal._core._store._isDisposed)return;let f=this._terminal._core._renderService;f.setRenderer(this._terminal._core._createRenderer()),f.handleResize(r.cols,r.rows)}))}get textureAtlas(){var r;return(r=this._renderer)==null?void 0:r.textureAtlas}clearTextureAtlas(){var r;(r=this._renderer)==null||r.clearTextureAtlas()}};function Cc(r){return(r*257).toString(16).padStart(4,"0")}function xc(r){const i=parseInt(r.slice(1,3),16),n=parseInt(r.slice(3,5),16),g=parseInt(r.slice(5,7),16);return`${Cc(i)}/${Cc(n)}/${Cc(g)}`}function Y0(r,i){r.parser.registerCsiHandler({final:"n"},n=>{const g=n.length>0?n[0]:0;if(g===6){const _=r.buffer.active,k=_.cursorY+1,R=_.cursorX+1;return i(`\x1B[${k};${R}R`),!0}else if(g===5)return i("\x1B[0n"),!0;return!1}),r.parser.registerCsiHandler({final:"c"},()=>(i("\x1B[?62;1;6;22c"),!0)),r.parser.registerCsiHandler({prefix:">",final:"c"},()=>(i("\x1B[>1;500;0c"),!0)),r.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},n=>{const g=n[0]||0,_=r.modes;let k=0;return g===1?k=_.applicationCursorKeysMode?1:2:g===25?k=1:g===1e3?k=_.mouseTrackingMode==="x10"?1:2:g===1002?k=_.mouseTrackingMode==="drag"?1:2:g===1003?k=_.mouseTrackingMode==="any"?1:2:g===1004?k=_.sendFocusMode?1:2:g===1006?k=_.mouseTrackingMode!=="none"?1:2:g===1049?k=r.buffer.active.type==="alternate"?1:2:g===2004?k=_.bracketedPasteMode?1:2:g===2026&&(k=2),i(`\x1B[?${g};${k}$y`),!0}),r.parser.registerOscHandler(10,n=>n==="?"?(i(`\x1B]10;rgb:${xc(Ff)}\x07`),!0):!1),r.parser.registerOscHandler(11,n=>n==="?"?(i(`\x1B]11;rgb:${xc(Ac)}\x07`),!0):!1),r.parser.registerOscHandler(12,n=>n==="?"?(i("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),r.parser.registerOscHandler(4,n=>{const g=n.match(/^(\d+);?\?$/);if(g){const _=parseInt(g[1]),k=_>=0&&_<St.length?St[_]:St[0];return i(`\x1B]4;${_};rgb:${xc(k)}\x07`),!0}return!1}),r.parser.registerOscHandler(52,n=>!!n.includes("?")),r.parser.registerCsiHandler({prefix:">",final:"q"},()=>(i("\x1BP>|xterm.js(5.5.0)\x1B\\"),!0)),r.parser.registerCsiHandler({prefix:"?",final:"u"},()=>!0),r.parser.registerCsiHandler({prefix:"?",final:"m"},n=>n[0]===4?(i("\x1B[>4;0m"),!0):!1),r.parser.registerCsiHandler({final:"t"},n=>{const g=n[0];return g===19?(i(`\x1B[9;${r.rows};${r.cols}t`),!0):g===20?(i("\x1B]LTerminal\x1B\\"),!0):g===21?(i("\x1B]lTerminal\x1B\\"),!0):!1}),r.parser.registerCsiHandler({prefix:"?",final:"S"},()=>!0),r.parser.registerDcsHandler({intermediates:"$",final:"q"},n=>n==="m"?(i("\x1BP1$rm\x1B\\"),!0):n==='"p'?(i('\x1BP1$r62;1"p\x1B\\'),!0):n==="r"?(i(`\x1BP1$r1;${r.rows}r\x1B\\`),!0):(i("\x1BP0$r\x1B\\"),!0)),r.parser.registerDcsHandler({intermediates:"+",final:"q"},n=>{try{const _=(n.match(/.{2}/g)||[]).map(R=>String.fromCharCode(parseInt(R,16))).join(""),k={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(_ in k){const a=k[_].split("").map(d=>d.charCodeAt(0).toString(16).padStart(2,"0")).join("");return i(`\x1BP1+r${a}\x1B\\`),!0}}catch(g){console.error("[XTGETTCAP] Failed to decode:",g)}return i("\x1BP0+r\x1B\\"),!0}),r.parser.registerCsiHandler({final:"b"},n=>{const g=n[0]||1;return g>65535?(console.warn(`[REP] Large repeat count ${g} clamped to 65535 for security`),!0):!1})}const X0=new Set(["w","t","n","r","s","p","j"]),bc=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent||"");function J0(r,i){const n=()=>{if(!r.hasSelection())return!1;try{const _=navigator==null?void 0:navigator.clipboard;if(_&&typeof _.writeText=="function")return _.writeText(r.getSelection()).catch(()=>{}),!0}catch{}return!1},g=()=>{try{const _=navigator==null?void 0:navigator.clipboard;if(_&&typeof _.readText=="function")return _.readText().then(k=>{!i()&&k&&r.paste(k)}).catch(()=>{}),!0}catch{}return!1};r.attachCustomKeyEventHandler(_=>{if(_.type!=="keydown"||_.isComposing||_.keyCode===229)return!0;const k=_.key.length===1?_.key.toLowerCase():_.key;return(_.ctrlKey&&_.shiftKey&&k==="c"||_.ctrlKey&&!_.shiftKey&&_.key==="Insert"||bc&&_.metaKey&&!_.ctrlKey&&k==="c")&&r.hasSelection()&&n()||(_.ctrlKey&&_.shiftKey&&k==="v"||_.shiftKey&&!_.ctrlKey&&_.key==="Insert"||bc&&_.metaKey&&!_.ctrlKey&&k==="v")&&g()?(_.preventDefault(),!1):((_.ctrlKey||_.metaKey)&&(_.key==="+"||_.key==="-"||_.key==="="||_.key==="0")||!bc&&_.ctrlKey&&!_.shiftKey&&!_.altKey&&!_.metaKey&&X0.has(k)&&_.preventDefault(),!0)})}const Q0="接続が終了しました。",uf=5,df=1e3,Z0=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),ff=new TextEncoder,Ec=48*1024;function e1(r){const i=new Uint8Array(r.length);for(let n=0;n<r.length;n++)i[n]=r.charCodeAt(n)&255;return i}function t1({session:r,wsUrl:i,onDelete:n,onExit:g,onTitle:_}){const k=q.useRef(null),R=q.useRef(null),a=q.useRef(null),d=q.useRef(null),p=q.useRef(0),y=q.useRef(g),f=q.useRef(_),[S,b]=q.useState(null);return q.useEffect(()=>{y.current=g},[g]),q.useEffect(()=>{f.current=_},[_]),q.useEffect(()=>{var M;b(null),(M=f.current)==null||M.call(f,null)},[r.id]),q.useEffect(()=>{var Ae,Wt;if(!R.current)return;p.current=0,R.current.innerHTML="";const M=new Dg.Terminal({cursorBlink:!0,cursorInactiveStyle:"outline",fontFamily:Iv,fontSize:Fv,allowProposedApi:!0,scrollback:1e4,scrollSensitivity:3,fastScrollModifier:"alt",macOptionIsMeta:!0,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:Ac,foreground:Ff,cursor:jv,cursorAccent:Ac,selectionBackground:Hv,black:St[0],red:St[1],green:St[2],yellow:St[3],blue:St[4],magenta:St[5],cyan:St[6],white:St[7],brightBlack:St[8],brightRed:St[9],brightGreen:St[10],brightYellow:St[11],brightBlue:St[12],brightMagenta:St[13],brightCyan:St[14],brightWhite:St[15]},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),w=new Pg,c=new am,u=new fm;M.loadAddon(w),M.loadAddon(c),M.loadAddon(u),M.unicode.activeVersion="11",a.current=w,M.open(R.current);let l=null,h=!1;const v=()=>{if(!(h||Ye||l)){h=!0;try{const ge=new G0;ge.onContextLoss(()=>{ge.dispose(),l===ge&&(l=null)}),M.loadAddon(ge),l=ge}catch(ge){if(console.warn("[Terminal] WebGL renderer unavailable, falling back to DOM:",ge),l){try{l.dispose()}catch{}l=null}}}},C=new IntersectionObserver(ge=>{for(const ke of ge)ke.isIntersecting&&ke.intersectionRatio>0&&(v(),_e(!0))});C.observe(R.current),J0(M,()=>Ye);const L=M.onTitleChange(ge=>{var ke;b(ge),(ke=f.current)==null||ke.call(f,ge)});let T=null;const E=M.onBell(()=>{var ke;const ge=k.current??((ke=R.current)==null?void 0:ke.closest(".terminal-tile"));ge&&(ge.classList.add("bell-flash"),T&&clearTimeout(T),T=setTimeout(()=>{T=null,ge.classList.remove("bell-flash")},150))});let N=!0,W=!1,K=0,I=!0,B=!1,U=!0;const $=()=>{N=!1,B&&(B=!1,_e(!0)),U&&window.requestAnimationFrame(()=>{M.scrollToBottom()})},V=ge=>{const ke=d.current;ke&&ke.readyState===WebSocket.OPEN&&ke.send(JSON.stringify(ge))};Y0(M,ge=>{if(N||!I)return;const ke=d.current;ke&&ke.readyState===WebSocket.OPEN&&ke.send(ff.encode(ge))});let z=0,D=0,O=null,A=M.cols,H=M.rows,Q=0,ne=0,oe=((Ae=window.visualViewport)==null?void 0:Ae.scale)??1;const ue=(ge,ke)=>{M.cols>0&&(Q=ge/M.cols),M.rows>0&&(ne=ke/M.rows)},Y=R.current.querySelector(".xterm-helper-textarea");Y instanceof HTMLTextAreaElement&&(Y.setAttribute("spellcheck","false"),Y.setAttribute("autocapitalize","off"),Y.setAttribute("autocomplete","off"),Y.setAttribute("autocorrect","off"));const j=()=>{const ge=M.cols,ke=M.rows;!ge||!ke||ge===A&&ke===H||(A=ge,H=ke,V({type:"resize",cols:ge,rows:ke}))},se=()=>{V({type:"claim"})},re=ge=>{const ke=d.current;if(!(!ke||ke.readyState!==WebSocket.OPEN)){if(ge.byteLength<=Ec){ke.send(ge);return}for(let Pe=0;Pe<ge.byteLength;Pe+=Ec){const ze=Math.min(Pe+Ec,ge.byteLength);ke.send(ge.subarray(Pe,ze))}}},ve=(ge=!1)=>{var Ne;if(B)return;const ke=R.current;if(!ke)return;const Pe=ke.clientWidth,ze=ke.clientHeight;if(!Pe||!ze||!ge&&Pe===z&&ze===D)return;const gt=((Ne=window.visualViewport)==null?void 0:Ne.scale)??1;if(!ge&&Q>0&&ne>0){const Vt=Math.max(2,Math.floor(Pe/Q)),Je=Math.max(1,Math.floor(ze/ne)),Kt=Math.abs(Pe-z),Ir=Math.abs(ze-D),Xi=Math.max(Q*.75,2),Ji=Math.max(ne*.75,2),Qi=Math.abs(gt-oe)>.001;if(Vt===A&&Je===H){z=Pe,D=ze,oe=gt;return}if(Qi&&Kt<Xi&&Ir<Ji){z=Pe,D=ze,oe=gt;return}}z=Pe,D=ze,w.fit(),ue(Pe,ze),oe=gt,j()},_e=(ge=!1)=>{if(O!==null){if(!ge)return;cancelAnimationFrame(O)}O=window.requestAnimationFrame(()=>{O=null,ve(ge)})},Re=new ResizeObserver(()=>{_e()});Re.observe(R.current),_e();const Se=typeof document<"u"?document.fonts:null,$e=()=>{Ye||_e(!0)};Se==null||Se.ready.then($e).catch(()=>{}),(Wt=Se==null?void 0:Se.addEventListener)==null||Wt.call(Se,"loadingdone",$e);let je=null,xe=null,Xe=null,ft=null,_t=null,Ye=!1,Ge=0,Ke=null,Ft=!1;const it=()=>{var ke;const ge=(ke=R.current)==null?void 0:ke.querySelector(".xterm-helper-textarea");if(ge instanceof HTMLTextAreaElement)try{ge.focus({preventScroll:!0})}catch{ge.focus()}},ut=()=>{Ye||it()},le=()=>{Ye||it()};R.current.addEventListener("pointerdown",ut,{passive:!0,capture:!0}),R.current.addEventListener("mousedown",ut,{passive:!0,capture:!0}),R.current.addEventListener("touchstart",ut,{passive:!0,capture:!0}),R.current.addEventListener("focusin",le,!0),_t=()=>{var ge,ke,Pe,ze;(ge=R.current)==null||ge.removeEventListener("pointerdown",ut,!0),(ke=R.current)==null||ke.removeEventListener("mousedown",ut,!0),(Pe=R.current)==null||Pe.removeEventListener("touchstart",ut,!0),(ze=R.current)==null||ze.removeEventListener("focusin",le,!0)};const ce=async(ge=!1)=>{if(!Ye){N=!0,W=!1,K=0;try{const{token:ke,authEnabled:Pe}=await Bc();if(Ye)return;const ze=Pe?`${i}?token=${ke}`:i;let gt=ze;if(ge&&p.current>0){const Ne=ze.includes("?")?"&":"?";gt=`${ze}${Ne}bufferOffset=${p.current}`}if(ge){const Ne=gt.includes("?")?"&":"?";gt=`${gt}${Ne}reconnect=1`}if(je=new WebSocket(gt),je.binaryType="arraybuffer",d.current=je,je.addEventListener("open",()=>{var Ne;Ge=0,z=0,D=0,Q=0,ne=0,A=-1,H=-1,oe=((Ne=window.visualViewport)==null?void 0:Ne.scale)??1,_e(),M.textarea&&document.activeElement===M.textarea&&se()}),je.addEventListener("message",Ne=>{if(typeof Ne.data=="string"){let Je=null;try{Je=JSON.parse(Ne.data)}catch{return}if((Je==null?void 0:Je.type)==="sync"){const Kt=M.buffer.active;U=Je.reset||Kt.viewportY>=Kt.baseY,N=!0,W=!1,K=0,B=!1,p.current=Je.offsetBase,Je.reset&&M.reset(),ve(!0),B=!0;return}if((Je==null?void 0:Je.type)==="ready"){W=!0,K===0&&$();return}if((Je==null?void 0:Je.type)==="primary"){I=Je.value;return}return}if(Ne.data instanceof Blob){Ne.data.arrayBuffer().then(Kt=>{if(Ye)return;const Ir=new Uint8Array(Kt);K++,M.write(Ir,()=>{p.current+=Ir.byteLength,K=Math.max(0,K-1),W&&K===0&&$()})});return}const Vt=new Uint8Array(Ne.data);K++,M.write(Vt,()=>{p.current+=Vt.byteLength,K=Math.max(0,K-1),W&&K===0&&$()})}),je.addEventListener("close",Ne=>{if(!(Ye||Ft)&&d.current===je){if(Ne.code===1e3&&Z0.has(Ne.reason)){y.current();return}if(Ge<uf){Ge++;const Vt=df*Math.pow(2,Ge-1);Ke=setTimeout(()=>ce(!0),Vt)}else M.write(`\r
162
+ \x1B[31m${Q0}\x1B[0m\r
163
+ `)}}),je.addEventListener("error",()=>{}),xe&&xe.dispose(),xe=M.onData(Ne=>{N||je&&je.readyState===WebSocket.OPEN&&re(ff.encode(Ne))}),Xe&&Xe.dispose(),Xe=M.onBinary(Ne=>{N||je&&je.readyState===WebSocket.OPEN&&re(e1(Ne))}),!ft&&M.textarea){const Ne=()=>{se()};M.textarea.addEventListener("focus",Ne),ft=()=>{var Vt;(Vt=M.textarea)==null||Vt.removeEventListener("focus",Ne)}}}catch(ke){if(console.error("[Terminal] Failed to connect:",ke),Ge<uf){Ge++;const Pe=df*Math.pow(2,Ge-1);Ke=setTimeout(()=>ce(!0),Pe)}else M.write(`\r
164
+ \x1B[31m接続エラー: ${ke instanceof Error?ke.message:"Unknown error"}\x1B[0m\r
165
+ `)}}};ce();const Ee=()=>{if(Ye||Ft)return;const ge=d.current;ge&&(ge.readyState===WebSocket.OPEN||ge.readyState===WebSocket.CONNECTING)||(Ge=0,!(ge&&ge.readyState===WebSocket.CLOSING)&&(Ke&&(clearTimeout(Ke),Ke=null),ce(!0)))},De=()=>Ee(),We=()=>{document.visibilityState==="visible"&&Ee()};return window.addEventListener("online",De),document.addEventListener("visibilitychange",We),()=>{var ge;if(Ye=!0,Ft=!0,window.removeEventListener("online",De),document.removeEventListener("visibilitychange",We),Ke&&clearTimeout(Ke),O!==null&&cancelAnimationFrame(O),Re.disconnect(),C.disconnect(),(ge=Se==null?void 0:Se.removeEventListener)==null||ge.call(Se,"loadingdone",$e),xe&&xe.dispose(),Xe&&Xe.dispose(),ft&&ft(),_t&&_t(),L.dispose(),E.dispose(),T&&(clearTimeout(T),T=null),je&&je.close(),d.current=null,l){try{l.dispose()}catch{}l=null}a.current=null,M.dispose()}},[r.id,i]),P.jsxs("div",{className:"terminal-tile",ref:k,children:[P.jsxs("div",{className:"terminal-tile-header",children:[P.jsx("span",{children:S||r.title}),P.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&n()},"aria-label":"ターミナルを閉じる",children:"×"})]}),P.jsx("div",{className:"terminal-tile-body",ref:R})]})}function r1(r){if(r<=1)return{cols:1,rows:1};const i=Math.ceil(Math.sqrt(r)),n=Math.ceil(r/i);return{cols:i,rows:n}}function i1({terminals:r,wsBase:i,activeTerminalId:n,onDeleteTerminal:g,onExitTerminal:_,onTerminalTitle:k}){const{cols:R,rows:a}=r1(r.length),[d,p]=q.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 720px)").matches);q.useEffect(()=>{const f=window.matchMedia("(max-width: 720px)");p(f.matches);const S=()=>p(f.matches);return f.addEventListener("change",S),()=>f.removeEventListener("change",S)},[]);const y=qf(r,n);return P.jsx("section",{className:"terminal-pane",children:r.length===0?P.jsx("div",{className:"terminal-empty",children:P.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):P.jsx("div",{className:Ot("terminal-grid",d&&"terminal-grid-mobile"),style:d?void 0:{gridTemplateColumns:`repeat(${R}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${a}, minmax(0, 1fr))`},children:r.map(f=>P.jsx("div",{className:Ot("terminal-tile-slot",d&&(f.id===y?"terminal-tile-slot-mobile-active":"terminal-tile-slot-mobile-hidden")),children:P.jsx(t1,{session:f,wsUrl:`${i}/api/terminals/${f.id}`,onDelete:()=>g(f.id),onExit:()=>_(f.id),onTitle:S=>k==null?void 0:k(f.id,S)})},f.id))})})}const s1="ワークスペースがありません。";function n1({workspaces:r,selectedWorkspaceId:i,onSelect:n,onDelete:g}){return P.jsx("div",{className:"w-full grid gap-2",children:r.length===0?P.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:s1}):r.map(_=>P.jsxs("div",{className:Ot("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",_.id===i&&"bg-list-active border-accent"),children:[P.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>n(_.id),children:[P.jsx("div",{className:"font-semibold text-[15px] mb-1",children:_.name}),P.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:_.path})]}),P.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:k=>{k.stopPropagation(),confirm(`「${_.name}」を削除しますか?`)&&g(_.id)},children:P.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[P.jsx("polyline",{points:"3 6 5 6 21 6"}),P.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},_.id))})}function o1({contextMenu:r,onNewFile:i,onNewFolder:n,onDelete:g}){var _;return P.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:r.x,top:r.y},onClick:k=>k.stopPropagation(),children:[(r.isRoot||((_=r.node)==null?void 0:_.type)==="dir")&&P.jsxs(P.Fragment,{children:[P.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var k;return i(((k=r.node)==null?void 0:k.path)||"",r.node?1:0)},children:"新規ファイル"}),P.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var k;return n(((k=r.node)==null?void 0:k.path)||"",r.node?1:0)},children:"新規フォルダ"})]}),r.node&&!r.isRoot&&P.jsxs(P.Fragment,{children:[r.node.type==="dir"&&P.jsx("div",{className:"h-px my-1 bg-border"}),P.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>g(r.node),children:"削除"})]})]})}const _f="読み込み中...",a1="ファイル",l1="更新",c1="ファイルが見つかりません。",h1="戻る";function u1(r,i){if(!i)return"";const n=i.find(g=>g.path===r||r.endsWith(g.path));return n?`git-tree-${n.status}`:""}const d1=()=>P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:P.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),pf=()=>P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:P.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),vf=()=>P.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[P.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),P.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function A_({root:r,entries:i=[],loading:n,error:g,mode:_="tree",canBack:k,onBack:R,onToggleDir:a,onOpenFile:d,onRefresh:p,onCreateFile:y,onCreateDirectory:f,onDeleteFile:S,onDeleteDirectory:b,gitFiles:M}){const[w,c]=q.useState(null),[u,l]=q.useState(null),[h,v]=q.useState(""),C=q.useRef(null),L=q.useRef(null),T=i??[];q.useEffect(()=>{const V=()=>c(null);if(w)return document.addEventListener("click",V),()=>document.removeEventListener("click",V)},[w]),q.useEffect(()=>{u&&C.current&&C.current.focus()},[u]);const E=q.useCallback((V,X,z=!1)=>{V.preventDefault(),V.stopPropagation();const D=180,O=150,A=Math.min(V.clientX,window.innerWidth-D-4),H=Math.min(V.clientY,window.innerHeight-O-4);c({x:A,y:H,node:X,isRoot:z})},[]),N=q.useCallback((V,X)=>{c(null),l({parentPath:V,type:"file",depth:X}),v("")},[]),W=q.useCallback((V,X)=>{c(null),l({parentPath:V,type:"dir",depth:X}),v("")},[]),K=q.useCallback(V=>{c(null),V.type==="dir"?window.confirm(`フォルダ "${V.name}" を削除しますか?
166
+ 中のファイルも全て削除されます。`)&&(b==null||b(V.path)):window.confirm(`ファイル "${V.name}" を削除しますか?`)&&(S==null||S(V.path))},[S,b]),I=q.useCallback(()=>{if(!u||!h.trim()){l(null);return}const V=h.trim();u.type==="file"?y==null||y(u.parentPath,V):f==null||f(u.parentPath,V),l(null),v("")},[u,h,y,f]),B=q.useCallback(V=>{V.key==="Enter"?I():V.key==="Escape"&&l(null)},[I]),U=V=>!u||u.depth!==V?null:P.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+V*16},children:[P.jsx("span",{className:"tree-icon","aria-hidden":"true",children:u.type==="dir"?P.jsx(pf,{}):P.jsx(vf,{})}),P.jsx("input",{ref:C,type:"text",className:"tree-input",value:h,onChange:X=>v(X.target.value),onKeyDown:B,onBlur:I,placeholder:u.type==="dir"?"フォルダ名":"ファイル名"})]}),$=(V,X)=>V.map(z=>{const D=z.type==="file"?u1(z.path,M):"";return P.jsxs("div",{children:[P.jsxs("button",{type:"button",className:Ot("tree-row",z.type==="dir"&&"is-dir",_==="tree"&&z.expanded&&"is-open",D),style:{paddingLeft:12+X*16},onClick:()=>z.type==="dir"?a(z):d(z),onContextMenu:O=>E(O,z),"aria-expanded":z.type==="dir"&&_==="tree"?z.expanded:void 0,title:z.path,children:[P.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:z.type==="dir"?P.jsx(d1,{}):null}),P.jsx("span",{className:`tree-icon ${z.type}`,"aria-hidden":"true",children:z.type==="dir"?P.jsx(pf,{}):P.jsx(vf,{})}),P.jsx("span",{className:"tree-label",children:z.name}),z.loading?P.jsx("span",{className:"tree-meta",children:_f}):null]}),_==="tree"&&z.expanded&&z.type==="dir"&&P.jsxs(P.Fragment,{children:[(u==null?void 0:u.parentPath)===z.path&&U(X+1),z.children&&z.children.length>0&&$(z.children,X+1)]})]},z.path)});return P.jsxs("section",{className:"panel file-tree",ref:L,children:[P.jsxs("div",{className:"panel-header",children:[P.jsxs("div",{children:[P.jsx("div",{className:"panel-title",children:a1}),P.jsx("div",{className:"panel-subtitle",children:r})]}),P.jsxs("div",{className:"tree-actions",children:[R?P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:R,disabled:k===!1,children:h1}):null,P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:p,children:l1})]})]}),P.jsxs("div",{className:"panel-body tree-body",onContextMenu:V=>E(V,null,!0),children:[n?P.jsx("div",{className:"tree-state",children:_f}):null,g?P.jsx("div",{className:"tree-state text-[#f14c4c]",children:g}):null,T.length===0&&!n?P.jsx("div",{className:"tree-state",children:c1}):null,(u==null?void 0:u.parentPath)===""&&U(0),$(T,0)]}),w&&P.jsx(o1,{contextMenu:w,onNewFile:N,onNewFolder:W,onDelete:K})]})}const f1=({isOpen:r,defaultRoot:i,onSubmit:n,onClose:g})=>{const[_,k]=q.useState(""),[R,a]=q.useState([]),[d,p]=q.useState(!1),[y,f]=q.useState(null),[S,b]=q.useState(!1),M=Pf(r,g),w=_.trim()||i,c=q.useMemo(()=>w?Bd(w)!==w:!1,[w]);q.useEffect(()=>{if(!r){a([]),p(!1),f(null);return}let C=!0;return p(!0),f(null),Md(w,"").then(L=>{C&&(a(sa(L)),p(!1))}).catch(L=>{C&&(f(Lt(L)),p(!1))}),()=>{C=!1}},[r,w]),q.useEffect(()=>{r&&(_.trim()||i&&k(i))},[i,r,_]);const u=()=>{r&&(p(!0),f(null),Md(w,"").then(C=>{a(sa(C)),p(!1)}).catch(C=>{f(Lt(C)),p(!1)}))},l=C=>{if(C.type!=="dir")return;const L=Rg(w,C.name);k(L)},h=()=>{if(!w)return;const C=Bd(w);C&&C!==w&&k(C)},v=async C=>{if(C.preventDefault(),!S){b(!0);try{await n(_),k("")}finally{b(!1)}}};return r?P.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:P.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:M,onSubmit:v,children:[P.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),P.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[P.jsx("span",{children:"パス"}),P.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:_,placeholder:i||"",required:!0,maxLength:500,onChange:C=>k(C.target.value)})]}),P.jsx("div",{className:"flex-1 min-h-0 mt-3",children:P.jsx(A_,{root:w,entries:R,loading:d,error:y,mode:"navigator",canBack:c,onBack:h,onToggleDir:l,onOpenFile:()=>{},onRefresh:u})}),P.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[P.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:g,disabled:S,children:"キャンセル"}),P.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:S,children:S?"追加中...":"追加"})]})]})}):null},_1="ステージ",p1="アンステージ",v1="変更を破棄",g1="差分を表示",m1={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function gf({file:r,onStage:i,onUnstage:n,onDiscard:g,onShowDiff:_}){const k=`git-${r.status}`,R=m1[r.status];return P.jsxs("div",{className:"git-file-row",children:[P.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>_(r),title:g1,children:[P.jsx("span",{className:`git-status-badge ${k}`,children:R}),P.jsx("span",{className:"git-file-path",children:r.path})]}),P.jsx("div",{className:"git-file-actions",children:r.staged?P.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>n(r.path),title:p1,children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):P.jsxs(P.Fragment,{children:[P.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>g(r.path),title:v1,children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),P.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(r.path),title:_1,children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const y1="ステージ済みの変更",w1="変更",S1="コミット",C1="コミットメッセージを入力...",x1="変更はありません",b1="すべてステージ",E1="すべてアンステージ",mf="Push",yf="Pull",L1="Pushing...",k1="Pulling...";function R1({status:r,branchStatus:i,hasRemote:n,pushing:g,pulling:_,commitMessage:k,onCommitMessageChange:R,onCommit:a,onStageFile:d,onUnstageFile:p,onStageAll:y,onUnstageAll:f,onDiscardFile:S,onShowDiff:b,onPush:M,onPull:w}){const c=r.files.filter(C=>C.staged),u=r.files.filter(C=>!C.staged),l=r.files.length>0,h=c.length>0,v=q.useCallback(C=>{C.key==="Enter"&&(C.ctrlKey||C.metaKey)&&(C.preventDefault(),a())},[a]);return P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[P.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:C1,value:k,onChange:C=>R(C.target.value),onKeyDown:v,rows:3}),P.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:a,disabled:!h||!k.trim(),children:S1})]}),n&&P.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[P.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:w,disabled:_||g,title:i!=null&&i.behind?`${i.behind} commits behind`:yf,children:[P.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),_?k1:yf,i!=null&&i.behind?` (${i.behind})`:""]}),P.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:M,disabled:g||_,title:i!=null&&i.ahead?`${i.ahead} commits ahead`:mf,children:[P.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),g?L1:mf,i!=null&&i.ahead?` (${i.ahead})`:""]})]}),l?P.jsxs(P.Fragment,{children:[c.length>0&&P.jsxs("div",{className:"flex flex-col",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[P.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[y1," (",c.length,")"]}),P.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:f,title:E1,children:P.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),P.jsx("div",{className:"flex flex-col",children:c.map(C=>P.jsx(gf,{file:C,onStage:d,onUnstage:p,onDiscard:S,onShowDiff:b},C.path))})]}),u.length>0&&P.jsxs("div",{className:"flex flex-col",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[P.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[w1," (",u.length,")"]}),P.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:y,title:b1,children:P.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),P.jsx("div",{className:"flex flex-col",children:u.map(C=>P.jsx(gf,{file:C,onStage:d,onUnstage:p,onDiscard:S,onShowDiff:b},C.path))})]})]}):P.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:x1})]})}const M1="読み込み中...",T1="新規ブランチ",D1="作成",A1="キャンセル";function B1({branches:r,branchesLoading:i,onCheckoutBranch:n,onCreateBranch:g}){const[_,k]=q.useState(!1),[R,a]=q.useState(""),d=q.useCallback(()=>{R.trim()&&(g(R.trim()),a(""),k(!1))},[R,g]),p=q.useCallback(y=>{y.key==="Enter"?(y.preventDefault(),d()):y.key==="Escape"&&(k(!1),a(""))},[d]);return P.jsxs("div",{className:"flex flex-col gap-2",children:[P.jsx("div",{className:"px-3 py-2 border-b border-border",children:_?P.jsxs("div",{className:"flex gap-1.5 items-center",children:[P.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:R,onChange:y=>a(y.target.value),onKeyDown:p,autoFocus:!0}),P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:d,disabled:!R.trim(),children:D1}),P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{k(!1),a("")},children:A1})]}):P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>k(!0),children:T1})}),i?P.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:M1}):P.jsx("div",{className:"flex flex-col",children:r.map(y=>P.jsxs("button",{type:"button",className:Ot("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",y.current&&"bg-list-active cursor-default"),onClick:()=>!y.current&&n(y.name),disabled:y.current,children:[P.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[P.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),P.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),P.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:y.name}),y.current&&P.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},y.name))})]})}const P1="読み込み中...";function O1({logs:r,logsLoading:i}){return P.jsx("div",{className:"flex flex-col",children:i?P.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:P1}):r.length===0?P.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):P.jsx("div",{className:"flex flex-col",children:r.map(n=>P.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:n.hashShort}),P.jsx("span",{className:"text-xs text-ink-muted",children:n.author})]}),P.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:n.message}),P.jsx("div",{className:"text-[11px] text-muted",children:new Date(n.date).toLocaleString()})]},n.hash))})})}const Sn="ソースコントロール",N1="Gitリポジトリではありません",I1="ワークスペースを選択してください",F1="読み込み中...",Lc="更新",j1="変更",H1="ブランチ",$1="履歴",kc="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",Rc="flex items-center justify-center h-full text-muted text-[13px] p-5";function z1({status:r,loading:i,error:n,workspaceId:g,branchStatus:_,hasRemote:k,pushing:R,pulling:a,branches:d,branchesLoading:p,logs:y,logsLoading:f,repos:S,selectedRepoPath:b,onSelectRepo:M,onRefresh:w,onStageFile:c,onUnstageFile:u,onStageAll:l,onUnstageAll:h,onCommit:v,onDiscardFile:C,onShowDiff:L,onPush:T,onPull:E,onLoadBranches:N,onCheckoutBranch:W,onCreateBranch:K,onLoadLogs:I}){const[B,U]=q.useState(""),[$,V]=q.useState("changes"),X=q.useCallback(()=>{B.trim()&&(v(B.trim()),U(""))},[B,v]),z=q.useCallback(A=>{V(A),A==="branches"?N():A==="history"&&I()},[N,I]);if(!g)return P.jsxs("section",{className:"panel",children:[P.jsx("div",{className:"panel-header",children:P.jsx("div",{className:"panel-title",children:Sn})}),P.jsx("div",{className:"panel-body",children:P.jsx("div",{className:Rc,children:I1})})]});if(i)return P.jsxs("section",{className:"panel",children:[P.jsx("div",{className:"panel-header",children:P.jsx("div",{className:"panel-title",children:Sn})}),P.jsx("div",{className:"panel-body",children:P.jsx("div",{className:Rc,children:F1})})]});if(n)return P.jsxs("section",{className:"panel",children:[P.jsxs("div",{className:"panel-header",children:[P.jsx("div",{className:"panel-title",children:Sn}),P.jsx("button",{type:"button",className:kc,onClick:w,children:Lc})]}),P.jsx("div",{className:"panel-body",children:P.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:n})})]});if(!(r!=null&&r.isGitRepo))return P.jsxs("section",{className:"panel",children:[P.jsxs("div",{className:"panel-header",children:[P.jsx("div",{className:"panel-title",children:Sn}),P.jsx("button",{type:"button",className:kc,onClick:w,children:Lc})]}),P.jsx("div",{className:"panel-body",children:P.jsx("div",{className:Rc,children:N1})})]});const D=r.files.length>0,O=S.length>1;return P.jsxs("section",{className:"panel",children:[P.jsxs("div",{className:"panel-header",children:[P.jsxs("div",{children:[P.jsx("div",{className:"panel-title",children:Sn}),P.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[P.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[P.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),P.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),r.branch]})]}),P.jsx("button",{type:"button",className:kc,onClick:w,children:Lc})]}),O&&P.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[P.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),P.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:b||"",onChange:A=>M(A.target.value),children:S.map(A=>P.jsxs("option",{value:A.path,children:[A.name," (",A.branch,") ",A.fileCount>0?`• ${A.fileCount}`:""]},A.path))}),P.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[S.length," repos"]})]}),P.jsxs("div",{className:"git-tabs",children:[P.jsxs("button",{type:"button",className:Ot("git-tab",$==="changes"&&"active"),onClick:()=>z("changes"),children:[j1,D&&P.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:r.files.length})]}),P.jsx("button",{type:"button",className:Ot("git-tab",$==="branches"&&"active"),onClick:()=>z("branches"),children:H1}),P.jsx("button",{type:"button",className:Ot("git-tab",$==="history"&&"active"),onClick:()=>z("history"),children:$1})]}),P.jsxs("div",{className:"panel-body",children:[$==="changes"&&P.jsx(R1,{status:r,branchStatus:_,hasRemote:k,pushing:R,pulling:a,commitMessage:B,onCommitMessageChange:U,onCommit:X,onStageFile:c,onUnstageFile:u,onStageAll:l,onUnstageAll:h,onDiscardFile:C,onShowDiff:L,onPush:T,onPull:E}),$==="branches"&&P.jsx(B1,{branches:d,branchesLoading:p,onCheckoutBranch:W,onCreateBranch:K}),$==="history"&&P.jsx(O1,{logs:y,logsLoading:f})]})]})}function wf(r,i){(i==null||i>r.length)&&(i=r.length);for(var n=0,g=Array(i);n<i;n++)g[n]=r[n];return g}function U1(r){if(Array.isArray(r))return r}function W1(r,i,n){return(i=J1(i))in r?Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[i]=n,r}function V1(r,i){var n=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(n!=null){var g,_,k,R,a=[],d=!0,p=!1;try{if(k=(n=n.call(r)).next,i!==0)for(;!(d=(g=k.call(n)).done)&&(a.push(g.value),a.length!==i);d=!0);}catch(y){p=!0,_=y}finally{try{if(!d&&n.return!=null&&(R=n.return(),Object(R)!==R))return}finally{if(p)throw _}}return a}}function K1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
167
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sf(r,i){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(r);i&&(g=g.filter(function(_){return Object.getOwnPropertyDescriptor(r,_).enumerable})),n.push.apply(n,g)}return n}function Cf(r){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?Sf(Object(n),!0).forEach(function(g){W1(r,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Sf(Object(n)).forEach(function(g){Object.defineProperty(r,g,Object.getOwnPropertyDescriptor(n,g))})}return r}function q1(r,i){if(r==null)return{};var n,g,_=G1(r,i);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(r);for(g=0;g<k.length;g++)n=k[g],i.indexOf(n)===-1&&{}.propertyIsEnumerable.call(r,n)&&(_[n]=r[n])}return _}function G1(r,i){if(r==null)return{};var n={};for(var g in r)if({}.hasOwnProperty.call(r,g)){if(i.indexOf(g)!==-1)continue;n[g]=r[g]}return n}function Y1(r,i){return U1(r)||V1(r,i)||Q1(r,i)||K1()}function X1(r,i){if(typeof r!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var g=n.call(r,i);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}function J1(r){var i=X1(r,"string");return typeof i=="symbol"?i:i+""}function Q1(r,i){if(r){if(typeof r=="string")return wf(r,i);var n={}.toString.call(r).slice(8,-1);return n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set"?Array.from(r):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wf(r,i):void 0}}function Z1(r,i,n){return i in r?Object.defineProperty(r,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[i]=n,r}function xf(r,i){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(r);i&&(g=g.filter(function(_){return Object.getOwnPropertyDescriptor(r,_).enumerable})),n.push.apply(n,g)}return n}function bf(r){for(var i=1;i<arguments.length;i++){var n=arguments[i]!=null?arguments[i]:{};i%2?xf(Object(n),!0).forEach(function(g){Z1(r,g,n[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):xf(Object(n)).forEach(function(g){Object.defineProperty(r,g,Object.getOwnPropertyDescriptor(n,g))})}return r}function ey(){for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];return function(g){return i.reduceRight(function(_,k){return k(_)},g)}}function xn(r){return function i(){for(var n=this,g=arguments.length,_=new Array(g),k=0;k<g;k++)_[k]=arguments[k];return _.length>=r.length?r.apply(this,_):function(){for(var R=arguments.length,a=new Array(R),d=0;d<R;d++)a[d]=arguments[d];return i.apply(n,[].concat(_,a))}}}function la(r){return{}.toString.call(r).includes("Object")}function ty(r){return!Object.keys(r).length}function kn(r){return typeof r=="function"}function ry(r,i){return Object.prototype.hasOwnProperty.call(r,i)}function iy(r,i){return la(i)||Ri("changeType"),Object.keys(i).some(function(n){return!ry(r,n)})&&Ri("changeField"),i}function sy(r){kn(r)||Ri("selectorType")}function ny(r){kn(r)||la(r)||Ri("handlerType"),la(r)&&Object.values(r).some(function(i){return!kn(i)})&&Ri("handlersType")}function oy(r){r||Ri("initialIsRequired"),la(r)||Ri("initialType"),ty(r)&&Ri("initialContent")}function ay(r,i){throw new Error(r[i]||r.default)}var ly={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ri=xn(ay)(ly),Go={changes:iy,selector:sy,handler:ny,initial:oy};function cy(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Go.initial(r),Go.handler(i);var n={current:r},g=xn(dy)(n,i),_=xn(uy)(n),k=xn(Go.changes)(r),R=xn(hy)(n);function a(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Go.selector(p),p(n.current)}function d(p){ey(g,_,k,R)(p)}return[a,d]}function hy(r,i){return kn(i)?i(r.current):i}function uy(r,i){return r.current=bf(bf({},r.current),i),i}function dy(r,i,n){return kn(i)?i(r.current):Object.keys(n).forEach(function(g){var _;return(_=i[g])===null||_===void 0?void 0:_.call(i,r.current[g])}),n}var fy={create:cy},_y={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function py(r){return function i(){for(var n=this,g=arguments.length,_=new Array(g),k=0;k<g;k++)_[k]=arguments[k];return _.length>=r.length?r.apply(this,_):function(){for(var R=arguments.length,a=new Array(R),d=0;d<R;d++)a[d]=arguments[d];return i.apply(n,[].concat(_,a))}}}function vy(r){return{}.toString.call(r).includes("Object")}function gy(r){return r||Ef("configIsRequired"),vy(r)||Ef("configType"),r.urls?(my(),{paths:{vs:r.urls.monacoBase}}):r}function my(){console.warn(B_.deprecation)}function yy(r,i){throw new Error(r[i]||r.default)}var B_={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
168
+ You are using deprecated way of configuration.
169
+
170
+ Instead of using
171
+ monaco.config({ urls: { monacoBase: '...' } })
172
+ use
173
+ monaco.config({ paths: { vs: '...' } })
174
+
175
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
176
+ `},Ef=py(yy)(B_),wy={config:gy},Sy=function(){for(var i=arguments.length,n=new Array(i),g=0;g<i;g++)n[g]=arguments[g];return function(_){return n.reduceRight(function(k,R){return R(k)},_)}};function P_(r,i){return Object.keys(i).forEach(function(n){i[n]instanceof Object&&r[n]&&Object.assign(i[n],P_(r[n],i[n]))}),Cf(Cf({},r),i)}var Cy={type:"cancelation",msg:"operation is manually canceled"};function Mc(r){var i=!1,n=new Promise(function(g,_){r.then(function(k){return i?_(Cy):g(k)}),r.catch(_)});return n.cancel=function(){return i=!0},n}var xy=["monaco"],by=fy.create({config:_y,isInitialized:!1,resolve:null,reject:null,monaco:null}),O_=Y1(by,2),Mn=O_[0],ha=O_[1];function Ey(r){var i=wy.config(r),n=i.monaco,g=q1(i,xy);ha(function(_){return{config:P_(_.config,g),monaco:n}})}function Ly(){var r=Mn(function(i){var n=i.monaco,g=i.isInitialized,_=i.resolve;return{monaco:n,isInitialized:g,resolve:_}});if(!r.isInitialized){if(ha({isInitialized:!0}),r.monaco)return r.resolve(r.monaco),Mc(Tc);if(window.monaco&&window.monaco.editor)return N_(window.monaco),r.resolve(window.monaco),Mc(Tc);Sy(ky,My)(Ty)}return Mc(Tc)}function ky(r){return document.body.appendChild(r)}function Ry(r){var i=document.createElement("script");return r&&(i.src=r),i}function My(r){var i=Mn(function(g){var _=g.config,k=g.reject;return{config:_,reject:k}}),n=Ry("".concat(i.config.paths.vs,"/loader.js"));return n.onload=function(){return r()},n.onerror=i.reject,n}function Ty(){var r=Mn(function(n){var g=n.config,_=n.resolve,k=n.reject;return{config:g,resolve:_,reject:k}}),i=window.require;i.config(r.config),i(["vs/editor/editor.main"],function(n){var g=n.m||n;N_(g),r.resolve(g)},function(n){r.reject(n)})}function N_(r){Mn().monaco||ha({monaco:r})}function Dy(){return Mn(function(r){var i=r.monaco;return i})}var Tc=new Promise(function(r,i){return ha({resolve:r,reject:i})}),I_={config:Ey,init:Ly,__getMonacoInstance:Dy},Ay={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Dc=Ay,By={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Py=By;function Oy({children:r}){return qi.createElement("div",{style:Py.container},r)}var Ny=Oy,Iy=Ny;function Fy({width:r,height:i,isEditorReady:n,loading:g,_ref:_,className:k,wrapperProps:R}){return qi.createElement("section",{style:{...Dc.wrapper,width:r,height:i},...R},!n&&qi.createElement(Iy,null,g),qi.createElement("div",{ref:_,style:{...Dc.fullWidth,...!n&&Dc.hide},className:k}))}var jy=Fy,F_=q.memo(jy);function Hy(r){q.useEffect(r,[])}var j_=Hy;function $y(r,i,n=!0){let g=q.useRef(!0);q.useEffect(g.current||!n?()=>{g.current=!1}:r,i)}var hr=$y;function En(){}function Ts(r,i,n,g){return zy(r,g)||Uy(r,i,n,g)}function zy(r,i){return r.editor.getModel(H_(r,i))}function Uy(r,i,n,g){return r.editor.createModel(i,n,g?H_(r,g):void 0)}function H_(r,i){return r.Uri.parse(i)}function Wy({original:r,modified:i,language:n,originalLanguage:g,modifiedLanguage:_,originalModelPath:k,modifiedModelPath:R,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:d=!1,theme:p="light",loading:y="Loading...",options:f={},height:S="100%",width:b="100%",className:M,wrapperProps:w={},beforeMount:c=En,onMount:u=En}){let[l,h]=q.useState(!1),[v,C]=q.useState(!0),L=q.useRef(null),T=q.useRef(null),E=q.useRef(null),N=q.useRef(u),W=q.useRef(c),K=q.useRef(!1);j_(()=>{let $=I_.init();return $.then(V=>(T.current=V)&&C(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>L.current?U():$.cancel()}),hr(()=>{if(L.current&&T.current){let $=L.current.getOriginalEditor(),V=Ts(T.current,r||"",g||n||"text",k||"");V!==$.getModel()&&$.setModel(V)}},[k],l),hr(()=>{if(L.current&&T.current){let $=L.current.getModifiedEditor(),V=Ts(T.current,i||"",_||n||"text",R||"");V!==$.getModel()&&$.setModel(V)}},[R],l),hr(()=>{let $=L.current.getModifiedEditor();$.getOption(T.current.editor.EditorOption.readOnly)?$.setValue(i||""):i!==$.getValue()&&($.executeEdits("",[{range:$.getModel().getFullModelRange(),text:i||"",forceMoveMarkers:!0}]),$.pushUndoStop())},[i],l),hr(()=>{var $,V;(V=($=L.current)==null?void 0:$.getModel())==null||V.original.setValue(r||"")},[r],l),hr(()=>{let{original:$,modified:V}=L.current.getModel();T.current.editor.setModelLanguage($,g||n||"text"),T.current.editor.setModelLanguage(V,_||n||"text")},[n,g,_],l),hr(()=>{var $;($=T.current)==null||$.editor.setTheme(p)},[p],l),hr(()=>{var $;($=L.current)==null||$.updateOptions(f)},[f],l);let I=q.useCallback(()=>{var X;if(!T.current)return;W.current(T.current);let $=Ts(T.current,r||"",g||n||"text",k||""),V=Ts(T.current,i||"",_||n||"text",R||"");(X=L.current)==null||X.setModel({original:$,modified:V})},[n,i,_,r,g,k,R]),B=q.useCallback(()=>{var $;!K.current&&E.current&&(L.current=T.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...f}),I(),($=T.current)==null||$.editor.setTheme(p),h(!0),K.current=!0)},[f,p,I]);q.useEffect(()=>{l&&N.current(L.current,T.current)},[l]),q.useEffect(()=>{!v&&!l&&B()},[v,l,B]);function U(){var V,X,z,D;let $=(V=L.current)==null?void 0:V.getModel();a||((X=$==null?void 0:$.original)==null||X.dispose()),d||((z=$==null?void 0:$.modified)==null||z.dispose()),(D=L.current)==null||D.dispose()}return qi.createElement(F_,{width:b,height:S,isEditorReady:l,loading:y,_ref:E,className:M,wrapperProps:w})}var Vy=Wy,Ky=q.memo(Vy);function qy(r){let i=q.useRef();return q.useEffect(()=>{i.current=r},[r]),i.current}var Gy=qy,Yo=new Map;function Yy({defaultValue:r,defaultLanguage:i,defaultPath:n,value:g,language:_,path:k,theme:R="light",line:a,loading:d="Loading...",options:p={},overrideServices:y={},saveViewState:f=!0,keepCurrentModel:S=!1,width:b="100%",height:M="100%",className:w,wrapperProps:c={},beforeMount:u=En,onMount:l=En,onChange:h,onValidate:v=En}){let[C,L]=q.useState(!1),[T,E]=q.useState(!0),N=q.useRef(null),W=q.useRef(null),K=q.useRef(null),I=q.useRef(l),B=q.useRef(u),U=q.useRef(),$=q.useRef(g),V=Gy(k),X=q.useRef(!1),z=q.useRef(!1);j_(()=>{let A=I_.init();return A.then(H=>(N.current=H)&&E(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>W.current?O():A.cancel()}),hr(()=>{var H,Q,ne,oe;let A=Ts(N.current,r||g||"",i||_||"",k||n||"");A!==((H=W.current)==null?void 0:H.getModel())&&(f&&Yo.set(V,(Q=W.current)==null?void 0:Q.saveViewState()),(ne=W.current)==null||ne.setModel(A),f&&((oe=W.current)==null||oe.restoreViewState(Yo.get(k))))},[k],C),hr(()=>{var A;(A=W.current)==null||A.updateOptions(p)},[p],C),hr(()=>{!W.current||g===void 0||(W.current.getOption(N.current.editor.EditorOption.readOnly)?W.current.setValue(g):g!==W.current.getValue()&&(z.current=!0,W.current.executeEdits("",[{range:W.current.getModel().getFullModelRange(),text:g,forceMoveMarkers:!0}]),W.current.pushUndoStop(),z.current=!1))},[g],C),hr(()=>{var H,Q;let A=(H=W.current)==null?void 0:H.getModel();A&&_&&((Q=N.current)==null||Q.editor.setModelLanguage(A,_))},[_],C),hr(()=>{var A;a!==void 0&&((A=W.current)==null||A.revealLine(a))},[a],C),hr(()=>{var A;(A=N.current)==null||A.editor.setTheme(R)},[R],C);let D=q.useCallback(()=>{var A;if(!(!K.current||!N.current)&&!X.current){B.current(N.current);let H=k||n,Q=Ts(N.current,g||r||"",i||_||"",H||"");W.current=(A=N.current)==null?void 0:A.editor.create(K.current,{model:Q,automaticLayout:!0,...p},y),f&&W.current.restoreViewState(Yo.get(H)),N.current.editor.setTheme(R),a!==void 0&&W.current.revealLine(a),L(!0),X.current=!0}},[r,i,n,g,_,k,p,y,f,R,a]);q.useEffect(()=>{C&&I.current(W.current,N.current)},[C]),q.useEffect(()=>{!T&&!C&&D()},[T,C,D]),$.current=g,q.useEffect(()=>{var A,H;C&&h&&((A=U.current)==null||A.dispose(),U.current=(H=W.current)==null?void 0:H.onDidChangeModelContent(Q=>{z.current||h(W.current.getValue(),Q)}))},[C,h]),q.useEffect(()=>{if(C){let A=N.current.editor.onDidChangeMarkers(H=>{var ne;let Q=(ne=W.current.getModel())==null?void 0:ne.uri;if(Q&&H.find(oe=>oe.path===Q.path)){let oe=N.current.editor.getModelMarkers({resource:Q});v==null||v(oe)}});return()=>{A==null||A.dispose()}}return()=>{}},[C,v]);function O(){var A,H;(A=U.current)==null||A.dispose(),S?f&&Yo.set(k,W.current.saveViewState()):(H=W.current.getModel())==null||H.dispose(),W.current.dispose()}return qi.createElement(F_,{width:b,height:M,isEditorReady:C,loading:d,_ref:K,className:w,wrapperProps:c})}var Xy=Yy,Jy=q.memo(Xy),Qy=Jy;const Lf="ファイルを選択してください",Zy="vs-dark",ew="vs";function tw(r){var g;const i=((g=r.split(".").pop())==null?void 0:g.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[i]||{icon:"📄",color:"var(--ink-muted)"}}function rw(r){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[r]||r}function iw({files:r,activeFileId:i,onSelectFile:n,onCloseFile:g,onChangeFile:_,onSaveFile:k,savingFileId:R,theme:a}){const d=r.find(w=>w.id===i),p=q.useRef(null),[y,f]=q.useState({line:1,column:1}),S=q.useCallback(w=>{p.current=w,w.onDidChangeCursorPosition(c=>{f({line:c.position.lineNumber,column:c.position.column})})},[]);q.useEffect(()=>{const w=c=>{!i||!((c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="s")||(c.preventDefault(),k==null||k(i))};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[i,k]);const b=(w,c)=>{w.stopPropagation(),g(c)},M=(w,c)=>{w.button===1&&(w.preventDefault(),g(c))};return r.length===0?P.jsx("div",{className:"editor-container editor-empty",children:P.jsxs("div",{className:"editor-welcome",children:[P.jsx("div",{className:"editor-welcome-icon",children:P.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[P.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),P.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),P.jsx("div",{className:"editor-welcome-text",children:Lf}),P.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):P.jsxs("div",{className:"editor-container",children:[P.jsx("div",{className:"editor-tabs",children:P.jsx("div",{className:"editor-tabs-list",children:r.map(w=>{const{icon:c,color:u}=tw(w.name),l=w.id===i,h=R===w.id;return P.jsxs("div",{className:Ot("editor-tab",l&&"active",w.dirty&&"dirty"),onClick:()=>n(w.id),onMouseDown:v=>M(v,w.id),role:"tab","aria-selected":l,tabIndex:0,children:[P.jsx("span",{className:"editor-tab-icon",style:{color:u},children:c}),P.jsx("span",{className:"editor-tab-name",children:w.name}),w.dirty&&!h&&P.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),h&&P.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:P.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:P.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),P.jsx("button",{type:"button",className:"editor-tab-close",onClick:v=>b(v,w.id),"aria-label":"閉じる",children:P.jsx("svg",{viewBox:"0 0 24 24",children:P.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},w.id)})})}),d&&P.jsx("div",{className:"editor-breadcrumb",children:P.jsx("span",{className:"editor-breadcrumb-path",children:d.path})}),P.jsx("div",{className:"editor-content",children:d?P.jsx(Qy,{height:"100%",theme:a==="dark"?Zy:ew,language:d.language,value:d.contents,onChange:w=>_(d.id,w??""),onMount:S,options:{fontFamily:Nf,fontSize:If,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):P.jsx("div",{className:"editor-no-file",children:P.jsx("span",{children:Lf})})}),d&&P.jsxs("div",{className:"editor-statusbar",children:[P.jsx("div",{className:"editor-statusbar-left",children:P.jsxs("span",{className:"editor-status-item",children:[P.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[P.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),P.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),P.jsxs("div",{className:"editor-statusbar-right",children:[P.jsxs("span",{className:"editor-status-item",children:["Ln ",y.line,", Col ",y.column]}),P.jsx("span",{className:"editor-status-item",children:"UTF-8"}),P.jsx("span",{className:"editor-status-item",children:rw(d.language)})]})]})]})}const sw="差分ビューア",nw="読み込み中...",ow="閉じる",aw="vs-dark",lw="vs";function cw({diff:r,loading:i,theme:n,onClose:g}){const _=r?Gf(r.path):"plaintext";return P.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[P.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[P.jsxs("div",{children:[P.jsx("div",{className:"text-[13px] font-medium",children:sw}),r&&P.jsx("div",{className:"text-xs text-muted font-mono",children:r.path})]}),P.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:g,children:ow})]}),P.jsx("div",{className:"min-h-0 overflow-hidden",children:i?P.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:nw}):r?P.jsx(Ky,{height:"100%",theme:n==="dark"?aw:lw,language:_,original:r.original,modified:r.modified,options:{fontFamily:Nf,fontSize:If,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function hw({activeWorkspace:r,defaultRoot:i,activeWorkspaceState:n,editorWorkspaceId:g,gitState:_,theme:k,savingFileId:R,onCloseWorkspaceEditor:a,onToggleDir:d,onOpenFile:p,onRefreshTree:y,onCreateFile:f,onCreateDirectory:S,onDeleteFile:b,onDeleteDirectory:M,onRefreshGit:w,onSelectRepo:c,onStageFile:u,onUnstageFile:l,onStageAll:h,onUnstageAll:v,onCommit:C,onDiscardFile:L,onShowDiff:T,onCloseDiff:E,onPush:N,onPull:W,onLoadBranches:K,onCheckoutBranch:I,onCreateBranch:B,onLoadLogs:U,onSelectFile:$,onCloseFile:V,onChangeFile:X,onSaveFile:z}){var oe,ue;const[D,O]=q.useState(!1),[A,H]=q.useState("files"),Q=q.useCallback(Y=>{p(Y),O(!1)},[p]),ne=((oe=_.status)==null?void 0:oe.files.length)??0;return P.jsxs("div",{className:Ot("workspace-editor-overlay",D&&"drawer-open"),children:[P.jsxs("div",{className:"workspace-editor-header",children:[P.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:a,children:"一覧に戻る"}),P.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>O(Y=>!Y),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:P.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:P.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),P.jsx("div",{className:"workspace-meta",children:r?r.path:null})]}),P.jsxs("div",{className:"workspace-editor-grid",children:[P.jsxs("div",{className:"activity-bar",children:[P.jsx("button",{type:"button",className:Ot("activity-bar-item",A==="files"&&"active"),onClick:()=>H("files"),title:"エクスプローラー",children:P.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:P.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),P.jsxs("button",{type:"button",className:Ot("activity-bar-item",A==="git"&&"active"),onClick:()=>{H("git"),w()},title:"ソースコントロール",children:[P.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[P.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),P.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),ne>0&&P.jsx("span",{className:"activity-bar-badge",children:ne})]})]}),P.jsx("div",{className:"sidebar-panel",children:P.jsx("div",{className:"sidebar-content",children:A==="files"?P.jsx(A_,{root:(r==null?void 0:r.path)||i||"",entries:n.tree,loading:n.treeLoading,error:n.treeError,onToggleDir:d,onOpenFile:Q,onRefresh:y,onCreateFile:f,onCreateDirectory:S,onDeleteFile:b,onDeleteDirectory:M,gitFiles:(ue=_.status)==null?void 0:ue.files}):P.jsx(z1,{status:_.status,loading:_.loading,error:_.error,workspaceId:g,branchStatus:_.branchStatus,hasRemote:_.hasRemote,pushing:_.pushing,pulling:_.pulling,branches:_.branches,branchesLoading:_.branchesLoading,logs:_.logs,logsLoading:_.logsLoading,repos:_.repos,selectedRepoPath:_.selectedRepoPath,onSelectRepo:c,onRefresh:w,onStageFile:u,onUnstageFile:l,onStageAll:h,onUnstageAll:v,onCommit:C,onDiscardFile:L,onShowDiff:T,onPush:N,onPull:W,onLoadBranches:K,onCheckoutBranch:I,onCreateBranch:B,onLoadLogs:U})})}),P.jsx(iw,{files:n.files,activeFileId:n.activeFileId,onSelectFile:$,onCloseFile:V,onChangeFile:X,onSaveFile:z,savingFileId:R,theme:k})]}),P.jsx("div",{className:"sidebar-overlay",onClick:()=>O(!1),"aria-hidden":"true"}),_.diffPath&&P.jsx(cw,{diff:_.diff,loading:_.diffLoading,theme:k,onClose:E})]})}const uw="設定",dw="サーバー設定",fw="ポート番号",_w="Basic認証",pw="Basic認証を有効にする",vw="ユーザー名",gw="パスワード",mw="※ 12文字以上推奨",yw="キャンセル",ww="保存",Sw="※ 設定を保存すると、サーバーが再起動されます",Cw="WebSocket設定",xw="接続数上限 (IP毎)",bw="現在の接続数",Ew="全接続をクリア",Lw="適用",Xo="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function kw({isOpen:r,onClose:i,onSave:n}){const[g,_]=q.useState(8787),[k,R]=q.useState(!1),[a,d]=q.useState(""),[p,y]=q.useState(""),[f,S]=q.useState(!1),[b,M]=q.useState(1e3),[w,c]=q.useState(null),[u,l]=q.useState(!1),h=()=>{fetch("/api/ws/stats").then(T=>T.json()).then(T=>{c(T),M(T.limit)}).catch(T=>{console.error("Failed to load WS stats:",T)})};q.useEffect(()=>{if(!r)return;const T=E=>{E.key==="Escape"&&(E.preventDefault(),i())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[r,i]),q.useEffect(()=>{r&&(fetch("/api/settings").then(T=>T.json()).then(T=>{_(T.port),R(T.basicAuthEnabled),d(T.basicAuthUser),y(T.basicAuthPassword)}).catch(T=>{console.error("Failed to load settings:",T)}),h())},[r]);const v=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:b})}),h()}catch(T){console.error("Failed to set WS limit:",T)}},C=async()=>{l(!0);try{await fetch("/api/ws/clear",{method:"POST"}),h()}catch(T){console.error("Failed to clear WS connections:",T)}finally{l(!1)}},L=async T=>{T.preventDefault(),S(!0);try{await n({port:g,basicAuthEnabled:k,basicAuthUser:a,basicAuthPassword:p}),i()}catch(E){console.error("Failed to save settings:",E),alert("設定の保存に失敗しました")}finally{S(!1)}};return r?P.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:i,children:P.jsxs("div",{className:"modal w-[500px]",onClick:T=>T.stopPropagation(),children:[P.jsxs("div",{className:"flex items-center justify-between mb-4",children:[P.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:uw}),P.jsx("button",{type:"button",className:"modal-close-btn",onClick:i,"aria-label":"閉じる",children:"×"})]}),P.jsxs("form",{onSubmit:L,children:[P.jsxs("div",{className:"flex flex-col gap-4",children:[P.jsxs("section",{className:"flex flex-col gap-3",children:[P.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:dw}),P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:fw}),P.jsx("input",{type:"number",id:"port",className:Xo,value:g,onChange:T=>_(Number(T.target.value)),min:1024,max:65535,required:!0})]}),P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:_w}),P.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[P.jsx("input",{type:"checkbox",checked:k,onChange:T=>R(T.target.checked)}),P.jsx("span",{children:pw})]})]}),k&&P.jsxs(P.Fragment,{children:[P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:vw}),P.jsx("input",{type:"text",id:"username",className:Xo,value:a,onChange:T=>d(T.target.value),required:k,autoComplete:"username"})]}),P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:gw}),P.jsx("input",{type:"password",id:"password",className:Xo,value:p,onChange:T=>y(T.target.value),required:k,minLength:12,autoComplete:"new-password"}),P.jsx("p",{className:"m-0 text-[11px] text-muted",children:mw})]})]})]}),P.jsxs("section",{className:"flex flex-col gap-3",children:[P.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:Cw}),P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:xw}),P.jsxs("div",{className:"flex gap-2 items-center",children:[P.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${Xo}`,value:b,onChange:T=>M(Number(T.target.value)),min:1,max:1e4}),P.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:v,children:Lw})]})]}),P.jsxs("div",{className:"flex flex-col gap-1",children:[P.jsx("label",{className:"text-xs text-ink-muted",children:bw}),P.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:w&&w.connections.length>0?w.connections.map(({ip:T,count:E})=>P.jsxs("div",{className:"flex justify-between items-center",children:[P.jsx("span",{className:"font-mono text-ink",children:T}),P.jsx("span",{className:"font-semibold text-ink-muted",children:E})]},T)):P.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),P.jsx("div",{className:"flex flex-col gap-1",children:P.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:C,disabled:u,children:u?"クリア中...":Ew})})]}),P.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:Sw})]}),P.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[P.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:f,children:yw}),P.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:f,children:f?"保存中...":ww})]})]})]})}):null}const Rw=()=>{const[r,i]=q.useState({}),n=q.useCallback((_,k)=>{i(R=>{const a=R[_]||ra();return{...R,[_]:k(a)}})},[]),g=q.useCallback(_=>{i(k=>{const R={...k};return _.forEach(a=>{R[a]||(R[a]=ra())}),R})},[]);return{workspaceStates:r,setWorkspaceStates:i,updateWorkspaceState:n,initializeWorkspaceStates:g}},Mw=()=>{const[r,i]=q.useState({}),n=q.useCallback((_,k)=>{i(R=>{const a=R[_]||ia();return{...R,[_]:k(a)}})},[]),g=q.useCallback(_=>{i(k=>{const R={...k};return _.forEach(a=>{R[a]||(R[a]=ia())}),R})},[]);return{deckStates:r,setDeckStates:i,updateDeckState:n,initializeDeckStates:g}},Tw=({setStatusMessage:r,defaultRoot:i,initializeWorkspaceStates:n,setWorkspaceStates:g})=>{const[_,k]=q.useState([]),[R,a]=q.useState(null);q.useEffect(()=>{let y=!0;return Uv().then(f=>{y&&(k(f),a(S=>S&&f.some(b=>b.id===S)?S:null),n(f.map(S=>S.id)))}).catch(f=>{y&&r(`ワークスペースを取得できませんでした: ${Lt(f)}`)}),()=>{y=!1}},[r,n]);const d=q.useCallback(async y=>{const S=y.trim()||i;if(!S)return r("パスを入力してください。"),null;const b=Ad(S);if(_.some(w=>Ad(w.path)===b))return r("同じパスのワークスペースは追加できません。"),null;try{const w=await Vv(S);return k(c=>[...c,w]),a(w.id),g(c=>({...c,[w.id]:ra()})),w}catch(w){return r(`ワークスペースを追加できませんでした: ${Lt(w)}`),null}},[_,i,r,g]),p=q.useCallback(async y=>{try{await Kv(y),k(f=>f.filter(S=>S.id!==y)),a(f=>f===y?null:f),g(f=>{const S={...f};return delete S[y],S})}catch(f){r(`ワークスペースを削除できませんでした: ${Lt(f)}`)}},[r,g]);return{workspaces:_,editorWorkspaceId:R,setEditorWorkspaceId:a,handleCreateWorkspace:d,handleDeleteWorkspace:p}},Dw=({setStatusMessage:r,initializeDeckStates:i,updateDeckState:n,setDeckStates:g,initialDeckIds:_})=>{const[k,R]=q.useState([]),[a,d]=q.useState(_??[]);q.useEffect(()=>{let w=!0;return qv().then(c=>{w&&(R(c),i(c.map(u=>u.id)),c.forEach(u=>{sg(u.id).then(l=>{w&&n(u.id,h=>{var v;return{...h,terminals:l,activeTerminalId:h.activeTerminalId&&l.some(C=>C.id===h.activeTerminalId)?h.activeTerminalId:((v=l[0])==null?void 0:v.id)??null}})}).catch(()=>{})}))}).catch(c=>{w&&r(`デッキを取得できませんでした: ${Lt(c)}`)}),()=>{w=!1}},[r,i,n]),q.useEffect(()=>{if(k.length===0)return;const w=a.filter(c=>k.some(u=>u.id===c));w.length===a.length&&w.length>0||(w.length>0?d(w):k[0]&&d([k[0].id]))},[k,a]);const p=q.useCallback(async(w,c)=>{try{const u=await Gv(w,c);return R(l=>[...l,u]),d(l=>[...l.filter(h=>h!==u.id),u.id]),g(l=>({...l,[u.id]:ia()})),u}catch(u){return r(`デッキの作成に失敗しました: ${Lt(u)}`),null}},[r,g]),y=q.useCallback(async w=>{try{await Yv(w),R(c=>c.filter(u=>u.id!==w)),d(c=>c.filter(u=>u!==w)),g(c=>{const u={...c};return delete u[w],u})}catch(c){r(`デッキの削除に失敗しました: ${Lt(c)}`)}},[r,g]),f=q.useCallback(w=>{R(c=>{const u=w(c);return Xv(u.map(l=>l.id)).catch(()=>{}),u})},[]),S=q.useCallback(async(w,c,u,l)=>{try{const h=await ig(w,l,u);n(w,v=>({...v,terminals:[...v.terminals,{id:h.id,title:h.title}],activeTerminalId:h.id}))}catch(h){r(`ターミナルを起動できませんでした: ${Lt(h)}`)}},[n,r]),b=q.useCallback(async(w,c)=>{try{await ng(c),n(w,u=>{var v;const l=u.terminals.filter(C=>C.id!==c),h=u.activeTerminalId===c?((v=l[l.length-1])==null?void 0:v.id)??null:u.activeTerminalId;return{...u,terminals:l,activeTerminalId:h}})}catch(u){r(`ターミナルを削除できませんでした: ${Lt(u)}`)}},[n,r]),M=q.useCallback((w,c)=>{n(w,u=>{var v;const l=u.terminals.filter(C=>C.id!==c),h=u.activeTerminalId===c?((v=l[l.length-1])==null?void 0:v.id)??null:u.activeTerminalId;return{...u,terminals:l,activeTerminalId:h}})},[n]);return{decks:k,activeDeckIds:a,setActiveDeckIds:d,handleCreateDeck:p,handleDeleteDeck:y,handleReorderDecks:f,handleCreateTerminal:S,handleDeleteTerminal:b,handleRemoveTerminalLocal:M}},Aw=({editorWorkspaceId:r,activeWorkspaceState:i,updateWorkspaceState:n,setStatusMessage:g})=>{const[_,k]=q.useState(null),R=q.useCallback(()=>{r&&(n(r,c=>({...c,treeLoading:!0,treeError:null})),Pt(Rd(r,""),15e3).then(c=>{n(r,u=>({...u,tree:sa(c),treeLoading:!1}))}).catch(c=>{n(r,u=>({...u,treeLoading:!1,treeError:Lt(c)}))}))},[r,n]),a=q.useCallback(c=>{if(!(!r||c.type!=="dir")){if(c.expanded){n(r,u=>({...u,tree:Ls(u.tree,c.path,l=>({...l,expanded:!1}))}));return}if(c.children&&c.children.length>0){n(r,u=>({...u,tree:Ls(u.tree,c.path,l=>({...l,expanded:!0}))}));return}n(r,u=>({...u,tree:Ls(u.tree,c.path,l=>({...l,loading:!0}))})),Pt(Rd(r,c.path),15e3).then(u=>{n(r,l=>({...l,tree:Ls(l.tree,c.path,h=>({...h,expanded:!0,loading:!1,children:sa(u)}))}))}).catch(u=>{n(r,l=>({...l,treeError:Lt(u),tree:Ls(l.tree,c.path,h=>({...h,loading:!1}))}))})}},[r,n]),d=q.useCallback(c=>{if(!r||c.type!=="file")return;const u=i.files.find(v=>v.path===c.path);if(u){n(r,v=>({...v,activeFileId:u.id}));return}const l=crypto.randomUUID(),h={id:l,name:c.name,path:c.path,language:Gf(c.path),contents:"",dirty:!1};n(r,v=>({...v,files:[...v.files,{...h,contents:"読み込み中..."}],activeFileId:l})),Pt(Jv(r,c.path),15e3).then(v=>{n(r,C=>({...C,files:C.files.map(L=>L.id===l?{...L,contents:v.contents}:L)}))}).catch(v=>{n(r,C=>({...C,files:C.files.filter(L=>L.id!==l),activeFileId:C.files.length>1?C.files[0].id:null})),g(`ファイルを開けませんでした: ${Lt(v)}`)})},[r,i.files,n,g]),p=q.useCallback((c,u)=>{r&&n(r,l=>({...l,files:l.files.map(h=>h.id===c?{...h,contents:u,dirty:!0}:h)}))},[r,n]),y=q.useCallback(async c=>{if(!r)return;const u=i.files.find(l=>l.id===c);if(u){k(c);try{await Pt(Qv(r,u.path,u.contents),15e3),n(r,l=>({...l,files:l.files.map(h=>h.id===c?{...h,dirty:!1}:h)})),g(Of)}catch(l){g(`保存に失敗しました: ${Lt(l)}`)}finally{k(null)}}},[r,i.files,n,g]),f=q.useCallback(c=>{r&&n(r,u=>{const l=u.files.findIndex(C=>C.id===c),h=u.files.filter(C=>C.id!==c);let v=u.activeFileId;return u.activeFileId===c&&(h.length===0?v=null:l>=h.length?v=h[h.length-1].id:v=h[l].id),{...u,files:h,activeFileId:v}})},[r,n]),S=q.useCallback(async(c,u)=>{if(!r)return;const l=c?`${c}/${u}`:u;try{await Pt(Zv(r,l),15e3);const h={name:u,path:l,type:"file",expanded:!1,loading:!1};n(r,v=>({...v,tree:Pc(v.tree,c,h)})),g(`ファイルを作成しました: ${u}`)}catch(h){g(`ファイル作成に失敗しました: ${Lt(h)}`)}},[r,n,g]),b=q.useCallback(async(c,u)=>{if(!r)return;const l=c?`${c}/${u}`:u;try{await Pt(tg(r,l),15e3);const h={name:u,path:l,type:"dir",expanded:!1,loading:!1,children:[]};n(r,v=>({...v,tree:Pc(v.tree,c,h)})),g(`フォルダを作成しました: ${u}`)}catch(h){g(`フォルダ作成に失敗しました: ${Lt(h)}`)}},[r,n,g]),M=q.useCallback(async c=>{if(r)try{await Pt(eg(r,c),15e3),n(r,u=>{const l=u.files.filter(C=>C.path!==c);let h=u.activeFileId;const v=u.files.find(C=>C.path===c);return v&&u.activeFileId===v.id&&(h=l.length>0?l[0].id:null),{...u,files:l,activeFileId:h,tree:Oc(u.tree,c)}}),g("ファイルを削除しました")}catch(u){g(`ファイル削除に失敗しました: ${Lt(u)}`)}},[r,n,g]),w=q.useCallback(async c=>{if(r)try{await Pt(rg(r,c),15e3),n(r,u=>{const l=u.files.filter(C=>!C.path.startsWith(c+"/")&&C.path!==c);let h=u.activeFileId;const v=u.files.find(C=>C.id===u.activeFileId);return v&&(v.path.startsWith(c+"/")||v.path===c)&&(h=l.length>0?l[0].id:null),{...u,files:l,activeFileId:h,tree:Oc(u.tree,c)}}),g("フォルダを削除しました")}catch(u){g(`フォルダ削除に失敗しました: ${Lt(u)}`)}},[r,n,g]);return{savingFileId:_,handleRefreshTree:R,handleToggleDir:a,handleOpenFile:d,handleFileChange:p,handleSaveFile:y,handleCloseFile:f,handleCreateFile:S,handleCreateDirectory:b,handleDeleteFile:M,handleDeleteDirectory:w}};async function Bw(r,i,n,g){if(!g.current[r]){g.current[r]=!0,i(r,_=>({..._,loading:!0,reposLoading:!0,error:null}));try{const k=(await Pt(hg(r)).catch(()=>({repos:[]}))).repos;i(r,f=>({...f,repos:k,reposLoading:!1,selectedRepoPath:f.selectedRepoPath??(k.length>0?k[0].path:null)}));const a=(n.current[r]||bn()).selectedRepoPath??(k.length>0?k[0].path:void 0),[d,p,y]=await Promise.all([Pt($f(r,a||void 0)),Pt(Wf(r,a||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Pt(Vf(r,a||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);i(r,f=>({...f,status:d,branchStatus:p,hasRemote:y.hasRemote,loading:!1,error:null}))}catch(_){const k=_ instanceof Error?_.message:"Failed to get git status";i(r,R=>({...R,status:null,loading:!1,reposLoading:!1,error:k}))}finally{g.current[r]=!1}}}async function Pw(r,i,n,g){n(r,_=>({..._,selectedRepoPath:i,loading:!0}));try{const[_,k,R]=await Promise.all([Pt($f(r,i||void 0)),Pt(Wf(r,i||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Pt(Vf(r,i||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);n(r,a=>({...a,status:_,branchStatus:k,hasRemote:R.hasRemote,loading:!1,branches:[],logs:[]}))}catch(_){const k=_ instanceof Error?_.message:"Failed to get git status";g(k),n(r,R=>({...R,loading:!1}))}}async function Ow(r,i,n,g,_){try{await zf(r,[i],n),await _()}catch(k){g(k instanceof Error?k.message:"Failed to stage file")}}async function Nw(r,i,n,g,_){try{await Uf(r,[i],n),await _()}catch(k){g(k instanceof Error?k.message:"Failed to unstage file")}}async function Iw(r,i,n,g,_){if(i.length!==0)try{await zf(r,i,n),await _()}catch(k){g(k instanceof Error?k.message:"Failed to stage files")}}async function Fw(r,i,n,g,_){if(i.length!==0)try{await Uf(r,i,n),await _()}catch(k){g(k instanceof Error?k.message:"Failed to unstage files")}}async function jw(r,i,n,g,_){try{const k=await ug(r,i.trim(),n);g(`Committed: ${k.summary.changes} changes, +${k.summary.insertions} -${k.summary.deletions}`),await _()}catch(k){g(k instanceof Error?k.message:"Failed to commit")}}async function Hw(r,i,n,g,_){try{await dg(r,[i],n),await _()}catch(k){g(k instanceof Error?k.message:"Failed to discard changes")}}async function $w(r,i,n,g,_){g(r,k=>({...k,diffPath:i.path,diffLoading:!0,diff:null}));try{const k=await fg(r,i.path,i.staged,n);g(r,R=>({...R,diff:k,diffLoading:!1}))}catch(k){_(k instanceof Error?k.message:"Failed to get diff"),g(r,R=>({...R,diffPath:null,diff:null,diffLoading:!1}))}}async function zw(r,i,n,g,_){n(r,k=>({...k,pushing:!0}));try{const k=await _g(r,i);g(`Pushed to ${k.branch}`),await _()}catch(k){g(k instanceof Error?k.message:"Failed to push")}finally{n(r,k=>({...k,pushing:!1}))}}async function Uw(r,i,n,g,_){n(r,k=>({...k,pulling:!0}));try{const k=await pg(r,i);k.summary.changes>0?g(`Pulled: ${k.summary.changes} changes, +${k.summary.insertions} -${k.summary.deletions}`):g("Already up to date"),await _()}catch(k){g(k instanceof Error?k.message:"Failed to pull")}finally{n(r,k=>({...k,pulling:!1}))}}async function Ww(r,i,n,g){try{await vg(r,i),n("Fetched from remote"),await g()}catch(_){n(_ instanceof Error?_.message:"Failed to fetch")}}async function Vw(r,i,n,g){n(r,_=>({..._,branchesLoading:!0}));try{const _=await Pt(gg(r,i));n(r,k=>({...k,branches:_.branches,branchesLoading:!1}))}catch(_){g(_ instanceof Error?_.message:"Failed to load branches"),n(r,k=>({...k,branchesLoading:!1}))}}async function Kw(r,i,n,g,_,k){try{await mg(r,i,n),g(`Switched to branch '${i}'`),await _(),await k()}catch(R){g(R instanceof Error?R.message:"Failed to checkout branch")}}async function qw(r,i,n,g,_,k,R){try{await yg(r,i,n,g),_(`Created branch '${i}'${n?" and switched to it":""}`),await k(),await R()}catch(a){_(a instanceof Error?a.message:"Failed to create branch")}}async function Gw(r,i,n,g,_){g(r,k=>({...k,logsLoading:!0}));try{const k=await Pt(wg(r,i,n));g(r,R=>({...R,logs:k.logs,logsLoading:!1}))}catch(k){_(k instanceof Error?k.message:"Failed to load git log"),g(r,R=>({...R,logsLoading:!1}))}}const bn=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),Yw=(r,i)=>{const[n,g]=q.useState({}),_=q.useRef({}),k=q.useRef(n);k.current=n;const R=r&&n[r]||bn(),a=q.useCallback((I,B)=>{g(U=>({...U,[I]:B(U[I]||bn())}))},[]),d=q.useCallback(async I=>{const B=I||r;B&&await Bw(B,a,k,_)},[r,a]),p=q.useCallback(async I=>{r&&await Pw(r,I,a,i)},[r,a,i]),y=q.useCallback(async()=>{const I=Object.keys(k.current);await Promise.all(I.map(B=>d(B)))},[d]),f=q.useCallback(()=>{if(!r)return;const I=k.current[r];return(I==null?void 0:I.selectedRepoPath)||void 0},[r]),S=q.useCallback(async I=>{r&&await Ow(r,I,f(),i,d)},[r,f,i,d]),b=q.useCallback(async I=>{r&&await Nw(r,I,f(),i,d)},[r,f,i,d]),M=q.useCallback(async()=>{if(!r||!R.status)return;const I=R.status.files.filter(B=>!B.staged).map(B=>B.path);await Iw(r,I,f(),i,d)},[r,R.status,f,i,d]),w=q.useCallback(async()=>{if(!r||!R.status)return;const I=R.status.files.filter(B=>B.staged).map(B=>B.path);await Fw(r,I,f(),i,d)},[r,R.status,f,i,d]),c=q.useCallback(async I=>{!r||!I.trim()||await jw(r,I,f(),i,d)},[r,f,i,d]),u=q.useCallback(async I=>{r&&await Hw(r,I,f(),i,d)},[r,f,i,d]),l=q.useCallback(async I=>{r&&await $w(r,I,f(),a,i)},[r,f,a,i]),h=q.useCallback(()=>{r&&a(r,I=>({...I,diffPath:null,diff:null,diffLoading:!1}))},[r,a]),v=q.useCallback(async()=>{r&&await zw(r,f(),a,i,d)},[r,f,a,i,d]),C=q.useCallback(async()=>{r&&await Uw(r,f(),a,i,d)},[r,f,a,i,d]),L=q.useCallback(async()=>{r&&await Ww(r,f(),i,d)},[r,f,i,d]),T=q.useCallback(async()=>{r&&await Vw(r,f(),a,i)},[r,f,a,i]),E=q.useCallback(async I=>{r&&await Kw(r,I,f(),i,d,T)},[r,f,i,d,T]),N=q.useCallback(async(I,B=!0)=>{r&&await qw(r,I,B,f(),i,d,T)},[r,f,i,d,T]),W=q.useCallback(async(I=50)=>{r&&await Gw(r,I,f(),a,i)},[r,f,a,i]),K=q.useCallback(I=>n[I]||bn(),[n]);return{gitState:R,gitStates:n,refreshGitStatus:d,refreshAllGitStatuses:y,getGitStateForWorkspace:K,handleSelectRepo:p,handleStageFile:S,handleUnstageFile:b,handleStageAll:M,handleUnstageAll:w,handleCommit:c,handleDiscardFile:u,handleShowDiff:l,handleCloseDiff:h,handlePush:v,handlePull:C,handleFetch:L,handleLoadBranches:T,handleCheckoutBranch:E,handleCreateBranch:N,handleLoadLogs:W}};function Xw(){const[r,i]=q.useState(Mg);q.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=r;try{window.localStorage.setItem(jf,r)}catch{}}},[r]);const n=q.useCallback(()=>{i(g=>g==="dark"?"light":"dark")},[]);return{theme:r,handleToggleTheme:n}}function Jw({view:r,editorWorkspaceId:i,activeDeckIds:n,workspaceMode:g,setView:_,setEditorWorkspaceId:k,setActiveDeckIds:R,setWorkspaceMode:a}){q.useEffect(()=>{const d=()=>{const p=Yf();_(p.view),k(p.workspaceId??null),R(p.deckIds),a(p.workspaceMode)};return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[_,k,R,a]),q.useEffect(()=>{const d=new URLSearchParams;d.set("view",r),r==="workspace"&&i&&d.set("workspace",i),n.length>0&&d.set("decks",n.join(",")),r==="workspace"&&g==="editor"&&i&&d.set("mode","editor");const p=d.toString(),y=p?`${window.location.pathname}?${p}`:window.location.pathname;window.history.replaceState(null,"",y)},[r,i,n,g])}function Qw(){const[r,i]=q.useState(!1),[n,g]=q.useState(!1),[_,k]=q.useState(!1),R=q.useCallback(()=>i(!0),[]),a=q.useCallback(()=>i(!1),[]),d=q.useCallback(()=>g(!0),[]),p=q.useCallback(()=>g(!1),[]),y=q.useCallback(()=>k(!0),[]),f=q.useCallback(()=>k(!1),[]);return{isWorkspaceModalOpen:r,openWorkspaceModal:R,closeWorkspaceModal:a,isDeckModalOpen:n,openDeckModal:d,closeDeckModal:p,isSettingsModalOpen:_,openSettingsModal:y,closeSettingsModal:f}}const kf=3;function Rf(r,i,n){const g=r.indexOf(i),_=r.indexOf(n);if(g<0||_<0||g===_)return r;const k=[...r];k.splice(g,1);const R=k.indexOf(n);return k.splice(R,0,i),k}function Zw(){const r=Yf(),i=q.useRef(null),n=q.useRef(!1),[g,_]=q.useState(r.view),[k,R]=q.useState(r.workspaceMode),[a,d]=q.useState(Bv),[p,y]=q.useState(""),[f,S]=q.useState(null),[b,M]=q.useState(null),[w,c]=q.useState(!1),[u,l]=q.useState(!1),[h,v]=q.useState(null),{theme:C,handleToggleTheme:L}=Xw(),[T,E]=q.useState({}),N=q.useCallback((ae,me)=>{E(Ie=>Ie[ae]===me?Ie:{...Ie,[ae]:me})},[]);q.useEffect(()=>{const ae=window.visualViewport;if(!ae)return;let me=ae.height,Ie=!1;const Oe=document.documentElement,Sr=()=>{Ie?(me=ae.height,Ie=!1):ae.height>me&&(me=ae.height);const jr=me-ae.height>150;Oe.style.setProperty("--viewport-height",`${ae.height}px`),Oe.classList.toggle("keyboard-open",jr)},ii=()=>{Ie=!0,window.setTimeout(Sr,300)};return Sr(),ae.addEventListener("resize",Sr),window.addEventListener("orientationchange",ii),()=>{ae.removeEventListener("resize",Sr),window.removeEventListener("orientationchange",ii),Oe.classList.remove("keyboard-open")}},[]);const{isWorkspaceModalOpen:W,openWorkspaceModal:K,closeWorkspaceModal:I,isDeckModalOpen:B,openDeckModal:U,closeDeckModal:$,isSettingsModalOpen:V,openSettingsModal:X,closeSettingsModal:z}=Qw(),{workspaceStates:D,setWorkspaceStates:O,updateWorkspaceState:A,initializeWorkspaceStates:H}=Rw(),{deckStates:Q,setDeckStates:ne,updateDeckState:oe,initializeDeckStates:ue}=Mw(),{workspaces:Y,editorWorkspaceId:j,setEditorWorkspaceId:se,handleCreateWorkspace:re,handleDeleteWorkspace:ve}=Tw({setStatusMessage:y,defaultRoot:a,initializeWorkspaceStates:H,setWorkspaceStates:O}),{decks:_e,activeDeckIds:Re,setActiveDeckIds:Se,handleCreateDeck:$e,handleDeleteDeck:je,handleReorderDecks:xe,handleCreateTerminal:Xe,handleDeleteTerminal:ft,handleRemoveTerminalLocal:_t}=Dw({setStatusMessage:y,initializeDeckStates:ue,updateDeckState:oe,setDeckStates:ne,initialDeckIds:r.deckIds}),Ye=q.useMemo(()=>ra(),[]),Ge=q.useMemo(()=>ia(),[]),Ke=Y.find(ae=>ae.id===j)||null,Ft=j&&D[j]||Ye,{savingFileId:it,handleRefreshTree:ut,handleToggleDir:le,handleOpenFile:ce,handleFileChange:Ee,handleSaveFile:De,handleCloseFile:We,handleCreateFile:Ae,handleCreateDirectory:Wt,handleDeleteFile:ge,handleDeleteDirectory:ke}=Aw({editorWorkspaceId:j,activeWorkspaceState:Ft,updateWorkspaceState:A,setStatusMessage:y}),{gitState:Pe,refreshGitStatus:ze,handleSelectRepo:gt,handleStageFile:Ne,handleUnstageFile:Vt,handleStageAll:Je,handleUnstageAll:Kt,handleCommit:Ir,handleDiscardFile:Xi,handleShowDiff:Ji,handleCloseDiff:Qi,handlePush:Tn,handlePull:Bs,handleLoadBranches:Dn,handleCheckoutBranch:Mi,handleCreateBranch:Ps,handleLoadLogs:Ti}=Yw(j,y);Jw({view:g,editorWorkspaceId:j,activeDeckIds:Re,workspaceMode:k,setView:_,setEditorWorkspaceId:se,setActiveDeckIds:Se,setWorkspaceMode:R});const An=zv(),ei=q.useMemo(()=>new Map(Y.map(ae=>[ae.id,ae])),[Y]),ti=_e;q.useEffect(()=>{let ae=!0;return Wv().then(me=>{ae&&me!=null&&me.defaultRoot&&d(me.defaultRoot)}).catch(()=>{}),()=>{ae=!1}},[]),q.useEffect(()=>{if(p!==Of)return;const ae=setTimeout(()=>y(""),Nv);return()=>clearTimeout(ae)},[p]),q.useEffect(()=>{k==="editor"&&!j&&R("list")},[k,j]),q.useEffect(()=>{if(typeof window>"u")return;const ae=window.matchMedia("(pointer: fine) and (min-width: 721px)"),me=()=>l(ae.matches);return me(),ae.addEventListener("change",me),()=>ae.removeEventListener("change",me)},[]);const Jt=q.useCallback(()=>{S(null),M(null),c(!1)},[]),ri=q.useCallback(()=>{n.current=!0,window.setTimeout(()=>{n.current=!1},100)},[]);q.useEffect(()=>{u||Jt()},[u,Jt]);const Os=q.useRef(null);q.useEffect(()=>{if(k!=="editor"||!j){Os.current=null;return}Os.current!==j&&(Os.current=j,ut(),ze())},[k,j,ut,ze]);const ua=q.useCallback(()=>{if(Y.length===0){y(Pv);return}U()},[Y.length,U]),da=q.useCallback(async(ae,me)=>{if(!me){y(Ov);return}await $e(ae,me)&&$()},[$e,$]),Fr=q.useCallback(async ae=>{try{const me=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ae)});if(!me.ok){const Ie=await me.text();throw new Error(Ie||"Failed to save settings")}await me.json(),y("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(me){throw console.error("Failed to save settings:",me),me}},[]),Bn=q.useCallback(ae=>{se(ae),R("editor")},[se]),Pn=q.useCallback(()=>{R("list")},[]),fa=q.useCallback(async ae=>{await re(ae)&&I()},[re,I]),On=q.useCallback(ae=>{const me=Q[ae]||Ge;Xe(ae,me.terminals.length)},[Q,Ge,Xe]),Nn=q.useCallback(ae=>{const me=Q[ae]||Ge;Xe(ae,me.terminals.length,"claude","Claude Code")},[Q,Ge,Xe]),In=q.useCallback(ae=>{const me=Q[ae]||Ge;Xe(ae,me.terminals.length,"codex","Codex")},[Q,Ge,Xe]),Fn=q.useCallback((ae,me)=>{ft(ae,me)},[ft]),_a=q.useCallback((ae,me)=>{_t(ae,me)},[_t]),pa=q.useCallback(ae=>{if(n.current){n.current=!1;return}Se([ae])},[Se]),st=q.useCallback(ae=>{Se(me=>{const Ie=[...me.filter(Oe=>Oe!==ae),ae];return Ie.length<=kf?Ie:Ie.slice(Ie.length-kf)})},[Se]),va=q.useCallback(ae=>{Se(me=>{if(me.length<=1){const Ie=ti.find(Oe=>Oe.id!==ae);return Ie?[Ie.id]:me}return me.filter(Ie=>Ie!==ae)})},[ti,Se]),Ns=q.useCallback((ae,me)=>{ae.preventDefault(),ae.stopPropagation(),v({deckId:me,x:ae.clientX,y:ae.clientY})},[]),jn=q.useCallback(()=>{if(!h)return;const{deckId:ae}=h;v(null),window.confirm(`このデッキを完全に削除しますか?
177
+ ターミナルもすべて削除されます。`)&&je(ae)},[h,je]),Di=q.useCallback(()=>{v(null)},[]),ga=q.useCallback((ae,me)=>{if(!u){ae.preventDefault();return}ae.dataTransfer.effectAllowed="move",ae.dataTransfer.setData("text/plain",me),S(me),M(null),c(!1)},[u]),Hn=q.useCallback((ae,me)=>{!u||!f||f===me||(ae.preventDefault(),ae.dataTransfer.dropEffect="move",M(me),c(!1))},[u,f]),Zi=q.useCallback((ae,me)=>{ae.currentTarget.contains(ae.relatedTarget)||M(Ie=>Ie===me?null:Ie)},[]),ur=q.useCallback((ae,me)=>{if(!u)return;ae.preventDefault();const Ie=f||ae.dataTransfer.getData("text/plain");if(!Ie||Ie===me){Jt();return}xe(Oe=>{const Sr=Oe.map(si=>si.id),ii=Rf(Sr,Ie,me),jr=new Map(Oe.map(si=>[si.id,si]));return ii.map(si=>jr.get(si))}),Se(Oe=>Rf(Oe,Ie,me)),ri(),Jt()},[f,u,Jt,Se,ri,xe]),ma=q.useCallback(ae=>{!u||!f||(ae.preventDefault(),ae.dataTransfer.dropEffect="move",c(!0))},[u,f]),nr=q.useCallback(ae=>{ae.currentTarget.contains(ae.relatedTarget)||c(!1)},[]),ya=q.useCallback(ae=>{if(!u)return;ae.preventDefault();const me=f||ae.dataTransfer.getData("text/plain");if(!me){Jt();return}st(me),ri(),Jt()},[f,st,u,Jt,ri]),wa=q.useCallback(ae=>{j&&A(j,me=>({...me,activeFileId:ae}))},[j,A]),Sa=k==="editor"&&!!j,es=P.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[P.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[P.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90",onClick:K,children:"ワークスペース追加"}),P.jsx(n1,{workspaces:Y,selectedWorkspaceId:j,onSelect:Bn,onDelete:ve})]}),Sa&&P.jsx(hw,{activeWorkspace:Ke,defaultRoot:a,activeWorkspaceState:Ft,editorWorkspaceId:j,gitState:Pe,theme:C,savingFileId:it,onCloseWorkspaceEditor:Pn,onToggleDir:le,onOpenFile:ce,onRefreshTree:ut,onCreateFile:Ae,onCreateDirectory:Wt,onDeleteFile:ge,onDeleteDirectory:ke,onRefreshGit:ze,onSelectRepo:gt,onStageFile:Ne,onUnstageFile:Vt,onStageAll:Je,onUnstageAll:Kt,onCommit:Ir,onDiscardFile:Xi,onShowDiff:Ji,onCloseDiff:Qi,onPush:Tn,onPull:Bs,onLoadBranches:Dn,onCheckoutBranch:Mi,onCreateBranch:Ps,onLoadLogs:Ti,onSelectFile:wa,onCloseFile:We,onChangeFile:Ee,onSaveFile:De})]}),ts=P.jsxs("div",{className:"terminal-layout",children:[P.jsx("div",{className:"terminal-topbar",children:P.jsx("div",{className:"topbar-left",children:P.jsxs("div",{className:"deck-tabs",children:[ti.map(ae=>{var me,Ie;return P.jsxs("button",{type:"button",className:Ot("deck-tab",Re.includes(ae.id)&&"active",f===ae.id&&"is-dragging",b===ae.id&&"is-drag-over"),onClick:()=>pa(ae.id),onContextMenu:Oe=>Ns(Oe,ae.id),draggable:u,onDragStart:Oe=>ga(Oe,ae.id),onDragOver:Oe=>Hn(Oe,ae.id),onDragLeave:Oe=>Zi(Oe,ae.id),onDrop:Oe=>ur(Oe,ae.id),onDragEnd:Jt,title:u?`${((me=ei.get(ae.workspaceId))==null?void 0:me.path)||ae.root}
178
+ ドラッグで並び替え / メインにドロップで分割表示`:`${((Ie=ei.get(ae.workspaceId))==null?void 0:Ie.path)||ae.root}`,children:[P.jsx("span",{className:"deck-tab-name",children:ae.name}),P.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:Oe=>{Oe.stopPropagation(),va(ae.id)},children:"×"})]},ae.id)}),P.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:ua,title:"デッキ作成",children:"+"})]})})}),P.jsx("div",{className:Ot("terminal-split-container",w&&"is-drop-target"),ref:i,style:{gridTemplateColumns:`repeat(${Re.length}, minmax(0, 1fr))`},onDragOver:ma,onDragLeave:nr,onDrop:ya,children:Re.length===0?P.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):Re.map(ae=>{const me=_e.find(Oe=>Oe.id===ae),Ie=Q[ae]||Ge;return me?P.jsxs("div",{className:"deck-split-pane",children:[P.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[Re.length>1&&P.jsx("span",{className:"deck-pane-name flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:me.name}),Ie.terminals.length>0&&P.jsx("select",{className:"terminal-switcher",value:qf(Ie.terminals,Ie.activeTerminalId)??"",onChange:Oe=>oe(ae,Sr=>({...Sr,activeTerminalId:Oe.target.value})),"aria-label":"ターミナルを切り替え",children:Ie.terminals.map(Oe=>P.jsx("option",{value:Oe.id,children:T[Oe.id]||Oe.title},Oe.id))}),P.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[P.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>On(ae),title:"ターミナル追加",children:"+"}),P.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>Nn(ae),title:"Claude",children:"C"}),P.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>In(ae),title:"Codex",children:"X"})]})]}),P.jsx(i1,{terminals:Ie.terminals,wsBase:An,activeTerminalId:Ie.activeTerminalId??null,onDeleteTerminal:Oe=>Fn(ae,Oe),onExitTerminal:Oe=>_a(ae,Oe),onTerminalTitle:N})]},ae):null})})]}),Ai=P.jsx(bg,{wsBase:An});return P.jsxs("div",{className:"app","data-view":g,children:[P.jsx(Tv,{activeView:g,onSelect:_,theme:C,onToggleTheme:L,onOpenSettings:X}),P.jsxs("main",{className:"main",children:[g==="workspace"&&es,g==="terminal"&&ts,g==="browser"&&Ai]}),P.jsx(Dv,{message:p}),P.jsx(f1,{isOpen:W,defaultRoot:a,onSubmit:fa,onClose:I}),P.jsx(Mv,{isOpen:B,workspaces:Y,onSubmit:da,onClose:$}),P.jsx(kw,{isOpen:V,onClose:z,onSave:Fr}),h&&P.jsxs(P.Fragment,{children:[P.jsx("div",{className:"fixed inset-0 z-[999]",onClick:Di,onContextMenu:ae=>{ae.preventDefault(),Di()}}),P.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:h.x,top:h.y},children:P.jsx("button",{type:"button",className:"w-full text-left px-3 py-1.5 text-[13px] text-red-400 bg-transparent border-0 cursor-pointer hover:bg-list-hover",onClick:jn,children:"デッキを削除"})})]})]})}class eS extends q.Component{constructor(i){super(i),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(i){return{hasError:!0,error:i}}componentDidCatch(i,n){console.error("Application error:",i),console.error("Component stack:",n.componentStack)}render(){return this.state.hasError?P.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:P.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[P.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),P.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,P.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 bg-accent text-white border-0 rounded-[2px] font-medium cursor-pointer hover:opacity-90",children:"Reload Application"})]})}):this.props.children}}Rv.createRoot(document.getElementById("root")).render(P.jsx(qi.StrictMode,{children:P.jsx(eS,{children:P.jsx(Zw,{})})}));