hjworktree-cli 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.context-snapshots/context-snapshot-20260106-211500.md +85 -0
  2. package/README.md +18 -10
  3. package/dist/server/socketHandlers.d.ts.map +1 -1
  4. package/dist/server/socketHandlers.js +19 -18
  5. package/dist/server/socketHandlers.js.map +1 -1
  6. package/dist/shared/constants.d.ts +1 -3
  7. package/dist/shared/constants.d.ts.map +1 -1
  8. package/dist/shared/constants.js +1 -24
  9. package/dist/shared/constants.js.map +1 -1
  10. package/dist/shared/types/index.d.ts +3 -15
  11. package/dist/shared/types/index.d.ts.map +1 -1
  12. package/dist/shared/types/index.js +1 -1
  13. package/dist/shared/types/index.js.map +1 -1
  14. package/dist/web/assets/index-D-hASqdI.js +53 -0
  15. package/dist/web/assets/index-D-hASqdI.js.map +1 -0
  16. package/dist/web/assets/index-Dgl6wRHk.css +32 -0
  17. package/dist/web/index.html +2 -2
  18. package/package.json +1 -1
  19. package/server/socketHandlers.ts +24 -23
  20. package/shared/constants.ts +1 -27
  21. package/shared/types/index.ts +6 -21
  22. package/web/src/App.tsx +8 -6
  23. package/web/src/components/Layout/LeftNavBar.tsx +6 -17
  24. package/web/src/components/Modals/AddWorktreeModal.tsx +1 -21
  25. package/web/src/components/Steps/WorktreeStep.tsx +1 -8
  26. package/web/src/components/Terminal/SplitTerminalView.tsx +64 -0
  27. package/web/src/components/Terminal/TerminalPanel.tsx +3 -69
  28. package/web/src/components/Terminal/XTerminal.tsx +4 -6
  29. package/web/src/stores/useAppStore.ts +77 -35
  30. package/web/src/styles/global.css +127 -77
  31. package/dist/web/assets/index-CsixHL-D.css +0 -32
  32. package/dist/web/assets/index-De6xm4hO.js +0 -53
  33. package/dist/web/assets/index-De6xm4hO.js.map +0 -1
  34. package/web/src/components/Setup/AgentSelector.tsx +0 -27
  35. package/web/src/components/Steps/AgentStep.tsx +0 -20
@@ -1,53 +0,0 @@
1
- (function(){const d=document.createElement("link").relList;if(d&&d.supports&&d.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))E(M);new MutationObserver(M=>{for(const V of M)if(V.type==="childList")for(const H of V.addedNodes)H.tagName==="LINK"&&H.rel==="modulepreload"&&E(H)}).observe(document,{childList:!0,subtree:!0});function h(M){const V={};return M.integrity&&(V.integrity=M.integrity),M.referrerPolicy&&(V.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?V.credentials="include":M.crossOrigin==="anonymous"?V.credentials="omit":V.credentials="same-origin",V}function E(M){if(M.ep)return;M.ep=!0;const V=h(M);fetch(M.href,V)}})();function Ph(C){return C&&C.__esModule&&Object.prototype.hasOwnProperty.call(C,"default")?C.default:C}var ll={exports:{}},Ki={},al={exports:{}},ke={};/**
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 _h;function Vd(){if(_h)return ke;_h=1;var C=Symbol.for("react.element"),d=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),H=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),f=Symbol.iterator;function m(T){return T===null||typeof T!="object"?null:(T=f&&T[f]||T["@@iterator"],typeof T=="function"?T:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,g={};function o(T,P,Z){this.props=T,this.context=P,this.refs=g,this.updater=Z||y}o.prototype.isReactComponent={},o.prototype.setState=function(T,P){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,P,"setState")},o.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function a(){}a.prototype=o.prototype;function s(T,P,Z){this.props=T,this.context=P,this.refs=g,this.updater=Z||y}var n=s.prototype=new a;n.constructor=s,x(n,o.prototype),n.isPureReactComponent=!0;var _=Array.isArray,k=Object.prototype.hasOwnProperty,b={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function S(T,P,Z){var re,ce={},he=null,U=null;if(P!=null)for(re in P.ref!==void 0&&(U=P.ref),P.key!==void 0&&(he=""+P.key),P)k.call(P,re)&&!L.hasOwnProperty(re)&&(ce[re]=P[re]);var B=arguments.length-2;if(B===1)ce.children=Z;else if(1<B){for(var ee=Array(B),J=0;J<B;J++)ee[J]=arguments[J+2];ce.children=ee}if(T&&T.defaultProps)for(re in B=T.defaultProps,B)ce[re]===void 0&&(ce[re]=B[re]);return{$$typeof:C,type:T,key:he,ref:U,props:ce,_owner:b.current}}function A(T,P){return{$$typeof:C,type:T.type,key:P,ref:T.ref,props:T.props,_owner:T._owner}}function F(T){return typeof T=="object"&&T!==null&&T.$$typeof===C}function j(T){var P={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Z){return P[Z]})}var W=/\/+/g;function I(T,P){return typeof T=="object"&&T!==null&&T.key!=null?j(""+T.key):P.toString(36)}function Q(T,P,Z,re,ce){var he=typeof T;(he==="undefined"||he==="boolean")&&(T=null);var U=!1;if(T===null)U=!0;else switch(he){case"string":case"number":U=!0;break;case"object":switch(T.$$typeof){case C:case d:U=!0}}if(U)return U=T,ce=ce(U),T=re===""?"."+I(U,0):re,_(ce)?(Z="",T!=null&&(Z=T.replace(W,"$&/")+"/"),Q(ce,P,Z,"",function(J){return J})):ce!=null&&(F(ce)&&(ce=A(ce,Z+(!ce.key||U&&U.key===ce.key?"":(""+ce.key).replace(W,"$&/")+"/")+T)),P.push(ce)),1;if(U=0,re=re===""?".":re+":",_(T))for(var B=0;B<T.length;B++){he=T[B];var ee=re+I(he,B);U+=Q(he,P,Z,ee,ce)}else if(ee=m(T),typeof ee=="function")for(T=ee.call(T),B=0;!(he=T.next()).done;)he=he.value,ee=re+I(he,B++),U+=Q(he,P,Z,ee,ce);else if(he==="object")throw P=String(T),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.");return U}function te(T,P,Z){if(T==null)return T;var re=[],ce=0;return Q(T,re,"","",function(he){return P.call(Z,he,ce++)}),re}function ne(T){if(T._status===-1){var P=T._result;P=P(),P.then(function(Z){(T._status===0||T._status===-1)&&(T._status=1,T._result=Z)},function(Z){(T._status===0||T._status===-1)&&(T._status=2,T._result=Z)}),T._status===-1&&(T._status=0,T._result=P)}if(T._status===1)return T._result.default;throw T._result}var le={current:null},X={transition:null},R={ReactCurrentDispatcher:le,ReactCurrentBatchConfig:X,ReactCurrentOwner:b};function O(){throw Error("act(...) is not supported in production builds of React.")}return ke.Children={map:te,forEach:function(T,P,Z){te(T,function(){P.apply(this,arguments)},Z)},count:function(T){var P=0;return te(T,function(){P++}),P},toArray:function(T){return te(T,function(P){return P})||[]},only:function(T){if(!F(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},ke.Component=o,ke.Fragment=h,ke.Profiler=M,ke.PureComponent=s,ke.StrictMode=E,ke.Suspense=u,ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=R,ke.act=O,ke.cloneElement=function(T,P,Z){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var re=x({},T.props),ce=T.key,he=T.ref,U=T._owner;if(P!=null){if(P.ref!==void 0&&(he=P.ref,U=b.current),P.key!==void 0&&(ce=""+P.key),T.type&&T.type.defaultProps)var B=T.type.defaultProps;for(ee in P)k.call(P,ee)&&!L.hasOwnProperty(ee)&&(re[ee]=P[ee]===void 0&&B!==void 0?B[ee]:P[ee])}var ee=arguments.length-2;if(ee===1)re.children=Z;else if(1<ee){B=Array(ee);for(var J=0;J<ee;J++)B[J]=arguments[J+2];re.children=B}return{$$typeof:C,type:T.type,key:ce,ref:he,props:re,_owner:U}},ke.createContext=function(T){return T={$$typeof:H,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:V,_context:T},T.Consumer=T},ke.createElement=S,ke.createFactory=function(T){var P=S.bind(null,T);return P.type=T,P},ke.createRef=function(){return{current:null}},ke.forwardRef=function(T){return{$$typeof:l,render:T}},ke.isValidElement=F,ke.lazy=function(T){return{$$typeof:w,_payload:{_status:-1,_result:T},_init:ne}},ke.memo=function(T,P){return{$$typeof:v,type:T,compare:P===void 0?null:P}},ke.startTransition=function(T){var P=X.transition;X.transition={};try{T()}finally{X.transition=P}},ke.unstable_act=O,ke.useCallback=function(T,P){return le.current.useCallback(T,P)},ke.useContext=function(T){return le.current.useContext(T)},ke.useDebugValue=function(){},ke.useDeferredValue=function(T){return le.current.useDeferredValue(T)},ke.useEffect=function(T,P){return le.current.useEffect(T,P)},ke.useId=function(){return le.current.useId()},ke.useImperativeHandle=function(T,P,Z){return le.current.useImperativeHandle(T,P,Z)},ke.useInsertionEffect=function(T,P){return le.current.useInsertionEffect(T,P)},ke.useLayoutEffect=function(T,P){return le.current.useLayoutEffect(T,P)},ke.useMemo=function(T,P){return le.current.useMemo(T,P)},ke.useReducer=function(T,P,Z){return le.current.useReducer(T,P,Z)},ke.useRef=function(T){return le.current.useRef(T)},ke.useState=function(T){return le.current.useState(T)},ke.useSyncExternalStore=function(T,P,Z){return le.current.useSyncExternalStore(T,P,Z)},ke.useTransition=function(){return le.current.useTransition()},ke.version="18.3.1",ke}var vh;function kl(){return vh||(vh=1,al.exports=Vd()),al.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 mh;function Kd(){if(mh)return Ki;mh=1;var C=kl(),d=Symbol.for("react.element"),h=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,M=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,V={key:!0,ref:!0,__self:!0,__source:!0};function H(l,u,v){var w,f={},m=null,y=null;v!==void 0&&(m=""+v),u.key!==void 0&&(m=""+u.key),u.ref!==void 0&&(y=u.ref);for(w in u)E.call(u,w)&&!V.hasOwnProperty(w)&&(f[w]=u[w]);if(l&&l.defaultProps)for(w in u=l.defaultProps,u)f[w]===void 0&&(f[w]=u[w]);return{$$typeof:d,type:l,key:m,ref:y,props:f,_owner:M.current}}return Ki.Fragment=h,Ki.jsx=H,Ki.jsxs=H,Ki}var gh;function qd(){return gh||(gh=1,ll.exports=Kd()),ll.exports}var q=qd(),$e=kl();const Gi=Ph($e);var nn={},cl={exports:{}},ut={},hl={exports:{}},ul={};/**
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 Sh;function Gd(){return Sh||(Sh=1,(function(C){function d(X,R){var O=X.length;X.push(R);e:for(;0<O;){var T=O-1>>>1,P=X[T];if(0<M(P,R))X[T]=R,X[O]=P,O=T;else break e}}function h(X){return X.length===0?null:X[0]}function E(X){if(X.length===0)return null;var R=X[0],O=X.pop();if(O!==R){X[0]=O;e:for(var T=0,P=X.length,Z=P>>>1;T<Z;){var re=2*(T+1)-1,ce=X[re],he=re+1,U=X[he];if(0>M(ce,O))he<P&&0>M(U,ce)?(X[T]=U,X[he]=O,T=he):(X[T]=ce,X[re]=O,T=re);else if(he<P&&0>M(U,O))X[T]=U,X[he]=O,T=he;else break e}}return R}function M(X,R){var O=X.sortIndex-R.sortIndex;return O!==0?O:X.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var V=performance;C.unstable_now=function(){return V.now()}}else{var H=Date,l=H.now();C.unstable_now=function(){return H.now()-l}}var u=[],v=[],w=1,f=null,m=3,y=!1,x=!1,g=!1,o=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function n(X){for(var R=h(v);R!==null;){if(R.callback===null)E(v);else if(R.startTime<=X)E(v),R.sortIndex=R.expirationTime,d(u,R);else break;R=h(v)}}function _(X){if(g=!1,n(X),!x)if(h(u)!==null)x=!0,ne(k);else{var R=h(v);R!==null&&le(_,R.startTime-X)}}function k(X,R){x=!1,g&&(g=!1,a(S),S=-1),y=!0;var O=m;try{for(n(R),f=h(u);f!==null&&(!(f.expirationTime>R)||X&&!j());){var T=f.callback;if(typeof T=="function"){f.callback=null,m=f.priorityLevel;var P=T(f.expirationTime<=R);R=C.unstable_now(),typeof P=="function"?f.callback=P:f===h(u)&&E(u),n(R)}else E(u);f=h(u)}if(f!==null)var Z=!0;else{var re=h(v);re!==null&&le(_,re.startTime-R),Z=!1}return Z}finally{f=null,m=O,y=!1}}var b=!1,L=null,S=-1,A=5,F=-1;function j(){return!(C.unstable_now()-F<A)}function W(){if(L!==null){var X=C.unstable_now();F=X;var R=!0;try{R=L(!0,X)}finally{R?I():(b=!1,L=null)}}else b=!1}var I;if(typeof s=="function")I=function(){s(W)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,te=Q.port2;Q.port1.onmessage=W,I=function(){te.postMessage(null)}}else I=function(){o(W,0)};function ne(X){L=X,b||(b=!0,I())}function le(X,R){S=o(function(){X(C.unstable_now())},R)}C.unstable_IdlePriority=5,C.unstable_ImmediatePriority=1,C.unstable_LowPriority=4,C.unstable_NormalPriority=3,C.unstable_Profiling=null,C.unstable_UserBlockingPriority=2,C.unstable_cancelCallback=function(X){X.callback=null},C.unstable_continueExecution=function(){x||y||(x=!0,ne(k))},C.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<X?Math.floor(1e3/X):5},C.unstable_getCurrentPriorityLevel=function(){return m},C.unstable_getFirstCallbackNode=function(){return h(u)},C.unstable_next=function(X){switch(m){case 1:case 2:case 3:var R=3;break;default:R=m}var O=m;m=R;try{return X()}finally{m=O}},C.unstable_pauseExecution=function(){},C.unstable_requestPaint=function(){},C.unstable_runWithPriority=function(X,R){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var O=m;m=X;try{return R()}finally{m=O}},C.unstable_scheduleCallback=function(X,R,O){var T=C.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?T+O:T):O=T,X){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=O+P,X={id:w++,callback:R,priorityLevel:X,startTime:O,expirationTime:P,sortIndex:-1},O>T?(X.sortIndex=O,d(v,X),h(u)===null&&X===h(v)&&(g?(a(S),S=-1):g=!0,le(_,O-T))):(X.sortIndex=P,d(u,X),x||y||(x=!0,ne(k))),X},C.unstable_shouldYield=j,C.unstable_wrapCallback=function(X){var R=m;return function(){var O=m;m=R;try{return X.apply(this,arguments)}finally{m=O}}}})(ul)),ul}var yh;function Xd(){return yh||(yh=1,hl.exports=Gd()),hl.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 Ch;function Yd(){if(Ch)return ut;Ch=1;var C=kl(),d=Xd();function h(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var E=new Set,M={};function V(e,t){H(e,t),H(e+"Capture",t)}function H(e,t){for(M[e]=t,e=0;e<t.length;e++)E.add(t[e])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,v=/^[: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]*$/,w={},f={};function m(e){return u.call(f,e)?!0:u.call(w,e)?!1:v.test(e)?f[e]=!0:(w[e]=!0,!1)}function y(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x(e,t,r,i){if(t===null||typeof t>"u"||y(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,r,i,c,p,D){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=c,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=p,this.removeEmptyString=D}var o={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){o[e]=new g(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];o[t]=new g(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){o[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){o[e]=new g(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){o[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){o[e]=new g(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){o[e]=new g(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){o[e]=new g(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){o[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var a=/[\-:]([a-z])/g;function s(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(a,s);o[t]=new g(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(a,s);o[t]=new g(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(a,s);o[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){o[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){o[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function n(e,t,r,i){var c=o.hasOwnProperty(t)?o[t]:null;(c!==null?c.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(x(t,r,c,i)&&(r=null),i||c===null?m(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):c.mustUseProperty?e[c.propertyName]=r===null?c.type===3?!1:"":r:(t=c.attributeName,i=c.attributeNamespace,r===null?e.removeAttribute(t):(c=c.type,r=c===3||c===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var _=C.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),b=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),j=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),le=Symbol.for("react.offscreen"),X=Symbol.iterator;function R(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var O=Object.assign,T;function P(e){if(T===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);T=t&&t[1]||""}return`
34
- `+T+e}var Z=!1;function re(e,t){if(!e||Z)return"";Z=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(Y){var i=Y}Reflect.construct(e,[],t)}else{try{t.call()}catch(Y){i=Y}e.call(t.prototype)}else{try{throw Error()}catch(Y){i=Y}e()}}catch(Y){if(Y&&i&&typeof Y.stack=="string"){for(var c=Y.stack.split(`
35
- `),p=i.stack.split(`
36
- `),D=c.length-1,N=p.length-1;1<=D&&0<=N&&c[D]!==p[N];)N--;for(;1<=D&&0<=N;D--,N--)if(c[D]!==p[N]){if(D!==1||N!==1)do if(D--,N--,0>N||c[D]!==p[N]){var z=`
37
- `+c[D].replace(" at new "," at ");return e.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",e.displayName)),z}while(1<=D&&0<=N);break}}}finally{Z=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?P(e):""}function ce(e){switch(e.tag){case 5:return P(e.type);case 16:return P("Lazy");case 13:return P("Suspense");case 19:return P("SuspenseList");case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return""}}function he(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 L:return"Fragment";case b:return"Portal";case A:return"Profiler";case S:return"StrictMode";case I:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:return(e.displayName||"Context")+".Consumer";case F:return(e._context.displayName||"Context")+".Provider";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return t=e.displayName||null,t!==null?t:he(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}function U(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 he(t);case 8:return t===S?"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 B(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ee(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function J(e){var t=ee(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,p=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(D){i=""+D,p.call(this,D)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(D){i=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||(e._valueTracker=J(e))}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=ee(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ee(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 Re(e,t){var r=t.checked;return O({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Te(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=B(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Xe(e,t){t=t.checked,t!=null&&n(e,"checked",t,!1)}function ye(e,t){Xe(e,t);var r=B(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Er(e,t.type,r):t.hasOwnProperty("defaultValue")&&Er(e,t.type,B(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jt(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Er(e,t,r){(t!=="number"||Ee(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wt=Array.isArray;function Mt(e,t,r,i){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&i&&(e[r].defaultSelected=!0)}else{for(r=""+B(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Zt(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(h(91));return O({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rt(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(h(92));if(Wt(r)){if(1<r.length)throw Error(h(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:B(r)}}function er(e,t){var r=B(t.value),i=B(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function dt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tr(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 kr(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tr(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ft,br=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,c){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,c)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ft=ft||document.createElement("div"),ft.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ft.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function nt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var xt={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(xt).forEach(function(e){Ae.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),xt[t]=xt[e]})});function Yi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||xt.hasOwnProperty(e)&&xt[e]?(""+t).trim():t+"px"}function Al(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,c=Yi(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,c):e[r]=c}}var Yh=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 gn(e,t){if(t){if(Yh[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(h(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(h(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(h(61))}if(t.style!=null&&typeof t.style!="object")throw Error(h(62))}}function Sn(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 yn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Fr=null,jr=null;function Bl(e){if(e=Ai(e)){if(typeof wn!="function")throw Error(h(280));var t=e.stateNode;t&&(t=Ss(t),wn(e.stateNode,e.type,t))}}function Ol(e){Fr?jr?jr.push(e):jr=[e]:Fr=e}function Pl(){if(Fr){var e=Fr,t=jr;if(jr=Fr=null,Bl(e),t)for(e=0;e<t.length;e++)Bl(t[e])}}function Ml(e,t){return e(t)}function Il(){}var En=!1;function Nl(e,t,r){if(En)return e(t,r);En=!0;try{return Ml(e,t,r)}finally{En=!1,(Fr!==null||jr!==null)&&(Il(),Pl())}}function hi(e,t){var r=e.stateNode;if(r===null)return null;var i=Ss(r);if(i===null)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(h(231,t,typeof r));return r}var kn=!1;if(l)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){kn=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{kn=!1}function Qh(e,t,r,i,c,p,D,N,z){var Y=Array.prototype.slice.call(arguments,3);try{t.apply(r,Y)}catch(se){this.onError(se)}}var di=!1,Qi=null,Ji=!1,bn=null,Jh={onError:function(e){di=!0,Qi=e}};function Zh(e,t,r,i,c,p,D,N,z){di=!1,Qi=null,Qh.apply(Jh,arguments)}function eu(e,t,r,i,c,p,D,N,z){if(Zh.apply(this,arguments),di){if(di){var Y=Qi;di=!1,Qi=null}else throw Error(h(198));Ji||(Ji=!0,bn=Y)}}function xr(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Hl(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 Fl(e){if(xr(e)!==e)throw Error(h(188))}function tu(e){var t=e.alternate;if(!t){if(t=xr(e),t===null)throw Error(h(188));return t!==e?null:e}for(var r=e,i=t;;){var c=r.return;if(c===null)break;var p=c.alternate;if(p===null){if(i=c.return,i!==null){r=i;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===r)return Fl(c),e;if(p===i)return Fl(c),t;p=p.sibling}throw Error(h(188))}if(r.return!==i.return)r=c,i=p;else{for(var D=!1,N=c.child;N;){if(N===r){D=!0,r=c,i=p;break}if(N===i){D=!0,i=c,r=p;break}N=N.sibling}if(!D){for(N=p.child;N;){if(N===r){D=!0,r=p,i=c;break}if(N===i){D=!0,i=p,r=c;break}N=N.sibling}if(!D)throw Error(h(189))}}if(r.alternate!==i)throw Error(h(190))}if(r.tag!==3)throw Error(h(188));return r.stateNode.current===r?e:t}function jl(e){return e=tu(e),e!==null?zl(e):null}function zl(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=zl(e);if(t!==null)return t;e=e.sibling}return null}var Ul=d.unstable_scheduleCallback,Wl=d.unstable_cancelCallback,ru=d.unstable_shouldYield,iu=d.unstable_requestPaint,He=d.unstable_now,su=d.unstable_getCurrentPriorityLevel,xn=d.unstable_ImmediatePriority,$l=d.unstable_UserBlockingPriority,Zi=d.unstable_NormalPriority,nu=d.unstable_LowPriority,Vl=d.unstable_IdlePriority,es=null,It=null;function ou(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(es,e,void 0,(e.current.flags&128)===128)}catch{}}var Lt=Math.clz32?Math.clz32:cu,lu=Math.log,au=Math.LN2;function cu(e){return e>>>=0,e===0?32:31-(lu(e)/au|0)|0}var ts=64,rs=4194304;function fi(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 is(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,c=e.suspendedLanes,p=e.pingedLanes,D=r&268435455;if(D!==0){var N=D&~c;N!==0?i=fi(N):(p&=D,p!==0&&(i=fi(p)))}else D=r&~c,D!==0?i=fi(D):p!==0&&(i=fi(p));if(i===0)return 0;if(t!==0&&t!==i&&(t&c)===0&&(c=i&-i,p=t&-t,c>=p||c===16&&(p&4194240)!==0))return t;if((i&4)!==0&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-Lt(t),c=1<<r,i|=e[r],t&=~c;return i}function hu(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 uu(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,p=e.pendingLanes;0<p;){var D=31-Lt(p),N=1<<D,z=c[D];z===-1?((N&r)===0||(N&i)!==0)&&(c[D]=hu(N,t)):z<=t&&(e.expiredLanes|=N),p&=~N}}function Ln(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Kl(){var e=ts;return ts<<=1,(ts&4194240)===0&&(ts=64),e}function Rn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function pi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lt(t),e[t]=r}function du(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var c=31-Lt(r),p=1<<c;t[c]=0,i[c]=-1,e[c]=-1,r&=~p}}function Dn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Lt(r),c=1<<i;c&t|e[i]&t&&(e[i]|=t),r&=~c}}var Le=0;function ql(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Gl,Tn,Xl,Yl,Ql,An=!1,ss=[],rr=null,ir=null,sr=null,_i=new Map,vi=new Map,nr=[],fu="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 Jl(e,t){switch(e){case"focusin":case"focusout":rr=null;break;case"dragenter":case"dragleave":ir=null;break;case"mouseover":case"mouseout":sr=null;break;case"pointerover":case"pointerout":_i.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(t.pointerId)}}function mi(e,t,r,i,c,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:p,targetContainers:[c]},t!==null&&(t=Ai(t),t!==null&&Tn(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function pu(e,t,r,i,c){switch(t){case"focusin":return rr=mi(rr,e,t,r,i,c),!0;case"dragenter":return ir=mi(ir,e,t,r,i,c),!0;case"mouseover":return sr=mi(sr,e,t,r,i,c),!0;case"pointerover":var p=c.pointerId;return _i.set(p,mi(_i.get(p)||null,e,t,r,i,c)),!0;case"gotpointercapture":return p=c.pointerId,vi.set(p,mi(vi.get(p)||null,e,t,r,i,c)),!0}return!1}function Zl(e){var t=Lr(e.target);if(t!==null){var r=xr(t);if(r!==null){if(t=r.tag,t===13){if(t=Hl(r),t!==null){e.blockedOn=t,Ql(e.priority,function(){Xl(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ns(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=On(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);yn=i,r.target.dispatchEvent(i),yn=null}else return t=Ai(r),t!==null&&Tn(t),e.blockedOn=r,!1;t.shift()}return!0}function ea(e,t,r){ns(e)&&r.delete(t)}function _u(){An=!1,rr!==null&&ns(rr)&&(rr=null),ir!==null&&ns(ir)&&(ir=null),sr!==null&&ns(sr)&&(sr=null),_i.forEach(ea),vi.forEach(ea)}function gi(e,t){e.blockedOn===t&&(e.blockedOn=null,An||(An=!0,d.unstable_scheduleCallback(d.unstable_NormalPriority,_u)))}function Si(e){function t(c){return gi(c,e)}if(0<ss.length){gi(ss[0],e);for(var r=1;r<ss.length;r++){var i=ss[r];i.blockedOn===e&&(i.blockedOn=null)}}for(rr!==null&&gi(rr,e),ir!==null&&gi(ir,e),sr!==null&&gi(sr,e),_i.forEach(t),vi.forEach(t),r=0;r<nr.length;r++)i=nr[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<nr.length&&(r=nr[0],r.blockedOn===null);)Zl(r),r.blockedOn===null&&nr.shift()}var zr=_.ReactCurrentBatchConfig,os=!0;function vu(e,t,r,i){var c=Le,p=zr.transition;zr.transition=null;try{Le=1,Bn(e,t,r,i)}finally{Le=c,zr.transition=p}}function mu(e,t,r,i){var c=Le,p=zr.transition;zr.transition=null;try{Le=4,Bn(e,t,r,i)}finally{Le=c,zr.transition=p}}function Bn(e,t,r,i){if(os){var c=On(e,t,r,i);if(c===null)Yn(e,t,i,ls,r),Jl(e,i);else if(pu(c,e,t,r,i))i.stopPropagation();else if(Jl(e,i),t&4&&-1<fu.indexOf(e)){for(;c!==null;){var p=Ai(c);if(p!==null&&Gl(p),p=On(e,t,r,i),p===null&&Yn(e,t,i,ls,r),p===c)break;c=p}c!==null&&i.stopPropagation()}else Yn(e,t,i,null,r)}}var ls=null;function On(e,t,r,i){if(ls=null,e=Cn(i),e=Lr(e),e!==null)if(t=xr(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Hl(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ls=e,null}function ta(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(su()){case xn:return 1;case $l:return 4;case Zi:case nu:return 16;case Vl:return 536870912;default:return 16}default:return 16}}var or=null,Pn=null,as=null;function ra(){if(as)return as;var e,t=Pn,r=t.length,i,c="value"in or?or.value:or.textContent,p=c.length;for(e=0;e<r&&t[e]===c[e];e++);var D=r-e;for(i=1;i<=D&&t[r-i]===c[p-i];i++);return as=c.slice(e,1<i?1-i:void 0)}function cs(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 hs(){return!0}function ia(){return!1}function pt(e){function t(r,i,c,p,D){this._reactName=r,this._targetInst=c,this.type=i,this.nativeEvent=p,this.target=D,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(r=e[N],this[N]=r?r(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?hs:ia,this.isPropagationStopped=ia,this}return O(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=hs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=pt(Ur),yi=O({},Ur,{view:0,detail:0}),gu=pt(yi),In,Nn,Ci,us=O({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,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!==Ci&&(Ci&&e.type==="mousemove"?(In=e.screenX-Ci.screenX,Nn=e.screenY-Ci.screenY):Nn=In=0,Ci=e),In)},movementY:function(e){return"movementY"in e?e.movementY:Nn}}),sa=pt(us),Su=O({},us,{dataTransfer:0}),yu=pt(Su),Cu=O({},yi,{relatedTarget:0}),Hn=pt(Cu),wu=O({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Eu=pt(wu),ku=O({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bu=pt(ku),xu=O({},Ur,{data:0}),na=pt(xu),Lu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ru={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"},Du={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tu(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Du[e])?!!t[e]:!1}function Fn(){return Tu}var Au=O({},yi,{key:function(e){if(e.key){var t=Lu[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ru[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type==="keypress"?cs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Bu=pt(Au),Ou=O({},us,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),oa=pt(Ou),Pu=O({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn}),Mu=pt(Pu),Iu=O({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nu=pt(Iu),Hu=O({},us,{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}),Fu=pt(Hu),ju=[9,13,27,32],jn=l&&"CompositionEvent"in window,wi=null;l&&"documentMode"in document&&(wi=document.documentMode);var zu=l&&"TextEvent"in window&&!wi,la=l&&(!jn||wi&&8<wi&&11>=wi),aa=" ",ca=!1;function ha(e,t){switch(e){case"keyup":return ju.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ua(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wr=!1;function Uu(e,t){switch(e){case"compositionend":return ua(t);case"keypress":return t.which!==32?null:(ca=!0,aa);case"textInput":return e=t.data,e===aa&&ca?null:e;default:return null}}function Wu(e,t){if(Wr)return e==="compositionend"||!jn&&ha(e,t)?(e=ra(),as=Pn=or=null,Wr=!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 la&&t.locale!=="ko"?null:t.data;default:return null}}var $u={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 da(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$u[e.type]:t==="textarea"}function fa(e,t,r,i){Ol(i),t=vs(t,"onChange"),0<t.length&&(r=new Mn("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Ei=null,ki=null;function Vu(e){Aa(e,0)}function ds(e){var t=Gr(e);if(ue(t))return e}function Ku(e,t){if(e==="change")return t}var pa=!1;if(l){var zn;if(l){var Un="oninput"in document;if(!Un){var _a=document.createElement("div");_a.setAttribute("oninput","return;"),Un=typeof _a.oninput=="function"}zn=Un}else zn=!1;pa=zn&&(!document.documentMode||9<document.documentMode)}function va(){Ei&&(Ei.detachEvent("onpropertychange",ma),ki=Ei=null)}function ma(e){if(e.propertyName==="value"&&ds(ki)){var t=[];fa(t,ki,e,Cn(e)),Nl(Vu,t)}}function qu(e,t,r){e==="focusin"?(va(),Ei=t,ki=r,Ei.attachEvent("onpropertychange",ma)):e==="focusout"&&va()}function Gu(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(ki)}function Xu(e,t){if(e==="click")return ds(t)}function Yu(e,t){if(e==="input"||e==="change")return ds(t)}function Qu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Rt=typeof Object.is=="function"?Object.is:Qu;function bi(e,t){if(Rt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var c=r[i];if(!u.call(t,c)||!Rt(e[c],t[c]))return!1}return!0}function ga(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sa(e,t){var r=ga(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ga(r)}}function ya(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ya(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ca(){for(var e=window,t=Ee();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ee(e.document)}return t}function Wn(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 Ju(e){var t=Ca(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ya(r.ownerDocument.documentElement,r)){if(i!==null&&Wn(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var c=r.textContent.length,p=Math.min(i.start,c);i=i.end===void 0?p:Math.min(i.end,c),!e.extend&&p>i&&(c=i,i=p,p=c),c=Sa(r,p);var D=Sa(r,i);c&&D&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==D.node||e.focusOffset!==D.offset)&&(t=t.createRange(),t.setStart(c.node,c.offset),e.removeAllRanges(),p>i?(e.addRange(t),e.extend(D.node,D.offset)):(t.setEnd(D.node,D.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zu=l&&"documentMode"in document&&11>=document.documentMode,$r=null,$n=null,xi=null,Vn=!1;function wa(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Vn||$r==null||$r!==Ee(i)||(i=$r,"selectionStart"in i&&Wn(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xi&&bi(xi,i)||(xi=i,i=vs($n,"onSelect"),0<i.length&&(t=new Mn("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=$r)))}function fs(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Vr={animationend:fs("Animation","AnimationEnd"),animationiteration:fs("Animation","AnimationIteration"),animationstart:fs("Animation","AnimationStart"),transitionend:fs("Transition","TransitionEnd")},Kn={},Ea={};l&&(Ea=document.createElement("div").style,"AnimationEvent"in window||(delete Vr.animationend.animation,delete Vr.animationiteration.animation,delete Vr.animationstart.animation),"TransitionEvent"in window||delete Vr.transitionend.transition);function ps(e){if(Kn[e])return Kn[e];if(!Vr[e])return e;var t=Vr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Ea)return Kn[e]=t[r];return e}var ka=ps("animationend"),ba=ps("animationiteration"),xa=ps("animationstart"),La=ps("transitionend"),Ra=new Map,Da="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 lr(e,t){Ra.set(e,t),V(t,[e])}for(var qn=0;qn<Da.length;qn++){var Gn=Da[qn],ed=Gn.toLowerCase(),td=Gn[0].toUpperCase()+Gn.slice(1);lr(ed,"on"+td)}lr(ka,"onAnimationEnd"),lr(ba,"onAnimationIteration"),lr(xa,"onAnimationStart"),lr("dblclick","onDoubleClick"),lr("focusin","onFocus"),lr("focusout","onBlur"),lr(La,"onTransitionEnd"),H("onMouseEnter",["mouseout","mouseover"]),H("onMouseLeave",["mouseout","mouseover"]),H("onPointerEnter",["pointerout","pointerover"]),H("onPointerLeave",["pointerout","pointerover"]),V("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),V("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),V("onBeforeInput",["compositionend","keypress","textInput","paste"]),V("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),V("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),V("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Li="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(" "),rd=new Set("cancel close invalid load scroll toggle".split(" ").concat(Li));function Ta(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,eu(i,t,void 0,e),e.currentTarget=null}function Aa(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],c=i.event;i=i.listeners;e:{var p=void 0;if(t)for(var D=i.length-1;0<=D;D--){var N=i[D],z=N.instance,Y=N.currentTarget;if(N=N.listener,z!==p&&c.isPropagationStopped())break e;Ta(c,N,Y),p=z}else for(D=0;D<i.length;D++){if(N=i[D],z=N.instance,Y=N.currentTarget,N=N.listener,z!==p&&c.isPropagationStopped())break e;Ta(c,N,Y),p=z}}}if(Ji)throw e=bn,Ji=!1,bn=null,e}function Be(e,t){var r=t[ro];r===void 0&&(r=t[ro]=new Set);var i=e+"__bubble";r.has(i)||(Ba(t,e,2,!1),r.add(i))}function Xn(e,t,r){var i=0;t&&(i|=4),Ba(r,e,i,t)}var _s="_reactListening"+Math.random().toString(36).slice(2);function Ri(e){if(!e[_s]){e[_s]=!0,E.forEach(function(r){r!=="selectionchange"&&(rd.has(r)||Xn(r,!1,e),Xn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_s]||(t[_s]=!0,Xn("selectionchange",!1,t))}}function Ba(e,t,r,i){switch(ta(t)){case 1:var c=vu;break;case 4:c=mu;break;default:c=Bn}r=c.bind(null,t,r,e),c=void 0,!kn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function Yn(e,t,r,i,c){var p=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var D=i.tag;if(D===3||D===4){var N=i.stateNode.containerInfo;if(N===c||N.nodeType===8&&N.parentNode===c)break;if(D===4)for(D=i.return;D!==null;){var z=D.tag;if((z===3||z===4)&&(z=D.stateNode.containerInfo,z===c||z.nodeType===8&&z.parentNode===c))return;D=D.return}for(;N!==null;){if(D=Lr(N),D===null)return;if(z=D.tag,z===5||z===6){i=p=D;continue e}N=N.parentNode}}i=i.return}Nl(function(){var Y=p,se=Cn(r),oe=[];e:{var ie=Ra.get(e);if(ie!==void 0){var fe=Mn,_e=e;switch(e){case"keypress":if(cs(r)===0)break e;case"keydown":case"keyup":fe=Bu;break;case"focusin":_e="focus",fe=Hn;break;case"focusout":_e="blur",fe=Hn;break;case"beforeblur":case"afterblur":fe=Hn;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=sa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=yu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Mu;break;case ka:case ba:case xa:fe=Eu;break;case La:fe=Nu;break;case"scroll":fe=gu;break;case"wheel":fe=Fu;break;case"copy":case"cut":case"paste":fe=bu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=oa}var ve=(t&4)!==0,Fe=!ve&&e==="scroll",K=ve?ie!==null?ie+"Capture":null:ie;ve=[];for(var $=Y,G;$!==null;){G=$;var ae=G.stateNode;if(G.tag===5&&ae!==null&&(G=ae,K!==null&&(ae=hi($,K),ae!=null&&ve.push(Di($,ae,G)))),Fe)break;$=$.return}0<ve.length&&(ie=new fe(ie,_e,null,r,se),oe.push({event:ie,listeners:ve}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",ie&&r!==yn&&(_e=r.relatedTarget||r.fromElement)&&(Lr(_e)||_e[$t]))break e;if((fe||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,fe?(_e=r.relatedTarget||r.toElement,fe=Y,_e=_e?Lr(_e):null,_e!==null&&(Fe=xr(_e),_e!==Fe||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(fe=null,_e=Y),fe!==_e)){if(ve=sa,ae="onMouseLeave",K="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(ve=oa,ae="onPointerLeave",K="onPointerEnter",$="pointer"),Fe=fe==null?ie:Gr(fe),G=_e==null?ie:Gr(_e),ie=new ve(ae,$+"leave",fe,r,se),ie.target=Fe,ie.relatedTarget=G,ae=null,Lr(se)===Y&&(ve=new ve(K,$+"enter",_e,r,se),ve.target=G,ve.relatedTarget=Fe,ae=ve),Fe=ae,fe&&_e)t:{for(ve=fe,K=_e,$=0,G=ve;G;G=Kr(G))$++;for(G=0,ae=K;ae;ae=Kr(ae))G++;for(;0<$-G;)ve=Kr(ve),$--;for(;0<G-$;)K=Kr(K),G--;for(;$--;){if(ve===K||K!==null&&ve===K.alternate)break t;ve=Kr(ve),K=Kr(K)}ve=null}else ve=null;fe!==null&&Oa(oe,ie,fe,ve,!1),_e!==null&&Fe!==null&&Oa(oe,Fe,_e,ve,!0)}}e:{if(ie=Y?Gr(Y):window,fe=ie.nodeName&&ie.nodeName.toLowerCase(),fe==="select"||fe==="input"&&ie.type==="file")var me=Ku;else if(da(ie))if(pa)me=Yu;else{me=Gu;var ge=qu}else(fe=ie.nodeName)&&fe.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(me=Xu);if(me&&(me=me(e,Y))){fa(oe,me,r,se);break e}ge&&ge(e,ie,Y),e==="focusout"&&(ge=ie._wrapperState)&&ge.controlled&&ie.type==="number"&&Er(ie,"number",ie.value)}switch(ge=Y?Gr(Y):window,e){case"focusin":(da(ge)||ge.contentEditable==="true")&&($r=ge,$n=Y,xi=null);break;case"focusout":xi=$n=$r=null;break;case"mousedown":Vn=!0;break;case"contextmenu":case"mouseup":case"dragend":Vn=!1,wa(oe,r,se);break;case"selectionchange":if(Zu)break;case"keydown":case"keyup":wa(oe,r,se)}var Se;if(jn)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Wr?ha(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&(la&&r.locale!=="ko"&&(Wr||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Wr&&(Se=ra()):(or=se,Pn="value"in or?or.value:or.textContent,Wr=!0)),ge=vs(Y,Ce),0<ge.length&&(Ce=new na(Ce,e,null,r,se),oe.push({event:Ce,listeners:ge}),Se?Ce.data=Se:(Se=ua(r),Se!==null&&(Ce.data=Se)))),(Se=zu?Uu(e,r):Wu(e,r))&&(Y=vs(Y,"onBeforeInput"),0<Y.length&&(se=new na("onBeforeInput","beforeinput",null,r,se),oe.push({event:se,listeners:Y}),se.data=Se))}Aa(oe,t)})}function Di(e,t,r){return{instance:e,listener:t,currentTarget:r}}function vs(e,t){for(var r=t+"Capture",i=[];e!==null;){var c=e,p=c.stateNode;c.tag===5&&p!==null&&(c=p,p=hi(e,r),p!=null&&i.unshift(Di(e,p,c)),p=hi(e,t),p!=null&&i.push(Di(e,p,c))),e=e.return}return i}function Kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Oa(e,t,r,i,c){for(var p=t._reactName,D=[];r!==null&&r!==i;){var N=r,z=N.alternate,Y=N.stateNode;if(z!==null&&z===i)break;N.tag===5&&Y!==null&&(N=Y,c?(z=hi(r,p),z!=null&&D.unshift(Di(r,z,N))):c||(z=hi(r,p),z!=null&&D.push(Di(r,z,N)))),r=r.return}D.length!==0&&e.push({event:t,listeners:D})}var id=/\r\n?/g,sd=/\u0000|\uFFFD/g;function Pa(e){return(typeof e=="string"?e:""+e).replace(id,`
38
- `).replace(sd,"")}function ms(e,t,r){if(t=Pa(t),Pa(e)!==t&&r)throw Error(h(425))}function gs(){}var Qn=null,Jn=null;function Zn(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 eo=typeof setTimeout=="function"?setTimeout:void 0,nd=typeof clearTimeout=="function"?clearTimeout:void 0,Ma=typeof Promise=="function"?Promise:void 0,od=typeof queueMicrotask=="function"?queueMicrotask:typeof Ma<"u"?function(e){return Ma.resolve(null).then(e).catch(ld)}:eo;function ld(e){setTimeout(function(){throw e})}function to(e,t){var r=t,i=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"){if(i===0){e.removeChild(c),Si(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=c}while(r);Si(t)}function ar(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 Ia(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var qr=Math.random().toString(36).slice(2),Nt="__reactFiber$"+qr,Ti="__reactProps$"+qr,$t="__reactContainer$"+qr,ro="__reactEvents$"+qr,ad="__reactListeners$"+qr,cd="__reactHandles$"+qr;function Lr(e){var t=e[Nt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[$t]||r[Nt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Ia(e);e!==null;){if(r=e[Nt])return r;e=Ia(e)}return t}e=r,r=e.parentNode}return null}function Ai(e){return e=e[Nt]||e[$t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Gr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(h(33))}function Ss(e){return e[Ti]||null}var io=[],Xr=-1;function cr(e){return{current:e}}function Oe(e){0>Xr||(e.current=io[Xr],io[Xr]=null,Xr--)}function De(e,t){Xr++,io[Xr]=e.current,e.current=t}var hr={},Je=cr(hr),ot=cr(!1),Rr=hr;function Yr(e,t){var r=e.type.contextTypes;if(!r)return hr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var c={},p;for(p in r)c[p]=t[p];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=c),c}function lt(e){return e=e.childContextTypes,e!=null}function ys(){Oe(ot),Oe(Je)}function Na(e,t,r){if(Je.current!==hr)throw Error(h(168));De(Je,t),De(ot,r)}function Ha(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var c in i)if(!(c in t))throw Error(h(108,U(e)||"Unknown",c));return O({},r,i)}function Cs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hr,Rr=Je.current,De(Je,e),De(ot,ot.current),!0}function Fa(e,t,r){var i=e.stateNode;if(!i)throw Error(h(169));r?(e=Ha(e,t,Rr),i.__reactInternalMemoizedMergedChildContext=e,Oe(ot),Oe(Je),De(Je,e)):Oe(ot),De(ot,r)}var Vt=null,ws=!1,so=!1;function ja(e){Vt===null?Vt=[e]:Vt.push(e)}function hd(e){ws=!0,ja(e)}function ur(){if(!so&&Vt!==null){so=!0;var e=0,t=Le;try{var r=Vt;for(Le=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Vt=null,ws=!1}catch(c){throw Vt!==null&&(Vt=Vt.slice(e+1)),Ul(xn,ur),c}finally{Le=t,so=!1}}return null}var Qr=[],Jr=0,Es=null,ks=0,gt=[],St=0,Dr=null,Kt=1,qt="";function Tr(e,t){Qr[Jr++]=ks,Qr[Jr++]=Es,Es=e,ks=t}function za(e,t,r){gt[St++]=Kt,gt[St++]=qt,gt[St++]=Dr,Dr=e;var i=Kt;e=qt;var c=32-Lt(i)-1;i&=~(1<<c),r+=1;var p=32-Lt(t)+c;if(30<p){var D=c-c%5;p=(i&(1<<D)-1).toString(32),i>>=D,c-=D,Kt=1<<32-Lt(t)+c|r<<c|i,qt=p+e}else Kt=1<<p|r<<c|i,qt=e}function no(e){e.return!==null&&(Tr(e,1),za(e,1,0))}function oo(e){for(;e===Es;)Es=Qr[--Jr],Qr[Jr]=null,ks=Qr[--Jr],Qr[Jr]=null;for(;e===Dr;)Dr=gt[--St],gt[St]=null,qt=gt[--St],gt[St]=null,Kt=gt[--St],gt[St]=null}var _t=null,vt=null,Pe=!1,Dt=null;function Ua(e,t){var r=Et(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Wa(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_t=e,vt=ar(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_t=e,vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Dr!==null?{id:Kt,overflow:qt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Et(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,_t=e,vt=null,!0):!1;default:return!1}}function lo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ao(e){if(Pe){var t=vt;if(t){var r=t;if(!Wa(e,t)){if(lo(e))throw Error(h(418));t=ar(r.nextSibling);var i=_t;t&&Wa(e,t)?Ua(i,r):(e.flags=e.flags&-4097|2,Pe=!1,_t=e)}}else{if(lo(e))throw Error(h(418));e.flags=e.flags&-4097|2,Pe=!1,_t=e}}}function $a(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_t=e}function bs(e){if(e!==_t)return!1;if(!Pe)return $a(e),Pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Zn(e.type,e.memoizedProps)),t&&(t=vt)){if(lo(e))throw Va(),Error(h(418));for(;t;)Ua(e,t),t=ar(t.nextSibling)}if($a(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(h(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){vt=ar(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}vt=null}}else vt=_t?ar(e.stateNode.nextSibling):null;return!0}function Va(){for(var e=vt;e;)e=ar(e.nextSibling)}function Zr(){vt=_t=null,Pe=!1}function co(e){Dt===null?Dt=[e]:Dt.push(e)}var ud=_.ReactCurrentBatchConfig;function Bi(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(h(309));var i=r.stateNode}if(!i)throw Error(h(147,e));var c=i,p=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===p?t.ref:(t=function(D){var N=c.refs;D===null?delete N[p]:N[p]=D},t._stringRef=p,t)}if(typeof e!="string")throw Error(h(284));if(!r._owner)throw Error(h(290,e))}return e}function xs(e,t){throw e=Object.prototype.toString.call(t),Error(h(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ka(e){var t=e._init;return t(e._payload)}function qa(e){function t(K,$){if(e){var G=K.deletions;G===null?(K.deletions=[$],K.flags|=16):G.push($)}}function r(K,$){if(!e)return null;for(;$!==null;)t(K,$),$=$.sibling;return null}function i(K,$){for(K=new Map;$!==null;)$.key!==null?K.set($.key,$):K.set($.index,$),$=$.sibling;return K}function c(K,$){return K=Sr(K,$),K.index=0,K.sibling=null,K}function p(K,$,G){return K.index=G,e?(G=K.alternate,G!==null?(G=G.index,G<$?(K.flags|=2,$):G):(K.flags|=2,$)):(K.flags|=1048576,$)}function D(K){return e&&K.alternate===null&&(K.flags|=2),K}function N(K,$,G,ae){return $===null||$.tag!==6?($=tl(G,K.mode,ae),$.return=K,$):($=c($,G),$.return=K,$)}function z(K,$,G,ae){var me=G.type;return me===L?se(K,$,G.props.children,ae,G.key):$!==null&&($.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ne&&Ka(me)===$.type)?(ae=c($,G.props),ae.ref=Bi(K,$,G),ae.return=K,ae):(ae=Ys(G.type,G.key,G.props,null,K.mode,ae),ae.ref=Bi(K,$,G),ae.return=K,ae)}function Y(K,$,G,ae){return $===null||$.tag!==4||$.stateNode.containerInfo!==G.containerInfo||$.stateNode.implementation!==G.implementation?($=rl(G,K.mode,ae),$.return=K,$):($=c($,G.children||[]),$.return=K,$)}function se(K,$,G,ae,me){return $===null||$.tag!==7?($=Hr(G,K.mode,ae,me),$.return=K,$):($=c($,G),$.return=K,$)}function oe(K,$,G){if(typeof $=="string"&&$!==""||typeof $=="number")return $=tl(""+$,K.mode,G),$.return=K,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case k:return G=Ys($.type,$.key,$.props,null,K.mode,G),G.ref=Bi(K,null,$),G.return=K,G;case b:return $=rl($,K.mode,G),$.return=K,$;case ne:var ae=$._init;return oe(K,ae($._payload),G)}if(Wt($)||R($))return $=Hr($,K.mode,G,null),$.return=K,$;xs(K,$)}return null}function ie(K,$,G,ae){var me=$!==null?$.key:null;if(typeof G=="string"&&G!==""||typeof G=="number")return me!==null?null:N(K,$,""+G,ae);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case k:return G.key===me?z(K,$,G,ae):null;case b:return G.key===me?Y(K,$,G,ae):null;case ne:return me=G._init,ie(K,$,me(G._payload),ae)}if(Wt(G)||R(G))return me!==null?null:se(K,$,G,ae,null);xs(K,G)}return null}function fe(K,$,G,ae,me){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return K=K.get(G)||null,N($,K,""+ae,me);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case k:return K=K.get(ae.key===null?G:ae.key)||null,z($,K,ae,me);case b:return K=K.get(ae.key===null?G:ae.key)||null,Y($,K,ae,me);case ne:var ge=ae._init;return fe(K,$,G,ge(ae._payload),me)}if(Wt(ae)||R(ae))return K=K.get(G)||null,se($,K,ae,me,null);xs($,ae)}return null}function _e(K,$,G,ae){for(var me=null,ge=null,Se=$,Ce=$=0,Ge=null;Se!==null&&Ce<G.length;Ce++){Se.index>Ce?(Ge=Se,Se=null):Ge=Se.sibling;var xe=ie(K,Se,G[Ce],ae);if(xe===null){Se===null&&(Se=Ge);break}e&&Se&&xe.alternate===null&&t(K,Se),$=p(xe,$,Ce),ge===null?me=xe:ge.sibling=xe,ge=xe,Se=Ge}if(Ce===G.length)return r(K,Se),Pe&&Tr(K,Ce),me;if(Se===null){for(;Ce<G.length;Ce++)Se=oe(K,G[Ce],ae),Se!==null&&($=p(Se,$,Ce),ge===null?me=Se:ge.sibling=Se,ge=Se);return Pe&&Tr(K,Ce),me}for(Se=i(K,Se);Ce<G.length;Ce++)Ge=fe(Se,K,Ce,G[Ce],ae),Ge!==null&&(e&&Ge.alternate!==null&&Se.delete(Ge.key===null?Ce:Ge.key),$=p(Ge,$,Ce),ge===null?me=Ge:ge.sibling=Ge,ge=Ge);return e&&Se.forEach(function(yr){return t(K,yr)}),Pe&&Tr(K,Ce),me}function ve(K,$,G,ae){var me=R(G);if(typeof me!="function")throw Error(h(150));if(G=me.call(G),G==null)throw Error(h(151));for(var ge=me=null,Se=$,Ce=$=0,Ge=null,xe=G.next();Se!==null&&!xe.done;Ce++,xe=G.next()){Se.index>Ce?(Ge=Se,Se=null):Ge=Se.sibling;var yr=ie(K,Se,xe.value,ae);if(yr===null){Se===null&&(Se=Ge);break}e&&Se&&yr.alternate===null&&t(K,Se),$=p(yr,$,Ce),ge===null?me=yr:ge.sibling=yr,ge=yr,Se=Ge}if(xe.done)return r(K,Se),Pe&&Tr(K,Ce),me;if(Se===null){for(;!xe.done;Ce++,xe=G.next())xe=oe(K,xe.value,ae),xe!==null&&($=p(xe,$,Ce),ge===null?me=xe:ge.sibling=xe,ge=xe);return Pe&&Tr(K,Ce),me}for(Se=i(K,Se);!xe.done;Ce++,xe=G.next())xe=fe(Se,K,Ce,xe.value,ae),xe!==null&&(e&&xe.alternate!==null&&Se.delete(xe.key===null?Ce:xe.key),$=p(xe,$,Ce),ge===null?me=xe:ge.sibling=xe,ge=xe);return e&&Se.forEach(function($d){return t(K,$d)}),Pe&&Tr(K,Ce),me}function Fe(K,$,G,ae){if(typeof G=="object"&&G!==null&&G.type===L&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case k:e:{for(var me=G.key,ge=$;ge!==null;){if(ge.key===me){if(me=G.type,me===L){if(ge.tag===7){r(K,ge.sibling),$=c(ge,G.props.children),$.return=K,K=$;break e}}else if(ge.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ne&&Ka(me)===ge.type){r(K,ge.sibling),$=c(ge,G.props),$.ref=Bi(K,ge,G),$.return=K,K=$;break e}r(K,ge);break}else t(K,ge);ge=ge.sibling}G.type===L?($=Hr(G.props.children,K.mode,ae,G.key),$.return=K,K=$):(ae=Ys(G.type,G.key,G.props,null,K.mode,ae),ae.ref=Bi(K,$,G),ae.return=K,K=ae)}return D(K);case b:e:{for(ge=G.key;$!==null;){if($.key===ge)if($.tag===4&&$.stateNode.containerInfo===G.containerInfo&&$.stateNode.implementation===G.implementation){r(K,$.sibling),$=c($,G.children||[]),$.return=K,K=$;break e}else{r(K,$);break}else t(K,$);$=$.sibling}$=rl(G,K.mode,ae),$.return=K,K=$}return D(K);case ne:return ge=G._init,Fe(K,$,ge(G._payload),ae)}if(Wt(G))return _e(K,$,G,ae);if(R(G))return ve(K,$,G,ae);xs(K,G)}return typeof G=="string"&&G!==""||typeof G=="number"?(G=""+G,$!==null&&$.tag===6?(r(K,$.sibling),$=c($,G),$.return=K,K=$):(r(K,$),$=tl(G,K.mode,ae),$.return=K,K=$),D(K)):r(K,$)}return Fe}var ei=qa(!0),Ga=qa(!1),Ls=cr(null),Rs=null,ti=null,ho=null;function uo(){ho=ti=Rs=null}function fo(e){var t=Ls.current;Oe(Ls),e._currentValue=t}function po(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function ri(e,t){Rs=e,ho=ti=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(at=!0),e.firstContext=null)}function yt(e){var t=e._currentValue;if(ho!==e)if(e={context:e,memoizedValue:t,next:null},ti===null){if(Rs===null)throw Error(h(308));ti=e,Rs.dependencies={lanes:0,firstContext:e}}else ti=ti.next=e;return t}var Ar=null;function _o(e){Ar===null?Ar=[e]:Ar.push(e)}function Xa(e,t,r,i){var c=t.interleaved;return c===null?(r.next=r,_o(t)):(r.next=c.next,c.next=r),t.interleaved=r,Gt(e,i)}function Gt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var dr=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ya(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 Xt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(be&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,Gt(e,r)}return c=i.interleaved,c===null?(t.next=t,_o(i)):(t.next=c.next,c.next=t),i.interleaved=t,Gt(e,r)}function Ds(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Dn(e,r)}}function Qa(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var c=null,p=null;if(r=r.firstBaseUpdate,r!==null){do{var D={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};p===null?c=p=D:p=p.next=D,r=r.next}while(r!==null);p===null?c=p=t:p=p.next=t}else c=p=t;r={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:p,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ts(e,t,r,i){var c=e.updateQueue;dr=!1;var p=c.firstBaseUpdate,D=c.lastBaseUpdate,N=c.shared.pending;if(N!==null){c.shared.pending=null;var z=N,Y=z.next;z.next=null,D===null?p=Y:D.next=Y,D=z;var se=e.alternate;se!==null&&(se=se.updateQueue,N=se.lastBaseUpdate,N!==D&&(N===null?se.firstBaseUpdate=Y:N.next=Y,se.lastBaseUpdate=z))}if(p!==null){var oe=c.baseState;D=0,se=Y=z=null,N=p;do{var ie=N.lane,fe=N.eventTime;if((i&ie)===ie){se!==null&&(se=se.next={eventTime:fe,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var _e=e,ve=N;switch(ie=t,fe=r,ve.tag){case 1:if(_e=ve.payload,typeof _e=="function"){oe=_e.call(fe,oe,ie);break e}oe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=ve.payload,ie=typeof _e=="function"?_e.call(fe,oe,ie):_e,ie==null)break e;oe=O({},oe,ie);break e;case 2:dr=!0}}N.callback!==null&&N.lane!==0&&(e.flags|=64,ie=c.effects,ie===null?c.effects=[N]:ie.push(N))}else fe={eventTime:fe,lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},se===null?(Y=se=fe,z=oe):se=se.next=fe,D|=ie;if(N=N.next,N===null){if(N=c.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,c.lastBaseUpdate=ie,c.shared.pending=null}}while(!0);if(se===null&&(z=oe),c.baseState=z,c.firstBaseUpdate=Y,c.lastBaseUpdate=se,t=c.shared.interleaved,t!==null){c=t;do D|=c.lane,c=c.next;while(c!==t)}else p===null&&(c.shared.lanes=0);Pr|=D,e.lanes=D,e.memoizedState=oe}}function Ja(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],c=i.callback;if(c!==null){if(i.callback=null,i=r,typeof c!="function")throw Error(h(191,c));c.call(i)}}}var Oi={},Ht=cr(Oi),Pi=cr(Oi),Mi=cr(Oi);function Br(e){if(e===Oi)throw Error(h(174));return e}function mo(e,t){switch(De(Mi,t),De(Pi,e),De(Ht,Oi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:kr(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=kr(t,e)}Oe(Ht),De(Ht,t)}function ii(){Oe(Ht),Oe(Pi),Oe(Mi)}function Za(e){Br(Mi.current);var t=Br(Ht.current),r=kr(t,e.type);t!==r&&(De(Pi,e),De(Ht,r))}function go(e){Pi.current===e&&(Oe(Ht),Oe(Pi))}var Me=cr(0);function As(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==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 So=[];function yo(){for(var e=0;e<So.length;e++)So[e]._workInProgressVersionPrimary=null;So.length=0}var Bs=_.ReactCurrentDispatcher,Co=_.ReactCurrentBatchConfig,Or=0,Ie=null,Ue=null,Ke=null,Os=!1,Ii=!1,Ni=0,dd=0;function Ze(){throw Error(h(321))}function wo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Rt(e[r],t[r]))return!1;return!0}function Eo(e,t,r,i,c,p){if(Or=p,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bs.current=e===null||e.memoizedState===null?vd:md,e=r(i,c),Ii){p=0;do{if(Ii=!1,Ni=0,25<=p)throw Error(h(301));p+=1,Ke=Ue=null,t.updateQueue=null,Bs.current=gd,e=r(i,c)}while(Ii)}if(Bs.current=Is,t=Ue!==null&&Ue.next!==null,Or=0,Ke=Ue=Ie=null,Os=!1,t)throw Error(h(300));return e}function ko(){var e=Ni!==0;return Ni=0,e}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?Ie.memoizedState=Ke=e:Ke=Ke.next=e,Ke}function Ct(){if(Ue===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=Ke===null?Ie.memoizedState:Ke.next;if(t!==null)Ke=t,Ue=e;else{if(e===null)throw Error(h(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},Ke===null?Ie.memoizedState=Ke=e:Ke=Ke.next=e}return Ke}function Hi(e,t){return typeof t=="function"?t(e):t}function bo(e){var t=Ct(),r=t.queue;if(r===null)throw Error(h(311));r.lastRenderedReducer=e;var i=Ue,c=i.baseQueue,p=r.pending;if(p!==null){if(c!==null){var D=c.next;c.next=p.next,p.next=D}i.baseQueue=c=p,r.pending=null}if(c!==null){p=c.next,i=i.baseState;var N=D=null,z=null,Y=p;do{var se=Y.lane;if((Or&se)===se)z!==null&&(z=z.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),i=Y.hasEagerState?Y.eagerState:e(i,Y.action);else{var oe={lane:se,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};z===null?(N=z=oe,D=i):z=z.next=oe,Ie.lanes|=se,Pr|=se}Y=Y.next}while(Y!==null&&Y!==p);z===null?D=i:z.next=N,Rt(i,t.memoizedState)||(at=!0),t.memoizedState=i,t.baseState=D,t.baseQueue=z,r.lastRenderedState=i}if(e=r.interleaved,e!==null){c=e;do p=c.lane,Ie.lanes|=p,Pr|=p,c=c.next;while(c!==e)}else c===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function xo(e){var t=Ct(),r=t.queue;if(r===null)throw Error(h(311));r.lastRenderedReducer=e;var i=r.dispatch,c=r.pending,p=t.memoizedState;if(c!==null){r.pending=null;var D=c=c.next;do p=e(p,D.action),D=D.next;while(D!==c);Rt(p,t.memoizedState)||(at=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),r.lastRenderedState=p}return[p,i]}function ec(){}function tc(e,t){var r=Ie,i=Ct(),c=t(),p=!Rt(i.memoizedState,c);if(p&&(i.memoizedState=c,at=!0),i=i.queue,Lo(sc.bind(null,r,i,e),[e]),i.getSnapshot!==t||p||Ke!==null&&Ke.memoizedState.tag&1){if(r.flags|=2048,Fi(9,ic.bind(null,r,i,c,t),void 0,null),qe===null)throw Error(h(349));(Or&30)!==0||rc(r,t,c)}return c}function rc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function ic(e,t,r,i){t.value=r,t.getSnapshot=i,nc(t)&&oc(e)}function sc(e,t,r){return r(function(){nc(t)&&oc(e)})}function nc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Rt(e,r)}catch{return!0}}function oc(e){var t=Gt(e,1);t!==null&&Ot(t,e,1,-1)}function lc(e){var t=Ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Hi,lastRenderedState:e},t.queue=e,e=e.dispatch=_d.bind(null,Ie,e),[t.memoizedState,e]}function Fi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function ac(){return Ct().memoizedState}function Ps(e,t,r,i){var c=Ft();Ie.flags|=e,c.memoizedState=Fi(1|t,r,void 0,i===void 0?null:i)}function Ms(e,t,r,i){var c=Ct();i=i===void 0?null:i;var p=void 0;if(Ue!==null){var D=Ue.memoizedState;if(p=D.destroy,i!==null&&wo(i,D.deps)){c.memoizedState=Fi(t,r,p,i);return}}Ie.flags|=e,c.memoizedState=Fi(1|t,r,p,i)}function cc(e,t){return Ps(8390656,8,e,t)}function Lo(e,t){return Ms(2048,8,e,t)}function hc(e,t){return Ms(4,2,e,t)}function uc(e,t){return Ms(4,4,e,t)}function dc(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 fc(e,t,r){return r=r!=null?r.concat([e]):null,Ms(4,4,dc.bind(null,t,e),r)}function Ro(){}function pc(e,t){var r=Ct();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&wo(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function _c(e,t){var r=Ct();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&wo(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function vc(e,t,r){return(Or&21)===0?(e.baseState&&(e.baseState=!1,at=!0),e.memoizedState=r):(Rt(r,t)||(r=Kl(),Ie.lanes|=r,Pr|=r,e.baseState=!0),t)}function fd(e,t){var r=Le;Le=r!==0&&4>r?r:4,e(!0);var i=Co.transition;Co.transition={};try{e(!1),t()}finally{Le=r,Co.transition=i}}function mc(){return Ct().memoizedState}function pd(e,t,r){var i=mr(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},gc(e))Sc(t,r);else if(r=Xa(e,t,r,i),r!==null){var c=st();Ot(r,e,i,c),yc(r,t,i)}}function _d(e,t,r){var i=mr(e),c={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(gc(e))Sc(t,c);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var D=t.lastRenderedState,N=p(D,r);if(c.hasEagerState=!0,c.eagerState=N,Rt(N,D)){var z=t.interleaved;z===null?(c.next=c,_o(t)):(c.next=z.next,z.next=c),t.interleaved=c;return}}catch{}finally{}r=Xa(e,t,c,i),r!==null&&(c=st(),Ot(r,e,i,c),yc(r,t,i))}}function gc(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function Sc(e,t){Ii=Os=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function yc(e,t,r){if((r&4194240)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Dn(e,r)}}var Is={readContext:yt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},vd={readContext:yt,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:yt,useEffect:cc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ps(4194308,4,dc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ps(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ps(4,2,e,t)},useMemo:function(e,t){var r=Ft();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ft();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=pd.bind(null,Ie,e),[i.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:lc,useDebugValue:Ro,useDeferredValue:function(e){return Ft().memoizedState=e},useTransition:function(){var e=lc(!1),t=e[0];return e=fd.bind(null,e[1]),Ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=Ie,c=Ft();if(Pe){if(r===void 0)throw Error(h(407));r=r()}else{if(r=t(),qe===null)throw Error(h(349));(Or&30)!==0||rc(i,t,r)}c.memoizedState=r;var p={value:r,getSnapshot:t};return c.queue=p,cc(sc.bind(null,i,p,e),[e]),i.flags|=2048,Fi(9,ic.bind(null,i,p,r,t),void 0,null),r},useId:function(){var e=Ft(),t=qe.identifierPrefix;if(Pe){var r=qt,i=Kt;r=(i&~(1<<32-Lt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ni++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=dd++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},md={readContext:yt,useCallback:pc,useContext:yt,useEffect:Lo,useImperativeHandle:fc,useInsertionEffect:hc,useLayoutEffect:uc,useMemo:_c,useReducer:bo,useRef:ac,useState:function(){return bo(Hi)},useDebugValue:Ro,useDeferredValue:function(e){var t=Ct();return vc(t,Ue.memoizedState,e)},useTransition:function(){var e=bo(Hi)[0],t=Ct().memoizedState;return[e,t]},useMutableSource:ec,useSyncExternalStore:tc,useId:mc,unstable_isNewReconciler:!1},gd={readContext:yt,useCallback:pc,useContext:yt,useEffect:Lo,useImperativeHandle:fc,useInsertionEffect:hc,useLayoutEffect:uc,useMemo:_c,useReducer:xo,useRef:ac,useState:function(){return xo(Hi)},useDebugValue:Ro,useDeferredValue:function(e){var t=Ct();return Ue===null?t.memoizedState=e:vc(t,Ue.memoizedState,e)},useTransition:function(){var e=xo(Hi)[0],t=Ct().memoizedState;return[e,t]},useMutableSource:ec,useSyncExternalStore:tc,useId:mc,unstable_isNewReconciler:!1};function Tt(e,t){if(e&&e.defaultProps){t=O({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Do(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:O({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ns={isMounted:function(e){return(e=e._reactInternals)?xr(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=st(),c=mr(e),p=Xt(i,c);p.payload=t,r!=null&&(p.callback=r),t=fr(e,p,c),t!==null&&(Ot(t,e,c,i),Ds(t,e,c))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=st(),c=mr(e),p=Xt(i,c);p.tag=1,p.payload=t,r!=null&&(p.callback=r),t=fr(e,p,c),t!==null&&(Ot(t,e,c,i),Ds(t,e,c))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=st(),i=mr(e),c=Xt(r,i);c.tag=2,t!=null&&(c.callback=t),t=fr(e,c,i),t!==null&&(Ot(t,e,i,r),Ds(t,e,i))}};function Cc(e,t,r,i,c,p,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,D):t.prototype&&t.prototype.isPureReactComponent?!bi(r,i)||!bi(c,p):!0}function wc(e,t,r){var i=!1,c=hr,p=t.contextType;return typeof p=="object"&&p!==null?p=yt(p):(c=lt(t)?Rr:Je.current,i=t.contextTypes,p=(i=i!=null)?Yr(e,c):hr),t=new t(r,p),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ns,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=p),t}function Ec(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function To(e,t,r,i){var c=e.stateNode;c.props=r,c.state=e.memoizedState,c.refs={},vo(e);var p=t.contextType;typeof p=="object"&&p!==null?c.context=yt(p):(p=lt(t)?Rr:Je.current,c.context=Yr(e,p)),c.state=e.memoizedState,p=t.getDerivedStateFromProps,typeof p=="function"&&(Do(e,t,p,r),c.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(t=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),t!==c.state&&Ns.enqueueReplaceState(c,c.state,null),Ts(e,r,c,i),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function si(e,t){try{var r="",i=t;do r+=ce(i),i=i.return;while(i);var c=r}catch(p){c=`
39
- Error generating stack: `+p.message+`
40
- `+p.stack}return{value:e,source:t,stack:c,digest:null}}function Ao(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Bo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Sd=typeof WeakMap=="function"?WeakMap:Map;function kc(e,t,r){r=Xt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){$s||($s=!0,qo=i),Bo(e,t)},r}function bc(e,t,r){r=Xt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var c=t.value;r.payload=function(){return i(c)},r.callback=function(){Bo(e,t)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(r.callback=function(){Bo(e,t),typeof i!="function"&&(_r===null?_r=new Set([this]):_r.add(this));var D=t.stack;this.componentDidCatch(t.value,{componentStack:D!==null?D:""})}),r}function xc(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Sd;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(r)||(c.add(r),e=Od.bind(null,e,t,r),t.then(e,e))}function Lc(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 Rc(e,t,r,i,c){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Xt(-1,1),t.tag=2,fr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var yd=_.ReactCurrentOwner,at=!1;function it(e,t,r,i){t.child=e===null?Ga(t,null,r,i):ei(t,e.child,r,i)}function Dc(e,t,r,i,c){r=r.render;var p=t.ref;return ri(t,c),i=Eo(e,t,r,i,p,c),r=ko(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,Yt(e,t,c)):(Pe&&r&&no(t),t.flags|=1,it(e,t,i,c),t.child)}function Tc(e,t,r,i,c){if(e===null){var p=r.type;return typeof p=="function"&&!el(p)&&p.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=p,Ac(e,t,p,i,c)):(e=Ys(r.type,null,i,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,(e.lanes&c)===0){var D=p.memoizedProps;if(r=r.compare,r=r!==null?r:bi,r(D,i)&&e.ref===t.ref)return Yt(e,t,c)}return t.flags|=1,e=Sr(p,i),e.ref=t.ref,e.return=t,t.child=e}function Ac(e,t,r,i,c){if(e!==null){var p=e.memoizedProps;if(bi(p,i)&&e.ref===t.ref)if(at=!1,t.pendingProps=i=p,(e.lanes&c)!==0)(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,Yt(e,t,c)}return Oo(e,t,r,i,c)}function Bc(e,t,r){var i=t.pendingProps,c=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(oi,mt),mt|=r;else{if((r&1073741824)===0)return e=p!==null?p.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(oi,mt),mt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=p!==null?p.baseLanes:r,De(oi,mt),mt|=i}else p!==null?(i=p.baseLanes|r,t.memoizedState=null):i=r,De(oi,mt),mt|=i;return it(e,t,c,r),t.child}function Oc(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Oo(e,t,r,i,c){var p=lt(r)?Rr:Je.current;return p=Yr(t,p),ri(t,c),r=Eo(e,t,r,i,p,c),i=ko(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~c,Yt(e,t,c)):(Pe&&i&&no(t),t.flags|=1,it(e,t,r,c),t.child)}function Pc(e,t,r,i,c){if(lt(r)){var p=!0;Cs(t)}else p=!1;if(ri(t,c),t.stateNode===null)Fs(e,t),wc(t,r,i),To(t,r,i,c),i=!0;else if(e===null){var D=t.stateNode,N=t.memoizedProps;D.props=N;var z=D.context,Y=r.contextType;typeof Y=="object"&&Y!==null?Y=yt(Y):(Y=lt(r)?Rr:Je.current,Y=Yr(t,Y));var se=r.getDerivedStateFromProps,oe=typeof se=="function"||typeof D.getSnapshotBeforeUpdate=="function";oe||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==i||z!==Y)&&Ec(t,D,i,Y),dr=!1;var ie=t.memoizedState;D.state=ie,Ts(t,i,D,c),z=t.memoizedState,N!==i||ie!==z||ot.current||dr?(typeof se=="function"&&(Do(t,r,se,i),z=t.memoizedState),(N=dr||Cc(t,r,N,i,ie,z,Y))?(oe||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(t.flags|=4194308)):(typeof D.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=z),D.props=i,D.state=z,D.context=Y,i=N):(typeof D.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{D=t.stateNode,Ya(e,t),N=t.memoizedProps,Y=t.type===t.elementType?N:Tt(t.type,N),D.props=Y,oe=t.pendingProps,ie=D.context,z=r.contextType,typeof z=="object"&&z!==null?z=yt(z):(z=lt(r)?Rr:Je.current,z=Yr(t,z));var fe=r.getDerivedStateFromProps;(se=typeof fe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||(N!==oe||ie!==z)&&Ec(t,D,i,z),dr=!1,ie=t.memoizedState,D.state=ie,Ts(t,i,D,c);var _e=t.memoizedState;N!==oe||ie!==_e||ot.current||dr?(typeof fe=="function"&&(Do(t,r,fe,i),_e=t.memoizedState),(Y=dr||Cc(t,r,Y,i,ie,_e,z)||!1)?(se||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(i,_e,z),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(i,_e,z)),typeof D.componentDidUpdate=="function"&&(t.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof D.componentDidUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=_e),D.props=i,D.state=_e,D.context=z,i=Y):(typeof D.componentDidUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return Po(e,t,r,i,p,c)}function Po(e,t,r,i,c,p){Oc(e,t);var D=(t.flags&128)!==0;if(!i&&!D)return c&&Fa(t,r,!1),Yt(e,t,p);i=t.stateNode,yd.current=t;var N=D&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&D?(t.child=ei(t,e.child,null,p),t.child=ei(t,null,N,p)):it(e,t,N,p),t.memoizedState=i.state,c&&Fa(t,r,!0),t.child}function Mc(e){var t=e.stateNode;t.pendingContext?Na(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Na(e,t.context,!1),mo(e,t.containerInfo)}function Ic(e,t,r,i,c){return Zr(),co(c),t.flags|=256,it(e,t,r,i),t.child}var Mo={dehydrated:null,treeContext:null,retryLane:0};function Io(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nc(e,t,r){var i=t.pendingProps,c=Me.current,p=!1,D=(t.flags&128)!==0,N;if((N=D)||(N=e!==null&&e.memoizedState===null?!1:(c&2)!==0),N?(p=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),De(Me,c&1),e===null)return ao(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):(D=i.children,e=i.fallback,p?(i=t.mode,p=t.child,D={mode:"hidden",children:D},(i&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=D):p=Qs(D,i,0,null),e=Hr(e,i,r,null),p.return=t,e.return=t,p.sibling=e,t.child=p,t.child.memoizedState=Io(r),t.memoizedState=Mo,e):No(t,D));if(c=e.memoizedState,c!==null&&(N=c.dehydrated,N!==null))return Cd(e,t,D,i,N,c,r);if(p){p=i.fallback,D=t.mode,c=e.child,N=c.sibling;var z={mode:"hidden",children:i.children};return(D&1)===0&&t.child!==c?(i=t.child,i.childLanes=0,i.pendingProps=z,t.deletions=null):(i=Sr(c,z),i.subtreeFlags=c.subtreeFlags&14680064),N!==null?p=Sr(N,p):(p=Hr(p,D,r,null),p.flags|=2),p.return=t,i.return=t,i.sibling=p,t.child=i,i=p,p=t.child,D=e.child.memoizedState,D=D===null?Io(r):{baseLanes:D.baseLanes|r,cachePool:null,transitions:D.transitions},p.memoizedState=D,p.childLanes=e.childLanes&~r,t.memoizedState=Mo,i}return p=e.child,e=p.sibling,i=Sr(p,{mode:"visible",children:i.children}),(t.mode&1)===0&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function No(e,t){return t=Qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Hs(e,t,r,i){return i!==null&&co(i),ei(t,e.child,null,r),e=No(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cd(e,t,r,i,c,p,D){if(r)return t.flags&256?(t.flags&=-257,i=Ao(Error(h(422))),Hs(e,t,D,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(p=i.fallback,c=t.mode,i=Qs({mode:"visible",children:i.children},c,0,null),p=Hr(p,c,D,null),p.flags|=2,i.return=t,p.return=t,i.sibling=p,t.child=i,(t.mode&1)!==0&&ei(t,e.child,null,D),t.child.memoizedState=Io(D),t.memoizedState=Mo,p);if((t.mode&1)===0)return Hs(e,t,D,null);if(c.data==="$!"){if(i=c.nextSibling&&c.nextSibling.dataset,i)var N=i.dgst;return i=N,p=Error(h(419)),i=Ao(p,i,void 0),Hs(e,t,D,i)}if(N=(D&e.childLanes)!==0,at||N){if(i=qe,i!==null){switch(D&-D){case 4:c=2;break;case 16:c=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:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(i.suspendedLanes|D))!==0?0:c,c!==0&&c!==p.retryLane&&(p.retryLane=c,Gt(e,c),Ot(i,e,c,-1))}return Zo(),i=Ao(Error(h(421))),Hs(e,t,D,i)}return c.data==="$?"?(t.flags|=128,t.child=e.child,t=Pd.bind(null,e),c._reactRetry=t,null):(e=p.treeContext,vt=ar(c.nextSibling),_t=t,Pe=!0,Dt=null,e!==null&&(gt[St++]=Kt,gt[St++]=qt,gt[St++]=Dr,Kt=e.id,qt=e.overflow,Dr=t),t=No(t,i.children),t.flags|=4096,t)}function Hc(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),po(e.return,t,r)}function Ho(e,t,r,i,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:c}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=r,p.tailMode=c)}function Fc(e,t,r){var i=t.pendingProps,c=i.revealOrder,p=i.tail;if(it(e,t,i.children,r),i=Me.current,(i&2)!==0)i=i&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&&Hc(e,r,t);else if(e.tag===19)Hc(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(De(Me,i),(t.mode&1)===0)t.memoizedState=null;else switch(c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&As(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),Ho(t,!1,c,r,p);break;case"backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&As(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Ho(t,!0,r,null,p);break;case"together":Ho(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fs(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Yt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Pr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(h(153));if(t.child!==null){for(e=t.child,r=Sr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Sr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function wd(e,t,r){switch(t.tag){case 3:Mc(t),Zr();break;case 5:Za(t);break;case 1:lt(t.type)&&Cs(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,c=t.memoizedProps.value;De(Ls,i._currentValue),i._currentValue=c;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(De(Me,Me.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Nc(e,t,r):(De(Me,Me.current&1),e=Yt(e,t,r),e!==null?e.sibling:null);De(Me,Me.current&1);break;case 19:if(i=(r&t.childLanes)!==0,(e.flags&128)!==0){if(i)return Fc(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),De(Me,Me.current),i)break;return null;case 22:case 23:return t.lanes=0,Bc(e,t,r)}return Yt(e,t,r)}var jc,Fo,zc,Uc;jc=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Fo=function(){},zc=function(e,t,r,i){var c=e.memoizedProps;if(c!==i){e=t.stateNode,Br(Ht.current);var p=null;switch(r){case"input":c=Re(e,c),i=Re(e,i),p=[];break;case"select":c=O({},c,{value:void 0}),i=O({},i,{value:void 0}),p=[];break;case"textarea":c=Zt(e,c),i=Zt(e,i),p=[];break;default:typeof c.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=gs)}gn(r,i);var D;r=null;for(Y in c)if(!i.hasOwnProperty(Y)&&c.hasOwnProperty(Y)&&c[Y]!=null)if(Y==="style"){var N=c[Y];for(D in N)N.hasOwnProperty(D)&&(r||(r={}),r[D]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(M.hasOwnProperty(Y)?p||(p=[]):(p=p||[]).push(Y,null));for(Y in i){var z=i[Y];if(N=c!=null?c[Y]:void 0,i.hasOwnProperty(Y)&&z!==N&&(z!=null||N!=null))if(Y==="style")if(N){for(D in N)!N.hasOwnProperty(D)||z&&z.hasOwnProperty(D)||(r||(r={}),r[D]="");for(D in z)z.hasOwnProperty(D)&&N[D]!==z[D]&&(r||(r={}),r[D]=z[D])}else r||(p||(p=[]),p.push(Y,r)),r=z;else Y==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,N=N?N.__html:void 0,z!=null&&N!==z&&(p=p||[]).push(Y,z)):Y==="children"?typeof z!="string"&&typeof z!="number"||(p=p||[]).push(Y,""+z):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(M.hasOwnProperty(Y)?(z!=null&&Y==="onScroll"&&Be("scroll",e),p||N===z||(p=[])):(p=p||[]).push(Y,z))}r&&(p=p||[]).push("style",r);var Y=p;(t.updateQueue=Y)&&(t.flags|=4)}},Uc=function(e,t,r,i){r!==i&&(t.flags|=4)};function ji(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function et(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags&14680064,i|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Ed(e,t,r){var i=t.pendingProps;switch(oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(t),null;case 1:return lt(t.type)&&ys(),et(t),null;case 3:return i=t.stateNode,ii(),Oe(ot),Oe(Je),yo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(bs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Dt!==null&&(Yo(Dt),Dt=null))),Fo(e,t),et(t),null;case 5:go(t);var c=Br(Mi.current);if(r=t.type,e!==null&&t.stateNode!=null)zc(e,t,r,i,c),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(h(166));return et(t),null}if(e=Br(Ht.current),bs(t)){i=t.stateNode,r=t.type;var p=t.memoizedProps;switch(i[Nt]=t,i[Ti]=p,e=(t.mode&1)!==0,r){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(c=0;c<Li.length;c++)Be(Li[c],i);break;case"source":Be("error",i);break;case"img":case"image":case"link":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"input":Te(i,p),Be("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!p.multiple},Be("invalid",i);break;case"textarea":rt(i,p),Be("invalid",i)}gn(r,p),c=null;for(var D in p)if(p.hasOwnProperty(D)){var N=p[D];D==="children"?typeof N=="string"?i.textContent!==N&&(p.suppressHydrationWarning!==!0&&ms(i.textContent,N,e),c=["children",N]):typeof N=="number"&&i.textContent!==""+N&&(p.suppressHydrationWarning!==!0&&ms(i.textContent,N,e),c=["children",""+N]):M.hasOwnProperty(D)&&N!=null&&D==="onScroll"&&Be("scroll",i)}switch(r){case"input":de(i),Jt(i,p,!0);break;case"textarea":de(i),dt(i);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(i.onclick=gs)}i=c,t.updateQueue=i,i!==null&&(t.flags|=4)}else{D=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tr(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=D.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=D.createElement(r,{is:i.is}):(e=D.createElement(r),r==="select"&&(D=e,i.multiple?D.multiple=!0:i.size&&(D.size=i.size))):e=D.createElementNS(e,r),e[Nt]=t,e[Ti]=i,jc(e,t,!1,!1),t.stateNode=e;e:{switch(D=Sn(r,i),r){case"dialog":Be("cancel",e),Be("close",e),c=i;break;case"iframe":case"object":case"embed":Be("load",e),c=i;break;case"video":case"audio":for(c=0;c<Li.length;c++)Be(Li[c],e);c=i;break;case"source":Be("error",e),c=i;break;case"img":case"image":case"link":Be("error",e),Be("load",e),c=i;break;case"details":Be("toggle",e),c=i;break;case"input":Te(e,i),c=Re(e,i),Be("invalid",e);break;case"option":c=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},c=O({},i,{value:void 0}),Be("invalid",e);break;case"textarea":rt(e,i),c=Zt(e,i),Be("invalid",e);break;default:c=i}gn(r,c),N=c;for(p in N)if(N.hasOwnProperty(p)){var z=N[p];p==="style"?Al(e,z):p==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&br(e,z)):p==="children"?typeof z=="string"?(r!=="textarea"||z!=="")&&nt(e,z):typeof z=="number"&&nt(e,""+z):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(M.hasOwnProperty(p)?z!=null&&p==="onScroll"&&Be("scroll",e):z!=null&&n(e,p,z,D))}switch(r){case"input":de(e),Jt(e,i,!1);break;case"textarea":de(e),dt(e);break;case"option":i.value!=null&&e.setAttribute("value",""+B(i.value));break;case"select":e.multiple=!!i.multiple,p=i.value,p!=null?Mt(e,!!i.multiple,p,!1):i.defaultValue!=null&&Mt(e,!!i.multiple,i.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=gs)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return et(t),null;case 6:if(e&&t.stateNode!=null)Uc(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(h(166));if(r=Br(Mi.current),Br(Ht.current),bs(t)){if(i=t.stateNode,r=t.memoizedProps,i[Nt]=t,(p=i.nodeValue!==r)&&(e=_t,e!==null))switch(e.tag){case 3:ms(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ms(i.nodeValue,r,(e.mode&1)!==0)}p&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Nt]=t,t.stateNode=i}return et(t),null;case 13:if(Oe(Me),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Pe&&vt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Va(),Zr(),t.flags|=98560,p=!1;else if(p=bs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!p)throw Error(h(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(h(317));p[Nt]=t}else Zr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;et(t),p=!1}else Dt!==null&&(Yo(Dt),Dt=null),p=!0;if(!p)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Me.current&1)!==0?We===0&&(We=3):Zo())),t.updateQueue!==null&&(t.flags|=4),et(t),null);case 4:return ii(),Fo(e,t),e===null&&Ri(t.stateNode.containerInfo),et(t),null;case 10:return fo(t.type._context),et(t),null;case 17:return lt(t.type)&&ys(),et(t),null;case 19:if(Oe(Me),p=t.memoizedState,p===null)return et(t),null;if(i=(t.flags&128)!==0,D=p.rendering,D===null)if(i)ji(p,!1);else{if(We!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(D=As(e),D!==null){for(t.flags|=128,ji(p,!1),i=D.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)p=r,e=i,p.flags&=14680066,D=p.alternate,D===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=D.childLanes,p.lanes=D.lanes,p.child=D.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=D.memoizedProps,p.memoizedState=D.memoizedState,p.updateQueue=D.updateQueue,p.type=D.type,e=D.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return De(Me,Me.current&1|2),t.child}e=e.sibling}p.tail!==null&&He()>li&&(t.flags|=128,i=!0,ji(p,!1),t.lanes=4194304)}else{if(!i)if(e=As(D),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(p,!0),p.tail===null&&p.tailMode==="hidden"&&!D.alternate&&!Pe)return et(t),null}else 2*He()-p.renderingStartTime>li&&r!==1073741824&&(t.flags|=128,i=!0,ji(p,!1),t.lanes=4194304);p.isBackwards?(D.sibling=t.child,t.child=D):(r=p.last,r!==null?r.sibling=D:t.child=D,p.last=D)}return p.tail!==null?(t=p.tail,p.rendering=t,p.tail=t.sibling,p.renderingStartTime=He(),t.sibling=null,r=Me.current,De(Me,i?r&1|2:r&1),t):(et(t),null);case 22:case 23:return Jo(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&(t.mode&1)!==0?(mt&1073741824)!==0&&(et(t),t.subtreeFlags&6&&(t.flags|=8192)):et(t),null;case 24:return null;case 25:return null}throw Error(h(156,t.tag))}function kd(e,t){switch(oo(t),t.tag){case 1:return lt(t.type)&&ys(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Oe(ot),Oe(Je),yo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return go(t),null;case 13:if(Oe(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(h(340));Zr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(Me),null;case 4:return ii(),null;case 10:return fo(t.type._context),null;case 22:case 23:return Jo(),null;case 24:return null;default:return null}}var js=!1,tt=!1,bd=typeof WeakSet=="function"?WeakSet:Set,pe=null;function ni(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){Ne(e,t,i)}else r.current=null}function jo(e,t,r){try{r()}catch(i){Ne(e,t,i)}}var Wc=!1;function xd(e,t){if(Qn=os,e=Ca(),Wn(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var c=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{r.nodeType,p.nodeType}catch{r=null;break e}var D=0,N=-1,z=-1,Y=0,se=0,oe=e,ie=null;t:for(;;){for(var fe;oe!==r||c!==0&&oe.nodeType!==3||(N=D+c),oe!==p||i!==0&&oe.nodeType!==3||(z=D+i),oe.nodeType===3&&(D+=oe.nodeValue.length),(fe=oe.firstChild)!==null;)ie=oe,oe=fe;for(;;){if(oe===e)break t;if(ie===r&&++Y===c&&(N=D),ie===p&&++se===i&&(z=D),(fe=oe.nextSibling)!==null)break;oe=ie,ie=oe.parentNode}oe=fe}r=N===-1||z===-1?null:{start:N,end:z}}else r=null}r=r||{start:0,end:0}}else r=null;for(Jn={focusedElem:e,selectionRange:r},os=!1,pe=t;pe!==null;)if(t=pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pe=e;else for(;pe!==null;){t=pe;try{var _e=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var ve=_e.memoizedProps,Fe=_e.memoizedState,K=t.stateNode,$=K.getSnapshotBeforeUpdate(t.elementType===t.type?ve:Tt(t.type,ve),Fe);K.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var G=t.stateNode.containerInfo;G.nodeType===1?G.textContent="":G.nodeType===9&&G.documentElement&&G.removeChild(G.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(h(163))}}catch(ae){Ne(t,t.return,ae)}if(e=t.sibling,e!==null){e.return=t.return,pe=e;break}pe=t.return}return _e=Wc,Wc=!1,_e}function zi(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var c=i=i.next;do{if((c.tag&e)===e){var p=c.destroy;c.destroy=void 0,p!==void 0&&jo(t,r,p)}c=c.next}while(c!==i)}}function zs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function zo(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function $c(e){var t=e.alternate;t!==null&&(e.alternate=null,$c(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[Ti],delete t[ro],delete t[ad],delete t[cd])),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 Vc(e){return e.tag===5||e.tag===3||e.tag===4}function Kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vc(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 Uo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=gs));else if(i!==4&&(e=e.child,e!==null))for(Uo(e,t,r),e=e.sibling;e!==null;)Uo(e,t,r),e=e.sibling}function Wo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Wo(e,t,r),e=e.sibling;e!==null;)Wo(e,t,r),e=e.sibling}var Ye=null,At=!1;function pr(e,t,r){for(r=r.child;r!==null;)qc(e,t,r),r=r.sibling}function qc(e,t,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(es,r)}catch{}switch(r.tag){case 5:tt||ni(r,t);case 6:var i=Ye,c=At;Ye=null,pr(e,t,r),Ye=i,At=c,Ye!==null&&(At?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(At?(e=Ye,r=r.stateNode,e.nodeType===8?to(e.parentNode,r):e.nodeType===1&&to(e,r),Si(e)):to(Ye,r.stateNode));break;case 4:i=Ye,c=At,Ye=r.stateNode.containerInfo,At=!0,pr(e,t,r),Ye=i,At=c;break;case 0:case 11:case 14:case 15:if(!tt&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){c=i=i.next;do{var p=c,D=p.destroy;p=p.tag,D!==void 0&&((p&2)!==0||(p&4)!==0)&&jo(r,t,D),c=c.next}while(c!==i)}pr(e,t,r);break;case 1:if(!tt&&(ni(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(N){Ne(r,t,N)}pr(e,t,r);break;case 21:pr(e,t,r);break;case 22:r.mode&1?(tt=(i=tt)||r.memoizedState!==null,pr(e,t,r),tt=i):pr(e,t,r);break;default:pr(e,t,r)}}function Gc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new bd),t.forEach(function(i){var c=Md.bind(null,e,i);r.has(i)||(r.add(i),i.then(c,c))})}}function Bt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var c=r[i];try{var p=e,D=t,N=D;e:for(;N!==null;){switch(N.tag){case 5:Ye=N.stateNode,At=!1;break e;case 3:Ye=N.stateNode.containerInfo,At=!0;break e;case 4:Ye=N.stateNode.containerInfo,At=!0;break e}N=N.return}if(Ye===null)throw Error(h(160));qc(p,D,c),Ye=null,At=!1;var z=c.alternate;z!==null&&(z.return=null),c.return=null}catch(Y){Ne(c,t,Y)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Xc(t,e),t=t.sibling}function Xc(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Bt(t,e),jt(e),i&4){try{zi(3,e,e.return),zs(3,e)}catch(ve){Ne(e,e.return,ve)}try{zi(5,e,e.return)}catch(ve){Ne(e,e.return,ve)}}break;case 1:Bt(t,e),jt(e),i&512&&r!==null&&ni(r,r.return);break;case 5:if(Bt(t,e),jt(e),i&512&&r!==null&&ni(r,r.return),e.flags&32){var c=e.stateNode;try{nt(c,"")}catch(ve){Ne(e,e.return,ve)}}if(i&4&&(c=e.stateNode,c!=null)){var p=e.memoizedProps,D=r!==null?r.memoizedProps:p,N=e.type,z=e.updateQueue;if(e.updateQueue=null,z!==null)try{N==="input"&&p.type==="radio"&&p.name!=null&&Xe(c,p),Sn(N,D);var Y=Sn(N,p);for(D=0;D<z.length;D+=2){var se=z[D],oe=z[D+1];se==="style"?Al(c,oe):se==="dangerouslySetInnerHTML"?br(c,oe):se==="children"?nt(c,oe):n(c,se,oe,Y)}switch(N){case"input":ye(c,p);break;case"textarea":er(c,p);break;case"select":var ie=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!p.multiple;var fe=p.value;fe!=null?Mt(c,!!p.multiple,fe,!1):ie!==!!p.multiple&&(p.defaultValue!=null?Mt(c,!!p.multiple,p.defaultValue,!0):Mt(c,!!p.multiple,p.multiple?[]:"",!1))}c[Ti]=p}catch(ve){Ne(e,e.return,ve)}}break;case 6:if(Bt(t,e),jt(e),i&4){if(e.stateNode===null)throw Error(h(162));c=e.stateNode,p=e.memoizedProps;try{c.nodeValue=p}catch(ve){Ne(e,e.return,ve)}}break;case 3:if(Bt(t,e),jt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Si(t.containerInfo)}catch(ve){Ne(e,e.return,ve)}break;case 4:Bt(t,e),jt(e);break;case 13:Bt(t,e),jt(e),c=e.child,c.flags&8192&&(p=c.memoizedState!==null,c.stateNode.isHidden=p,!p||c.alternate!==null&&c.alternate.memoizedState!==null||(Ko=He())),i&4&&Gc(e);break;case 22:if(se=r!==null&&r.memoizedState!==null,e.mode&1?(tt=(Y=tt)||se,Bt(t,e),tt=Y):Bt(t,e),jt(e),i&8192){if(Y=e.memoizedState!==null,(e.stateNode.isHidden=Y)&&!se&&(e.mode&1)!==0)for(pe=e,se=e.child;se!==null;){for(oe=pe=se;pe!==null;){switch(ie=pe,fe=ie.child,ie.tag){case 0:case 11:case 14:case 15:zi(4,ie,ie.return);break;case 1:ni(ie,ie.return);var _e=ie.stateNode;if(typeof _e.componentWillUnmount=="function"){i=ie,r=ie.return;try{t=i,_e.props=t.memoizedProps,_e.state=t.memoizedState,_e.componentWillUnmount()}catch(ve){Ne(i,r,ve)}}break;case 5:ni(ie,ie.return);break;case 22:if(ie.memoizedState!==null){Jc(oe);continue}}fe!==null?(fe.return=ie,pe=fe):Jc(oe)}se=se.sibling}e:for(se=null,oe=e;;){if(oe.tag===5){if(se===null){se=oe;try{c=oe.stateNode,Y?(p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(N=oe.stateNode,z=oe.memoizedProps.style,D=z!=null&&z.hasOwnProperty("display")?z.display:null,N.style.display=Yi("display",D))}catch(ve){Ne(e,e.return,ve)}}}else if(oe.tag===6){if(se===null)try{oe.stateNode.nodeValue=Y?"":oe.memoizedProps}catch(ve){Ne(e,e.return,ve)}}else if((oe.tag!==22&&oe.tag!==23||oe.memoizedState===null||oe===e)&&oe.child!==null){oe.child.return=oe,oe=oe.child;continue}if(oe===e)break e;for(;oe.sibling===null;){if(oe.return===null||oe.return===e)break e;se===oe&&(se=null),oe=oe.return}se===oe&&(se=null),oe.sibling.return=oe.return,oe=oe.sibling}}break;case 19:Bt(t,e),jt(e),i&4&&Gc(e);break;case 21:break;default:Bt(t,e),jt(e)}}function jt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Vc(r)){var i=r;break e}r=r.return}throw Error(h(160))}switch(i.tag){case 5:var c=i.stateNode;i.flags&32&&(nt(c,""),i.flags&=-33);var p=Kc(e);Wo(e,p,c);break;case 3:case 4:var D=i.stateNode.containerInfo,N=Kc(e);Uo(e,N,D);break;default:throw Error(h(161))}}catch(z){Ne(e,e.return,z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ld(e,t,r){pe=e,Yc(e)}function Yc(e,t,r){for(var i=(e.mode&1)!==0;pe!==null;){var c=pe,p=c.child;if(c.tag===22&&i){var D=c.memoizedState!==null||js;if(!D){var N=c.alternate,z=N!==null&&N.memoizedState!==null||tt;N=js;var Y=tt;if(js=D,(tt=z)&&!Y)for(pe=c;pe!==null;)D=pe,z=D.child,D.tag===22&&D.memoizedState!==null?Zc(c):z!==null?(z.return=D,pe=z):Zc(c);for(;p!==null;)pe=p,Yc(p),p=p.sibling;pe=c,js=N,tt=Y}Qc(e)}else(c.subtreeFlags&8772)!==0&&p!==null?(p.return=c,pe=p):Qc(e)}}function Qc(e){for(;pe!==null;){var t=pe;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:tt||zs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!tt)if(r===null)i.componentDidMount();else{var c=t.elementType===t.type?r.memoizedProps:Tt(t.type,r.memoizedProps);i.componentDidUpdate(c,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var p=t.updateQueue;p!==null&&Ja(t,p,i);break;case 3:var D=t.updateQueue;if(D!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ja(t,D,r)}break;case 5:var N=t.stateNode;if(r===null&&t.flags&4){r=N;var z=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&r.focus();break;case"img":z.src&&(r.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var Y=t.alternate;if(Y!==null){var se=Y.memoizedState;if(se!==null){var oe=se.dehydrated;oe!==null&&Si(oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(h(163))}tt||t.flags&512&&zo(t)}catch(ie){Ne(t,t.return,ie)}}if(t===e){pe=null;break}if(r=t.sibling,r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Jc(e){for(;pe!==null;){var t=pe;if(t===e){pe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,pe=r;break}pe=t.return}}function Zc(e){for(;pe!==null;){var t=pe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{zs(4,t)}catch(z){Ne(t,r,z)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var c=t.return;try{i.componentDidMount()}catch(z){Ne(t,c,z)}}var p=t.return;try{zo(t)}catch(z){Ne(t,p,z)}break;case 5:var D=t.return;try{zo(t)}catch(z){Ne(t,D,z)}}}catch(z){Ne(t,t.return,z)}if(t===e){pe=null;break}var N=t.sibling;if(N!==null){N.return=t.return,pe=N;break}pe=t.return}}var Rd=Math.ceil,Us=_.ReactCurrentDispatcher,$o=_.ReactCurrentOwner,wt=_.ReactCurrentBatchConfig,be=0,qe=null,je=null,Qe=0,mt=0,oi=cr(0),We=0,Ui=null,Pr=0,Ws=0,Vo=0,Wi=null,ct=null,Ko=0,li=1/0,Qt=null,$s=!1,qo=null,_r=null,Vs=!1,vr=null,Ks=0,$i=0,Go=null,qs=-1,Gs=0;function st(){return(be&6)!==0?He():qs!==-1?qs:qs=He()}function mr(e){return(e.mode&1)===0?1:(be&2)!==0&&Qe!==0?Qe&-Qe:ud.transition!==null?(Gs===0&&(Gs=Kl()),Gs):(e=Le,e!==0||(e=window.event,e=e===void 0?16:ta(e.type)),e)}function Ot(e,t,r,i){if(50<$i)throw $i=0,Go=null,Error(h(185));pi(e,r,i),((be&2)===0||e!==qe)&&(e===qe&&((be&2)===0&&(Ws|=r),We===4&&gr(e,Qe)),ht(e,i),r===1&&be===0&&(t.mode&1)===0&&(li=He()+500,ws&&ur()))}function ht(e,t){var r=e.callbackNode;uu(e,t);var i=is(e,e===qe?Qe:0);if(i===0)r!==null&&Wl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Wl(r),t===1)e.tag===0?hd(th.bind(null,e)):ja(th.bind(null,e)),od(function(){(be&6)===0&&ur()}),r=null;else{switch(ql(i)){case 1:r=xn;break;case 4:r=$l;break;case 16:r=Zi;break;case 536870912:r=Vl;break;default:r=Zi}r=ch(r,eh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function eh(e,t){if(qs=-1,Gs=0,(be&6)!==0)throw Error(h(327));var r=e.callbackNode;if(ai()&&e.callbackNode!==r)return null;var i=is(e,e===qe?Qe:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||t)t=Xs(e,i);else{t=i;var c=be;be|=2;var p=ih();(qe!==e||Qe!==t)&&(Qt=null,li=He()+500,Ir(e,t));do try{Ad();break}catch(N){rh(e,N)}while(!0);uo(),Us.current=p,be=c,je!==null?t=0:(qe=null,Qe=0,t=We)}if(t!==0){if(t===2&&(c=Ln(e),c!==0&&(i=c,t=Xo(e,c))),t===1)throw r=Ui,Ir(e,0),gr(e,i),ht(e,He()),r;if(t===6)gr(e,i);else{if(c=e.current.alternate,(i&30)===0&&!Dd(c)&&(t=Xs(e,i),t===2&&(p=Ln(e),p!==0&&(i=p,t=Xo(e,p))),t===1))throw r=Ui,Ir(e,0),gr(e,i),ht(e,He()),r;switch(e.finishedWork=c,e.finishedLanes=i,t){case 0:case 1:throw Error(h(345));case 2:Nr(e,ct,Qt);break;case 3:if(gr(e,i),(i&130023424)===i&&(t=Ko+500-He(),10<t)){if(is(e,0)!==0)break;if(c=e.suspendedLanes,(c&i)!==i){st(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=eo(Nr.bind(null,e,ct,Qt),t);break}Nr(e,ct,Qt);break;case 4:if(gr(e,i),(i&4194240)===i)break;for(t=e.eventTimes,c=-1;0<i;){var D=31-Lt(i);p=1<<D,D=t[D],D>c&&(c=D),i&=~p}if(i=c,i=He()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Rd(i/1960))-i,10<i){e.timeoutHandle=eo(Nr.bind(null,e,ct,Qt),i);break}Nr(e,ct,Qt);break;case 5:Nr(e,ct,Qt);break;default:throw Error(h(329))}}}return ht(e,He()),e.callbackNode===r?eh.bind(null,e):null}function Xo(e,t){var r=Wi;return e.current.memoizedState.isDehydrated&&(Ir(e,t).flags|=256),e=Xs(e,t),e!==2&&(t=ct,ct=r,t!==null&&Yo(t)),e}function Yo(e){ct===null?ct=e:ct.push.apply(ct,e)}function Dd(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var c=r[i],p=c.getSnapshot;c=c.value;try{if(!Rt(p(),c))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gr(e,t){for(t&=~Vo,t&=~Ws,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Lt(t),i=1<<r;e[r]=-1,t&=~i}}function th(e){if((be&6)!==0)throw Error(h(327));ai();var t=is(e,0);if((t&1)===0)return ht(e,He()),null;var r=Xs(e,t);if(e.tag!==0&&r===2){var i=Ln(e);i!==0&&(t=i,r=Xo(e,i))}if(r===1)throw r=Ui,Ir(e,0),gr(e,t),ht(e,He()),r;if(r===6)throw Error(h(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,ct,Qt),ht(e,He()),null}function Qo(e,t){var r=be;be|=1;try{return e(t)}finally{be=r,be===0&&(li=He()+500,ws&&ur())}}function Mr(e){vr!==null&&vr.tag===0&&(be&6)===0&&ai();var t=be;be|=1;var r=wt.transition,i=Le;try{if(wt.transition=null,Le=1,e)return e()}finally{Le=i,wt.transition=r,be=t,(be&6)===0&&ur()}}function Jo(){mt=oi.current,Oe(oi)}function Ir(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,nd(r)),je!==null)for(r=je.return;r!==null;){var i=r;switch(oo(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&ys();break;case 3:ii(),Oe(ot),Oe(Je),yo();break;case 5:go(i);break;case 4:ii();break;case 13:Oe(Me);break;case 19:Oe(Me);break;case 10:fo(i.type._context);break;case 22:case 23:Jo()}r=r.return}if(qe=e,je=e=Sr(e.current,null),Qe=mt=t,We=0,Ui=null,Vo=Ws=Pr=0,ct=Wi=null,Ar!==null){for(t=0;t<Ar.length;t++)if(r=Ar[t],i=r.interleaved,i!==null){r.interleaved=null;var c=i.next,p=r.pending;if(p!==null){var D=p.next;p.next=c,i.next=D}r.pending=i}Ar=null}return e}function rh(e,t){do{var r=je;try{if(uo(),Bs.current=Is,Os){for(var i=Ie.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Os=!1}if(Or=0,Ke=Ue=Ie=null,Ii=!1,Ni=0,$o.current=null,r===null||r.return===null){We=1,Ui=t,je=null;break}e:{var p=e,D=r.return,N=r,z=t;if(t=Qe,N.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var Y=z,se=N,oe=se.tag;if((se.mode&1)===0&&(oe===0||oe===11||oe===15)){var ie=se.alternate;ie?(se.updateQueue=ie.updateQueue,se.memoizedState=ie.memoizedState,se.lanes=ie.lanes):(se.updateQueue=null,se.memoizedState=null)}var fe=Lc(D);if(fe!==null){fe.flags&=-257,Rc(fe,D,N,p,t),fe.mode&1&&xc(p,Y,t),t=fe,z=Y;var _e=t.updateQueue;if(_e===null){var ve=new Set;ve.add(z),t.updateQueue=ve}else _e.add(z);break e}else{if((t&1)===0){xc(p,Y,t),Zo();break e}z=Error(h(426))}}else if(Pe&&N.mode&1){var Fe=Lc(D);if(Fe!==null){(Fe.flags&65536)===0&&(Fe.flags|=256),Rc(Fe,D,N,p,t),co(si(z,N));break e}}p=z=si(z,N),We!==4&&(We=2),Wi===null?Wi=[p]:Wi.push(p),p=D;do{switch(p.tag){case 3:p.flags|=65536,t&=-t,p.lanes|=t;var K=kc(p,z,t);Qa(p,K);break e;case 1:N=z;var $=p.type,G=p.stateNode;if((p.flags&128)===0&&(typeof $.getDerivedStateFromError=="function"||G!==null&&typeof G.componentDidCatch=="function"&&(_r===null||!_r.has(G)))){p.flags|=65536,t&=-t,p.lanes|=t;var ae=bc(p,N,t);Qa(p,ae);break e}}p=p.return}while(p!==null)}nh(r)}catch(me){t=me,je===r&&r!==null&&(je=r=r.return);continue}break}while(!0)}function ih(){var e=Us.current;return Us.current=Is,e===null?Is:e}function Zo(){(We===0||We===3||We===2)&&(We=4),qe===null||(Pr&268435455)===0&&(Ws&268435455)===0||gr(qe,Qe)}function Xs(e,t){var r=be;be|=2;var i=ih();(qe!==e||Qe!==t)&&(Qt=null,Ir(e,t));do try{Td();break}catch(c){rh(e,c)}while(!0);if(uo(),be=r,Us.current=i,je!==null)throw Error(h(261));return qe=null,Qe=0,We}function Td(){for(;je!==null;)sh(je)}function Ad(){for(;je!==null&&!ru();)sh(je)}function sh(e){var t=ah(e.alternate,e,mt);e.memoizedProps=e.pendingProps,t===null?nh(e):je=t,$o.current=null}function nh(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Ed(r,t,mt),r!==null){je=r;return}}else{if(r=kd(r,t),r!==null){r.flags&=32767,je=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{We=6,je=null;return}}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);We===0&&(We=5)}function Nr(e,t,r){var i=Le,c=wt.transition;try{wt.transition=null,Le=1,Bd(e,t,r,i)}finally{wt.transition=c,Le=i}return null}function Bd(e,t,r,i){do ai();while(vr!==null);if((be&6)!==0)throw Error(h(327));r=e.finishedWork;var c=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(h(177));e.callbackNode=null,e.callbackPriority=0;var p=r.lanes|r.childLanes;if(du(e,p),e===qe&&(je=qe=null,Qe=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Vs||(Vs=!0,ch(Zi,function(){return ai(),null})),p=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||p){p=wt.transition,wt.transition=null;var D=Le;Le=1;var N=be;be|=4,$o.current=null,xd(e,r),Xc(r,e),Ju(Jn),os=!!Qn,Jn=Qn=null,e.current=r,Ld(r),iu(),be=N,Le=D,wt.transition=p}else e.current=r;if(Vs&&(Vs=!1,vr=e,Ks=c),p=e.pendingLanes,p===0&&(_r=null),ou(r.stateNode),ht(e,He()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)c=t[r],i(c.value,{componentStack:c.stack,digest:c.digest});if($s)throw $s=!1,e=qo,qo=null,e;return(Ks&1)!==0&&e.tag!==0&&ai(),p=e.pendingLanes,(p&1)!==0?e===Go?$i++:($i=0,Go=e):$i=0,ur(),null}function ai(){if(vr!==null){var e=ql(Ks),t=wt.transition,r=Le;try{if(wt.transition=null,Le=16>e?16:e,vr===null)var i=!1;else{if(e=vr,vr=null,Ks=0,(be&6)!==0)throw Error(h(331));var c=be;for(be|=4,pe=e.current;pe!==null;){var p=pe,D=p.child;if((pe.flags&16)!==0){var N=p.deletions;if(N!==null){for(var z=0;z<N.length;z++){var Y=N[z];for(pe=Y;pe!==null;){var se=pe;switch(se.tag){case 0:case 11:case 15:zi(8,se,p)}var oe=se.child;if(oe!==null)oe.return=se,pe=oe;else for(;pe!==null;){se=pe;var ie=se.sibling,fe=se.return;if($c(se),se===Y){pe=null;break}if(ie!==null){ie.return=fe,pe=ie;break}pe=fe}}}var _e=p.alternate;if(_e!==null){var ve=_e.child;if(ve!==null){_e.child=null;do{var Fe=ve.sibling;ve.sibling=null,ve=Fe}while(ve!==null)}}pe=p}}if((p.subtreeFlags&2064)!==0&&D!==null)D.return=p,pe=D;else e:for(;pe!==null;){if(p=pe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:zi(9,p,p.return)}var K=p.sibling;if(K!==null){K.return=p.return,pe=K;break e}pe=p.return}}var $=e.current;for(pe=$;pe!==null;){D=pe;var G=D.child;if((D.subtreeFlags&2064)!==0&&G!==null)G.return=D,pe=G;else e:for(D=$;pe!==null;){if(N=pe,(N.flags&2048)!==0)try{switch(N.tag){case 0:case 11:case 15:zs(9,N)}}catch(me){Ne(N,N.return,me)}if(N===D){pe=null;break e}var ae=N.sibling;if(ae!==null){ae.return=N.return,pe=ae;break e}pe=N.return}}if(be=c,ur(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(es,e)}catch{}i=!0}return i}finally{Le=r,wt.transition=t}}return!1}function oh(e,t,r){t=si(r,t),t=kc(e,t,1),e=fr(e,t,1),t=st(),e!==null&&(pi(e,1,t),ht(e,t))}function Ne(e,t,r){if(e.tag===3)oh(e,e,r);else for(;t!==null;){if(t.tag===3){oh(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(_r===null||!_r.has(i))){e=si(r,e),e=bc(t,e,1),t=fr(t,e,1),e=st(),t!==null&&(pi(t,1,e),ht(t,e));break}}t=t.return}}function Od(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&r,qe===e&&(Qe&r)===r&&(We===4||We===3&&(Qe&130023424)===Qe&&500>He()-Ko?Ir(e,0):Vo|=r),ht(e,t)}function lh(e,t){t===0&&((e.mode&1)===0?t=1:(t=rs,rs<<=1,(rs&130023424)===0&&(rs=4194304)));var r=st();e=Gt(e,t),e!==null&&(pi(e,t,r),ht(e,r))}function Pd(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),lh(e,r)}function Md(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(h(314))}i!==null&&i.delete(t),lh(e,r)}var ah;ah=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return at=!1,wd(e,t,r);at=(e.flags&131072)!==0}else at=!1,Pe&&(t.flags&1048576)!==0&&za(t,ks,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Fs(e,t),e=t.pendingProps;var c=Yr(t,Je.current);ri(t,r),c=Eo(null,t,i,e,c,r);var p=ko();return t.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(i)?(p=!0,Cs(t)):p=!1,t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,vo(t),c.updater=Ns,t.stateNode=c,c._reactInternals=t,To(t,i,e,r),t=Po(null,t,i,!0,p,r)):(t.tag=0,Pe&&p&&no(t),it(null,t,c,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Fs(e,t),e=t.pendingProps,c=i._init,i=c(i._payload),t.type=i,c=t.tag=Nd(i),e=Tt(i,e),c){case 0:t=Oo(null,t,i,e,r);break e;case 1:t=Pc(null,t,i,e,r);break e;case 11:t=Dc(null,t,i,e,r);break e;case 14:t=Tc(null,t,i,Tt(i.type,e),r);break e}throw Error(h(306,i,""))}return t;case 0:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Oo(e,t,i,c,r);case 1:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Pc(e,t,i,c,r);case 3:e:{if(Mc(t),e===null)throw Error(h(387));i=t.pendingProps,p=t.memoizedState,c=p.element,Ya(e,t),Ts(t,i,null,r);var D=t.memoizedState;if(i=D.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){c=si(Error(h(423)),t),t=Ic(e,t,i,r,c);break e}else if(i!==c){c=si(Error(h(424)),t),t=Ic(e,t,i,r,c);break e}else for(vt=ar(t.stateNode.containerInfo.firstChild),_t=t,Pe=!0,Dt=null,r=Ga(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Zr(),i===c){t=Yt(e,t,r);break e}it(e,t,i,r)}t=t.child}return t;case 5:return Za(t),e===null&&ao(t),i=t.type,c=t.pendingProps,p=e!==null?e.memoizedProps:null,D=c.children,Zn(i,c)?D=null:p!==null&&Zn(i,p)&&(t.flags|=32),Oc(e,t),it(e,t,D,r),t.child;case 6:return e===null&&ao(t),null;case 13:return Nc(e,t,r);case 4:return mo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ei(t,null,i,r):it(e,t,i,r),t.child;case 11:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Dc(e,t,i,c,r);case 7:return it(e,t,t.pendingProps,r),t.child;case 8:return it(e,t,t.pendingProps.children,r),t.child;case 12:return it(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,c=t.pendingProps,p=t.memoizedProps,D=c.value,De(Ls,i._currentValue),i._currentValue=D,p!==null)if(Rt(p.value,D)){if(p.children===c.children&&!ot.current){t=Yt(e,t,r);break e}}else for(p=t.child,p!==null&&(p.return=t);p!==null;){var N=p.dependencies;if(N!==null){D=p.child;for(var z=N.firstContext;z!==null;){if(z.context===i){if(p.tag===1){z=Xt(-1,r&-r),z.tag=2;var Y=p.updateQueue;if(Y!==null){Y=Y.shared;var se=Y.pending;se===null?z.next=z:(z.next=se.next,se.next=z),Y.pending=z}}p.lanes|=r,z=p.alternate,z!==null&&(z.lanes|=r),po(p.return,r,t),N.lanes|=r;break}z=z.next}}else if(p.tag===10)D=p.type===t.type?null:p.child;else if(p.tag===18){if(D=p.return,D===null)throw Error(h(341));D.lanes|=r,N=D.alternate,N!==null&&(N.lanes|=r),po(D,r,t),D=p.sibling}else D=p.child;if(D!==null)D.return=p;else for(D=p;D!==null;){if(D===t){D=null;break}if(p=D.sibling,p!==null){p.return=D.return,D=p;break}D=D.return}p=D}it(e,t,c.children,r),t=t.child}return t;case 9:return c=t.type,i=t.pendingProps.children,ri(t,r),c=yt(c),i=i(c),t.flags|=1,it(e,t,i,r),t.child;case 14:return i=t.type,c=Tt(i,t.pendingProps),c=Tt(i.type,c),Tc(e,t,i,c,r);case 15:return Ac(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,c=t.pendingProps,c=t.elementType===i?c:Tt(i,c),Fs(e,t),t.tag=1,lt(i)?(e=!0,Cs(t)):e=!1,ri(t,r),wc(t,i,c),To(t,i,c,r),Po(null,t,i,!0,e,r);case 19:return Fc(e,t,r);case 22:return Bc(e,t,r)}throw Error(h(156,t.tag))};function ch(e,t){return Ul(e,t)}function Id(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Et(e,t,r,i){return new Id(e,t,r,i)}function el(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nd(e){if(typeof e=="function")return el(e)?1:0;if(e!=null){if(e=e.$$typeof,e===W)return 11;if(e===te)return 14}return 2}function Sr(e,t){var r=e.alternate;return r===null?(r=Et(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Ys(e,t,r,i,c,p){var D=2;if(i=e,typeof e=="function")el(e)&&(D=1);else if(typeof e=="string")D=5;else e:switch(e){case L:return Hr(r.children,c,p,t);case S:D=8,c|=8;break;case A:return e=Et(12,r,t,c|2),e.elementType=A,e.lanes=p,e;case I:return e=Et(13,r,t,c),e.elementType=I,e.lanes=p,e;case Q:return e=Et(19,r,t,c),e.elementType=Q,e.lanes=p,e;case le:return Qs(r,c,p,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case F:D=10;break e;case j:D=9;break e;case W:D=11;break e;case te:D=14;break e;case ne:D=16,i=null;break e}throw Error(h(130,e==null?e:typeof e,""))}return t=Et(D,r,t,c),t.elementType=e,t.type=i,t.lanes=p,t}function Hr(e,t,r,i){return e=Et(7,e,i,t),e.lanes=r,e}function Qs(e,t,r,i){return e=Et(22,e,i,t),e.elementType=le,e.lanes=r,e.stateNode={isHidden:!1},e}function tl(e,t,r){return e=Et(6,e,null,t),e.lanes=r,e}function rl(e,t,r){return t=Et(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hd(e,t,r,i,c){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=Rn(0),this.expirationTimes=Rn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rn(0),this.identifierPrefix=i,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function il(e,t,r,i,c,p,D,N,z){return e=new Hd(e,t,r,N,z),t===1?(t=1,p===!0&&(t|=8)):t=0,p=Et(3,null,null,t),e.current=p,p.stateNode=e,p.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},vo(p),e}function Fd(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:b,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function hh(e){if(!e)return hr;e=e._reactInternals;e:{if(xr(e)!==e||e.tag!==1)throw Error(h(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(lt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(h(171))}if(e.tag===1){var r=e.type;if(lt(r))return Ha(e,r,t)}return t}function uh(e,t,r,i,c,p,D,N,z){return e=il(r,i,!0,e,c,p,D,N,z),e.context=hh(null),r=e.current,i=st(),c=mr(r),p=Xt(i,c),p.callback=t??null,fr(r,p,c),e.current.lanes=c,pi(e,c,i),ht(e,i),e}function Js(e,t,r,i){var c=t.current,p=st(),D=mr(c);return r=hh(r),t.context===null?t.context=r:t.pendingContext=r,t=Xt(p,D),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=fr(c,t,D),e!==null&&(Ot(e,c,D,p),Ds(e,c,D)),D}function Zs(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 dh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function sl(e,t){dh(e,t),(e=e.alternate)&&dh(e,t)}function jd(){return null}var fh=typeof reportError=="function"?reportError:function(e){console.error(e)};function nl(e){this._internalRoot=e}en.prototype.render=nl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(h(409));Js(e,t,null,null)},en.prototype.unmount=nl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Mr(function(){Js(null,e,null,null)}),t[$t]=null}};function en(e){this._internalRoot=e}en.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<nr.length&&t!==0&&t<nr[r].priority;r++);nr.splice(r,0,e),r===0&&Zl(e)}};function ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function tn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ph(){}function zd(e,t,r,i,c){if(c){if(typeof i=="function"){var p=i;i=function(){var Y=Zs(D);p.call(Y)}}var D=uh(t,i,e,0,null,!1,!1,"",ph);return e._reactRootContainer=D,e[$t]=D.current,Ri(e.nodeType===8?e.parentNode:e),Mr(),D}for(;c=e.lastChild;)e.removeChild(c);if(typeof i=="function"){var N=i;i=function(){var Y=Zs(z);N.call(Y)}}var z=il(e,0,!1,null,null,!1,!1,"",ph);return e._reactRootContainer=z,e[$t]=z.current,Ri(e.nodeType===8?e.parentNode:e),Mr(function(){Js(t,z,r,i)}),z}function rn(e,t,r,i,c){var p=r._reactRootContainer;if(p){var D=p;if(typeof c=="function"){var N=c;c=function(){var z=Zs(D);N.call(z)}}Js(t,D,e,c)}else D=zd(r,t,e,c,i);return Zs(D)}Gl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=fi(t.pendingLanes);r!==0&&(Dn(t,r|1),ht(t,He()),(be&6)===0&&(li=He()+500,ur()))}break;case 13:Mr(function(){var i=Gt(e,1);if(i!==null){var c=st();Ot(i,e,1,c)}}),sl(e,1)}},Tn=function(e){if(e.tag===13){var t=Gt(e,134217728);if(t!==null){var r=st();Ot(t,e,134217728,r)}sl(e,134217728)}},Xl=function(e){if(e.tag===13){var t=mr(e),r=Gt(e,t);if(r!==null){var i=st();Ot(r,e,t,i)}sl(e,t)}},Yl=function(){return Le},Ql=function(e,t){var r=Le;try{return Le=e,t()}finally{Le=r}},wn=function(e,t,r){switch(t){case"input":if(ye(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var c=Ss(i);if(!c)throw Error(h(90));ue(i),ye(i,c)}}}break;case"textarea":er(e,r);break;case"select":t=r.value,t!=null&&Mt(e,!!r.multiple,t,!1)}},Ml=Qo,Il=Mr;var Ud={usingClientEntryPoint:!1,Events:[Ai,Gr,Ss,Ol,Pl,Qo]},Vi={findFiberByHostInstance:Lr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wd={bundleType:Vi.bundleType,version:Vi.version,rendererPackageName:Vi.rendererPackageName,rendererConfig:Vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:_.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=jl(e),e===null?null:e.stateNode},findFiberByHostInstance:Vi.findFiberByHostInstance||jd,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 sn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sn.isDisabled&&sn.supportsFiber)try{es=sn.inject(Wd),It=sn}catch{}}return ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ud,ut.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ol(t))throw Error(h(200));return Fd(e,t,null,r)},ut.createRoot=function(e,t){if(!ol(e))throw Error(h(299));var r=!1,i="",c=fh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=il(e,1,!1,null,null,r,!1,i,c),e[$t]=t.current,Ri(e.nodeType===8?e.parentNode:e),new nl(t)},ut.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(h(188)):(e=Object.keys(e).join(","),Error(h(268,e)));return e=jl(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return Mr(e)},ut.hydrate=function(e,t,r){if(!tn(t))throw Error(h(200));return rn(null,e,t,!0,r)},ut.hydrateRoot=function(e,t,r){if(!ol(e))throw Error(h(405));var i=r!=null&&r.hydratedSources||null,c=!1,p="",D=fh;if(r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onRecoverableError!==void 0&&(D=r.onRecoverableError)),t=uh(t,null,e,1,r??null,c,!1,p,D),e[$t]=t.current,Ri(e),i)for(e=0;e<i.length;e++)r=i[e],c=r._getVersion,c=c(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,c]:t.mutableSourceEagerHydrationData.push(r,c);return new en(t)},ut.render=function(e,t,r){if(!tn(t))throw Error(h(200));return rn(null,e,t,!1,r)},ut.unmountComponentAtNode=function(e){if(!tn(e))throw Error(h(40));return e._reactRootContainer?(Mr(function(){rn(null,null,e,!1,function(){e._reactRootContainer=null,e[$t]=null})}),!0):!1},ut.unstable_batchedUpdates=Qo,ut.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!tn(r))throw Error(h(200));if(e==null||e._reactInternals===void 0)throw Error(h(38));return rn(e,t,r,!1,i)},ut.version="18.3.1-next-f1338f8080-20240426",ut}var wh;function Qd(){if(wh)return cl.exports;wh=1;function C(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C)}catch(d){console.error(d)}}return C(),cl.exports=Yd(),cl.exports}var Eh;function Jd(){if(Eh)return nn;Eh=1;var C=Qd();return nn.createRoot=C.createRoot,nn.hydrateRoot=C.hydrateRoot,nn}var Zd=Jd();const ef=Ph(Zd),kh=C=>{let d;const h=new Set,E=(v,w)=>{const f=typeof v=="function"?v(d):v;if(!Object.is(f,d)){const m=d;d=w??(typeof f!="object"||f===null)?f:Object.assign({},d,f),h.forEach(y=>y(d,m))}},M=()=>d,l={setState:E,getState:M,getInitialState:()=>u,subscribe:v=>(h.add(v),()=>h.delete(v))},u=d=C(E,M,l);return l},tf=(C=>C?kh(C):kh),rf=C=>C;function sf(C,d=rf){const h=Gi.useSyncExternalStore(C.subscribe,Gi.useCallback(()=>d(C.getState()),[C,d]),Gi.useCallback(()=>d(C.getInitialState()),[C,d]));return Gi.useDebugValue(h),h}const bh=C=>{const d=tf(C),h=E=>sf(d,E);return Object.assign(h,d),h},nf=(C=>C?bh(C):bh),Cr=["branch","agent","worktree","running"],pn=[{id:"codex",name:"Codex CLI",command:"codex",installCommand:"npm install -g @openai/codex",description:"OpenAI Codex CLI - AI-powered coding assistant"},{id:"claude",name:"Claude Code",command:"claude",installCommand:"npm install -g @anthropic-ai/claude-code",description:"Anthropic Claude Code - Advanced AI coding assistant"},{id:"gemini",name:"Gemini CLI",command:"gemini",installCommand:"npm install -g @google/gemini-cli",description:"Google Gemini CLI - Multi-modal AI assistant"}],ml=10,an=1,of=3,lf="hjWorktree CLI",af="2.3.0",xh={step:"branch",completedSteps:[],projectInfo:null,branches:[],selectedBranch:null,selectedAgent:"claude",worktreeCount:of,terminals:[],activeTerminalIndex:0,activeSessionId:null,selectedSessionIds:[],isSetupCollapsed:!1,collapsedBranches:[],modalType:null,modalData:null,isLoading:!1,loadingMessage:"",error:null},Ve=nf((C,d)=>({...xh,setStep:h=>C({step:h}),goToStep:h=>{const{canNavigateTo:E,step:M,isStepComplete:V,completedSteps:H}=d();if(!E(h))return;const l=[...H];V(M)&&!l.includes(M)&&l.push(M),C({step:h,completedSteps:l})},goToNext:()=>{const{step:h,isStepComplete:E,completedSteps:M}=d(),V=Cr.indexOf(h);if(V<Cr.length-1&&E(h)){const H=[...M];H.includes(h)||H.push(h),C({step:Cr[V+1],completedSteps:H})}},goToPrev:()=>{const{step:h}=d(),E=Cr.indexOf(h);E>0&&C({step:Cr[E-1]})},canNavigateTo:h=>{const{step:E,completedSteps:M,isStepComplete:V}=d(),H=Cr.indexOf(E),l=Cr.indexOf(h);if(l===H||l<H)return!0;for(let u=0;u<l;u++){const v=Cr[u];if(!M.includes(v)&&!V(v))return!1}return!0},isStepComplete:h=>{const{selectedBranch:E,selectedAgent:M,worktreeCount:V,terminals:H}=d();switch(h){case"branch":return E!==null;case"agent":return M!==null;case"worktree":return V>=an;case"running":return H.length>0;default:return!1}},getStepStatus:h=>{const{step:E,completedSteps:M,isStepComplete:V}=d();return h===E?"current":M.includes(h)||V(h)?"completed":"pending"},setProjectInfo:h=>C({projectInfo:h}),fetchProjectInfo:async()=>{try{const h=await fetch("/api/info");if(!h.ok)throw new Error("Failed to fetch project info");const E=await h.json();C({projectInfo:E})}catch(h){C({error:h instanceof Error?h.message:"Unknown error"})}},setBranches:h=>C({branches:h}),setSelectedBranch:h=>C({selectedBranch:h}),fetchBranches:async()=>{try{const h=await fetch("/api/branches");if(!h.ok)throw new Error("Failed to fetch branches");const E=await h.json();if(C({branches:E}),!d().selectedBranch&&E.length>0){const V=E.find(H=>H.isCurrent);C({selectedBranch:(V==null?void 0:V.name)||E[0].name})}}catch(h){C({error:h instanceof Error?h.message:"Unknown error"})}},setSelectedAgent:h=>C({selectedAgent:h}),setWorktreeCount:h=>C({worktreeCount:Math.max(an,Math.min(ml,h))}),incrementWorktreeCount:()=>{const{worktreeCount:h}=d();h<ml&&C({worktreeCount:h+1})},decrementWorktreeCount:()=>{const{worktreeCount:h}=d();h>an&&C({worktreeCount:h-1})},addTerminal:h=>C(E=>({terminals:[...E.terminals,h]})),updateTerminalStatus:(h,E)=>C(M=>({terminals:M.terminals.map(V=>V.sessionId===h?{...V,status:E}:V)})),removeTerminal:h=>C(E=>{const M=E.terminals.filter(H=>H.sessionId!==h),V=Math.min(E.activeTerminalIndex,Math.max(0,M.length-1));return{terminals:M,activeTerminalIndex:V,step:M.length===0?"branch":E.step,completedSteps:M.length===0?[]:E.completedSteps}}),setActiveTerminal:h=>C({activeTerminalIndex:h}),clearAllTerminals:()=>C({terminals:[],activeTerminalIndex:0,activeSessionId:null,selectedSessionIds:[]}),setActiveSession:h=>{const{terminals:E}=d(),M=E.findIndex(V=>V.sessionId===h);C({activeSessionId:h,activeTerminalIndex:M>=0?M:0})},toggleSessionSelection:h=>C(E=>{const M=[...E.selectedSessionIds],V=M.indexOf(h);return V>=0?M.splice(V,1):M.push(h),{selectedSessionIds:M}}),selectAllSessions:()=>C(h=>({selectedSessionIds:h.terminals.map(E=>E.sessionId)})),clearSessionSelection:()=>C({selectedSessionIds:[]}),removeSelectedSessions:async()=>{const{selectedSessionIds:h,terminals:E}=d();if(h.length===0)return;const M=E.filter(V=>h.includes(V.sessionId)).map(V=>V.worktreeName);try{(await fetch("/api/worktrees/batch",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:M})})).ok&&C(H=>{const l=H.terminals.filter(u=>!h.includes(u.sessionId));return{terminals:l,selectedSessionIds:[],activeTerminalIndex:Math.min(H.activeTerminalIndex,Math.max(0,l.length-1)),activeSessionId:l.length>0?l[0].sessionId:null}})}catch(V){console.error("Failed to remove sessions:",V)}},getSessionGroups:()=>{const{terminals:h,collapsedBranches:E}=d(),M=new Map;for(const H of h){const l=H.branchName.replace(/-project-\d+$/,"");M.has(l)||M.set(l,[]),M.get(l).push(H)}const V=[];for(const[H,l]of M)V.push({branchName:H,sessions:l.map(u=>({...u,id:u.sessionId,createdAt:Date.now()})),isCollapsed:E.includes(H)});return V.sort((H,l)=>H.branchName.localeCompare(l.branchName))},toggleSetupCollapse:()=>C(h=>({isSetupCollapsed:!h.isSetupCollapsed})),toggleBranchCollapse:h=>C(E=>{const M=[...E.collapsedBranches],V=M.indexOf(h);return V>=0?M.splice(V,1):M.push(h),{collapsedBranches:M}}),openModal:(h,E)=>C({modalType:h,modalData:E||null}),closeModal:()=>C({modalType:null,modalData:null}),createSingleWorktree:async(h,E)=>{const{setLoading:M,setError:V,addTerminal:H,setActiveSession:l}=d();M(!0,"Creating worktree..."),V(null);try{const u=await fetch("/api/worktrees/single",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:h,agentType:E})});if(!u.ok){const f=await u.json();throw new Error(f.error||"Failed to create worktree")}const{worktree:v}=await u.json(),w=`${v.name}-${Date.now()}`;H({sessionId:w,worktreePath:v.path,worktreeName:v.name,branchName:v.branch,agentType:E,status:"initializing"}),l(w),C({step:"running",isSetupCollapsed:!0,modalType:null,modalData:null})}catch(u){V(u instanceof Error?u.message:"Unknown error")}finally{M(!1)}},execute:async()=>{const{selectedBranch:h,worktreeCount:E,selectedAgent:M,setLoading:V,setError:H,setStep:l,addTerminal:u}=d();if(!h){H("Please select a branch");return}V(!0,"Creating worktrees..."),H(null);try{const v=await fetch("/api/worktrees",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:h,count:E,agentType:M})});if(!v.ok){const m=await v.json();throw new Error(m.error||"Failed to create worktrees")}const{worktrees:w}=await v.json();for(const m of w){const y=`${m.name}-${Date.now()}`;u({sessionId:y,worktreePath:m.path,worktreeName:m.name,branchName:m.branch,agentType:M,status:"initializing"})}const{terminals:f}=d();C({step:"running",completedSteps:["branch","agent","worktree"],isSetupCollapsed:!0,activeSessionId:f.length>0?f[0].sessionId:null})}catch(v){H(v instanceof Error?v.message:"Unknown error")}finally{V(!1)}},setLoading:(h,E="")=>C({isLoading:h,loadingMessage:E}),setError:h=>C({error:h}),reset:()=>C(xh)})),Ut=Object.create(null);Ut.open="0";Ut.close="1";Ut.ping="2";Ut.pong="3";Ut.message="4";Ut.upgrade="5";Ut.noop="6";const cn=Object.create(null);Object.keys(Ut).forEach(C=>{cn[Ut[C]]=C});const gl={type:"error",data:"parser error"},Mh=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ih=typeof ArrayBuffer=="function",Nh=C=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(C):C&&C.buffer instanceof ArrayBuffer,bl=({type:C,data:d},h,E)=>Mh&&d instanceof Blob?h?E(d):Lh(d,E):Ih&&(d instanceof ArrayBuffer||Nh(d))?h?E(d):Lh(new Blob([d]),E):E(Ut[C]+(d||"")),Lh=(C,d)=>{const h=new FileReader;return h.onload=function(){const E=h.result.split(",")[1];d("b"+(E||""))},h.readAsDataURL(C)};function Rh(C){return C instanceof Uint8Array?C:C instanceof ArrayBuffer?new Uint8Array(C):new Uint8Array(C.buffer,C.byteOffset,C.byteLength)}let dl;function cf(C,d){if(Mh&&C.data instanceof Blob)return C.data.arrayBuffer().then(Rh).then(d);if(Ih&&(C.data instanceof ArrayBuffer||Nh(C.data)))return d(Rh(C.data));bl(C,!1,h=>{dl||(dl=new TextEncoder),d(dl.encode(h))})}const Dh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xi=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let C=0;C<Dh.length;C++)Xi[Dh.charCodeAt(C)]=C;const hf=C=>{let d=C.length*.75,h=C.length,E,M=0,V,H,l,u;C[C.length-1]==="="&&(d--,C[C.length-2]==="="&&d--);const v=new ArrayBuffer(d),w=new Uint8Array(v);for(E=0;E<h;E+=4)V=Xi[C.charCodeAt(E)],H=Xi[C.charCodeAt(E+1)],l=Xi[C.charCodeAt(E+2)],u=Xi[C.charCodeAt(E+3)],w[M++]=V<<2|H>>4,w[M++]=(H&15)<<4|l>>2,w[M++]=(l&3)<<6|u&63;return v},uf=typeof ArrayBuffer=="function",xl=(C,d)=>{if(typeof C!="string")return{type:"message",data:Hh(C,d)};const h=C.charAt(0);return h==="b"?{type:"message",data:df(C.substring(1),d)}:cn[h]?C.length>1?{type:cn[h],data:C.substring(1)}:{type:cn[h]}:gl},df=(C,d)=>{if(uf){const h=hf(C);return Hh(h,d)}else return{base64:!0,data:C}},Hh=(C,d)=>{switch(d){case"blob":return C instanceof Blob?C:new Blob([C]);case"arraybuffer":default:return C instanceof ArrayBuffer?C:C.buffer}},Fh="",ff=(C,d)=>{const h=C.length,E=new Array(h);let M=0;C.forEach((V,H)=>{bl(V,!1,l=>{E[H]=l,++M===h&&d(E.join(Fh))})})},pf=(C,d)=>{const h=C.split(Fh),E=[];for(let M=0;M<h.length;M++){const V=xl(h[M],d);if(E.push(V),V.type==="error")break}return E};function _f(){return new TransformStream({transform(C,d){cf(C,h=>{const E=h.length;let M;if(E<126)M=new Uint8Array(1),new DataView(M.buffer).setUint8(0,E);else if(E<65536){M=new Uint8Array(3);const V=new DataView(M.buffer);V.setUint8(0,126),V.setUint16(1,E)}else{M=new Uint8Array(9);const V=new DataView(M.buffer);V.setUint8(0,127),V.setBigUint64(1,BigInt(E))}C.data&&typeof C.data!="string"&&(M[0]|=128),d.enqueue(M),d.enqueue(h)})}})}let fl;function on(C){return C.reduce((d,h)=>d+h.length,0)}function ln(C,d){if(C[0].length===d)return C.shift();const h=new Uint8Array(d);let E=0;for(let M=0;M<d;M++)h[M]=C[0][E++],E===C[0].length&&(C.shift(),E=0);return C.length&&E<C[0].length&&(C[0]=C[0].slice(E)),h}function vf(C,d){fl||(fl=new TextDecoder);const h=[];let E=0,M=-1,V=!1;return new TransformStream({transform(H,l){for(h.push(H);;){if(E===0){if(on(h)<1)break;const u=ln(h,1);V=(u[0]&128)===128,M=u[0]&127,M<126?E=3:M===126?E=1:E=2}else if(E===1){if(on(h)<2)break;const u=ln(h,2);M=new DataView(u.buffer,u.byteOffset,u.length).getUint16(0),E=3}else if(E===2){if(on(h)<8)break;const u=ln(h,8),v=new DataView(u.buffer,u.byteOffset,u.length),w=v.getUint32(0);if(w>Math.pow(2,21)-1){l.enqueue(gl);break}M=w*Math.pow(2,32)+v.getUint32(4),E=3}else{if(on(h)<M)break;const u=ln(h,M);l.enqueue(xl(V?u:fl.decode(u),d)),E=0}if(M===0||M>C){l.enqueue(gl);break}}}})}const jh=4;function ze(C){if(C)return mf(C)}function mf(C){for(var d in ze.prototype)C[d]=ze.prototype[d];return C}ze.prototype.on=ze.prototype.addEventListener=function(C,d){return this._callbacks=this._callbacks||{},(this._callbacks["$"+C]=this._callbacks["$"+C]||[]).push(d),this};ze.prototype.once=function(C,d){function h(){this.off(C,h),d.apply(this,arguments)}return h.fn=d,this.on(C,h),this};ze.prototype.off=ze.prototype.removeListener=ze.prototype.removeAllListeners=ze.prototype.removeEventListener=function(C,d){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var h=this._callbacks["$"+C];if(!h)return this;if(arguments.length==1)return delete this._callbacks["$"+C],this;for(var E,M=0;M<h.length;M++)if(E=h[M],E===d||E.fn===d){h.splice(M,1);break}return h.length===0&&delete this._callbacks["$"+C],this};ze.prototype.emit=function(C){this._callbacks=this._callbacks||{};for(var d=new Array(arguments.length-1),h=this._callbacks["$"+C],E=1;E<arguments.length;E++)d[E-1]=arguments[E];if(h){h=h.slice(0);for(var E=0,M=h.length;E<M;++E)h[E].apply(this,d)}return this};ze.prototype.emitReserved=ze.prototype.emit;ze.prototype.listeners=function(C){return this._callbacks=this._callbacks||{},this._callbacks["$"+C]||[]};ze.prototype.hasListeners=function(C){return!!this.listeners(C).length};const _n=typeof Promise=="function"&&typeof Promise.resolve=="function"?d=>Promise.resolve().then(d):(d,h)=>h(d,0),bt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),gf="arraybuffer";function zh(C,...d){return d.reduce((h,E)=>(C.hasOwnProperty(E)&&(h[E]=C[E]),h),{})}const Sf=bt.setTimeout,yf=bt.clearTimeout;function vn(C,d){d.useNativeTimers?(C.setTimeoutFn=Sf.bind(bt),C.clearTimeoutFn=yf.bind(bt)):(C.setTimeoutFn=bt.setTimeout.bind(bt),C.clearTimeoutFn=bt.clearTimeout.bind(bt))}const Cf=1.33;function wf(C){return typeof C=="string"?Ef(C):Math.ceil((C.byteLength||C.size)*Cf)}function Ef(C){let d=0,h=0;for(let E=0,M=C.length;E<M;E++)d=C.charCodeAt(E),d<128?h+=1:d<2048?h+=2:d<55296||d>=57344?h+=3:(E++,h+=4);return h}function Uh(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function kf(C){let d="";for(let h in C)C.hasOwnProperty(h)&&(d.length&&(d+="&"),d+=encodeURIComponent(h)+"="+encodeURIComponent(C[h]));return d}function bf(C){let d={},h=C.split("&");for(let E=0,M=h.length;E<M;E++){let V=h[E].split("=");d[decodeURIComponent(V[0])]=decodeURIComponent(V[1])}return d}class xf extends Error{constructor(d,h,E){super(d),this.description=h,this.context=E,this.type="TransportError"}}class Ll extends ze{constructor(d){super(),this.writable=!1,vn(this,d),this.opts=d,this.query=d.query,this.socket=d.socket,this.supportsBinary=!d.forceBase64}onError(d,h,E){return super.emitReserved("error",new xf(d,h,E)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(d){this.readyState==="open"&&this.write(d)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(d){const h=xl(d,this.socket.binaryType);this.onPacket(h)}onPacket(d){super.emitReserved("packet",d)}onClose(d){this.readyState="closed",super.emitReserved("close",d)}pause(d){}createUri(d,h={}){return d+"://"+this._hostname()+this._port()+this.opts.path+this._query(h)}_hostname(){const d=this.opts.hostname;return d.indexOf(":")===-1?d:"["+d+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(d){const h=kf(d);return h.length?"?"+h:""}}class Lf extends Ll{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(d){this.readyState="pausing";const h=()=>{this.readyState="paused",d()};if(this._polling||!this.writable){let E=0;this._polling&&(E++,this.once("pollComplete",function(){--E||h()})),this.writable||(E++,this.once("drain",function(){--E||h()}))}else h()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(d){const h=E=>{if(this.readyState==="opening"&&E.type==="open"&&this.onOpen(),E.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(E)};pf(d,this.socket.binaryType).forEach(h),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const d=()=>{this.write([{type:"close"}])};this.readyState==="open"?d():this.once("open",d)}write(d){this.writable=!1,ff(d,h=>{this.doWrite(h,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const d=this.opts.secure?"https":"http",h=this.query||{};return this.opts.timestampRequests!==!1&&(h[this.opts.timestampParam]=Uh()),!this.supportsBinary&&!h.sid&&(h.b64=1),this.createUri(d,h)}}let Wh=!1;try{Wh=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Rf=Wh;function Df(){}class Tf extends Lf{constructor(d){if(super(d),typeof location<"u"){const h=location.protocol==="https:";let E=location.port;E||(E=h?"443":"80"),this.xd=typeof location<"u"&&d.hostname!==location.hostname||E!==d.port}}doWrite(d,h){const E=this.request({method:"POST",data:d});E.on("success",h),E.on("error",(M,V)=>{this.onError("xhr post error",M,V)})}doPoll(){const d=this.request();d.on("data",this.onData.bind(this)),d.on("error",(h,E)=>{this.onError("xhr poll error",h,E)}),this.pollXhr=d}}class zt extends ze{constructor(d,h,E){super(),this.createRequest=d,vn(this,E),this._opts=E,this._method=E.method||"GET",this._uri=h,this._data=E.data!==void 0?E.data:null,this._create()}_create(){var d;const h=zh(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");h.xdomain=!!this._opts.xd;const E=this._xhr=this.createRequest(h);try{E.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){E.setDisableHeaderCheck&&E.setDisableHeaderCheck(!0);for(let M in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(M)&&E.setRequestHeader(M,this._opts.extraHeaders[M])}}catch{}if(this._method==="POST")try{E.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{E.setRequestHeader("Accept","*/*")}catch{}(d=this._opts.cookieJar)===null||d===void 0||d.addCookies(E),"withCredentials"in E&&(E.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(E.timeout=this._opts.requestTimeout),E.onreadystatechange=()=>{var M;E.readyState===3&&((M=this._opts.cookieJar)===null||M===void 0||M.parseCookies(E.getResponseHeader("set-cookie"))),E.readyState===4&&(E.status===200||E.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof E.status=="number"?E.status:0)},0))},E.send(this._data)}catch(M){this.setTimeoutFn(()=>{this._onError(M)},0);return}typeof document<"u"&&(this._index=zt.requestsCount++,zt.requests[this._index]=this)}_onError(d){this.emitReserved("error",d,this._xhr),this._cleanup(!0)}_cleanup(d){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Df,d)try{this._xhr.abort()}catch{}typeof document<"u"&&delete zt.requests[this._index],this._xhr=null}}_onLoad(){const d=this._xhr.responseText;d!==null&&(this.emitReserved("data",d),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}zt.requestsCount=0;zt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Th);else if(typeof addEventListener=="function"){const C="onpagehide"in bt?"pagehide":"unload";addEventListener(C,Th,!1)}}function Th(){for(let C in zt.requests)zt.requests.hasOwnProperty(C)&&zt.requests[C].abort()}const Af=(function(){const C=$h({xdomain:!1});return C&&C.responseType!==null})();class Bf extends Tf{constructor(d){super(d);const h=d&&d.forceBase64;this.supportsBinary=Af&&!h}request(d={}){return Object.assign(d,{xd:this.xd},this.opts),new zt($h,this.uri(),d)}}function $h(C){const d=C.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!d||Rf))return new XMLHttpRequest}catch{}if(!d)try{return new bt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Vh=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Of extends Ll{get name(){return"websocket"}doOpen(){const d=this.uri(),h=this.opts.protocols,E=Vh?{}:zh(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(E.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(d,h,E)}catch(M){return this.emitReserved("error",M)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=d=>this.onClose({description:"websocket connection closed",context:d}),this.ws.onmessage=d=>this.onData(d.data),this.ws.onerror=d=>this.onError("websocket error",d)}write(d){this.writable=!1;for(let h=0;h<d.length;h++){const E=d[h],M=h===d.length-1;bl(E,this.supportsBinary,V=>{try{this.doWrite(E,V)}catch{}M&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const d=this.opts.secure?"wss":"ws",h=this.query||{};return this.opts.timestampRequests&&(h[this.opts.timestampParam]=Uh()),this.supportsBinary||(h.b64=1),this.createUri(d,h)}}const pl=bt.WebSocket||bt.MozWebSocket;class Pf extends Of{createSocket(d,h,E){return Vh?new pl(d,h,E):h?new pl(d,h):new pl(d)}doWrite(d,h){this.ws.send(h)}}class Mf extends Ll{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(d){return this.emitReserved("error",d)}this._transport.closed.then(()=>{this.onClose()}).catch(d=>{this.onError("webtransport error",d)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(d=>{const h=vf(Number.MAX_SAFE_INTEGER,this.socket.binaryType),E=d.readable.pipeThrough(h).getReader(),M=_f();M.readable.pipeTo(d.writable),this._writer=M.writable.getWriter();const V=()=>{E.read().then(({done:l,value:u})=>{l||(this.onPacket(u),V())}).catch(l=>{})};V();const H={type:"open"};this.query.sid&&(H.data=`{"sid":"${this.query.sid}"}`),this._writer.write(H).then(()=>this.onOpen())})})}write(d){this.writable=!1;for(let h=0;h<d.length;h++){const E=d[h],M=h===d.length-1;this._writer.write(E).then(()=>{M&&_n(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var d;(d=this._transport)===null||d===void 0||d.close()}}const If={websocket:Pf,webtransport:Mf,polling:Bf},Nf=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Hf=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Sl(C){if(C.length>8e3)throw"URI too long";const d=C,h=C.indexOf("["),E=C.indexOf("]");h!=-1&&E!=-1&&(C=C.substring(0,h)+C.substring(h,E).replace(/:/g,";")+C.substring(E,C.length));let M=Nf.exec(C||""),V={},H=14;for(;H--;)V[Hf[H]]=M[H]||"";return h!=-1&&E!=-1&&(V.source=d,V.host=V.host.substring(1,V.host.length-1).replace(/;/g,":"),V.authority=V.authority.replace("[","").replace("]","").replace(/;/g,":"),V.ipv6uri=!0),V.pathNames=Ff(V,V.path),V.queryKey=jf(V,V.query),V}function Ff(C,d){const h=/\/{2,9}/g,E=d.replace(h,"/").split("/");return(d.slice(0,1)=="/"||d.length===0)&&E.splice(0,1),d.slice(-1)=="/"&&E.splice(E.length-1,1),E}function jf(C,d){const h={};return d.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(E,M,V){M&&(h[M]=V)}),h}const yl=typeof addEventListener=="function"&&typeof removeEventListener=="function",hn=[];yl&&addEventListener("offline",()=>{hn.forEach(C=>C())},!1);class wr extends ze{constructor(d,h){if(super(),this.binaryType=gf,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,d&&typeof d=="object"&&(h=d,d=null),d){const E=Sl(d);h.hostname=E.host,h.secure=E.protocol==="https"||E.protocol==="wss",h.port=E.port,E.query&&(h.query=E.query)}else h.host&&(h.hostname=Sl(h.host).host);vn(this,h),this.secure=h.secure!=null?h.secure:typeof location<"u"&&location.protocol==="https:",h.hostname&&!h.port&&(h.port=this.secure?"443":"80"),this.hostname=h.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=h.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},h.transports.forEach(E=>{const M=E.prototype.name;this.transports.push(M),this._transportsByName[M]=E}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},h),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=bf(this.opts.query)),yl&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},hn.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(d){const h=Object.assign({},this.opts.query);h.EIO=jh,h.transport=d,this.id&&(h.sid=this.id);const E=Object.assign({},this.opts,{query:h,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[d]);return new this._transportsByName[d](E)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const d=this.opts.rememberUpgrade&&wr.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const h=this.createTransport(d);h.open(),this.setTransport(h)}setTransport(d){this.transport&&this.transport.removeAllListeners(),this.transport=d,d.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",h=>this._onClose("transport close",h))}onOpen(){this.readyState="open",wr.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(d){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",d),this.emitReserved("heartbeat"),d.type){case"open":this.onHandshake(JSON.parse(d.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const h=new Error("server error");h.code=d.data,this._onError(h);break;case"message":this.emitReserved("data",d.data),this.emitReserved("message",d.data);break}}onHandshake(d){this.emitReserved("handshake",d),this.id=d.sid,this.transport.query.sid=d.sid,this._pingInterval=d.pingInterval,this._pingTimeout=d.pingTimeout,this._maxPayload=d.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const d=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+d,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},d),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const d=this._getWritablePackets();this.transport.send(d),this._prevBufferLen=d.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let h=1;for(let E=0;E<this.writeBuffer.length;E++){const M=this.writeBuffer[E].data;if(M&&(h+=wf(M)),E>0&&h>this._maxPayload)return this.writeBuffer.slice(0,E);h+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const d=Date.now()>this._pingTimeoutTime;return d&&(this._pingTimeoutTime=0,_n(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),d}write(d,h,E){return this._sendPacket("message",d,h,E),this}send(d,h,E){return this._sendPacket("message",d,h,E),this}_sendPacket(d,h,E,M){if(typeof h=="function"&&(M=h,h=void 0),typeof E=="function"&&(M=E,E=null),this.readyState==="closing"||this.readyState==="closed")return;E=E||{},E.compress=E.compress!==!1;const V={type:d,data:h,options:E};this.emitReserved("packetCreate",V),this.writeBuffer.push(V),M&&this.once("flush",M),this.flush()}close(){const d=()=>{this._onClose("forced close"),this.transport.close()},h=()=>{this.off("upgrade",h),this.off("upgradeError",h),d()},E=()=>{this.once("upgrade",h),this.once("upgradeError",h)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?E():d()}):this.upgrading?E():d()),this}_onError(d){if(wr.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",d),this._onClose("transport error",d)}_onClose(d,h){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),yl&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const E=hn.indexOf(this._offlineEventListener);E!==-1&&hn.splice(E,1)}this.readyState="closed",this.id=null,this.emitReserved("close",d,h),this.writeBuffer=[],this._prevBufferLen=0}}}wr.protocol=jh;class zf extends wr{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let d=0;d<this._upgrades.length;d++)this._probe(this._upgrades[d])}_probe(d){let h=this.createTransport(d),E=!1;wr.priorWebsocketSuccess=!1;const M=()=>{E||(h.send([{type:"ping",data:"probe"}]),h.once("packet",f=>{if(!E)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",h),!h)return;wr.priorWebsocketSuccess=h.name==="websocket",this.transport.pause(()=>{E||this.readyState!=="closed"&&(w(),this.setTransport(h),h.send([{type:"upgrade"}]),this.emitReserved("upgrade",h),h=null,this.upgrading=!1,this.flush())})}else{const m=new Error("probe error");m.transport=h.name,this.emitReserved("upgradeError",m)}}))};function V(){E||(E=!0,w(),h.close(),h=null)}const H=f=>{const m=new Error("probe error: "+f);m.transport=h.name,V(),this.emitReserved("upgradeError",m)};function l(){H("transport closed")}function u(){H("socket closed")}function v(f){h&&f.name!==h.name&&V()}const w=()=>{h.removeListener("open",M),h.removeListener("error",H),h.removeListener("close",l),this.off("close",u),this.off("upgrading",v)};h.once("open",M),h.once("error",H),h.once("close",l),this.once("close",u),this.once("upgrading",v),this._upgrades.indexOf("webtransport")!==-1&&d!=="webtransport"?this.setTimeoutFn(()=>{E||h.open()},200):h.open()}onHandshake(d){this._upgrades=this._filterUpgrades(d.upgrades),super.onHandshake(d)}_filterUpgrades(d){const h=[];for(let E=0;E<d.length;E++)~this.transports.indexOf(d[E])&&h.push(d[E]);return h}}let Uf=class extends zf{constructor(d,h={}){const E=typeof d=="object"?d:h;(!E.transports||E.transports&&typeof E.transports[0]=="string")&&(E.transports=(E.transports||["polling","websocket","webtransport"]).map(M=>If[M]).filter(M=>!!M)),super(d,E)}};function Wf(C,d="",h){let E=C;h=h||typeof location<"u"&&location,C==null&&(C=h.protocol+"//"+h.host),typeof C=="string"&&(C.charAt(0)==="/"&&(C.charAt(1)==="/"?C=h.protocol+C:C=h.host+C),/^(https?|wss?):\/\//.test(C)||(typeof h<"u"?C=h.protocol+"//"+C:C="https://"+C),E=Sl(C)),E.port||(/^(http|ws)$/.test(E.protocol)?E.port="80":/^(http|ws)s$/.test(E.protocol)&&(E.port="443")),E.path=E.path||"/";const V=E.host.indexOf(":")!==-1?"["+E.host+"]":E.host;return E.id=E.protocol+"://"+V+":"+E.port+d,E.href=E.protocol+"://"+V+(h&&h.port===E.port?"":":"+E.port),E}const $f=typeof ArrayBuffer=="function",Vf=C=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(C):C.buffer instanceof ArrayBuffer,Kh=Object.prototype.toString,Kf=typeof Blob=="function"||typeof Blob<"u"&&Kh.call(Blob)==="[object BlobConstructor]",qf=typeof File=="function"||typeof File<"u"&&Kh.call(File)==="[object FileConstructor]";function Rl(C){return $f&&(C instanceof ArrayBuffer||Vf(C))||Kf&&C instanceof Blob||qf&&C instanceof File}function un(C,d){if(!C||typeof C!="object")return!1;if(Array.isArray(C)){for(let h=0,E=C.length;h<E;h++)if(un(C[h]))return!0;return!1}if(Rl(C))return!0;if(C.toJSON&&typeof C.toJSON=="function"&&arguments.length===1)return un(C.toJSON(),!0);for(const h in C)if(Object.prototype.hasOwnProperty.call(C,h)&&un(C[h]))return!0;return!1}function Gf(C){const d=[],h=C.data,E=C;return E.data=Cl(h,d),E.attachments=d.length,{packet:E,buffers:d}}function Cl(C,d){if(!C)return C;if(Rl(C)){const h={_placeholder:!0,num:d.length};return d.push(C),h}else if(Array.isArray(C)){const h=new Array(C.length);for(let E=0;E<C.length;E++)h[E]=Cl(C[E],d);return h}else if(typeof C=="object"&&!(C instanceof Date)){const h={};for(const E in C)Object.prototype.hasOwnProperty.call(C,E)&&(h[E]=Cl(C[E],d));return h}return C}function Xf(C,d){return C.data=wl(C.data,d),delete C.attachments,C}function wl(C,d){if(!C)return C;if(C&&C._placeholder===!0){if(typeof C.num=="number"&&C.num>=0&&C.num<d.length)return d[C.num];throw new Error("illegal attachments")}else if(Array.isArray(C))for(let h=0;h<C.length;h++)C[h]=wl(C[h],d);else if(typeof C=="object")for(const h in C)Object.prototype.hasOwnProperty.call(C,h)&&(C[h]=wl(C[h],d));return C}const qh=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Yf=5;var we;(function(C){C[C.CONNECT=0]="CONNECT",C[C.DISCONNECT=1]="DISCONNECT",C[C.EVENT=2]="EVENT",C[C.ACK=3]="ACK",C[C.CONNECT_ERROR=4]="CONNECT_ERROR",C[C.BINARY_EVENT=5]="BINARY_EVENT",C[C.BINARY_ACK=6]="BINARY_ACK"})(we||(we={}));class Qf{constructor(d){this.replacer=d}encode(d){return(d.type===we.EVENT||d.type===we.ACK)&&un(d)?this.encodeAsBinary({type:d.type===we.EVENT?we.BINARY_EVENT:we.BINARY_ACK,nsp:d.nsp,data:d.data,id:d.id}):[this.encodeAsString(d)]}encodeAsString(d){let h=""+d.type;return(d.type===we.BINARY_EVENT||d.type===we.BINARY_ACK)&&(h+=d.attachments+"-"),d.nsp&&d.nsp!=="/"&&(h+=d.nsp+","),d.id!=null&&(h+=d.id),d.data!=null&&(h+=JSON.stringify(d.data,this.replacer)),h}encodeAsBinary(d){const h=Gf(d),E=this.encodeAsString(h.packet),M=h.buffers;return M.unshift(E),M}}class Dl extends ze{constructor(d){super(),this.reviver=d}add(d){let h;if(typeof d=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");h=this.decodeString(d);const E=h.type===we.BINARY_EVENT;E||h.type===we.BINARY_ACK?(h.type=E?we.EVENT:we.ACK,this.reconstructor=new Jf(h),h.attachments===0&&super.emitReserved("decoded",h)):super.emitReserved("decoded",h)}else if(Rl(d)||d.base64)if(this.reconstructor)h=this.reconstructor.takeBinaryData(d),h&&(this.reconstructor=null,super.emitReserved("decoded",h));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+d)}decodeString(d){let h=0;const E={type:Number(d.charAt(0))};if(we[E.type]===void 0)throw new Error("unknown packet type "+E.type);if(E.type===we.BINARY_EVENT||E.type===we.BINARY_ACK){const V=h+1;for(;d.charAt(++h)!=="-"&&h!=d.length;);const H=d.substring(V,h);if(H!=Number(H)||d.charAt(h)!=="-")throw new Error("Illegal attachments");E.attachments=Number(H)}if(d.charAt(h+1)==="/"){const V=h+1;for(;++h&&!(d.charAt(h)===","||h===d.length););E.nsp=d.substring(V,h)}else E.nsp="/";const M=d.charAt(h+1);if(M!==""&&Number(M)==M){const V=h+1;for(;++h;){const H=d.charAt(h);if(H==null||Number(H)!=H){--h;break}if(h===d.length)break}E.id=Number(d.substring(V,h+1))}if(d.charAt(++h)){const V=this.tryParse(d.substr(h));if(Dl.isPayloadValid(E.type,V))E.data=V;else throw new Error("invalid payload")}return E}tryParse(d){try{return JSON.parse(d,this.reviver)}catch{return!1}}static isPayloadValid(d,h){switch(d){case we.CONNECT:return fn(h);case we.DISCONNECT:return h===void 0;case we.CONNECT_ERROR:return typeof h=="string"||fn(h);case we.EVENT:case we.BINARY_EVENT:return Array.isArray(h)&&(typeof h[0]=="number"||typeof h[0]=="string"&&qh.indexOf(h[0])===-1);case we.ACK:case we.BINARY_ACK:return Array.isArray(h)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Jf{constructor(d){this.packet=d,this.buffers=[],this.reconPack=d}takeBinaryData(d){if(this.buffers.push(d),this.buffers.length===this.reconPack.attachments){const h=Xf(this.reconPack,this.buffers);return this.finishedReconstruction(),h}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function Zf(C){return typeof C=="string"}const ep=Number.isInteger||function(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C};function tp(C){return C===void 0||ep(C)}function fn(C){return Object.prototype.toString.call(C)==="[object Object]"}function rp(C,d){switch(C){case we.CONNECT:return d===void 0||fn(d);case we.DISCONNECT:return d===void 0;case we.EVENT:return Array.isArray(d)&&(typeof d[0]=="number"||typeof d[0]=="string"&&qh.indexOf(d[0])===-1);case we.ACK:return Array.isArray(d);case we.CONNECT_ERROR:return typeof d=="string"||fn(d);default:return!1}}function ip(C){return Zf(C.nsp)&&tp(C.id)&&rp(C.type,C.data)}const sp=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Dl,Encoder:Qf,get PacketType(){return we},isPacketValid:ip,protocol:Yf},Symbol.toStringTag,{value:"Module"}));function Pt(C,d,h){return C.on(d,h),function(){C.off(d,h)}}const np=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Gh extends ze{constructor(d,h,E){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=d,this.nsp=h,E&&E.auth&&(this.auth=E.auth),this._opts=Object.assign({},E),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const d=this.io;this.subs=[Pt(d,"open",this.onopen.bind(this)),Pt(d,"packet",this.onpacket.bind(this)),Pt(d,"error",this.onerror.bind(this)),Pt(d,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...d){return d.unshift("message"),this.emit.apply(this,d),this}emit(d,...h){var E,M,V;if(np.hasOwnProperty(d))throw new Error('"'+d.toString()+'" is a reserved event name');if(h.unshift(d),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(h),this;const H={type:we.EVENT,data:h};if(H.options={},H.options.compress=this.flags.compress!==!1,typeof h[h.length-1]=="function"){const w=this.ids++,f=h.pop();this._registerAckCallback(w,f),H.id=w}const l=(M=(E=this.io.engine)===null||E===void 0?void 0:E.transport)===null||M===void 0?void 0:M.writable,u=this.connected&&!(!((V=this.io.engine)===null||V===void 0)&&V._hasPingExpired());return this.flags.volatile&&!l||(u?(this.notifyOutgoingListeners(H),this.packet(H)):this.sendBuffer.push(H)),this.flags={},this}_registerAckCallback(d,h){var E;const M=(E=this.flags.timeout)!==null&&E!==void 0?E:this._opts.ackTimeout;if(M===void 0){this.acks[d]=h;return}const V=this.io.setTimeoutFn(()=>{delete this.acks[d];for(let l=0;l<this.sendBuffer.length;l++)this.sendBuffer[l].id===d&&this.sendBuffer.splice(l,1);h.call(this,new Error("operation has timed out"))},M),H=(...l)=>{this.io.clearTimeoutFn(V),h.apply(this,l)};H.withError=!0,this.acks[d]=H}emitWithAck(d,...h){return new Promise((E,M)=>{const V=(H,l)=>H?M(H):E(l);V.withError=!0,h.push(V),this.emit(d,...h)})}_addToQueue(d){let h;typeof d[d.length-1]=="function"&&(h=d.pop());const E={id:this._queueSeq++,tryCount:0,pending:!1,args:d,flags:Object.assign({fromQueue:!0},this.flags)};d.push((M,...V)=>(this._queue[0],M!==null?E.tryCount>this._opts.retries&&(this._queue.shift(),h&&h(M)):(this._queue.shift(),h&&h(null,...V)),E.pending=!1,this._drainQueue())),this._queue.push(E),this._drainQueue()}_drainQueue(d=!1){if(!this.connected||this._queue.length===0)return;const h=this._queue[0];h.pending&&!d||(h.pending=!0,h.tryCount++,this.flags=h.flags,this.emit.apply(this,h.args))}packet(d){d.nsp=this.nsp,this.io._packet(d)}onopen(){typeof this.auth=="function"?this.auth(d=>{this._sendConnectPacket(d)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(d){this.packet({type:we.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},d):d})}onerror(d){this.connected||this.emitReserved("connect_error",d)}onclose(d,h){this.connected=!1,delete this.id,this.emitReserved("disconnect",d,h),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(d=>{if(!this.sendBuffer.some(E=>String(E.id)===d)){const E=this.acks[d];delete this.acks[d],E.withError&&E.call(this,new Error("socket has been disconnected"))}})}onpacket(d){if(d.nsp===this.nsp)switch(d.type){case we.CONNECT:d.data&&d.data.sid?this.onconnect(d.data.sid,d.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case we.EVENT:case we.BINARY_EVENT:this.onevent(d);break;case we.ACK:case we.BINARY_ACK:this.onack(d);break;case we.DISCONNECT:this.ondisconnect();break;case we.CONNECT_ERROR:this.destroy();const E=new Error(d.data.message);E.data=d.data.data,this.emitReserved("connect_error",E);break}}onevent(d){const h=d.data||[];d.id!=null&&h.push(this.ack(d.id)),this.connected?this.emitEvent(h):this.receiveBuffer.push(Object.freeze(h))}emitEvent(d){if(this._anyListeners&&this._anyListeners.length){const h=this._anyListeners.slice();for(const E of h)E.apply(this,d)}super.emit.apply(this,d),this._pid&&d.length&&typeof d[d.length-1]=="string"&&(this._lastOffset=d[d.length-1])}ack(d){const h=this;let E=!1;return function(...M){E||(E=!0,h.packet({type:we.ACK,id:d,data:M}))}}onack(d){const h=this.acks[d.id];typeof h=="function"&&(delete this.acks[d.id],h.withError&&d.data.unshift(null),h.apply(this,d.data))}onconnect(d,h){this.id=d,this.recovered=h&&this._pid===h,this._pid=h,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(d=>this.emitEvent(d)),this.receiveBuffer=[],this.sendBuffer.forEach(d=>{this.notifyOutgoingListeners(d),this.packet(d)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(d=>d()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:we.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(d){return this.flags.compress=d,this}get volatile(){return this.flags.volatile=!0,this}timeout(d){return this.flags.timeout=d,this}onAny(d){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(d),this}prependAny(d){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(d),this}offAny(d){if(!this._anyListeners)return this;if(d){const h=this._anyListeners;for(let E=0;E<h.length;E++)if(d===h[E])return h.splice(E,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(d){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(d),this}prependAnyOutgoing(d){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(d),this}offAnyOutgoing(d){if(!this._anyOutgoingListeners)return this;if(d){const h=this._anyOutgoingListeners;for(let E=0;E<h.length;E++)if(d===h[E])return h.splice(E,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(d){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const h=this._anyOutgoingListeners.slice();for(const E of h)E.apply(this,d.data)}}}function ci(C){C=C||{},this.ms=C.min||100,this.max=C.max||1e4,this.factor=C.factor||2,this.jitter=C.jitter>0&&C.jitter<=1?C.jitter:0,this.attempts=0}ci.prototype.duration=function(){var C=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var d=Math.random(),h=Math.floor(d*this.jitter*C);C=(Math.floor(d*10)&1)==0?C-h:C+h}return Math.min(C,this.max)|0};ci.prototype.reset=function(){this.attempts=0};ci.prototype.setMin=function(C){this.ms=C};ci.prototype.setMax=function(C){this.max=C};ci.prototype.setJitter=function(C){this.jitter=C};class El extends ze{constructor(d,h){var E;super(),this.nsps={},this.subs=[],d&&typeof d=="object"&&(h=d,d=void 0),h=h||{},h.path=h.path||"/socket.io",this.opts=h,vn(this,h),this.reconnection(h.reconnection!==!1),this.reconnectionAttempts(h.reconnectionAttempts||1/0),this.reconnectionDelay(h.reconnectionDelay||1e3),this.reconnectionDelayMax(h.reconnectionDelayMax||5e3),this.randomizationFactor((E=h.randomizationFactor)!==null&&E!==void 0?E:.5),this.backoff=new ci({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(h.timeout==null?2e4:h.timeout),this._readyState="closed",this.uri=d;const M=h.parser||sp;this.encoder=new M.Encoder,this.decoder=new M.Decoder,this._autoConnect=h.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(d){return arguments.length?(this._reconnection=!!d,d||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(d){return d===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=d,this)}reconnectionDelay(d){var h;return d===void 0?this._reconnectionDelay:(this._reconnectionDelay=d,(h=this.backoff)===null||h===void 0||h.setMin(d),this)}randomizationFactor(d){var h;return d===void 0?this._randomizationFactor:(this._randomizationFactor=d,(h=this.backoff)===null||h===void 0||h.setJitter(d),this)}reconnectionDelayMax(d){var h;return d===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=d,(h=this.backoff)===null||h===void 0||h.setMax(d),this)}timeout(d){return arguments.length?(this._timeout=d,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(d){if(~this._readyState.indexOf("open"))return this;this.engine=new Uf(this.uri,this.opts);const h=this.engine,E=this;this._readyState="opening",this.skipReconnect=!1;const M=Pt(h,"open",function(){E.onopen(),d&&d()}),V=l=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",l),d?d(l):this.maybeReconnectOnOpen()},H=Pt(h,"error",V);if(this._timeout!==!1){const l=this._timeout,u=this.setTimeoutFn(()=>{M(),V(new Error("timeout")),h.close()},l);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}return this.subs.push(M),this.subs.push(H),this}connect(d){return this.open(d)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const d=this.engine;this.subs.push(Pt(d,"ping",this.onping.bind(this)),Pt(d,"data",this.ondata.bind(this)),Pt(d,"error",this.onerror.bind(this)),Pt(d,"close",this.onclose.bind(this)),Pt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(d){try{this.decoder.add(d)}catch(h){this.onclose("parse error",h)}}ondecoded(d){_n(()=>{this.emitReserved("packet",d)},this.setTimeoutFn)}onerror(d){this.emitReserved("error",d)}socket(d,h){let E=this.nsps[d];return E?this._autoConnect&&!E.active&&E.connect():(E=new Gh(this,d,h),this.nsps[d]=E),E}_destroy(d){const h=Object.keys(this.nsps);for(const E of h)if(this.nsps[E].active)return;this._close()}_packet(d){const h=this.encoder.encode(d);for(let E=0;E<h.length;E++)this.engine.write(h[E],d.options)}cleanup(){this.subs.forEach(d=>d()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(d,h){var E;this.cleanup(),(E=this.engine)===null||E===void 0||E.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",d,h),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const d=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const h=this.backoff.duration();this._reconnecting=!0;const E=this.setTimeoutFn(()=>{d.skipReconnect||(this.emitReserved("reconnect_attempt",d.backoff.attempts),!d.skipReconnect&&d.open(M=>{M?(d._reconnecting=!1,d.reconnect(),this.emitReserved("reconnect_error",M)):d.onreconnect()}))},h);this.opts.autoUnref&&E.unref(),this.subs.push(()=>{this.clearTimeoutFn(E)})}}onreconnect(){const d=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",d)}}const qi={};function dn(C,d){typeof C=="object"&&(d=C,C=void 0),d=d||{};const h=Wf(C,d.path||"/socket.io"),E=h.source,M=h.id,V=h.path,H=qi[M]&&V in qi[M].nsps,l=d.forceNew||d["force new connection"]||d.multiplex===!1||H;let u;return l?u=new El(E,d):(qi[M]||(qi[M]=new El(E,d)),u=qi[M]),h.query&&!d.query&&(d.query=h.queryKey),u.socket(h.path,d)}Object.assign(dn,{Manager:El,Socket:Gh,io:dn,connect:dn});let kt=null;function mn(){const[C,d]=$e.useState(!1),h=$e.useRef(null);$e.useEffect(()=>{kt||(kt=dn(window.location.origin,{reconnection:!0,reconnectionAttempts:5,reconnectionDelay:1e3})),h.current=kt;const H=()=>{console.log("Socket connected"),d(!0)},l=()=>{console.log("Socket disconnected"),d(!1)};return kt.on("connect",H),kt.on("disconnect",l),kt.connected&&d(!0),()=>{kt==null||kt.off("connect",H),kt==null||kt.off("disconnect",l)}},[]);const E=$e.useCallback((H,l)=>{var u;(u=h.current)==null||u.emit(H,l)},[]),M=$e.useCallback((H,l)=>{var u;(u=h.current)==null||u.on(H,l)},[]),V=$e.useCallback((H,l)=>{var u,v;l?(u=h.current)==null||u.off(H,l):(v=h.current)==null||v.off(H)},[]);return{socket:h.current,connected:C,emit:E,on:M,off:V}}function op(){const C=Ve(d=>d.projectInfo);return q.jsxs("header",{className:"header",children:[q.jsx("h1",{children:lf}),q.jsxs("div",{className:"project-info",children:[C&&q.jsxs(q.Fragment,{children:[q.jsxs("span",{className:"branch",children:[q.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:q.jsx("path",{d:"M11.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zm-2.25.75a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25zM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5zM3.5 3.25a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0z"})}),C.currentBranch||"Unknown"]}),q.jsx("span",{children:C.cwd})]}),q.jsxs("span",{children:["v",af]})]})]})}const lp=[{id:"branch",number:1,label:"Branch"},{id:"agent",number:2,label:"Agent"},{id:"worktree",number:3,label:"Count"}];function ap({number:C,label:d,status:h,onClick:E,disabled:M}){return q.jsxs("button",{className:`lnb-step ${h}`,onClick:E,disabled:M,type:"button",children:[q.jsx("span",{className:"step-number",children:h==="completed"?"✓":C}),q.jsx("span",{className:"step-label",children:d})]})}function cp(){const{step:C,goToStep:d,canNavigateTo:h,getStepStatus:E,isSetupCollapsed:M,toggleSetupCollapse:V,terminals:H}=Ve(),l=H.length>0;return q.jsxs("div",{className:"lnb-section setup-section",children:[q.jsxs("div",{className:"lnb-section-header",onClick:V,role:"button",tabIndex:0,children:[q.jsx("span",{className:"section-title",children:"SETUP"}),q.jsx("span",{className:"collapse-icon",children:M?"+":"−"})]}),!M&&q.jsxs("div",{className:"lnb-steps",children:[lp.map(u=>q.jsx(ap,{step:u.id,number:u.number,label:u.label,status:E(u.id),onClick:()=>d(u.id),disabled:!h(u.id)},u.id)),l&&q.jsxs("button",{className:`lnb-step ${C==="running"?"current":"completed"}`,onClick:()=>d("running"),type:"button",children:[q.jsx("span",{className:"step-number",children:"4"}),q.jsx("span",{className:"step-label",children:"Running"})]})]})]})}function hp({status:C}){const d={initializing:"#f59e0b",installing:"#f59e0b",running:"#22c55e",stopped:"#6b7280",error:"#ef4444"};return q.jsx("span",{className:"status-indicator",style:{backgroundColor:d[C]},title:C})}function up({sessionId:C,worktreeName:d,agentType:h,status:E,isActive:M,isSelected:V,onSelect:H,onToggleSelect:l,onClose:u}){const v=pn.find(w=>w.id===h);return q.jsxs("div",{className:`session-item ${M?"active":""} ${V?"selected":""}`,onClick:H,role:"button",tabIndex:0,children:[q.jsx("input",{type:"checkbox",className:"session-checkbox",checked:V,onClick:l,onChange:()=>{}}),q.jsx(hp,{status:E}),q.jsx("span",{className:"session-name",title:d,children:d}),q.jsx("span",{className:"session-agent",title:v==null?void 0:v.name,children:h.charAt(0).toUpperCase()}),q.jsx("button",{className:"session-close",onClick:u,title:"Close session",type:"button",children:"×"})]})}function dp({branchName:C,sessionCount:d,isCollapsed:h,onToggleCollapse:E,children:M}){return q.jsxs("div",{className:"session-group",children:[q.jsxs("div",{className:"session-group-header",onClick:E,role:"button",tabIndex:0,children:[q.jsx("span",{className:"group-collapse-icon",children:h?"▶":"▼"}),q.jsx("span",{className:"group-name",children:C}),q.jsxs("span",{className:"group-count",children:["(",d,")"]})]}),!h&&q.jsx("div",{className:"session-group-items",children:M})]})}function fp(){const{terminals:C,activeSessionId:d,selectedSessionIds:h,getSessionGroups:E,setActiveSession:M,toggleSessionSelection:V,toggleBranchCollapse:H,removeTerminal:l,openModal:u}=Ve(),v=E(),w=async(f,m,y)=>{f.stopPropagation();try{(await fetch(`/api/worktrees/${encodeURIComponent(y)}`,{method:"DELETE"})).ok&&l(m)}catch(x){console.error("Failed to close session:",x)}};return C.length===0?null:q.jsxs("div",{className:"lnb-section sessions-section",children:[q.jsxs("div",{className:"lnb-section-header",children:[q.jsx("span",{className:"section-title",children:"SESSIONS"}),q.jsx("span",{className:"session-count",children:C.length})]}),q.jsx("div",{className:"session-list",children:v.map(f=>q.jsx(dp,{branchName:f.branchName,sessionCount:f.sessions.length,isCollapsed:f.isCollapsed,onToggleCollapse:()=>H(f.branchName),children:f.sessions.map(m=>q.jsx(up,{sessionId:m.sessionId,worktreeName:m.worktreeName,agentType:m.agentType,status:m.status,isActive:m.sessionId===d,isSelected:h.includes(m.sessionId),onSelect:()=>M(m.sessionId),onToggleSelect:y=>{y.stopPropagation(),V(m.sessionId)},onClose:y=>w(y,m.sessionId,m.worktreeName)},m.sessionId))},f.branchName))}),q.jsx("button",{className:"add-session-btn",onClick:()=>u("addWorktree"),type:"button",children:"+ Add Session"})]})}function pp(){const{selectedSessionIds:C,clearSessionSelection:d,openModal:h}=Ve();return C.length===0?null:q.jsxs("div",{className:"bulk-actions-bar",children:[q.jsxs("span",{className:"selected-count",children:[C.length," selected"]}),q.jsx("button",{className:"bulk-delete-btn",onClick:()=>h("confirmDelete",{sessionIds:C}),type:"button",children:"Delete"}),q.jsx("button",{className:"bulk-cancel-btn",onClick:d,type:"button",children:"Cancel"})]})}function _p(){return q.jsxs("nav",{className:"left-nav-bar",children:[q.jsx(cp,{}),q.jsx(fp,{}),q.jsx(pp,{})]})}function vp({children:C}){return q.jsxs("div",{className:"main-layout",children:[q.jsx(_p,{}),q.jsx("div",{className:"main-content-area with-lnb",children:C})]})}function Tl({children:C,title:d,description:h,showNavButtons:E=!0,nextLabel:M="Next",onNext:V,nextDisabled:H=!1}){const{step:l,goToNext:u,goToPrev:v,isStepComplete:w}=Ve(),f=l==="branch",m=w(l),y=()=>{V?V():u()};return q.jsxs("div",{className:"step-container",children:[q.jsxs("div",{className:"step-header",children:[q.jsx("h2",{children:d}),h&&q.jsx("p",{children:h})]}),q.jsx("div",{className:"step-content",children:C}),E&&q.jsxs("div",{className:"step-navigation",children:[q.jsx("button",{className:"nav-button prev",onClick:v,disabled:f,type:"button",children:"Previous"}),q.jsx("button",{className:"nav-button next",onClick:y,disabled:H||!m,type:"button",children:M})]})]})}function mp(){const{branches:C,selectedBranch:d,setSelectedBranch:h}=Ve();return q.jsxs("div",{className:"setup-section",children:[q.jsx("label",{htmlFor:"branch-select",children:"Select Branch"}),q.jsxs("select",{id:"branch-select",value:d||"",onChange:E=>h(E.target.value||null),children:[q.jsx("option",{value:"",children:"-- Select a branch --"}),C.map(E=>q.jsxs("option",{value:E.name,children:[E.name,E.isCurrent?" (current)":"",E.isRemote?" (remote)":""]},E.name))]})]})}function Ah(){const C=Ve(d=>d.selectedBranch);return q.jsx(Tl,{title:"Select Branch",description:"Choose the Git branch to create worktrees from",nextDisabled:!C,children:q.jsx(mp,{})})}function gp(){const{selectedAgent:C,setSelectedAgent:d}=Ve();return q.jsxs("div",{className:"setup-section",children:[q.jsx("label",{children:"Select AI Agent"}),q.jsx("div",{className:"agent-cards",children:pn.map(h=>q.jsxs("div",{className:`agent-card ${C===h.id?"selected":""}`,onClick:()=>d(h.id),children:[q.jsx("h4",{children:h.name}),q.jsx("p",{children:h.description})]},h.id))})]})}function Sp(){const C=Ve(d=>d.selectedAgent);return q.jsx(Tl,{title:"Select AI Agent",description:"Choose which AI coding agent to run in each worktree",nextDisabled:!C,children:q.jsx(gp,{})})}function yp(){const{worktreeCount:C,incrementWorktreeCount:d,decrementWorktreeCount:h}=Ve();return q.jsxs("div",{className:"setup-section",children:[q.jsx("label",{children:"Number of Worktrees"}),q.jsxs("div",{className:"counter",children:[q.jsx("button",{onClick:h,disabled:C<=an,children:"-"}),q.jsx("span",{children:C}),q.jsx("button",{onClick:d,disabled:C>=ml,children:"+"})]})]})}function Cp(){var H;const{execute:C,isLoading:d,selectedBranch:h,selectedAgent:E,worktreeCount:M}=Ve(),V=((H=pn.find(l=>l.id===E))==null?void 0:H.name)||E;return q.jsxs(Tl,{title:"Configure Worktrees",description:"Set the number of parallel worktrees to create",nextLabel:d?"Creating...":"Execute",onNext:C,nextDisabled:!h||d||M<1,children:[q.jsx(yp,{}),q.jsxs("div",{className:"execution-summary",children:[q.jsx("h4",{children:"Summary"}),q.jsxs("div",{className:"summary-item",children:[q.jsx("span",{className:"summary-label",children:"Branch:"}),q.jsx("span",{className:"summary-value",children:h})]}),q.jsxs("div",{className:"summary-item",children:[q.jsx("span",{className:"summary-label",children:"Agent:"}),q.jsx("span",{className:"summary-value",children:V})]}),q.jsxs("div",{className:"summary-item",children:[q.jsx("span",{className:"summary-label",children:"Worktrees:"}),q.jsx("span",{className:"summary-value",children:M})]})]})]})}var _l={exports:{}},Bh;function wp(){return Bh||(Bh=1,(function(C,d){(function(h,E){C.exports=E()})(globalThis,(()=>(()=>{var h={4567:function(H,l,u){var v=this&&this.__decorate||function(s,n,_,k){var b,L=arguments.length,S=L<3?n:k===null?k=Object.getOwnPropertyDescriptor(n,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,_,k);else for(var A=s.length-1;A>=0;A--)(b=s[A])&&(S=(L<3?b(S):L>3?b(n,_,S):b(n,_))||S);return L>3&&S&&Object.defineProperty(n,_,S),S},w=this&&this.__param||function(s,n){return function(_,k){n(_,k,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),m=u(9924),y=u(844),x=u(4725),g=u(2585),o=u(3656);let a=l.AccessibilityManager=class extends y.Disposable{constructor(s,n,_,k){super(),this._terminal=s,this._coreBrowserService=_,this._renderService=k,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 b=0;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);if(this._topBoundaryFocusListener=b=>this._handleBoundaryFocus(b,0),this._bottomBoundaryFocusListener=b=>this._handleBoundaryFocus(b,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 m.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((b=>this._handleResize(b.rows)))),this.register(this._terminal.onRender((b=>this._refreshRows(b.start,b.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((b=>this._handleChar(b)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
41
- `)))),this.register(this._terminal.onA11yTab((b=>this._handleTab(b)))),this.register(this._terminal.onKey((b=>this._handleKey(b.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,y.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(s){for(let n=0;n<s;n++)this._handleChar(" ")}_handleChar(s){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==s&&(this._charsToAnnounce+=s):this._charsToAnnounce+=s,s===`
42
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(s){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(s)||this._charsToConsume.push(s)}_refreshRows(s,n){this._liveRegionDebouncer.refresh(s,n,this._terminal.rows)}_renderRows(s,n){const _=this._terminal.buffer,k=_.lines.length.toString();for(let b=s;b<=n;b++){const L=_.lines.get(_.ydisp+b),S=[],A=(L==null?void 0:L.translateToString(!0,void 0,void 0,S))||"",F=(_.ydisp+b+1).toString(),j=this._rowElements[b];j&&(A.length===0?(j.innerText=" ",this._rowColumns.set(j,[0,1])):(j.textContent=A,this._rowColumns.set(j,S)),j.setAttribute("aria-posinset",F),j.setAttribute("aria-setsize",k))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(s,n){const _=s.target,k=this._rowElements[n===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(n===0?"1":`${this._terminal.buffer.lines.length}`)||s.relatedTarget!==k)return;let b,L;if(n===0?(b=_,L=this._rowElements.pop(),this._rowContainer.removeChild(L)):(b=this._rowElements.shift(),L=_,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),L.removeEventListener("focus",this._bottomBoundaryFocusListener),n===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(n===0?-1:1),this._rowElements[n===0?1:this._rowElements.length-2].focus(),s.preventDefault(),s.stopImmediatePropagation()}_handleSelectionChange(){var A;if(this._rowElements.length===0)return;const s=document.getSelection();if(!s)return;if(s.isCollapsed)return void(this._rowContainer.contains(s.anchorNode)&&this._terminal.clearSelection());if(!s.anchorNode||!s.focusNode)return void console.error("anchorNode and/or focusNode are null");let n={node:s.anchorNode,offset:s.anchorOffset},_={node:s.focusNode,offset:s.focusOffset};if((n.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||n.node===_.node&&n.offset>_.offset)&&([n,_]=[_,n]),n.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(n={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(n.node))return;const k=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(k)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:k,offset:((A=k.textContent)==null?void 0:A.length)??0}),!this._rowContainer.contains(_.node))return;const b=({node:F,offset:j})=>{const W=F instanceof Text?F.parentNode:F;let I=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(W);if(!Q)return console.warn("columns is null. Race condition?"),null;let te=j<Q.length?Q[j]:Q.slice(-1)[0]+1;return te>=this._terminal.cols&&(++I,te=0),{row:I,column:te}},L=b(n),S=b(_);if(L&&S){if(L.row>S.row||L.row===S.row&&L.column>=S.column)throw new Error("invalid range");this._terminal.select(L.column,L.row,(S.row-L.row)*this._terminal.cols-L.column+S.column)}}_handleResize(s){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let n=this._rowContainer.children.length;n<this._terminal.rows;n++)this._rowElements[n]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[n]);for(;this._rowElements.length>s;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const s=this._coreBrowserService.mainDocument.createElement("div");return s.setAttribute("role","listitem"),s.tabIndex=-1,this._refreshRowDimensions(s),s}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let s=0;s<this._terminal.rows;s++)this._refreshRowDimensions(this._rowElements[s])}}_refreshRowDimensions(s){s.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=a=v([w(1,g.IInstantiationService),w(2,x.ICoreBrowserService),w(3,x.IRenderService)],a)},3614:(H,l)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function v(m,y){return y?"\x1B[200~"+m+"\x1B[201~":m}function w(m,y,x,g){m=v(m=u(m),x.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(m,!0),y.value=""}function f(m,y,x){const g=x.getBoundingClientRect(),o=m.clientX-g.left-10,a=m.clientY-g.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${o}px`,y.style.top=`${a}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=v,l.copyHandler=function(m,y){m.clipboardData&&m.clipboardData.setData("text/plain",y.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,y,x,g){m.stopPropagation(),m.clipboardData&&w(m.clipboardData.getData("text/plain"),y,x,g)},l.paste=w,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(m,y,x,g,o){f(m,y,x),o&&g.rightClickSelect(m),y.value=g.selectionText,y.select()}},7239:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const v=u(1505);l.ColorContrastCache=class{constructor(){this._color=new v.TwoKeyMap,this._css=new v.TwoKeyMap}setCss(w,f,m){this._css.set(w,f,m)}getCss(w,f){return this._css.get(w,f)}setColor(w,f,m){this._color.set(w,f,m)}getColor(w,f){return this._color.get(w,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,v,w,f){u.addEventListener(v,w,f);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(v,w,f))}}}},3551:function(H,l,u){var v=this&&this.__decorate||function(a,s,n,_){var k,b=arguments.length,L=b<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,n):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,s,n,_);else for(var S=a.length-1;S>=0;S--)(k=a[S])&&(L=(b<3?k(L):b>3?k(s,n,L):k(s,n))||L);return b>3&&L&&Object.defineProperty(s,n,L),L},w=this&&this.__param||function(a,s){return function(n,_){s(n,_,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),m=u(8460),y=u(844),x=u(2585),g=u(4725);let o=l.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(a,s,n,_,k){super(),this._element=a,this._mouseService=s,this._renderService=n,this._bufferService=_,this._linkProviderService=k,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)((()=>{var b;this._lastMouseEvent=void 0,(b=this._activeProviderReplies)==null||b.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(a){this._lastMouseEvent=a;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const n=a.composedPath();for(let _=0;_<n.length;_++){const k=n[_];if(k.classList.contains("xterm"))break;if(k.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,s){var _,k;this._activeProviderReplies&&s||((_=this._activeProviderReplies)==null||_.forEach((b=>{b==null||b.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let n=!1;for(const[b,L]of this._linkProviderService.linkProviders.entries())s?(k=this._activeProviderReplies)!=null&&k.get(b)&&(n=this._checkLinkProviderResult(b,a,n)):L.provideLinks(a.y,(S=>{var F,j;if(this._isMouseOut)return;const A=S==null?void 0:S.map((W=>({link:W})));(F=this._activeProviderReplies)==null||F.set(b,A),n=this._checkLinkProviderResult(b,a,n),((j=this._activeProviderReplies)==null?void 0:j.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,s){const n=new Set;for(let _=0;_<s.size;_++){const k=s.get(_);if(k)for(let b=0;b<k.length;b++){const L=k[b],S=L.link.range.start.y<a?0:L.link.range.start.x,A=L.link.range.end.y>a?this._bufferService.cols:L.link.range.end.x;for(let F=S;F<=A;F++){if(n.has(F)){k.splice(b--,1);break}n.add(F)}}}}_checkLinkProviderResult(a,s,n){var b;if(!this._activeProviderReplies)return n;const _=this._activeProviderReplies.get(a);let k=!1;for(let L=0;L<a;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(k=!0);if(!k&&_){const L=_.find((S=>this._linkAtPosition(S.link,s)));L&&(n=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let L=0;L<this._activeProviderReplies.size;L++){const S=(b=this._activeProviderReplies.get(L))==null?void 0:b.find((A=>this._linkAtPosition(A.link,s)));if(S){n=!0,this._handleNewLink(S);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const s=this._positionFromMouseEvent(a,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,s){this._currentLink&&this._lastMouseEvent&&(!a||!s||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(a.link,s)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var n,_;return(_=(n=this._currentLink)==null?void 0:n.state)==null?void 0:_.decorations.pointerCursor},set:n=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,_;return(_=(n=this._currentLink)==null?void 0:n.state)==null?void 0:_.decorations.underline},set:n=>{var _,k,b;(_=this._currentLink)!=null&&_.state&&((b=(k=this._currentLink)==null?void 0:k.state)==null?void 0:b.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((n=>{if(!this._currentLink)return;const _=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=k&&(this._clearCurrentLink(_,k),this._lastMouseEvent)){const b=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);b&&this._askForLink(b,!1)}}))))}_linkHover(a,s,n){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(n,s.text)}_fireUnderlineEvent(a,s){const n=a.range,_=this._bufferService.buffer.ydisp,k=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-_-1,n.end.x,n.end.y-_-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(k)}_linkLeave(a,s,n){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(n,s.text)}_linkAtPosition(a,s){const n=a.range.start.y*this._bufferService.cols+a.range.start.x,_=a.range.end.y*this._bufferService.cols+a.range.end.x,k=s.y*this._bufferService.cols+s.x;return n<=k&&k<=_}_positionFromMouseEvent(a,s,n){const _=n.getCoords(a,s,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,s,n,_,k){return{x1:a,y1:s,x2:n,y2:_,cols:this._bufferService.cols,fg:k}}};l.Linkifier=o=v([w(1,g.IMouseService),w(2,g.IRenderService),w(3,x.IBufferService),w(4,g.ILinkProviderService)],o)},9042:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(H,l,u){var v=this&&this.__decorate||function(g,o,a,s){var n,_=arguments.length,k=_<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,o,a,s);else for(var b=g.length-1;b>=0;b--)(n=g[b])&&(k=(_<3?n(k):_>3?n(o,a,k):n(o,a))||k);return _>3&&k&&Object.defineProperty(o,a,k),k},w=this&&this.__param||function(g,o){return function(a,s){o(a,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),m=u(2585);let y=l.OscLinkProvider=class{constructor(g,o,a){this._bufferService=g,this._optionsService=o,this._oscLinkService=a}provideLinks(g,o){var A;const a=this._bufferService.buffer.lines.get(g-1);if(!a)return void o(void 0);const s=[],n=this._optionsService.rawOptions.linkHandler,_=new f.CellData,k=a.getTrimmedLength();let b=-1,L=-1,S=!1;for(let F=0;F<k;F++)if(L!==-1||a.hasContent(F)){if(a.loadCell(F,_),_.hasExtendedAttrs()&&_.extended.urlId){if(L===-1){L=F,b=_.extended.urlId;continue}S=_.extended.urlId!==b}else L!==-1&&(S=!0);if(S||L!==-1&&F===k-1){const j=(A=this._oscLinkService.getLinkData(b))==null?void 0:A.uri;if(j){const W={start:{x:L+1,y:g},end:{x:F+(S||F!==k-1?0:1),y:g}};let I=!1;if(!(n!=null&&n.allowNonHttpProtocols))try{const Q=new URL(j);["http:","https:"].includes(Q.protocol)||(I=!0)}catch{I=!0}I||s.push({text:j,range:W,activate:(Q,te)=>n?n.activate(Q,te,W):x(0,te),hover:(Q,te)=>{var ne;return(ne=n==null?void 0:n.hover)==null?void 0:ne.call(n,Q,te,W)},leave:(Q,te)=>{var ne;return(ne=n==null?void 0:n.leave)==null?void 0:ne.call(n,Q,te,W)}})}S=!1,_.hasExtendedAttrs()&&_.extended.urlId?(L=F,b=_.extended.urlId):(L=-1,b=-1)}}o(s)}};function x(g,o){if(confirm(`Do you want to navigate to ${o}?
43
-
44
- WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=y=v([w(0,m.IBufferService),w(1,m.IOptionsService),w(2,m.IOscLinkService)],y)},6193:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,v){this._renderCallback=u,this._coreBrowserService=v,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,v,w){this._rowCount=w,u=u!==void 0?u:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v,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 u=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,v),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const v=u(3614),w=u(3656),f=u(3551),m=u(9042),y=u(3730),x=u(1680),g=u(3107),o=u(5744),a=u(2950),s=u(1296),n=u(428),_=u(4269),k=u(5114),b=u(8934),L=u(3230),S=u(9312),A=u(4725),F=u(6731),j=u(8055),W=u(8969),I=u(8460),Q=u(844),te=u(6114),ne=u(8437),le=u(2584),X=u(7399),R=u(5941),O=u(9074),T=u(2585),P=u(5435),Z=u(4567),re=u(779);class ce extends W.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(U={}){super(U),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(O.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(A.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((B,ee)=>this.refresh(B,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((B=>this._reportWindowsOptions(B)))),this.register(this._inputHandler.onColor((B=>this._handleColorEvent(B)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((B=>this._afterResize(B.cols,B.rows)))),this.register((0,Q.toDisposable)((()=>{var B,ee;this._customKeyEventHandler=void 0,(ee=(B=this.element)==null?void 0:B.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(U){if(this._themeService)for(const B of U){let ee,J="";switch(B.index){case 256:ee="foreground",J="10";break;case 257:ee="background",J="11";break;case 258:ee="cursor",J="12";break;default:ee="ansi",J="4;"+B.index}switch(B.type){case 0:const de=j.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${le.C0.ESC}]${J};${(0,R.toRgbString)(de)}${le.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((ue=>ue.ansi[B.index]=j.channels.toColor(...B.color)));else{const ue=ee;this._themeService.modifyColors((Ee=>Ee[ue]=j.channels.toColor(...B.color)))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(U){U?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(U){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var U;return(U=this.textarea)==null?void 0:U.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.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 U=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get(U);if(!B)return;const ee=Math.min(this.buffer.x,this.cols-1),J=this._renderService.dimensions.css.cell.height,de=B.getWidth(ee),ue=this._renderService.dimensions.css.cell.width*de,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,Re=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Re+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=J+"px",this.textarea.style.lineHeight=J+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,w.addDisposableDomListener)(this.element,"copy",(B=>{this.hasSelection()&&(0,v.copyHandler)(B,this._selectionService)})));const U=B=>(0,v.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,w.addDisposableDomListener)(this.textarea,"paste",U)),this.register((0,w.addDisposableDomListener)(this.element,"paste",U)),te.isFirefox?this.register((0,w.addDisposableDomListener)(this.element,"mousedown",(B=>{B.button===2&&(0,v.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,w.addDisposableDomListener)(this.element,"contextmenu",(B=>{(0,v.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,w.addDisposableDomListener)(this.element,"auxclick",(B=>{B.button===1&&(0,v.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,w.addDisposableDomListener)(this.textarea,"keyup",(U=>this._keyUp(U)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"keydown",(U=>this._keyDown(U)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"keypress",(U=>this._keyPress(U)),!0)),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionupdate",(U=>this._compositionHelper.compositionupdate(U)))),this.register((0,w.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,w.addDisposableDomListener)(this.textarea,"input",(U=>this._inputEvent(U)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(U){var ee;if(!U)throw new Error("Terminal requires a parent element.");if(U.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=U.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"),U.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,w.addDisposableDomListener)(this.screenElement,"mousemove",(J=>this.updateCursorStyle(J)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),te.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(k.CoreBrowserService,this.textarea,U.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(A.ICoreBrowserService,this._coreBrowserService),this.register((0,w.addDisposableDomListener)(this.textarea,"focus",(J=>this._handleTextAreaFocus(J)))),this.register((0,w.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(n.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(A.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(F.ThemeService),this._instantiationService.setService(A.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(A.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(L.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(A.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((J=>this._onRender.fire(J)))),this.onResize((J=>this._renderService.resize(J.cols,J.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(b.MouseService),this._instantiationService.setService(A.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(f.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((J=>this.scrollLines(J.amount,J.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(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(A.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((J=>this._renderService.handleSelectionChanged(J.start,J.end,J.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((J=>{this.textarea.value=J,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((J=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,w.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,w.addDisposableDomListener)(this.element,"mousedown",(J=>this._selectionService.handleMouseDown(J)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(J=>this._handleScreenReaderModeOptionChange(J)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(J=>{!this._overviewRulerRenderer&&J&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const U=this,B=this.element;function ee(ue){const Ee=U._mouseService.getMouseReportCoords(ue,U.screenElement);if(!Ee)return!1;let Re,Te;switch(ue.overrideType||ue.type){case"mousemove":Te=32,ue.buttons===void 0?(Re=3,ue.button!==void 0&&(Re=ue.button<3?ue.button:3)):Re=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":Te=0,Re=ue.button<3?ue.button:3;break;case"mousedown":Te=1,Re=ue.button<3?ue.button:3;break;case"wheel":if(U._customWheelEventHandler&&U._customWheelEventHandler(ue)===!1||U.viewport.getLinesScrolled(ue)===0)return!1;Te=ue.deltaY<0?0:1,Re=4;break;default:return!1}return!(Te===void 0||Re===void 0||Re>4)&&U.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:Re,action:Te,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const J={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ue=>(ee(ue),ue.buttons||(this._document.removeEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.removeEventListener("mousemove",J.mousedrag)),this.cancel(ue)),wheel:ue=>(ee(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&ee(ue)},mousemove:ue=>{ue.buttons||ee(ue)}};this.register(this.coreMouseService.onProtocolChange((ue=>{ue?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ue)),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&ue?J.mousemove||(B.addEventListener("mousemove",de.mousemove),J.mousemove=de.mousemove):(B.removeEventListener("mousemove",J.mousemove),J.mousemove=null),16&ue?J.wheel||(B.addEventListener("wheel",de.wheel,{passive:!1}),J.wheel=de.wheel):(B.removeEventListener("wheel",J.wheel),J.wheel=null),2&ue?J.mouseup||(J.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",J.mouseup),J.mouseup=null),4&ue?J.mousedrag||(J.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",J.mousedrag),J.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,w.addDisposableDomListener)(B,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return ee(ue),J.mouseup&&this._document.addEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.addEventListener("mousemove",J.mousedrag),this.cancel(ue)}))),this.register((0,w.addDisposableDomListener)(B,"wheel",(ue=>{if(!J.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ue)===!1)return!1;if(!this.buffer.hasScrollback){const Ee=this.viewport.getLinesScrolled(ue);if(Ee===0)return;const Re=le.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let Te="";for(let Xe=0;Xe<Math.abs(Ee);Xe++)Te+=Re;return this.coreService.triggerDataEvent(Te,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,w.addDisposableDomListener)(B,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,w.addDisposableDomListener)(B,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(U,B){var ee;(ee=this._renderService)==null||ee.refreshRows(U,B)}updateCursorStyle(U){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect(U)?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(U,B,ee=0){var J;ee===1?(super.scrollLines(U,B,ee),this.refresh(0,this.rows-1)):(J=this.viewport)==null||J.scrollLines(U)}paste(U){(0,v.paste)(U,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(U){this._customKeyEventHandler=U}attachCustomWheelEventHandler(U){this._customWheelEventHandler=U}registerLinkProvider(U){return this._linkProviderService.registerLinkProvider(U)}registerCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register(U);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner(U){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(U)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(U){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+U)}registerDecoration(U){return this._decorationService.registerDecoration(U)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(U,B,ee){this._selectionService.setSelection(U,B,ee)}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 U;(U=this._selectionService)==null||U.clearSelection()}selectAll(){var U;(U=this._selectionService)==null||U.selectAll()}selectLines(U,B){var ee;(ee=this._selectionService)==null||ee.selectLines(U,B)}_keyDown(U){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&U.altKey;if(!B&&!this._compositionHelper.keydown(U))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||U.key!=="Dead"&&U.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,X.evaluateKeyboardEvent)(U,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(U),ee.type===3||ee.type===2){const J=this.rows-1;return this.scrollLines(ee.type===2?-J:J),this.cancel(U,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,U)||(ee.cancel&&this.cancel(U,!0),!ee.key||!!(U.key&&!U.ctrlKey&&!U.altKey&&!U.metaKey&&U.key.length===1&&U.key.charCodeAt(0)>=65&&U.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==le.C0.ETX&&ee.key!==le.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||U.altKey||U.ctrlKey?this.cancel(U,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(U,B){const ee=U.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||U.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||U.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?ee:ee&&(!B.keyCode||B.keyCode>47)}_keyUp(U){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1||((function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18})(U)||this.focus(),this.updateCursorStyle(U),this._keyPressHandled=!1)}_keyPress(U){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(U)===!1)return!1;if(this.cancel(U),U.charCode)B=U.charCode;else if(U.which===null||U.which===void 0)B=U.keyCode;else{if(U.which===0||U.charCode===0)return!1;B=U.which}return!(!B||(U.altKey||U.ctrlKey||U.metaKey)&&!this._isThirdLevelShift(this.browser,U)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:U}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(U){if(U.data&&U.inputType==="insertText"&&(!U.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=U.data;return this.coreService.triggerDataEvent(B,!0),this.cancel(U),!0}return!1}resize(U,B){U!==this.cols||B!==this.rows?super.resize(U,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(U,B){var ee,J;(ee=this._charSizeService)==null||ee.measure(),(J=this.viewport)==null||J.syncScrollArea(!0)}clear(){var U;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(ne.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(U=this.viewport)==null||U.reset(),this.refresh(0,this.rows-1)}}reset(){var B,ee;this.options.rows=this.rows,this.options.cols=this.cols;const U=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=U,this.refresh(0,this.rows-1)}clearTextureAtlas(){var U;(U=this._renderService)==null||U.clearTextureAtlas()}_reportFocus(){var U;(U=this.element)!=null&&U.classList.contains("focus")?this.coreService.triggerDataEvent(le.C0.ESC+"[I"):this.coreService.triggerDataEvent(le.C0.ESC+"[O")}_reportWindowsOptions(U){if(this._renderService)switch(U){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[4;${ee};${B}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const J=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.C0.ESC}[6;${de};${J}t`)}}cancel(U,B){if(this.options.cancelEvents||B)return U.preventDefault(),U.stopPropagation(),!1}}l.Terminal=ce},9924:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,v=1e3){this._renderCallback=u,this._debounceThresholdMS=v,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,v,w){this._rowCount=w,u=u!==void 0?u:0,v=v!==void 0?v:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,v):v;const f=Date.now();if(f-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=f,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=f-this._lastRefreshMs,y=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),v=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,v)}}},1680:function(H,l,u){var v=this&&this.__decorate||function(a,s,n,_){var k,b=arguments.length,L=b<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,n):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,s,n,_);else for(var S=a.length-1;S>=0;S--)(k=a[S])&&(L=(b<3?k(L):b>3?k(s,n,L):k(s,n))||L);return b>3&&L&&Object.defineProperty(s,n,L),L},w=this&&this.__param||function(a,s){return function(n,_){s(n,_,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const f=u(3656),m=u(4725),y=u(8460),x=u(844),g=u(2585);let o=l.Viewport=class extends x.Disposable{constructor(a,s,n,_,k,b,L,S){super(),this._viewportElement=a,this._scrollArea=s,this._bufferService=n,this._optionsService=_,this._charSizeService=k,this._renderService=b,this._coreBrowserService=L,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 y.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((A=>this._activeBuffer=A.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((A=>this._renderDimensions=A))),this._handleThemeChange(S.colors),this.register(S.onChangeColors((A=>this._handleThemeChange(A)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,s){const n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&n<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const s=this._getPixelsScrolled(a);return s!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(a,s){var S;let n,_="";const k=[],b=s??this._bufferService.buffer.lines.length,L=this._bufferService.buffer.lines;for(let A=a;A<b;A++){const F=L.get(A);if(!F)continue;const j=(S=L.get(A+1))==null?void 0:S.isWrapped;if(_+=F.translateToString(!j),!j||A===L.length-1){const W=document.createElement("div");W.textContent=_,k.push(W),_.length>0&&(n=W),_=""}}return{bufferElements:k,cursorElement:n}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let s=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(a,s){const n=this._optionsService.rawOptions.fastScrollModifier;return n==="alt"&&s.altKey||n==="ctrl"&&s.ctrlKey||n==="shift"&&s.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const s=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(a,s))}};l.Viewport=o=v([w(2,g.IBufferService),w(3,g.IOptionsService),w(4,m.ICharSizeService),w(5,m.IRenderService),w(6,m.ICoreBrowserService),w(7,m.IThemeService)],o)},3107:function(H,l,u){var v=this&&this.__decorate||function(g,o,a,s){var n,_=arguments.length,k=_<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,o,a,s);else for(var b=g.length-1;b>=0;b--)(n=g[b])&&(k=(_<3?n(k):_>3?n(o,a,k):n(o,a))||k);return _>3&&k&&Object.defineProperty(o,a,k),k},w=this&&this.__param||function(g,o){return function(a,s){o(a,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const f=u(4725),m=u(844),y=u(2585);let x=l.BufferDecorationRenderer=class extends m.Disposable{constructor(g,o,a,s,n){super(),this._screenElement=g,this._bufferService=o,this._coreBrowserService=a,this._decorationService=s,this._renderService=n,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,m.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 g of this._decorationService.decorations)this._renderDecoration(g);this._dimensionsChanged=!1}_renderDecoration(g){this._refreshStyle(g),this._dimensionsChanged&&this._refreshXPosition(g)}_createElement(g){var s;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((s=g==null?void 0:g.options)==null?void 0:s.layer)==="top"),o.style.width=`${Math.round((g.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(g.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(g.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=g.options.x??0;return a&&a>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(g,o),o}_refreshStyle(g){const o=g.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)g.element&&(g.element.style.display="none",g.onRenderEmitter.fire(g.element));else{let a=this._decorationElements.get(g);a||(a=this._createElement(g),g.element=a,this._decorationElements.set(g,a),this._container.appendChild(a),g.onDispose((()=>{this._decorationElements.delete(g),a.remove()}))),a.style.top=o*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",g.onRenderEmitter.fire(a)}}_refreshXPosition(g,o=g.element){if(!o)return;const a=g.options.x??0;(g.options.anchor||"left")==="right"?o.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(g){var o;(o=this._decorationElements.get(g))==null||o.remove(),this._decorationElements.delete(g),g.dispose()}};l.BufferDecorationRenderer=x=v([w(1,y.IBufferService),w(2,f.ICoreBrowserService),w(3,y.IDecorationService),w(4,f.IRenderService)],x)},5871:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const v of this._zones)if(v.color===u.options.overviewRulerOptions.color&&v.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(v,u.marker.line))return;if(this._lineAdjacentToZone(v,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(v,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,v){return v>=u.startBufferLine&&v<=u.endBufferLine}_lineAdjacentToZone(u,v,w){return v>=u.startBufferLine-this._linePadding[w||"full"]&&v<=u.endBufferLine+this._linePadding[w||"full"]}_addLineToZone(u,v){u.startBufferLine=Math.min(u.startBufferLine,v),u.endBufferLine=Math.max(u.endBufferLine,v)}}},5744:function(H,l,u){var v=this&&this.__decorate||function(n,_,k,b){var L,S=arguments.length,A=S<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,k):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(n,_,k,b);else for(var F=n.length-1;F>=0;F--)(L=n[F])&&(A=(S<3?L(A):S>3?L(_,k,A):L(_,k))||A);return S>3&&A&&Object.defineProperty(_,k,A),A},w=this&&this.__param||function(n,_){return function(k,b){_(k,b,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const f=u(5871),m=u(4725),y=u(844),x=u(2585),g={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let s=l.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(n,_,k,b,L,S,A){var j;super(),this._viewportElement=n,this._screenElement=_,this._bufferService=k,this._decorationService=b,this._renderService=L,this._optionsService=S,this._coreBrowserService=A,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(),(j=this._viewportElement.parentElement)==null||j.insertBefore(this._canvas,this._viewportElement);const F=this._canvas.getContext("2d");if(!F)throw new Error("Ctx cannot be null");this._ctx=F,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)((()=>{var W;(W=this._canvas)==null||W.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const n=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=n,o.center=_,o.right=n,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=o.left,a.right=o.left+o.center}_refreshDrawHeightConstants(){g.full=Math.round(2*this._coreBrowserService.dpr);const n=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(n,12),6)*this._coreBrowserService.dpr);g.left=_,g.center=_,g.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*g.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const n=this._colorZoneStore.zones;for(const _ of n)_.position!=="full"&&this._renderColorZone(_);for(const _ of n)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(n){this._ctx.fillStyle=n.color,this._ctx.fillRect(a[n.position||"full"],Math.round((this._canvas.height-1)*(n.startBufferLine/this._bufferService.buffers.active.lines.length)-g[n.position||"full"]/2),o[n.position||"full"],Math.round((this._canvas.height-1)*((n.endBufferLine-n.startBufferLine)/this._bufferService.buffers.active.lines.length)+g[n.position||"full"]))}_queueRefresh(n,_){this._shouldUpdateDimensions=n||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=s=v([w(2,x.IBufferService),w(3,x.IDecorationService),w(4,m.IRenderService),w(5,x.IOptionsService),w(6,m.ICoreBrowserService)],s)},2950:function(H,l,u){var v=this&&this.__decorate||function(g,o,a,s){var n,_=arguments.length,k=_<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,a):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,o,a,s);else for(var b=g.length-1;b>=0;b--)(n=g[b])&&(k=(_<3?n(k):_>3?n(o,a,k):n(o,a))||k);return _>3&&k&&Object.defineProperty(o,a,k),k},w=this&&this.__param||function(g,o){return function(a,s){o(a,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const f=u(4725),m=u(2585),y=u(2584);let x=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,o,a,s,n,_){this._textarea=g,this._compositionView=o,this._bufferService=a,this._optionsService=s,this._coreService=n,this._renderService=_,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,a=o.replace(g,"");this._dataAlreadySent=a,o.length>g.length?this._coreService.triggerDataEvent(a,!0):o.length<g.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):o.length===g.length&&o!==g&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,n=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}g||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=x=v([w(2,m.IBufferService),w(3,m.IOptionsService),w(4,m.ICoreService),w(5,f.IRenderService)],x)},9806:(H,l)=>{function u(v,w,f){const m=f.getBoundingClientRect(),y=v.getComputedStyle(f),x=parseInt(y.getPropertyValue("padding-left")),g=parseInt(y.getPropertyValue("padding-top"));return[w.clientX-m.left-x,w.clientY-m.top-g]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(v,w,f,m,y,x,g,o,a){if(!x)return;const s=u(v,w,f);return s?(s[0]=Math.ceil((s[0]+(a?g/2:0))/g),s[1]=Math.ceil(s[1]/o),s[0]=Math.min(Math.max(s[0],1),m+(a?1:0)),s[1]=Math.min(Math.max(s[1],1),y),s):void 0}},9504:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const v=u(2584);function w(o,a,s,n){const _=o-f(o,s),k=a-f(a,s),b=Math.abs(_-k)-(function(L,S,A){let F=0;const j=L-f(L,A),W=S-f(S,A);for(let I=0;I<Math.abs(j-W);I++){const Q=m(L,S)==="A"?-1:1,te=A.buffer.lines.get(j+Q*I);te!=null&&te.isWrapped&&F++}return F})(o,a,s);return g(b,x(m(o,a),n))}function f(o,a){let s=0,n=a.buffer.lines.get(o),_=n==null?void 0:n.isWrapped;for(;_&&o>=0&&o<a.rows;)s++,n=a.buffer.lines.get(--o),_=n==null?void 0:n.isWrapped;return s}function m(o,a){return o>a?"A":"B"}function y(o,a,s,n,_,k){let b=o,L=a,S="";for(;b!==s||L!==n;)b+=_?1:-1,_&&b>k.cols-1?(S+=k.buffer.translateBufferLineToString(L,!1,o,b),b=0,o=0,L++):!_&&b<0&&(S+=k.buffer.translateBufferLineToString(L,!1,0,o+1),b=k.cols-1,o=b,L--);return S+k.buffer.translateBufferLineToString(L,!1,o,b)}function x(o,a){const s=a?"O":"[";return v.C0.ESC+s+o}function g(o,a){o=Math.floor(o);let s="";for(let n=0;n<o;n++)s+=a;return s}l.moveToCellSequence=function(o,a,s,n){const _=s.buffer.x,k=s.buffer.y;if(!s.buffer.hasScrollback)return(function(S,A,F,j,W,I){return w(A,j,W,I).length===0?"":g(y(S,A,S,A-f(A,W),!1,W).length,x("D",I))})(_,k,0,a,s,n)+w(k,a,s,n)+(function(S,A,F,j,W,I){let Q;Q=w(A,j,W,I).length>0?j-f(j,W):A;const te=j,ne=(function(le,X,R,O,T,P){let Z;return Z=w(R,O,T,P).length>0?O-f(O,T):X,le<R&&Z<=O||le>=R&&Z<O?"C":"D"})(S,A,F,j,W,I);return g(y(S,Q,F,te,ne==="C",W).length,x(ne,I))})(_,k,o,a,s,n);let b;if(k===a)return b=_>o?"D":"C",g(Math.abs(_-o),x(b,n));b=k>a?"D":"C";const L=Math.abs(k-a);return g((function(S,A){return A.cols-S})(k>a?o:_,s)+(L-1)*s.cols+1+((k>a?_:o)-1),x(b,n))}},1296:function(H,l,u){var v=this&&this.__decorate||function(I,Q,te,ne){var le,X=arguments.length,R=X<3?Q:ne===null?ne=Object.getOwnPropertyDescriptor(Q,te):ne;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(I,Q,te,ne);else for(var O=I.length-1;O>=0;O--)(le=I[O])&&(R=(X<3?le(R):X>3?le(Q,te,R):le(Q,te))||R);return X>3&&R&&Object.defineProperty(Q,te,R),R},w=this&&this.__param||function(I,Q){return function(te,ne){Q(te,ne,I)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const f=u(3787),m=u(2550),y=u(2223),x=u(6171),g=u(6052),o=u(4725),a=u(8055),s=u(8460),n=u(844),_=u(2585),k="xterm-dom-renderer-owner-",b="xterm-rows",L="xterm-fg-",S="xterm-bg-",A="xterm-focus",F="xterm-selection";let j=1,W=l.DomRenderer=class extends n.Disposable{constructor(I,Q,te,ne,le,X,R,O,T,P,Z,re,ce){super(),this._terminal=I,this._document=Q,this._element=te,this._screenElement=ne,this._viewportElement=le,this._helperContainer=X,this._linkifier2=R,this._charSizeService=T,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=re,this._themeService=ce,this._terminalClass=j++,this._rowElements=[],this._selectionRenderModel=(0,g.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new s.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(b),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(F),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=O.createInstance(f.DomRendererRowFactory,document),this._element.classList.add(k+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,n.toDisposable)((()=>{this._element.classList.remove(k+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.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 I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${b} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${b} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${b} .xterm-dim { color: ${a.color.multiplyOpacity(I.foreground,.5).css};}`,Q+=`${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 te=`blink_underline_${this._terminalClass}`,ne=`blink_bar_${this._terminalClass}`,le=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${ne} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${le} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Q+=`${this._terminalSelector} .${b}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${b}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${ne} 1s step-end infinite;}${this._terminalSelector} .${b}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${le} 1s step-end infinite;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${b} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${F} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${F} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${F} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[X,R]of I.ansi.entries())Q+=`${this._terminalSelector} .${L}${X} { color: ${R.css}; }${this._terminalSelector} .${L}${X}.xterm-dim { color: ${a.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${S}${X} { background-color: ${R.css}; }`;Q+=`${this._terminalSelector} .${L}${y.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(I.background).css}; }${this._terminalSelector} .${L}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${S}${y.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,Q){for(let te=this._rowElements.length;te<=Q;te++){const ne=this._document.createElement("div");this._rowContainer.appendChild(ne),this._rowElements.push(ne)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Q){this._refreshRowElements(I,Q),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(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,Q,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Q,te),this.renderRows(0,this._bufferService.rows-1),!I||!Q)return;this._selectionRenderModel.update(this._terminal,I,Q,te);const ne=this._selectionRenderModel.viewportStartRow,le=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||R<0)return;const O=this._document.createDocumentFragment();if(te){const T=I[0]>Q[0];O.appendChild(this._createSelectionElement(X,T?Q[0]:I[0],T?I[0]:Q[0],R-X+1))}else{const T=ne===X?I[0]:0,P=X===le?Q[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(X,T,P));const Z=R-X-1;if(O.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,Z)),X!==R){const re=le===R?Q[0]:this._bufferService.cols;O.appendChild(this._createSelectionElement(R,0,re))}}this._selectionContainer.appendChild(O)}_createSelectionElement(I,Q,te,ne=1){const le=this._document.createElement("div"),X=Q*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(te-Q);return X+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-X),le.style.height=ne*this.dimensions.css.cell.height+"px",le.style.top=I*this.dimensions.css.cell.height+"px",le.style.left=`${X}px`,le.style.width=`${R}px`,le}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 I of this._rowElements)I.replaceChildren()}renderRows(I,Q){const te=this._bufferService.buffer,ne=te.ybase+te.y,le=Math.min(te.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=I;T<=Q;T++){const P=T+te.ydisp,Z=this._rowElements[T],re=te.lines.get(P);if(!Z||!re)break;Z.replaceChildren(...this._rowFactory.createRow(re,P,P===ne,R,O,le,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${k}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,Q,te,ne,le,X){te<0&&(I=0),ne<0&&(Q=0);const R=this._bufferService.rows-1;te=Math.max(Math.min(te,R),0),ne=Math.max(Math.min(ne,R),0),le=Math.min(le,this._bufferService.cols);const O=this._bufferService.buffer,T=O.ybase+O.y,P=Math.min(O.x,le-1),Z=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=te;he<=ne;++he){const U=he+O.ydisp,B=this._rowElements[he],ee=O.lines.get(U);if(!B||!ee)break;B.replaceChildren(...this._rowFactory.createRow(ee,U,U===T,re,ce,P,Z,this.dimensions.css.cell.width,this._widthCache,X?he===te?I:0:-1,X?(he===ne?Q:le)-1:-1))}}};l.DomRenderer=W=v([w(7,_.IInstantiationService),w(8,o.ICharSizeService),w(9,_.IOptionsService),w(10,_.IBufferService),w(11,o.ICoreBrowserService),w(12,o.IThemeService)],W)},3787:function(H,l,u){var v=this&&this.__decorate||function(b,L,S,A){var F,j=arguments.length,W=j<3?L:A===null?A=Object.getOwnPropertyDescriptor(L,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(b,L,S,A);else for(var I=b.length-1;I>=0;I--)(F=b[I])&&(W=(j<3?F(W):j>3?F(L,S,W):F(L,S))||W);return j>3&&W&&Object.defineProperty(L,S,W),W},w=this&&this.__param||function(b,L){return function(S,A){L(S,A,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const f=u(2223),m=u(643),y=u(511),x=u(2585),g=u(8055),o=u(4725),a=u(4269),s=u(6171),n=u(3734);let _=l.DomRendererRowFactory=class{constructor(b,L,S,A,F,j,W){this._document=b,this._characterJoinerService=L,this._optionsService=S,this._coreBrowserService=A,this._coreService=F,this._decorationService=j,this._themeService=W,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(b,L,S){this._selectionStart=b,this._selectionEnd=L,this._columnSelectMode=S}createRow(b,L,S,A,F,j,W,I,Q,te,ne){const le=[],X=this._characterJoinerService.getJoinedCharacters(L),R=this._themeService.colors;let O,T=b.getNoBgTrimmedLength();S&&T<j+1&&(T=j+1);let P=0,Z="",re=0,ce=0,he=0,U=!1,B=0,ee=!1,J=0;const de=[],ue=te!==-1&&ne!==-1;for(let Ee=0;Ee<T;Ee++){b.loadCell(Ee,this._workCell);let Re=this._workCell.getWidth();if(Re===0)continue;let Te=!1,Xe=Ee,ye=this._workCell;if(X.length>0&&Ee===X[0][0]){Te=!0;const Ae=X.shift();ye=new a.JoinedCellData(this._workCell,b.translateToString(!0,Ae[0],Ae[1]),Ae[1]-Ae[0]),Xe=Ae[1]-1,Re=ye.getWidth()}const Jt=this._isCellInSelection(Ee,L),Er=S&&Ee===j,Wt=ue&&Ee>=te&&Ee<=ne;let Mt=!1;this._decorationService.forEachDecorationAtCell(Ee,L,void 0,(Ae=>{Mt=!0}));let Zt=ye.getChars()||m.WHITESPACE_CELL_CHAR;if(Zt===" "&&(ye.isUnderline()||ye.isOverline())&&(Zt=" "),J=Re*I-Q.get(Zt,ye.isBold(),ye.isItalic()),O){if(P&&(Jt&&ee||!Jt&&!ee&&ye.bg===re)&&(Jt&&ee&&R.selectionForeground||ye.fg===ce)&&ye.extended.ext===he&&Wt===U&&J===B&&!Er&&!Te&&!Mt){ye.isInvisible()?Z+=m.WHITESPACE_CELL_CHAR:Z+=Zt,P++;continue}P&&(O.textContent=Z),O=this._document.createElement("span"),P=0,Z=""}else O=this._document.createElement("span");if(re=ye.bg,ce=ye.fg,he=ye.extended.ext,U=Wt,B=J,ee=Jt,Te&&j>=Ee&&j<=Xe&&(j=Ee),!this._coreService.isCursorHidden&&Er&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&de.push("xterm-cursor-blink"),de.push(A==="bar"?"xterm-cursor-bar":A==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(F)switch(F){case"outline":de.push("xterm-cursor-outline");break;case"block":de.push("xterm-cursor-block");break;case"bar":de.push("xterm-cursor-bar");break;case"underline":de.push("xterm-cursor-underline")}}if(ye.isBold()&&de.push("xterm-bold"),ye.isItalic()&&de.push("xterm-italic"),ye.isDim()&&de.push("xterm-dim"),Z=ye.isInvisible()?m.WHITESPACE_CELL_CHAR:ye.getChars()||m.WHITESPACE_CELL_CHAR,ye.isUnderline()&&(de.push(`xterm-underline-${ye.extended.underlineStyle}`),Z===" "&&(Z=" "),!ye.isUnderlineColorDefault()))if(ye.isUnderlineColorRGB())O.style.textDecorationColor=`rgb(${n.AttributeData.toColorRGB(ye.getUnderlineColor()).join(",")})`;else{let Ae=ye.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ye.isBold()&&Ae<8&&(Ae+=8),O.style.textDecorationColor=R.ansi[Ae].css}ye.isOverline()&&(de.push("xterm-overline"),Z===" "&&(Z=" ")),ye.isStrikethrough()&&de.push("xterm-strikethrough"),Wt&&(O.style.textDecoration="underline");let rt=ye.getFgColor(),er=ye.getFgColorMode(),dt=ye.getBgColor(),tr=ye.getBgColorMode();const kr=!!ye.isInverse();if(kr){const Ae=rt;rt=dt,dt=Ae;const Yi=er;er=tr,tr=Yi}let ft,br,nt,xt=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,L,void 0,(Ae=>{Ae.options.layer!=="top"&&xt||(Ae.backgroundColorRGB&&(tr=50331648,dt=Ae.backgroundColorRGB.rgba>>8&16777215,ft=Ae.backgroundColorRGB),Ae.foregroundColorRGB&&(er=50331648,rt=Ae.foregroundColorRGB.rgba>>8&16777215,br=Ae.foregroundColorRGB),xt=Ae.options.layer==="top")})),!xt&&Jt&&(ft=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,dt=ft.rgba>>8&16777215,tr=50331648,xt=!0,R.selectionForeground&&(er=50331648,rt=R.selectionForeground.rgba>>8&16777215,br=R.selectionForeground)),xt&&de.push("xterm-decoration-top"),tr){case 16777216:case 33554432:nt=R.ansi[dt],de.push(`xterm-bg-${dt}`);break;case 50331648:nt=g.channels.toColor(dt>>16,dt>>8&255,255&dt),this._addStyle(O,`background-color:#${k((dt>>>0).toString(16),"0",6)}`);break;default:kr?(nt=R.foreground,de.push(`xterm-bg-${f.INVERTED_DEFAULT_COLOR}`)):nt=R.background}switch(ft||ye.isDim()&&(ft=g.color.multiplyOpacity(nt,.5)),er){case 16777216:case 33554432:ye.isBold()&&rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(rt+=8),this._applyMinimumContrast(O,nt,R.ansi[rt],ye,ft,void 0)||de.push(`xterm-fg-${rt}`);break;case 50331648:const Ae=g.channels.toColor(rt>>16&255,rt>>8&255,255&rt);this._applyMinimumContrast(O,nt,Ae,ye,ft,br)||this._addStyle(O,`color:#${k(rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(O,nt,R.foreground,ye,ft,br)||kr&&de.push(`xterm-fg-${f.INVERTED_DEFAULT_COLOR}`)}de.length&&(O.className=de.join(" "),de.length=0),Er||Te||Mt?O.textContent=Z:P++,J!==this.defaultSpacing&&(O.style.letterSpacing=`${J}px`),le.push(O),Ee=Xe}return O&&P&&(O.textContent=Z),le}_applyMinimumContrast(b,L,S,A,F,j){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.treatGlyphAsBackgroundColor)(A.getCode()))return!1;const W=this._getContrastCache(A);let I;if(F||j||(I=W.getColor(L.rgba,S.rgba)),I===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(A.isDim()?2:1);I=g.color.ensureContrastRatio(F||L,j||S,Q),W.setColor((F||L).rgba,(j||S).rgba,I??null)}return!!I&&(this._addStyle(b,`color:${I.css}`),!0)}_getContrastCache(b){return b.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(b,L){b.setAttribute("style",`${b.getAttribute("style")||""}${L};`)}_isCellInSelection(b,L){const S=this._selectionStart,A=this._selectionEnd;return!(!S||!A)&&(this._columnSelectMode?S[0]<=A[0]?b>=S[0]&&L>=S[1]&&b<A[0]&&L<=A[1]:b<S[0]&&L>=S[1]&&b>=A[0]&&L<=A[1]:L>S[1]&&L<A[1]||S[1]===A[1]&&L===S[1]&&b>=S[0]&&b<A[0]||S[1]<A[1]&&L===A[1]&&b<A[0]||S[1]<A[1]&&L===S[1]&&b>=S[0])}};function k(b,L,S){for(;b.length<S;)b=L+b;return b}l.DomRendererRowFactory=_=v([w(1,o.ICharacterJoinerService),w(2,x.IOptionsService),w(3,o.ICoreBrowserService),w(4,x.ICoreService),w(5,x.IDecorationService),w(6,o.IThemeService)],_)},2550:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,v){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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 w=u.createElement("span");w.classList.add("xterm-char-measure-element");const f=u.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontWeight="bold";const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const y=u.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[w,f,m,y],this._container.appendChild(w),this._container.appendChild(f),this._container.appendChild(m),this._container.appendChild(y),v.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(u,v,w,f){u===this._font&&v===this._fontSize&&w===this._weight&&f===this._weightBold||(this._font=u,this._fontSize=v,this._weight=w,this._weightBold=f,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${w}`,this._measureElements[1].style.fontWeight=`${f}`,this._measureElements[2].style.fontWeight=`${w}`,this._measureElements[3].style.fontWeight=`${f}`,this.clear())}get(u,v,w){let f=0;if(!v&&!w&&u.length===1&&(f=u.charCodeAt(0))<256){if(this._flat[f]!==-9999)return this._flat[f];const x=this._measure(u,0);return x>0&&(this._flat[f]=x),x}let m=u;v&&(m+="B"),w&&(m+="I");let y=this._holey.get(m);if(y===void 0){let x=0;v&&(x|=1),w&&(x|=2),y=this._measure(u,x),y>0&&this._holey.set(m,y)}return y}_measure(u,v){const w=this._measureElements[v];return w.textContent=u.repeat(32),w.offsetWidth/32}}},2223:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const v=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=v.isFirefox||v.isLegacyEdge?"bottom":"ideographic"},6171:(H,l)=>{function u(w){return 57508<=w&&w<=57558}function v(w){return w>=128512&&w<=128591||w>=127744&&w<=128511||w>=128640&&w<=128767||w>=9728&&w<=9983||w>=9984&&w<=10175||w>=65024&&w<=65039||w>=129280&&w<=129535||w>=127462&&w<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(w){if(!w)throw new Error("value must not be falsy");return w},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(w){return 57520<=w&&w<=57527},l.isEmoji=v,l.allowRescaling=function(w,f,m,y){return f===1&&m>Math.ceil(1.5*y)&&w!==void 0&&w>255&&!v(w)&&!u(w)&&!(function(x){return 57344<=x&&x<=63743})(w)},l.treatGlyphAsBackgroundColor=function(w){return u(w)||(function(f){return 9472<=f&&f<=9631})(w)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(w,f,m=0){return(w-(2*Math.round(f)-m))%(2*Math.round(f))}},6052:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{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(w,f,m,y=!1){if(this.selectionStart=f,this.selectionEnd=m,!f||!m||f[0]===m[0]&&f[1]===m[1])return void this.clear();const x=w.buffers.active.ydisp,g=f[1]-x,o=m[1]-x,a=Math.max(g,0),s=Math.min(o,w.rows-1);a>=w.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=g,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=s,this.startCol=f[0],this.endCol=m[0])}isCellSelected(w,f,m){return!!this.hasSelection&&(m-=w.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?f>=this.startCol&&m>=this.viewportCappedStartRow&&f<this.endCol&&m<=this.viewportCappedEndRow:f<this.startCol&&m>=this.viewportCappedStartRow&&f>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&f<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&f>=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,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 u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,v=this.selectionEnd;return!(!u||!v)&&(u[1]>v[1]||u[1]===v[1]&&u[0]>v[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(H,l,u){var v=this&&this.__decorate||function(s,n,_,k){var b,L=arguments.length,S=L<3?n:k===null?k=Object.getOwnPropertyDescriptor(n,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,_,k);else for(var A=s.length-1;A>=0;A--)(b=s[A])&&(S=(L<3?b(S):L>3?b(n,_,S):b(n,_))||S);return L>3&&S&&Object.defineProperty(n,_,S),S},w=this&&this.__param||function(s,n){return function(_,k){n(_,k,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const f=u(2585),m=u(8460),y=u(844);let x=l.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(s,n,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new o(s,n,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const s=this._measureStrategy.measure();s.width===this.width&&s.height===this.height||(this.width=s.width,this.height=s.height,this._onCharSizeChange.fire())}};l.CharSizeService=x=v([w(2,f.IOptionsService)],x);class g extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(n,_){n!==void 0&&n>0&&_!==void 0&&_>0&&(this._result.width=n,this._result.height=_)}}class o extends g{constructor(n,_,k){super(),this._document=n,this._parentElement=_,this._optionsService=k,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends g{constructor(n){super(),this._optionsService=n,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const n=this._ctx.measureText("W");return this._validateAndSet(n.width,n.fontBoundingBoxAscent+n.fontBoundingBoxDescent),this._result}}},4269:function(H,l,u){var v=this&&this.__decorate||function(a,s,n,_){var k,b=arguments.length,L=b<3?s:_===null?_=Object.getOwnPropertyDescriptor(s,n):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,s,n,_);else for(var S=a.length-1;S>=0;S--)(k=a[S])&&(L=(b<3?k(L):b>3?k(s,n,L):k(s,n))||L);return b>3&&L&&Object.defineProperty(s,n,L),L},w=this&&this.__param||function(a,s){return function(n,_){s(n,_,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const f=u(3734),m=u(643),y=u(511),x=u(2585);class g extends f.AttributeData{constructor(s,n,_){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=n,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=g;let o=l.CharacterJoinerService=class Xh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(s){const n={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(n),n.id}deregister(s){for(let n=0;n<this._characterJoiners.length;n++)if(this._characterJoiners[n].id===s)return this._characterJoiners.splice(n,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const n=this._bufferService.buffer.lines.get(s);if(!n||n.length===0)return[];const _=[],k=n.translateToString(!0);let b=0,L=0,S=0,A=n.getFg(0),F=n.getBg(0);for(let j=0;j<n.getTrimmedLength();j++)if(n.loadCell(j,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==A||this._workCell.bg!==F){if(j-b>1){const W=this._getJoinedRanges(k,S,L,n,b);for(let I=0;I<W.length;I++)_.push(W[I])}b=j,S=L,A=this._workCell.fg,F=this._workCell.bg}L+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-b>1){const j=this._getJoinedRanges(k,S,L,n,b);for(let W=0;W<j.length;W++)_.push(j[W])}return _}_getJoinedRanges(s,n,_,k,b){const L=s.substring(n,_);let S=[];try{S=this._characterJoiners[0].handler(L)}catch(A){console.error(A)}for(let A=1;A<this._characterJoiners.length;A++)try{const F=this._characterJoiners[A].handler(L);for(let j=0;j<F.length;j++)Xh._mergeRanges(S,F[j])}catch(F){console.error(F)}return this._stringRangesToCellRanges(S,k,b),S}_stringRangesToCellRanges(s,n,_){let k=0,b=!1,L=0,S=s[k];if(S){for(let A=_;A<this._bufferService.cols;A++){const F=n.getWidth(A),j=n.getString(A).length||m.WHITESPACE_CELL_CHAR.length;if(F!==0){if(!b&&S[0]<=L&&(S[0]=A,b=!0),S[1]<=L){if(S[1]=A,S=s[++k],!S)break;S[0]<=L?(S[0]=A,b=!0):b=!1}L+=j}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(s,n){let _=!1;for(let k=0;k<s.length;k++){const b=s[k];if(_){if(n[1]<=b[0])return s[k-1][1]=n[1],s;if(n[1]<=b[1])return s[k-1][1]=Math.max(n[1],b[1]),s.splice(k,1),s;s.splice(k,1),k--}else{if(n[1]<=b[0])return s.splice(k,0,n),s;if(n[1]<=b[1])return b[0]=Math.min(n[0],b[0]),s;n[0]<b[1]&&(b[0]=Math.min(n[0],b[0]),_=!0)}}return _?s[s.length-1][1]=n[1]:s.push(n),s}};l.CharacterJoinerService=o=v([w(0,x.IBufferService)],o)},5114:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const v=u(844),w=u(8460),f=u(3656);class m extends v.Disposable{constructor(g,o,a){super(),this._textarea=g,this._window=o,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new w.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new w.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((s=>this._screenDprMonitor.setWindow(s)))),this.register((0,w.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(g){this._window!==g&&(this._window=g,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=m;class y extends v.Disposable{constructor(g){super(),this._parentWindow=g,this._windowResizeListener=this.register(new v.MutableDisposable),this._onDprChange=this.register(new w.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,v.toDisposable)((()=>this.clearListener())))}setWindow(g){this._parentWindow=g,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 g;this._outerListener&&((g=this._resolutionMediaMatchList)==null||g.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:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const v=u(844);class w extends v.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,v.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const y=this.linkProviders.indexOf(m);y!==-1&&this.linkProviders.splice(y,1)}}}}l.LinkProviderService=w},8934:function(H,l,u){var v=this&&this.__decorate||function(x,g,o,a){var s,n=arguments.length,_=n<3?g:a===null?a=Object.getOwnPropertyDescriptor(g,o):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(x,g,o,a);else for(var k=x.length-1;k>=0;k--)(s=x[k])&&(_=(n<3?s(_):n>3?s(g,o,_):s(g,o))||_);return n>3&&_&&Object.defineProperty(g,o,_),_},w=this&&this.__param||function(x,g){return function(o,a){g(o,a,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const f=u(4725),m=u(9806);let y=l.MouseService=class{constructor(x,g){this._renderService=x,this._charSizeService=g}getCoords(x,g,o,a,s){return(0,m.getCoords)(window,x,g,o,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(x,g){const o=(0,m.getCoordsRelativeToElement)(window,x,g);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};l.MouseService=y=v([w(0,f.IRenderService),w(1,f.ICharSizeService)],y)},3230:function(H,l,u){var v=this&&this.__decorate||function(s,n,_,k){var b,L=arguments.length,S=L<3?n:k===null?k=Object.getOwnPropertyDescriptor(n,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,_,k);else for(var A=s.length-1;A>=0;A--)(b=s[A])&&(S=(L<3?b(S):L>3?b(n,_,S):b(n,_))||S);return L>3&&S&&Object.defineProperty(n,_,S),S},w=this&&this.__param||function(s,n){return function(_,k){n(_,k,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const f=u(6193),m=u(4725),y=u(8460),x=u(844),g=u(7226),o=u(2585);let a=l.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(s,n,_,k,b,L,S,A){super(),this._rowCount=s,this._charSizeService=k,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new g.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f.RenderDebouncer(((F,j)=>this._renderRows(F,j)),S),this.register(this._renderDebouncer),this.register(S.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(L.onResize((()=>this._fullRefresh()))),this.register(L.buffers.onBufferActivate((()=>{var F;return(F=this._renderer.value)==null?void 0:F.clear()}))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(b.onDecorationRegistered((()=>this._fullRefresh()))),this.register(b.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(L.cols,L.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(L.buffer.y,L.buffer.y,!0)))),this.register(A.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(S.window,n),this.register(S.onWindowChange((F=>this._registerIntersectionObserver(F,n))))}_registerIntersectionObserver(s,n){if("IntersectionObserver"in s){const _=new s.IntersectionObserver((k=>this._handleIntersectionChange(k[k.length-1])),{threshold:0});_.observe(n),this._observerDisposable.value=(0,x.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(s,n,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,n,this._rowCount))}_renderRows(s,n){this._renderer.value&&(s=Math.min(s,this._rowCount-1),n=Math.min(n,this._rowCount-1),this._renderer.value.renderRows(s,n),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:s,end:n}),this._onRender.fire({start:s,end:n}),this._isNextRenderRedrawOnly=!0)}resize(s,n){this._rowCount=n,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(s){this._renderer.value=s,this._renderer.value&&(this._renderer.value.onRequestRedraw((n=>this.refreshRows(n.start,n.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(s){return this._renderDebouncer.addRefreshCallback(s)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var s,n;this._renderer.value&&((n=(s=this._renderer.value).clearTextureAtlas)==null||n.call(s),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(s,n){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(s,n)})):this._renderer.value.handleResize(s,n),this._fullRefresh())}handleCharSizeChanged(){var s;(s=this._renderer.value)==null||s.handleCharSizeChanged()}handleBlur(){var s;(s=this._renderer.value)==null||s.handleBlur()}handleFocus(){var s;(s=this._renderer.value)==null||s.handleFocus()}handleSelectionChanged(s,n,_){var k;this._selectionState.start=s,this._selectionState.end=n,this._selectionState.columnSelectMode=_,(k=this._renderer.value)==null||k.handleSelectionChanged(s,n,_)}handleCursorMove(){var s;(s=this._renderer.value)==null||s.handleCursorMove()}clear(){var s;(s=this._renderer.value)==null||s.clear()}};l.RenderService=a=v([w(2,o.IOptionsService),w(3,m.ICharSizeService),w(4,o.IDecorationService),w(5,o.IBufferService),w(6,m.ICoreBrowserService),w(7,m.IThemeService)],a)},9312:function(H,l,u){var v=this&&this.__decorate||function(S,A,F,j){var W,I=arguments.length,Q=I<3?A:j===null?j=Object.getOwnPropertyDescriptor(A,F):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(S,A,F,j);else for(var te=S.length-1;te>=0;te--)(W=S[te])&&(Q=(I<3?W(Q):I>3?W(A,F,Q):W(A,F))||Q);return I>3&&Q&&Object.defineProperty(A,F,Q),Q},w=this&&this.__param||function(S,A){return function(F,j){A(F,j,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const f=u(9806),m=u(9504),y=u(456),x=u(4725),g=u(8460),o=u(844),a=u(6114),s=u(4841),n=u(511),_=u(2585),k=" ",b=new RegExp(k,"g");let L=l.SelectionService=class extends o.Disposable{constructor(S,A,F,j,W,I,Q,te,ne){super(),this._element=S,this._screenElement=A,this._linkifier=F,this._bufferService=j,this._coreService=W,this._mouseService=I,this._optionsService=Q,this._renderService=te,this._coreBrowserService=ne,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new n.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=le=>this._handleMouseMove(le),this._mouseUpListener=le=>this._handleMouseUp(le),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((le=>this._handleTrim(le))),this.register(this._bufferService.buffers.onBufferActivate((le=>this._handleBufferActivate(le)))),this.enable(),this._model=new y.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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 S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!S||!A||S[0]===A[0]&&S[1]===A[1])}get selectionText(){const S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;if(!S||!A)return"";const F=this._bufferService.buffer,j=[];if(this._activeSelectionMode===3){if(S[0]===A[0])return"";const W=S[0]<A[0]?S[0]:A[0],I=S[0]<A[0]?A[0]:S[0];for(let Q=S[1];Q<=A[1];Q++){const te=F.translateBufferLineToString(Q,!0,W,I);j.push(te)}}else{const W=S[1]===A[1]?A[0]:void 0;j.push(F.translateBufferLineToString(S[1],!0,S[0],W));for(let I=S[1]+1;I<=A[1]-1;I++){const Q=F.lines.get(I),te=F.translateBufferLineToString(I,!0);Q!=null&&Q.isWrapped?j[j.length-1]+=te:j.push(te)}if(S[1]!==A[1]){const I=F.lines.get(A[1]),Q=F.translateBufferLineToString(A[1],!0,0,A[0]);I&&I.isWrapped?j[j.length-1]+=Q:j.push(Q)}}return j.map((W=>W.replace(b," "))).join(a.isWindows?`\r
45
- `:`
46
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&S&&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(S){const A=this._getMouseBufferCoords(S),F=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!!(F&&j&&A)&&this._areCoordsInSelection(A,F,j)}isCellInSelection(S,A){const F=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!F||!j)&&this._areCoordsInSelection([S,A],F,j)}_areCoordsInSelection(S,A,F){return S[1]>A[1]&&S[1]<F[1]||A[1]===F[1]&&S[1]===A[1]&&S[0]>=A[0]&&S[0]<F[0]||A[1]<F[1]&&S[1]===F[1]&&S[0]<F[0]||A[1]<F[1]&&S[1]===A[1]&&S[0]>=A[0]}_selectWordAtCursor(S,A){var W,I;const F=(I=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:I.range;if(F)return this._model.selectionStart=[F.start.x-1,F.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(F,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const j=this._getMouseBufferCoords(S);return!!j&&(this._selectWordAt(j,A),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,A){this._model.clearSelection(),S=Math.max(S,0),A=Math.min(A,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,A],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const A=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(A)return A[0]--,A[1]--,A[1]+=this._bufferService.buffer.ydisp,A}_getMouseEventScrollAmount(S){let A=(0,f.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const F=this._renderService.dimensions.css.canvas.height;return A>=0&&A<=F?0:(A>F&&(A-=F),A=Math.min(Math.max(A,-50),50),A/=50,A/Math.abs(A)+Math.round(14*A))}shouldForceSelection(S){return a.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const A=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);A&&A.length!==this._model.selectionStart[0]&&A.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const A=this._getMouseBufferCoords(S);A&&(this._activeSelectionMode=2,this._selectLineAt(A[1]))}shouldColumnSelect(S){return S.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const A=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const F=this._bufferService.buffer;if(this._model.selectionEnd[1]<F.lines.length){const j=F.lines.get(this._model.selectionEnd[1]);j&&j.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}A&&A[0]===this._model.selectionEnd[0]&&A[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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const A=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&A<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const F=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(F&&F[0]!==void 0&&F[1]!==void 0){const j=(0,m.moveToCellSequence)(F[0]-1,F[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(j,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,A=this._model.finalSelectionEnd,F=!(!S||!A||S[0]===A[0]&&S[1]===A[1]);F?S&&A&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&A[0]===this._oldSelectionEnd[0]&&A[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,A,F)):this._oldHasSelection&&this._fireOnSelectionChange(S,A,F)}_fireOnSelectionChange(S,A,F){this._oldSelectionStart=S,this._oldSelectionEnd=A,this._oldHasSelection=F,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim((A=>this._handleTrim(A)))}_convertViewportColToCharacterIndex(S,A){let F=A;for(let j=0;A>=j;j++){const W=S.loadCell(j,this._workCell).getChars().length;this._workCell.getWidth()===0?F--:W>1&&A!==j&&(F+=W-1)}return F}setSelection(S,A,F){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,A],this._model.selectionStartLength=F,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,A,F=!0,j=!0){if(S[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(S[1]);if(!I)return;const Q=W.translateBufferLineToString(S[1],!1);let te=this._convertViewportColToCharacterIndex(I,S[0]),ne=te;const le=S[0]-te;let X=0,R=0,O=0,T=0;if(Q.charAt(te)===" "){for(;te>0&&Q.charAt(te-1)===" ";)te--;for(;ne<Q.length&&Q.charAt(ne+1)===" ";)ne++}else{let re=S[0],ce=S[0];I.getWidth(re)===0&&(X++,re--),I.getWidth(ce)===2&&(R++,ce++);const he=I.getString(ce).length;for(he>1&&(T+=he-1,ne+=he-1);re>0&&te>0&&!this._isCharWordSeparator(I.loadCell(re-1,this._workCell));){I.loadCell(re-1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,re--):U>1&&(O+=U-1,te-=U-1),te--,re--}for(;ce<I.length&&ne+1<Q.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const U=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,ce++):U>1&&(T+=U-1,ne+=U-1),ne++,ce++}}ne++;let P=te+le-X+O,Z=Math.min(this._bufferService.cols,ne-te+X+R-O-T);if(A||Q.slice(te,ne).trim()!==""){if(F&&P===0&&I.getCodePoint(0)!==32){const re=W.lines.get(S[1]-1);if(re&&I.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(ce){const he=this._bufferService.cols-ce.start;P-=he,Z+=he}}}if(j&&P+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const re=W.lines.get(S[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ce=this._getWordAt([0,S[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:P,length:Z}}}_selectWordAt(S,A){const F=this._getWordAt(S,A);if(F){for(;F.start<0;)F.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[F.start,S[1]],this._model.selectionStartLength=F.length}}_selectToWordAt(S){const A=this._getWordAt(S,!0);if(A){let F=S[1];for(;A.start<0;)A.start+=this._bufferService.cols,F--;if(!this._model.areSelectionValuesReversed())for(;A.start+A.length>this._bufferService.cols;)A.length-=this._bufferService.cols,F++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?A.start:A.start+A.length,F]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const A=this._bufferService.buffer.getWrappedRangeForLine(S),F={start:{x:0,y:A.first},end:{x:this._bufferService.cols-1,y:A.last}};this._model.selectionStart=[0,A.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(F,this._bufferService.cols)}};l.SelectionService=L=v([w(3,_.IBufferService),w(4,_.ICoreService),w(5,x.IMouseService),w(6,_.IOptionsService),w(7,x.IRenderService),w(8,x.ICoreBrowserService)],L)},4725:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const v=u(8343);l.ICharSizeService=(0,v.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,v.createDecorator)("CoreBrowserService"),l.IMouseService=(0,v.createDecorator)("MouseService"),l.IRenderService=(0,v.createDecorator)("RenderService"),l.ISelectionService=(0,v.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,v.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,v.createDecorator)("ThemeService"),l.ILinkProviderService=(0,v.createDecorator)("LinkProviderService")},6731:function(H,l,u){var v=this&&this.__decorate||function(L,S,A,F){var j,W=arguments.length,I=W<3?S:F===null?F=Object.getOwnPropertyDescriptor(S,A):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(L,S,A,F);else for(var Q=L.length-1;Q>=0;Q--)(j=L[Q])&&(I=(W<3?j(I):W>3?j(S,A,I):j(S,A))||I);return W>3&&I&&Object.defineProperty(S,A,I),I},w=this&&this.__param||function(L,S){return function(A,F){S(A,F,L)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const f=u(7239),m=u(8055),y=u(8460),x=u(844),g=u(2585),o=m.css.toColor("#ffffff"),a=m.css.toColor("#000000"),s=m.css.toColor("#ffffff"),n=m.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const L=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let A=0;A<216;A++){const F=S[A/36%6|0],j=S[A/6%6|0],W=S[A%6];L.push({css:m.channels.toCss(F,j,W),rgba:m.channels.toRgba(F,j,W)})}for(let A=0;A<24;A++){const F=8+10*A;L.push({css:m.channels.toCss(F,F,F),rgba:m.channels.toRgba(F,F,F)})}return L})());let k=l.ThemeService=class extends x.Disposable{get colors(){return this._colors}constructor(L){super(),this._optionsService=L,this._contrastCache=new f.ColorContrastCache,this._halfContrastCache=new f.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:a,cursor:s,cursorAccent:n,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:m.color.blend(a,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:m.color.blend(a,_),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(L={}){const S=this._colors;if(S.foreground=b(L.foreground,o),S.background=b(L.background,a),S.cursor=b(L.cursor,s),S.cursorAccent=b(L.cursorAccent,n),S.selectionBackgroundTransparent=b(L.selectionBackground,_),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=b(L.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=L.selectionForeground?b(L.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=l.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=b(L.black,l.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=b(L.red,l.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=b(L.green,l.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=b(L.yellow,l.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=b(L.blue,l.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=b(L.magenta,l.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=b(L.cyan,l.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=b(L.white,l.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=b(L.brightBlack,l.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=b(L.brightRed,l.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=b(L.brightGreen,l.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=b(L.brightYellow,l.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=b(L.brightBlue,l.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=b(L.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=b(L.brightCyan,l.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=b(L.brightWhite,l.DEFAULT_ANSI_COLORS[15]),L.extendedAnsi){const A=Math.min(S.ansi.length-16,L.extendedAnsi.length);for(let F=0;F<A;F++)S.ansi[F+16]=b(L.extendedAnsi[F],l.DEFAULT_ANSI_COLORS[F+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(L){this._restoreColor(L),this._onChangeColors.fire(this.colors)}_restoreColor(L){if(L!==void 0)switch(L){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[L]=this._restoreColors.ansi[L]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(L){L(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 b(L,S){if(L!==void 0)try{return m.css.toColor(L)}catch{}return S}l.ThemeService=k=v([w(0,g.IOptionsService)],k)},6349:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const v=u(8460),w=u(844);class f extends w.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new v.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new v.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new v.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(y){if(this._maxLength===y)return;const x=new Array(y);for(let g=0;g<Math.min(y,this.length);g++)x[g]=this._array[this._getCyclicIndex(g)];this._array=x,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let x=this._length;x<y;x++)this._array[x]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,x){this._array[this._getCyclicIndex(y)]=x}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,x,...g){if(x){for(let o=y;o<this._length-x;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+x)];this._length-=x,this.onDeleteEmitter.fire({index:y,amount:x})}for(let o=this._length-1;o>=y;o--)this._array[this._getCyclicIndex(o+g.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<g.length;o++)this._array[this._getCyclicIndex(y+o)]=g[o];if(g.length&&this.onInsertEmitter.fire({index:y,amount:g.length}),this._length+g.length>this._maxLength){const o=this._length+g.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=g.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,x,g){if(!(x<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let a=x-1;a>=0;a--)this.set(y+a+g,this.get(y+a));const o=y+x+g-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<x;o++)this.set(y+o+g,this.get(y+o))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}l.CircularList=f},1439:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(v,w=5){if(typeof v!="object")return v;const f=Array.isArray(v)?[]:{};for(const m in v)f[m]=w<=1?v[m]:v[m]&&u(v[m],w-1);return f}},8055:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let u=0,v=0,w=0,f=0;var m,y,x,g,o;function a(n){const _=n.toString(16);return _.length<2?"0"+_:_}function s(n,_){return n<_?(_+.05)/(n+.05):(n+.05)/(_+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(n){n.toCss=function(_,k,b,L){return L!==void 0?`#${a(_)}${a(k)}${a(b)}${a(L)}`:`#${a(_)}${a(k)}${a(b)}`},n.toRgba=function(_,k,b,L=255){return(_<<24|k<<16|b<<8|L)>>>0},n.toColor=function(_,k,b,L){return{css:n.toCss(_,k,b,L),rgba:n.toRgba(_,k,b,L)}}})(m||(l.channels=m={})),(function(n){function _(k,b){return f=Math.round(255*b),[u,v,w]=o.toChannels(k.rgba),{css:m.toCss(u,v,w,f),rgba:m.toRgba(u,v,w,f)}}n.blend=function(k,b){if(f=(255&b.rgba)/255,f===1)return{css:b.css,rgba:b.rgba};const L=b.rgba>>24&255,S=b.rgba>>16&255,A=b.rgba>>8&255,F=k.rgba>>24&255,j=k.rgba>>16&255,W=k.rgba>>8&255;return u=F+Math.round((L-F)*f),v=j+Math.round((S-j)*f),w=W+Math.round((A-W)*f),{css:m.toCss(u,v,w),rgba:m.toRgba(u,v,w)}},n.isOpaque=function(k){return(255&k.rgba)==255},n.ensureContrastRatio=function(k,b,L){const S=o.ensureContrastRatio(k.rgba,b.rgba,L);if(S)return m.toColor(S>>24&255,S>>16&255,S>>8&255)},n.opaque=function(k){const b=(255|k.rgba)>>>0;return[u,v,w]=o.toChannels(b),{css:m.toCss(u,v,w),rgba:b}},n.opacity=_,n.multiplyOpacity=function(k,b){return f=255&k.rgba,_(k,f*b/255)},n.toColorRGB=function(k){return[k.rgba>>24&255,k.rgba>>16&255,k.rgba>>8&255]}})(y||(l.color=y={})),(function(n){let _,k;try{const b=document.createElement("canvas");b.width=1,b.height=1;const L=b.getContext("2d",{willReadFrequently:!0});L&&(_=L,_.globalCompositeOperation="copy",k=_.createLinearGradient(0,0,1,1))}catch{}n.toColor=function(b){if(b.match(/#[\da-f]{3,8}/i))switch(b.length){case 4:return u=parseInt(b.slice(1,2).repeat(2),16),v=parseInt(b.slice(2,3).repeat(2),16),w=parseInt(b.slice(3,4).repeat(2),16),m.toColor(u,v,w);case 5:return u=parseInt(b.slice(1,2).repeat(2),16),v=parseInt(b.slice(2,3).repeat(2),16),w=parseInt(b.slice(3,4).repeat(2),16),f=parseInt(b.slice(4,5).repeat(2),16),m.toColor(u,v,w,f);case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}const L=b.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(L)return u=parseInt(L[1]),v=parseInt(L[2]),w=parseInt(L[3]),f=Math.round(255*(L[5]===void 0?1:parseFloat(L[5]))),m.toColor(u,v,w,f);if(!_||!k)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=k,_.fillStyle=b,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[u,v,w,f]=_.getImageData(0,0,1,1).data,f!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(u,v,w,f),css:b}}})(x||(l.css=x={})),(function(n){function _(k,b,L){const S=k/255,A=b/255,F=L/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.0722*(F<=.03928?F/12.92:Math.pow((F+.055)/1.055,2.4))}n.relativeLuminance=function(k){return _(k>>16&255,k>>8&255,255&k)},n.relativeLuminance2=_})(g||(l.rgb=g={})),(function(n){function _(b,L,S){const A=b>>24&255,F=b>>16&255,j=b>>8&255;let W=L>>24&255,I=L>>16&255,Q=L>>8&255,te=s(g.relativeLuminance2(W,I,Q),g.relativeLuminance2(A,F,j));for(;te<S&&(W>0||I>0||Q>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),Q-=Math.max(0,Math.ceil(.1*Q)),te=s(g.relativeLuminance2(W,I,Q),g.relativeLuminance2(A,F,j));return(W<<24|I<<16|Q<<8|255)>>>0}function k(b,L,S){const A=b>>24&255,F=b>>16&255,j=b>>8&255;let W=L>>24&255,I=L>>16&255,Q=L>>8&255,te=s(g.relativeLuminance2(W,I,Q),g.relativeLuminance2(A,F,j));for(;te<S&&(W<255||I<255||Q<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),te=s(g.relativeLuminance2(W,I,Q),g.relativeLuminance2(A,F,j));return(W<<24|I<<16|Q<<8|255)>>>0}n.blend=function(b,L){if(f=(255&L)/255,f===1)return L;const S=L>>24&255,A=L>>16&255,F=L>>8&255,j=b>>24&255,W=b>>16&255,I=b>>8&255;return u=j+Math.round((S-j)*f),v=W+Math.round((A-W)*f),w=I+Math.round((F-I)*f),m.toRgba(u,v,w)},n.ensureContrastRatio=function(b,L,S){const A=g.relativeLuminance(b>>8),F=g.relativeLuminance(L>>8);if(s(A,F)<S){if(F<A){const I=_(b,L,S),Q=s(A,g.relativeLuminance(I>>8));if(Q<S){const te=k(b,L,S);return Q>s(A,g.relativeLuminance(te>>8))?I:te}return I}const j=k(b,L,S),W=s(A,g.relativeLuminance(j>>8));if(W<S){const I=_(b,L,S);return W>s(A,g.relativeLuminance(I>>8))?j:I}return j}},n.reduceLuminance=_,n.increaseLuminance=k,n.toChannels=function(b){return[b>>24&255,b>>16&255,b>>8&255,255&b]}})(o||(l.rgba=o={})),l.toPaddedHex=a,l.contrastRatio=s},8969:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const v=u(844),w=u(2585),f=u(4348),m=u(7866),y=u(744),x=u(7302),g=u(6975),o=u(8460),a=u(1753),s=u(1480),n=u(7994),_=u(9282),k=u(5435),b=u(5981),L=u(2660);let S=!1;class A extends v.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((j=>{var W;(W=this._onScrollApi)==null||W.fire(j.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(j){for(const W in j)this.optionsService.options[W]=j[W]}constructor(j){super(),this._windowsWrappingHeuristics=this.register(new v.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new f.InstantiationService,this.optionsService=this.register(new x.OptionsService(j)),this._instantiationService.setService(w.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(w.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(w.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(w.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(w.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(w.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(n.CharsetService),this._instantiationService.setService(w.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(L.OscLinkService),this._instantiationService.setService(w.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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((W=>{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((W=>{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 b.WriteBuffer(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(j,W){this._writeBuffer.write(j,W)}writeSync(j,W){this._logService.logLevel<=w.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(j,W)}input(j,W=!0){this.coreService.triggerDataEvent(j,W)}resize(j,W){isNaN(j)||isNaN(W)||(j=Math.max(j,y.MINIMUM_COLS),W=Math.max(W,y.MINIMUM_ROWS),this._bufferService.resize(j,W))}scroll(j,W=!1){this._bufferService.scroll(j,W)}scrollLines(j,W,I){this._bufferService.scrollLines(j,W,I)}scrollPages(j){this.scrollLines(j*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(j){const W=j-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(j,W){return this._inputHandler.registerEscHandler(j,W)}registerDcsHandler(j,W){return this._inputHandler.registerDcsHandler(j,W)}registerCsiHandler(j,W){return this._inputHandler.registerCsiHandler(j,W)}registerOscHandler(j,W){return this._inputHandler.registerOscHandler(j,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let j=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?j=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(j=!0),j?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const j=[];j.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),j.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,v.toDisposable)((()=>{for(const W of j)W.dispose()}))}}}l.CoreTerminal=A},8460:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let v=0;v<this._listeners.length;v++)if(this._listeners[v]===u)return void this._listeners.splice(v,1)}}})),this._event}fire(u,v){const w=[];for(let f=0;f<this._listeners.length;f++)w.push(this._listeners[f]);for(let f=0;f<w.length;f++)w[f].call(void 0,u,v)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,v){return u((w=>v.fire(w)))},l.runAndSubscribe=function(u,v){return v(void 0),u((w=>v(w)))}},5435:function(H,l,u){var v=this&&this.__decorate||function(X,R,O,T){var P,Z=arguments.length,re=Z<3?R:T===null?T=Object.getOwnPropertyDescriptor(R,O):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(X,R,O,T);else for(var ce=X.length-1;ce>=0;ce--)(P=X[ce])&&(re=(Z<3?P(re):Z>3?P(R,O,re):P(R,O))||re);return Z>3&&re&&Object.defineProperty(R,O,re),re},w=this&&this.__param||function(X,R){return function(O,T){R(O,T,X)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const f=u(2584),m=u(7116),y=u(2015),x=u(844),g=u(482),o=u(8437),a=u(8460),s=u(643),n=u(511),_=u(3734),k=u(2585),b=u(1480),L=u(6242),S=u(6351),A=u(5941),F={"(":0,")":1,"*":2,"+":3,"-":1,".":2},j=131072;function W(X,R){if(X>24)return R.setWinLines||!1;switch(X){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var I;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(l.WindowsOptionsReportType=I={}));let Q=0;class te extends x.Disposable{getAttrData(){return this._curAttrData}constructor(R,O,T,P,Z,re,ce,he,U=new y.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=O,this._coreService=T,this._logService=P,this._optionsService=Z,this._oscLinkService=re,this._coreMouseService=ce,this._unicodeService=he,this._parser=U,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new n.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new ne(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._parser.setCsiHandlerFallback(((B,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:ee.toArray()})})),this._parser.setEscHandlerFallback((B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})})),this._parser.setExecuteHandlerFallback((B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})})),this._parser.setOscHandlerFallback(((B,ee,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:ee,data:J})})),this._parser.setDcsHandlerFallback(((B,ee,J)=>{ee==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:ee,payload:J})})),this._parser.setPrintHandler(((B,ee,J)=>this.print(B,ee,J))),this._parser.registerCsiHandler({final:"@"},(B=>this.insertChars(B))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(B=>this.scrollLeft(B))),this._parser.registerCsiHandler({final:"A"},(B=>this.cursorUp(B))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(B=>this.scrollRight(B))),this._parser.registerCsiHandler({final:"B"},(B=>this.cursorDown(B))),this._parser.registerCsiHandler({final:"C"},(B=>this.cursorForward(B))),this._parser.registerCsiHandler({final:"D"},(B=>this.cursorBackward(B))),this._parser.registerCsiHandler({final:"E"},(B=>this.cursorNextLine(B))),this._parser.registerCsiHandler({final:"F"},(B=>this.cursorPrecedingLine(B))),this._parser.registerCsiHandler({final:"G"},(B=>this.cursorCharAbsolute(B))),this._parser.registerCsiHandler({final:"H"},(B=>this.cursorPosition(B))),this._parser.registerCsiHandler({final:"I"},(B=>this.cursorForwardTab(B))),this._parser.registerCsiHandler({final:"J"},(B=>this.eraseInDisplay(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(B=>this.eraseInDisplay(B,!0))),this._parser.registerCsiHandler({final:"K"},(B=>this.eraseInLine(B,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(B=>this.eraseInLine(B,!0))),this._parser.registerCsiHandler({final:"L"},(B=>this.insertLines(B))),this._parser.registerCsiHandler({final:"M"},(B=>this.deleteLines(B))),this._parser.registerCsiHandler({final:"P"},(B=>this.deleteChars(B))),this._parser.registerCsiHandler({final:"S"},(B=>this.scrollUp(B))),this._parser.registerCsiHandler({final:"T"},(B=>this.scrollDown(B))),this._parser.registerCsiHandler({final:"X"},(B=>this.eraseChars(B))),this._parser.registerCsiHandler({final:"Z"},(B=>this.cursorBackwardTab(B))),this._parser.registerCsiHandler({final:"`"},(B=>this.charPosAbsolute(B))),this._parser.registerCsiHandler({final:"a"},(B=>this.hPositionRelative(B))),this._parser.registerCsiHandler({final:"b"},(B=>this.repeatPrecedingCharacter(B))),this._parser.registerCsiHandler({final:"c"},(B=>this.sendDeviceAttributesPrimary(B))),this._parser.registerCsiHandler({prefix:">",final:"c"},(B=>this.sendDeviceAttributesSecondary(B))),this._parser.registerCsiHandler({final:"d"},(B=>this.linePosAbsolute(B))),this._parser.registerCsiHandler({final:"e"},(B=>this.vPositionRelative(B))),this._parser.registerCsiHandler({final:"f"},(B=>this.hVPosition(B))),this._parser.registerCsiHandler({final:"g"},(B=>this.tabClear(B))),this._parser.registerCsiHandler({final:"h"},(B=>this.setMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(B=>this.setModePrivate(B))),this._parser.registerCsiHandler({final:"l"},(B=>this.resetMode(B))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(B=>this.resetModePrivate(B))),this._parser.registerCsiHandler({final:"m"},(B=>this.charAttributes(B))),this._parser.registerCsiHandler({final:"n"},(B=>this.deviceStatus(B))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(B=>this.deviceStatusPrivate(B))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(B=>this.softReset(B))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(B=>this.setCursorStyle(B))),this._parser.registerCsiHandler({final:"r"},(B=>this.setScrollRegion(B))),this._parser.registerCsiHandler({final:"s"},(B=>this.saveCursor(B))),this._parser.registerCsiHandler({final:"t"},(B=>this.windowOptions(B))),this._parser.registerCsiHandler({final:"u"},(B=>this.restoreCursor(B))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(B=>this.insertColumns(B))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(B=>this.deleteColumns(B))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(B=>this.selectProtected(B))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(B=>this.requestMode(B,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(B=>this.requestMode(B,!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 L.OscHandler((B=>(this.setTitle(B),this.setIconName(B),!0)))),this._parser.registerOscHandler(1,new L.OscHandler((B=>this.setIconName(B)))),this._parser.registerOscHandler(2,new L.OscHandler((B=>this.setTitle(B)))),this._parser.registerOscHandler(4,new L.OscHandler((B=>this.setOrReportIndexedColor(B)))),this._parser.registerOscHandler(8,new L.OscHandler((B=>this.setHyperlink(B)))),this._parser.registerOscHandler(10,new L.OscHandler((B=>this.setOrReportFgColor(B)))),this._parser.registerOscHandler(11,new L.OscHandler((B=>this.setOrReportBgColor(B)))),this._parser.registerOscHandler(12,new L.OscHandler((B=>this.setOrReportCursorColor(B)))),this._parser.registerOscHandler(104,new L.OscHandler((B=>this.restoreIndexedColor(B)))),this._parser.registerOscHandler(110,new L.OscHandler((B=>this.restoreFgColor(B)))),this._parser.registerOscHandler(111,new L.OscHandler((B=>this.restoreBgColor(B)))),this._parser.registerOscHandler(112,new L.OscHandler((B=>this.restoreCursorColor(B)))),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 B in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},(()=>this.selectCharset("("+B))),this._parser.registerEscHandler({intermediates:")",final:B},(()=>this.selectCharset(")"+B))),this._parser.registerEscHandler({intermediates:"*",final:B},(()=>this.selectCharset("*"+B))),this._parser.registerEscHandler({intermediates:"+",final:B},(()=>this.selectCharset("+"+B))),this._parser.registerEscHandler({intermediates:"-",final:B},(()=>this.selectCharset("-"+B))),this._parser.registerEscHandler({intermediates:".",final:B},(()=>this.selectCharset("."+B))),this._parser.registerEscHandler({intermediates:"/",final:B},(()=>this.selectCharset("/"+B)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((B=>(this._logService.error("Parsing error: ",B),B))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler(((B,ee)=>this.requestStatusString(B,ee))))}_preserveStack(R,O,T,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=O,this._parseStack.decodedLength=T,this._parseStack.position=P}_logSlowResolvingAsync(R){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([R,new Promise(((O,T)=>setTimeout((()=>T("#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(R,O){let T,P=this._activeBuffer.x,Z=this._activeBuffer.y,re=0;const ce=this._parseStack.paused;if(ce){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,O))return this._logSlowResolvingAsync(T),T;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>j&&(re=this._parseStack.position+j)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,(B=>String.fromCharCode(B))).join("")}"`),typeof R=="string"?R.split("").map((B=>B.charCodeAt(0))):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<j&&(this._parseBuffer=new Uint32Array(Math.min(R.length,j))),ce||this._dirtyRowTracker.clearRange(),R.length>j)for(let B=re;B<R.length;B+=j){const ee=B+j<R.length?B+j:R.length,J=typeof R=="string"?this._stringDecoder.decode(R.substring(B,ee),this._parseBuffer):this._utf8Decoder.decode(R.subarray(B,ee),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,J))return this._preserveStack(P,Z,J,B),this._logSlowResolvingAsync(T),T}else if(!ce){const B=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,B))return this._preserveStack(P,Z,B,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===P&&this._activeBuffer.y===Z||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),U=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);U<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(U,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(R,O,T){let P,Z;const re=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,U=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,ee=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-O>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let de=this._parser.precedingJoinState;for(let ue=O;ue<T;++ue){if(P=R[ue],P<127&&re){const Xe=re[String.fromCharCode(P)];Xe&&(P=Xe.charCodeAt(0))}const Ee=this._unicodeService.charProperties(P,de);Z=b.UnicodeService.extractWidth(Ee);const Re=b.UnicodeService.extractShouldJoin(Ee),Te=Re?b.UnicodeService.extractWidth(de):0;if(de=Ee,ce&&this._onA11yChar.fire((0,g.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Te>he){if(U){const Xe=J;let ye=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,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),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&J instanceof o.BufferLine&&J.copyCellsFrom(Xe,ye,0,Te,!1);ye<he;)Xe.setCellFromCodepoint(ye++,0,1,ee)}else if(this._activeBuffer.x=he-1,Z===2)continue}if(Re&&this._activeBuffer.x){const Xe=J.getWidth(this._activeBuffer.x-1)?1:2;J.addCodepointToCell(this._activeBuffer.x-Xe,P,Z);for(let ye=Z-Te;--ye>=0;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(B&&(J.insertCells(this._activeBuffer.x,Z-Te,this._activeBuffer.getNullCell(ee)),J.getWidth(he-1)===2&&J.setCellFromCodepoint(he-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,ee)),J.setCellFromCodepoint(this._activeBuffer.x++,P,Z,ee),Z>0)for(;--Z;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=de,this._activeBuffer.x<he&&T-O>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,O){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,O):this._parser.registerCsiHandler(R,(T=>!W(T.params[0],this._optionsService.rawOptions.windowOptions)||O(T)))}registerDcsHandler(R,O){return this._parser.registerDcsHandler(R,new S.DcsHandler(O))}registerEscHandler(R,O){return this._parser.registerEscHandler(R,O)}registerOscHandler(R,O){return this._parser.registerOscHandler(R,new L.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 R;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&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.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 R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,O){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+O):(this._activeBuffer.x=R,this._activeBuffer.y=O),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,O){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+O)}cursorUp(R){const O=this._activeBuffer.y-this._activeBuffer.scrollTop;return O>=0?this._moveCursor(0,-Math.min(O,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const O=this._activeBuffer.scrollBottom-this._activeBuffer.y;return O>=0?this._moveCursor(0,Math.min(O,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const O=R.params[0];return O===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:O===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=R.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let O=R.params[0]||1;for(;O--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const O=R.params[0];return O===1&&(this._curAttrData.bg|=536870912),O!==2&&O!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,O,T,P=!1,Z=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);re.replaceCells(O,T,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(re.isWrapped=!1)}_resetBufferLine(R,O=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),O),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),T.isWrapped=!1)}eraseInDisplay(R,O=!1){let T;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,O);T<this._bufferService.rows;T++)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,O),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,O);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(R,O=!1){switch(this._restrictCursor(this._bufferService.cols),R.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(R){this._restrictCursor();let O=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;O--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let O=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;O--;)this._activeBuffer.lines.splice(T,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let O=R.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(R){let O=R.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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=R.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.deleteCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=R.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.insertCells(0,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=R.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.insertCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=R.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);P.deleteCells(this._activeBuffer.x,O,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return O&&(O.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const O=this._parser.precedingJoinState;if(!O)return!0;const T=R.params[0]||1,P=b.UnicodeService.extractWidth(O),Z=this._activeBuffer.x-P,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(re.length*T);let he=0;for(let B=0;B<re.length;){const ee=re.codePointAt(B)||0;ce[he++]=ee,B+=ee>65535?2:1}let U=he;for(let B=1;B<T;++B)ce.copyWithin(U,0,he),U+=he;return this.print(ce,0,U),!0}sendDeviceAttributesPrimary(R){return R.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(R){return R.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(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let O=0;O<R.length;O++)switch(R.params[O]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let O=0;O<R.length;O++)switch(R.params[O]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(R){for(let O=0;O<R.length;O++)switch(R.params[O]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let O=0;O<R.length;O++)switch(R.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(),R.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(R,O){const T=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,re=this._coreService,{buffers:ce,cols:he}=this._bufferService,{active:U,alt:B}=ce,ee=this._optionsService.rawOptions,J=Re=>Re?1:2,de=R.params[0];return ue=de,Ee=O?de===2?4:de===4?J(re.modes.insertMode):de===12?3:de===20?J(ee.convertEol):0:de===1?J(T.applicationCursorKeys):de===3?ee.windowOptions.setWinLines?he===80?2:he===132?1:0:0:de===6?J(T.origin):de===7?J(T.wraparound):de===8?3:de===9?J(P==="X10"):de===12?J(ee.cursorBlink):de===25?J(!re.isCursorHidden):de===45?J(T.reverseWraparound):de===66?J(T.applicationKeypad):de===67?4:de===1e3?J(P==="VT200"):de===1002?J(P==="DRAG"):de===1003?J(P==="ANY"):de===1004?J(T.sendFocus):de===1005?4:de===1006?J(Z==="SGR"):de===1015?4:de===1016?J(Z==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?J(U===B):de===2004?J(T.bracketedPasteMode):0,re.triggerDataEvent(`${f.C0.ESC}[${O?"":"?"}${ue};${Ee}$y`),!0;var ue,Ee}_updateAttrColor(R,O,T,P,Z){return O===2?(R|=50331648,R&=-16777216,R|=_.AttributeData.fromColorRGB([T,P,Z])):O===5&&(R&=-50331904,R|=33554432|255&T),R}_extractColor(R,O,T){const P=[0,0,-1,0,0,0];let Z=0,re=0;do{if(P[re+Z]=R.params[O+re],R.hasSubParams(O+re)){const ce=R.getSubParams(O+re);let he=0;do P[1]===5&&(Z=1),P[re+he+1+Z]=ce[he];while(++he<ce.length&&he+re+1+Z<P.length);break}if(P[1]===5&&re+Z>=2||P[1]===2&&re+Z>=5)break;P[1]&&(Z=1)}while(++re+O<R.length&&re+Z<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:T.fg=this._updateAttrColor(T.fg,P[1],P[3],P[4],P[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,P[1],P[3],P[4],P[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,P[1],P[3],P[4],P[5])}return re}_processUnderline(R,O){O.extended=O.extended.clone(),(!~R||R>5)&&(R=1),O.extended.underlineStyle=R,O.fg|=268435456,R===0&&(O.fg&=-268435457),O.updateExtended()}_processSGR0(R){R.fg=o.DEFAULT_ATTR_DATA.fg,R.bg=o.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const O=R.length;let T;const P=this._curAttrData;for(let Z=0;Z<O;Z++)T=R.params[Z],T>=30&&T<=37?(P.fg&=-50331904,P.fg|=16777216|T-30):T>=40&&T<=47?(P.bg&=-50331904,P.bg|=16777216|T-40):T>=90&&T<=97?(P.fg&=-50331904,P.fg|=16777224|T-90):T>=100&&T<=107?(P.bg&=-50331904,P.bg|=16777224|T-100):T===0?this._processSGR0(P):T===1?P.fg|=134217728:T===3?P.bg|=67108864:T===4?(P.fg|=268435456,this._processUnderline(R.hasSubParams(Z)?R.getSubParams(Z)[0]:1,P)):T===5?P.fg|=536870912:T===7?P.fg|=67108864:T===8?P.fg|=1073741824:T===9?P.fg|=2147483648:T===2?P.bg|=134217728:T===21?this._processUnderline(2,P):T===22?(P.fg&=-134217729,P.bg&=-134217729):T===23?P.bg&=-67108865:T===24?(P.fg&=-268435457,this._processUnderline(0,P)):T===25?P.fg&=-536870913:T===27?P.fg&=-67108865:T===28?P.fg&=-1073741825:T===29?P.fg&=2147483647:T===39?(P.fg&=-67108864,P.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):T===49?(P.bg&=-67108864,P.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?Z+=this._extractColor(R,Z,P):T===53?P.bg|=1073741824:T===55?P.bg&=-1073741825:T===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):T===100?(P.fg&=-67108864,P.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${f.C0.ESC}[0n`);break;case 6:const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[${O};${T}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const O=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${f.C0.ESC}[?${O};${T}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(R){const O=R.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 T=O%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(R){const O=R.params[0]||1;let T;return(R.length<2||(T=R.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>O&&(this._activeBuffer.scrollTop=O-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(R){if(!W(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const O=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:O!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.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(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const O=[],T=R.split(";");for(;T.length>1;){const P=T.shift(),Z=T.shift();if(/^\d+$/.exec(P)){const re=parseInt(P);if(le(re))if(Z==="?")O.push({type:0,index:re});else{const ce=(0,A.parseColor)(Z);ce&&O.push({type:1,index:re,color:ce})}}}return O.length&&this._onColor.fire(O),!0}setHyperlink(R){const O=R.split(";");return!(O.length<2)&&(O[1]?this._createHyperlink(O[0],O[1]):!O[0]&&this._finishHyperlink())}_createHyperlink(R,O){this._getCurrentLinkId()&&this._finishHyperlink();const T=R.split(":");let P;const Z=T.findIndex((re=>re.startsWith("id=")));return Z!==-1&&(P=T[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,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(R,O){const T=R.split(";");for(let P=0;P<T.length&&!(O>=this._specialColors.length);++P,++O)if(T[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[O]}]);else{const Z=(0,A.parseColor)(T[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[O],color:Z}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const O=[],T=R.split(";");for(let P=0;P<T.length;++P)if(/^\d+$/.exec(T[P])){const Z=parseInt(T[P]);le(Z)&&O.push({type:2,index:Z})}return O.length&&this._onColor.fire(O),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,m.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(F[R[0]],m.CHARSETS[R[1]]||m.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 R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new n.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let O=0;O<this._bufferService.rows;++O){const T=this._activeBuffer.ybase+this._activeBuffer.y+O,P=this._activeBuffer.lines.get(T);P&&(P.fill(R),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,O){const T=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${f.C0.ESC}${Z}${f.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,O){this._dirtyRowTracker.markRangeDirty(R,O)}}l.InputHandler=te;let ne=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,R){X>R&&(Q=X,X=R,R=Q),X<this.start&&(this.start=X),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function le(X){return 0<=X&&X<256}ne=v([w(0,k.IBufferService)],ne)},844:(H,l)=>{function u(v){for(const w of v)w.dispose();v.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const v of this._disposables)v.dispose();this._disposables.length=0}register(v){return this._disposables.push(v),v}unregister(v){const w=this._disposables.indexOf(v);w!==-1&&this._disposables.splice(w,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(v){var w;this._isDisposed||v===this._value||((w=this._value)==null||w.dispose(),this._value=v)}clear(){this.value=void 0}dispose(){var v;this._isDisposed=!0,(v=this._value)==null||v.dispose(),this._value=void 0}},l.toDisposable=function(v){return{dispose:v}},l.disposeArray=u,l.getDisposeArrayDisposable=function(v){return{dispose:()=>u(v)}}},1505:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(w,f,m){this._data[w]||(this._data[w]={}),this._data[w][f]=m}get(w,f){return this._data[w]?this._data[w][f]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(v,w,f,m,y){this._data.get(v,w)||this._data.set(v,w,new u),this._data.get(v,w).set(f,m,y)}get(v,w,f,m){var y;return(y=this._data.get(v,w))==null?void 0:y.get(f,m)}clear(){this._data.clear()}}},6114:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const u=l.isNode?"node":navigator.userAgent,v=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const w=u.match(/Version\/(\d+)/);return w===null||w.length<2?0:parseInt(w[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(v),l.isIpad=v==="iPad",l.isIphone=v==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(v),l.isLinux=v.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(v){this._getKey=v,this._array=[]}clear(){this._array.length=0}insert(v){this._array.length!==0?(u=this._search(this._getKey(v)),this._array.splice(u,0,v)):this._array.push(v)}delete(v){if(this._array.length===0)return!1;const w=this._getKey(v);if(w===void 0||(u=this._search(w),u===-1)||this._getKey(this._array[u])!==w)return!1;do if(this._array[u]===v)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===w);return!1}*getKeyIterator(v){if(this._array.length!==0&&(u=this._search(v),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===v))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===v)}forEachByKey(v,w){if(this._array.length!==0&&(u=this._search(v),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===v))do w(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===v)}values(){return[...this._array].values()}_search(v){let w=0,f=this._array.length-1;for(;f>=w;){let m=w+f>>1;const y=this._getKey(this._array[m]);if(y>v)f=m-1;else{if(!(y<v)){for(;m>0&&this._getKey(this._array[m-1])===v;)m--;return m}w=m+1}}return w}}},7226:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const v=u(6114);class w{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let x=0,g=0,o=y.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),g=Math.max(x,g),a=y.timeRemaining(),1.5*g>a)return o-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-x))}ms`),void this._start();o=a}this.clear()}}class f extends w{_requestCallback(y){return setTimeout((()=>y(this._createDeadline(16))))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const x=Date.now()+y;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}l.PriorityTaskQueue=f,l.IdleTaskQueue=!v.isNode&&"requestIdleCallback"in window?class extends w{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:f,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const v=u(643);l.updateWindowsModeWrappedState=function(w){const f=w.buffer.lines.get(w.buffer.ybase+w.buffer.y-1),m=f==null?void 0:f.get(w.cols-1),y=w.buffer.lines.get(w.buffer.ybase+w.buffer.y);y&&m&&(y.isWrapped=m[v.CHAR_DATA_CODE_INDEX]!==v.NULL_CELL_CODE&&m[v.CHAR_DATA_CODE_INDEX]!==v.WHITESPACE_CELL_CODE)}},3734:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new v}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 u;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}}l.AttributeData=u;class v{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,m=0){this._ext=0,this._urlId=0,this._ext=f,this._urlId=m}clone(){return new v(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=v},9092:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const v=u(6349),w=u(7226),f=u(3734),m=u(8437),y=u(4634),x=u(511),g=u(643),o=u(4863),a=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,n,_){this._hasScrollback=s,this._optionsService=n,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new w.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new v.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new f.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new f.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,n){return new m.BufferLine(this._bufferService.cols,this.getNullCell(s),n)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const n=s+this._optionsService.rawOptions.scrollback;return n>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:n}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=m.DEFAULT_ATTR_DATA);let n=this._rows;for(;n--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new v.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,n){const _=this.getNullCell(m.DEFAULT_ATTR_DATA);let k=0;const b=this._getCorrectBufferLength(n);if(b>this.lines.maxLength&&(this.lines.maxLength=b),this.lines.length>0){if(this._cols<s)for(let S=0;S<this.lines.length;S++)k+=+this.lines.get(S).resize(s,_);let L=0;if(this._rows<n)for(let S=this._rows;S<n;S++)this.lines.length<n+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(s,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+L+1?(this.ybase--,L++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(s,_)));else for(let S=this._rows;S>n;S--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(b<this.lines.maxLength){const S=this.lines.length-b;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=b}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,n-1),L&&(this.y+=L),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(s,n),this._cols>s))for(let L=0;L<this.lines.length;L++)k+=+this.lines.get(L).resize(s,_);this._cols=s,this._rows=n,this._memoryCleanupQueue.clear(),k>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let n=0;for(;this._memoryCleanupPosition<this.lines.length;)if(n+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),n>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,n){this._cols!==s&&(s>this._cols?this._reflowLarger(s,n):this._reflowSmaller(s,n))}_reflowLarger(s,n){const _=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(_.length>0){const k=(0,y.reflowLargerCreateNewLayout)(this.lines,_);(0,y.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(s,n,k.countRemoved)}}_reflowLargerAdjustViewport(s,n,_){const k=this.getNullCell(m.DEFAULT_ATTR_DATA);let b=_;for(;b-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new m.BufferLine(s,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(s,n){const _=this.getNullCell(m.DEFAULT_ATTR_DATA),k=[];let b=0;for(let L=this.lines.length-1;L>=0;L--){let S=this.lines.get(L);if(!S||!S.isWrapped&&S.getTrimmedLength()<=s)continue;const A=[S];for(;S.isWrapped&&L>0;)S=this.lines.get(--L),A.unshift(S);const F=this.ybase+this.y;if(F>=L&&F<L+A.length)continue;const j=A[A.length-1].getTrimmedLength(),W=(0,y.reflowSmallerGetNewLineLengths)(A,this._cols,s),I=W.length-A.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const te=[];for(let T=0;T<I;T++){const P=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);te.push(P)}te.length>0&&(k.push({start:L+A.length+b,newLines:te}),b+=te.length),A.push(...te);let ne=W.length-1,le=W[ne];le===0&&(ne--,le=W[ne]);let X=A.length-I-1,R=j;for(;X>=0;){const T=Math.min(R,le);if(A[ne]===void 0)break;if(A[ne].copyCellsFrom(A[X],R-T,le-T,T,!0),le-=T,le===0&&(ne--,le=W[ne]),R-=T,R===0){X--;const P=Math.max(X,0);R=(0,y.getWrappedLineTrimmedLength)(A,P,this._cols)}}for(let T=0;T<A.length;T++)W[T]<s&&A[T].setCell(W[T],_);let O=I-Q;for(;O-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+b)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+n-1)}if(k.length>0){const L=[],S=[];for(let ne=0;ne<this.lines.length;ne++)S.push(this.lines.get(ne));const A=this.lines.length;let F=A-1,j=0,W=k[j];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+b);let I=0;for(let ne=Math.min(this.lines.maxLength-1,A+b-1);ne>=0;ne--)if(W&&W.start>F+I){for(let le=W.newLines.length-1;le>=0;le--)this.lines.set(ne--,W.newLines[le]);ne++,L.push({index:F+1,amount:W.newLines.length}),I+=W.newLines.length,W=k[++j]}else this.lines.set(ne,S[F--]);let Q=0;for(let ne=L.length-1;ne>=0;ne--)L[ne].index+=Q,this.lines.onInsertEmitter.fire(L[ne]),Q+=L[ne].amount;const te=Math.max(0,A+b-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(s,n,_=0,k){const b=this.lines.get(s);return b?b.translateToString(n,_,k):""}getWrappedRangeForLine(s){let n=s,_=s;for(;n>0&&this.lines.get(n).isWrapped;)n--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:n,last:_}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].line===s&&(this.markers[n].dispose(),this.markers.splice(n--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const n=new o.Marker(s);return this.markers.push(n),n.register(this.lines.onTrim((_=>{n.line-=_,n.line<0&&n.dispose()}))),n.register(this.lines.onInsert((_=>{n.line>=_.index&&(n.line+=_.amount)}))),n.register(this.lines.onDelete((_=>{n.line>=_.index&&n.line<_.index+_.amount&&n.dispose(),n.line>_.index&&(n.line-=_.amount)}))),n.register(n.onDispose((()=>this._removeMarker(n)))),n}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const v=u(3734),w=u(511),f=u(643),m=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new v.AttributeData);let y=0;class x{constructor(o,a,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const n=a||w.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]);for(let _=0;_<o;++_)this.setCell(_,n);this.length=o}get(o){const a=this._data[3*o+0],s=2097151&a;return[this._data[3*o+1],2097152&a?this._combined[o]:s?(0,m.stringFromCodePoint)(s):"",a>>22,2097152&a?this._combined[o].charCodeAt(this._combined[o].length-1):s]}set(o,a){this._data[3*o+1]=a[f.CHAR_DATA_ATTR_INDEX],a[f.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=a[1],this._data[3*o+0]=2097152|o|a[f.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=a[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[f.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const a=this._data[3*o+0];return 2097152&a?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&a}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const a=this._data[3*o+0];return 2097152&a?this._combined[o]:2097151&a?(0,m.stringFromCodePoint)(2097151&a):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,a){return y=3*o,a.content=this._data[y+0],a.fg=this._data[y+1],a.bg=this._data[y+2],2097152&a.content&&(a.combinedData=this._combined[o]),268435456&a.bg&&(a.extended=this._extendedAttrs[o]),a}setCell(o,a){2097152&a.content&&(this._combined[o]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[o]=a.extended),this._data[3*o+0]=a.content,this._data[3*o+1]=a.fg,this._data[3*o+2]=a.bg}setCellFromCodepoint(o,a,s,n){268435456&n.bg&&(this._extendedAttrs[o]=n.extended),this._data[3*o+0]=a|s<<22,this._data[3*o+1]=n.fg,this._data[3*o+2]=n.bg}addCodepointToCell(o,a,s){let n=this._data[3*o+0];2097152&n?this._combined[o]+=(0,m.stringFromCodePoint)(a):2097151&n?(this._combined[o]=(0,m.stringFromCodePoint)(2097151&n)+(0,m.stringFromCodePoint)(a),n&=-2097152,n|=2097152):n=a|4194304,s&&(n&=-12582913,n|=s<<22),this._data[3*o+0]=n}insertCells(o,a,s){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length-o){const n=new w.CellData;for(let _=this.length-o-a-1;_>=0;--_)this.setCell(o+a+_,this.loadCell(o+_,n));for(let _=0;_<a;++_)this.setCell(o+_,s)}else for(let n=o;n<this.length;++n)this.setCell(n,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(o,a,s){if(o%=this.length,a<this.length-o){const n=new w.CellData;for(let _=0;_<this.length-o-a;++_)this.setCell(o+_,this.loadCell(o+a+_,n));for(let _=this.length-a;_<this.length;++_)this.setCell(_,s)}else for(let n=o;n<this.length;++n)this.setCell(n,s);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,s)}replaceCells(o,a,s,n=!1){if(n)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,s);o<a&&o<this.length;)this.isProtected(o)||this.setCell(o,s),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,s),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,s);o<a&&o<this.length;)this.setCell(o++,s)}resize(o,a){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const n=new Uint32Array(s);n.set(this._data),this._data=n}for(let n=this.length;n<o;++n)this.setCell(n,a)}else{this._data=this._data.subarray(0,s);const n=Object.keys(this._combined);for(let k=0;k<n.length;k++){const b=parseInt(n[k],10);b>=o&&delete this._combined[b]}const _=Object.keys(this._extendedAttrs);for(let k=0;k<_.length;k++){const b=parseInt(_[k],10);b>=o&&delete this._extendedAttrs[b]}}return this.length=o,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,a=!1){if(a)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,o);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const a in o._combined)this._combined[a]=o._combined[a];this._extendedAttrs={};for(const a in o._extendedAttrs)this._extendedAttrs[a]=o._extendedAttrs[a];this.isWrapped=o.isWrapped}clone(){const o=new x(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const a in this._combined)o._combined[a]=this._combined[a];for(const a in this._extendedAttrs)o._extendedAttrs[a]=this._extendedAttrs[a];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,a,s,n,_){const k=o._data;if(_)for(let L=n-1;L>=0;L--){for(let S=0;S<3;S++)this._data[3*(s+L)+S]=k[3*(a+L)+S];268435456&k[3*(a+L)+2]&&(this._extendedAttrs[s+L]=o._extendedAttrs[a+L])}else for(let L=0;L<n;L++){for(let S=0;S<3;S++)this._data[3*(s+L)+S]=k[3*(a+L)+S];268435456&k[3*(a+L)+2]&&(this._extendedAttrs[s+L]=o._extendedAttrs[a+L])}const b=Object.keys(o._combined);for(let L=0;L<b.length;L++){const S=parseInt(b[L],10);S>=a&&(this._combined[S-a+s]=o._combined[S])}}translateToString(o,a,s,n){a=a??0,s=s??this.length,o&&(s=Math.min(s,this.getTrimmedLength())),n&&(n.length=0);let _="";for(;a<s;){const k=this._data[3*a+0],b=2097151&k,L=2097152&k?this._combined[a]:b?(0,m.stringFromCodePoint)(b):f.WHITESPACE_CELL_CHAR;if(_+=L,n)for(let S=0;S<L.length;++S)n.push(a);a+=k>>22||1}return n&&n.push(a),_}}l.BufferLine=x},4841:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,v){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return v*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(H,l)=>{function u(v,w,f){if(w===v.length-1)return v[w].getTrimmedLength();const m=!v[w].hasContent(f-1)&&v[w].getWidth(f-1)===1,y=v[w+1].getWidth(0)===2;return m&&y?f-1:f}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(v,w,f,m,y){const x=[];for(let g=0;g<v.length-1;g++){let o=g,a=v.get(++o);if(!a.isWrapped)continue;const s=[v.get(g)];for(;o<v.length&&a.isWrapped;)s.push(a),a=v.get(++o);if(m>=g&&m<o){g+=s.length-1;continue}let n=0,_=u(s,n,w),k=1,b=0;for(;k<s.length;){const S=u(s,k,w),A=S-b,F=f-_,j=Math.min(A,F);s[n].copyCellsFrom(s[k],b,_,j,!1),_+=j,_===f&&(n++,_=0),b+=j,b===S&&(k++,b=0),_===0&&n!==0&&s[n-1].getWidth(f-1)===2&&(s[n].copyCellsFrom(s[n-1],f-1,_++,1,!1),s[n-1].setCell(f-1,y))}s[n].replaceCells(_,f,y);let L=0;for(let S=s.length-1;S>0&&(S>n||s[S].getTrimmedLength()===0);S--)L++;L>0&&(x.push(g+s.length-L),x.push(L)),g+=s.length-1}return x},l.reflowLargerCreateNewLayout=function(v,w){const f=[];let m=0,y=w[m],x=0;for(let g=0;g<v.length;g++)if(y===g){const o=w[++m];v.onDeleteEmitter.fire({index:g-x,amount:o}),g+=o-1,x+=o,y=w[++m]}else f.push(g);return{layout:f,countRemoved:x}},l.reflowLargerApplyNewLayout=function(v,w){const f=[];for(let m=0;m<w.length;m++)f.push(v.get(w[m]));for(let m=0;m<f.length;m++)v.set(m,f[m]);v.length=w.length},l.reflowSmallerGetNewLineLengths=function(v,w,f){const m=[],y=v.map(((a,s)=>u(v,s,w))).reduce(((a,s)=>a+s));let x=0,g=0,o=0;for(;o<y;){if(y-o<f){m.push(y-o);break}x+=f;const a=u(v,g,w);x>a&&(x-=a,g++);const s=v[g].getWidth(x-1)===2;s&&x--;const n=s?f-1:f;m.push(n),o+=n}return m},l.getWrappedLineTrimmedLength=u},5295:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const v=u(8460),w=u(844),f=u(9092);class m extends w.Disposable{constructor(x,g){super(),this._optionsService=x,this._bufferService=g,this._onBufferActivate=this.register(new v.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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(x,g){this._normal.resize(x,g),this._alt.resize(x,g),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}l.BufferSet=m},511:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const v=u(482),w=u(643),f=u(3734);class m extends f.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new f.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const g=new m;return g.setFromCharData(x),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,v.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(x){this.fg=x[w.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(x[w.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(x[w.CHAR_DATA_CHAR_INDEX].length===2){const o=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const a=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(o-55296)+a-56320+65536|x[w.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=x[w.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[w.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=x[w.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[w.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=m},643:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const v=u(8460),w=u(844);class f{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=f._nextId++,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,w.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}l.Marker=f,f._nextId=1},7116:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(H,l)=>{var u,v,w;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.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=""})(u||(l.C0=u={})),(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="Ÿ"})(v||(l.C1=v={})),(function(f){f.ST=`${u.ESC}\\`})(w||(l.C1_ESCAPED=w={}))},7399:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const v=u(2584),w={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(f,m,y,x){const g={type:0,cancel:!1,key:void 0},o=(f.shiftKey?1:0)|(f.altKey?2:0)|(f.ctrlKey?4:0)|(f.metaKey?8:0);switch(f.keyCode){case 0:f.key==="UIKeyInputUpArrow"?g.key=m?v.C0.ESC+"OA":v.C0.ESC+"[A":f.key==="UIKeyInputLeftArrow"?g.key=m?v.C0.ESC+"OD":v.C0.ESC+"[D":f.key==="UIKeyInputRightArrow"?g.key=m?v.C0.ESC+"OC":v.C0.ESC+"[C":f.key==="UIKeyInputDownArrow"&&(g.key=m?v.C0.ESC+"OB":v.C0.ESC+"[B");break;case 8:g.key=f.ctrlKey?"\b":v.C0.DEL,f.altKey&&(g.key=v.C0.ESC+g.key);break;case 9:if(f.shiftKey){g.key=v.C0.ESC+"[Z";break}g.key=v.C0.HT,g.cancel=!0;break;case 13:g.key=f.altKey?v.C0.ESC+v.C0.CR:v.C0.CR,g.cancel=!0;break;case 27:g.key=v.C0.ESC,f.altKey&&(g.key=v.C0.ESC+v.C0.ESC),g.cancel=!0;break;case 37:if(f.metaKey)break;o?(g.key=v.C0.ESC+"[1;"+(o+1)+"D",g.key===v.C0.ESC+"[1;3D"&&(g.key=v.C0.ESC+(y?"b":"[1;5D"))):g.key=m?v.C0.ESC+"OD":v.C0.ESC+"[D";break;case 39:if(f.metaKey)break;o?(g.key=v.C0.ESC+"[1;"+(o+1)+"C",g.key===v.C0.ESC+"[1;3C"&&(g.key=v.C0.ESC+(y?"f":"[1;5C"))):g.key=m?v.C0.ESC+"OC":v.C0.ESC+"[C";break;case 38:if(f.metaKey)break;o?(g.key=v.C0.ESC+"[1;"+(o+1)+"A",y||g.key!==v.C0.ESC+"[1;3A"||(g.key=v.C0.ESC+"[1;5A")):g.key=m?v.C0.ESC+"OA":v.C0.ESC+"[A";break;case 40:if(f.metaKey)break;o?(g.key=v.C0.ESC+"[1;"+(o+1)+"B",y||g.key!==v.C0.ESC+"[1;3B"||(g.key=v.C0.ESC+"[1;5B")):g.key=m?v.C0.ESC+"OB":v.C0.ESC+"[B";break;case 45:f.shiftKey||f.ctrlKey||(g.key=v.C0.ESC+"[2~");break;case 46:g.key=o?v.C0.ESC+"[3;"+(o+1)+"~":v.C0.ESC+"[3~";break;case 36:g.key=o?v.C0.ESC+"[1;"+(o+1)+"H":m?v.C0.ESC+"OH":v.C0.ESC+"[H";break;case 35:g.key=o?v.C0.ESC+"[1;"+(o+1)+"F":m?v.C0.ESC+"OF":v.C0.ESC+"[F";break;case 33:f.shiftKey?g.type=2:f.ctrlKey?g.key=v.C0.ESC+"[5;"+(o+1)+"~":g.key=v.C0.ESC+"[5~";break;case 34:f.shiftKey?g.type=3:f.ctrlKey?g.key=v.C0.ESC+"[6;"+(o+1)+"~":g.key=v.C0.ESC+"[6~";break;case 112:g.key=o?v.C0.ESC+"[1;"+(o+1)+"P":v.C0.ESC+"OP";break;case 113:g.key=o?v.C0.ESC+"[1;"+(o+1)+"Q":v.C0.ESC+"OQ";break;case 114:g.key=o?v.C0.ESC+"[1;"+(o+1)+"R":v.C0.ESC+"OR";break;case 115:g.key=o?v.C0.ESC+"[1;"+(o+1)+"S":v.C0.ESC+"OS";break;case 116:g.key=o?v.C0.ESC+"[15;"+(o+1)+"~":v.C0.ESC+"[15~";break;case 117:g.key=o?v.C0.ESC+"[17;"+(o+1)+"~":v.C0.ESC+"[17~";break;case 118:g.key=o?v.C0.ESC+"[18;"+(o+1)+"~":v.C0.ESC+"[18~";break;case 119:g.key=o?v.C0.ESC+"[19;"+(o+1)+"~":v.C0.ESC+"[19~";break;case 120:g.key=o?v.C0.ESC+"[20;"+(o+1)+"~":v.C0.ESC+"[20~";break;case 121:g.key=o?v.C0.ESC+"[21;"+(o+1)+"~":v.C0.ESC+"[21~";break;case 122:g.key=o?v.C0.ESC+"[23;"+(o+1)+"~":v.C0.ESC+"[23~";break;case 123:g.key=o?v.C0.ESC+"[24;"+(o+1)+"~":v.C0.ESC+"[24~";break;default:if(!f.ctrlKey||f.shiftKey||f.altKey||f.metaKey)if(y&&!x||!f.altKey||f.metaKey)!y||f.altKey||f.ctrlKey||f.shiftKey||!f.metaKey?f.key&&!f.ctrlKey&&!f.altKey&&!f.metaKey&&f.keyCode>=48&&f.key.length===1?g.key=f.key:f.key&&f.ctrlKey&&(f.key==="_"&&(g.key=v.C0.US),f.key==="@"&&(g.key=v.C0.NUL)):f.keyCode===65&&(g.type=1);else{const a=w[f.keyCode],s=a==null?void 0:a[f.shiftKey?1:0];if(s)g.key=v.C0.ESC+s;else if(f.keyCode>=65&&f.keyCode<=90){const n=f.ctrlKey?f.keyCode-64:f.keyCode+32;let _=String.fromCharCode(n);f.shiftKey&&(_=_.toUpperCase()),g.key=v.C0.ESC+_}else if(f.keyCode===32)g.key=v.C0.ESC+(f.ctrlKey?v.C0.NUL:" ");else if(f.key==="Dead"&&f.code.startsWith("Key")){let n=f.code.slice(3,4);f.shiftKey||(n=n.toLowerCase()),g.key=v.C0.ESC+n,g.cancel=!0}}else f.keyCode>=65&&f.keyCode<=90?g.key=String.fromCharCode(f.keyCode-64):f.keyCode===32?g.key=v.C0.NUL:f.keyCode>=51&&f.keyCode<=55?g.key=String.fromCharCode(f.keyCode-51+27):f.keyCode===56?g.key=v.C0.DEL:f.keyCode===219?g.key=v.C0.ESC:f.keyCode===220?g.key=v.C0.FS:f.keyCode===221&&(g.key=v.C0.GS)}return g}},482:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,v=0,w=u.length){let f="";for(let m=v;m<w;++m){let y=u[m];y>65535?(y-=65536,f+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):f+=String.fromCharCode(y)}return f},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,v){const w=u.length;if(!w)return 0;let f=0,m=0;if(this._interim){const y=u.charCodeAt(m++);56320<=y&&y<=57343?v[f++]=1024*(this._interim-55296)+y-56320+65536:(v[f++]=this._interim,v[f++]=y),this._interim=0}for(let y=m;y<w;++y){const x=u.charCodeAt(y);if(55296<=x&&x<=56319){if(++y>=w)return this._interim=x,f;const g=u.charCodeAt(y);56320<=g&&g<=57343?v[f++]=1024*(x-55296)+g-56320+65536:(v[f++]=x,v[f++]=g)}else x!==65279&&(v[f++]=x)}return f}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,v){const w=u.length;if(!w)return 0;let f,m,y,x,g=0,o=0,a=0;if(this.interim[0]){let _=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let b,L=0;for(;(b=63&this.interim[++L])&&L<4;)k<<=6,k|=b;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,A=S-L;for(;a<A;){if(a>=w)return 0;if(b=u[a++],(192&b)!=128){a--,_=!0;break}this.interim[L++]=b,k<<=6,k|=63&b}_||(S===2?k<128?a--:v[g++]=k:S===3?k<2048||k>=55296&&k<=57343||k===65279||(v[g++]=k):k<65536||k>1114111||(v[g++]=k)),this.interim.fill(0)}const s=w-4;let n=a;for(;n<w;){for(;!(!(n<s)||128&(f=u[n])||128&(m=u[n+1])||128&(y=u[n+2])||128&(x=u[n+3]));)v[g++]=f,v[g++]=m,v[g++]=y,v[g++]=x,n+=4;if(f=u[n++],f<128)v[g++]=f;else if((224&f)==192){if(n>=w)return this.interim[0]=f,g;if(m=u[n++],(192&m)!=128){n--;continue}if(o=(31&f)<<6|63&m,o<128){n--;continue}v[g++]=o}else if((240&f)==224){if(n>=w)return this.interim[0]=f,g;if(m=u[n++],(192&m)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=m,g;if(y=u[n++],(192&y)!=128){n--;continue}if(o=(15&f)<<12|(63&m)<<6|63&y,o<2048||o>=55296&&o<=57343||o===65279)continue;v[g++]=o}else if((248&f)==240){if(n>=w)return this.interim[0]=f,g;if(m=u[n++],(192&m)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=m,g;if(y=u[n++],(192&y)!=128){n--;continue}if(n>=w)return this.interim[0]=f,this.interim[1]=m,this.interim[2]=y,g;if(x=u[n++],(192&x)!=128){n--;continue}if(o=(7&f)<<18|(63&m)<<12|(63&y)<<6|63&x,o<65536||o>1114111)continue;v[g++]=o}}return g}}},225:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const v=u(1480),w=[[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 m;l.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let y=0;y<w.length;++y)m.fill(0,w[y][0],w[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?m[y]:(function(x,g){let o,a=0,s=g.length-1;if(x<g[0][0]||x>g[s][1])return!1;for(;s>=a;)if(o=a+s>>1,x>g[o][1])a=o+1;else{if(!(x<g[o][0]))return!0;s=o-1}return!1})(y,f)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,x){let g=this.wcwidth(y),o=g===0&&x!==0;if(o){const a=v.UnicodeService.extractWidth(x);a===0?o=!1:a>g&&(g=a)}return v.UnicodeService.createPropertyValue(0,g,o)}}},5981:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const v=u(8460),w=u(844);class f extends w.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,x){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(x),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(x)}_innerWrite(y=0,x=!0){const g=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],a=this._action(o,x);if(a){const n=_=>Date.now()-g>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(g,_);return void a.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-g>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=f},5941:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\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})$/,v=/^[\da-f]+$/;function w(f,m){const y=f.toString(16),x=y.length<2?"0"+y:y;switch(m){case 4:return y[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}l.parseColor=function(f){if(!f)return;let m=f.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const y=u.exec(m);if(y){const x=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/x*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/x*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/x*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),v.exec(m)&&[3,6,9,12].includes(m.length))){const y=m.length/3,x=[0,0,0];for(let g=0;g<3;++g){const o=parseInt(m.slice(y*g,y*g+y),16);x[g]=y===1?o<<4:y===2?o:y===3?o>>4:o>>8}return x}},l.toRgbString=function(f,m=16){const[y,x,g]=f;return`rgb:${w(y,m)}/${w(x,m)}/${w(g,m)}`}},5770:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const v=u(482),w=u(8742),f=u(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(x,g){this._handlers[x]===void 0&&(this._handlers[x]=[]);const o=this._handlers[x];return o.push(g),{dispose:()=>{const a=o.indexOf(g);a!==-1&&o.splice(a,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(x,g){if(this.reset(),this._ident=x,this._active=this._handlers[x]||m,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(x,g,o){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(x,g,o);else this._handlerFb(this._ident,"PUT",(0,v.utf32ToString)(x,g,o))}unhook(x,g=!0){if(this._active.length){let o=!1,a=this._active.length-1,s=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,o=g,s=this._stack.fallThrough,this._stack.paused=!1),!s&&o===!1){for(;a>=0&&(o=this._active[a].unhook(x),o!==!0);a--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,o;a--}for(;a>=0;a--)if(o=this._active[a].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",x);this._active=m,this._ident=0}};const y=new w.Params;y.addParam(0),l.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=y,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():y,this._data="",this._hitLimit=!1}put(x,g,o){this._hitLimit||(this._data+=(0,v.utf32ToString)(x,g,o),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let g=!1;if(this._hitLimit)g=!1;else if(x&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then((o=>(this._params=y,this._data="",this._hitLimit=!1,o)));return this._params=y,this._data="",this._hitLimit=!1,g}}},2015:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const v=u(844),w=u(8742),f=u(6242),m=u(6351);class y{constructor(a){this.table=new Uint8Array(a)}setDefault(a,s){this.table.fill(a<<4|s)}add(a,s,n,_){this.table[s<<8|a]=n<<4|_}addMany(a,s,n,_){for(let k=0;k<a.length;k++)this.table[s<<8|a[k]]=n<<4|_}}l.TransitionTable=y;const x=160;l.VT500_TRANSITION_TABLE=(function(){const o=new y(4095),a=Array.apply(null,Array(256)).map(((L,S)=>S)),s=(L,S)=>a.slice(L,S),n=s(32,127),_=s(0,24);_.push(25),_.push.apply(_,s(28,32));const k=s(0,14);let b;for(b in o.setDefault(1,0),o.addMany(n,0,2,0),k)o.addMany([24,26,153,154],b,3,0),o.addMany(s(128,144),b,3,0),o.addMany(s(144,152),b,3,0),o.add(156,b,0,0),o.add(27,b,11,1),o.add(157,b,4,8),o.addMany([152,158,159],b,0,7),o.add(155,b,11,3),o.add(144,b,11,9);return o.addMany(_,0,3,0),o.addMany(_,1,3,1),o.add(127,1,0,1),o.addMany(_,8,0,8),o.addMany(_,3,3,3),o.add(127,3,0,3),o.addMany(_,4,3,4),o.add(127,4,0,4),o.addMany(_,6,3,6),o.addMany(_,5,3,5),o.add(127,5,0,5),o.addMany(_,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(n,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(s(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(n,7,0,7),o.addMany(_,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(s(64,127),3,7,0),o.addMany(s(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(s(48,60),4,8,4),o.addMany(s(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(s(32,64),6,0,6),o.add(127,6,0,6),o.addMany(s(64,127),6,0,0),o.addMany(s(32,48),3,9,5),o.addMany(s(32,48),5,9,5),o.addMany(s(48,64),5,0,6),o.addMany(s(64,127),5,7,0),o.addMany(s(32,48),4,9,5),o.addMany(s(32,48),1,9,2),o.addMany(s(32,48),2,9,2),o.addMany(s(48,127),2,10,0),o.addMany(s(48,80),1,10,0),o.addMany(s(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(s(96,127),1,10,0),o.add(80,1,11,9),o.addMany(_,9,0,9),o.add(127,9,0,9),o.addMany(s(28,32),9,0,9),o.addMany(s(32,48),9,9,12),o.addMany(s(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(_,11,0,11),o.addMany(s(32,128),11,0,11),o.addMany(s(28,32),11,0,11),o.addMany(_,10,0,10),o.add(127,10,0,10),o.addMany(s(28,32),10,0,10),o.addMany(s(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(s(32,48),10,9,12),o.addMany(_,12,0,12),o.add(127,12,0,12),o.addMany(s(28,32),12,0,12),o.addMany(s(32,48),12,9,12),o.addMany(s(48,64),12,0,11),o.addMany(s(64,127),12,12,13),o.addMany(s(64,127),10,12,13),o.addMany(s(64,127),9,12,13),o.addMany(_,13,13,13),o.addMany(n,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(x,0,2,0),o.add(x,8,5,8),o.add(x,6,0,6),o.add(x,11,0,11),o.add(x,13,13,13),o})();class g extends v.Disposable{constructor(a=l.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new w.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,_)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,v.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 m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,s=[64,126]){let n=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=a.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;k<a.intermediates.length;++k){const b=a.intermediates.charCodeAt(k);if(32>b||b>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=b}}if(a.final.length!==1)throw new Error("final must be a single byte");const _=a.final.charCodeAt(0);if(s[0]>_||_>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=_,n}identToString(a){const s=[];for(;a;)s.push(String.fromCharCode(255&a)),a>>=8;return s.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,s){const n=this._identifier(a,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const _=this._escHandlers[n];return _.push(s),{dispose:()=>{const k=_.indexOf(s);k!==-1&&_.splice(k,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,s){this._executeHandlers[a.charCodeAt(0)]=s}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,s){const n=this._identifier(a);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const _=this._csiHandlers[n];return _.push(s),{dispose:()=>{const k=_.indexOf(s);k!==-1&&_.splice(k,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,s){return this._dcsParser.registerHandler(this._identifier(a),s)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,s){return this._oscParser.registerHandler(a,s)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(a,s,n,_,k){this._parseStack.state=a,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=_,this._parseStack.chunkPos=k}parse(a,s,n){let _,k=0,b=0,L=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,L=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let A=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&A>-1){for(;A>=0&&(_=S[A](this._params),_!==!0);A--)if(_ instanceof Promise)return this._parseStack.handlerPos=A,_}this._parseStack.handlers=[];break;case 4:if(n===!1&&A>-1){for(;A>=0&&(_=S[A](),_!==!0);A--)if(_ instanceof Promise)return this._parseStack.handlerPos=A,_}this._parseStack.handlers=[];break;case 6:if(k=a[this._parseStack.chunkPos],_=this._dcsParser.unhook(k!==24&&k!==26,n),_)return _;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=a[this._parseStack.chunkPos],_=this._oscParser.end(k!==24&&k!==26,n),_)return _;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,L=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=L;S<s;++S){switch(k=a[S],b=this._transitions.table[this.currentState<<8|(k<160?k:x)],b>>4){case 2:for(let I=S+1;;++I){if(I>=s||(k=a[I])<32||k>126&&k<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(k=a[I])<32||k>126&&k<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(k=a[I])<32||k>126&&k<x){this._printHandler(a,S,I),S=I-1;break}if(++I>=s||(k=a[I])<32||k>126&&k<x){this._printHandler(a,S,I),S=I-1;break}}break;case 3:this._executeHandlers[k]?this._executeHandlers[k]():this._executeHandlerFb(k),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:k,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const A=this._csiHandlers[this._collect<<8|k];let F=A?A.length-1:-1;for(;F>=0&&(_=A[F](this._params),_!==!0);F--)if(_ instanceof Promise)return this._preserveStack(3,A,F,b,S),_;F<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingJoinState=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++S<s&&(k=a[S])>47&&k<60);S--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const j=this._escHandlers[this._collect<<8|k];let W=j?j.length-1:-1;for(;W>=0&&(_=j[W](),_!==!0);W--)if(_ instanceof Promise)return this._preserveStack(4,j,W,b,S),_;W<0&&this._escHandlerFb(this._collect<<8|k),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|k,this._params);break;case 13:for(let I=S+1;;++I)if(I>=s||(k=a[I])===24||k===26||k===27||k>127&&k<x){this._dcsParser.put(a,S,I),S=I-1;break}break;case 14:if(_=this._dcsParser.unhook(k!==24&&k!==26),_)return this._preserveStack(6,[],0,b,S),_;k===27&&(b|=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 I=S+1;;I++)if(I>=s||(k=a[I])<32||k>127&&k<x){this._oscParser.put(a,S,I),S=I-1;break}break;case 6:if(_=this._oscParser.end(k!==24&&k!==26),_)return this._preserveStack(5,[],0,b,S),_;k===27&&(b|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&b}}}l.EscapeSequenceParser=g},6242:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const v=u(5770),w=u(482),f=[];l.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(m,y){this._handlers[m]===void 0&&(this._handlers[m]=[]);const x=this._handlers[m];return x.push(y),{dispose:()=>{const g=x.indexOf(y);g!==-1&&x.splice(g,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].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 m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,y,x){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(m,y,x);else this._handlerFb(this._id,"PUT",(0,w.utf32ToString)(m,y,x))}start(){this.reset(),this._state=1}put(m,y,x){if(this._state!==3){if(this._state===1)for(;y<x;){const g=m[y++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&x-y>0&&this._put(m,y,x)}}end(m,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,g=this._active.length-1,o=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,x=y,o=this._stack.fallThrough,this._stack.paused=!1),!o&&x===!1){for(;g>=0&&(x=this._active[g].end(m),x!==!0);g--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,x;g--}for(;g>=0;g--)if(x=this._active[g].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",m);this._active=f,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,y,x){this._hitLimit||(this._data+=(0,w.utf32ToString)(m,y,x),this._data.length>v.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let y=!1;if(this._hitLimit)y=!1;else if(m&&(y=this._handler(this._data),y instanceof Promise))return y.then((x=>(this._data="",this._hitLimit=!1,x)));return this._data="",this._hitLimit=!1,y}}},8742:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class v{static fromArray(f){const m=new v;if(!f.length)return m;for(let y=Array.isArray(f[0])?1:0;y<f.length;++y){const x=f[y];if(Array.isArray(x))for(let g=0;g<x.length;++g)m.addSubParam(x[g]);else m.addParam(x)}return m}constructor(f=32,m=32){if(this.maxLength=f,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(f),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(f),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const f=new v(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 m=0;m<this.length;++m){f.push(this.params[m]);const y=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];x-y>0&&f.push(Array.prototype.slice.call(this._subParams,y,x))}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>u?u: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>u?u:f,this._subParamsIdx[this.length-1]++}}hasSubParams(f){return(255&this._subParamsIdx[f])-(this._subParamsIdx[f]>>8)>0}getSubParams(f){const m=this._subParamsIdx[f]>>8,y=255&this._subParamsIdx[f];return y-m>0?this._subParams.subarray(m,y):null}getSubParamsAll(){const f={};for(let m=0;m<this.length;++m){const y=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];x-y>0&&(f[m]=this._subParams.slice(y,x))}return f}addDigit(f){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,x=y[m-1];y[m-1]=~x?Math.min(10*x+f,u):f}}l.Params=v},5741:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,v){const w={instance:v,dispose:v.dispose,isDisposed:!1};this._addons.push(w),v.dispose=()=>this._wrappedAddonDispose(w),v.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let v=-1;for(let w=0;w<this._addons.length;w++)if(this._addons[w]===u){v=w;break}if(v===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(v,1)}}},8771:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const v=u(3785),w=u(511);l.BufferApiView=class{constructor(f,m){this._buffer=f,this.type=m}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 m=this._buffer.lines.get(f);if(m)return new v.BufferLineApiView(m)}getNullCell(){return new w.CellData}}},3785:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const v=u(511);l.BufferLineApiView=class{constructor(w){this._line=w}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(w,f){if(!(w<0||w>=this._line.length))return f?(this._line.loadCell(w,f),f):this._line.loadCell(w,new v.CellData)}translateToString(w,f,m){return this._line.translateToString(w,f,m)}}},8285:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const v=u(8771),w=u(8460),f=u(844);class m extends f.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new w.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new v.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new v.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=m},7975:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,v){return this._core.registerCsiHandler(u,(w=>v(w.toArray())))}addCsiHandler(u,v){return this.registerCsiHandler(u,v)}registerDcsHandler(u,v){return this._core.registerDcsHandler(u,((w,f)=>v(w,f.toArray())))}addDcsHandler(u,v){return this.registerDcsHandler(u,v)}registerEscHandler(u,v){return this._core.registerEscHandler(u,v)}addEscHandler(u,v){return this.registerEscHandler(u,v)}registerOscHandler(u,v){return this._core.registerOscHandler(u,v)}addOscHandler(u,v){return this.registerOscHandler(u,v)}}},7090:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(H,l,u){var v=this&&this.__decorate||function(o,a,s,n){var _,k=arguments.length,b=k<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,a,s,n);else for(var L=o.length-1;L>=0;L--)(_=o[L])&&(b=(k<3?_(b):k>3?_(a,s,b):_(a,s))||b);return k>3&&b&&Object.defineProperty(a,s,b),b},w=this&&this.__param||function(o,a){return function(s,n){a(s,n,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const f=u(8460),m=u(844),y=u(5295),x=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let g=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(o){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(o.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(o,this))}resize(o,a){this.cols=o,this.rows=a,this.buffers.resize(o,a),this._onResize.fire({cols:o,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,a=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===o.fg&&n.getBg(0)===o.bg||(n=s.getBlankLine(o,a),this._cachedBlankLine=n),n.isWrapped=a;const _=s.ybase+s.scrollTop,k=s.ybase+s.scrollBottom;if(s.scrollTop===0){const b=s.lines.isFull;k===s.lines.length-1?b?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(k+1,0,n.clone()),b?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const b=k-_+1;s.lines.shiftElements(_+1,b-1,-1),s.lines.set(k,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(o,a,s){const n=this.buffer;if(o<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else o+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const _=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+o,n.ybase),0),_!==n.ydisp&&(a||this._onScroll.fire(n.ydisp))}};l.BufferService=g=v([w(0,x.IOptionsService)],g)},7994:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,v){this._charsets[u]=v,this.glevel===u&&(this.charset=v)}}},1753:function(H,l,u){var v=this&&this.__decorate||function(n,_,k,b){var L,S=arguments.length,A=S<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,k):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(n,_,k,b);else for(var F=n.length-1;F>=0;F--)(L=n[F])&&(A=(S<3?L(A):S>3?L(_,k,A):L(_,k))||A);return S>3&&A&&Object.defineProperty(_,k,A),A},w=this&&this.__param||function(n,_){return function(k,b){_(k,b,n)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const f=u(2585),m=u(8460),y=u(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function g(n,_){let k=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(k|=64,k|=n.action):(k|=3&n.button,4&n.button&&(k|=64),8&n.button&&(k|=128),n.action===32?k|=32:n.action!==0||_||(k|=3)),k}const o=String.fromCharCode,a={DEFAULT:n=>{const _=[g(n,!1)+32,n.col+32,n.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${o(_[0])}${o(_[1])}${o(_[2])}`},SGR:n=>{const _=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${g(n,!0)};${n.col};${n.row}${_}`},SGR_PIXELS:n=>{const _=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${g(n,!0)};${n.x};${n.y}${_}`}};let s=l.CoreMouseService=class extends y.Disposable{constructor(n,_){super(),this._bufferService=n,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(x))this.addProtocol(k,x[k]);for(const k of Object.keys(a))this.addEncoding(k,a[k]);this.reset()}addProtocol(n,_){this._protocols[n]=_}addEncoding(n,_){this._encodings[n]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const _=this._encodings[this._activeEncoding](n);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,_,k){if(k){if(n.x!==_.x||n.y!==_.y)return!1}else if(n.col!==_.col||n.row!==_.row)return!1;return n.button===_.button&&n.action===_.action&&n.ctrl===_.ctrl&&n.alt===_.alt&&n.shift===_.shift}};l.CoreMouseService=s=v([w(0,f.IBufferService),w(1,f.ICoreService)],s)},6975:function(H,l,u){var v=this&&this.__decorate||function(s,n,_,k){var b,L=arguments.length,S=L<3?n:k===null?k=Object.getOwnPropertyDescriptor(n,_):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,n,_,k);else for(var A=s.length-1;A>=0;A--)(b=s[A])&&(S=(L<3?b(S):L>3?b(n,_,S):b(n,_))||S);return L>3&&S&&Object.defineProperty(n,_,S),S},w=this&&this.__param||function(s,n){return function(_,k){n(_,k,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const f=u(1439),m=u(8460),y=u(844),x=u(2585),g=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=l.CoreService=class extends y.Disposable{constructor(s,n,_){super(),this._bufferService=s,this._logService=n,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,f.clone)(g),this.decPrivateModes=(0,f.clone)(o)}reset(){this.modes=(0,f.clone)(g),this.decPrivateModes=(0,f.clone)(o)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,(()=>s.split("").map((k=>k.charCodeAt(0))))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,(()=>s.split("").map((n=>n.charCodeAt(0))))),this._onBinary.fire(s))}};l.CoreService=a=v([w(0,x.IBufferService),w(1,x.ILogService),w(2,x.IOptionsService)],a)},9074:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const v=u(8055),w=u(8460),f=u(844),m=u(6106);let y=0,x=0;class g extends f.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((s=>s==null?void 0:s.marker.line)),this._onDecorationRegistered=this.register(new w.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new w.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,f.toDisposable)((()=>this.reset())))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new o(s);if(n){const _=n.marker.onDispose((()=>n.dispose()));n.onDispose((()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),_.dispose())})),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,_){let k=0,b=0;for(const L of this._decorations.getKeyIterator(n))k=L.options.x??0,b=k+(L.options.width??1),s>=k&&s<b&&(!_||(L.options.layer??"bottom")===_)&&(yield L)}forEachDecorationAtCell(s,n,_,k){this._decorations.forEachByKey(n,(b=>{y=b.options.x??0,x=y+(b.options.width??1),s>=y&&s<x&&(!_||(b.options.layer??"bottom")===_)&&k(b)}))}}l.DecorationService=g;class o extends f.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=v.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=v.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new w.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new w.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const v=u(2585),w=u(8343);class f{constructor(...y){this._entries=new Map;for(const[x,g]of y)this.set(x,g)}set(y,x){const g=this._entries.get(y);return this._entries.set(y,x),g}forEach(y){for(const[x,g]of this._entries.entries())y(x,g)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}l.ServiceCollection=f,l.InstantiationService=class{constructor(){this._services=new f,this._services.set(v.IInstantiationService,this)}setService(m,y){this._services.set(m,y)}getService(m){return this._services.get(m)}createInstance(m,...y){const x=(0,w.getServiceDependencies)(m).sort(((a,s)=>a.index-s.index)),g=[];for(const a of x){const s=this._services.get(a.id);if(!s)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${a.id}.`);g.push(s)}const o=x.length>0?x[0].index:y.length;if(y.length!==o)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${o+1} conflicts with ${y.length} static arguments`);return new m(...y,...g)}}},7866:function(H,l,u){var v=this&&this.__decorate||function(o,a,s,n){var _,k=arguments.length,b=k<3?a:n===null?n=Object.getOwnPropertyDescriptor(a,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,a,s,n);else for(var L=o.length-1;L>=0;L--)(_=o[L])&&(b=(k<3?_(b):k>3?_(a,s,b):_(a,s))||b);return k>3&&b&&Object.defineProperty(a,s,b),b},w=this&&this.__param||function(o,a){return function(s,n){a(s,n,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const f=u(844),m=u(2585),y={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let x,g=l.LogService=class extends f.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),x=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let a=0;a<o.length;a++)typeof o[a]=="function"&&(o[a]=o[a]())}_log(o,a,s){this._evalLazyOptionalParams(s),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...s)}trace(o,...a){var s;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,o,a)}debug(o,...a){var s;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,o,a)}info(o,...a){var s;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,o,a)}warn(o,...a){var s;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,o,a)}error(o,...a){var s;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,o,a)}};l.LogService=g=v([w(0,m.IOptionsService)],g),l.setTraceLogger=function(o){x=o},l.traceCall=function(o,a,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(..._){if(x.logLevel!==m.LogLevelEnum.TRACE)return n.apply(this,_);x.trace(`GlyphRenderer#${n.name}(${_.map((b=>JSON.stringify(b))).join(", ")})`);const k=n.apply(this,_);return x.trace(`GlyphRenderer#${n.name} return`,k),k}}},7302:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const v=u(8460),w=u(844),f=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:f.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends w.Disposable{constructor(g){super(),this._onOptionChange=this.register(new v.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...l.DEFAULT_OPTIONS};for(const a in g)if(a in o)try{const s=g[a];o[a]=this._sanitizeAndValidateOption(a,s)}catch(s){console.error(s)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,w.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(g,o){return this.onOptionChange((a=>{a===g&&o(this.rawOptions[g])}))}onMultipleOptionChange(g,o){return this.onOptionChange((a=>{g.indexOf(a)!==-1&&o()}))}_setupOptions(){const g=a=>{if(!(a in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},o=(a,s)=>{if(!(a in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);s=this._sanitizeAndValidateOption(a,s),this.rawOptions[a]!==s&&(this.rawOptions[a]=s,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const s={get:g.bind(this,a),set:o.bind(this,a)};Object.defineProperty(this.options,a,s)}}_sanitizeAndValidateOption(g,o){switch(g){case"cursorStyle":if(o||(o=l.DEFAULT_OPTIONS[g]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${g}`);break;case"wordSeparator":o||(o=l.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=m.includes(o)?o:l.DEFAULT_OPTIONS[g];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${g} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${g} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}l.OptionsService=y},2660:function(H,l,u){var v=this&&this.__decorate||function(y,x,g,o){var a,s=arguments.length,n=s<3?x:o===null?o=Object.getOwnPropertyDescriptor(x,g):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(y,x,g,o);else for(var _=y.length-1;_>=0;_--)(a=y[_])&&(n=(s<3?a(n):s>3?a(x,g,n):a(x,g))||n);return s>3&&n&&Object.defineProperty(x,g,n),n},w=this&&this.__param||function(y,x){return function(g,o){x(g,o,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const f=u(2585);let m=l.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const x=this._bufferService.buffer;if(y.id===void 0){const _=x.addMarker(x.ybase+x.y),k={data:y,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(k,_))),this._dataByLinkId.set(k.id,k),k.id}const g=y,o=this._getEntryIdKey(g),a=this._entriesWithId.get(o);if(a)return this.addLineToLink(a.id,x.ybase+x.y),a.id;const s=x.addMarker(x.ybase+x.y),n={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[s]};return s.onDispose((()=>this._removeMarkerFromLink(n,s))),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(y,x){const g=this._dataByLinkId.get(y);if(g&&g.lines.every((o=>o.line!==x))){const o=this._bufferService.buffer.addMarker(x);g.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(g,o)))}}getLinkData(y){var x;return(x=this._dataByLinkId.get(y))==null?void 0:x.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,x){const g=y.lines.indexOf(x);g!==-1&&(y.lines.splice(g,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};l.OscLinkService=m=v([w(0,f.IBufferService)],m)},8343:(H,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",v="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(w){return w[v]||[]},l.createDecorator=function(w){if(l.serviceRegistry.has(w))return l.serviceRegistry.get(w);const f=function(m,y,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,o,a){o[u]===o?o[v].push({id:g,index:a}):(o[v]=[{id:g,index:a}],o[u]=o)})(f,m,x)};return f.toString=()=>w,l.serviceRegistry.set(w,f),f}},2585:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const v=u(8343);var w;l.IBufferService=(0,v.createDecorator)("BufferService"),l.ICoreMouseService=(0,v.createDecorator)("CoreMouseService"),l.ICoreService=(0,v.createDecorator)("CoreService"),l.ICharsetService=(0,v.createDecorator)("CharsetService"),l.IInstantiationService=(0,v.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"})(w||(l.LogLevelEnum=w={})),l.ILogService=(0,v.createDecorator)("LogService"),l.IOptionsService=(0,v.createDecorator)("OptionsService"),l.IOscLinkService=(0,v.createDecorator)("OscLinkService"),l.IUnicodeService=(0,v.createDecorator)("UnicodeService"),l.IDecorationService=(0,v.createDecorator)("DecorationService")},1480:(H,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const v=u(8460),w=u(225);class f{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,x,g=!1){return(16777215&y)<<3|(3&x)<<1|(g?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new v.EventEmitter,this.onChange=this._onChange.event;const y=new w.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let x=0,g=0;const o=y.length;for(let a=0;a<o;++a){let s=y.charCodeAt(a);if(55296<=s&&s<=56319){if(++a>=o)return x+this.wcwidth(s);const k=y.charCodeAt(a);56320<=k&&k<=57343?s=1024*(s-55296)+k-56320+65536:x+=this.wcwidth(k)}const n=this.charProperties(s,g);let _=f.extractWidth(n);f.extractShouldJoin(n)&&(_-=f.extractWidth(g)),x+=_,g=n}return x}charProperties(y,x){return this._activeProvider.charProperties(y,x)}}l.UnicodeService=f}},E={};function M(H){var l=E[H];if(l!==void 0)return l.exports;var u=E[H]={exports:{}};return h[H].call(u.exports,u,u.exports,M),u.exports}var V={};return(()=>{var H=V;Object.defineProperty(H,"__esModule",{value:!0}),H.Terminal=void 0;const l=M(9042),u=M(3236),v=M(844),w=M(5741),f=M(8285),m=M(7975),y=M(7090),x=["cols","rows"];class g extends v.Disposable{constructor(a){super(),this._core=this.register(new u.Terminal(a)),this._addonManager=this.register(new w.AddonManager),this._publicOptions={...this._core.options};const s=_=>this._core.options[_],n=(_,k)=>{this._checkReadonlyOptions(_),this._core.options[_]=k};for(const _ in this._core.options){const k={get:s.bind(this,_),set:n.bind(this,_)};Object.defineProperty(this._publicOptions,_,k)}}_checkReadonlyOptions(a){if(x.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 a=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const s in a)this._publicOptions[s]=a[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,s=!0){this._core.input(a,s)}resize(a,s){this._verifyIntegers(a,s),this._core.resize(a,s)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,s,n){this._verifyIntegers(a,s,n),this._core.select(a,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,s){this._verifyIntegers(a,s),this._core.selectLines(a,s)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,s){this._core.write(a,s)}writeln(a,s){this._core.write(a),this._core.write(`\r
48
- `,s)}paste(a){this._core.paste(a)}refresh(a,s){this._verifyIntegers(a,s),this._core.refresh(a,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return l}_verifyIntegers(...a){for(const s of a)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const s of a)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}H.Terminal=g})(),V})()))})(_l)),_l.exports}var Ep=wp(),vl={exports:{}},Oh;function kp(){return Oh||(Oh=1,(function(C,d){(function(h,E){C.exports=E()})(self,(()=>(()=>{var h={};return(()=>{var E=h;Object.defineProperty(E,"__esModule",{value:!0}),E.FitAddon=void 0,E.FitAddon=class{activate(M){this._terminal=M}dispose(){}fit(){const M=this.proposeDimensions();if(!M||!this._terminal||isNaN(M.cols)||isNaN(M.rows))return;const V=this._terminal._core;this._terminal.rows===M.rows&&this._terminal.cols===M.cols||(V._renderService.clear(),this._terminal.resize(M.cols,M.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const M=this._terminal._core,V=M._renderService.dimensions;if(V.css.cell.width===0||V.css.cell.height===0)return;const H=this._terminal.options.scrollback===0?0:M.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),v=Math.max(0,parseInt(l.getPropertyValue("width"))),w=window.getComputedStyle(this._terminal.element),f=u-(parseInt(w.getPropertyValue("padding-top"))+parseInt(w.getPropertyValue("padding-bottom"))),m=v-(parseInt(w.getPropertyValue("padding-right"))+parseInt(w.getPropertyValue("padding-left")))-H;return{cols:Math.max(2,Math.floor(m/V.css.cell.width)),rows:Math.max(1,Math.floor(f/V.css.cell.height))}}}})(),h})()))})(vl)),vl.exports}var bp=kp();function xp({sessionId:C,worktreePath:d,agentType:h,isActive:E}){const M=$e.useRef(null),V=$e.useRef(null),H=$e.useRef(null),l=$e.useRef(!1),{emit:u,on:v,off:w,connected:f}=mn(),m=Ve(y=>y.updateTerminalStatus);return $e.useEffect(()=>{if(!M.current||l.current)return;const y=new Ep.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"'JetBrains Mono', Menlo, Monaco, 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#c9d1d9",cursor:"#58a6ff",cursorAccent:"#0d1117",black:"#0d1117",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#a371f7",cyan:"#39c5cf",white:"#c9d1d9",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#bc8cff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},allowProposedApi:!0}),x=new bp.FitAddon;return y.loadAddon(x),y.open(M.current),V.current=y,H.current=x,l.current=!0,setTimeout(()=>{x.fit()},0),()=>{y.dispose(),l.current=!1}},[]),$e.useEffect(()=>{if(!V.current||!f)return;const y=V.current,x=H.current,g=_=>{const k=_;k.sessionId===C&&y.write(k.data)},o=_=>{const{sessionId:k}=_;k===C&&m(C,"running")},a=_=>{const{sessionId:k}=_;k===C&&(m(C,"stopped"),y.write(`\r
49
- [Process exited]\r
50
- `))},s=_=>{const{sessionId:k,error:b}=_;k===C&&(m(C,"error"),y.write(`\r
51
- [Error: ${b}]\r
52
- `))};v("terminal:output",g),v("terminal:created",o),v("terminal:exit",a),v("terminal:error",s);const n=y.onData(_=>{u("terminal:input",{sessionId:C,data:_})});return u("terminal:create",{sessionId:C,worktreePath:d,agentType:h}),x&&u("terminal:resize",{sessionId:C,cols:y.cols,rows:y.rows}),()=>{w("terminal:output",g),w("terminal:created",o),w("terminal:exit",a),w("terminal:error",s),n.dispose()}},[C,d,h,f,u,v,w,m]),$e.useEffect(()=>{if(!M.current||!H.current)return;const y=H.current,x=V.current,g=()=>{E&&x&&y&&(y.fit(),u("terminal:resize",{sessionId:C,cols:x.cols,rows:x.rows}))},o=new ResizeObserver(()=>{g()});return o.observe(M.current),E&&setTimeout(g,0),()=>{o.disconnect()}},[C,E,u]),$e.useEffect(()=>{E&&V.current&&V.current.focus()},[E]),q.jsx("div",{ref:M,className:"terminal",style:{height:"100%",width:"100%"}})}function Lp(){const{terminals:C,activeTerminalIndex:d,activeSessionId:h,setActiveSession:E,removeTerminal:M,clearAllTerminals:V,openModal:H}=Ve(),{emit:l}=mn(),u=async(m,y)=>{y.stopPropagation(),l("terminal:kill",{sessionId:m});const x=C.find(g=>g.sessionId===m);if(x)try{await fetch(`/api/worktrees/${x.worktreeName}`,{method:"DELETE"})}catch(g){console.error("Failed to delete worktree:",g)}M(m)},v=()=>{const m=C.map(y=>y.sessionId);H("confirmDelete",{sessionIds:m})},w=h?C.findIndex(m=>m.sessionId===h):d,f=w>=0?w:0;return C.length===0?q.jsx("div",{className:"terminal-panel empty",children:q.jsxs("div",{className:"empty-message",children:[q.jsx("p",{children:"No active sessions"}),q.jsx("p",{children:'Use the Setup wizard or click "+ Add Session" in the sidebar'})]})}):q.jsxs("div",{className:"terminal-panel",children:[q.jsxs("div",{className:"terminal-tabs",children:[C.map((m,y)=>q.jsxs("button",{className:`terminal-tab ${m.sessionId===h||y===f?"active":""}`,onClick:()=>E(m.sessionId),children:[q.jsx("span",{className:`status ${m.status}`}),q.jsx("span",{children:m.worktreeName}),q.jsx("button",{className:"close-btn",onClick:x=>u(m.sessionId,x),title:"Close terminal",children:"×"})]},m.sessionId)),q.jsx("div",{className:"terminal-actions",children:q.jsx("button",{className:"danger",onClick:v,children:"Close All"})})]}),q.jsx("div",{className:"terminal-container",children:C.map((m,y)=>q.jsx("div",{className:`terminal-wrapper ${y!==f?"hidden":""}`,children:q.jsx(xp,{sessionId:m.sessionId,worktreePath:m.worktreePath,agentType:m.agentType,isActive:y===f})},m.sessionId))})]})}function Rp(){const{branches:C,closeModal:d,createSingleWorktree:h,isLoading:E}=Ve(),[M,V]=$e.useState(""),[H,l]=$e.useState("claude"),u=async()=>{M&&await h(M,H)};return q.jsx("div",{className:"modal-overlay",onClick:d,children:q.jsxs("div",{className:"modal-content",onClick:v=>v.stopPropagation(),children:[q.jsxs("div",{className:"modal-header",children:[q.jsx("h2",{children:"Add New Session"}),q.jsx("button",{className:"modal-close",onClick:d,type:"button",children:"×"})]}),q.jsxs("div",{className:"modal-body",children:[q.jsxs("div",{className:"form-group",children:[q.jsx("label",{htmlFor:"branch-select",children:"Branch"}),q.jsxs("select",{id:"branch-select",value:M,onChange:v=>V(v.target.value),disabled:E,children:[q.jsx("option",{value:"",children:"Select a branch..."}),C.map(v=>q.jsxs("option",{value:v.name,children:[v.name,v.isCurrent?" (current)":"",v.isRemote?" (remote)":""]},v.name))]})]}),q.jsxs("div",{className:"form-group",children:[q.jsx("label",{children:"Agent"}),q.jsx("div",{className:"agent-options",children:pn.map(v=>q.jsx("button",{type:"button",className:`agent-option ${H===v.id?"selected":""}`,onClick:()=>l(v.id),disabled:E,children:q.jsx("span",{className:"agent-name",children:v.name})},v.id))})]})]}),q.jsxs("div",{className:"modal-footer",children:[q.jsx("button",{type:"button",className:"btn-secondary",onClick:d,disabled:E,children:"Cancel"}),q.jsx("button",{type:"button",className:"btn-primary",onClick:u,disabled:!M||E,children:E?"Creating...":"Create Session"})]})]})})}function Dp(){const{modalData:C,terminals:d,closeModal:h,removeTerminal:E,clearAllTerminals:M,clearSessionSelection:V}=Ve(),{emit:H}=mn(),[l,u]=$e.useState(!1),v=(C==null?void 0:C.sessionIds)||[],w=d.filter(y=>v.includes(y.sessionId)),f=v.length===d.length,m=async()=>{u(!0);try{for(const y of v)H("terminal:kill",{sessionId:y});if(f)await fetch("/api/worktrees",{method:"DELETE"}),M();else{const y=w.map(x=>x.worktreeName);await fetch("/api/worktrees/batch",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({names:y})});for(const x of v)E(x)}V(),h()}catch(y){console.error("Failed to delete sessions:",y)}finally{u(!1)}};return q.jsx("div",{className:"modal-overlay",onClick:h,children:q.jsxs("div",{className:"modal-content modal-confirm",onClick:y=>y.stopPropagation(),children:[q.jsxs("div",{className:"modal-header",children:[q.jsx("h2",{children:"Confirm Delete"}),q.jsx("button",{className:"modal-close",onClick:h,type:"button",children:"×"})]}),q.jsxs("div",{className:"modal-body",children:[q.jsx("p",{className:"confirm-message",children:f?"Are you sure you want to delete ALL sessions?":`Are you sure you want to delete ${v.length} session${v.length>1?"s":""}?`}),w.length>0&&q.jsx("ul",{className:"delete-list",children:w.map(y=>q.jsxs("li",{children:[q.jsx("span",{className:`status ${y.status}`}),y.worktreeName]},y.sessionId))}),q.jsx("p",{className:"warning-text",children:"This action will terminate running agents and delete the worktrees. This cannot be undone."})]}),q.jsxs("div",{className:"modal-footer",children:[q.jsx("button",{type:"button",className:"btn-secondary",onClick:h,disabled:l,children:"Cancel"}),q.jsx("button",{type:"button",className:"btn-danger",onClick:m,disabled:l,children:l?"Deleting...":"Delete"})]})]})})}function Tp(){const C=Ve(d=>d.modalType);if(!C)return null;switch(C){case"addWorktree":return q.jsx(Rp,{});case"confirmDelete":return q.jsx(Dp,{});default:return null}}function Ap(){const{step:C,isLoading:d,loadingMessage:h,error:E}=Ve(),{connected:M}=mn();$e.useEffect(()=>{Ve.getState().fetchProjectInfo(),Ve.getState().fetchBranches()},[]);const V=()=>{switch(C){case"branch":return q.jsx(Ah,{});case"agent":return q.jsx(Sp,{});case"worktree":return q.jsx(Cp,{});case"running":return q.jsx(Lp,{});default:return q.jsx(Ah,{})}};return q.jsxs("div",{className:"app",children:[q.jsx(op,{}),q.jsx(vp,{children:V()}),d&&q.jsxs("div",{className:"loading-overlay",children:[q.jsx("div",{className:"loading-spinner"}),q.jsx("p",{children:h||"Loading..."})]}),E&&q.jsx("div",{className:"error-banner",children:E}),q.jsxs("div",{className:"connection-status",children:[q.jsx("span",{className:`dot ${M?"connected":"disconnected"}`}),M?"Connected":"Disconnected"]}),q.jsx(Tp,{})]})}ef.createRoot(document.getElementById("root")).render(q.jsx(Gi.StrictMode,{children:q.jsx(Ap,{})}));
53
- //# sourceMappingURL=index-De6xm4hO.js.map