agent-workbench 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +424 -413
- package/dist/server.js +758 -503
- package/dist/web/assets/de-PtmfVEFc.js +1 -0
- package/dist/web/assets/es-BWOH-zRt.js +1 -0
- package/dist/web/assets/fr-tY7LZ7vh.js +1 -0
- package/dist/web/assets/{highlight-D9nIZ0qi.js → highlight-BdawNAzW.js} +1 -1
- package/dist/web/assets/index-CmLNpznn.css +32 -0
- package/dist/web/assets/index-Crbjtl9a.js +135 -0
- package/dist/web/assets/ja-CebmU1Hk.js +1 -0
- package/dist/web/assets/ko-BuKbKnfu.js +1 -0
- package/dist/web/assets/pt-BR-CxtiCd-u.js +1 -0
- package/dist/web/assets/ru-C3EXpruH.js +1 -0
- package/dist/web/assets/zh-CN-DugN9tNb.js +1 -0
- package/dist/web/favicon.svg +32 -32
- package/dist/web/index.html +19 -19
- package/package.json +2 -2
- package/dist/web/assets/index-Bgx4KtjD.css +0 -32
- package/dist/web/assets/index-DIDbH8tn.js +0 -130
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var qm=Object.defineProperty;var Vm=(r,n,c)=>n in r?qm(r,n,{enumerable:!0,configurable:!0,writable:!0,value:c}):r[n]=c;var nn=(r,n,c)=>Vm(r,typeof n!="symbol"?n+"":n,c);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const E of document.querySelectorAll('link[rel="modulepreload"]'))y(E);new MutationObserver(E=>{for(const N of E)if(N.type==="childList")for(const D of N.addedNodes)D.tagName==="LINK"&&D.rel==="modulepreload"&&y(D)}).observe(document,{childList:!0,subtree:!0});function c(E){const N={};return E.integrity&&(N.integrity=E.integrity),E.referrerPolicy&&(N.referrerPolicy=E.referrerPolicy),E.crossOrigin==="use-credentials"?N.credentials="include":E.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function y(E){if(E.ep)return;E.ep=!0;const N=c(E);fetch(E.href,N)}})();function Km(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Cl={exports:{}},ni={},bl={exports:{}},Xe={};/**
|
|
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 Wh;function Gm(){if(Wh)return Xe;Wh=1;var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),N=Symbol.for("react.provider"),D=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),l=Symbol.iterator;function v(F){return F===null||typeof F!="object"?null:(F=l&&F[l]||F["@@iterator"],typeof F=="function"?F:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,f={};function o(F,q,ne){this.props=F,this.context=q,this.refs=f,this.updater=ne||S}o.prototype.isReactComponent={},o.prototype.setState=function(F,q){if(typeof F!="object"&&typeof F!="function"&&F!=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,F,q,"setState")},o.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function u(){}u.prototype=o.prototype;function h(F,q,ne){this.props=F,this.context=q,this.refs=f,this.updater=ne||S}var d=h.prototype=new u;d.constructor=h,C(d,o.prototype),d.isPureReactComponent=!0;var w=Array.isArray,R=Object.prototype.hasOwnProperty,k={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function b(F,q,ne){var re,ie={},Q=null,V=null;if(q!=null)for(re in q.ref!==void 0&&(V=q.ref),q.key!==void 0&&(Q=""+q.key),q)R.call(q,re)&&!A.hasOwnProperty(re)&&(ie[re]=q[re]);var H=arguments.length-2;if(H===1)ie.children=ne;else if(1<H){for(var G=Array(H),ee=0;ee<H;ee++)G[ee]=arguments[ee+2];ie.children=G}if(F&&F.defaultProps)for(re in H=F.defaultProps,H)ie[re]===void 0&&(ie[re]=H[re]);return{$$typeof:r,type:F,key:Q,ref:V,props:ie,_owner:k.current}}function T(F,q){return{$$typeof:r,type:F.type,key:q,ref:F.ref,props:F.props,_owner:F._owner}}function I(F){return typeof F=="object"&&F!==null&&F.$$typeof===r}function W(F){var q={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(ne){return q[ne]})}var O=/\/+/g;function j(F,q){return typeof F=="object"&&F!==null&&F.key!=null?W(""+F.key):q.toString(36)}function z(F,q,ne,re,ie){var Q=typeof F;(Q==="undefined"||Q==="boolean")&&(F=null);var V=!1;if(F===null)V=!0;else switch(Q){case"string":case"number":V=!0;break;case"object":switch(F.$$typeof){case r:case n:V=!0}}if(V)return V=F,ie=ie(V),F=re===""?"."+j(V,0):re,w(ie)?(ne="",F!=null&&(ne=F.replace(O,"$&/")+"/"),z(ie,q,ne,"",function(ee){return ee})):ie!=null&&(I(ie)&&(ie=T(ie,ne+(!ie.key||V&&V.key===ie.key?"":(""+ie.key).replace(O,"$&/")+"/")+F)),q.push(ie)),1;if(V=0,re=re===""?".":re+":",w(F))for(var H=0;H<F.length;H++){Q=F[H];var G=re+j(Q,H);V+=z(Q,q,ne,G,ie)}else if(G=v(F),typeof G=="function")for(F=G.call(F),H=0;!(Q=F.next()).done;)Q=Q.value,G=re+j(Q,H++),V+=z(Q,q,ne,G,ie);else if(Q==="object")throw q=String(F),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.");return V}function Y(F,q,ne){if(F==null)return F;var re=[],ie=0;return z(F,re,"","",function(Q){return q.call(ne,Q,ie++)}),re}function Z(F){if(F._status===-1){var q=F._result;q=q(),q.then(function(ne){(F._status===0||F._status===-1)&&(F._status=1,F._result=ne)},function(ne){(F._status===0||F._status===-1)&&(F._status=2,F._result=ne)}),F._status===-1&&(F._status=0,F._result=q)}if(F._status===1)return F._result.default;throw F._result}var J={current:null},K={transition:null},P={ReactCurrentDispatcher:J,ReactCurrentBatchConfig:K,ReactCurrentOwner:k};function $(){throw Error("act(...) is not supported in production builds of React.")}return Xe.Children={map:Y,forEach:function(F,q,ne){Y(F,function(){q.apply(this,arguments)},ne)},count:function(F){var q=0;return Y(F,function(){q++}),q},toArray:function(F){return Y(F,function(q){return q})||[]},only:function(F){if(!I(F))throw Error("React.Children.only expected to receive a single React element child.");return F}},Xe.Component=o,Xe.Fragment=c,Xe.Profiler=E,Xe.PureComponent=h,Xe.StrictMode=y,Xe.Suspense=a,Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,Xe.act=$,Xe.cloneElement=function(F,q,ne){if(F==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+F+".");var re=C({},F.props),ie=F.key,Q=F.ref,V=F._owner;if(q!=null){if(q.ref!==void 0&&(Q=q.ref,V=k.current),q.key!==void 0&&(ie=""+q.key),F.type&&F.type.defaultProps)var H=F.type.defaultProps;for(G in q)R.call(q,G)&&!A.hasOwnProperty(G)&&(re[G]=q[G]===void 0&&H!==void 0?H[G]:q[G])}var G=arguments.length-2;if(G===1)re.children=ne;else if(1<G){H=Array(G);for(var ee=0;ee<G;ee++)H[ee]=arguments[ee+2];re.children=H}return{$$typeof:r,type:F.type,key:ie,ref:Q,props:re,_owner:V}},Xe.createContext=function(F){return F={$$typeof:D,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},F.Provider={$$typeof:N,_context:F},F.Consumer=F},Xe.createElement=b,Xe.createFactory=function(F){var q=b.bind(null,F);return q.type=F,q},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(F){return{$$typeof:i,render:F}},Xe.isValidElement=I,Xe.lazy=function(F){return{$$typeof:_,_payload:{_status:-1,_result:F},_init:Z}},Xe.memo=function(F,q){return{$$typeof:g,type:F,compare:q===void 0?null:q}},Xe.startTransition=function(F){var q=K.transition;K.transition={};try{F()}finally{K.transition=q}},Xe.unstable_act=$,Xe.useCallback=function(F,q){return J.current.useCallback(F,q)},Xe.useContext=function(F){return J.current.useContext(F)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(F){return J.current.useDeferredValue(F)},Xe.useEffect=function(F,q){return J.current.useEffect(F,q)},Xe.useId=function(){return J.current.useId()},Xe.useImperativeHandle=function(F,q,ne){return J.current.useImperativeHandle(F,q,ne)},Xe.useInsertionEffect=function(F,q){return J.current.useInsertionEffect(F,q)},Xe.useLayoutEffect=function(F,q){return J.current.useLayoutEffect(F,q)},Xe.useMemo=function(F,q){return J.current.useMemo(F,q)},Xe.useReducer=function(F,q,ne){return J.current.useReducer(F,q,ne)},Xe.useRef=function(F){return J.current.useRef(F)},Xe.useState=function(F){return J.current.useState(F)},Xe.useSyncExternalStore=function(F,q,ne){return J.current.useSyncExternalStore(F,q,ne)},Xe.useTransition=function(){return J.current.useTransition()},Xe.version="18.3.1",Xe}var Uh;function mc(){return Uh||(Uh=1,bl.exports=Gm()),bl.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 zh;function Xm(){if(zh)return ni;zh=1;var r=mc(),n=Symbol.for("react.element"),c=Symbol.for("react.fragment"),y=Object.prototype.hasOwnProperty,E=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,N={key:!0,ref:!0,__self:!0,__source:!0};function D(i,a,g){var _,l={},v=null,S=null;g!==void 0&&(v=""+g),a.key!==void 0&&(v=""+a.key),a.ref!==void 0&&(S=a.ref);for(_ in a)y.call(a,_)&&!N.hasOwnProperty(_)&&(l[_]=a[_]);if(i&&i.defaultProps)for(_ in a=i.defaultProps,a)l[_]===void 0&&(l[_]=a[_]);return{$$typeof:n,type:i,key:v,ref:S,props:l,_owner:E.current}}return ni.Fragment=c,ni.jsx=D,ni.jsxs=D,ni}var qh;function Ym(){return qh||(qh=1,Cl.exports=Xm()),Cl.exports}var m=Ym(),Eo={},xl={exports:{}},Gt={},kl={exports:{}},El={};/**
|
|
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 Vh;function Qm(){return Vh||(Vh=1,(function(r){function n(K,P){var $=K.length;K.push(P);e:for(;0<$;){var F=$-1>>>1,q=K[F];if(0<E(q,P))K[F]=P,K[$]=q,$=F;else break e}}function c(K){return K.length===0?null:K[0]}function y(K){if(K.length===0)return null;var P=K[0],$=K.pop();if($!==P){K[0]=$;e:for(var F=0,q=K.length,ne=q>>>1;F<ne;){var re=2*(F+1)-1,ie=K[re],Q=re+1,V=K[Q];if(0>E(ie,$))Q<q&&0>E(V,ie)?(K[F]=V,K[Q]=$,F=Q):(K[F]=ie,K[re]=$,F=re);else if(Q<q&&0>E(V,$))K[F]=V,K[Q]=$,F=Q;else break e}}return P}function E(K,P){var $=K.sortIndex-P.sortIndex;return $!==0?$:K.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var N=performance;r.unstable_now=function(){return N.now()}}else{var D=Date,i=D.now();r.unstable_now=function(){return D.now()-i}}var a=[],g=[],_=1,l=null,v=3,S=!1,C=!1,f=!1,o=typeof setTimeout=="function"?setTimeout:null,u=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function d(K){for(var P=c(g);P!==null;){if(P.callback===null)y(g);else if(P.startTime<=K)y(g),P.sortIndex=P.expirationTime,n(a,P);else break;P=c(g)}}function w(K){if(f=!1,d(K),!C)if(c(a)!==null)C=!0,Z(R);else{var P=c(g);P!==null&&J(w,P.startTime-K)}}function R(K,P){C=!1,f&&(f=!1,u(b),b=-1),S=!0;var $=v;try{for(d(P),l=c(a);l!==null&&(!(l.expirationTime>P)||K&&!W());){var F=l.callback;if(typeof F=="function"){l.callback=null,v=l.priorityLevel;var q=F(l.expirationTime<=P);P=r.unstable_now(),typeof q=="function"?l.callback=q:l===c(a)&&y(a),d(P)}else y(a);l=c(a)}if(l!==null)var ne=!0;else{var re=c(g);re!==null&&J(w,re.startTime-P),ne=!1}return ne}finally{l=null,v=$,S=!1}}var k=!1,A=null,b=-1,T=5,I=-1;function W(){return!(r.unstable_now()-I<T)}function O(){if(A!==null){var K=r.unstable_now();I=K;var P=!0;try{P=A(!0,K)}finally{P?j():(k=!1,A=null)}}else k=!1}var j;if(typeof h=="function")j=function(){h(O)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,Y=z.port2;z.port1.onmessage=O,j=function(){Y.postMessage(null)}}else j=function(){o(O,0)};function Z(K){A=K,k||(k=!0,j())}function J(K,P){b=o(function(){K(r.unstable_now())},P)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(K){K.callback=null},r.unstable_continueExecution=function(){C||S||(C=!0,Z(R))},r.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<K?Math.floor(1e3/K):5},r.unstable_getCurrentPriorityLevel=function(){return v},r.unstable_getFirstCallbackNode=function(){return c(a)},r.unstable_next=function(K){switch(v){case 1:case 2:case 3:var P=3;break;default:P=v}var $=v;v=P;try{return K()}finally{v=$}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function(K,P){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var $=v;v=K;try{return P()}finally{v=$}},r.unstable_scheduleCallback=function(K,P,$){var F=r.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?F+$:F):$=F,K){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=$+q,K={id:_++,callback:P,priorityLevel:K,startTime:$,expirationTime:q,sortIndex:-1},$>F?(K.sortIndex=$,n(g,K),c(a)===null&&K===c(g)&&(f?(u(b),b=-1):f=!0,J(w,$-F))):(K.sortIndex=q,n(a,K),C||S||(C=!0,Z(R))),K},r.unstable_shouldYield=W,r.unstable_wrapCallback=function(K){var P=v;return function(){var $=v;v=P;try{return K.apply(this,arguments)}finally{v=$}}}})(El)),El}var Kh;function Jm(){return Kh||(Kh=1,kl.exports=Qm()),kl.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 Gh;function Zm(){if(Gh)return Gt;Gh=1;var r=mc(),n=Jm();function c(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var y=new Set,E={};function N(e,t){D(e,t),D(e+"Capture",t)}function D(e,t){for(E[e]=t,e=0;e<t.length;e++)y.add(t[e])}var i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),a=Object.prototype.hasOwnProperty,g=/^[: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]*$/,_={},l={};function v(e){return a.call(l,e)?!0:a.call(_,e)?!1:g.test(e)?l[e]=!0:(_[e]=!0,!1)}function S(e,t,s,p){if(s!==null&&s.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return p?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,t,s,p){if(t===null||typeof t>"u"||S(e,t,s,p))return!0;if(p)return!1;if(s!==null)switch(s.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function f(e,t,s,p,x,M,U){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=p,this.attributeNamespace=x,this.mustUseProperty=s,this.propertyName=e,this.type=t,this.sanitizeURL=M,this.removeEmptyString=U}var o={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){o[e]=new f(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 f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){o[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){o[e]=new f(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 f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){o[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){o[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){o[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){o[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var u=/[\-:]([a-z])/g;function h(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(u,h);o[t]=new f(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(u,h);o[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(u,h);o[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){o[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),o.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){o[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});function d(e,t,s,p){var x=o.hasOwnProperty(t)?o[t]:null;(x!==null?x.type!==0:p||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(C(t,s,x,p)&&(s=null),p||x===null?v(t)&&(s===null?e.removeAttribute(t):e.setAttribute(t,""+s)):x.mustUseProperty?e[x.propertyName]=s===null?x.type===3?!1:"":s:(t=x.attributeName,p=x.attributeNamespace,s===null?e.removeAttribute(t):(x=x.type,s=x===3||x===4&&s===!0?"":""+s,p?e.setAttributeNS(p,t,s):e.setAttribute(t,s))))}var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),I=Symbol.for("react.provider"),W=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),K=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var $=Object.assign,F;function q(e){if(F===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);F=t&&t[1]||""}return`
|
|
34
|
+
`+F+e}var ne=!1;function re(e,t){if(!e||ne)return"";ne=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(ce){var p=ce}Reflect.construct(e,[],t)}else{try{t.call()}catch(ce){p=ce}e.call(t.prototype)}else{try{throw Error()}catch(ce){p=ce}e()}}catch(ce){if(ce&&p&&typeof ce.stack=="string"){for(var x=ce.stack.split(`
|
|
35
|
+
`),M=p.stack.split(`
|
|
36
|
+
`),U=x.length-1,X=M.length-1;1<=U&&0<=X&&x[U]!==M[X];)X--;for(;1<=U&&0<=X;U--,X--)if(x[U]!==M[X]){if(U!==1||X!==1)do if(U--,X--,0>X||x[U]!==M[X]){var te=`
|
|
37
|
+
`+x[U].replace(" at new "," at ");return e.displayName&&te.includes("<anonymous>")&&(te=te.replace("<anonymous>",e.displayName)),te}while(1<=U&&0<=X);break}}}finally{ne=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?q(e):""}function ie(e){switch(e.tag){case 5:return q(e.type);case 16:return q("Lazy");case 13:return q("Suspense");case 19:return q("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 Q(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 A:return"Fragment";case k:return"Portal";case T:return"Profiler";case b:return"StrictMode";case j:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case W:return(e.displayName||"Context")+".Consumer";case I:return(e._context.displayName||"Context")+".Provider";case O:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}function V(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 Q(t);case 8:return t===b?"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 H(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function G(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ee(e){var t=G(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),p=""+e[t];if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var x=s.get,M=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return x.call(this)},set:function(U){p=""+U,M.call(this,U)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return p},setValue:function(U){p=""+U},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function de(e){e._valueTracker||(e._valueTracker=ee(e))}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),p="";return e&&(p=G(e)?e.checked?"true":"false":e.value),e=p,e!==s?(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 ke(e,t){var s=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function $e(e,t){var s=t.defaultValue==null?"":t.defaultValue,p=t.checked!=null?t.checked:t.defaultChecked;s=H(t.value!=null?t.value:s),e._wrapperState={initialChecked:p,initialValue:s,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ye(e,t){t=t.checked,t!=null&&d(e,"checked",t,!1)}function Te(e,t){Ye(e,t);var s=H(t.value),p=t.type;if(s!=null)p==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(p==="submit"||p==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ae(e,t.type,s):t.hasOwnProperty("defaultValue")&&Ae(e,t.type,H(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ot(e,t,s){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var p=t.type;if(!(p!=="submit"&&p!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,s||t===e.value||(e.value=t),e.defaultValue=t}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Ae(e,t,s){(t!=="number"||Ee(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var De=Array.isArray;function Ce(e,t,s,p){if(e=e.options,t){t={};for(var x=0;x<s.length;x++)t["$"+s[x]]=!0;for(s=0;s<e.length;s++)x=t.hasOwnProperty("$"+e[s].value),e[s].selected!==x&&(e[s].selected=x),x&&p&&(e[s].defaultSelected=!0)}else{for(s=""+H(s),t=null,x=0;x<e.length;x++){if(e[x].value===s){e[x].selected=!0,p&&(e[x].defaultSelected=!0);return}t!==null||e[x].disabled||(t=e[x])}t!==null&&(t.selected=!0)}}function je(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(c(91));return $({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _e(e,t){var s=t.value;if(s==null){if(s=t.children,t=t.defaultValue,s!=null){if(t!=null)throw Error(c(92));if(De(s)){if(1<s.length)throw Error(c(93));s=s[0]}t=s}t==null&&(t=""),s=t}e._wrapperState={initialValue:H(s)}}function We(e,t){var s=H(t.value),p=H(t.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),t.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),p!=null&&(e.defaultValue=""+p)}function Je(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ze(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 St(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ze(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var at,lt=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,s,p,x){MSApp.execUnsafeLocalFunction(function(){return e(t,s,p,x)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(at=at||document.createElement("div"),at.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=at.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function tt(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var Ge={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},fe=["Webkit","ms","Moz","O"];Object.keys(Ge).forEach(function(e){fe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ge[t]=Ge[e]})});function ze(e,t,s){return t==null||typeof t=="boolean"||t===""?"":s||typeof t!="number"||t===0||Ge.hasOwnProperty(e)&&Ge[e]?(""+t).trim():t+"px"}function st(e,t){e=e.style;for(var s in t)if(t.hasOwnProperty(s)){var p=s.indexOf("--")===0,x=ze(s,t[s],p);s==="float"&&(s="cssFloat"),p?e.setProperty(s,x):e[s]=x}}var we=$({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 Ke(e,t){if(t){if(we[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(c(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(c(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(c(61))}if(t.style!=null&&typeof t.style!="object")throw Error(c(62))}}function he(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 Oe=null;function be(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nt=null,Ne=null,ct=null;function dn(e){if(e=$s(e)){if(typeof nt!="function")throw Error(c(280));var t=e.stateNode;t&&(t=Hi(t),nt(e.stateNode,e.type,t))}}function kn(e){Ne?ct?ct.push(e):ct=[e]:Ne=e}function En(){if(Ne){var e=Ne,t=ct;if(ct=Ne=null,dn(e),t)for(e=0;e<t.length;e++)dn(t[e])}}function mr(e,t){return e(t)}function Or(){}var Ln=!1;function ui(e,t,s){if(Ln)return e(t,s);Ln=!0;try{return mr(e,t,s)}finally{Ln=!1,(Ne!==null||ct!==null)&&(Or(),En())}}function gr(e,t){var s=e.stateNode;if(s===null)return null;var p=Hi(s);if(p===null)return null;s=p[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":(p=!p.disabled)||(e=e.type,p=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!p;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var jr=!1;if(i)try{var _r={};Object.defineProperty(_r,"passive",{get:function(){jr=!0}}),window.addEventListener("test",_r,_r),window.removeEventListener("test",_r,_r)}catch{jr=!1}function vs(e,t,s,p,x,M,U,X,te){var ce=Array.prototype.slice.call(arguments,3);try{t.apply(s,ce)}catch(me){this.onError(me)}}var Bn=!1,fn=null,Tn=!1,vr=null,Gn={onError:function(e){Bn=!0,fn=e}};function ys(e,t,s,p,x,M,U,X,te){Bn=!1,fn=null,vs.apply(Gn,arguments)}function rn(e,t,s,p,x,M,U,X,te){if(ys.apply(this,arguments),Bn){if(Bn){var ce=fn;Bn=!1,fn=null}else throw Error(c(198));Tn||(Tn=!0,vr=ce)}}function Fn(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function ws(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 Br(e){if(Fn(e)!==e)throw Error(c(188))}function Bt(e){var t=e.alternate;if(!t){if(t=Fn(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,p=t;;){var x=s.return;if(x===null)break;var M=x.alternate;if(M===null){if(p=x.return,p!==null){s=p;continue}break}if(x.child===M.child){for(M=x.child;M;){if(M===s)return Br(x),e;if(M===p)return Br(x),t;M=M.sibling}throw Error(c(188))}if(s.return!==p.return)s=x,p=M;else{for(var U=!1,X=x.child;X;){if(X===s){U=!0,s=x,p=M;break}if(X===p){U=!0,p=x,s=M;break}X=X.sibling}if(!U){for(X=M.child;X;){if(X===s){U=!0,s=M,p=x;break}if(X===p){U=!0,p=M,s=x;break}X=X.sibling}if(!U)throw Error(c(189))}}if(s.alternate!==p)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function hi(e){return e=Bt(e),e!==null?di(e):null}function di(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=di(e);if(t!==null)return t;e=e.sibling}return null}var fi=n.unstable_scheduleCallback,pi=n.unstable_cancelCallback,Uo=n.unstable_shouldYield,mi=n.unstable_requestPaint,ft=n.unstable_now,gi=n.unstable_getCurrentPriorityLevel,Fr=n.unstable_ImmediatePriority,_i=n.unstable_UserBlockingPriority,Hr=n.unstable_NormalPriority,zo=n.unstable_LowPriority,Ss=n.unstable_IdlePriority,yr=null,Wt=null;function Cs(e){if(Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(yr,e,void 0,(e.current.flags&128)===128)}catch{}}var Yt=Math.clz32?Math.clz32:vi,qo=Math.log,Vo=Math.LN2;function vi(e){return e>>>=0,e===0?32:31-(qo(e)/Vo|0)|0}var Qt=64,$r=4194304;function pn(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 wr(e,t){var s=e.pendingLanes;if(s===0)return 0;var p=0,x=e.suspendedLanes,M=e.pingedLanes,U=s&268435455;if(U!==0){var X=U&~x;X!==0?p=pn(X):(M&=U,M!==0&&(p=pn(M)))}else U=s&~x,U!==0?p=pn(U):M!==0&&(p=pn(M));if(p===0)return 0;if(t!==0&&t!==p&&(t&x)===0&&(x=p&-p,M=t&-t,x>=M||x===16&&(M&4194240)!==0))return t;if((p&4)!==0&&(p|=s&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=p;0<t;)s=31-Yt(t),x=1<<s,p|=e[s],t&=~x;return p}function yi(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 wi(e,t){for(var s=e.suspendedLanes,p=e.pingedLanes,x=e.expirationTimes,M=e.pendingLanes;0<M;){var U=31-Yt(M),X=1<<U,te=x[U];te===-1?((X&s)===0||(X&p)!==0)&&(x[U]=yi(X,t)):te<=t&&(e.expiredLanes|=X),M&=~X}}function bs(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Si(){var e=Qt;return Qt<<=1,(Qt&4194240)===0&&(Qt=64),e}function xs(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Sr(e,t,s){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Yt(t),e[t]=s}function Ko(e,t){var s=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var p=e.eventTimes;for(e=e.expirationTimes;0<s;){var x=31-Yt(s),M=1<<x;t[x]=0,p[x]=-1,e[x]=-1,s&=~M}}function Rn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var p=31-Yt(s),x=1<<p;x&t|e[p]&t&&(e[p]|=t),s&=~x}}var it=0;function ks(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ci,Es,bi,xi,ki,Cr=!1,br=[],sn=null,mn=null,Mn=null,Xn=new Map,Yn=new Map,le=[],Se="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 Qe(e,t){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":mn=null;break;case"mouseover":case"mouseout":Mn=null;break;case"pointerover":case"pointerout":Xn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yn.delete(t.pointerId)}}function gn(e,t,s,p,x,M){return e===null||e.nativeEvent!==M?(e={blockedOn:t,domEventName:s,eventSystemFlags:p,nativeEvent:M,targetContainers:[x]},t!==null&&(t=$s(t),t!==null&&Es(t)),e):(e.eventSystemFlags|=p,t=e.targetContainers,x!==null&&t.indexOf(x)===-1&&t.push(x),e)}function Ls(e,t,s,p,x){switch(t){case"focusin":return sn=gn(sn,e,t,s,p,x),!0;case"dragenter":return mn=gn(mn,e,t,s,p,x),!0;case"mouseover":return Mn=gn(Mn,e,t,s,p,x),!0;case"pointerover":var M=x.pointerId;return Xn.set(M,gn(Xn.get(M)||null,e,t,s,p,x)),!0;case"gotpointercapture":return M=x.pointerId,Yn.set(M,gn(Yn.get(M)||null,e,t,s,p,x)),!0}return!1}function Ec(e){var t=xr(e.target);if(t!==null){var s=Fn(t);if(s!==null){if(t=s.tag,t===13){if(t=ws(s),t!==null){e.blockedOn=t,ki(e.priority,function(){bi(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ei(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Xo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var p=new s.constructor(s.type,s);Oe=p,s.target.dispatchEvent(p),Oe=null}else return t=$s(s),t!==null&&Es(t),e.blockedOn=s,!1;t.shift()}return!0}function Lc(e,t,s){Ei(e)&&s.delete(t)}function mp(){Cr=!1,sn!==null&&Ei(sn)&&(sn=null),mn!==null&&Ei(mn)&&(mn=null),Mn!==null&&Ei(Mn)&&(Mn=null),Xn.forEach(Lc),Yn.forEach(Lc)}function Ts(e,t){e.blockedOn===t&&(e.blockedOn=null,Cr||(Cr=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,mp)))}function Rs(e){function t(x){return Ts(x,e)}if(0<br.length){Ts(br[0],e);for(var s=1;s<br.length;s++){var p=br[s];p.blockedOn===e&&(p.blockedOn=null)}}for(sn!==null&&Ts(sn,e),mn!==null&&Ts(mn,e),Mn!==null&&Ts(Mn,e),Xn.forEach(t),Yn.forEach(t),s=0;s<le.length;s++)p=le[s],p.blockedOn===e&&(p.blockedOn=null);for(;0<le.length&&(s=le[0],s.blockedOn===null);)Ec(s),s.blockedOn===null&&le.shift()}var Wr=w.ReactCurrentBatchConfig,Li=!0;function gp(e,t,s,p){var x=it,M=Wr.transition;Wr.transition=null;try{it=1,Go(e,t,s,p)}finally{it=x,Wr.transition=M}}function _p(e,t,s,p){var x=it,M=Wr.transition;Wr.transition=null;try{it=4,Go(e,t,s,p)}finally{it=x,Wr.transition=M}}function Go(e,t,s,p){if(Li){var x=Xo(e,t,s,p);if(x===null)da(e,t,p,Ti,s),Qe(e,p);else if(Ls(x,e,t,s,p))p.stopPropagation();else if(Qe(e,p),t&4&&-1<Se.indexOf(e)){for(;x!==null;){var M=$s(x);if(M!==null&&Ci(M),M=Xo(e,t,s,p),M===null&&da(e,t,p,Ti,s),M===x)break;x=M}x!==null&&p.stopPropagation()}else da(e,t,p,null,s)}}var Ti=null;function Xo(e,t,s,p){if(Ti=null,e=be(p),e=xr(e),e!==null)if(t=Fn(e),t===null)e=null;else if(s=t.tag,s===13){if(e=ws(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ti=e,null}function Tc(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(gi()){case Fr:return 1;case _i:return 4;case Hr:case zo:return 16;case Ss:return 536870912;default:return 16}default:return 16}}var Qn=null,Yo=null,Ri=null;function Rc(){if(Ri)return Ri;var e,t=Yo,s=t.length,p,x="value"in Qn?Qn.value:Qn.textContent,M=x.length;for(e=0;e<s&&t[e]===x[e];e++);var U=s-e;for(p=1;p<=U&&t[s-p]===x[M-p];p++);return Ri=x.slice(e,1<p?1-p:void 0)}function Mi(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 Ai(){return!0}function Mc(){return!1}function Jt(e){function t(s,p,x,M,U){this._reactName=s,this._targetInst=x,this.type=p,this.nativeEvent=M,this.target=U,this.currentTarget=null;for(var X in e)e.hasOwnProperty(X)&&(s=e[X],this[X]=s?s(M):M[X]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?Ai:Mc,this.isPropagationStopped=Mc,this}return $(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Ai)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Ai)},persist:function(){},isPersistent:Ai}),t}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=Jt(Ur),Ms=$({},Ur,{view:0,detail:0}),vp=Jt(Ms),Jo,Zo,As,Di=$({},Ms,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ta,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!==As&&(As&&e.type==="mousemove"?(Jo=e.screenX-As.screenX,Zo=e.screenY-As.screenY):Zo=Jo=0,As=e),Jo)},movementY:function(e){return"movementY"in e?e.movementY:Zo}}),Ac=Jt(Di),yp=$({},Di,{dataTransfer:0}),wp=Jt(yp),Sp=$({},Ms,{relatedTarget:0}),ea=Jt(Sp),Cp=$({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),bp=Jt(Cp),xp=$({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),kp=Jt(xp),Ep=$({},Ur,{data:0}),Dc=Jt(Ep),Lp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tp={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"},Rp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rp[e])?!!t[e]:!1}function ta(){return Mp}var Ap=$({},Ms,{key:function(e){if(e.key){var t=Lp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Tp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ta,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dp=Jt(Ap),Ip=$({},Di,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ic=Jt(Ip),Np=$({},Ms,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ta}),Pp=Jt(Np),Op=$({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),jp=Jt(Op),Bp=$({},Di,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Fp=Jt(Bp),Hp=[9,13,27,32],na=i&&"CompositionEvent"in window,Ds=null;i&&"documentMode"in document&&(Ds=document.documentMode);var $p=i&&"TextEvent"in window&&!Ds,Nc=i&&(!na||Ds&&8<Ds&&11>=Ds),Pc=" ",Oc=!1;function jc(e,t){switch(e){case"keyup":return Hp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zr=!1;function Wp(e,t){switch(e){case"compositionend":return Bc(t);case"keypress":return t.which!==32?null:(Oc=!0,Pc);case"textInput":return e=t.data,e===Pc&&Oc?null:e;default:return null}}function Up(e,t){if(zr)return e==="compositionend"||!na&&jc(e,t)?(e=Rc(),Ri=Yo=Qn=null,zr=!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 Nc&&t.locale!=="ko"?null:t.data;default:return null}}var zp={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 Fc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!zp[e.type]:t==="textarea"}function Hc(e,t,s,p){kn(p),t=ji(t,"onChange"),0<t.length&&(s=new Qo("onChange","change",null,s,p),e.push({event:s,listeners:t}))}var Is=null,Ns=null;function qp(e){su(e,0)}function Ii(e){var t=Xr(e);if(ue(t))return e}function Vp(e,t){if(e==="change")return t}var $c=!1;if(i){var ra;if(i){var sa="oninput"in document;if(!sa){var Wc=document.createElement("div");Wc.setAttribute("oninput","return;"),sa=typeof Wc.oninput=="function"}ra=sa}else ra=!1;$c=ra&&(!document.documentMode||9<document.documentMode)}function Uc(){Is&&(Is.detachEvent("onpropertychange",zc),Ns=Is=null)}function zc(e){if(e.propertyName==="value"&&Ii(Ns)){var t=[];Hc(t,Ns,e,be(e)),ui(qp,t)}}function Kp(e,t,s){e==="focusin"?(Uc(),Is=t,Ns=s,Is.attachEvent("onpropertychange",zc)):e==="focusout"&&Uc()}function Gp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ii(Ns)}function Xp(e,t){if(e==="click")return Ii(t)}function Yp(e,t){if(e==="input"||e==="change")return Ii(t)}function Qp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _n=typeof Object.is=="function"?Object.is:Qp;function Ps(e,t){if(_n(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),p=Object.keys(t);if(s.length!==p.length)return!1;for(p=0;p<s.length;p++){var x=s[p];if(!a.call(t,x)||!_n(e[x],t[x]))return!1}return!0}function qc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vc(e,t){var s=qc(e);e=0;for(var p;s;){if(s.nodeType===3){if(p=e+s.textContent.length,e<=t&&p>=t)return{node:s,offset:t-e};e=p}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=qc(s)}}function Kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gc(){for(var e=window,t=Ee();t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ee(e.document)}return t}function ia(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 Jp(e){var t=Gc(),s=e.focusedElem,p=e.selectionRange;if(t!==s&&s&&s.ownerDocument&&Kc(s.ownerDocument.documentElement,s)){if(p!==null&&ia(s)){if(t=p.start,e=p.end,e===void 0&&(e=t),"selectionStart"in s)s.selectionStart=t,s.selectionEnd=Math.min(e,s.value.length);else if(e=(t=s.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var x=s.textContent.length,M=Math.min(p.start,x);p=p.end===void 0?M:Math.min(p.end,x),!e.extend&&M>p&&(x=p,p=M,M=x),x=Vc(s,M);var U=Vc(s,p);x&&U&&(e.rangeCount!==1||e.anchorNode!==x.node||e.anchorOffset!==x.offset||e.focusNode!==U.node||e.focusOffset!==U.offset)&&(t=t.createRange(),t.setStart(x.node,x.offset),e.removeAllRanges(),M>p?(e.addRange(t),e.extend(U.node,U.offset)):(t.setEnd(U.node,U.offset),e.addRange(t)))}}for(t=[],e=s;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<t.length;s++)e=t[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Zp=i&&"documentMode"in document&&11>=document.documentMode,qr=null,oa=null,Os=null,aa=!1;function Xc(e,t,s){var p=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;aa||qr==null||qr!==Ee(p)||(p=qr,"selectionStart"in p&&ia(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Os&&Ps(Os,p)||(Os=p,p=ji(oa,"onSelect"),0<p.length&&(t=new Qo("onSelect","select",null,t,s),e.push({event:t,listeners:p}),t.target=qr)))}function Ni(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Vr={animationend:Ni("Animation","AnimationEnd"),animationiteration:Ni("Animation","AnimationIteration"),animationstart:Ni("Animation","AnimationStart"),transitionend:Ni("Transition","TransitionEnd")},la={},Yc={};i&&(Yc=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 Pi(e){if(la[e])return la[e];if(!Vr[e])return e;var t=Vr[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Yc)return la[e]=t[s];return e}var Qc=Pi("animationend"),Jc=Pi("animationiteration"),Zc=Pi("animationstart"),eu=Pi("transitionend"),tu=new Map,nu="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 Jn(e,t){tu.set(e,t),N(t,[e])}for(var ca=0;ca<nu.length;ca++){var ua=nu[ca],em=ua.toLowerCase(),tm=ua[0].toUpperCase()+ua.slice(1);Jn(em,"on"+tm)}Jn(Qc,"onAnimationEnd"),Jn(Jc,"onAnimationIteration"),Jn(Zc,"onAnimationStart"),Jn("dblclick","onDoubleClick"),Jn("focusin","onFocus"),Jn("focusout","onBlur"),Jn(eu,"onTransitionEnd"),D("onMouseEnter",["mouseout","mouseover"]),D("onMouseLeave",["mouseout","mouseover"]),D("onPointerEnter",["pointerout","pointerover"]),D("onPointerLeave",["pointerout","pointerover"]),N("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),N("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),N("onBeforeInput",["compositionend","keypress","textInput","paste"]),N("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),N("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),N("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var js="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(" "),nm=new Set("cancel close invalid load scroll toggle".split(" ").concat(js));function ru(e,t,s){var p=e.type||"unknown-event";e.currentTarget=s,rn(p,t,void 0,e),e.currentTarget=null}function su(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var p=e[s],x=p.event;p=p.listeners;e:{var M=void 0;if(t)for(var U=p.length-1;0<=U;U--){var X=p[U],te=X.instance,ce=X.currentTarget;if(X=X.listener,te!==M&&x.isPropagationStopped())break e;ru(x,X,ce),M=te}else for(U=0;U<p.length;U++){if(X=p[U],te=X.instance,ce=X.currentTarget,X=X.listener,te!==M&&x.isPropagationStopped())break e;ru(x,X,ce),M=te}}}if(Tn)throw e=vr,Tn=!1,vr=null,e}function ht(e,t){var s=t[va];s===void 0&&(s=t[va]=new Set);var p=e+"__bubble";s.has(p)||(iu(t,e,2,!1),s.add(p))}function ha(e,t,s){var p=0;t&&(p|=4),iu(s,e,p,t)}var Oi="_reactListening"+Math.random().toString(36).slice(2);function Bs(e){if(!e[Oi]){e[Oi]=!0,y.forEach(function(s){s!=="selectionchange"&&(nm.has(s)||ha(s,!1,e),ha(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oi]||(t[Oi]=!0,ha("selectionchange",!1,t))}}function iu(e,t,s,p){switch(Tc(t)){case 1:var x=gp;break;case 4:x=_p;break;default:x=Go}s=x.bind(null,t,s,e),x=void 0,!jr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(x=!0),p?x!==void 0?e.addEventListener(t,s,{capture:!0,passive:x}):e.addEventListener(t,s,!0):x!==void 0?e.addEventListener(t,s,{passive:x}):e.addEventListener(t,s,!1)}function da(e,t,s,p,x){var M=p;if((t&1)===0&&(t&2)===0&&p!==null)e:for(;;){if(p===null)return;var U=p.tag;if(U===3||U===4){var X=p.stateNode.containerInfo;if(X===x||X.nodeType===8&&X.parentNode===x)break;if(U===4)for(U=p.return;U!==null;){var te=U.tag;if((te===3||te===4)&&(te=U.stateNode.containerInfo,te===x||te.nodeType===8&&te.parentNode===x))return;U=U.return}for(;X!==null;){if(U=xr(X),U===null)return;if(te=U.tag,te===5||te===6){p=M=U;continue e}X=X.parentNode}}p=p.return}ui(function(){var ce=M,me=be(s),ge=[];e:{var pe=tu.get(e);if(pe!==void 0){var xe=Qo,Re=e;switch(e){case"keypress":if(Mi(s)===0)break e;case"keydown":case"keyup":xe=Dp;break;case"focusin":Re="focus",xe=ea;break;case"focusout":Re="blur",xe=ea;break;case"beforeblur":case"afterblur":xe=ea;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Ac;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=wp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=Pp;break;case Qc:case Jc:case Zc:xe=bp;break;case eu:xe=jp;break;case"scroll":xe=vp;break;case"wheel":xe=Fp;break;case"copy":case"cut":case"paste":xe=kp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Ic}var Ie=(t&4)!==0,wt=!Ie&&e==="scroll",oe=Ie?pe!==null?pe+"Capture":null:pe;Ie=[];for(var se=ce,ae;se!==null;){ae=se;var ve=ae.stateNode;if(ae.tag===5&&ve!==null&&(ae=ve,oe!==null&&(ve=gr(se,oe),ve!=null&&Ie.push(Fs(se,ve,ae)))),wt)break;se=se.return}0<Ie.length&&(pe=new xe(pe,Re,null,s,me),ge.push({event:pe,listeners:Ie}))}}if((t&7)===0){e:{if(pe=e==="mouseover"||e==="pointerover",xe=e==="mouseout"||e==="pointerout",pe&&s!==Oe&&(Re=s.relatedTarget||s.fromElement)&&(xr(Re)||Re[Hn]))break e;if((xe||pe)&&(pe=me.window===me?me:(pe=me.ownerDocument)?pe.defaultView||pe.parentWindow:window,xe?(Re=s.relatedTarget||s.toElement,xe=ce,Re=Re?xr(Re):null,Re!==null&&(wt=Fn(Re),Re!==wt||Re.tag!==5&&Re.tag!==6)&&(Re=null)):(xe=null,Re=ce),xe!==Re)){if(Ie=Ac,ve="onMouseLeave",oe="onMouseEnter",se="mouse",(e==="pointerout"||e==="pointerover")&&(Ie=Ic,ve="onPointerLeave",oe="onPointerEnter",se="pointer"),wt=xe==null?pe:Xr(xe),ae=Re==null?pe:Xr(Re),pe=new Ie(ve,se+"leave",xe,s,me),pe.target=wt,pe.relatedTarget=ae,ve=null,xr(me)===ce&&(Ie=new Ie(oe,se+"enter",Re,s,me),Ie.target=ae,Ie.relatedTarget=wt,ve=Ie),wt=ve,xe&&Re)t:{for(Ie=xe,oe=Re,se=0,ae=Ie;ae;ae=Kr(ae))se++;for(ae=0,ve=oe;ve;ve=Kr(ve))ae++;for(;0<se-ae;)Ie=Kr(Ie),se--;for(;0<ae-se;)oe=Kr(oe),ae--;for(;se--;){if(Ie===oe||oe!==null&&Ie===oe.alternate)break t;Ie=Kr(Ie),oe=Kr(oe)}Ie=null}else Ie=null;xe!==null&&ou(ge,pe,xe,Ie,!1),Re!==null&&wt!==null&&ou(ge,wt,Re,Ie,!0)}}e:{if(pe=ce?Xr(ce):window,xe=pe.nodeName&&pe.nodeName.toLowerCase(),xe==="select"||xe==="input"&&pe.type==="file")var Pe=Vp;else if(Fc(pe))if($c)Pe=Yp;else{Pe=Gp;var Fe=Kp}else(xe=pe.nodeName)&&xe.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Pe=Xp);if(Pe&&(Pe=Pe(e,ce))){Hc(ge,Pe,s,me);break e}Fe&&Fe(e,pe,ce),e==="focusout"&&(Fe=pe._wrapperState)&&Fe.controlled&&pe.type==="number"&&Ae(pe,"number",pe.value)}switch(Fe=ce?Xr(ce):window,e){case"focusin":(Fc(Fe)||Fe.contentEditable==="true")&&(qr=Fe,oa=ce,Os=null);break;case"focusout":Os=oa=qr=null;break;case"mousedown":aa=!0;break;case"contextmenu":case"mouseup":case"dragend":aa=!1,Xc(ge,s,me);break;case"selectionchange":if(Zp)break;case"keydown":case"keyup":Xc(ge,s,me)}var He;if(na)e:{switch(e){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else zr?jc(e,s)&&(qe="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(qe="onCompositionStart");qe&&(Nc&&s.locale!=="ko"&&(zr||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&zr&&(He=Rc()):(Qn=me,Yo="value"in Qn?Qn.value:Qn.textContent,zr=!0)),Fe=ji(ce,qe),0<Fe.length&&(qe=new Dc(qe,e,null,s,me),ge.push({event:qe,listeners:Fe}),He?qe.data=He:(He=Bc(s),He!==null&&(qe.data=He)))),(He=$p?Wp(e,s):Up(e,s))&&(ce=ji(ce,"onBeforeInput"),0<ce.length&&(me=new Dc("onBeforeInput","beforeinput",null,s,me),ge.push({event:me,listeners:ce}),me.data=He))}su(ge,t)})}function Fs(e,t,s){return{instance:e,listener:t,currentTarget:s}}function ji(e,t){for(var s=t+"Capture",p=[];e!==null;){var x=e,M=x.stateNode;x.tag===5&&M!==null&&(x=M,M=gr(e,s),M!=null&&p.unshift(Fs(e,M,x)),M=gr(e,t),M!=null&&p.push(Fs(e,M,x))),e=e.return}return p}function Kr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ou(e,t,s,p,x){for(var M=t._reactName,U=[];s!==null&&s!==p;){var X=s,te=X.alternate,ce=X.stateNode;if(te!==null&&te===p)break;X.tag===5&&ce!==null&&(X=ce,x?(te=gr(s,M),te!=null&&U.unshift(Fs(s,te,X))):x||(te=gr(s,M),te!=null&&U.push(Fs(s,te,X)))),s=s.return}U.length!==0&&e.push({event:t,listeners:U})}var rm=/\r\n?/g,sm=/\u0000|\uFFFD/g;function au(e){return(typeof e=="string"?e:""+e).replace(rm,`
|
|
38
|
+
`).replace(sm,"")}function Bi(e,t,s){if(t=au(t),au(e)!==t&&s)throw Error(c(425))}function Fi(){}var fa=null,pa=null;function ma(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 ga=typeof setTimeout=="function"?setTimeout:void 0,im=typeof clearTimeout=="function"?clearTimeout:void 0,lu=typeof Promise=="function"?Promise:void 0,om=typeof queueMicrotask=="function"?queueMicrotask:typeof lu<"u"?function(e){return lu.resolve(null).then(e).catch(am)}:ga;function am(e){setTimeout(function(){throw e})}function _a(e,t){var s=t,p=0;do{var x=s.nextSibling;if(e.removeChild(s),x&&x.nodeType===8)if(s=x.data,s==="/$"){if(p===0){e.removeChild(x),Rs(t);return}p--}else s!=="$"&&s!=="$?"&&s!=="$!"||p++;s=x}while(s);Rs(t)}function Zn(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 cu(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(t===0)return e;t--}else s==="/$"&&t++}e=e.previousSibling}return null}var Gr=Math.random().toString(36).slice(2),An="__reactFiber$"+Gr,Hs="__reactProps$"+Gr,Hn="__reactContainer$"+Gr,va="__reactEvents$"+Gr,lm="__reactListeners$"+Gr,cm="__reactHandles$"+Gr;function xr(e){var t=e[An];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Hn]||s[An]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=cu(e);e!==null;){if(s=e[An])return s;e=cu(e)}return t}e=s,s=e.parentNode}return null}function $s(e){return e=e[An]||e[Hn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(c(33))}function Hi(e){return e[Hs]||null}var ya=[],Yr=-1;function er(e){return{current:e}}function dt(e){0>Yr||(e.current=ya[Yr],ya[Yr]=null,Yr--)}function ut(e,t){Yr++,ya[Yr]=e.current,e.current=t}var tr={},Dt=er(tr),Ut=er(!1),kr=tr;function Qr(e,t){var s=e.type.contextTypes;if(!s)return tr;var p=e.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===t)return p.__reactInternalMemoizedMaskedChildContext;var x={},M;for(M in s)x[M]=t[M];return p&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=x),x}function zt(e){return e=e.childContextTypes,e!=null}function $i(){dt(Ut),dt(Dt)}function uu(e,t,s){if(Dt.current!==tr)throw Error(c(168));ut(Dt,t),ut(Ut,s)}function hu(e,t,s){var p=e.stateNode;if(t=t.childContextTypes,typeof p.getChildContext!="function")return s;p=p.getChildContext();for(var x in p)if(!(x in t))throw Error(c(108,V(e)||"Unknown",x));return $({},s,p)}function Wi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tr,kr=Dt.current,ut(Dt,e),ut(Ut,Ut.current),!0}function du(e,t,s){var p=e.stateNode;if(!p)throw Error(c(169));s?(e=hu(e,t,kr),p.__reactInternalMemoizedMergedChildContext=e,dt(Ut),dt(Dt),ut(Dt,e)):dt(Ut),ut(Ut,s)}var $n=null,Ui=!1,wa=!1;function fu(e){$n===null?$n=[e]:$n.push(e)}function um(e){Ui=!0,fu(e)}function nr(){if(!wa&&$n!==null){wa=!0;var e=0,t=it;try{var s=$n;for(it=1;e<s.length;e++){var p=s[e];do p=p(!0);while(p!==null)}$n=null,Ui=!1}catch(x){throw $n!==null&&($n=$n.slice(e+1)),fi(Fr,nr),x}finally{it=t,wa=!1}}return null}var Jr=[],Zr=0,zi=null,qi=0,on=[],an=0,Er=null,Wn=1,Un="";function Lr(e,t){Jr[Zr++]=qi,Jr[Zr++]=zi,zi=e,qi=t}function pu(e,t,s){on[an++]=Wn,on[an++]=Un,on[an++]=Er,Er=e;var p=Wn;e=Un;var x=32-Yt(p)-1;p&=~(1<<x),s+=1;var M=32-Yt(t)+x;if(30<M){var U=x-x%5;M=(p&(1<<U)-1).toString(32),p>>=U,x-=U,Wn=1<<32-Yt(t)+x|s<<x|p,Un=M+e}else Wn=1<<M|s<<x|p,Un=e}function Sa(e){e.return!==null&&(Lr(e,1),pu(e,1,0))}function Ca(e){for(;e===zi;)zi=Jr[--Zr],Jr[Zr]=null,qi=Jr[--Zr],Jr[Zr]=null;for(;e===Er;)Er=on[--an],on[an]=null,Un=on[--an],on[an]=null,Wn=on[--an],on[an]=null}var Zt=null,en=null,pt=!1,vn=null;function mu(e,t){var s=hn(5,null,null,0);s.elementType="DELETED",s.stateNode=t,s.return=e,t=e.deletions,t===null?(e.deletions=[s],e.flags|=16):t.push(s)}function gu(e,t){switch(e.tag){case 5:var s=e.type;return t=t.nodeType!==1||s.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Zt=e,en=Zn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Zt=e,en=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(s=Er!==null?{id:Wn,overflow:Un}:null,e.memoizedState={dehydrated:t,treeContext:s,retryLane:1073741824},s=hn(18,null,null,0),s.stateNode=t,s.return=e,e.child=s,Zt=e,en=null,!0):!1;default:return!1}}function ba(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xa(e){if(pt){var t=en;if(t){var s=t;if(!gu(e,t)){if(ba(e))throw Error(c(418));t=Zn(s.nextSibling);var p=Zt;t&&gu(e,t)?mu(p,s):(e.flags=e.flags&-4097|2,pt=!1,Zt=e)}}else{if(ba(e))throw Error(c(418));e.flags=e.flags&-4097|2,pt=!1,Zt=e}}}function _u(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Zt=e}function Vi(e){if(e!==Zt)return!1;if(!pt)return _u(e),pt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ma(e.type,e.memoizedProps)),t&&(t=en)){if(ba(e))throw vu(),Error(c(418));for(;t;)mu(e,t),t=Zn(t.nextSibling)}if(_u(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(t===0){en=Zn(e.nextSibling);break e}t--}else s!=="$"&&s!=="$!"&&s!=="$?"||t++}e=e.nextSibling}en=null}}else en=Zt?Zn(e.stateNode.nextSibling):null;return!0}function vu(){for(var e=en;e;)e=Zn(e.nextSibling)}function es(){en=Zt=null,pt=!1}function ka(e){vn===null?vn=[e]:vn.push(e)}var hm=w.ReactCurrentBatchConfig;function Ws(e,t,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(c(309));var p=s.stateNode}if(!p)throw Error(c(147,e));var x=p,M=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===M?t.ref:(t=function(U){var X=x.refs;U===null?delete X[M]:X[M]=U},t._stringRef=M,t)}if(typeof e!="string")throw Error(c(284));if(!s._owner)throw Error(c(290,e))}return e}function Ki(e,t){throw e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yu(e){var t=e._init;return t(e._payload)}function wu(e){function t(oe,se){if(e){var ae=oe.deletions;ae===null?(oe.deletions=[se],oe.flags|=16):ae.push(se)}}function s(oe,se){if(!e)return null;for(;se!==null;)t(oe,se),se=se.sibling;return null}function p(oe,se){for(oe=new Map;se!==null;)se.key!==null?oe.set(se.key,se):oe.set(se.index,se),se=se.sibling;return oe}function x(oe,se){return oe=ur(oe,se),oe.index=0,oe.sibling=null,oe}function M(oe,se,ae){return oe.index=ae,e?(ae=oe.alternate,ae!==null?(ae=ae.index,ae<se?(oe.flags|=2,se):ae):(oe.flags|=2,se)):(oe.flags|=1048576,se)}function U(oe){return e&&oe.alternate===null&&(oe.flags|=2),oe}function X(oe,se,ae,ve){return se===null||se.tag!==6?(se=gl(ae,oe.mode,ve),se.return=oe,se):(se=x(se,ae),se.return=oe,se)}function te(oe,se,ae,ve){var Pe=ae.type;return Pe===A?me(oe,se,ae.props.children,ve,ae.key):se!==null&&(se.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===Z&&yu(Pe)===se.type)?(ve=x(se,ae.props),ve.ref=Ws(oe,se,ae),ve.return=oe,ve):(ve=vo(ae.type,ae.key,ae.props,null,oe.mode,ve),ve.ref=Ws(oe,se,ae),ve.return=oe,ve)}function ce(oe,se,ae,ve){return se===null||se.tag!==4||se.stateNode.containerInfo!==ae.containerInfo||se.stateNode.implementation!==ae.implementation?(se=_l(ae,oe.mode,ve),se.return=oe,se):(se=x(se,ae.children||[]),se.return=oe,se)}function me(oe,se,ae,ve,Pe){return se===null||se.tag!==7?(se=Pr(ae,oe.mode,ve,Pe),se.return=oe,se):(se=x(se,ae),se.return=oe,se)}function ge(oe,se,ae){if(typeof se=="string"&&se!==""||typeof se=="number")return se=gl(""+se,oe.mode,ae),se.return=oe,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case R:return ae=vo(se.type,se.key,se.props,null,oe.mode,ae),ae.ref=Ws(oe,null,se),ae.return=oe,ae;case k:return se=_l(se,oe.mode,ae),se.return=oe,se;case Z:var ve=se._init;return ge(oe,ve(se._payload),ae)}if(De(se)||P(se))return se=Pr(se,oe.mode,ae,null),se.return=oe,se;Ki(oe,se)}return null}function pe(oe,se,ae,ve){var Pe=se!==null?se.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return Pe!==null?null:X(oe,se,""+ae,ve);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===Pe?te(oe,se,ae,ve):null;case k:return ae.key===Pe?ce(oe,se,ae,ve):null;case Z:return Pe=ae._init,pe(oe,se,Pe(ae._payload),ve)}if(De(ae)||P(ae))return Pe!==null?null:me(oe,se,ae,ve,null);Ki(oe,ae)}return null}function xe(oe,se,ae,ve,Pe){if(typeof ve=="string"&&ve!==""||typeof ve=="number")return oe=oe.get(ae)||null,X(se,oe,""+ve,Pe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case R:return oe=oe.get(ve.key===null?ae:ve.key)||null,te(se,oe,ve,Pe);case k:return oe=oe.get(ve.key===null?ae:ve.key)||null,ce(se,oe,ve,Pe);case Z:var Fe=ve._init;return xe(oe,se,ae,Fe(ve._payload),Pe)}if(De(ve)||P(ve))return oe=oe.get(ae)||null,me(se,oe,ve,Pe,null);Ki(se,ve)}return null}function Re(oe,se,ae,ve){for(var Pe=null,Fe=null,He=se,qe=se=0,Tt=null;He!==null&&qe<ae.length;qe++){He.index>qe?(Tt=He,He=null):Tt=He.sibling;var rt=pe(oe,He,ae[qe],ve);if(rt===null){He===null&&(He=Tt);break}e&&He&&rt.alternate===null&&t(oe,He),se=M(rt,se,qe),Fe===null?Pe=rt:Fe.sibling=rt,Fe=rt,He=Tt}if(qe===ae.length)return s(oe,He),pt&&Lr(oe,qe),Pe;if(He===null){for(;qe<ae.length;qe++)He=ge(oe,ae[qe],ve),He!==null&&(se=M(He,se,qe),Fe===null?Pe=He:Fe.sibling=He,Fe=He);return pt&&Lr(oe,qe),Pe}for(He=p(oe,He);qe<ae.length;qe++)Tt=xe(He,oe,qe,ae[qe],ve),Tt!==null&&(e&&Tt.alternate!==null&&He.delete(Tt.key===null?qe:Tt.key),se=M(Tt,se,qe),Fe===null?Pe=Tt:Fe.sibling=Tt,Fe=Tt);return e&&He.forEach(function(hr){return t(oe,hr)}),pt&&Lr(oe,qe),Pe}function Ie(oe,se,ae,ve){var Pe=P(ae);if(typeof Pe!="function")throw Error(c(150));if(ae=Pe.call(ae),ae==null)throw Error(c(151));for(var Fe=Pe=null,He=se,qe=se=0,Tt=null,rt=ae.next();He!==null&&!rt.done;qe++,rt=ae.next()){He.index>qe?(Tt=He,He=null):Tt=He.sibling;var hr=pe(oe,He,rt.value,ve);if(hr===null){He===null&&(He=Tt);break}e&&He&&hr.alternate===null&&t(oe,He),se=M(hr,se,qe),Fe===null?Pe=hr:Fe.sibling=hr,Fe=hr,He=Tt}if(rt.done)return s(oe,He),pt&&Lr(oe,qe),Pe;if(He===null){for(;!rt.done;qe++,rt=ae.next())rt=ge(oe,rt.value,ve),rt!==null&&(se=M(rt,se,qe),Fe===null?Pe=rt:Fe.sibling=rt,Fe=rt);return pt&&Lr(oe,qe),Pe}for(He=p(oe,He);!rt.done;qe++,rt=ae.next())rt=xe(He,oe,qe,rt.value,ve),rt!==null&&(e&&rt.alternate!==null&&He.delete(rt.key===null?qe:rt.key),se=M(rt,se,qe),Fe===null?Pe=rt:Fe.sibling=rt,Fe=rt);return e&&He.forEach(function(zm){return t(oe,zm)}),pt&&Lr(oe,qe),Pe}function wt(oe,se,ae,ve){if(typeof ae=="object"&&ae!==null&&ae.type===A&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:e:{for(var Pe=ae.key,Fe=se;Fe!==null;){if(Fe.key===Pe){if(Pe=ae.type,Pe===A){if(Fe.tag===7){s(oe,Fe.sibling),se=x(Fe,ae.props.children),se.return=oe,oe=se;break e}}else if(Fe.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===Z&&yu(Pe)===Fe.type){s(oe,Fe.sibling),se=x(Fe,ae.props),se.ref=Ws(oe,Fe,ae),se.return=oe,oe=se;break e}s(oe,Fe);break}else t(oe,Fe);Fe=Fe.sibling}ae.type===A?(se=Pr(ae.props.children,oe.mode,ve,ae.key),se.return=oe,oe=se):(ve=vo(ae.type,ae.key,ae.props,null,oe.mode,ve),ve.ref=Ws(oe,se,ae),ve.return=oe,oe=ve)}return U(oe);case k:e:{for(Fe=ae.key;se!==null;){if(se.key===Fe)if(se.tag===4&&se.stateNode.containerInfo===ae.containerInfo&&se.stateNode.implementation===ae.implementation){s(oe,se.sibling),se=x(se,ae.children||[]),se.return=oe,oe=se;break e}else{s(oe,se);break}else t(oe,se);se=se.sibling}se=_l(ae,oe.mode,ve),se.return=oe,oe=se}return U(oe);case Z:return Fe=ae._init,wt(oe,se,Fe(ae._payload),ve)}if(De(ae))return Re(oe,se,ae,ve);if(P(ae))return Ie(oe,se,ae,ve);Ki(oe,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,se!==null&&se.tag===6?(s(oe,se.sibling),se=x(se,ae),se.return=oe,oe=se):(s(oe,se),se=gl(ae,oe.mode,ve),se.return=oe,oe=se),U(oe)):s(oe,se)}return wt}var ts=wu(!0),Su=wu(!1),Gi=er(null),Xi=null,ns=null,Ea=null;function La(){Ea=ns=Xi=null}function Ta(e){var t=Gi.current;dt(Gi),e._currentValue=t}function Ra(e,t,s){for(;e!==null;){var p=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,p!==null&&(p.childLanes|=t)):p!==null&&(p.childLanes&t)!==t&&(p.childLanes|=t),e===s)break;e=e.return}}function rs(e,t){Xi=e,Ea=ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(qt=!0),e.firstContext=null)}function ln(e){var t=e._currentValue;if(Ea!==e)if(e={context:e,memoizedValue:t,next:null},ns===null){if(Xi===null)throw Error(c(308));ns=e,Xi.dependencies={lanes:0,firstContext:e}}else ns=ns.next=e;return t}var Tr=null;function Ma(e){Tr===null?Tr=[e]:Tr.push(e)}function Cu(e,t,s,p){var x=t.interleaved;return x===null?(s.next=s,Ma(t)):(s.next=x.next,x.next=s),t.interleaved=s,zn(e,p)}function zn(e,t){e.lanes|=t;var s=e.alternate;for(s!==null&&(s.lanes|=t),s=e,e=e.return;e!==null;)e.childLanes|=t,s=e.alternate,s!==null&&(s.childLanes|=t),s=e,e=e.return;return s.tag===3?s.stateNode:null}var rr=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bu(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 qn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function sr(e,t,s){var p=e.updateQueue;if(p===null)return null;if(p=p.shared,(et&2)!==0){var x=p.pending;return x===null?t.next=t:(t.next=x.next,x.next=t),p.pending=t,zn(e,s)}return x=p.interleaved,x===null?(t.next=t,Ma(p)):(t.next=x.next,x.next=t),p.interleaved=t,zn(e,s)}function Yi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194240)!==0)){var p=t.lanes;p&=e.pendingLanes,s|=p,t.lanes=s,Rn(e,s)}}function xu(e,t){var s=e.updateQueue,p=e.alternate;if(p!==null&&(p=p.updateQueue,s===p)){var x=null,M=null;if(s=s.firstBaseUpdate,s!==null){do{var U={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};M===null?x=M=U:M=M.next=U,s=s.next}while(s!==null);M===null?x=M=t:M=M.next=t}else x=M=t;s={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:M,shared:p.shared,effects:p.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}function Qi(e,t,s,p){var x=e.updateQueue;rr=!1;var M=x.firstBaseUpdate,U=x.lastBaseUpdate,X=x.shared.pending;if(X!==null){x.shared.pending=null;var te=X,ce=te.next;te.next=null,U===null?M=ce:U.next=ce,U=te;var me=e.alternate;me!==null&&(me=me.updateQueue,X=me.lastBaseUpdate,X!==U&&(X===null?me.firstBaseUpdate=ce:X.next=ce,me.lastBaseUpdate=te))}if(M!==null){var ge=x.baseState;U=0,me=ce=te=null,X=M;do{var pe=X.lane,xe=X.eventTime;if((p&pe)===pe){me!==null&&(me=me.next={eventTime:xe,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var Re=e,Ie=X;switch(pe=t,xe=s,Ie.tag){case 1:if(Re=Ie.payload,typeof Re=="function"){ge=Re.call(xe,ge,pe);break e}ge=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ie.payload,pe=typeof Re=="function"?Re.call(xe,ge,pe):Re,pe==null)break e;ge=$({},ge,pe);break e;case 2:rr=!0}}X.callback!==null&&X.lane!==0&&(e.flags|=64,pe=x.effects,pe===null?x.effects=[X]:pe.push(X))}else xe={eventTime:xe,lane:pe,tag:X.tag,payload:X.payload,callback:X.callback,next:null},me===null?(ce=me=xe,te=ge):me=me.next=xe,U|=pe;if(X=X.next,X===null){if(X=x.shared.pending,X===null)break;pe=X,X=pe.next,pe.next=null,x.lastBaseUpdate=pe,x.shared.pending=null}}while(!0);if(me===null&&(te=ge),x.baseState=te,x.firstBaseUpdate=ce,x.lastBaseUpdate=me,t=x.shared.interleaved,t!==null){x=t;do U|=x.lane,x=x.next;while(x!==t)}else M===null&&(x.shared.lanes=0);Ar|=U,e.lanes=U,e.memoizedState=ge}}function ku(e,t,s){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var p=e[t],x=p.callback;if(x!==null){if(p.callback=null,p=s,typeof x!="function")throw Error(c(191,x));x.call(p)}}}var Us={},Dn=er(Us),zs=er(Us),qs=er(Us);function Rr(e){if(e===Us)throw Error(c(174));return e}function Da(e,t){switch(ut(qs,t),ut(zs,e),ut(Dn,Us),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:St(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=St(t,e)}dt(Dn),ut(Dn,t)}function ss(){dt(Dn),dt(zs),dt(qs)}function Eu(e){Rr(qs.current);var t=Rr(Dn.current),s=St(t,e.type);t!==s&&(ut(zs,e),ut(Dn,s))}function Ia(e){zs.current===e&&(dt(Dn),dt(zs))}var gt=er(0);function Ji(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Na=[];function Pa(){for(var e=0;e<Na.length;e++)Na[e]._workInProgressVersionPrimary=null;Na.length=0}var Zi=w.ReactCurrentDispatcher,Oa=w.ReactCurrentBatchConfig,Mr=0,_t=null,bt=null,Et=null,eo=!1,Vs=!1,Ks=0,dm=0;function It(){throw Error(c(321))}function ja(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!_n(e[s],t[s]))return!1;return!0}function Ba(e,t,s,p,x,M){if(Mr=M,_t=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Zi.current=e===null||e.memoizedState===null?gm:_m,e=s(p,x),Vs){M=0;do{if(Vs=!1,Ks=0,25<=M)throw Error(c(301));M+=1,Et=bt=null,t.updateQueue=null,Zi.current=vm,e=s(p,x)}while(Vs)}if(Zi.current=ro,t=bt!==null&&bt.next!==null,Mr=0,Et=bt=_t=null,eo=!1,t)throw Error(c(300));return e}function Fa(){var e=Ks!==0;return Ks=0,e}function In(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?_t.memoizedState=Et=e:Et=Et.next=e,Et}function cn(){if(bt===null){var e=_t.alternate;e=e!==null?e.memoizedState:null}else e=bt.next;var t=Et===null?_t.memoizedState:Et.next;if(t!==null)Et=t,bt=e;else{if(e===null)throw Error(c(310));bt=e,e={memoizedState:bt.memoizedState,baseState:bt.baseState,baseQueue:bt.baseQueue,queue:bt.queue,next:null},Et===null?_t.memoizedState=Et=e:Et=Et.next=e}return Et}function Gs(e,t){return typeof t=="function"?t(e):t}function Ha(e){var t=cn(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var p=bt,x=p.baseQueue,M=s.pending;if(M!==null){if(x!==null){var U=x.next;x.next=M.next,M.next=U}p.baseQueue=x=M,s.pending=null}if(x!==null){M=x.next,p=p.baseState;var X=U=null,te=null,ce=M;do{var me=ce.lane;if((Mr&me)===me)te!==null&&(te=te.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),p=ce.hasEagerState?ce.eagerState:e(p,ce.action);else{var ge={lane:me,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};te===null?(X=te=ge,U=p):te=te.next=ge,_t.lanes|=me,Ar|=me}ce=ce.next}while(ce!==null&&ce!==M);te===null?U=p:te.next=X,_n(p,t.memoizedState)||(qt=!0),t.memoizedState=p,t.baseState=U,t.baseQueue=te,s.lastRenderedState=p}if(e=s.interleaved,e!==null){x=e;do M=x.lane,_t.lanes|=M,Ar|=M,x=x.next;while(x!==e)}else x===null&&(s.lanes=0);return[t.memoizedState,s.dispatch]}function $a(e){var t=cn(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var p=s.dispatch,x=s.pending,M=t.memoizedState;if(x!==null){s.pending=null;var U=x=x.next;do M=e(M,U.action),U=U.next;while(U!==x);_n(M,t.memoizedState)||(qt=!0),t.memoizedState=M,t.baseQueue===null&&(t.baseState=M),s.lastRenderedState=M}return[M,p]}function Lu(){}function Tu(e,t){var s=_t,p=cn(),x=t(),M=!_n(p.memoizedState,x);if(M&&(p.memoizedState=x,qt=!0),p=p.queue,Wa(Au.bind(null,s,p,e),[e]),p.getSnapshot!==t||M||Et!==null&&Et.memoizedState.tag&1){if(s.flags|=2048,Xs(9,Mu.bind(null,s,p,x,t),void 0,null),Lt===null)throw Error(c(349));(Mr&30)!==0||Ru(s,t,x)}return x}function Ru(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Mu(e,t,s,p){t.value=s,t.getSnapshot=p,Du(t)&&Iu(e)}function Au(e,t,s){return s(function(){Du(t)&&Iu(e)})}function Du(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!_n(e,s)}catch{return!0}}function Iu(e){var t=zn(e,1);t!==null&&Cn(t,e,1,-1)}function Nu(e){var t=In();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Gs,lastRenderedState:e},t.queue=e,e=e.dispatch=mm.bind(null,_t,e),[t.memoizedState,e]}function Xs(e,t,s,p){return e={tag:e,create:t,destroy:s,deps:p,next:null},t=_t.updateQueue,t===null?(t={lastEffect:null,stores:null},_t.updateQueue=t,t.lastEffect=e.next=e):(s=t.lastEffect,s===null?t.lastEffect=e.next=e:(p=s.next,s.next=e,e.next=p,t.lastEffect=e)),e}function Pu(){return cn().memoizedState}function to(e,t,s,p){var x=In();_t.flags|=e,x.memoizedState=Xs(1|t,s,void 0,p===void 0?null:p)}function no(e,t,s,p){var x=cn();p=p===void 0?null:p;var M=void 0;if(bt!==null){var U=bt.memoizedState;if(M=U.destroy,p!==null&&ja(p,U.deps)){x.memoizedState=Xs(t,s,M,p);return}}_t.flags|=e,x.memoizedState=Xs(1|t,s,M,p)}function Ou(e,t){return to(8390656,8,e,t)}function Wa(e,t){return no(2048,8,e,t)}function ju(e,t){return no(4,2,e,t)}function Bu(e,t){return no(4,4,e,t)}function Fu(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 Hu(e,t,s){return s=s!=null?s.concat([e]):null,no(4,4,Fu.bind(null,t,e),s)}function Ua(){}function $u(e,t){var s=cn();t=t===void 0?null:t;var p=s.memoizedState;return p!==null&&t!==null&&ja(t,p[1])?p[0]:(s.memoizedState=[e,t],e)}function Wu(e,t){var s=cn();t=t===void 0?null:t;var p=s.memoizedState;return p!==null&&t!==null&&ja(t,p[1])?p[0]:(e=e(),s.memoizedState=[e,t],e)}function Uu(e,t,s){return(Mr&21)===0?(e.baseState&&(e.baseState=!1,qt=!0),e.memoizedState=s):(_n(s,t)||(s=Si(),_t.lanes|=s,Ar|=s,e.baseState=!0),t)}function fm(e,t){var s=it;it=s!==0&&4>s?s:4,e(!0);var p=Oa.transition;Oa.transition={};try{e(!1),t()}finally{it=s,Oa.transition=p}}function zu(){return cn().memoizedState}function pm(e,t,s){var p=lr(e);if(s={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null},qu(e))Vu(t,s);else if(s=Cu(e,t,s,p),s!==null){var x=Ht();Cn(s,e,p,x),Ku(s,t,p)}}function mm(e,t,s){var p=lr(e),x={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null};if(qu(e))Vu(t,x);else{var M=e.alternate;if(e.lanes===0&&(M===null||M.lanes===0)&&(M=t.lastRenderedReducer,M!==null))try{var U=t.lastRenderedState,X=M(U,s);if(x.hasEagerState=!0,x.eagerState=X,_n(X,U)){var te=t.interleaved;te===null?(x.next=x,Ma(t)):(x.next=te.next,te.next=x),t.interleaved=x;return}}catch{}finally{}s=Cu(e,t,x,p),s!==null&&(x=Ht(),Cn(s,e,p,x),Ku(s,t,p))}}function qu(e){var t=e.alternate;return e===_t||t!==null&&t===_t}function Vu(e,t){Vs=eo=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Ku(e,t,s){if((s&4194240)!==0){var p=t.lanes;p&=e.pendingLanes,s|=p,t.lanes=s,Rn(e,s)}}var ro={readContext:ln,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useInsertionEffect:It,useLayoutEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useMutableSource:It,useSyncExternalStore:It,useId:It,unstable_isNewReconciler:!1},gm={readContext:ln,useCallback:function(e,t){return In().memoizedState=[e,t===void 0?null:t],e},useContext:ln,useEffect:Ou,useImperativeHandle:function(e,t,s){return s=s!=null?s.concat([e]):null,to(4194308,4,Fu.bind(null,t,e),s)},useLayoutEffect:function(e,t){return to(4194308,4,e,t)},useInsertionEffect:function(e,t){return to(4,2,e,t)},useMemo:function(e,t){var s=In();return t=t===void 0?null:t,e=e(),s.memoizedState=[e,t],e},useReducer:function(e,t,s){var p=In();return t=s!==void 0?s(t):t,p.memoizedState=p.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},p.queue=e,e=e.dispatch=pm.bind(null,_t,e),[p.memoizedState,e]},useRef:function(e){var t=In();return e={current:e},t.memoizedState=e},useState:Nu,useDebugValue:Ua,useDeferredValue:function(e){return In().memoizedState=e},useTransition:function(){var e=Nu(!1),t=e[0];return e=fm.bind(null,e[1]),In().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,s){var p=_t,x=In();if(pt){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),Lt===null)throw Error(c(349));(Mr&30)!==0||Ru(p,t,s)}x.memoizedState=s;var M={value:s,getSnapshot:t};return x.queue=M,Ou(Au.bind(null,p,M,e),[e]),p.flags|=2048,Xs(9,Mu.bind(null,p,M,s,t),void 0,null),s},useId:function(){var e=In(),t=Lt.identifierPrefix;if(pt){var s=Un,p=Wn;s=(p&~(1<<32-Yt(p)-1)).toString(32)+s,t=":"+t+"R"+s,s=Ks++,0<s&&(t+="H"+s.toString(32)),t+=":"}else s=dm++,t=":"+t+"r"+s.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_m={readContext:ln,useCallback:$u,useContext:ln,useEffect:Wa,useImperativeHandle:Hu,useInsertionEffect:ju,useLayoutEffect:Bu,useMemo:Wu,useReducer:Ha,useRef:Pu,useState:function(){return Ha(Gs)},useDebugValue:Ua,useDeferredValue:function(e){var t=cn();return Uu(t,bt.memoizedState,e)},useTransition:function(){var e=Ha(Gs)[0],t=cn().memoizedState;return[e,t]},useMutableSource:Lu,useSyncExternalStore:Tu,useId:zu,unstable_isNewReconciler:!1},vm={readContext:ln,useCallback:$u,useContext:ln,useEffect:Wa,useImperativeHandle:Hu,useInsertionEffect:ju,useLayoutEffect:Bu,useMemo:Wu,useReducer:$a,useRef:Pu,useState:function(){return $a(Gs)},useDebugValue:Ua,useDeferredValue:function(e){var t=cn();return bt===null?t.memoizedState=e:Uu(t,bt.memoizedState,e)},useTransition:function(){var e=$a(Gs)[0],t=cn().memoizedState;return[e,t]},useMutableSource:Lu,useSyncExternalStore:Tu,useId:zu,unstable_isNewReconciler:!1};function yn(e,t){if(e&&e.defaultProps){t=$({},t),e=e.defaultProps;for(var s in e)t[s]===void 0&&(t[s]=e[s]);return t}return t}function za(e,t,s,p){t=e.memoizedState,s=s(p,t),s=s==null?t:$({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var so={isMounted:function(e){return(e=e._reactInternals)?Fn(e)===e:!1},enqueueSetState:function(e,t,s){e=e._reactInternals;var p=Ht(),x=lr(e),M=qn(p,x);M.payload=t,s!=null&&(M.callback=s),t=sr(e,M,x),t!==null&&(Cn(t,e,x,p),Yi(t,e,x))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var p=Ht(),x=lr(e),M=qn(p,x);M.tag=1,M.payload=t,s!=null&&(M.callback=s),t=sr(e,M,x),t!==null&&(Cn(t,e,x,p),Yi(t,e,x))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Ht(),p=lr(e),x=qn(s,p);x.tag=2,t!=null&&(x.callback=t),t=sr(e,x,p),t!==null&&(Cn(t,e,p,s),Yi(t,e,p))}};function Gu(e,t,s,p,x,M,U){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(p,M,U):t.prototype&&t.prototype.isPureReactComponent?!Ps(s,p)||!Ps(x,M):!0}function Xu(e,t,s){var p=!1,x=tr,M=t.contextType;return typeof M=="object"&&M!==null?M=ln(M):(x=zt(t)?kr:Dt.current,p=t.contextTypes,M=(p=p!=null)?Qr(e,x):tr),t=new t(s,M),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=so,e.stateNode=t,t._reactInternals=e,p&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=x,e.__reactInternalMemoizedMaskedChildContext=M),t}function Yu(e,t,s,p){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,p),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,p),t.state!==e&&so.enqueueReplaceState(t,t.state,null)}function qa(e,t,s,p){var x=e.stateNode;x.props=s,x.state=e.memoizedState,x.refs={},Aa(e);var M=t.contextType;typeof M=="object"&&M!==null?x.context=ln(M):(M=zt(t)?kr:Dt.current,x.context=Qr(e,M)),x.state=e.memoizedState,M=t.getDerivedStateFromProps,typeof M=="function"&&(za(e,t,M,s),x.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(t=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),t!==x.state&&so.enqueueReplaceState(x,x.state,null),Qi(e,s,x,p),x.state=e.memoizedState),typeof x.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var s="",p=t;do s+=ie(p),p=p.return;while(p);var x=s}catch(M){x=`
|
|
39
|
+
Error generating stack: `+M.message+`
|
|
40
|
+
`+M.stack}return{value:e,source:t,stack:x,digest:null}}function Va(e,t,s){return{value:e,source:null,stack:s??null,digest:t??null}}function Ka(e,t){try{console.error(t.value)}catch(s){setTimeout(function(){throw s})}}var ym=typeof WeakMap=="function"?WeakMap:Map;function Qu(e,t,s){s=qn(-1,s),s.tag=3,s.payload={element:null};var p=t.value;return s.callback=function(){ho||(ho=!0,ll=p),Ka(e,t)},s}function Ju(e,t,s){s=qn(-1,s),s.tag=3;var p=e.type.getDerivedStateFromError;if(typeof p=="function"){var x=t.value;s.payload=function(){return p(x)},s.callback=function(){Ka(e,t)}}var M=e.stateNode;return M!==null&&typeof M.componentDidCatch=="function"&&(s.callback=function(){Ka(e,t),typeof p!="function"&&(or===null?or=new Set([this]):or.add(this));var U=t.stack;this.componentDidCatch(t.value,{componentStack:U!==null?U:""})}),s}function Zu(e,t,s){var p=e.pingCache;if(p===null){p=e.pingCache=new ym;var x=new Set;p.set(t,x)}else x=p.get(t),x===void 0&&(x=new Set,p.set(t,x));x.has(s)||(x.add(s),e=Im.bind(null,e,t,s),t.then(e,e))}function eh(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 th(e,t,s,p,x){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(t=qn(-1,1),t.tag=2,sr(s,t,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=x,e)}var wm=w.ReactCurrentOwner,qt=!1;function Ft(e,t,s,p){t.child=e===null?Su(t,null,s,p):ts(t,e.child,s,p)}function nh(e,t,s,p,x){s=s.render;var M=t.ref;return rs(t,x),p=Ba(e,t,s,p,M,x),s=Fa(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~x,Vn(e,t,x)):(pt&&s&&Sa(t),t.flags|=1,Ft(e,t,p,x),t.child)}function rh(e,t,s,p,x){if(e===null){var M=s.type;return typeof M=="function"&&!ml(M)&&M.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(t.tag=15,t.type=M,sh(e,t,M,p,x)):(e=vo(s.type,null,p,t,t.mode,x),e.ref=t.ref,e.return=t,t.child=e)}if(M=e.child,(e.lanes&x)===0){var U=M.memoizedProps;if(s=s.compare,s=s!==null?s:Ps,s(U,p)&&e.ref===t.ref)return Vn(e,t,x)}return t.flags|=1,e=ur(M,p),e.ref=t.ref,e.return=t,t.child=e}function sh(e,t,s,p,x){if(e!==null){var M=e.memoizedProps;if(Ps(M,p)&&e.ref===t.ref)if(qt=!1,t.pendingProps=p=M,(e.lanes&x)!==0)(e.flags&131072)!==0&&(qt=!0);else return t.lanes=e.lanes,Vn(e,t,x)}return Ga(e,t,s,p,x)}function ih(e,t,s){var p=t.pendingProps,x=p.children,M=e!==null?e.memoizedState:null;if(p.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ut(as,tn),tn|=s;else{if((s&1073741824)===0)return e=M!==null?M.baseLanes|s:s,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ut(as,tn),tn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},p=M!==null?M.baseLanes:s,ut(as,tn),tn|=p}else M!==null?(p=M.baseLanes|s,t.memoizedState=null):p=s,ut(as,tn),tn|=p;return Ft(e,t,x,s),t.child}function oh(e,t){var s=t.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(t.flags|=512,t.flags|=2097152)}function Ga(e,t,s,p,x){var M=zt(s)?kr:Dt.current;return M=Qr(t,M),rs(t,x),s=Ba(e,t,s,p,M,x),p=Fa(),e!==null&&!qt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~x,Vn(e,t,x)):(pt&&p&&Sa(t),t.flags|=1,Ft(e,t,s,x),t.child)}function ah(e,t,s,p,x){if(zt(s)){var M=!0;Wi(t)}else M=!1;if(rs(t,x),t.stateNode===null)oo(e,t),Xu(t,s,p),qa(t,s,p,x),p=!0;else if(e===null){var U=t.stateNode,X=t.memoizedProps;U.props=X;var te=U.context,ce=s.contextType;typeof ce=="object"&&ce!==null?ce=ln(ce):(ce=zt(s)?kr:Dt.current,ce=Qr(t,ce));var me=s.getDerivedStateFromProps,ge=typeof me=="function"||typeof U.getSnapshotBeforeUpdate=="function";ge||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(X!==p||te!==ce)&&Yu(t,U,p,ce),rr=!1;var pe=t.memoizedState;U.state=pe,Qi(t,p,U,x),te=t.memoizedState,X!==p||pe!==te||Ut.current||rr?(typeof me=="function"&&(za(t,s,me,p),te=t.memoizedState),(X=rr||Gu(t,s,X,p,pe,te,ce))?(ge||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(t.flags|=4194308)):(typeof U.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=p,t.memoizedState=te),U.props=p,U.state=te,U.context=ce,p=X):(typeof U.componentDidMount=="function"&&(t.flags|=4194308),p=!1)}else{U=t.stateNode,bu(e,t),X=t.memoizedProps,ce=t.type===t.elementType?X:yn(t.type,X),U.props=ce,ge=t.pendingProps,pe=U.context,te=s.contextType,typeof te=="object"&&te!==null?te=ln(te):(te=zt(s)?kr:Dt.current,te=Qr(t,te));var xe=s.getDerivedStateFromProps;(me=typeof xe=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(X!==ge||pe!==te)&&Yu(t,U,p,te),rr=!1,pe=t.memoizedState,U.state=pe,Qi(t,p,U,x);var Re=t.memoizedState;X!==ge||pe!==Re||Ut.current||rr?(typeof xe=="function"&&(za(t,s,xe,p),Re=t.memoizedState),(ce=rr||Gu(t,s,ce,p,pe,Re,te)||!1)?(me||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(p,Re,te),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(p,Re,te)),typeof U.componentDidUpdate=="function"&&(t.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof U.componentDidUpdate!="function"||X===e.memoizedProps&&pe===e.memoizedState||(t.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||X===e.memoizedProps&&pe===e.memoizedState||(t.flags|=1024),t.memoizedProps=p,t.memoizedState=Re),U.props=p,U.state=Re,U.context=te,p=ce):(typeof U.componentDidUpdate!="function"||X===e.memoizedProps&&pe===e.memoizedState||(t.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||X===e.memoizedProps&&pe===e.memoizedState||(t.flags|=1024),p=!1)}return Xa(e,t,s,p,M,x)}function Xa(e,t,s,p,x,M){oh(e,t);var U=(t.flags&128)!==0;if(!p&&!U)return x&&du(t,s,!1),Vn(e,t,M);p=t.stateNode,wm.current=t;var X=U&&typeof s.getDerivedStateFromError!="function"?null:p.render();return t.flags|=1,e!==null&&U?(t.child=ts(t,e.child,null,M),t.child=ts(t,null,X,M)):Ft(e,t,X,M),t.memoizedState=p.state,x&&du(t,s,!0),t.child}function lh(e){var t=e.stateNode;t.pendingContext?uu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&uu(e,t.context,!1),Da(e,t.containerInfo)}function ch(e,t,s,p,x){return es(),ka(x),t.flags|=256,Ft(e,t,s,p),t.child}var Ya={dehydrated:null,treeContext:null,retryLane:0};function Qa(e){return{baseLanes:e,cachePool:null,transitions:null}}function uh(e,t,s){var p=t.pendingProps,x=gt.current,M=!1,U=(t.flags&128)!==0,X;if((X=U)||(X=e!==null&&e.memoizedState===null?!1:(x&2)!==0),X?(M=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(x|=1),ut(gt,x&1),e===null)return xa(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):(U=p.children,e=p.fallback,M?(p=t.mode,M=t.child,U={mode:"hidden",children:U},(p&1)===0&&M!==null?(M.childLanes=0,M.pendingProps=U):M=yo(U,p,0,null),e=Pr(e,p,s,null),M.return=t,e.return=t,M.sibling=e,t.child=M,t.child.memoizedState=Qa(s),t.memoizedState=Ya,e):Ja(t,U));if(x=e.memoizedState,x!==null&&(X=x.dehydrated,X!==null))return Sm(e,t,U,p,X,x,s);if(M){M=p.fallback,U=t.mode,x=e.child,X=x.sibling;var te={mode:"hidden",children:p.children};return(U&1)===0&&t.child!==x?(p=t.child,p.childLanes=0,p.pendingProps=te,t.deletions=null):(p=ur(x,te),p.subtreeFlags=x.subtreeFlags&14680064),X!==null?M=ur(X,M):(M=Pr(M,U,s,null),M.flags|=2),M.return=t,p.return=t,p.sibling=M,t.child=p,p=M,M=t.child,U=e.child.memoizedState,U=U===null?Qa(s):{baseLanes:U.baseLanes|s,cachePool:null,transitions:U.transitions},M.memoizedState=U,M.childLanes=e.childLanes&~s,t.memoizedState=Ya,p}return M=e.child,e=M.sibling,p=ur(M,{mode:"visible",children:p.children}),(t.mode&1)===0&&(p.lanes=s),p.return=t,p.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=p,t.memoizedState=null,p}function Ja(e,t){return t=yo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function io(e,t,s,p){return p!==null&&ka(p),ts(t,e.child,null,s),e=Ja(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sm(e,t,s,p,x,M,U){if(s)return t.flags&256?(t.flags&=-257,p=Va(Error(c(422))),io(e,t,U,p)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(M=p.fallback,x=t.mode,p=yo({mode:"visible",children:p.children},x,0,null),M=Pr(M,x,U,null),M.flags|=2,p.return=t,M.return=t,p.sibling=M,t.child=p,(t.mode&1)!==0&&ts(t,e.child,null,U),t.child.memoizedState=Qa(U),t.memoizedState=Ya,M);if((t.mode&1)===0)return io(e,t,U,null);if(x.data==="$!"){if(p=x.nextSibling&&x.nextSibling.dataset,p)var X=p.dgst;return p=X,M=Error(c(419)),p=Va(M,p,void 0),io(e,t,U,p)}if(X=(U&e.childLanes)!==0,qt||X){if(p=Lt,p!==null){switch(U&-U){case 4:x=2;break;case 16:x=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:x=32;break;case 536870912:x=268435456;break;default:x=0}x=(x&(p.suspendedLanes|U))!==0?0:x,x!==0&&x!==M.retryLane&&(M.retryLane=x,zn(e,x),Cn(p,e,x,-1))}return pl(),p=Va(Error(c(421))),io(e,t,U,p)}return x.data==="$?"?(t.flags|=128,t.child=e.child,t=Nm.bind(null,e),x._reactRetry=t,null):(e=M.treeContext,en=Zn(x.nextSibling),Zt=t,pt=!0,vn=null,e!==null&&(on[an++]=Wn,on[an++]=Un,on[an++]=Er,Wn=e.id,Un=e.overflow,Er=t),t=Ja(t,p.children),t.flags|=4096,t)}function hh(e,t,s){e.lanes|=t;var p=e.alternate;p!==null&&(p.lanes|=t),Ra(e.return,t,s)}function Za(e,t,s,p,x){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:p,tail:s,tailMode:x}:(M.isBackwards=t,M.rendering=null,M.renderingStartTime=0,M.last=p,M.tail=s,M.tailMode=x)}function dh(e,t,s){var p=t.pendingProps,x=p.revealOrder,M=p.tail;if(Ft(e,t,p.children,s),p=gt.current,(p&2)!==0)p=p&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&&hh(e,s,t);else if(e.tag===19)hh(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}p&=1}if(ut(gt,p),(t.mode&1)===0)t.memoizedState=null;else switch(x){case"forwards":for(s=t.child,x=null;s!==null;)e=s.alternate,e!==null&&Ji(e)===null&&(x=s),s=s.sibling;s=x,s===null?(x=t.child,t.child=null):(x=s.sibling,s.sibling=null),Za(t,!1,x,s,M);break;case"backwards":for(s=null,x=t.child,t.child=null;x!==null;){if(e=x.alternate,e!==null&&Ji(e)===null){t.child=x;break}e=x.sibling,x.sibling=s,s=x,x=e}Za(t,!0,s,null,M);break;case"together":Za(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Vn(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ar|=t.lanes,(s&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=ur(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=ur(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Cm(e,t,s){switch(t.tag){case 3:lh(t),es();break;case 5:Eu(t);break;case 1:zt(t.type)&&Wi(t);break;case 4:Da(t,t.stateNode.containerInfo);break;case 10:var p=t.type._context,x=t.memoizedProps.value;ut(Gi,p._currentValue),p._currentValue=x;break;case 13:if(p=t.memoizedState,p!==null)return p.dehydrated!==null?(ut(gt,gt.current&1),t.flags|=128,null):(s&t.child.childLanes)!==0?uh(e,t,s):(ut(gt,gt.current&1),e=Vn(e,t,s),e!==null?e.sibling:null);ut(gt,gt.current&1);break;case 19:if(p=(s&t.childLanes)!==0,(e.flags&128)!==0){if(p)return dh(e,t,s);t.flags|=128}if(x=t.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ut(gt,gt.current),p)break;return null;case 22:case 23:return t.lanes=0,ih(e,t,s)}return Vn(e,t,s)}var fh,el,ph,mh;fh=function(e,t){for(var s=t.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break;for(;s.sibling===null;){if(s.return===null||s.return===t)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},el=function(){},ph=function(e,t,s,p){var x=e.memoizedProps;if(x!==p){e=t.stateNode,Rr(Dn.current);var M=null;switch(s){case"input":x=ke(e,x),p=ke(e,p),M=[];break;case"select":x=$({},x,{value:void 0}),p=$({},p,{value:void 0}),M=[];break;case"textarea":x=je(e,x),p=je(e,p),M=[];break;default:typeof x.onClick!="function"&&typeof p.onClick=="function"&&(e.onclick=Fi)}Ke(s,p);var U;s=null;for(ce in x)if(!p.hasOwnProperty(ce)&&x.hasOwnProperty(ce)&&x[ce]!=null)if(ce==="style"){var X=x[ce];for(U in X)X.hasOwnProperty(U)&&(s||(s={}),s[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(E.hasOwnProperty(ce)?M||(M=[]):(M=M||[]).push(ce,null));for(ce in p){var te=p[ce];if(X=x!=null?x[ce]:void 0,p.hasOwnProperty(ce)&&te!==X&&(te!=null||X!=null))if(ce==="style")if(X){for(U in X)!X.hasOwnProperty(U)||te&&te.hasOwnProperty(U)||(s||(s={}),s[U]="");for(U in te)te.hasOwnProperty(U)&&X[U]!==te[U]&&(s||(s={}),s[U]=te[U])}else s||(M||(M=[]),M.push(ce,s)),s=te;else ce==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,X=X?X.__html:void 0,te!=null&&X!==te&&(M=M||[]).push(ce,te)):ce==="children"?typeof te!="string"&&typeof te!="number"||(M=M||[]).push(ce,""+te):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(E.hasOwnProperty(ce)?(te!=null&&ce==="onScroll"&&ht("scroll",e),M||X===te||(M=[])):(M=M||[]).push(ce,te))}s&&(M=M||[]).push("style",s);var ce=M;(t.updateQueue=ce)&&(t.flags|=4)}},mh=function(e,t,s,p){s!==p&&(t.flags|=4)};function Ys(e,t){if(!pt)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var p=null;s!==null;)s.alternate!==null&&(p=s),s=s.sibling;p===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:p.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,p=0;if(t)for(var x=e.child;x!==null;)s|=x.lanes|x.childLanes,p|=x.subtreeFlags&14680064,p|=x.flags&14680064,x.return=e,x=x.sibling;else for(x=e.child;x!==null;)s|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=e,x=x.sibling;return e.subtreeFlags|=p,e.childLanes=s,t}function bm(e,t,s){var p=t.pendingProps;switch(Ca(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return zt(t.type)&&$i(),Nt(t),null;case 3:return p=t.stateNode,ss(),dt(Ut),dt(Dt),Pa(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vn!==null&&(hl(vn),vn=null))),el(e,t),Nt(t),null;case 5:Ia(t);var x=Rr(qs.current);if(s=t.type,e!==null&&t.stateNode!=null)ph(e,t,s,p,x),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!p){if(t.stateNode===null)throw Error(c(166));return Nt(t),null}if(e=Rr(Dn.current),Vi(t)){p=t.stateNode,s=t.type;var M=t.memoizedProps;switch(p[An]=t,p[Hs]=M,e=(t.mode&1)!==0,s){case"dialog":ht("cancel",p),ht("close",p);break;case"iframe":case"object":case"embed":ht("load",p);break;case"video":case"audio":for(x=0;x<js.length;x++)ht(js[x],p);break;case"source":ht("error",p);break;case"img":case"image":case"link":ht("error",p),ht("load",p);break;case"details":ht("toggle",p);break;case"input":$e(p,M),ht("invalid",p);break;case"select":p._wrapperState={wasMultiple:!!M.multiple},ht("invalid",p);break;case"textarea":_e(p,M),ht("invalid",p)}Ke(s,M),x=null;for(var U in M)if(M.hasOwnProperty(U)){var X=M[U];U==="children"?typeof X=="string"?p.textContent!==X&&(M.suppressHydrationWarning!==!0&&Bi(p.textContent,X,e),x=["children",X]):typeof X=="number"&&p.textContent!==""+X&&(M.suppressHydrationWarning!==!0&&Bi(p.textContent,X,e),x=["children",""+X]):E.hasOwnProperty(U)&&X!=null&&U==="onScroll"&&ht("scroll",p)}switch(s){case"input":de(p),ot(p,M,!0);break;case"textarea":de(p),Je(p);break;case"select":case"option":break;default:typeof M.onClick=="function"&&(p.onclick=Fi)}p=x,t.updateQueue=p,p!==null&&(t.flags|=4)}else{U=x.nodeType===9?x:x.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ze(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=U.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof p.is=="string"?e=U.createElement(s,{is:p.is}):(e=U.createElement(s),s==="select"&&(U=e,p.multiple?U.multiple=!0:p.size&&(U.size=p.size))):e=U.createElementNS(e,s),e[An]=t,e[Hs]=p,fh(e,t,!1,!1),t.stateNode=e;e:{switch(U=he(s,p),s){case"dialog":ht("cancel",e),ht("close",e),x=p;break;case"iframe":case"object":case"embed":ht("load",e),x=p;break;case"video":case"audio":for(x=0;x<js.length;x++)ht(js[x],e);x=p;break;case"source":ht("error",e),x=p;break;case"img":case"image":case"link":ht("error",e),ht("load",e),x=p;break;case"details":ht("toggle",e),x=p;break;case"input":$e(e,p),x=ke(e,p),ht("invalid",e);break;case"option":x=p;break;case"select":e._wrapperState={wasMultiple:!!p.multiple},x=$({},p,{value:void 0}),ht("invalid",e);break;case"textarea":_e(e,p),x=je(e,p),ht("invalid",e);break;default:x=p}Ke(s,x),X=x;for(M in X)if(X.hasOwnProperty(M)){var te=X[M];M==="style"?st(e,te):M==="dangerouslySetInnerHTML"?(te=te?te.__html:void 0,te!=null&<(e,te)):M==="children"?typeof te=="string"?(s!=="textarea"||te!=="")&&tt(e,te):typeof te=="number"&&tt(e,""+te):M!=="suppressContentEditableWarning"&&M!=="suppressHydrationWarning"&&M!=="autoFocus"&&(E.hasOwnProperty(M)?te!=null&&M==="onScroll"&&ht("scroll",e):te!=null&&d(e,M,te,U))}switch(s){case"input":de(e),ot(e,p,!1);break;case"textarea":de(e),Je(e);break;case"option":p.value!=null&&e.setAttribute("value",""+H(p.value));break;case"select":e.multiple=!!p.multiple,M=p.value,M!=null?Ce(e,!!p.multiple,M,!1):p.defaultValue!=null&&Ce(e,!!p.multiple,p.defaultValue,!0);break;default:typeof x.onClick=="function"&&(e.onclick=Fi)}switch(s){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}}p&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Nt(t),null;case 6:if(e&&t.stateNode!=null)mh(e,t,e.memoizedProps,p);else{if(typeof p!="string"&&t.stateNode===null)throw Error(c(166));if(s=Rr(qs.current),Rr(Dn.current),Vi(t)){if(p=t.stateNode,s=t.memoizedProps,p[An]=t,(M=p.nodeValue!==s)&&(e=Zt,e!==null))switch(e.tag){case 3:Bi(p.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Bi(p.nodeValue,s,(e.mode&1)!==0)}M&&(t.flags|=4)}else p=(s.nodeType===9?s:s.ownerDocument).createTextNode(p),p[An]=t,t.stateNode=p}return Nt(t),null;case 13:if(dt(gt),p=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pt&&en!==null&&(t.mode&1)!==0&&(t.flags&128)===0)vu(),es(),t.flags|=98560,M=!1;else if(M=Vi(t),p!==null&&p.dehydrated!==null){if(e===null){if(!M)throw Error(c(318));if(M=t.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(c(317));M[An]=t}else es(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Nt(t),M=!1}else vn!==null&&(hl(vn),vn=null),M=!0;if(!M)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=s,t):(p=p!==null,p!==(e!==null&&e.memoizedState!==null)&&p&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(gt.current&1)!==0?xt===0&&(xt=3):pl())),t.updateQueue!==null&&(t.flags|=4),Nt(t),null);case 4:return ss(),el(e,t),e===null&&Bs(t.stateNode.containerInfo),Nt(t),null;case 10:return Ta(t.type._context),Nt(t),null;case 17:return zt(t.type)&&$i(),Nt(t),null;case 19:if(dt(gt),M=t.memoizedState,M===null)return Nt(t),null;if(p=(t.flags&128)!==0,U=M.rendering,U===null)if(p)Ys(M,!1);else{if(xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(U=Ji(e),U!==null){for(t.flags|=128,Ys(M,!1),p=U.updateQueue,p!==null&&(t.updateQueue=p,t.flags|=4),t.subtreeFlags=0,p=s,s=t.child;s!==null;)M=s,e=p,M.flags&=14680066,U=M.alternate,U===null?(M.childLanes=0,M.lanes=e,M.child=null,M.subtreeFlags=0,M.memoizedProps=null,M.memoizedState=null,M.updateQueue=null,M.dependencies=null,M.stateNode=null):(M.childLanes=U.childLanes,M.lanes=U.lanes,M.child=U.child,M.subtreeFlags=0,M.deletions=null,M.memoizedProps=U.memoizedProps,M.memoizedState=U.memoizedState,M.updateQueue=U.updateQueue,M.type=U.type,e=U.dependencies,M.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return ut(gt,gt.current&1|2),t.child}e=e.sibling}M.tail!==null&&ft()>ls&&(t.flags|=128,p=!0,Ys(M,!1),t.lanes=4194304)}else{if(!p)if(e=Ji(U),e!==null){if(t.flags|=128,p=!0,s=e.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),Ys(M,!0),M.tail===null&&M.tailMode==="hidden"&&!U.alternate&&!pt)return Nt(t),null}else 2*ft()-M.renderingStartTime>ls&&s!==1073741824&&(t.flags|=128,p=!0,Ys(M,!1),t.lanes=4194304);M.isBackwards?(U.sibling=t.child,t.child=U):(s=M.last,s!==null?s.sibling=U:t.child=U,M.last=U)}return M.tail!==null?(t=M.tail,M.rendering=t,M.tail=t.sibling,M.renderingStartTime=ft(),t.sibling=null,s=gt.current,ut(gt,p?s&1|2:s&1),t):(Nt(t),null);case 22:case 23:return fl(),p=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==p&&(t.flags|=8192),p&&(t.mode&1)!==0?(tn&1073741824)!==0&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(c(156,t.tag))}function xm(e,t){switch(Ca(t),t.tag){case 1:return zt(t.type)&&$i(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ss(),dt(Ut),dt(Dt),Pa(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Ia(t),null;case 13:if(dt(gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return dt(gt),null;case 4:return ss(),null;case 10:return Ta(t.type._context),null;case 22:case 23:return fl(),null;case 24:return null;default:return null}}var ao=!1,Pt=!1,km=typeof WeakSet=="function"?WeakSet:Set,Le=null;function os(e,t){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(p){yt(e,t,p)}else s.current=null}function tl(e,t,s){try{s()}catch(p){yt(e,t,p)}}var gh=!1;function Em(e,t){if(fa=Li,e=Gc(),ia(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var p=s.getSelection&&s.getSelection();if(p&&p.rangeCount!==0){s=p.anchorNode;var x=p.anchorOffset,M=p.focusNode;p=p.focusOffset;try{s.nodeType,M.nodeType}catch{s=null;break e}var U=0,X=-1,te=-1,ce=0,me=0,ge=e,pe=null;t:for(;;){for(var xe;ge!==s||x!==0&&ge.nodeType!==3||(X=U+x),ge!==M||p!==0&&ge.nodeType!==3||(te=U+p),ge.nodeType===3&&(U+=ge.nodeValue.length),(xe=ge.firstChild)!==null;)pe=ge,ge=xe;for(;;){if(ge===e)break t;if(pe===s&&++ce===x&&(X=U),pe===M&&++me===p&&(te=U),(xe=ge.nextSibling)!==null)break;ge=pe,pe=ge.parentNode}ge=xe}s=X===-1||te===-1?null:{start:X,end:te}}else s=null}s=s||{start:0,end:0}}else s=null;for(pa={focusedElem:e,selectionRange:s},Li=!1,Le=t;Le!==null;)if(t=Le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Le=e;else for(;Le!==null;){t=Le;try{var Re=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(Re!==null){var Ie=Re.memoizedProps,wt=Re.memoizedState,oe=t.stateNode,se=oe.getSnapshotBeforeUpdate(t.elementType===t.type?Ie:yn(t.type,Ie),wt);oe.__reactInternalSnapshotBeforeUpdate=se}break;case 3:var ae=t.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(c(163))}}catch(ve){yt(t,t.return,ve)}if(e=t.sibling,e!==null){e.return=t.return,Le=e;break}Le=t.return}return Re=gh,gh=!1,Re}function Qs(e,t,s){var p=t.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&e)===e){var M=x.destroy;x.destroy=void 0,M!==void 0&&tl(t,s,M)}x=x.next}while(x!==p)}}function lo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var s=t=t.next;do{if((s.tag&e)===e){var p=s.create;s.destroy=p()}s=s.next}while(s!==t)}}function nl(e){var t=e.ref;if(t!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof t=="function"?t(e):t.current=e}}function _h(e){var t=e.alternate;t!==null&&(e.alternate=null,_h(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[An],delete t[Hs],delete t[va],delete t[lm],delete t[cm])),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 vh(e){return e.tag===5||e.tag===3||e.tag===4}function yh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vh(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 rl(e,t,s){var p=e.tag;if(p===5||p===6)e=e.stateNode,t?s.nodeType===8?s.parentNode.insertBefore(e,t):s.insertBefore(e,t):(s.nodeType===8?(t=s.parentNode,t.insertBefore(e,s)):(t=s,t.appendChild(e)),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Fi));else if(p!==4&&(e=e.child,e!==null))for(rl(e,t,s),e=e.sibling;e!==null;)rl(e,t,s),e=e.sibling}function sl(e,t,s){var p=e.tag;if(p===5||p===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(p!==4&&(e=e.child,e!==null))for(sl(e,t,s),e=e.sibling;e!==null;)sl(e,t,s),e=e.sibling}var Rt=null,wn=!1;function ir(e,t,s){for(s=s.child;s!==null;)wh(e,t,s),s=s.sibling}function wh(e,t,s){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(yr,s)}catch{}switch(s.tag){case 5:Pt||os(s,t);case 6:var p=Rt,x=wn;Rt=null,ir(e,t,s),Rt=p,wn=x,Rt!==null&&(wn?(e=Rt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):Rt.removeChild(s.stateNode));break;case 18:Rt!==null&&(wn?(e=Rt,s=s.stateNode,e.nodeType===8?_a(e.parentNode,s):e.nodeType===1&&_a(e,s),Rs(e)):_a(Rt,s.stateNode));break;case 4:p=Rt,x=wn,Rt=s.stateNode.containerInfo,wn=!0,ir(e,t,s),Rt=p,wn=x;break;case 0:case 11:case 14:case 15:if(!Pt&&(p=s.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){x=p=p.next;do{var M=x,U=M.destroy;M=M.tag,U!==void 0&&((M&2)!==0||(M&4)!==0)&&tl(s,t,U),x=x.next}while(x!==p)}ir(e,t,s);break;case 1:if(!Pt&&(os(s,t),p=s.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=s.memoizedProps,p.state=s.memoizedState,p.componentWillUnmount()}catch(X){yt(s,t,X)}ir(e,t,s);break;case 21:ir(e,t,s);break;case 22:s.mode&1?(Pt=(p=Pt)||s.memoizedState!==null,ir(e,t,s),Pt=p):ir(e,t,s);break;default:ir(e,t,s)}}function Sh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new km),t.forEach(function(p){var x=Pm.bind(null,e,p);s.has(p)||(s.add(p),p.then(x,x))})}}function Sn(e,t){var s=t.deletions;if(s!==null)for(var p=0;p<s.length;p++){var x=s[p];try{var M=e,U=t,X=U;e:for(;X!==null;){switch(X.tag){case 5:Rt=X.stateNode,wn=!1;break e;case 3:Rt=X.stateNode.containerInfo,wn=!0;break e;case 4:Rt=X.stateNode.containerInfo,wn=!0;break e}X=X.return}if(Rt===null)throw Error(c(160));wh(M,U,x),Rt=null,wn=!1;var te=x.alternate;te!==null&&(te.return=null),x.return=null}catch(ce){yt(x,t,ce)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ch(t,e),t=t.sibling}function Ch(e,t){var s=e.alternate,p=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Sn(t,e),Nn(e),p&4){try{Qs(3,e,e.return),lo(3,e)}catch(Ie){yt(e,e.return,Ie)}try{Qs(5,e,e.return)}catch(Ie){yt(e,e.return,Ie)}}break;case 1:Sn(t,e),Nn(e),p&512&&s!==null&&os(s,s.return);break;case 5:if(Sn(t,e),Nn(e),p&512&&s!==null&&os(s,s.return),e.flags&32){var x=e.stateNode;try{tt(x,"")}catch(Ie){yt(e,e.return,Ie)}}if(p&4&&(x=e.stateNode,x!=null)){var M=e.memoizedProps,U=s!==null?s.memoizedProps:M,X=e.type,te=e.updateQueue;if(e.updateQueue=null,te!==null)try{X==="input"&&M.type==="radio"&&M.name!=null&&Ye(x,M),he(X,U);var ce=he(X,M);for(U=0;U<te.length;U+=2){var me=te[U],ge=te[U+1];me==="style"?st(x,ge):me==="dangerouslySetInnerHTML"?lt(x,ge):me==="children"?tt(x,ge):d(x,me,ge,ce)}switch(X){case"input":Te(x,M);break;case"textarea":We(x,M);break;case"select":var pe=x._wrapperState.wasMultiple;x._wrapperState.wasMultiple=!!M.multiple;var xe=M.value;xe!=null?Ce(x,!!M.multiple,xe,!1):pe!==!!M.multiple&&(M.defaultValue!=null?Ce(x,!!M.multiple,M.defaultValue,!0):Ce(x,!!M.multiple,M.multiple?[]:"",!1))}x[Hs]=M}catch(Ie){yt(e,e.return,Ie)}}break;case 6:if(Sn(t,e),Nn(e),p&4){if(e.stateNode===null)throw Error(c(162));x=e.stateNode,M=e.memoizedProps;try{x.nodeValue=M}catch(Ie){yt(e,e.return,Ie)}}break;case 3:if(Sn(t,e),Nn(e),p&4&&s!==null&&s.memoizedState.isDehydrated)try{Rs(t.containerInfo)}catch(Ie){yt(e,e.return,Ie)}break;case 4:Sn(t,e),Nn(e);break;case 13:Sn(t,e),Nn(e),x=e.child,x.flags&8192&&(M=x.memoizedState!==null,x.stateNode.isHidden=M,!M||x.alternate!==null&&x.alternate.memoizedState!==null||(al=ft())),p&4&&Sh(e);break;case 22:if(me=s!==null&&s.memoizedState!==null,e.mode&1?(Pt=(ce=Pt)||me,Sn(t,e),Pt=ce):Sn(t,e),Nn(e),p&8192){if(ce=e.memoizedState!==null,(e.stateNode.isHidden=ce)&&!me&&(e.mode&1)!==0)for(Le=e,me=e.child;me!==null;){for(ge=Le=me;Le!==null;){switch(pe=Le,xe=pe.child,pe.tag){case 0:case 11:case 14:case 15:Qs(4,pe,pe.return);break;case 1:os(pe,pe.return);var Re=pe.stateNode;if(typeof Re.componentWillUnmount=="function"){p=pe,s=pe.return;try{t=p,Re.props=t.memoizedProps,Re.state=t.memoizedState,Re.componentWillUnmount()}catch(Ie){yt(p,s,Ie)}}break;case 5:os(pe,pe.return);break;case 22:if(pe.memoizedState!==null){kh(ge);continue}}xe!==null?(xe.return=pe,Le=xe):kh(ge)}me=me.sibling}e:for(me=null,ge=e;;){if(ge.tag===5){if(me===null){me=ge;try{x=ge.stateNode,ce?(M=x.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none"):(X=ge.stateNode,te=ge.memoizedProps.style,U=te!=null&&te.hasOwnProperty("display")?te.display:null,X.style.display=ze("display",U))}catch(Ie){yt(e,e.return,Ie)}}}else if(ge.tag===6){if(me===null)try{ge.stateNode.nodeValue=ce?"":ge.memoizedProps}catch(Ie){yt(e,e.return,Ie)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===e)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===e)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===e)break e;me===ge&&(me=null),ge=ge.return}me===ge&&(me=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:Sn(t,e),Nn(e),p&4&&Sh(e);break;case 21:break;default:Sn(t,e),Nn(e)}}function Nn(e){var t=e.flags;if(t&2){try{e:{for(var s=e.return;s!==null;){if(vh(s)){var p=s;break e}s=s.return}throw Error(c(160))}switch(p.tag){case 5:var x=p.stateNode;p.flags&32&&(tt(x,""),p.flags&=-33);var M=yh(e);sl(e,M,x);break;case 3:case 4:var U=p.stateNode.containerInfo,X=yh(e);rl(e,X,U);break;default:throw Error(c(161))}}catch(te){yt(e,e.return,te)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lm(e,t,s){Le=e,bh(e)}function bh(e,t,s){for(var p=(e.mode&1)!==0;Le!==null;){var x=Le,M=x.child;if(x.tag===22&&p){var U=x.memoizedState!==null||ao;if(!U){var X=x.alternate,te=X!==null&&X.memoizedState!==null||Pt;X=ao;var ce=Pt;if(ao=U,(Pt=te)&&!ce)for(Le=x;Le!==null;)U=Le,te=U.child,U.tag===22&&U.memoizedState!==null?Eh(x):te!==null?(te.return=U,Le=te):Eh(x);for(;M!==null;)Le=M,bh(M),M=M.sibling;Le=x,ao=X,Pt=ce}xh(e)}else(x.subtreeFlags&8772)!==0&&M!==null?(M.return=x,Le=M):xh(e)}}function xh(e){for(;Le!==null;){var t=Le;if((t.flags&8772)!==0){var s=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Pt||lo(5,t);break;case 1:var p=t.stateNode;if(t.flags&4&&!Pt)if(s===null)p.componentDidMount();else{var x=t.elementType===t.type?s.memoizedProps:yn(t.type,s.memoizedProps);p.componentDidUpdate(x,s.memoizedState,p.__reactInternalSnapshotBeforeUpdate)}var M=t.updateQueue;M!==null&&ku(t,M,p);break;case 3:var U=t.updateQueue;if(U!==null){if(s=null,t.child!==null)switch(t.child.tag){case 5:s=t.child.stateNode;break;case 1:s=t.child.stateNode}ku(t,U,s)}break;case 5:var X=t.stateNode;if(s===null&&t.flags&4){s=X;var te=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":te.autoFocus&&s.focus();break;case"img":te.src&&(s.src=te.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var ce=t.alternate;if(ce!==null){var me=ce.memoizedState;if(me!==null){var ge=me.dehydrated;ge!==null&&Rs(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(c(163))}Pt||t.flags&512&&nl(t)}catch(pe){yt(t,t.return,pe)}}if(t===e){Le=null;break}if(s=t.sibling,s!==null){s.return=t.return,Le=s;break}Le=t.return}}function kh(e){for(;Le!==null;){var t=Le;if(t===e){Le=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Le=s;break}Le=t.return}}function Eh(e){for(;Le!==null;){var t=Le;try{switch(t.tag){case 0:case 11:case 15:var s=t.return;try{lo(4,t)}catch(te){yt(t,s,te)}break;case 1:var p=t.stateNode;if(typeof p.componentDidMount=="function"){var x=t.return;try{p.componentDidMount()}catch(te){yt(t,x,te)}}var M=t.return;try{nl(t)}catch(te){yt(t,M,te)}break;case 5:var U=t.return;try{nl(t)}catch(te){yt(t,U,te)}}}catch(te){yt(t,t.return,te)}if(t===e){Le=null;break}var X=t.sibling;if(X!==null){X.return=t.return,Le=X;break}Le=t.return}}var Tm=Math.ceil,co=w.ReactCurrentDispatcher,il=w.ReactCurrentOwner,un=w.ReactCurrentBatchConfig,et=0,Lt=null,Ct=null,Mt=0,tn=0,as=er(0),xt=0,Js=null,Ar=0,uo=0,ol=0,Zs=null,Vt=null,al=0,ls=1/0,Kn=null,ho=!1,ll=null,or=null,fo=!1,ar=null,po=0,ei=0,cl=null,mo=-1,go=0;function Ht(){return(et&6)!==0?ft():mo!==-1?mo:mo=ft()}function lr(e){return(e.mode&1)===0?1:(et&2)!==0&&Mt!==0?Mt&-Mt:hm.transition!==null?(go===0&&(go=Si()),go):(e=it,e!==0||(e=window.event,e=e===void 0?16:Tc(e.type)),e)}function Cn(e,t,s,p){if(50<ei)throw ei=0,cl=null,Error(c(185));Sr(e,s,p),((et&2)===0||e!==Lt)&&(e===Lt&&((et&2)===0&&(uo|=s),xt===4&&cr(e,Mt)),Kt(e,p),s===1&&et===0&&(t.mode&1)===0&&(ls=ft()+500,Ui&&nr()))}function Kt(e,t){var s=e.callbackNode;wi(e,t);var p=wr(e,e===Lt?Mt:0);if(p===0)s!==null&&pi(s),e.callbackNode=null,e.callbackPriority=0;else if(t=p&-p,e.callbackPriority!==t){if(s!=null&&pi(s),t===1)e.tag===0?um(Th.bind(null,e)):fu(Th.bind(null,e)),om(function(){(et&6)===0&&nr()}),s=null;else{switch(ks(p)){case 1:s=Fr;break;case 4:s=_i;break;case 16:s=Hr;break;case 536870912:s=Ss;break;default:s=Hr}s=Oh(s,Lh.bind(null,e))}e.callbackPriority=t,e.callbackNode=s}}function Lh(e,t){if(mo=-1,go=0,(et&6)!==0)throw Error(c(327));var s=e.callbackNode;if(cs()&&e.callbackNode!==s)return null;var p=wr(e,e===Lt?Mt:0);if(p===0)return null;if((p&30)!==0||(p&e.expiredLanes)!==0||t)t=_o(e,p);else{t=p;var x=et;et|=2;var M=Mh();(Lt!==e||Mt!==t)&&(Kn=null,ls=ft()+500,Ir(e,t));do try{Am();break}catch(X){Rh(e,X)}while(!0);La(),co.current=M,et=x,Ct!==null?t=0:(Lt=null,Mt=0,t=xt)}if(t!==0){if(t===2&&(x=bs(e),x!==0&&(p=x,t=ul(e,x))),t===1)throw s=Js,Ir(e,0),cr(e,p),Kt(e,ft()),s;if(t===6)cr(e,p);else{if(x=e.current.alternate,(p&30)===0&&!Rm(x)&&(t=_o(e,p),t===2&&(M=bs(e),M!==0&&(p=M,t=ul(e,M))),t===1))throw s=Js,Ir(e,0),cr(e,p),Kt(e,ft()),s;switch(e.finishedWork=x,e.finishedLanes=p,t){case 0:case 1:throw Error(c(345));case 2:Nr(e,Vt,Kn);break;case 3:if(cr(e,p),(p&130023424)===p&&(t=al+500-ft(),10<t)){if(wr(e,0)!==0)break;if(x=e.suspendedLanes,(x&p)!==p){Ht(),e.pingedLanes|=e.suspendedLanes&x;break}e.timeoutHandle=ga(Nr.bind(null,e,Vt,Kn),t);break}Nr(e,Vt,Kn);break;case 4:if(cr(e,p),(p&4194240)===p)break;for(t=e.eventTimes,x=-1;0<p;){var U=31-Yt(p);M=1<<U,U=t[U],U>x&&(x=U),p&=~M}if(p=x,p=ft()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*Tm(p/1960))-p,10<p){e.timeoutHandle=ga(Nr.bind(null,e,Vt,Kn),p);break}Nr(e,Vt,Kn);break;case 5:Nr(e,Vt,Kn);break;default:throw Error(c(329))}}}return Kt(e,ft()),e.callbackNode===s?Lh.bind(null,e):null}function ul(e,t){var s=Zs;return e.current.memoizedState.isDehydrated&&(Ir(e,t).flags|=256),e=_o(e,t),e!==2&&(t=Vt,Vt=s,t!==null&&hl(t)),e}function hl(e){Vt===null?Vt=e:Vt.push.apply(Vt,e)}function Rm(e){for(var t=e;;){if(t.flags&16384){var s=t.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var p=0;p<s.length;p++){var x=s[p],M=x.getSnapshot;x=x.value;try{if(!_n(M(),x))return!1}catch{return!1}}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function cr(e,t){for(t&=~ol,t&=~uo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var s=31-Yt(t),p=1<<s;e[s]=-1,t&=~p}}function Th(e){if((et&6)!==0)throw Error(c(327));cs();var t=wr(e,0);if((t&1)===0)return Kt(e,ft()),null;var s=_o(e,t);if(e.tag!==0&&s===2){var p=bs(e);p!==0&&(t=p,s=ul(e,p))}if(s===1)throw s=Js,Ir(e,0),cr(e,t),Kt(e,ft()),s;if(s===6)throw Error(c(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,Vt,Kn),Kt(e,ft()),null}function dl(e,t){var s=et;et|=1;try{return e(t)}finally{et=s,et===0&&(ls=ft()+500,Ui&&nr())}}function Dr(e){ar!==null&&ar.tag===0&&(et&6)===0&&cs();var t=et;et|=1;var s=un.transition,p=it;try{if(un.transition=null,it=1,e)return e()}finally{it=p,un.transition=s,et=t,(et&6)===0&&nr()}}function fl(){tn=as.current,dt(as)}function Ir(e,t){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,im(s)),Ct!==null)for(s=Ct.return;s!==null;){var p=s;switch(Ca(p),p.tag){case 1:p=p.type.childContextTypes,p!=null&&$i();break;case 3:ss(),dt(Ut),dt(Dt),Pa();break;case 5:Ia(p);break;case 4:ss();break;case 13:dt(gt);break;case 19:dt(gt);break;case 10:Ta(p.type._context);break;case 22:case 23:fl()}s=s.return}if(Lt=e,Ct=e=ur(e.current,null),Mt=tn=t,xt=0,Js=null,ol=uo=Ar=0,Vt=Zs=null,Tr!==null){for(t=0;t<Tr.length;t++)if(s=Tr[t],p=s.interleaved,p!==null){s.interleaved=null;var x=p.next,M=s.pending;if(M!==null){var U=M.next;M.next=x,p.next=U}s.pending=p}Tr=null}return e}function Rh(e,t){do{var s=Ct;try{if(La(),Zi.current=ro,eo){for(var p=_t.memoizedState;p!==null;){var x=p.queue;x!==null&&(x.pending=null),p=p.next}eo=!1}if(Mr=0,Et=bt=_t=null,Vs=!1,Ks=0,il.current=null,s===null||s.return===null){xt=1,Js=t,Ct=null;break}e:{var M=e,U=s.return,X=s,te=t;if(t=Mt,X.flags|=32768,te!==null&&typeof te=="object"&&typeof te.then=="function"){var ce=te,me=X,ge=me.tag;if((me.mode&1)===0&&(ge===0||ge===11||ge===15)){var pe=me.alternate;pe?(me.updateQueue=pe.updateQueue,me.memoizedState=pe.memoizedState,me.lanes=pe.lanes):(me.updateQueue=null,me.memoizedState=null)}var xe=eh(U);if(xe!==null){xe.flags&=-257,th(xe,U,X,M,t),xe.mode&1&&Zu(M,ce,t),t=xe,te=ce;var Re=t.updateQueue;if(Re===null){var Ie=new Set;Ie.add(te),t.updateQueue=Ie}else Re.add(te);break e}else{if((t&1)===0){Zu(M,ce,t),pl();break e}te=Error(c(426))}}else if(pt&&X.mode&1){var wt=eh(U);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),th(wt,U,X,M,t),ka(is(te,X));break e}}M=te=is(te,X),xt!==4&&(xt=2),Zs===null?Zs=[M]:Zs.push(M),M=U;do{switch(M.tag){case 3:M.flags|=65536,t&=-t,M.lanes|=t;var oe=Qu(M,te,t);xu(M,oe);break e;case 1:X=te;var se=M.type,ae=M.stateNode;if((M.flags&128)===0&&(typeof se.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(or===null||!or.has(ae)))){M.flags|=65536,t&=-t,M.lanes|=t;var ve=Ju(M,X,t);xu(M,ve);break e}}M=M.return}while(M!==null)}Dh(s)}catch(Pe){t=Pe,Ct===s&&s!==null&&(Ct=s=s.return);continue}break}while(!0)}function Mh(){var e=co.current;return co.current=ro,e===null?ro:e}function pl(){(xt===0||xt===3||xt===2)&&(xt=4),Lt===null||(Ar&268435455)===0&&(uo&268435455)===0||cr(Lt,Mt)}function _o(e,t){var s=et;et|=2;var p=Mh();(Lt!==e||Mt!==t)&&(Kn=null,Ir(e,t));do try{Mm();break}catch(x){Rh(e,x)}while(!0);if(La(),et=s,co.current=p,Ct!==null)throw Error(c(261));return Lt=null,Mt=0,xt}function Mm(){for(;Ct!==null;)Ah(Ct)}function Am(){for(;Ct!==null&&!Uo();)Ah(Ct)}function Ah(e){var t=Ph(e.alternate,e,tn);e.memoizedProps=e.pendingProps,t===null?Dh(e):Ct=t,il.current=null}function Dh(e){var t=e;do{var s=t.alternate;if(e=t.return,(t.flags&32768)===0){if(s=bm(s,t,tn),s!==null){Ct=s;return}}else{if(s=xm(s,t),s!==null){s.flags&=32767,Ct=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{xt=6,Ct=null;return}}if(t=t.sibling,t!==null){Ct=t;return}Ct=t=e}while(t!==null);xt===0&&(xt=5)}function Nr(e,t,s){var p=it,x=un.transition;try{un.transition=null,it=1,Dm(e,t,s,p)}finally{un.transition=x,it=p}return null}function Dm(e,t,s,p){do cs();while(ar!==null);if((et&6)!==0)throw Error(c(327));s=e.finishedWork;var x=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(c(177));e.callbackNode=null,e.callbackPriority=0;var M=s.lanes|s.childLanes;if(Ko(e,M),e===Lt&&(Ct=Lt=null,Mt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||fo||(fo=!0,Oh(Hr,function(){return cs(),null})),M=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||M){M=un.transition,un.transition=null;var U=it;it=1;var X=et;et|=4,il.current=null,Em(e,s),Ch(s,e),Jp(pa),Li=!!fa,pa=fa=null,e.current=s,Lm(s),mi(),et=X,it=U,un.transition=M}else e.current=s;if(fo&&(fo=!1,ar=e,po=x),M=e.pendingLanes,M===0&&(or=null),Cs(s.stateNode),Kt(e,ft()),t!==null)for(p=e.onRecoverableError,s=0;s<t.length;s++)x=t[s],p(x.value,{componentStack:x.stack,digest:x.digest});if(ho)throw ho=!1,e=ll,ll=null,e;return(po&1)!==0&&e.tag!==0&&cs(),M=e.pendingLanes,(M&1)!==0?e===cl?ei++:(ei=0,cl=e):ei=0,nr(),null}function cs(){if(ar!==null){var e=ks(po),t=un.transition,s=it;try{if(un.transition=null,it=16>e?16:e,ar===null)var p=!1;else{if(e=ar,ar=null,po=0,(et&6)!==0)throw Error(c(331));var x=et;for(et|=4,Le=e.current;Le!==null;){var M=Le,U=M.child;if((Le.flags&16)!==0){var X=M.deletions;if(X!==null){for(var te=0;te<X.length;te++){var ce=X[te];for(Le=ce;Le!==null;){var me=Le;switch(me.tag){case 0:case 11:case 15:Qs(8,me,M)}var ge=me.child;if(ge!==null)ge.return=me,Le=ge;else for(;Le!==null;){me=Le;var pe=me.sibling,xe=me.return;if(_h(me),me===ce){Le=null;break}if(pe!==null){pe.return=xe,Le=pe;break}Le=xe}}}var Re=M.alternate;if(Re!==null){var Ie=Re.child;if(Ie!==null){Re.child=null;do{var wt=Ie.sibling;Ie.sibling=null,Ie=wt}while(Ie!==null)}}Le=M}}if((M.subtreeFlags&2064)!==0&&U!==null)U.return=M,Le=U;else e:for(;Le!==null;){if(M=Le,(M.flags&2048)!==0)switch(M.tag){case 0:case 11:case 15:Qs(9,M,M.return)}var oe=M.sibling;if(oe!==null){oe.return=M.return,Le=oe;break e}Le=M.return}}var se=e.current;for(Le=se;Le!==null;){U=Le;var ae=U.child;if((U.subtreeFlags&2064)!==0&&ae!==null)ae.return=U,Le=ae;else e:for(U=se;Le!==null;){if(X=Le,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:lo(9,X)}}catch(Pe){yt(X,X.return,Pe)}if(X===U){Le=null;break e}var ve=X.sibling;if(ve!==null){ve.return=X.return,Le=ve;break e}Le=X.return}}if(et=x,nr(),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(yr,e)}catch{}p=!0}return p}finally{it=s,un.transition=t}}return!1}function Ih(e,t,s){t=is(s,t),t=Qu(e,t,1),e=sr(e,t,1),t=Ht(),e!==null&&(Sr(e,1,t),Kt(e,t))}function yt(e,t,s){if(e.tag===3)Ih(e,e,s);else for(;t!==null;){if(t.tag===3){Ih(t,e,s);break}else if(t.tag===1){var p=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(or===null||!or.has(p))){e=is(s,e),e=Ju(t,e,1),t=sr(t,e,1),e=Ht(),t!==null&&(Sr(t,1,e),Kt(t,e));break}}t=t.return}}function Im(e,t,s){var p=e.pingCache;p!==null&&p.delete(t),t=Ht(),e.pingedLanes|=e.suspendedLanes&s,Lt===e&&(Mt&s)===s&&(xt===4||xt===3&&(Mt&130023424)===Mt&&500>ft()-al?Ir(e,0):ol|=s),Kt(e,t)}function Nh(e,t){t===0&&((e.mode&1)===0?t=1:(t=$r,$r<<=1,($r&130023424)===0&&($r=4194304)));var s=Ht();e=zn(e,t),e!==null&&(Sr(e,t,s),Kt(e,s))}function Nm(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Nh(e,s)}function Pm(e,t){var s=0;switch(e.tag){case 13:var p=e.stateNode,x=e.memoizedState;x!==null&&(s=x.retryLane);break;case 19:p=e.stateNode;break;default:throw Error(c(314))}p!==null&&p.delete(t),Nh(e,s)}var Ph;Ph=function(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ut.current)qt=!0;else{if((e.lanes&s)===0&&(t.flags&128)===0)return qt=!1,Cm(e,t,s);qt=(e.flags&131072)!==0}else qt=!1,pt&&(t.flags&1048576)!==0&&pu(t,qi,t.index);switch(t.lanes=0,t.tag){case 2:var p=t.type;oo(e,t),e=t.pendingProps;var x=Qr(t,Dt.current);rs(t,s),x=Ba(null,t,p,e,x,s);var M=Fa();return t.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zt(p)?(M=!0,Wi(t)):M=!1,t.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Aa(t),x.updater=so,t.stateNode=x,x._reactInternals=t,qa(t,p,e,s),t=Xa(null,t,p,!0,M,s)):(t.tag=0,pt&&M&&Sa(t),Ft(null,t,x,s),t=t.child),t;case 16:p=t.elementType;e:{switch(oo(e,t),e=t.pendingProps,x=p._init,p=x(p._payload),t.type=p,x=t.tag=jm(p),e=yn(p,e),x){case 0:t=Ga(null,t,p,e,s);break e;case 1:t=ah(null,t,p,e,s);break e;case 11:t=nh(null,t,p,e,s);break e;case 14:t=rh(null,t,p,yn(p.type,e),s);break e}throw Error(c(306,p,""))}return t;case 0:return p=t.type,x=t.pendingProps,x=t.elementType===p?x:yn(p,x),Ga(e,t,p,x,s);case 1:return p=t.type,x=t.pendingProps,x=t.elementType===p?x:yn(p,x),ah(e,t,p,x,s);case 3:e:{if(lh(t),e===null)throw Error(c(387));p=t.pendingProps,M=t.memoizedState,x=M.element,bu(e,t),Qi(t,p,null,s);var U=t.memoizedState;if(p=U.element,M.isDehydrated)if(M={element:p,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},t.updateQueue.baseState=M,t.memoizedState=M,t.flags&256){x=is(Error(c(423)),t),t=ch(e,t,p,s,x);break e}else if(p!==x){x=is(Error(c(424)),t),t=ch(e,t,p,s,x);break e}else for(en=Zn(t.stateNode.containerInfo.firstChild),Zt=t,pt=!0,vn=null,s=Su(t,null,p,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(es(),p===x){t=Vn(e,t,s);break e}Ft(e,t,p,s)}t=t.child}return t;case 5:return Eu(t),e===null&&xa(t),p=t.type,x=t.pendingProps,M=e!==null?e.memoizedProps:null,U=x.children,ma(p,x)?U=null:M!==null&&ma(p,M)&&(t.flags|=32),oh(e,t),Ft(e,t,U,s),t.child;case 6:return e===null&&xa(t),null;case 13:return uh(e,t,s);case 4:return Da(t,t.stateNode.containerInfo),p=t.pendingProps,e===null?t.child=ts(t,null,p,s):Ft(e,t,p,s),t.child;case 11:return p=t.type,x=t.pendingProps,x=t.elementType===p?x:yn(p,x),nh(e,t,p,x,s);case 7:return Ft(e,t,t.pendingProps,s),t.child;case 8:return Ft(e,t,t.pendingProps.children,s),t.child;case 12:return Ft(e,t,t.pendingProps.children,s),t.child;case 10:e:{if(p=t.type._context,x=t.pendingProps,M=t.memoizedProps,U=x.value,ut(Gi,p._currentValue),p._currentValue=U,M!==null)if(_n(M.value,U)){if(M.children===x.children&&!Ut.current){t=Vn(e,t,s);break e}}else for(M=t.child,M!==null&&(M.return=t);M!==null;){var X=M.dependencies;if(X!==null){U=M.child;for(var te=X.firstContext;te!==null;){if(te.context===p){if(M.tag===1){te=qn(-1,s&-s),te.tag=2;var ce=M.updateQueue;if(ce!==null){ce=ce.shared;var me=ce.pending;me===null?te.next=te:(te.next=me.next,me.next=te),ce.pending=te}}M.lanes|=s,te=M.alternate,te!==null&&(te.lanes|=s),Ra(M.return,s,t),X.lanes|=s;break}te=te.next}}else if(M.tag===10)U=M.type===t.type?null:M.child;else if(M.tag===18){if(U=M.return,U===null)throw Error(c(341));U.lanes|=s,X=U.alternate,X!==null&&(X.lanes|=s),Ra(U,s,t),U=M.sibling}else U=M.child;if(U!==null)U.return=M;else for(U=M;U!==null;){if(U===t){U=null;break}if(M=U.sibling,M!==null){M.return=U.return,U=M;break}U=U.return}M=U}Ft(e,t,x.children,s),t=t.child}return t;case 9:return x=t.type,p=t.pendingProps.children,rs(t,s),x=ln(x),p=p(x),t.flags|=1,Ft(e,t,p,s),t.child;case 14:return p=t.type,x=yn(p,t.pendingProps),x=yn(p.type,x),rh(e,t,p,x,s);case 15:return sh(e,t,t.type,t.pendingProps,s);case 17:return p=t.type,x=t.pendingProps,x=t.elementType===p?x:yn(p,x),oo(e,t),t.tag=1,zt(p)?(e=!0,Wi(t)):e=!1,rs(t,s),Xu(t,p,x),qa(t,p,x,s),Xa(null,t,p,!0,e,s);case 19:return dh(e,t,s);case 22:return ih(e,t,s)}throw Error(c(156,t.tag))};function Oh(e,t){return fi(e,t)}function Om(e,t,s,p){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hn(e,t,s,p){return new Om(e,t,s,p)}function ml(e){return e=e.prototype,!(!e||!e.isReactComponent)}function jm(e){if(typeof e=="function")return ml(e)?1:0;if(e!=null){if(e=e.$$typeof,e===O)return 11;if(e===Y)return 14}return 2}function ur(e,t){var s=e.alternate;return s===null?(s=hn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function vo(e,t,s,p,x,M){var U=2;if(p=e,typeof e=="function")ml(e)&&(U=1);else if(typeof e=="string")U=5;else e:switch(e){case A:return Pr(s.children,x,M,t);case b:U=8,x|=8;break;case T:return e=hn(12,s,t,x|2),e.elementType=T,e.lanes=M,e;case j:return e=hn(13,s,t,x),e.elementType=j,e.lanes=M,e;case z:return e=hn(19,s,t,x),e.elementType=z,e.lanes=M,e;case J:return yo(s,x,M,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:U=10;break e;case W:U=9;break e;case O:U=11;break e;case Y:U=14;break e;case Z:U=16,p=null;break e}throw Error(c(130,e==null?e:typeof e,""))}return t=hn(U,s,t,x),t.elementType=e,t.type=p,t.lanes=M,t}function Pr(e,t,s,p){return e=hn(7,e,p,t),e.lanes=s,e}function yo(e,t,s,p){return e=hn(22,e,p,t),e.elementType=J,e.lanes=s,e.stateNode={isHidden:!1},e}function gl(e,t,s){return e=hn(6,e,null,t),e.lanes=s,e}function _l(e,t,s){return t=hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bm(e,t,s,p,x){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=xs(0),this.expirationTimes=xs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xs(0),this.identifierPrefix=p,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function vl(e,t,s,p,x,M,U,X,te){return e=new Bm(e,t,s,X,te),t===1?(t=1,M===!0&&(t|=8)):t=0,M=hn(3,null,null,t),e.current=M,M.stateNode=e,M.memoizedState={element:p,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Aa(M),e}function Fm(e,t,s){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:p==null?null:""+p,children:e,containerInfo:t,implementation:s}}function jh(e){if(!e)return tr;e=e._reactInternals;e:{if(Fn(e)!==e||e.tag!==1)throw Error(c(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(zt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(c(171))}if(e.tag===1){var s=e.type;if(zt(s))return hu(e,s,t)}return t}function Bh(e,t,s,p,x,M,U,X,te){return e=vl(s,p,!0,e,x,M,U,X,te),e.context=jh(null),s=e.current,p=Ht(),x=lr(s),M=qn(p,x),M.callback=t??null,sr(s,M,x),e.current.lanes=x,Sr(e,x,p),Kt(e,p),e}function wo(e,t,s,p){var x=t.current,M=Ht(),U=lr(x);return s=jh(s),t.context===null?t.context=s:t.pendingContext=s,t=qn(M,U),t.payload={element:e},p=p===void 0?null:p,p!==null&&(t.callback=p),e=sr(x,t,U),e!==null&&(Cn(e,x,U,M),Yi(e,x,U)),U}function So(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 Fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function yl(e,t){Fh(e,t),(e=e.alternate)&&Fh(e,t)}function Hm(){return null}var Hh=typeof reportError=="function"?reportError:function(e){console.error(e)};function wl(e){this._internalRoot=e}Co.prototype.render=wl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));wo(e,t,null,null)},Co.prototype.unmount=wl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dr(function(){wo(null,e,null,null)}),t[Hn]=null}};function Co(e){this._internalRoot=e}Co.prototype.unstable_scheduleHydration=function(e){if(e){var t=xi();e={blockedOn:null,target:e,priority:t};for(var s=0;s<le.length&&t!==0&&t<le[s].priority;s++);le.splice(s,0,e),s===0&&Ec(e)}};function Sl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $h(){}function $m(e,t,s,p,x){if(x){if(typeof p=="function"){var M=p;p=function(){var ce=So(U);M.call(ce)}}var U=Bh(t,p,e,0,null,!1,!1,"",$h);return e._reactRootContainer=U,e[Hn]=U.current,Bs(e.nodeType===8?e.parentNode:e),Dr(),U}for(;x=e.lastChild;)e.removeChild(x);if(typeof p=="function"){var X=p;p=function(){var ce=So(te);X.call(ce)}}var te=vl(e,0,!1,null,null,!1,!1,"",$h);return e._reactRootContainer=te,e[Hn]=te.current,Bs(e.nodeType===8?e.parentNode:e),Dr(function(){wo(t,te,s,p)}),te}function xo(e,t,s,p,x){var M=s._reactRootContainer;if(M){var U=M;if(typeof x=="function"){var X=x;x=function(){var te=So(U);X.call(te)}}wo(t,U,e,x)}else U=$m(s,t,e,x,p);return So(U)}Ci=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var s=pn(t.pendingLanes);s!==0&&(Rn(t,s|1),Kt(t,ft()),(et&6)===0&&(ls=ft()+500,nr()))}break;case 13:Dr(function(){var p=zn(e,1);if(p!==null){var x=Ht();Cn(p,e,1,x)}}),yl(e,1)}},Es=function(e){if(e.tag===13){var t=zn(e,134217728);if(t!==null){var s=Ht();Cn(t,e,134217728,s)}yl(e,134217728)}},bi=function(e){if(e.tag===13){var t=lr(e),s=zn(e,t);if(s!==null){var p=Ht();Cn(s,e,t,p)}yl(e,t)}},xi=function(){return it},ki=function(e,t){var s=it;try{return it=e,t()}finally{it=s}},nt=function(e,t,s){switch(t){case"input":if(Te(e,s),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<s.length;t++){var p=s[t];if(p!==e&&p.form===e.form){var x=Hi(p);if(!x)throw Error(c(90));ue(p),Te(p,x)}}}break;case"textarea":We(e,s);break;case"select":t=s.value,t!=null&&Ce(e,!!s.multiple,t,!1)}},mr=dl,Or=Dr;var Wm={usingClientEntryPoint:!1,Events:[$s,Xr,Hi,kn,En,dl]},ti={findFiberByHostInstance:xr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Um={bundleType:ti.bundleType,version:ti.version,rendererPackageName:ti.rendererPackageName,rendererConfig:ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hi(e),e===null?null:e.stateNode},findFiberByHostInstance:ti.findFiberByHostInstance||Hm,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 ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ko.isDisabled&&ko.supportsFiber)try{yr=ko.inject(Um),Wt=ko}catch{}}return Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wm,Gt.createPortal=function(e,t){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Sl(t))throw Error(c(200));return Fm(e,t,null,s)},Gt.createRoot=function(e,t){if(!Sl(e))throw Error(c(299));var s=!1,p="",x=Hh;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(p=t.identifierPrefix),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=vl(e,1,!1,null,null,s,!1,p,x),e[Hn]=t.current,Bs(e.nodeType===8?e.parentNode:e),new wl(t)},Gt.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(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=hi(t),e=e===null?null:e.stateNode,e},Gt.flushSync=function(e){return Dr(e)},Gt.hydrate=function(e,t,s){if(!bo(t))throw Error(c(200));return xo(null,e,t,!0,s)},Gt.hydrateRoot=function(e,t,s){if(!Sl(e))throw Error(c(405));var p=s!=null&&s.hydratedSources||null,x=!1,M="",U=Hh;if(s!=null&&(s.unstable_strictMode===!0&&(x=!0),s.identifierPrefix!==void 0&&(M=s.identifierPrefix),s.onRecoverableError!==void 0&&(U=s.onRecoverableError)),t=Bh(t,null,e,1,s??null,x,!1,M,U),e[Hn]=t.current,Bs(e),p)for(e=0;e<p.length;e++)s=p[e],x=s._getVersion,x=x(s._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[s,x]:t.mutableSourceEagerHydrationData.push(s,x);return new Co(t)},Gt.render=function(e,t,s){if(!bo(t))throw Error(c(200));return xo(null,e,t,!1,s)},Gt.unmountComponentAtNode=function(e){if(!bo(e))throw Error(c(40));return e._reactRootContainer?(Dr(function(){xo(null,null,e,!1,function(){e._reactRootContainer=null,e[Hn]=null})}),!0):!1},Gt.unstable_batchedUpdates=dl,Gt.unstable_renderSubtreeIntoContainer=function(e,t,s,p){if(!bo(s))throw Error(c(200));if(e==null||e._reactInternals===void 0)throw Error(c(38));return xo(e,t,s,!1,p)},Gt.version="18.3.1-next-f1338f8080-20240426",Gt}var Xh;function cf(){if(Xh)return xl.exports;Xh=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(n){console.error(n)}}return r(),xl.exports=Zm(),xl.exports}var Yh;function eg(){if(Yh)return Eo;Yh=1;var r=cf();return Eo.createRoot=r.createRoot,Eo.hydrateRoot=r.hydrateRoot,Eo}var tg=eg(),B=mc();const ng=Km(B);function Be(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:null}function Me(r){return typeof r=="string"?r:null}function ye(r){return typeof r=="string"&&r.length>0?r:null}function mt(r){return typeof r=="boolean"?r:null}function Ue(r){return typeof r=="number"&&Number.isFinite(r)?r:null}function Ll(r){if(!Array.isArray(r))return null;const n=[];for(const c of r){if(typeof c!="string")return null;n.push(c)}return n}function vt(r,n){if(!Array.isArray(r))return null;const c=[];for(const y of r){const E=n(y);if(E===null)return null;c.push(E)}return c}function xn(r,n){if(!Array.isArray(r))return null;const c=[];for(const y of r){const E=n(y);E!==null&&c.push(E)}return c}function Ve(r,n){return typeof r=="string"&&n.includes(r)?r:null}function rg(r){try{return JSON.parse(r)}catch{return}}const sg=["auto","default","acceptEdits","plan"];function fs(r){return typeof r=="string"&&sg.includes(r)}const ig={agentUnknown:[],answerInterrupted:[],answerInvalid:[],answerNoFreeText:[],answerNotPending:[],answerSendFailed:[],answersUnsupported:[],archiveOpenTab:[],attachmentEmpty:["name"],attachmentExecutable:["name"],attachmentSaveFailed:[],attachmentTooLarge:["max","name","size"],badMessage:[],cliMissing:["command","url"],cliNotFound:[],cliNotInstalled:["label"],cliOpenFailed:[],continueFailed:[],continueHistoryMissing:[],continueNoFolder:[],continueNotInHistory:[],continueReadFailed:[],continueSameCli:[],continueTabFailed:[],continueTranscriptFailed:[],conversationNotFollowed:[],cwdMissing:["cwd"],cwdNotDir:["cwd"],diffBinaryUntracked:[],diffNewEmpty:[],diffNoStaged:[],diffNoUnstaged:[],diffReadFailed:[],dirReadFailed:[],dirSearchFailed:[],fileReadFailed:[],filesPerMessage:["max"],gitCommandFailed:["command"],gitMissing:[],gitNotFound:[],gitNotRepo:[],gitRunFailed:[],gitStatusUnknown:[],gitUnexpected:["command"],handoffEmpty:[],handoffNoTranscript:[],imageEmpty:[],imageTooLarge:["max","size"],imageTypeUnsupported:["type"],imageUnknownFormat:[],imagesPerMessage:["max"],imagesUnsupported:[],memoryAppeared:["file"],memoryBrokenBlock:["file"],memoryChooseFile:[],memoryGitFailed:["detail"],memoryHardLinks:["file"],memoryLinkOutside:["path"],memoryNotAFile:["label"],memoryNotInstalled:[],memoryNotUtf8:["file"],memoryNoteClaude:[],memoryNoteGone:[],memoryNoteHardLink:["path"],memoryNoteHardLinkCmd:["path"],memoryNoteName:[],memoryNoteOpenCode:[],memorySameFile:["file","other"],memoryViaEncoding:["file"],memoryViaFallback:[],memoryViaFile:["file"],memoryViaNoBlock:["file"],memoryViaNoBlockEither:[],memoryViaNoFolder:[],memoryViaNoIndex:[],memoryViaOutside:["file"],modePendingConfirmation:[],modeUnreachable:["key"],modesUnsupported:[],noteCliNotStarted:[],noteEmpty:[],noteExists:[],noteGone:[],noteIdInvalid:[],noteImageFailed:[],noteImagesMax:["max"],noteImagesUnsupported:[],noteInterrupted:[],noteNoAgent:[],noteNoReadySignal:[],noteSaveFailed:[],noteTooLong:["max"],notesMax:["max"],openToolSubmit:["label"],operationFailed:["detail"],pasteImageFailed:[],pathMissing:[],pathNotRelative:[],pathNullByte:[],pathOpenFailed:[],pathOutside:[],pendingSubmitAnswer:["label"],pendingSubmitPermission:["label"],pickerCliFolder:[],pickerClosed:[],pickerCreateFailed:[],pickerFolderExists:[],pickerListFailed:[],pickerNameChars:[],pickerNameInvalid:[],pickerNoProjectsHere:[],pickerNotListed:[],pickerRootMissing:[],pickerTooMany:[],planReadFailed:[],raw:["text"],relaunchCloseFailed:[],searchFailed:[],shellNotFound:[],submitInterrupted:[],submitStoppedTool:["label"],submitStoppedToolNoLabel:[],submitStoppedWaiting:["label"],submitStoppedWaitingNoLabel:[],tabClosedWhileOpening:[],tabDirGone:[],tabOpenFailed:[],terminalAsleep:[],terminalGone:[],terminalOpenFailed:[],tooManyTabs:["max"],vaultBusyMeasuring:[],vaultBusyMoving:[],vaultBusyWriting:[],vaultCannotWrite:[],vaultCurrentInsideTarget:[],vaultDiskFull:["detail"],vaultFailed:[],vaultIndexNotReady:[],vaultMeasureFirst:[],vaultMemoryFailed:["cwd","detail"],vaultMoveFailed:["detail"],vaultMoving:[],vaultNoCopyYet:[],vaultNotLoaded:[],vaultProjectGone:[],vaultReasonNewerFormat:[],vaultReasonOriginMissing:[],vaultReasonUnsafeId:[],vaultSessionFailed:["agent","detail","session"],vaultSessionMissing:[],vaultTargetCliFolder:[],vaultTargetInsideCurrent:[],vaultTargetNotAbsolute:[],waitingSubmit:["label"]};function og(r){return Object.prototype.hasOwnProperty.call(ig,r)}function jn(r,n=0){const c=Be(r);if(c===null)return null;const y=Me(c.key);if(y===null||y.length===0)return null;const E=c.params;if(E===void 0)return{key:y};const N=Be(E);if(N===null)return null;const D={};for(const[i,a]of Object.entries(N)){if(typeof a=="string"||typeof a=="number"&&Number.isFinite(a)){D[i]=a;continue}const g=n===0?jn(a,n+1):null;if(g===null)return null;D[i]=g}return{key:y,params:D}}function ag(r){if(!Array.isArray(r))return null;const n=[];for(const c of r){const y=jn(c);if(y===null)return null;n.push(y)}return n}const ms=["claude-code","codex","opencode","antigravity"],lg=["gemini-cli","antigravity-ide"],Bo=[...ms,...lg],cg={"gemini-cli":"Gemini CLI","antigravity-ide":"Antigravity IDE"};function ai(r){return ms.includes(r)}const ug=["at-quoted","bare-path-paste"],hg=["at"],dg=["usage-with-variants","token-count","usage-with-catalog","status-line"],fg=["child-session-marker"],pg=["active","missing","other-command","disabled","unreadable"];function uf(r,n=null){return!r.statusSource||n==="unknown"}const hf={sessionIdAtLaunch:!1,resume:!1,statusSource:!1,readySignal:!1,permissionCycle:null,models:null,efforts:null,questionCards:!1,imagesByPath:null,fileMentions:null,rewind:!1,contextWindowSource:null,plans:!1,waitingBlocksSubmit:!1};function gc(r){return r.filter(n=>n.available).length>1}function mg(r){const n=Be(r);if(n===null)return null;const c=n.modes;if(!Array.isArray(c)||c.length===0)return null;const y=[];for(const D of c){if(!fs(D))return null;y.push(D)}const E=n.launchMode;if(!fs(E)||!y.includes(E))return null;const N=ye(n.keyLabel);return N===null?null:{modes:y,launchMode:E,keyLabel:N,approvesPendingOnCycle:n.approvesPendingOnCycle===!0}}function gg(r){const n=Be(r);if(n===null)return null;const c=Ve(n.state,pg),y=ye(n.settingsPath),E=ye(n.scriptPath),N=n.fragment,D=N===null?null:ye(N);return c===null||y===null||E===null||N!==null&&D===null?null:{state:c,settingsPath:y,scriptPath:E,fragment:D}}function _g(r){const n=Be(r);if(n===null)return null;const c=ye(n.value),y=Me(n.label),E=Me(n.family),N=mt(n.long),D=n.window,i=D===null?null:Ue(D);return c===null||y===null||E===null||N===null||D!==null&&i===null?null:{value:c,label:y,family:E,long:N,window:i}}function vg(r){const n=Be(r);if(n===null)return null;const c=ye(n.value),y=Me(n.label);return c===null||y===null?null:{value:c,label:y}}function Qh(r,n){const c=vt(r,n);return c===null||c.length===0?null:c}function yg(r){const n=Be(r);return n===null?{...hf}:{sessionIdAtLaunch:n.sessionIdAtLaunch===!0,resume:n.resume===!0,statusSource:n.statusSource===!0,readySignal:n.readySignal===!0,permissionCycle:mg(n.permissionCycle),models:Qh(n.models,_g),efforts:Qh(n.efforts,vg),questionCards:n.questionCards===!0,imagesByPath:Ve(n.imagesByPath,ug),fileMentions:Ve(n.fileMentions,hg),rewind:n.rewind===!0,contextWindowSource:Ve(n.contextWindowSource,dg),plans:n.plans===!0,waitingBlocksSubmit:n.waitingBlocksSubmit===!0}}function Jh(r){const n=Be(r);if(n===null)return null;const c=Ve(n.id,ms),y=Me(n.label),E=Me(n.command),N=Me(n.installUrl);return c===null||y===null||E===null||N===null?null:{id:c,label:y,command:E,available:n.available===!0,version:Me(n.version),installUrl:N,missingMessage:jn(n.missingMessage),capabilities:yg(n.capabilities),environmentNotice:Ve(n.environmentNotice,fg),statusLine:gg(n.statusLine)}}const wg=["custom","ai","first-message","none"],Sg=["native","vault"],Cg=["idle","scanning","ready"],bg=["agent","shell"],xg=["busy","idle","waiting","offline","unknown"],kg=["server-closed"];function Eg(r){const n=Be(r);if(n===null)return null;const c=ye(n.sessionId),y=Me(n.title),E=Ve(n.titleSource,wg),N=Ue(n.updatedAt),D=Ue(n.sizeBytes);if(c===null||y===null||E===null||N===null||D===null)return null;const i=n.agent===void 0?"claude-code":Ve(n.agent,Bo);if(i===null)return null;const a=Me(n.cwd)??"";return{agent:i,sessionId:c,cwd:a,title:y,titleSource:E,updatedAt:N,sizeBytes:D,archived:n.archived===!0,storage:Ve(n.storage,Sg)??"native",partial:n.partial===!0}}function Lg(r){const n=Be(r);if(n===null)return null;const c=Me(n.cwd),y=mt(n.cwdExists),E=xn(n.sessions,Eg),N=Ue(n.lastActivityAt);if(c===null||y===null||E===null||N===null)return null;const D=ye(n.key);if(D!==null)return{key:D,fallbackName:Me(n.fallbackName)??"",cwd:c,cwdExists:y,sessions:E,lastActivityAt:N};const i=ye(n.slug);return i===null?null:{key:i,fallbackName:c.length===0?i:"",cwd:c,cwdExists:y,sessions:E,lastActivityAt:N}}function Tg(r){const n=Be(r);if(n===null)return null;const c=Ve(n.state,Cg),y=Ue(n.scannedFiles),E=Ue(n.totalFiles);return c===null||y===null||E===null?null:{state:c,scannedFiles:y,totalFiles:E}}function Zh(r){const n=Be(r);if(n===null)return null;const c=ye(n.terminalId),y=Ve(n.kind,bg)??"agent";let E=null;if(y==="agent"&&(E=n.agent===void 0?"claude-code":Ve(n.agent,ms),E===null))return null;const N=Me(n.cwd),D=Me(n.sessionId),i=Me(n.label),a=mt(n.resumed),g=Ue(n.createdAt),_=mt(n.alive);if(c===null||N===null||D===null||i===null||a===null||g===null||_===null)return null;const l=n.exitCode;return{terminalId:c,kind:y,agent:E,cwd:N,sessionId:D,label:i,resumed:a,createdAt:g,alive:_,exitCode:typeof l=="number"?l:null,sleeping:n.sleeping===!0}}const df=["user","assistant"],Rg=["content","attachment"],Mg=["compacted","interrupted","error"],Ag=["cli-plans","project","scratch"],Tl={lastRequestTokens:0,lastOutputTokens:0,lastModel:null,contextWindow:null,contextWindowEstimated:!1,totalInputTokens:0,totalOutputTokens:0,totalCacheReadTokens:0,assistantMessages:0},ed=["waiting","live","unavailable","no-transcript"];function Dg(r){const n=Be(r);if(n===null)return null;const c=Ue(n.inputTokens),y=Ue(n.outputTokens),E=Ue(n.cacheCreationInputTokens),N=Ue(n.cacheReadInputTokens);return c===null||y===null||E===null||N===null?null:{inputTokens:c,outputTokens:y,cacheCreationInputTokens:E,cacheReadInputTokens:N}}function Ig(r){const n=Be(r);if(n===null)return null;const c=ye(n.label);return c===null?null:{label:c,description:Me(n.description)??""}}function Ng(r){const n=Be(r);if(n===null)return null;const c=ye(n.question),y=vt(n.options,Ig);return c===null||y===null||y.length===0?null:{question:c,header:Me(n.header)??"",multiSelect:n.multiSelect===!0,options:y}}function ff(r){const n=Be(r);if(n===null)return null;switch(n.kind){case"text":{const c=Me(n.text),y=mt(n.truncated);return c===null||y===null?null:{kind:"text",text:c,truncated:y}}case"tool-call":{const c=Me(n.toolUseId),y=Me(n.name),E=Me(n.input),N=mt(n.truncated);return c===null||y===null||E===null||N===null?null:{kind:"tool-call",toolUseId:c,name:y,input:E,truncated:N}}case"tool-result":{const c=Me(n.toolUseId),y=Me(n.text),E=mt(n.isError),N=mt(n.truncated),D=Ue(n.imageCount);return c===null||y===null||E===null||N===null||D===null?null:{kind:"tool-result",toolUseId:c,text:y,isError:E,truncated:N,imageCount:D}}case"thinking":return{kind:"thinking"};case"question":{const c=ye(n.toolUseId),y=vt(n.questions,Ng);return c===null||y===null||y.length===0?null:{kind:"question",toolUseId:c,questions:y}}case"image":{const c=Ue(n.index),y=Me(n.mediaType);if(c===null||y===null)return null;const E=n.source==="attachment"?"attachment":"content";return{kind:"image",index:c,mediaType:y,source:E}}case"notice":{const c=Ve(n.notice,Mg);return c===null?null:{kind:"notice",notice:c,detail:Me(n.detail)??""}}default:return null}}function Rl(r){const n=Be(r);if(n===null)return null;const c=ye(n.eventId),y=Ve(n.role,df),E=Ue(n.at),N=vt(n.parts,ff);return c===null||y===null||E===null||N===null?null:{eventId:c,role:y,at:E,parts:N,model:Me(n.model),usage:Dg(n.usage),effort:Me(n.effort),durationMs:Ue(n.durationMs),queued:n.queued===!0}}function td(r){const n=Be(r);if(n===null)return null;const c=Ue(n.lastRequestTokens),y=Ue(n.lastOutputTokens),E=Ue(n.totalInputTokens),N=Ue(n.totalOutputTokens),D=Ue(n.totalCacheReadTokens),i=Ue(n.assistantMessages);if(c===null||y===null||E===null||N===null||D===null||i===null)return null;const a=Me(n.lastEffort);return{lastRequestTokens:c,lastOutputTokens:y,lastModel:Me(n.lastModel),contextWindow:Ue(n.contextWindow),contextWindowEstimated:n.contextWindowEstimated===!0,totalInputTokens:E,totalOutputTokens:N,totalCacheReadTokens:D,assistantMessages:i,...a!==null?{lastEffort:a}:{}}}function Pg(r){const n=Be(r);if(n===null)return null;const c=ye(n.fileName),y=ye(n.title),E=Ue(n.modifiedAt),N=Ue(n.sizeBytes);if(c===null||y===null||E===null||N===null)return null;const D=n.origin,i=Ag.find(g=>g===D)??"cli-plans",a=Me(n.path)??"";return{fileName:c,title:y,origin:i,path:a,exists:n.exists===!0,modifiedAt:E,sizeBytes:N}}function Og(r){const n=Be(r);if(n===null)return null;const c=ye(n.fileName),y=Me(n.text);return c===null||y===null?null:{fileName:c,text:y,truncated:n.truncated===!0}}const pf=[{value:"default",label:"Por defecto",family:"",long:!1,window:null},{value:"opus",label:"Opus",family:"opus",long:!1,window:2e5},{value:"opus[1m]",label:"Opus",family:"opus",long:!0,window:1e6},{value:"sonnet",label:"Sonnet",family:"sonnet",long:!1,window:2e5},{value:"sonnet[1m]",label:"Sonnet",family:"sonnet",long:!0,window:1e6},{value:"haiku",label:"Haiku",family:"haiku",long:!1,window:2e5},{value:"fable",label:"Fable",family:"fable",long:!1,window:2e5},{value:"fable[1m]",label:"Fable",family:"fable",long:!0,window:1e6}];function jg(r){if(r.window===null)return r.label;const n=r.window>=1e6?`${Math.round(r.window/1e6)}M`:`${Math.round(r.window/1e3)}k`;return`${r.label} · ${n}`}function Bg(r,n=pf){const c=Fg(r,n);if(c===null||r===null)return null;const y=r.includes("[1m]");return n.find(E=>E.family===c&&E.long===y)??null}function Fg(r,n=pf){var y;return r===null||r.length===0?null:((y=n.filter(E=>E.family.length>0).sort((E,N)=>N.family.length-E.family.length).find(E=>r.includes(E.family)))==null?void 0:y.family)??null}function Hg(r){return`/model ${r}`}function $g(r){return`/effort ${r}`}const Wg=["staged","unstaged","untracked","conflict"],Ug=["added","modified","deleted","renamed","copied","type-changed","untracked","conflict"],zg=["ready","not-a-repo","git-missing","error"],Ml={state:"not-a-repo",message:null,repoRoot:"",branch:null,head:null,upstream:null,ahead:0,behind:0,changes:[],worktrees:[],truncated:!1,updatedAt:0},qg=["meta","hunk","context","added","removed"];function Vg(r){const n=Be(r);if(n===null)return null;const c=ye(n.path),y=Ve(n.kind,Ug),E=Ve(n.stage,Wg);return c===null||y===null||E===null?null:{path:c,kind:y,stage:E,oldPath:Me(n.oldPath)}}function Kg(r){const n=Be(r);if(n===null)return null;const c=ye(n.path);return c===null?null:{path:c,branch:Me(n.branch),isCurrent:n.isCurrent===!0}}function Gg(r){const n=Be(r);if(n===null)return null;const c=Ve(n.state,zg),y=Me(n.repoRoot),E=Ue(n.ahead),N=Ue(n.behind),D=vt(n.changes,Vg),i=vt(n.worktrees,Kg),a=Ue(n.updatedAt);return c===null||y===null||E===null||N===null||D===null||i===null||a===null?null:{state:c,message:jn(n.message),repoRoot:y,branch:Me(n.branch),head:Me(n.head),upstream:Me(n.upstream),ahead:E,behind:N,changes:D,worktrees:i,truncated:n.truncated===!0,updatedAt:a}}function Xg(r){const n=Be(r);if(n===null)return null;const c=Ve(n.kind,qg),y=Me(n.text);return c===null||y===null?null:{kind:c,text:y,oldLine:Ue(n.oldLine),newLine:Ue(n.newLine)}}function Yg(r){const n=Be(r);if(n===null)return null;const c=ye(n.path),y=mt(n.staged),E=vt(n.lines,Xg);return c===null||y===null||E===null?null:{path:c,staged:y,lines:E,truncated:n.truncated===!0,binary:n.binary===!0,message:jn(n.message)}}const Qg=["dir","file"],Jg=["ignored","always"];function mf(r){const n=Be(r);if(n===null)return null;const c=ye(n.name),y=ye(n.path),E=Ve(n.kind,Qg),N=Ue(n.sizeBytes),D=Ue(n.modifiedAt);if(c===null||y===null||E===null||N===null||D===null)return null;const i=Ve(n.hidden,Jg),a={name:c,path:y,kind:E,sizeBytes:N,modifiedAt:D};return i===null?a:{...a,hidden:i}}function Zg(r){const n=Be(r);if(n===null)return null;const c=Me(n.query),y=vt(n.entries,mf);return c===null||y===null?null:{query:c,entries:y,truncated:n.truncated===!0}}function e_(r){const n=Be(r);if(n===null)return null;const c=Me(n.path),y=vt(n.entries,mf),E=Ue(n.hiddenCount);return c===null||y===null||E===null?null:{path:c,entries:y,truncated:n.truncated===!0,hiddenCount:E}}function t_(r){const n=Be(r);if(n===null)return null;const c=ye(n.path),y=Me(n.text),E=Ue(n.sizeBytes),N=mt(n.binary);return c===null||y===null||E===null||N===null?null:{path:c,language:Me(n.language),text:y,sizeBytes:E,truncated:n.truncated===!0,binary:N}}function n_(r){const n=Be(r);if(n===null)return null;const c=ye(n.pickerId),y=ye(n.path),E=vt(n.entries,D=>ye(D)),N=vt(n.roots,D=>ye(D));return c===null||y===null||E===null||N===null?null:{pickerId:c,path:y,entries:E,roots:N,canGoUp:n.canGoUp===!0,truncated:n.truncated===!0}}const Po="MEMORY.md",_c=["AGENTS.md","CLAUDE.md"],gf=["claude-code","codex","antigravity","opencode"],r_=["outside","encoding"],s_=["create","append-block","replace-block","append-lines","copy"];function i_(r){return{instructionFiles:[..._c],gitMode:r!==null&&r.git.kind==="error"?"version":"ignore",importNative:r!==null&&r.native.pending>0,copyFromMainWorktree:r!==null&&r.git.kind==="repo"&&r.git.worktree!==null&&r.git.worktree.mainHasMemory}}function o_(r){const n=Be(r);if(n===null)return null;const c=Ve(n.name,_c),y=mt(n.exists),E=mt(n.hasBlock),N=mt(n.blockCurrent),D=mt(n.brokenBlock),i=n.problem,a=i===null?null:Ve(i,r_);return c===null||y===null||E===null||N===null||D===null||i!==null&&a===null?null:{name:c,exists:y,hasBlock:E,blockCurrent:N,brokenBlock:D,problem:a}}function a_(r){const n=Be(r);if(n===null)return null;switch(n.kind){case"not-repo":return{kind:"not-repo"};case"error":{const c=jn(n.message);return c===null?null:{kind:"error",message:c}}case"repo":{const c=mt(n.ignored);if(c===null)return null;if(n.worktree===null)return{kind:"repo",ignored:c,worktree:null};const y=Be(n.worktree);if(y===null)return null;const E=ye(y.mainPath),N=mt(y.mainHasMemory);return E===null||N===null?null:{kind:"repo",ignored:c,worktree:{mainPath:E,mainHasMemory:N}}}default:return null}}function l_(r){const n=Be(r);if(n===null)return null;const c=Ve(n.agent,gf),y=ye(n.label),E=mt(n.reaches),N=jn(n.via);return c===null||y===null||E===null||N===null?null:{agent:c,label:y,reaches:E,via:N}}function c_(r){const n=Be(r);if(n===null)return null;const c=ye(n.name),y=Me(n.title),E=Me(n.description),N=Ue(n.sizeBytes),D=Ue(n.modifiedAt);return c===null||y===null||E===null||N===null||D===null?null:{name:c,title:y,description:E,sizeBytes:N,modifiedAt:D}}const u_=["line","command","json"];function h_(r){const n=Be(r);if(n===null)return null;const c=Ve(n.agent,gf),y=ye(n.label),E=ye(n.target),N=Ve(n.kind,u_),D=ye(n.text),i=jn(n.note);return c===null||y===null||E===null||N===null||D===null||i===null?null:{agent:c,label:y,target:E,kind:N,text:D,note:i}}function d_(r){const n=Be(r);if(n===null)return null;const c=ye(n.cwd),y=mt(n.folderExists),E=mt(n.indexExists),N=mt(n.installed),D=vt(n.notes,c_),i=vt(n.files,o_),a=a_(n.git),g=vt(n.reach,l_),_=Be(n.native),l=_===null?null:Ue(_.available),v=_===null?null:Ue(_.pending),S=vt(n.globalFragments,h_);return c===null||y===null||E===null||N===null||D===null||i===null||a===null||g===null||l===null||v===null||S===null?null:{cwd:c,folderExists:y,indexExists:E,installed:N,notes:D,files:i,git:a,reach:g,native:{available:l,pending:v},globalFragments:S}}function nd(r){const n=Be(r);if(n===null)return null;const c=ye(n.file),y=Ve(n.action,s_),E=Me(n.preview),N=Me(n.copiedFrom);return c===null||y===null||E===null?null:{file:c,action:y,preview:E,copiedFrom:N}}function f_(r){const n=Be(r);if(n===null)return null;const c=ye(n.name),y=Me(n.text),E=mt(n.truncated);return c===null||y===null||E===null?null:{name:c,text:y,truncated:E}}const rd=20;function p_(r,n="Nota"){const c=r.text.split(`
|
|
41
|
+
`).map(y=>y.trim()).find(y=>y.length>0);return c===void 0?r.images.length>0?"Imagen":n:c.length>40?`${c.slice(0,40)}…`:c}function m_(r){const n=Be(r);if(n===null)return null;const c=ye(n.imageId),y=ye(n.mediaType),E=Ue(n.bytes);return c===null||y===null||E===null?null:{imageId:c,mediaType:y,bytes:E}}function g_(r){const n=Be(r);if(n===null)return null;const c=ye(n.noteId),y=Me(n.text),E=vt(n.images,m_),N=Ue(n.createdAt),D=Ue(n.updatedAt);return c===null||y===null||E===null?null:{noteId:c,text:y,images:E,createdAt:N??0,updatedAt:D??0}}const _f=3,__=3e4,v_=["results","time"];function gs(r){return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:null}function si(r,n){if(r==null)return null;const c=n(r);return c===null?void 0:c}function vf(r){const n=Be(r);if(n===null)return null;const c=Ve(n.agent,Bo),y=ye(n.sessionId),E=si(n.cwd,Me),N=Me(n.title),D=si(n.eventId,ye),i=si(n.role,v=>Ve(v,df)),a=si(n.at,Ue),g=Me(n.snippet),_=gs(n.matchStart),l=gs(n.matchLength);return c===null||y===null||E===void 0||N===null||D===void 0||i===void 0||a===void 0||g===null||_===null||l===null||_+l>g.length?null:{agent:c,sessionId:y,cwd:E,title:N,eventId:D,role:i,at:a,snippet:g,matchStart:_,matchLength:l}}function y_(r){const n=Be(r);if(n===null)return null;const c=Me(n.query),y=xn(n.hits,vf),E=gs(n.sessionsScanned),N=gs(n.sessionsTotal),D=si(n.truncated,i=>Ve(i,v_));return c===null||y===null||E===null||N===null||E>N||D===void 0?null:{query:c,hits:y,sessionsScanned:E,sessionsTotal:N,truncated:D}}function w_(r){const n=Be(r);if(n===null)return null;const c=Me(n.query),y=xn(n.hits,vf),E=gs(n.sessionsScanned),N=gs(n.sessionsTotal);return c===null||y===null||E===null||N===null||E>N?null:{query:c,hits:y,sessionsScanned:E,sessionsTotal:N}}const S_=["off","idle","measuring","writing","moving"];function jt(r){return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:null}function ri(r,n){if(r==null)return null;const c=n(r);return c===null?void 0:c}function C_(r){const n=Be(r);if(n===null)return null;const c=Ve(n.agent,Bo),y=jt(n.sessions),E=jt(n.eventBytes),N=jt(n.images),D=jt(n.imageBytes),i=jt(n.skippedArchived),a=jt(n.skippedEmpty),g=jt(n.unsupported),_=jt(n.failed),l=ag(n.failureReasons);return c===null||y===null||E===null||N===null||D===null||i===null||a===null||g===null||_===null||l===null?null:{agent:c,sessions:y,eventBytes:E,images:N,imageBytes:D,skippedArchived:i,skippedEmpty:a,unsupported:g,failed:_,failureReasons:l}}function b_(r){const n=Be(r);if(n===null)return null;const c=Ue(n.measuredAt),y=Ue(n.durationMs),E=xn(n.byAgent,C_),N=jt(n.memoryProjects),D=jt(n.memoryBytes);return c===null||y===null||E===null||N===null||D===null?null:{measuredAt:c,durationMs:y,byAgent:E,memoryProjects:N,memoryBytes:D}}function x_(r){const n=Be(r);if(n===null)return null;const c=jt(n.done),y=jt(n.total);return c===null||y===null?null:{done:c,total:y}}function k_(r){const n=Be(r);if(n===null)return null;const c=mt(n.enabled),y=Me(n.dir),E=mt(n.isDefaultDir),N=Ve(n.state,S_),D=jt(n.sessions),i=jt(n.passSessions),a=jt(n.bytes),g=jt(n.pending),_=ri(n.progress,x_),l=ri(n.lastPassAt,Ue),v=ri(n.measurement,b_),S=ri(n.previousDir,Me),C=ri(n.lastError,jn);return c===null||y===null||E===null||N===null||D===null||i===null||a===null||g===null||_===void 0||l===void 0||v===void 0||S===void 0||C===void 0?null:{enabled:c,dir:y,isDefaultDir:E,state:N,progress:_,sessions:D,passSessions:i,bytes:a,lastPassAt:l,pending:g,measurement:v,previousDir:S,lastError:C}}const hs=8,E_="/ws",ec="token",Oo=12*1024*1024,Al=8,sd=10*1024*1024,Dl=4,L_=["sending","prefilled"],T_=["no-delivery","not-ready","send-failed"],R_=["cli-not-found","shell-not-found","spawn-failed","bad-message","unknown-terminal","terminal-asleep","invalid-cwd","too-many-terminals","invalid-path","read-failed","submit-failed","answer-failed","mode-failed","archive-failed","notes-failed","picker-failed","memory-failed","vault-failed","continue-failed","search-failed","agent-unsupported","internal"];function M_(r){const n={model:null,effort:null,contextWindow:null};if(typeof r!="object"||r===null)return n;const c=r;return{model:ye(c.model),effort:ye(c.effort),contextWindow:Ue(c.contextWindow)}}function id(r){return typeof r=="number"&&Number.isInteger(r)&&r>=0?r:null}function Lo(r,n){const c=ye(n.requestId);return c!==null&&(r.requestId=c),r}function A_(r){const n=Be(rg(r));if(n===null)return null;switch(n.type){case"hello":{const c=Ue(n.protocolVersion),y=Me(n.platform),E=Me(n.defaultCwd);return c===null||y===null||E===null?null:{type:"hello",protocolVersion:c,agents:xn(n.agents,Jh)??[],defaultAgent:Ve(n.defaultAgent,ms),platform:y,defaultCwd:E,shellName:ye(n.shellName)}}case"agents":{const c=xn(n.agents,Jh);return c===null?null:{type:"agents",agents:c,defaultAgent:Ve(n.defaultAgent,ms)}}case"terminal.list":{const c=xn(n.terminals,Zh),y=Ll(n.order);return c===null||y===null?null:{type:"terminal.list",terminals:c,order:y}}case"terminal.opened":{const c=ye(n.requestId),y=Zh(n.terminal);return c===null||y===null?null:{type:"terminal.opened",requestId:c,terminal:y}}case"terminal.output":{const c=ye(n.terminalId),y=Me(n.data);return c===null||y===null?null:{type:"terminal.output",terminalId:c,data:y}}case"terminal.replay":{const c=ye(n.terminalId),y=Me(n.data);return c===null||y===null?null:{type:"terminal.replay",terminalId:c,data:y,truncated:n.truncated===!0}}case"terminal.exit":{const c=ye(n.terminalId),y=Ue(n.exitCode);if(c===null||y===null)return null;const E=n.signal;return{type:"terminal.exit",terminalId:c,exitCode:y,signal:typeof E=="number"?E:null}}case"terminal.closed":{const c=ye(n.terminalId);return c===null?null:{type:"terminal.closed",terminalId:c}}case"terminal.activity":{const c=ye(n.terminalId),y=Ve(n.activity,xg);if(c===null||y===null)return null;const E=y==="offline"?Ve(n.offlineReason,kg):null;return E===null?{type:"terminal.activity",terminalId:c,activity:y}:{type:"terminal.activity",terminalId:c,activity:y,offlineReason:E}}case"index.status":{const c=Tg(n.status);return c===null?null:{type:"index.status",status:c}}case"index.projects":{const c=xn(n.projects,Lg);return c===null?null:{type:"index.projects",projects:c,replace:n.replace===!0}}case"conversation.reset":{const c=ye(n.terminalId),y=Me(n.sessionId),E=Ve(n.state,ed),N=xn(n.events,Rl),D=td(n.usage);return c===null||y===null||E===null||N===null||D===null?null:{type:"conversation.reset",terminalId:c,sessionId:y,state:E,events:N,hasMore:n.hasMore===!0,usage:D,permissionMode:fs(n.permissionMode)?n.permissionMode:null,defaults:M_(n.defaults),waitingFor:ye(n.waitingFor),openToolCall:n.openToolCall===!0}}case"conversation.append":{const c=ye(n.terminalId),y=xn(n.events,Rl),E=td(n.usage);return c===null||y===null||E===null?null:{type:"conversation.append",terminalId:c,events:y,usage:E,permissionMode:fs(n.permissionMode)?n.permissionMode:null}}case"conversation.mode":{const c=ye(n.terminalId),y=n.mode;return c===null||!fs(y)?null:{type:"conversation.mode",terminalId:c,mode:y}}case"conversation.waiting":{const c=ye(n.terminalId);return c===null?null:{type:"conversation.waiting",terminalId:c,waitingFor:ye(n.waitingFor)}}case"conversation.toolCall":{const c=ye(n.terminalId),y=mt(n.open);return c===null||y===null?null:{type:"conversation.toolCall",terminalId:c,open:y}}case"conversation.page":{const c=ye(n.terminalId),y=xn(n.events,Rl);return c===null||y===null?null:{type:"conversation.page",terminalId:c,events:y,hasMore:n.hasMore===!0}}case"conversation.turns":{const c=ye(n.terminalId),y=vt(n.turns,E=>{const N=Be(E);if(N===null)return null;const D=ye(N.eventId),i=Ue(N.durationMs);return D===null||i===null?null:{eventId:D,durationMs:i}});return c===null||y===null?null:{type:"conversation.turns",terminalId:c,turns:y}}case"conversation.parts":{const c=ye(n.terminalId),y=vt(n.updates,E=>{const N=Be(E);if(N===null)return null;const D=ye(N.eventId),i=vt(N.parts,ff);return D===null||i===null?null:{eventId:D,parts:i}});return c===null||y===null?null:{type:"conversation.parts",terminalId:c,updates:y}}case"conversation.imageData":{const c=ye(n.terminalId),y=ye(n.eventId),E=Ue(n.index),N=Me(n.mediaType);if(c===null||y===null||E===null||N===null)return null;const D=n.data;return{type:"conversation.imageData",terminalId:c,eventId:y,index:E,source:Ve(n.source,Rg)??"content",mediaType:N,data:typeof D=="string"?D:null}}case"conversation.state":{const c=ye(n.terminalId),y=Ve(n.state,ed);return c===null||y===null?null:{type:"conversation.state",terminalId:c,state:y}}case"git.status":{const c=ye(n.terminalId),y=Gg(n.status);return c===null||y===null?null:{type:"git.status",terminalId:c,status:y}}case"git.diff":{const c=ye(n.terminalId),y=Yg(n.diff);return c===null||y===null?null:{type:"git.diff",terminalId:c,diff:y}}case"files.listing":{const c=ye(n.terminalId),y=e_(n.listing);return c===null||y===null?null:{type:"files.listing",terminalId:c,listing:y}}case"picker.listing":{const c=n_(n.listing);return c===null?null:{type:"picker.listing",listing:c}}case"files.preview":{const c=ye(n.terminalId),y=t_(n.preview);return c===null||y===null?null:{type:"files.preview",terminalId:c,preview:y}}case"conversation.plans":{const c=ye(n.terminalId),y=vt(n.plans,Pg);return c===null||y===null?null:{type:"conversation.plans",terminalId:c,plans:y}}case"plans.content":{const c=ye(n.terminalId),y=Og(n.plan);return c===null||y===null?null:{type:"plans.content",terminalId:c,plan:y}}case"files.results":{const c=ye(n.terminalId),y=Zg(n.result);return c===null||y===null?null:{type:"files.results",terminalId:c,result:y}}case"notes.list":{const c=vt(n.notes,g_);return c===null?null:{type:"notes.list",notes:c}}case"notes.imageData":{const c=ye(n.imageId),y=Me(n.mediaType);if(c===null||y===null)return null;const E=n.data;return{type:"notes.imageData",imageId:c,mediaType:y,data:typeof E=="string"?E:null}}case"memory.status":{const c=ye(n.terminalId),y=d_(n.status);return c===null||y===null?null:{type:"memory.status",terminalId:c,status:y}}case"memory.planned":{const c=ye(n.terminalId),y=vt(n.changes,nd);return c===null||y===null?null:Lo({type:"memory.planned",terminalId:c,changes:y},n)}case"memory.installed":{const c=ye(n.terminalId),y=vt(n.applied,nd);return c===null||y===null?null:Lo({type:"memory.installed",terminalId:c,applied:y},n)}case"memory.imported":{const c=ye(n.terminalId),y=Ll(n.copied),E=Ll(n.skipped);return c===null||y===null||E===null?null:Lo({type:"memory.imported",terminalId:c,copied:y,skipped:E},n)}case"memory.content":{const c=ye(n.terminalId),y=f_(n.note);return c===null||y===null?null:Lo({type:"memory.content",terminalId:c,note:y},n)}case"vault.status":{const c=k_(n.status);return c===null?null:{type:"vault.status",status:c}}case"vault.exported":{const c=ye(n.projectKey),y=Ue(n.sessions);return c===null||y===null?null:{type:"vault.exported",projectKey:c,sessions:y}}case"session.continued":{const c=ye(n.requestId),y=ye(n.terminalId),E=Be(n.source),N=Ve(E==null?void 0:E.agent,Bo),D=ye(E==null?void 0:E.sessionId),i=Me(E==null?void 0:E.title),a=id(n.includedTurns),g=id(n.totalTurns),_=Ve(n.delivery,L_);return c===null||y===null||N===null||D===null||i===null||a===null||g===null||a>g||_===null?null:{type:"session.continued",requestId:c,terminalId:y,source:{agent:N,sessionId:D,title:i},includedTurns:a,totalTurns:g,totalTurnsIsMinimum:n.totalTurnsIsMinimum===!0,delivery:_}}case"composer.prefill":{const c=ye(n.terminalId),y=ye(n.text),E=Ve(n.reason,T_);return c===null||y===null||E===null?null:{type:"composer.prefill",terminalId:c,text:y,reason:E}}case"search.progress":{const c=ye(n.searchId),y=w_(n.progress);return c===null||y===null?null:{type:"search.progress",searchId:c,progress:y}}case"search.results":{const c=ye(n.searchId),y=y_(n.result);return c===null||y===null?null:{type:"search.results",searchId:c,result:y}}case"error":{const c=jn(n.text);if(c===null)return null;const E={type:"error",code:Ve(n.code,R_)??"internal",text:c},N=Me(n.detail);N!==null&&(E.detail=N);const D=ye(n.requestId);return D!==null&&(E.requestId=D),E}default:return null}}function od(r){return JSON.stringify(r)}const D_=/^[A-Za-z]:\\$/;function _s(r,n){return r.length===0?"":n==="win32"?I_(r):N_(r)}function I_(r){let n=r.replace(/\//g,"\\");for(n.startsWith("\\\\?\\UNC\\")?n=`\\\\${n.slice(8)}`:n.startsWith("\\\\?\\")&&(n=n.slice(4)),n=n.startsWith("\\\\")?`\\\\${n.slice(2).replace(/\\+/g,"\\")}`:n.replace(/\\+/g,"\\");n.endsWith("\\")&&!D_.test(n);)n=n.slice(0,-1);return n.toLowerCase()}function yf(r,n,c){return r.length===0||c==="win32"&&r!==n&&r.toLowerCase()===n.toLowerCase()?n:r}function N_(r){let n=r.replace(/\/+/g,"/");for(;n.length>1&&n.endsWith("/");)n=n.slice(0,-1);return n}function P_(r,n,c,y){const E=_s(c.cwd,y);let N=-1;for(const[D,i]of r.entries()){const a=n(i);a===void 0||a.kind!=="agent"||_s(a.cwd,y)===E&&(N=D)}return N===-1?r.length:N+1}function wf(r){return`[Pasted text #${r}]`}function O_(r){return`[Start of pasted text #${r}]`}function j_(r){return`[End of pasted text #${r}]`}function B_(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n([\s\S]*?)\n\[End of pasted text #\2\](?=\n|$)/g}function F_(){return/(^|\n)\[Start of pasted text #(\d{1,6})\]\n/}function H_(){return/\[Pasted text #(\d{1,6})\]/g}const $_="modulepreload",W_=function(r){return"/"+r},ad={},Pn=function(n,c,y){let E=Promise.resolve();if(c&&c.length>0){let D=function(g){return Promise.all(g.map(_=>Promise.resolve(_).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));E=D(c.map(g=>{if(g=W_(g),g in ad)return;ad[g]=!0;const _=g.endsWith(".css"),l=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${l}`))return;const v=document.createElement("link");if(v.rel=_?"stylesheet":$_,_||(v.as="script"),v.crossOrigin="",v.href=g,a&&v.setAttribute("nonce",a),document.head.appendChild(v),_)return new Promise((S,C)=>{v.addEventListener("load",S),v.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${g}`)))})}))}function N(D){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=D,window.dispatchEvent(i),!i.defaultPrevented)throw D}return E.then(D=>{for(const i of D||[])i.status==="rejected"&&N(i.reason);return n().catch(N)})},U_={"agent.composer.imagesRefused":"This CLI doesn't take images from the message box.","agent.continue.discovering":"The session isn't in the history yet: it shows up with the first message.","agent.continue.noConversation":"This tab doesn't have a conversation to continue yet.","agent.continue.noMessages":"This conversation doesn't have any messages to continue yet.","agent.continue.title":"Continue this conversation with another CLI","agent.dot.idle":"Ready, nothing in progress","agent.dot.noStatus":"This CLI doesn't publish its status","agent.dot.open":"CLI open","agent.dot.statusLineOnly":"This CLI only publishes its status with the status line configured","agent.dot.statusLinePending":"The status line hasn't published this conversation's status yet","agent.handoff.notice":"Continued from {{label}}: the agent starts from a transcript of {{turns}}, not from the context it had. Tool results are trimmed and images don't carry over.","agent.handoff.prefill.noDelivery":"The message is in the message box: check it and send it with Enter.","agent.handoff.prefill.notReady":"The CLI wasn't ready in time: the message is in the message box for you to send.","agent.handoff.prefill.sendFailed":"It couldn't be sent automatically: the message is in the message box for you to send.","agent.handoff.sending":"Sending the continuation…","agent.handoff.tabLabel":"Continued: {{title}}","agent.handoff.tabLabelNoTitle":"Continued","agent.handoff.turns.all_one":"the {{count}} turn","agent.handoff.turns.all_other":"the {{count}} turns","agent.handoff.turns.lastManyOfMore_one":"the last {{included}} of more than {{count}} turn","agent.handoff.turns.lastManyOfMore_other":"the last {{included}} of more than {{count}} turns","agent.handoff.turns.lastMany_one":"the last {{included}} of {{count}} turn","agent.handoff.turns.lastMany_other":"the last {{included}} of {{count}} turns","agent.handoff.turns.lastOne":"the last turn of {{total}}","agent.handoff.turns.lastOneOfMore":"the last turn of more than {{total}}","agent.handoff.turns.single":"the only turn","agent.meter.idle.noFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and the project's instructions file already take up context, and the real number shows up with the first response.","agent.meter.idle.statusLine":"The status line hasn't published tokens for this conversation yet. It doesn't start at zero: the number shows up when the CLI runs it, with the first message or when the session resumes.","agent.meter.idle.withFile":"The session hasn't measured any response yet. It doesn't start at zero: the system prompt, the tools and {{file}} already take up context, and the real number shows up with the first response.","agent.meter.origin.catalog":"limit from the CLI's model catalog","agent.meter.origin.estimated":"limit inferred from the measured tokens","agent.meter.setup.disabled":"This CLI only publishes its tokens through its status line, and the app's status line is disabled. Configure explains how.","agent.meter.setup.missing":"This CLI only publishes its tokens through its status line, and it isn't configured yet. Configure explains how.","agent.meter.setup.otherCommand":"This CLI only publishes its tokens through its status line, and you have another status line configured. Configure explains how.","agent.meter.setup.unreadable":"This CLI only publishes its tokens through its status line, and its settings.json couldn't be read. Configure explains how.","agent.mode.blocked":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","agent.mode.title":"{{mode}} mode: {{hint}}. Changing it sends {{key}} to the CLI tab","agent.mode.titleBlind":"{{title}}. Without status line data the app can't tell whether a confirmation is pending; changing the mode at that moment approves it","agent.note.empty":"The note is empty","agent.note.needsTab":"Open a tab first: the conversation opens in its project","agent.note.noReadySignal":"This tab's CLI doesn't say when it's ready, so the note can't be sent","agent.note.send":"Send the note to the agent in a new conversation in {{cwd}}","agent.openBlocked":"Opening a tab in this project…","agent.openTool.noLabel":"The CLI has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.openTool.withLabel":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","agent.serverClosed.noLabel":"The CLI server closed and this tab lost its connection.","agent.serverClosed.relaunch":"Relaunch","agent.serverClosed.relaunching":"Relaunching…","agent.serverClosed.withLabel":"The {{label}} server closed and this tab lost its connection.","agent.session.cliMissing":"{{label}} isn't installed.","agent.shortcuts.antigravity.answerPermission":"Answer a permission request: 1 allows it, 4 rejects it","agent.shortcuts.antigravity.cycleMode":"Change the mode: accept-edits, plan and default (with focus on the terminal)","agent.shortcuts.antigravity.help":"Show the CLI's shortcuts","agent.shortcuts.antigravity.interrupt":"Interrupt the current turn, or cancel a permission request","agent.shortcuts.claudeCode.cancel":"Cancel","agent.shortcuts.claudeCode.cycleMode":"Change the permission mode (with focus on the terminal)","agent.shortcuts.claudeCode.fullOutput":"Show the full output","agent.shortcuts.claudeCode.pasteImage":"Paste an image from the clipboard","agent.shortcuts.claudeCode.pasteText":"Paste text from the clipboard","agent.shortcuts.claudeCode.rewind":"Open the rewind menu","agent.shortcuts.claudeCode.searchHistory":"Search the command history","agent.shortcuts.codex.cycleMode":"Switch between the default mode and Plan (with focus on the terminal)","agent.shortcuts.codex.editPrevious":"Edit a previous message","agent.shortcuts.codex.effort":"Lower / raise the effort","agent.shortcuts.codex.externalEditor":"Edit the message in the external editor","agent.shortcuts.codex.interruptOrExit":"Interrupt, or exit if there's no turn","agent.shortcuts.codex.interruptTurn":"Interrupt the current turn","agent.shortcuts.codex.mention":"Mention a file, a skill or a plugin","agent.shortcuts.codex.note":"Alt + ← / → switch agents inside Codex, but here the app uses them to switch tabs.","agent.shortcuts.codex.queue":"Queue the message while the agent works","agent.shortcuts.codex.searchHistory":"Search the message history","agent.shortcuts.codex.transcript":"Show the transcript","agent.shortcuts.commands":"Commands","agent.shortcuts.composer.newline":"New line without sending","agent.shortcuts.composer.pasteText":"Paste text","agent.shortcuts.composer.pasteWithImages":"Paste text or an image (it stays as a thumbnail)","agent.shortcuts.composer.send":"Send the message","agent.shortcuts.interruptCli":"Interrupt whatever the CLI is doing","agent.shortcuts.leaderThen":"Ctrl + X, then {{key}}","agent.shortcuts.opencode.clearInput":"Clear the input; twice, exit","agent.shortcuts.opencode.commandList":"Command list, with the model variants","agent.shortcuts.opencode.cycleAgent":"Switch agent, build or plan (with focus on the terminal)","agent.shortcuts.opencode.interrupt":"Interrupt (the first press only warns)","agent.shortcuts.opencode.model":"Choose a model","agent.shortcuts.opencode.newSession":"New session: the tab stays tied to the session it was opened with","agent.shortcuts.opencode.newline":"New line","agent.shortcuts.opencode.note":"Ctrl + T switches the model variant inside OpenCode, but the browser keeps it for itself: it's under Ctrl + P.","agent.shortcuts.opencode.paste":"Paste","agent.statusLine.noFragment":"The app's folder has characters the console interprets (such as & % ! or quotes), and with them there's no line the CLI can run: on Windows it runs it with cmd /c and no quote gets through. Moving the configuration folder to a path without those characters fixes it.","agent.statusLine.state.active":"Configured","agent.statusLine.state.disabled":"Disabled (enabled: false)","agent.statusLine.state.missing":"Not configured","agent.statusLine.state.otherCommand":"You have another status line: pasting this one replaces it","agent.statusLine.state.unreadable":"Couldn't read settings.json","agent.thread.discovering":"The session shows up in the history with the first message.","agent.thread.noTranscript":"This conversation comes from a CLI version that didn't leave a readable transcript. It can be resumed from the sidebar, but there's nothing to show here.","agent.waiting.answer":"The CLI is waiting for an answer from you.","agent.waiting.permission":"The CLI is waiting for you to authorize a tool.","agent.waiting.question":"The agent asked you a question: answer it in the thread.","agentMenu.chooseTitle":"Choose which CLI to open with","agentMenu.openWith":"Open with","agentMenu.titleWithAgent":"{{title}} — with {{label}}","app.divider.consoleHeight":"Drag to change the console's height","app.divider.width":"Drag to change the width","app.empty.hint":"Pick a project on the left, or open a session from the history to resume it.","app.empty.newSession":"New session in {{cwd}}","app.empty.noTabs":"No open tabs.","app.empty.opening":"Opening…","app.header.cliVersion":"CLI {{version}}","app.header.shortcuts":"Show keyboard shortcuts","app.markerNotice":"This server was started from inside a CLI session. The <code>{{variable}}</code> variable was removed from the tabs' environment: it turns off history saving, and without that there would be no conversation or context meter. The rest of the environment is left untouched.","app.panel.name":"Panel","app.panel.show":"Show the right panel (Alt+P)","app.picker.project.confirm":"Open here","app.picker.project.confirmTitle":"Open an agent tab in {{path}}","app.picker.project.title":"New project","app.picker.vault.confirm":"Use this folder","app.picker.vault.confirmTitle":"Move the local copy to {{path}}. The current folder stays untouched","app.picker.vault.title":"Local copy folder","app.sidebar.name":"Projects","app.sidebar.show":"Show the project list","app.status.connecting":"Connecting","app.status.failed":"No connection","app.status.open":"Connected","app.status.reconnecting":"Reconnecting","archive.allBlocked_one":"Its only conversation has an open tab. Close it first.","archive.allBlocked_other":"Its {{count}} conversations have an open tab. Close them first.","archive.blockedStays_one":"Another one has an open tab and stays.","archive.blockedStays_other":"{{count}} others have an open tab and stay.","archive.confirm_one":"Archive {{count}} conversation?","archive.confirm_other":"Archive the {{count}} conversations?","archive.withBlocked":"{{confirm}} {{blocked}}","common.cancel":"Cancel","common.close":"Close","common.closeEsc":"Close (Esc)","common.copied":"Copied","common.dismissNotice":"Dismiss the notice","common.gotIt":"Got it","composer.attach":"Attach a file","composer.attachTitle":"Attach a file: a log, a PDF, a document or an image","composer.chip.editHint":"Show and edit the pasted text","composer.chip.editorLabel":"Edit pasted text #{{number}}","composer.chip.pastedTextEmpty":"#{{number}} · Pasted text · empty, won't be sent","composer.chip.pastedText_one":"#{{number}} · Pasted text · {{count}} line","composer.chip.pastedText_other":"#{{number}} · Pasted text · {{count}} lines","composer.chip.remove":"Remove","composer.pastedImage":"pasted image","composer.placeholder.ended":"This tab's session has ended.","composer.placeholder.ready":"Type your message.","composer.placeholder.sleeping":"This tab doesn't have the CLI open yet.","composer.problem.empty":'"{{name}}" is empty.',"composer.problem.imageTooBig":"The image is {{size}} MB; the maximum is {{max}} MB.","composer.problem.imageUnreadable":"Couldn't read the image from the clipboard.","composer.problem.tooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"composer.problem.tooManyFiles_one":"Up to {{count}} file per message.","composer.problem.tooManyFiles_other":"Up to {{count}} files per message.","composer.problem.tooManyImages_one":"Up to {{count}} image per message.","composer.problem.tooManyImages_other":"Up to {{count}} images per message.","composer.problem.unreadable":`Couldn't read "{{name}}".`,"composer.resizeTitle":"Drag to resize the message box","composer.send":"Send","composer.sendTitle":"Send (Enter)","composer.stop":"Stop","composer.stopTitle":"Interrupt whatever the CLI is doing (Esc)","console.collapse":"Collapse. The processes keep running: to end them, use each terminal's ×","console.name":"Console","console.noShell":"No system console was found to open.","console.openAnother":"Open another {{shell}} in {{cwd}}","console.openAnyIn":"Open a console in {{cwd}}","console.openIn":"Open {{shell}} in {{cwd}}","console.tab.close":"Close this terminal and end its process","console.tab.exited":"Exited with code {{code}}","console.tab.label":"Terminal {{number}}","console.tab.title":"{{shell}} {{number}} in {{cwd}}","continue.menuLabel":"Continue with","controls.effort.high":"High","controls.effort.inUse":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab","controls.effort.inUseSaved":"Effort in use: {{effort}}. Changing it sends /effort to the CLI tab, and the CLI saves it as the default for the next tabs","controls.effort.low":"Low","controls.effort.max":"Max","controls.effort.medium":"Medium","controls.effort.noData":"Effort: no data. Not every model has levels — with haiku, /effort leaves no trace","controls.effort.placeholder":"effort — no data","controls.effort.provisional":"Effort from your configuration: {{effort}}. No response has confirmed it yet","controls.effort.xhigh":"Very high","controls.model.default":"Default","controls.model.inUse":"Model in use: {{model}}. Changing it sends /model to the CLI tab","controls.model.inUseSaved":"Model in use: {{model}}. Changing it sends /model to the CLI tab, and the CLI saves it as the default for the next tabs","controls.model.noData":"Model: there hasn't been any response in this session yet","controls.model.placeholder":"model — no data","controls.model.provisional":"Model from your configuration: {{model}}. No response has confirmed it yet","conversation.answerUnconfirmed":"The CLI didn't confirm this answer. Try again, or answer in the CLI tab.","diff.binary":"Binary file: there's no diff to show.","diff.noChanges":"No changes.","diff.truncated":"The diff was cut off because of its size. The full file is easier to read outside this panel.","files.allHidden":"everything in it is hidden","files.back":"← Files","files.copyFolderPath":"Copy this folder's path, in quotes","files.copyPath":"Copy the path of {{name}}, in quotes","files.empty":"empty","files.hidden.hide":"Hide again what .gitignore and the built-in list exclude","files.hidden.show":"Also show what .gitignore and the built-in list exclude","files.hiddenCount_one":"{{count}} hidden","files.hiddenCount_other":"{{count}} hidden","files.hiddenTitle":"Hidden: .git, node_modules, dist, bin, obj and whatever .gitignore says","files.loading":"loading…","files.menu.copyAbsolute":"Copy absolute path","files.menu.copyRelative":"Copy relative path","files.menu.insertMention":"Insert as @path","files.menu.openWithSystem":"Open with the default app","files.moreEntries":"there are more entries than shown","files.preview.binary":"Binary file: no preview.","files.preview.truncated":"The file was cut off because of its size. Open it with the default app to see all of it.","files.readDirFailed":"Couldn't read the directory.","files.readingDir":"Reading the directory…","files.readingFile":"Reading the file…","files.refresh":"Reload the tree","files.reveal":"Open {{name}} in the system's file explorer","files.revealFolder":"Open this folder in the system's file explorer","files.row.alwaysHidden":"always hidden: .git, node_modules, dist, bin, obj","files.row.ignored":"hidden by .gitignore","files.search.clear":"Clear (Esc)","files.search.more":"there are more results than shown","files.search.moreTitle":"Narrow the search to see them all","files.search.none":"No file with that name.","files.search.placeholder":"Search files by name…","files.search.prompt":"Type to search.","files.search.searching":"Searching…","format.bytes.b":"{{value}} B","format.bytes.gb":"{{value}} GB","format.bytes.kb":"{{value}} KB","format.bytes.mb":"{{value}} MB","format.duration.minutes":"{{value}} min","format.duration.minutesSeconds":"{{minutes}} min {{seconds}} s","format.duration.ms":"{{value}} ms","format.duration.seconds":"{{value}} s","format.duration.underSecond":"less than 1 s","git.aheadBehindTitle":"Commits ahead of and behind the upstream branch","git.backToChanges":"Changes","git.clean":"The working tree is clean.","git.detached":"Detached HEAD","git.detachedAt":"Detached HEAD @ {{head}}","git.group.conflict":"Conflicted","git.group.conflictHint":"They need to be resolved before going on","git.group.staged":"Staged","git.group.stagedHint":"Already added with git add","git.group.unstaged":"Unstaged","git.group.unstagedHint":"Modified in the working tree","git.group.untracked":"Untracked","git.group.untrackedHint":"New files git doesn't know about","git.kind.added":"added","git.kind.conflict":"conflicted","git.kind.copied":"copied","git.kind.deleted":"deleted","git.kind.modified":"modified","git.kind.renamed":"renamed","git.kind.typeChanged":"type changed","git.kind.untracked":"untracked","git.newFolderTitle":"{{path}} — new folder; its contents show up in Files","git.readingDiff":"Reading the diff…","git.refresh":"Refresh the status now","git.stagedTag":"staged","git.truncated":"There are more changes than shown. It usually means a rule is missing from <code>.gitignore</code>.","git.unknownState":"The repository's status isn't known yet.","git.upstreamTitle":"Upstream branch: {{upstream}}","git.worktrees.detached":"detached","git.worktrees.heading":"Other worktrees","git.worktrees.headingTitle":"Other working trees of this repository","header.locale.auto":"Automatic (browser: {{name}})","header.locale.title":"Language: {{name}}","header.locale.titleAuto":"Language: {{name}} (automatic, from the browser)","memory.action.appendBlock":"the block will be added at the end","memory.action.appendLines":"lines will be added at the end","memory.action.copy":"will be copied","memory.action.create":"will be created","memory.action.replaceBlock":"the block will be replaced","memory.back":"← Memory","memory.error.connectionLost":"The connection dropped before the response. Once it reconnects, the status shows what got written.","memory.form.copyFromMain":"Copy the notes from the main worktree","memory.form.existingNotes":"Existing notes","memory.form.files":"Instruction files","memory.form.importNative_one":"Import {{count}} note from Claude Code's memory","memory.form.importNative_other":"Import {{count}} notes from Claude Code's memory","memory.form.noFiles":"Choose at least one instruction file","memory.form.planning":"Calculating…","memory.form.preview":"Preview changes","memory.git.alreadyIgnored":"This repo already ignores <code>.agents/memory/</code>. To track it, that rule has to be removed from <code>.gitignore</code> by hand.","memory.git.blocked":"With git returning an error, it can only be installed without touching .gitignore","memory.git.dontTouch":"Don't touch <code>.gitignore</code>","memory.git.errorHint":"git returned an error","memory.git.errorWarning":"git returned an error, so there's no telling whether the memory is ignored. It can be installed without touching <code>.gitignore</code>.","memory.git.ignore":"Ignore the memory","memory.git.ignoreHint":"recommended","memory.git.version":"Track it","memory.git.versionHint":"for private repos","memory.global.copy":"Copy the snippet","memory.global.intro":"What applies to all your projects goes in <code>~/.agents/global.md</code>. The app doesn't write it: each CLI reads it once you add its snippet.","memory.global.title":"Global memory","memory.index":"Index","memory.intro.what":"Shared memory keeps what the agents learn about this project —decisions, constraints, pitfalls they already ran into— for the next session.","memory.intro.where":"It lives in <code>.agents/memory/</code>: one note per file and an index, <code>MEMORY.md</code>. The four CLIs read it through a marked block in their instructions file. Nothing is written until you confirm the changes.","memory.list.empty":"No notes yet. The agents save them here when they learn something that's useful in another session.","memory.list.notes":"Notes","memory.loading":"Reading the memory…","memory.native.import_one":"Import {{count}} note","memory.native.import_other":"Import {{count}} notes","memory.native.importing":"Importing…","memory.native.pending_one":"Claude Code's own memory has {{count}} note that isn't here.","memory.native.pending_other":"Claude Code's own memory has {{count}} notes that aren't here.","memory.note.loading":"Reading the note…","memory.note.truncated":"The note was cut off because of its size.","memory.plan.back":"Back","memory.plan.changes":"Changes","memory.plan.copiedFrom":"Copy of {{path}}","memory.plan.install":"Install","memory.plan.nothing":"There's nothing to change: the bridge is already up to date.","memory.plan.update":"Update","memory.plan.writing":"Writing…","memory.problem.brokenBlock":"Its block markers are malformed","memory.problem.brokenBlockWarning":"<code>{{file}}</code> has malformed memory block markers: one without its pair, or the block repeated. The app won't touch it until you fix it by hand.","memory.problem.encoding":"It isn't in UTF-8","memory.problem.encodingWarning":"<code>{{file}}</code> isn't in UTF-8 (it looks like UTF-16, which is what <code>></code> writes in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it until then.","memory.problem.outside":"It's a link that points outside the project","memory.problem.outsideWarning":"<code>{{file}}</code> is a link that points outside the project: the app doesn't read or write it.","memory.reach.adjust":"Adjust","memory.reach.adjustTitle":"Choose the bridge's instruction files again","memory.reach.doesNotReach":": doesn't reach the memory, {{via}}","memory.reach.reaches":": reaches the memory through {{via}}","memory.reach.title":"{{label}}: {{via}}","memory.result.imported_one":"Imported {{count}} note.","memory.result.imported_other":"Imported {{count}} notes.","memory.result.installed_one":"Done: {{count}} file changed.","memory.result.installed_other":"Done: {{count}} files changed.","memory.result.nothingChanged":"There was nothing to change: the bridge was already up to date.","memory.result.nothingImported":"There were no new notes to import.","memory.result.skipped_one":"Not overwritten because it already existed with different content: {{files}}.","memory.result.skipped_other":"Not overwritten because they already existed with different content: {{files}}.","memory.result.withSkipped":"{{result}} {{skipped}}","memory.update.button":"Update the bridge","memory.update.missing":"The block is missing from {{files}}.","memory.update.outdatedAndMissing_one":"{{outdated}} has an outdated block; the block is missing from {{missing}}.","memory.update.outdatedAndMissing_other":"{{outdated}} have an outdated block; the block is missing from {{missing}}.","memory.update.outdated_one":"{{files}} has an outdated block.","memory.update.outdated_other":"{{files}} have an outdated block.","meter.configure":"Configure","meter.label":"Context","meter.lastResponseTitle":"The model's last response","meter.modelWithOrigin":"{{model}} — {{origin}}","meter.noTokens":"this CLI doesn't publish tokens","meter.noTokensTitle":"This CLI doesn't publish how many tokens each response uses, so there's nothing to measure.","meter.output":"output {{tokens}}","meter.responses_one":"{{count}} response","meter.responses_other":"{{count}} responses","meter.sessionTitle":"Total for the whole session","meter.sessionTotals_one":"session {{output}} out · {{cache}} cache · {{count}} response","meter.sessionTotals_other":"session {{output}} out · {{cache}} cache · {{count}} responses","meter.unknownModel":"unrecognized model: showing the tokens, not the window size","meter.unknownModelShort":"unrecognized model: no window size","meter.unmeasured":"not measured","meter.windowPercent":"{{percent}}% of the window","mode.acceptEdits.hint":"Accepts file edits without asking","mode.acceptEdits.label":"Accept edits","mode.auto.hint":"The CLI decides on its own which tools to use, without asking","mode.auto.label":"Auto","mode.default.hint":"Asks before each tool that isn't allowed","mode.default.label":"Manual","mode.plan.hint":"Researches and proposes a plan, without touching anything until you approve it","mode.plan.label":"Plan","notes.attach":"Attach an image from a file","notes.closeConfirm":"Closing this note deletes it, along with its images.","notes.closeNote":"Close the note. It's deleted, along with its images","notes.collapse":"Collapse. Notes aren't lost: the × on each tab is what closes them","notes.empty":"No notes. The <b>+</b> opens one; they're for jotting down an idea without leaving what you're doing.","notes.expand":"Expand the notes","notes.imageAlt":"note image","notes.imageFallbackName":"the image","notes.imageOnly":"Image","notes.imageTooBig":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"notes.imageUnavailable":"the image isn't available","notes.lightboxClose":"Click to close","notes.name":"Notes","notes.new":"New note","notes.placeholder":"Jot down an idea. Images can be pasted or dragged here.","notes.readFailed":"Couldn't read the image.","notes.removeImage":"Remove the image","notes.resize":"Drag to change the height","notes.thumbMissing":"missing","notes.tooManyImages_one":"Up to {{count}} image per note.","notes.tooManyImages_other":"Up to {{count}} images per note.","notes.untitled":"Note","panel.cliUnseen":"The CLI wrote something","panel.hide":"Hide the panel (Alt+P)","panel.restoreWidth":"Restore the column's width","panel.tab.cli":"CLI","panel.tab.files":"Files","panel.tab.git":"Changes","panel.tab.memory":"Memory","panel.tab.plans":"Plans","panel.widen":"Widen the column — the CLI's interface needs room to draw diffs and tables","picker.create":"Create","picker.createHere":"Create a folder here","picker.empty":"There are no subfolders here.","picker.goTo":"Go to {{root}}","picker.loading":"Reading the disk...","picker.newFolderName":"Folder name","picker.truncated":"There are more subfolders than fit in the list. Open one to narrow it down.","picker.up":"parent folder","plans.backToList":"Plans","plans.empty":"This conversation hasn't written any documents yet. Plans from plan mode show up here, along with the <code>.md</code> files the agent saves in the project or in its temporary folder.","plans.loading":"Reading the plan…","plans.missing":"missing","plans.missingTitle":"The file is no longer on disk","plans.truncated":"The plan was cut off because of its size.","search.found":"{{hits}} in {{sessions}}","search.hits_one":"{{count}} match","search.hits_other":"{{count}} matches","search.mode.conversations":"In conversations","search.mode.conversationsTitle":"Searches the text of the conversations saved in the local copy, ignoring case and accents","search.mode.titles":"In titles","search.off":"The local copy is off: the search covers what it saved while it was on.","search.placeholder.conversations":"Search the conversations (Enter)","search.placeholder.titles":"Filter projects and sessions","search.role.assistant":"Response","search.role.title":"Title","search.role.user":"Request","search.sessions_one":"{{count}} session","search.sessions_other":"{{count}} sessions","search.status.done":"{{found}}.","search.status.none":"No results","search.status.noneIn":"No results in {{sessions}}.","search.status.progressFound_one":"Searching… {{scanned}} of {{count}} session, {{found}} so far.","search.status.progressFound_other":"Searching… {{scanned}} of {{count}} sessions, {{found}} so far.","search.status.progress_one":"Searching… {{scanned}} of {{count}} session.","search.status.progress_other":"Searching… {{scanned}} of {{count}} sessions.","search.status.searching":"Searching…","search.status.truncatedResults":"{{found}}: these are the first ones, refine the search to see the rest.","search.status.truncatedTime":"{{found}}: the search stopped after {{seconds}} s and {{left}} were left unchecked.","search.tooShort":"Type at least {{min}} characters and press Enter.","searchHook.connectionLost":"The connection to the server was lost: search again.","server.agentUnknown":"This server doesn't know how to launch that CLI.","server.answerInterrupted":"The answer wasn't fully sent: the interruption cut it off.","server.answerInvalid":"The answer doesn't match the question.","server.answerNoFreeText":"This question doesn't accept a written answer: choose one of the options.","server.answerNotPending":"That question is no longer waiting for an answer.","server.answerSendFailed":"The answer couldn't be sent: answer it in the CLI tab.","server.answersUnsupported":"This CLI doesn't take answers from the conversation. Answer it in the CLI tab.","server.archiveOpenTab":"Sessions with an open tab aren't archived. Close it first.","server.attachmentEmpty":'"{{name}}" arrived empty.',"server.attachmentExecutable":`Executables aren't attached: "{{name}}".`,"server.attachmentSaveFailed":"The attached file couldn't be saved.","server.attachmentTooLarge":'"{{name}}" is {{size}} MB; the maximum is {{max}} MB.',"server.badMessage":"Message not recognized by the protocol.","server.cliMissing":`The "{{command}}" command wasn't found in the PATH. Agent Workbench uses the CLI you already have installed: it doesn't include or download it. Install it from {{url}} and start again.`,"server.cliNotFound":"The CLI isn't installed or wasn't found in the PATH.","server.cliNotInstalled":"{{label}} isn't installed or wasn't found in the PATH.","server.cliOpenFailed":"The tab's CLI couldn't be opened.","server.continueFailed":"The continuation couldn't be prepared.","server.continueHistoryMissing":"That conversation's history wasn't found.","server.continueNoFolder":"That conversation doesn't say which folder it ran in.","server.continueNotInHistory":"That conversation isn't in the history: if it just started, try again in a few seconds.","server.continueReadFailed":"That conversation couldn't be read.","server.continueSameCli":"That conversation already belongs to that CLI: to continue it, open it from the sidebar.","server.continueTabFailed":"The continuation's tab couldn't be opened.","server.continueTranscriptFailed":"The continuation's transcript couldn't be saved.","server.conversationNotFollowed":"That conversation is no longer being followed.","server.cwdMissing":"The directory doesn't exist: {{cwd}}","server.cwdNotDir":"It isn't a directory: {{cwd}}","server.diffBinaryUntracked":"Untracked binary file.","server.diffNewEmpty":"New, empty file.","server.diffNoStaged":"There are no staged changes for this file.","server.diffNoUnstaged":"There are no unstaged changes for this file.","server.diffReadFailed":"The diff couldn't be read.","server.dirReadFailed":"The directory couldn't be read.","server.dirSearchFailed":"The directory couldn't be searched.","server.fileReadFailed":"The file couldn't be read.","server.filesPerMessage":"You can attach up to {{max}} files per message.","server.gitCommandFailed":"git {{command}} failed.","server.gitMissing":"git wasn't found in the PATH. The Changes panel needs git installed; the rest of the app works the same.","server.gitNotFound":"git wasn't found in the PATH.","server.gitNotRepo":"This folder isn't inside a git repository.","server.gitRunFailed":"git couldn't be run to read the repository's status.","server.gitStatusUnknown":"The repository's status isn't known yet.","server.gitUnexpected":"Unexpected answer from git {{command}}.","server.handoffEmpty":"That conversation has no messages to continue.","server.handoffNoTranscript":"That conversation has no messages to continue: that CLI didn't leave a readable transcript.","server.imageEmpty":"The image arrived empty.","server.imageTooLarge":"The image is {{size}} MB; the maximum is {{max}} MB.","server.imageTypeUnsupported":"Image type not supported: {{type}}","server.imageUnknownFormat":"The content isn't an image in a known format.","server.imagesPerMessage":"You can attach up to {{max}} images per message.","server.imagesUnsupported":"This CLI doesn't take images from the message box.","server.memoryAppeared":"{{file}} appeared during the installation. Review the changes again.","server.memoryBrokenBlock":"{{file}} has malformed memory block markers (one without its pair, or the block repeated). Fix it by hand: the app won't touch that file in the meantime.","server.memoryChooseFile":"Choose at least one instructions file.","server.memoryGitFailed":"git couldn't be queried ({{detail}}). Without that, there's no telling whether .gitignore needs changes.","server.memoryHardLinks":"{{file}} has hard links: the app doesn't modify it, because writing it would break the link. Add the block by hand.","server.memoryLinkOutside":"{{path}} points outside the project (a link or a junction): the app doesn't write there.","server.memoryNotAFile":"{{label}} exists but isn't a file.","server.memoryNotInstalled":"Install the bridge first: the .agents/memory folder is missing.","server.memoryNotUtf8":"{{file}} isn't UTF-8 (it looks like UTF-16, which is what `>` leaves in Windows PowerShell 5.1). Save it as UTF-8: the app won't touch it in the meantime.","server.memoryNoteClaude":"Add this line at the end. Claude Code imports the file at startup.","server.memoryNoteGone":"That note no longer exists.","server.memoryNoteHardLink":"Hard link. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteHardLinkCmd":"Hard link, in cmd. `~/{{path}}` has to exist first, and the CLI's file must not: if it exists, move what it has into `global.md` and delete it. If your editor saves by replacing the file, the link breaks: in that case copy the content.","server.memoryNoteName":"That name isn't a memory note.","server.memoryNoteOpenCode":"Inside the root object. Absolute path: OpenCode doesn't expand `~` in this key (unverified).","server.memorySameFile":"{{other}} and {{file}} are the same file (a link). Choose just one.","server.memoryViaEncoding":"{{file}} isn't UTF-8","server.memoryViaFallback":"CLAUDE.md (fallback)","server.memoryViaFile":"{{file}}","server.memoryViaNoBlock":"the block is missing in {{file}}","server.memoryViaNoBlockEither":"the block is missing in AGENTS.md or CLAUDE.md","server.memoryViaNoFolder":"the .agents/memory folder is missing","server.memoryViaNoIndex":".agents/memory/MEMORY.md is missing","server.memoryViaOutside":"{{file}} points outside the project","server.modePendingConfirmation":"There's a confirmation pending in the CLI: changing the mode now would approve it. Answer it in the CLI tab.","server.modeUnreachable":"That mode can't be reached from the current one. Change it with {{key}} in the CLI tab.","server.modesUnsupported":"This CLI has no permission modes to change from here.","server.noteCliNotStarted":"That tab's CLI didn't manage to start; the note wasn't sent.","server.noteEmpty":"The note is empty.","server.noteExists":"That note already exists.","server.noteGone":"The note no longer exists.","server.noteIdInvalid":"The note's id isn't valid.","server.noteImageFailed":"An image from the note couldn't be attached.","server.noteImagesMax":"Up to {{max}} images per note.","server.noteImagesUnsupported":"This CLI doesn't take images; the note wasn't sent.","server.noteInterrupted":"The note wasn't fully sent: the interruption cut it off.","server.noteNoAgent":"That tab has no agent to send the note to.","server.noteNoReadySignal":"This CLI doesn't say when it's ready; the note wasn't sent.","server.noteSaveFailed":"The note couldn't be saved.","server.noteTooLong":"A note holds up to {{max}} characters.","server.notesMax":"Up to {{max}} open notes. Close one first.","server.openToolSubmit":"{{label}} has a tool without a result: it may be asking for approval. Answer it in the CLI tab.","server.operationFailed":"The operation couldn't be completed: {{detail}}","server.pasteImageFailed":"The pasted image couldn't be saved.","server.pathMissing":"The path doesn't exist.","server.pathNotRelative":"Only paths relative to the tab's directory are accepted.","server.pathNullByte":"The path contains a null byte.","server.pathOpenFailed":"The path couldn't be opened.","server.pathOutside":"The path goes outside the tab's directory.","server.pendingSubmitAnswer":"{{label}} is waiting for an answer: the message's Enter would answer it. Answer it in the CLI tab.","server.pendingSubmitPermission":"{{label}} is waiting for you to authorize a tool: the message's Enter would approve it. Answer it in the CLI tab.","server.pickerCliFolder":"That folder belongs to the CLI and can't be opened from here.","server.pickerClosed":"That folder picker is no longer open.","server.pickerCreateFailed":"The folder couldn't be created there.","server.pickerFolderExists":"There's already a folder with that name.","server.pickerListFailed":"That folder couldn't be listed.","server.pickerNameChars":"The name has characters that can't be used.","server.pickerNameInvalid":"The folder name isn't valid.","server.pickerNoProjectsHere":"Projects aren't created there: it's the CLI's folder.","server.pickerNotListed":"That folder isn't in the current listing.","server.pickerRootMissing":"That root doesn't exist.","server.pickerTooMany":"Too many folder pickers are open.","server.planReadFailed":"The plan couldn't be read.","server.raw":"{{text}}","server.relaunchCloseFailed":"The tab's CLI couldn't be closed to relaunch it.","server.searchFailed":"The local copy couldn't be searched.","server.shellNotFound":"No system console was found to open.","server.submitInterrupted":"The message wasn't fully sent: the interruption cut it off.","server.submitStoppedTool":"The message wasn't fully sent: {{label}} opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedToolNoLabel":"The message wasn't fully sent: the CLI opened a tool while it was being typed and may be asking for approval. Check the CLI tab.","server.submitStoppedWaiting":"The message wasn't fully sent: {{label}} started waiting for an answer while it was being typed. Answer it before sending another message.","server.submitStoppedWaitingNoLabel":"The message wasn't fully sent: the CLI started waiting for an answer while it was being typed. Answer it before sending another message.","server.tabClosedWhileOpening":"The tab closed while it was opening.","server.tabDirGone":"The tab's directory no longer exists.","server.tabOpenFailed":"The tab couldn't be opened.","server.terminalAsleep":"This tab doesn't have its CLI open. Open it to write to the agent.","server.terminalGone":"The terminal no longer exists.","server.terminalOpenFailed":"The terminal couldn't be opened.","server.tooManyTabs":"You can't open more than {{max}} tabs at once.","server.vaultBusyMeasuring":"The local copy is busy measuring. Try again when it's done.","server.vaultBusyMoving":"The local copy is busy moving to another folder. Try again when it's done.","server.vaultBusyWriting":"The local copy is busy copying. Try again when it's done.","server.vaultCannotWrite":"That folder can't be written to.","server.vaultCurrentInsideTarget":"The current copy can't end up inside the new folder.","server.vaultDiskFull":"Disk full: the pass stopped ({{detail}})","server.vaultFailed":"The local copy operation couldn't be completed.","server.vaultIndexNotReady":"The history is still being read. Measure when it's done.","server.vaultMeasureFirst":"First measure how much it would take.","server.vaultMemoryFailed":"memory of {{cwd}}: {{detail}}","server.vaultMoveFailed":"The local copy couldn't be moved: {{detail}}","server.vaultMoving":"The local copy is moving to another folder. Try again when it's done.","server.vaultNoCopyYet":"There's no local copy yet.","server.vaultNotLoaded":"The local copy isn't loaded.","server.vaultProjectGone":"That project is no longer in the sidebar.","server.vaultReasonNewerFormat":"the existing copy is in a newer format","server.vaultReasonOriginMissing":"the source wasn't found","server.vaultReasonUnsafeId":"a session id that can't be copied","server.vaultSessionFailed":"{{agent}}/{{session}}: {{detail}}","server.vaultSessionMissing":"That session isn't in the local copy.","server.vaultTargetCliFolder":"That folder belongs to a CLI: the local copy isn't kept there.","server.vaultTargetInsideCurrent":"The new folder can't be inside the current copy.","server.vaultTargetNotAbsolute":"The local copy folder has to be an absolute path.","server.waitingSubmit":"{{label}} is waiting for an answer: answer it before sending another message.","session.untitled":"Untitled session","shortcuts.altNumber":"<strong>Alt + number</strong> isn't used either, on purpose: on Windows, Alt with the numeric keypad is how you type characters that aren't on the keyboard (<kbd>Alt + 164</kbd> = ñ). Intercepting it breaks typing accented characters. To switch tabs there are <kbd>Alt + ←</kbd> and <kbd>Alt + →</kbd>.","shortcuts.app.closeTab":"Close the active tab","shortcuts.app.newTab":"New tab in the current tab's directory","shortcuts.app.previousTab":"Go back to the previous tab (outside the terminal: inside, it goes to the CLI)","shortcuts.app.switchTab":"Previous / next tab (also Alt + PgUp / PgDn)","shortcuts.app.togglePanel":"Show or hide the right panel","shortcuts.ariaLabel":"Keyboard shortcuts","shortcuts.browserReserved":"<strong>Ctrl+T</strong>, <strong>Ctrl+W</strong> and <strong>Ctrl+Tab</strong> can't be used: the browser keeps them for its own tabs and the event never reaches the page.","shortcuts.cliHint":"The CLI handles these. The app doesn't intercept them: they reach it as they are. In the terminal, a new line is still <kbd>Ctrl + J</kbd> and images are pasted with <kbd>Alt + V</kbd>; the message box is the one with the keys above.","shortcuts.section.app":"Application","shortcuts.section.cli":"CLI, inside the terminal","shortcuts.section.composer":"In the message box","shortcuts.title":"Shortcuts","sidebar.action.archive":"Archive","sidebar.action.restore":"Restore","sidebar.action.undo":"Undo","sidebar.archived.hide_one":"Hide {{count}} archived","sidebar.archived.hide_other":"Hide {{count}} archived","sidebar.archived.show_one":"Show {{count}} archived","sidebar.archived.show_other":"Show {{count}} archived","sidebar.archived.toggleTitle":"Archived sessions stay on disk; this only shows or hides them","sidebar.empty.noMatch":"Nothing matches the filter.","sidebar.empty.noProjects":"No projects found in the history.","sidebar.hide":"Hide the projects","sidebar.history.button":"Archive history…","sidebar.history.buttonTitle":"Hide a CLI's sessions from before today in one go. Nothing is deleted","sidebar.history.confirm_one":"{{count}} {{label}} session will be hidden; nothing is deleted","sidebar.history.confirm_other":"{{count}} {{label}} sessions will be hidden; nothing is deleted","sidebar.history.count_one":"{{count}} session from before today","sidebar.history.count_other":"{{count}} sessions from before today","sidebar.history.heading":"Archive everything before today","sidebar.history.region":"Archive history","sidebar.indexing":"Indexing {{scanned}} / {{total}}","sidebar.newProject":"New project: choose or create a folder","sidebar.project.archive":"Archive project","sidebar.project.archiveTitle":"Archive the project: hides its conversations from the sidebar. Nothing is deleted","sidebar.project.export":"Export to Markdown","sidebar.project.folderGone":"The folder no longer exists on disk","sidebar.project.missing":"folder not found","sidebar.project.newSession":"New session in this project","sidebar.reindex":"Reindex the history","sidebar.searchMode.label":"Where to search","sidebar.searchMode.titlesTitle":"Filters the list by project name and session title","sidebar.selection.count_one":"{{count}} selected","sidebar.selection.count_other":"{{count}} selected","sidebar.session.archive":"Archive — hides it from the list, nothing is deleted","sidebar.session.blocked":"It has an open tab. Close it first.","sidebar.session.restore":"Restore to the list","sidebar.undo.dismissTitle":"Dismiss the notice; the sessions stay archived","sidebar.undo.text_one":"Archived {{count}} session from {{what}}","sidebar.undo.text_other":"Archived {{count}} sessions from {{what}}","sidebar.vaultLine.lastError":"Last error: {{error}}","sidebar.vaultLine.title":"See the local copy's status and folder","sound.off":"Notification sound muted — click to turn it on","sound.on":"Notification sound on — click to mute","sound.volume":"Notification sound volume","statusLine.benefit":"With the status line configured, this CLI's tabs show their status, the “waiting” bar when it asks for permission to use a tool, and the context meter with the exact window. Without it there's no way to know: the CLI doesn't leave it in any other file.","statusLine.check":"Check","statusLine.checkHint":"The app also notices on its own within a couple of seconds.","statusLine.checking":"Checking…","statusLine.copied":"Copied","statusLine.copy":"Copy","statusLine.copyTitle":"Copy the line to the clipboard","statusLine.lineSection":"The line","statusLine.mergeHint":"Merge it with what the file below already has, without replacing it: if it already has braces, add only the <kbd>statusLine</kbd> key.","statusLine.runsEverywhere":"With the line in place, every CLI session runs it, including the ones you open outside the app, and it needs <kbd>node</kbd> in the PATH.","statusLine.scriptHint":"It only saves the status, model and tokens of each conversation, in the app's folder. It doesn't save your email, your quota or the cost, which the CLI also passes to it, and it doesn't print anything: the CLI's own line stays as it is.","statusLine.scriptSection":"What the script does","statusLine.title":"{{agent}} status line","statusLine.whereHint":"The app doesn't touch that file: you edit it.","statusLine.whereSection":"Where","summary.alsoWorksWith":"Also works with: {{names}}","summary.newerServer":"The server is from a newer version than this page (protocol {{server}}, this page uses {{page}}). Reload the page with F5.","summary.outdatedServer":"The running server is from an older version than this page (protocol {{server}}, this page uses {{page}}). Restart it and reload the page.","tabs.aria.opening":"opening","tabs.aria.working":"working","tabs.close":"Close (Alt+W)","tabs.dot.busy":"The agent is working","tabs.dot.exited":"This tab's CLI has closed","tabs.dot.sleeping":"Sleeping: readable, no CLI open","tabs.dot.waiting":"The CLI is waiting for an answer from you","tabs.new":"New tab (Alt+T)","tabs.state.alive":"active","tabs.state.exited":"exited (code {{code}})","tabs.state.opening":"opening…","tabs.state.sleeping":"sleeping","terminal.exited":"the process exited (code {{code}})","terminal.replayTruncated":"earlier output trimmed","theme.dark":"Dark theme","theme.light":"Light theme","theme.system":"System theme","theme.title":"{{theme}} — click to change","thread.continueWith":"↪ Continue with…","thread.copyMessage":"Copy this message's text","thread.empty.noMessages":"The session doesn't have any messages yet.","thread.empty.unavailable":"This tab doesn't have a known directory, so there's no session file to follow.","thread.empty.waiting":"Waiting for the first message. The session file is created when the conversation starts.","thread.fold.less":"show less","thread.fold.more_one":"show {{count}} line","thread.fold.more_other":"show all {{count}} lines","thread.goToCli":"Go to the CLI tab","thread.image.alt":"message image","thread.image.gone":"the image is no longer in the file","thread.image.loading":"loading image…","thread.image.openTitle":"Click to see it full size","thread.loadEarlier":"Load earlier messages","thread.loadingMore":"Loading...","thread.notice.compacted":"Context compacted","thread.notice.compactedAuto":"Context compacted automatically","thread.notice.error":"The CLI returned an error: {{detail}}","thread.notice.errorNoDetail":"The CLI returned an error","thread.notice.interrupted":"Interrupted","thread.pasted_one":"Pasted text #{{number}} · {{count}} line","thread.pasted_other":"Pasted text #{{number}} · {{count}} lines","thread.question.answerInCli":"Answer in the CLI tab","thread.question.answered":"Answered","thread.question.multi":"multiple","thread.question.pickEach":"Pick an option in each question · you can also answer in the CLI tab","thread.question.pickOne":"Pick an option · you can also answer in the CLI tab","thread.question.placeholder":"Write your answer","thread.question.send":"Send","thread.question.sendAnswers":"Send answers","thread.question.useText":"Use this text","thread.question.writeOther":"Write another answer…","thread.question.writeOtherHint":"To suggest an alternative, or give more context","thread.rewind":"Go back here — opens the CLI's rewind menu in the CLI tab (Esc Esc)","thread.search.next":"Next","thread.search.none":"no results","thread.search.placeholder":"Search the conversation","thread.search.previous":"Previous","thread.tool.error":"error","thread.tool.imagesNotSent_one":"({{count}} image: not sent to the panel)","thread.tool.imagesNotSent_other":"({{count}} images: not sent to the panel)","thread.tool.images_one":"{{count}} image","thread.tool.images_other":"{{count}} images","thread.tool.input":"input","thread.tool.noOutput":"(no output)","thread.tool.orphanResult":"orphan result","thread.tool.result":"result","thread.truncated":"… (truncated)","thread.turn.effort":"effort {{effort}}","thread.turn.queued":"sent while it was working","thread.turn.queuedTitle":"You wrote it while the agent was working: it went into the turn already in progress","thread.turn.you":"You","thread.wake.exited":"This tab's CLI closed.","thread.wake.exitedWithCode":"This tab's CLI closed (exit code {{code}}).","thread.wake.open":"Open CLI","thread.wake.opening":"Opening…","thread.wake.sleeping":"You're reading this conversation without the CLI open. Open it to write to the agent.","threadFont.size.l":"large","threadFont.size.m":"normal","threadFont.size.s":"small","threadFont.title":"Font size: {{current}} (click: {{next}})","time.daysAgo":"{{count}} d ago","time.hoursAgo":"{{count}} h ago","time.justNow":"just now","time.minutesAgo":"{{count}} min ago","tools.run.agent_one":"{{count}} subagent","tools.run.agent_other":"{{count}} subagents","tools.run.callsTo_one":"{{count}} call to {{name}}","tools.run.callsTo_other":"{{count}} calls to {{name}}","tools.run.edit_one":"{{count}} edit","tools.run.edit_other":"{{count}} edits","tools.run.find_one":"{{count}} project search","tools.run.find_other":"{{count}} project searches","tools.run.read_one":"{{count}} file read","tools.run.read_other":"{{count}} files read","tools.run.shell_one":"{{count}} console command","tools.run.shell_other":"{{count}} console commands","tools.run.todo_one":"{{count}} to-do list","tools.run.todo_other":"{{count}} to-do lists","tools.run.web_one":"{{count}} search","tools.run.web_other":"{{count}} searches","vault.archived":"Archived sessions aren't copied, and archiving one that was already copied doesn't delete its copy. The app never deletes anything from this folder.","vault.busy":"A local copy operation is in progress. Wait for it to finish.","vault.button.off":"Local copy: off. Set it up","vault.button.on":"Local copy: on. See the status and the folder","vault.dialog.activate":"Turn on","vault.dialog.activateExistingHint":"The folder already has a copy. Once on, it completes it and keeps it up to date.","vault.dialog.activateExistingTitle":"The folder already has a copy: turning it on completes it","vault.dialog.activateMeasuredHint":"Copies everything measured and, after that, every session that changes and stays quiet for a minute.","vault.dialog.activateMeasuredTitle":"Copies what was measured now and, after that, every session that changes","vault.dialog.changeDir":"Change folder…","vault.dialog.changeDirTitle":"Choose another folder. What was copied gets copied there; this one stays untouched","vault.dialog.defaultDir":"It's the default one, in the app's folder.","vault.dialog.folderSection":"Folder","vault.dialog.inFolder":"In the folder","vault.dialog.lastError":"Last error","vault.dialog.lastPass":"last pass {{when}}","vault.dialog.measure":"Measure","vault.dialog.measureAgain":"Measure again","vault.dialog.measureTitle":"Reads the whole history without writing anything, not even the folder","vault.dialog.needsMeasure":"First measure how much it would take: then “{{activate}}” shows up.","vault.dialog.openFolder":"Open folder","vault.dialog.openFolderTitle":"Open the folder in the system's file explorer","vault.dialog.pendingCalm_one":"{{count}} waiting for its quiet minute","vault.dialog.pendingCalm_other":"{{count}} waiting for their quiet minute","vault.dialog.sizeSection":"How much it would take","vault.dialog.table.archived":"Archived","vault.dialog.table.archivedTitle":"Archived sessions aren't copied","vault.dialog.table.images":"Images","vault.dialog.table.memory_one":"Memory of {{count}} project","vault.dialog.table.memory_other":"Memory of {{count}} projects","vault.dialog.table.sessions":"Sessions","vault.dialog.table.size":"Size","vault.dialog.table.total":"Total","vault.dialog.turnOff":"Turn off","vault.dialog.turnOffHint":"Turning it off doesn't delete anything: what was copied stays in the folder.","vault.dialog.waiting":"Waiting for the server's status…","vault.export.done":"Exported: the folder was opened","vault.export.exporting":"Exporting to Markdown…","vault.export.idle":"Export this project's sessions to Markdown","vault.indexNotReady":"The history is still being read. Measure when it's done.","vault.line.copying":"copying","vault.line.copyingProgress":"copying {{done}} / {{total}}","vault.line.measuring":"measuring","vault.line.moving":"moving to another folder","vault.line.neverCopied":"not copied yet","vault.line.pending_one":"{{count}} waiting","vault.line.pending_other":"{{count}} waiting","vault.mark.copy":"copy","vault.mark.copyTitle":"The CLI's history no longer has this session. The local copy opens, in Markdown.","vault.mark.partial":"partial","vault.mark.partialTitle":"Only the summary and the documents were recovered: the conversation's content is encrypted.","vault.measure.summary":"Measured {{when}}, in {{duration}}","vault.measure.summaryNoWhen":"Measured in {{duration}}","vault.name":"Local copy","vault.note.empty_one":"{{count}} empty","vault.note.empty_other":"{{count}} empty","vault.note.failedWithReasons_one":"{{count}} failed ({{reasons}})","vault.note.failedWithReasons_other":"{{count}} failed ({{reasons}})","vault.note.failed_one":"{{count}} failed","vault.note.failed_other":"{{count}} failed","vault.note.notCopied":"Not copied: {{parts}}","vault.note.unsupported_one":"{{count}} without a full read","vault.note.unsupported_other":"{{count}} without a full read","vault.previousDir":"The previous folder was left untouched: {{dir}}","vault.privacy":"It keeps the same as each CLI's history —messages, tool inputs and results, images— in a folder of yours. If you put it in a synced folder or in a repository, all that travels with it.","vault.sessions_one":"{{count}} session","vault.sessions_other":"{{count}} sessions","vault.state.measuring":"Measuring…","vault.state.measuringProgress":"Measuring… {{done}} / {{total}}","vault.state.moving":"Moving to another folder…","vault.state.off":"Off","vault.state.on":"On","vault.state.writing":"Copying…","vault.state.writingProgress":"Copying… {{done}} / {{total}}","workspace.connectFailed":"Couldn't connect to the local server. Open the URL it printed at startup again."},vc=["en","es","de","fr","pt-BR","ru","ja","ko","zh-CN"],Sf="en",Il={en:"English",es:"Español",de:"Deutsch",fr:"Français","pt-BR":"Português (Brasil)",ru:"Русский",ja:"日本語",ko:"한국어","zh-CN":"简体中文"},z_={en:"EN",es:"ES",de:"DE",fr:"FR","pt-BR":"PT",ru:"RU",ja:"JA",ko:"KO","zh-CN":"ZH"},yc={en:"en-US",es:"es-419",de:"de-DE",fr:"fr-FR","pt-BR":"pt-BR",ru:"ru-RU",ja:"ja-JP",ko:"ko-KR","zh-CN":"zh-CN"},q_={es:()=>Pn(()=>import("./es-BWOH-zRt.js"),[]),de:()=>Pn(()=>import("./de-PtmfVEFc.js"),[]),fr:()=>Pn(()=>import("./fr-tY7LZ7vh.js"),[]),"pt-BR":()=>Pn(()=>import("./pt-BR-CxtiCd-u.js"),[]),ru:()=>Pn(()=>import("./ru-C3EXpruH.js"),[]),ja:()=>Pn(()=>import("./ja-CebmU1Hk.js"),[]),ko:()=>Pn(()=>import("./ko-BuKbKnfu.js"),[]),"zh-CN":()=>Pn(()=>import("./zh-CN-DugN9tNb.js"),[])},Cf=U_,tc=new Map([["en",Cf]]),ld=new Map,nc=new Set;let ii=Sf,rc=yc[Sf],cd=0;function bf(r){return vc.includes(r)}function sc(){return ii}function Fo(){return rc}function V_(r){return yc[r]}function xf(r){return nc.add(r),()=>nc.delete(r)}async function kf(r,n=yc[r]){const c=++cd;if(!tc.has(r)&&r!=="en"){const y=await q_[r]();tc.set(r,y.default)}if(c===cd&&!(ii===r&&rc===n)){ii=r,rc=n;for(const y of nc)y()}}function K_(r,n){let c=ld.get(r);return c===void 0&&(c=new Intl.PluralRules(r),ld.set(r,c)),c.select(n)}function ud(r,n,c,y){if(y!==void 0){const E=r[`${c}_${K_(n,y)}`]??r[`${c}_other`];if(E!==void 0)return E}return r[c]}function G_(r,n,c,y){const E=y==null?void 0:y.count,N=typeof E=="number"?E:void 0;return(r===void 0?void 0:ud(r,n,c,N))??ud(Cf,"en",c,N)??c}function Io(r,n){return n===void 0?r:r.replace(/\{\{\s*([A-Za-z0-9_]+)\s*\}\}/g,(c,y)=>{const E=n[y];return E===void 0?c:String(E)})}function Ef(r,n){return G_(tc.get(ii),ii,r,n)}function L(r,n){return Io(Ef(r,n),n)}function X_(){return[{keys:"Esc",description:L("agent.shortcuts.codex.interruptTurn")},{keys:"Esc Esc",description:L("agent.shortcuts.codex.editPrevious")},{keys:"Ctrl + C",description:L("agent.shortcuts.codex.interruptOrExit")},{keys:"Alt + , / Alt + .",description:L("agent.shortcuts.codex.effort")},{keys:"Shift + Tab",description:L("agent.shortcuts.codex.cycleMode")},{keys:"Tab",description:L("agent.shortcuts.codex.queue")},{keys:"Ctrl + T",description:L("agent.shortcuts.codex.transcript")},{keys:"Ctrl + R",description:L("agent.shortcuts.codex.searchHistory")},{keys:"@",description:L("agent.shortcuts.codex.mention")},{keys:"/",description:L("agent.shortcuts.commands")},{keys:"Ctrl + G",description:L("agent.shortcuts.codex.externalEditor")}]}function Y_(){return[{keys:"Esc Esc",description:L("agent.shortcuts.opencode.interrupt")},{keys:"Tab / Shift + Tab",description:L("agent.shortcuts.opencode.cycleAgent")},{keys:"Ctrl + P",description:L("agent.shortcuts.opencode.commandList")},{keys:L("agent.shortcuts.leaderThen",{key:"M"}),description:L("agent.shortcuts.opencode.model")},{keys:L("agent.shortcuts.leaderThen",{key:"N"}),description:L("agent.shortcuts.opencode.newSession")},{keys:"Ctrl + J",description:L("agent.shortcuts.opencode.newline")},{keys:"Ctrl + C",description:L("agent.shortcuts.opencode.clearInput")},{keys:"Ctrl + V",description:L("agent.shortcuts.opencode.paste")}]}function Q_(){return[{keys:"Esc",description:L("agent.shortcuts.antigravity.interrupt")},{keys:"Shift + Tab",description:L("agent.shortcuts.antigravity.cycleMode")},{keys:"1 … 4",description:L("agent.shortcuts.antigravity.answerPermission")},{keys:"/",description:L("agent.shortcuts.commands")},{keys:"?",description:L("agent.shortcuts.antigravity.help")}]}function J_(){return[{keys:"Esc",description:L("agent.shortcuts.interruptCli")},{keys:"Esc Esc",description:L("agent.shortcuts.claudeCode.rewind")},{keys:"Ctrl + C",description:L("agent.shortcuts.claudeCode.cancel")},{keys:"Ctrl + R",description:L("agent.shortcuts.claudeCode.searchHistory")},{keys:"Ctrl + O",description:L("agent.shortcuts.claudeCode.fullOutput")},{keys:"Shift + Tab",description:L("agent.shortcuts.claudeCode.cycleMode")},{keys:"Alt + V",description:L("agent.shortcuts.claudeCode.pasteImage")},{keys:"Ctrl + V",description:L("agent.shortcuts.claudeCode.pasteText")}]}const ps={"claude-code":{shortLabel:"CC",get shortcuts(){return J_()},shortcutsNote:null,instructionsFile:"CLAUDE.md",savesModelChoice:!1},codex:{shortLabel:"CX",get shortcuts(){return X_()},get shortcutsNote(){return L("agent.shortcuts.codex.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},opencode:{shortLabel:"OC",get shortcuts(){return Y_()},get shortcutsNote(){return L("agent.shortcuts.opencode.note")},instructionsFile:"AGENTS.md",savesModelChoice:!1},antigravity:{shortLabel:"AG",get shortcuts(){return Q_()},shortcutsNote:null,instructionsFile:"AGENTS.md",savesModelChoice:!0}},Z_={"gemini-cli":"GC","antigravity-ide":"AI"};function ev(r){return ai(r)?ps[r].shortLabel:Z_[r]}function li(r,n){var c;return ai(r)?((c=n.find(y=>y.id===r))==null?void 0:c.label)??r:cg[r]}const tv="Sesion sin titulo";function On(r,n){return n==="none"||r===tv?L("session.untitled"):r}function ic(r){return r.storage==="native"&&ai(r.agent)}function nv(r){return r!==null&&ps[r].savesModelChoice}function rv(r){return r===null?null:ps[r].instructionsFile}function sv(r){return{modeCycle:r.permissionCycle,models:r.models,efforts:r.efforts,imagesAllowed:r.imagesByPath!==null,rewind:r.rewind,questionsAnswerable:r.questionCards,fileMentions:r.fileMentions!==null,plansAvailable:r.plans,contextWindowSource:r.contextWindowSource,noteSendable:r.readySignal}}function iv(r,n){const c=Bg(n,r);return c===null?null:r.find(y=>y.value===c.value)??null}function ov(r,n){return r??n.launchMode}const av={auto:"mode.auto.label",default:"mode.default.label",acceptEdits:"mode.acceptEdits.label",plan:"mode.plan.label"},lv={auto:"mode.auto.hint",default:"mode.default.hint",acceptEdits:"mode.acceptEdits.hint",plan:"mode.plan.hint"};function Lf(r){return L(av[r])}function cv(r){return L(lv[r])}function uv(r,n){return L("agent.mode.title",{mode:Lf(r),hint:cv(r),key:n.keyLabel})}function Tf(r,n){return r.approvesPendingOnCycle&&n!==null}function hv(r,n,c,y){if(Tf(n,y))return L("agent.mode.blocked");const E=uv(r,n);return!n.approvesPendingOnCycle||c?E:L("agent.mode.titleBlind",{title:E})}const dv={active:"agent.statusLine.state.active",missing:"agent.statusLine.state.missing","other-command":"agent.statusLine.state.otherCommand",disabled:"agent.statusLine.state.disabled",unreadable:"agent.statusLine.state.unreadable"};function fv(r){return L(dv[r])}function pv(){return L("agent.statusLine.noFragment")}function mv(r,n){return r.filter(c=>n||c.id!=="plans")}function gv(r,n){return r==="plans"&&!n?"cli":r}function _v(r,n,c){const y=E=>E===null?void 0:n.find(N=>N.id===E);return y(r)??y(c)??n[0]??null}function vv(r){return[{keys:"Enter",description:L("agent.shortcuts.composer.send")},{keys:"Shift + Enter",description:L("agent.shortcuts.composer.newline")},{keys:"Ctrl + V",description:L(r?"agent.shortcuts.composer.pasteWithImages":"agent.shortcuts.composer.pasteText")},{keys:"Esc",description:L("agent.shortcuts.interruptCli")}]}function yv(){return L("agent.composer.imagesRefused")}function wv(r,n,c){return c??(r==="token-count"||r==="status-line"?n.contextWindow:null)}function Sv(r,n){return r==="status-line"?n.lastRequestTokens>0:n.assistantMessages>0}function Cv(r,n){return r===null&&n!==null&&n.state!=="active"}function bv(r){return L(r==="other-command"?"agent.meter.setup.otherCommand":r==="disabled"?"agent.meter.setup.disabled":r==="unreadable"?"agent.meter.setup.unreadable":"agent.meter.setup.missing")}function xv(r,n){return n.contextWindowEstimated?L("agent.meter.origin.estimated"):r==="usage-with-catalog"&&n.contextWindow!==null?L("agent.meter.origin.catalog"):null}function kv(r,n=null){return n==="status-line"?L("agent.meter.idle.statusLine"):r===null?L("agent.meter.idle.noFile"):L("agent.meter.idle.withFile",{file:r})}function Ev(r,n=null){return r==="idle"?L("agent.dot.idle"):r==="unknown"?n===null?L("agent.dot.noStatus"):n.state==="active"?L("agent.dot.statusLinePending"):L("agent.dot.statusLineOnly"):L("agent.dot.open")}function hd(r,n){return r.length===0?!0:r.some(c=>c.id===n&&c.available&&c.capabilities.resume)}function Lv(r,n,c){return r?c?L("agent.note.empty"):L("agent.note.send",{cwd:n??""}):L(n===null?"agent.note.needsTab":"agent.note.noReadySignal")}function Rf(r,n,c){const y=_s(n,c);let E=null;for(const N of r)N.kind!=="agent"||N.agent===null||_s(N.cwd,c)===y&&(E=N.agent);return E}function Mf(r,n){var y;const c=n.filter(E=>E.available);for(const E of r)if(E!==null&&c.some(N=>N.id===E))return E;return((y=c[0])==null?void 0:y.id)??null}function Tv(r){let n=null;for(const c of r){const y=c.agent;ai(y)&&(n===null||c.updatedAt>n.updatedAt)&&(n={agent:y,updatedAt:c.updatedAt})}return(n==null?void 0:n.agent)??null}function Rv(r,n,c,y,E){return Mf([Rf(r,n,c),E],y)}function Mv(r,n,c,y,E){return Mf([Rf(r,n.cwd,c),Tv(n.sessions),E],y)}function Af(r){return r.filter(n=>n.available)}function Av(r,n){const c=r.findIndex(y=>y.id===n);return c===-1?0:c}function Dv(r,n,c){return c<=0?0:((r+n)%c+c)%c}function Iv(r,n,c,y=4){const E=r.bottom+2,N=r.top-2-n.height,D=E+n.height+y<=c.height||N<y?Math.max(y,Math.min(E,c.height-n.height-y)):N;return{left:Math.max(y,Math.min(r.left,c.width-n.width-y)),top:D}}function Nv(r,n,c){const y=r;return y===null||typeof y!="object"||typeof y.contains!="function"?!0:c!==null&&c.contains(r)?!1:y.contains(n)}function Df(r,n,c=!1){return n===null||c||!gc(r)?[]:Af(r).filter(y=>y.id!==n)}function Pv(){return L("agent.continue.title")}function Ov(r,n,c){return n?L("agent.continue.discovering"):r.length===0?L("agent.continue.noConversation"):c?null:L("agent.continue.noMessages")}function jv(r,n,c,y){const E=n>=c&&!y?c===1?L("agent.handoff.turns.single"):L("agent.handoff.turns.all",{count:c}):n===1?y?L("agent.handoff.turns.lastOneOfMore",{total:c}):L("agent.handoff.turns.lastOne",{total:c}):y?L("agent.handoff.turns.lastManyOfMore",{count:c,included:n}):L("agent.handoff.turns.lastMany",{count:c,included:n});return L("agent.handoff.notice",{label:r,turns:E})}const dd=40;function fd(r){const n=r.replace(/\s+/g," ").trim(),c=[...n],y=c.length>dd?`${c.slice(0,dd).join("").trimEnd()}…`:n;return y.length>0?L("agent.handoff.tabLabel",{title:y}):L("agent.handoff.tabLabelNoTitle")}function Bv(){return L("agent.handoff.sending")}function Fv(r){switch(r){case"no-delivery":return L("agent.handoff.prefill.noDelivery");case"not-ready":return L("agent.handoff.prefill.notReady");case"send-failed":return L("agent.handoff.prefill.sendFailed")}}function pd(r,n){return r.trim().length===0?n:`${n}
|
|
42
|
+
|
|
43
|
+
${r}`}function Hv(r,n){return r&&n!==null}function $v(r,n,c){if(!ai(r))return{badge:!0,unavailableTitle:null};const y=n.find(D=>D.id===r),E=n.some(D=>D.available),N=y!==void 0&&!y.available&&E;return{badge:c||N,unavailableTitle:N?L("agent.session.cliMissing",{label:y.label}):null}}function Wv(r,n,c){return r!==null&&n===""&&!c.sessionIdAtLaunch}function Uv(){return L("agent.thread.noTranscript")}function zv(){return L("agent.thread.discovering")}function qv(r,n,c,y,E=null){return!y||!uf(r,E)||!n?null:c===null?L("agent.openTool.noLabel"):L("agent.openTool.withLabel",{label:c})}function If(r,n=!1){return L(r==="permission prompt"?"agent.waiting.permission":r==="question"&&n?"agent.waiting.question":"agent.waiting.answer")}function Vv(r){return r.relaunching?"relaunching":r.offlineReason==="server-closed"&&r.alive?"offer":null}function Kv(r){return r===null?L("agent.serverClosed.noLabel"):L("agent.serverClosed.withLabel",{label:r})}function Gv(){return L("agent.serverClosed.relaunch")}function Xv(){return L("agent.serverClosed.relaunching")}function Yv(r,n){const c=new Map,y=[];for(const[E,N]of r){const D=n.find(i=>i.terminalId===E);D===void 0||D.alive&&N==="exited"?y.push(E):c.set(E,D.alive?N:"exited")}return{phases:c,finished:y}}function Qv(r,n,c){var y;return!c||n===null||((y=r.permissionCycle)==null?void 0:y.approvesPendingOnCycle)!==!0&&!r.waitingBlocksSubmit?null:If(n,r.questionCards)}const Jv=2e4;function Zv(r){if(r.label.length>0)return r.label;const n=r.cwd.split(/[\\/]/).filter(c=>c.length>0);return n[n.length-1]??r.cwd}function e0(r,n,c){const y=r.map(N=>({terminalId:N.terminalId,kind:N.kind,cwd:N.cwd})),E=[];for(const N of n){const D=P_(y.map(i=>i.terminalId),i=>y.find(a=>a.terminalId===i),{cwd:N.cwd},c);E.push({pending:N,index:D,label:Zv(N)}),y.splice(D,0,{terminalId:`pending:${N.requestId}`,kind:"agent",cwd:N.cwd})}return E}function md(r,n,c){const y=_s(n,c);return r.some(E=>_s(E.cwd,c)===y)}function Nf(){return L("agent.openBlocked")}const t0={low:"controls.effort.low",medium:"controls.effort.medium",high:"controls.effort.high",xhigh:"controls.effort.xhigh",max:"controls.effort.max"};function n0(r){const n=t0[r.value];return n===void 0?r.label:L(n)}function r0(r){return r.value==="default"?L("controls.model.default"):jg(r)}function s0({models:r,efforts:n,model:c,effort:y,modelProvisional:E=!1,effortProvisional:N=!1,savesChoice:D=!1,disabled:i,onCommand:a}){const g=r===null?null:iv(r,c),_=g===null&&c!==null;return m.jsxs(m.Fragment,{children:[r!==null&&m.jsxs("select",{className:"agent-select",value:(g==null?void 0:g.value)??"",disabled:i,onChange:l=>{l.target.value.length>0&&a(Hg(l.target.value))},title:c===null?L("controls.model.noData"):E?L("controls.model.provisional",{model:c}):D?L("controls.model.inUseSaved",{model:c}):L("controls.model.inUse",{model:c}),children:[g===null&&m.jsx("option",{value:"",children:_?c??"":L("controls.model.placeholder")}),r.map(l=>m.jsx("option",{value:l.value,children:r0(l)},l.value))]}),n!==null&&m.jsxs("select",{className:"agent-select",value:y??"",disabled:i,onChange:l=>{l.target.value.length>0&&a($g(l.target.value))},title:y===null?L("controls.effort.noData"):N?L("controls.effort.provisional",{effort:y}):D?L("controls.effort.inUseSaved",{effort:y}):L("controls.effort.inUse",{effort:y}),children:[y===null&&m.jsx("option",{value:"",children:L("controls.effort.placeholder")}),n.map(l=>m.jsx("option",{value:l.value,children:n0(l)},l.value))]})]})}function i0({mode:r,cycle:n,disabled:c,waitingFor:y=null,statusKnown:E=!0,onChange:N}){const D=ov(r,n);return m.jsx("select",{className:"agent-select agent-select-mode",value:D,disabled:c||Tf(n,y),onChange:i=>{fs(i.target.value)&&N(i.target.value)},title:hv(D,n,E,y),children:n.modes.map(i=>m.jsx("option",{value:i,children:Lf(i)},i))})}function oc(r){const n=r.replace(/(\r?\n)+$/,"");return n.length===0?0:n.split(`
|
|
44
|
+
`).length}function o0(r,n){return n===0?L("composer.chip.pastedTextEmpty",{number:r}):L("composer.chip.pastedText",{number:r,count:n})}function a0(r){return r.length===0?1:Math.max(...r)+1}function l0(r){const n=new Set;for(const c of r.matchAll(H_()))n.add(Number(c[1]));return[...n].sort((c,y)=>c-y)}const c0=/[^\s([{"'¿¡«]/u,u0=/[\p{L}\p{N}]/u;function h0(r,n,c,y){const E=Math.max(0,Math.min(n,r.length)),N=Math.max(E,Math.min(c,r.length)),D=E>0?r.charAt(E-1):"",i=N<r.length?r.charAt(N):"",a=`${D!==""&&c0.test(D)?" ":""}${wf(y)}${i!==""&&u0.test(i)?" ":""}`;return{text:`${r.slice(0,E)}${a}${r.slice(N)}`,inserted:a,caret:E+a.length}}function Pf(r,n){const c=new RegExp(`( ?)${p0(wf(n))}( ?)`,"g");return r.replace(c,(y,E,N)=>E!==""&&N!==""?" ":"")}function d0(r,n){let c=n;const y=[];for(const E of r){const N=E.text.replace(/\r\n?/g,`
|
|
45
|
+
`).replace(/\n+$/,"");if(N.trim().length===0){c=Pf(c,E.number);continue}y.push(`${O_(E.number)}
|
|
46
|
+
${N}
|
|
47
|
+
${j_(E.number)}`)}return c.trim().length>0&&y.push(c),y.join(`
|
|
48
|
+
|
|
49
|
+
`)}function f0(r,n=!1){const c=r.replace(/\r\n?/g,`
|
|
50
|
+
`),y=[],E=a=>{const g=a.replace(/^\n+|\n+$/g,"");g.trim().length>0&&y.push({kind:"text",text:g})};let N=0;for(const a of c.matchAll(B_())){const g=a[1]??"",_=(a.index??0)+g.length;E(c.slice(N,_)),y.push({kind:"pasted",number:Number(a[2]),text:a[3]??"",complete:!0}),N=(a.index??0)+a[0].length}const D=c.slice(N),i=n?F_().exec(D):null;if(i!==null){const a=i.index+(i[1]??"").length;E(D.slice(0,a)),y.push({kind:"pasted",number:Number(i[2]),text:D.slice(i.index+i[0].length),complete:!1})}else E(D);return y.some(a=>a.kind==="pasted")?y:[{kind:"text",text:r}]}function p0(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ac=1024,lc=ac*1024,gd=lc*1024;function ds(r,n=0){return new Intl.NumberFormat(Fo(),{minimumFractionDigits:n,maximumFractionDigits:n,useGrouping:!1}).format(r)}function Xt(r){return!Number.isFinite(r)||r<ac?L("format.bytes.b",{value:ds(Math.max(0,Math.round(r)||0))}):r<lc?L("format.bytes.kb",{value:ds(Math.round(r/ac))}):r<gd?L("format.bytes.mb",{value:ds(r/lc,1)}):L("format.bytes.gb",{value:ds(r/gd,2)})}function Of(r){const n=Math.floor(r/60),c=r%60;return c===0?L("format.duration.minutes",{value:n}):L("format.duration.minutesSeconds",{minutes:n,seconds:c})}function m0(r){if(r<1e3)return L("format.duration.ms",{value:r});const n=Math.round(r/1e3);return n<60?L("format.duration.seconds",{value:n}):Of(n)}function _d(r){if(!Number.isFinite(r)||r<1e3)return L("format.duration.underSecond");const n=Math.round(r/1e3);return n<60?L("format.duration.seconds",{value:n}):Of(n)}function pr(r,n=Date.now()){if(r<=0)return"";const c=Math.floor((n-r)/6e4);if(c<1)return L("time.justNow");if(c<60)return L("time.minutesAgo",{count:c});const y=Math.floor(c/60);if(y<24)return L("time.hoursAgo",{count:y});const E=Math.floor(y/24);return E<30?L("time.daysAgo",{count:E}):g0(r)}function g0(r){return new Date(r).toLocaleDateString(Fo())}function jf(r){return new Date(r).toLocaleTimeString(Fo(),{hour:"2-digit",minute:"2-digit"})}function Bf(r){return new Intl.ListFormat(Fo(),{type:"conjunction"}).format(r)}var Ff=cf();function Hf({src:r,caption:n,onClose:c}){return B.useEffect(()=>{const y=E=>{E.key==="Escape"&&(E.preventDefault(),E.stopPropagation(),c())};return window.addEventListener("keydown",y,!0),()=>window.removeEventListener("keydown",y,!0)},[c]),Ff.createPortal(m.jsxs("div",{className:"viewer",onClick:c,role:"presentation",children:[m.jsx("div",{className:"viewer-frame",onClick:y=>y.stopPropagation(),children:m.jsx("img",{className:"viewer-image",src:r,alt:n})}),m.jsxs("div",{className:"viewer-bar",children:[m.jsx("span",{className:"viewer-caption",children:n}),m.jsx("button",{className:"viewer-close",onClick:c,title:L("common.closeEsc"),children:"×"})]})]}),document.body)}const _0=5,v0=1200;function Nl(){return crypto.randomUUID()}function y0(r=!0){const[n,c]=B.useState([]),[y,E]=B.useState(null),N=B.useCallback(C=>{if(n.filter(o=>o.kind==="image").length>=Al){E(L("composer.problem.tooManyImages",{count:Al}));return}if(C.size>Oo){const o=Math.round(C.size/1024/1024),u=Oo/1024/1024;E(C.name.length>0?L("composer.problem.tooBig",{name:C.name,size:o,max:u}):L("composer.problem.imageTooBig",{size:o,max:u}));return}const f=new FileReader;f.onload=()=>{const o=f.result;if(typeof o!="string")return;const u=o.indexOf(",");u!==-1&&c(h=>h.filter(d=>d.kind==="image").length>=Al?h:[...h,{id:Nl(),kind:"image",mediaType:C.type,base64:o.slice(u+1),dataUrl:o,bytes:C.size,name:C.name.length>0?C.name:L("composer.pastedImage")}])},f.onerror=()=>E(L("composer.problem.imageUnreadable")),f.readAsDataURL(C)},[n]),D=B.useCallback(C=>{if(n.filter(o=>o.kind==="file").length>=Dl){E(L("composer.problem.tooManyFiles",{count:Dl}));return}if(C.size===0){E(L("composer.problem.empty",{name:C.name}));return}if(C.size>sd){E(L("composer.problem.tooBig",{name:C.name,size:Math.round(C.size/1024/1024),max:sd/1024/1024}));return}const f=new FileReader;f.onload=()=>{const o=f.result;if(typeof o!="string")return;const u=o.indexOf(",");u!==-1&&c(h=>h.filter(d=>d.kind==="file").length>=Dl?h:[...h,{id:Nl(),kind:"file",name:C.name.length>0?C.name:"archivo",base64:o.slice(u+1),bytes:C.size}])},f.onerror=()=>E(L("composer.problem.unreadable",{name:C.name})),f.readAsDataURL(C)},[n]),i=B.useCallback(C=>{const f=Array.from(C),o=f.filter(h=>h.type.startsWith("image/")),u=f.filter(h=>!h.type.startsWith("image/"));if(o.length>0&&!r)E(yv());else for(const h of o)N(h);for(const h of u)D(h)},[N,D,r]),a=B.useCallback((C,f=[])=>{if(C.files.length>0)return i(C.files),{consumed:!0,pastedNumber:null};const o=C.getData("text/plain");if(o.length===0)return{consumed:!1,pastedNumber:null};if(o.split(`
|
|
51
|
+
`).length<_0&&o.length<v0)return{consumed:!1,pastedNumber:null};const u=a0([...n.flatMap(h=>h.kind==="text"?[h.number]:[]),...f]);return c(h=>[...h,{id:Nl(),kind:"text",number:u,text:o,lines:oc(o)}]),{consumed:!0,pastedNumber:u}},[i,n]),g=B.useCallback(C=>{c(f=>f.filter(o=>o.id!==C))},[]),_=B.useCallback((C,f)=>{c(o=>o.map(u=>u.id===C&&u.kind==="text"?{...u,text:f,lines:oc(f)}:u))},[]),l=B.useCallback(C=>{c(C),E(null)},[]),v=B.useCallback(()=>l([]),[l]),S=B.useCallback(()=>E(null),[]);return{items:n,problem:y,acceptPaste:a,acceptFiles:i,remove:g,updateText:_,replace:l,clear:v,dismissProblem:S}}function No({min:r,max:n,value:c,measure:y,onChange:E,onCommit:N,onStart:D}){const i=B.useRef(!1),a=B.useRef(c),g=B.useCallback(v=>{i.current=!0,a.current=c,D==null||D(v),v.currentTarget.setPointerCapture(v.pointerId),v.preventDefault()},[D,c]),_=B.useCallback(v=>{if(!i.current)return;const S=Math.min(n,Math.max(r,y(v)));a.current=S,E(S)},[n,r,y,E]),l=B.useCallback(v=>{i.current&&(i.current=!1,v.currentTarget.releasePointerCapture(v.pointerId),N(a.current))},[N]);return{onPointerDown:g,onPointerMove:_,onPointerUp:l,onPointerCancel:l}}function $t(r,n,c){try{const y=window.localStorage.getItem(r);return y===null?n:c(y)??n}catch{return n}}function Ot(r,n){try{window.localStorage.setItem(r,n)}catch{}}function w0(r,n,c){const y=Number.parseInt(r,10);return Number.isFinite(y)&&y>=n&&y<=c?y:null}const vd=90,S0=260,yd=720,wd="agent-workbench.composer-height";function C0({connection:r,terminalId:n,alive:c,sleeping:y=!1,controls:E,leading:N,imagesAllowed:D=!0,blockedReason:i=null,prefills:a,onPrefillApplied:g,notice:_=null,onDismissNotice:l,onSubmitted:v}){const[S,C]=B.useState(""),[f,o]=B.useState(!1),u=y0(D),h=B.useRef(null),[d,w]=B.useState(()=>$t(wd,S0,Q=>w0(Q,vd,yd))),[R,k]=B.useState(!1),A=B.useCallback(()=>{const Q=h.current;if(Q===null)return;Q.style.height="auto";const V=R?d:Math.min(Q.scrollHeight,d);Q.style.height=`${V}px`},[d,R]);B.useEffect(A,[S,A]);const b=B.useRef(0),T=B.useRef(0),I=No({min:vd,max:yd,value:d,measure:B.useCallback(Q=>b.current-Q.clientY-T.current,[]),onChange:w,onCommit:B.useCallback(Q=>{k(!1),Ot(wd,String(Q))},[]),onStart:B.useCallback(Q=>{const V=h.current,H=V==null?void 0:V.getBoundingClientRect();b.current=(H==null?void 0:H.bottom)??Q.clientY,T.current=((H==null?void 0:H.bottom)??Q.clientY)-Q.clientY-((H==null?void 0:H.height)??0),k(!0)},[])}),W=B.useRef(new Map),O=B.useRef(null),j=B.useRef(S);j.current=S;const z=B.useRef(u.items);z.current=u.items;const{replace:Y}=u;B.useEffect(()=>{var H;const Q=O.current;if(Q===n)return;O.current=n,Q!==null&&W.current.set(Q,{text:j.current,items:z.current});const V=n===null?void 0:W.current.get(n);C((V==null?void 0:V.text)??""),Y((V==null?void 0:V.items)??[]),n!==null&&((H=h.current)==null||H.focus())},[n,Y]);const Z=B.useRef(new Set);B.useEffect(()=>{if(!(a===void 0||a.length===0)){for(const Q of a)if(!Z.current.has(Q.id)){if(Z.current.add(Q.id),Q.terminalId===O.current)C(V=>pd(V,Q.text));else{const V=W.current.get(Q.terminalId);W.current.set(Q.terminalId,{text:pd((V==null?void 0:V.text)??"",Q.text),items:(V==null?void 0:V.items)??[]})}g==null||g(Q.id)}}},[a,g]);const J=B.useCallback(()=>{if(n===null||i!==null)return;const Q=u.items.filter(ee=>ee.kind==="text").map(ee=>({number:ee.number,text:ee.text})),V=u.items.filter(ee=>ee.kind==="image").map(ee=>({mediaType:ee.mediaType,data:ee.base64})),H=u.items.filter(ee=>ee.kind==="file").map(ee=>({name:ee.name,data:ee.base64})),G=d0(Q,S);G.length===0&&V.length===0&&H.length===0||(r.send({type:"agent.submit",terminalId:n,text:G,images:V,...H.length>0?{files:H}:{}}),C(""),u.clear(),v==null||v(n))},[r,n,S,u,i,v]),K=B.useCallback(()=>{n!==null&&r.send({type:"agent.interrupt",terminalId:n})},[r,n]),P=B.useCallback(Q=>{if(Q.key==="Enter"&&!Q.shiftKey&&!Q.altKey){Q.preventDefault(),J();return}Q.key==="Escape"&&(Q.preventDefault(),K())},[J,K]),$=B.useCallback((Q,V)=>{const{inserted:H}=h0(Q.value,Q.selectionStart,Q.selectionEnd,V);let G=!1;try{G=document.execCommand("insertText",!1,H)}catch{G=!1}G||(Q.setRangeText(H,Q.selectionStart,Q.selectionEnd,"end"),C(Q.value))},[]),F=B.useCallback(Q=>{if(Q.clipboardData===null)return;const V=u.acceptPaste(Q.clipboardData,l0(Q.currentTarget.value));V.consumed&&(Q.preventDefault(),V.pastedNumber!==null&&$(Q.currentTarget,V.pastedNumber))},[u,$]),q=B.useCallback(Q=>{u.remove(Q.id),Q.kind==="text"&&C(V=>Pf(V,Q.number))},[u]),ne=B.useRef(null),re=n===null||!c,ie=S.trim().length>0||u.items.some(Q=>Q.kind!=="text"||Q.text.trim().length>0);return m.jsxs("div",{className:`composer${f?" composer-dragging":""}`,onDragOver:Q=>{Array.from(Q.dataTransfer.types).includes("Files")&&(Q.preventDefault(),o(!0))},onDragLeave:()=>o(!1),onDrop:Q=>{Q.preventDefault(),o(!1),u.acceptFiles(Q.dataTransfer.files)},children:[m.jsx("div",{className:"hdivider composer-divider",...I,title:L("composer.resizeTitle")}),_!==null&&m.jsxs("div",{className:"handoff-notice",role:"status",children:[m.jsxs("span",{className:"handoff-notice-text",children:[_.text,_.status!==null&&m.jsx("span",{className:"handoff-notice-status",children:_.status})]}),l!==void 0&&m.jsx("button",{className:"icon-button",onClick:l,title:L("common.dismissNotice"),children:"×"})]}),u.problem!==null&&m.jsxs("div",{className:"composer-problem",children:[m.jsx("span",{children:u.problem}),m.jsx("button",{className:"icon-button",onClick:u.dismissProblem,title:L("common.close"),children:"×"})]}),u.items.length>0&&m.jsx("div",{className:"composer-chips",children:u.items.map(Q=>m.jsx(b0,{item:Q,onRemove:()=>q(Q),onEdit:V=>u.updateText(Q.id,V),onDoneEditing:()=>{var V;return(V=h.current)==null?void 0:V.focus()}},Q.id))}),m.jsx("textarea",{ref:h,className:"composer-input",value:S,rows:1,placeholder:L(re?y?"composer.placeholder.sleeping":"composer.placeholder.ended":"composer.placeholder.ready"),disabled:re,onChange:Q=>C(Q.target.value),onKeyDown:P,onPaste:F,spellCheck:!1}),m.jsxs("div",{className:"composer-bar",children:[m.jsx("input",{ref:ne,type:"file",multiple:!0,hidden:!0,onChange:Q=>{Q.target.files!==null&&u.acceptFiles(Q.target.files),Q.target.value=""}}),m.jsx("button",{className:"icon-button composer-attach",onClick:()=>{var Q;return(Q=ne.current)==null?void 0:Q.click()},disabled:re,title:L("composer.attachTitle"),"aria-label":L("composer.attach"),children:m.jsx("svg",{viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":"true",children:m.jsx("path",{d:"M21.4 11.1 12.3 20.2a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),N,m.jsx("span",{className:"composer-spacer"}),E,m.jsx("button",{className:"composer-stop",onClick:K,disabled:re,title:L("composer.stopTitle"),children:L("composer.stop")}),m.jsx("button",{className:"composer-send",onClick:J,disabled:re||!ie||i!==null,title:i??L("composer.sendTitle"),children:L("composer.send")})]})]})}function b0({item:r,onRemove:n,onEdit:c,onDoneEditing:y}){const[E,N]=B.useState(!1);if(r.kind==="image"){const D=`${r.name} · ${Xt(r.bytes)}`;return m.jsxs("figure",{className:"chip chip-image",title:D,children:[m.jsx("img",{src:r.dataUrl,alt:r.name,onClick:()=>N(!0)}),m.jsx("button",{className:"chip-remove",onClick:n,title:L("composer.chip.remove"),children:"×"}),E&&m.jsx(Hf,{src:r.dataUrl,caption:D,onClose:()=>N(!1)})]})}return r.kind==="file"?m.jsxs("div",{className:"chip chip-text chip-file",title:`${r.name} · ${Xt(r.bytes)}`,children:[m.jsxs("span",{className:"chip-toggle chip-file-label",children:[m.jsx("span",{className:"chip-icon",children:"▤"}),m.jsx("span",{className:"chip-file-name",children:r.name}),m.jsx("span",{className:"chip-file-size",children:Xt(r.bytes)})]}),m.jsx("button",{className:"chip-remove",onClick:n,title:L("composer.chip.remove"),children:"×"})]}):m.jsxs("div",{className:`chip chip-text${E?" chip-open":""}`,children:[m.jsxs("button",{className:"chip-toggle",onClick:()=>N(D=>!D),title:L("composer.chip.editHint"),"aria-expanded":E,children:[m.jsx("span",{className:"chip-icon",children:"¶"}),o0(r.number,r.lines),m.jsx("span",{className:"chip-chevron",children:E?"▾":"▸"})]}),m.jsx("button",{className:"chip-remove",onClick:n,title:L("composer.chip.remove"),children:"×"}),E&&m.jsx("textarea",{className:"chip-editor",value:r.text,onChange:D=>c(D.target.value),onKeyDown:D=>{D.key==="Escape"&&(D.preventDefault(),N(!1),y())},"aria-label":L("composer.chip.editorLabel",{number:r.number}),spellCheck:!1,autoFocus:!0})]})}var Pl={exports:{}},Sd;function x0(){return Sd||(Sd=1,(function(r,n){(function(c,y){r.exports=y()})(self,(()=>(()=>{var c={};return(()=>{var y=c;Object.defineProperty(y,"__esModule",{value:!0}),y.FitAddon=void 0,y.FitAddon=class{activate(E){this._terminal=E}dispose(){}fit(){const E=this.proposeDimensions();if(!E||!this._terminal||isNaN(E.cols)||isNaN(E.rows))return;const N=this._terminal._core;this._terminal.rows===E.rows&&this._terminal.cols===E.cols||(N._renderService.clear(),this._terminal.resize(E.cols,E.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const E=this._terminal._core,N=E._renderService.dimensions;if(N.css.cell.width===0||N.css.cell.height===0)return;const D=this._terminal.options.scrollback===0?0:E.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(i.getPropertyValue("height")),g=Math.max(0,parseInt(i.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),l=a-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),v=g-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-D;return{cols:Math.max(2,Math.floor(v/N.css.cell.width)),rows:Math.max(1,Math.floor(l/N.css.cell.height))}}}})(),c})()))})(Pl)),Pl.exports}var k0=x0(),Ol={exports:{}},Cd;function E0(){return Cd||(Cd=1,(function(r,n){(function(c,y){r.exports=y()})(self,(()=>(()=>{var c={6:(D,i)=>{function a(_){try{const l=new URL(_),v=l.password&&l.username?`${l.protocol}//${l.username}:${l.password}@${l.host}`:l.username?`${l.protocol}//${l.username}@${l.host}`:`${l.protocol}//${l.host}`;return _.toLocaleLowerCase().startsWith(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(_,l,v,S={}){this._terminal=_,this._regex=l,this._handler=v,this._options=S}provideLinks(_,l){const v=g.computeLink(_,this._regex,this._terminal,this._handler);l(this._addCallbacks(v))}_addCallbacks(_){return _.map((l=>(l.leave=this._options.leave,l.hover=(v,S)=>{if(this._options.hover){const{range:C}=l;this._options.hover(v,S,C)}},l)))}};class g{static computeLink(l,v,S,C){const f=new RegExp(v.source,(v.flags||"")+"g"),[o,u]=g._getWindowedLineStrings(l-1,S),h=o.join("");let d;const w=[];for(;d=f.exec(h);){const R=d[0];if(!a(R))continue;const[k,A]=g._mapStrIdx(S,u,0,d.index),[b,T]=g._mapStrIdx(S,k,A,R.length);if(k===-1||A===-1||b===-1||T===-1)continue;const I={start:{x:A+1,y:k+1},end:{x:T,y:b+1}};w.push({range:I,text:R,activate:C})}return w}static _getWindowedLineStrings(l,v){let S,C=l,f=l,o=0,u="";const h=[];if(S=v.buffer.active.getLine(l)){const d=S.translateToString(!0);if(S.isWrapped&&d[0]!==" "){for(o=0;(S=v.buffer.active.getLine(--C))&&o<2048&&(u=S.translateToString(!0),o+=u.length,h.push(u),S.isWrapped&&u.indexOf(" ")===-1););h.reverse()}for(h.push(d),o=0;(S=v.buffer.active.getLine(++f))&&S.isWrapped&&o<2048&&(u=S.translateToString(!0),o+=u.length,h.push(u),u.indexOf(" ")===-1););}return[h,C]}static _mapStrIdx(l,v,S,C){const f=l.buffer.active,o=f.getNullCell();let u=S;for(;C;){const h=f.getLine(v);if(!h)return[-1,-1];for(let d=u;d<h.length;++d){h.getCell(d,o);const w=o.getChars();if(o.getWidth()&&(C-=w.length||1,d===h.length-1&&w==="")){const R=f.getLine(v+1);R&&R.isWrapped&&(R.getCell(0,o),o.getWidth()===2&&(C+=1))}if(C<0)return[v,d]}v++,u=0}return[v,u]}}i.LinkComputer=g}},y={};function E(D){var i=y[D];if(i!==void 0)return i.exports;var a=y[D]={exports:{}};return c[D](a,a.exports,E),a.exports}var N={};return(()=>{var D=N;Object.defineProperty(D,"__esModule",{value:!0}),D.WebLinksAddon=void 0;const i=E(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function g(_,l){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}D.WebLinksAddon=class{constructor(_=g,l={}){this._handler=_,this._options=l}activate(_){this._terminal=_;const l=this._options,v=l.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,v,this._handler,l))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),N})()))})(Ol)),Ol.exports}var L0=E0(),jl={exports:{}},bd;function T0(){return bd||(bd=1,(function(r,n){(function(c,y){r.exports=y()})(self,(()=>(()=>{var c={965:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GlyphRenderer=void 0;const g=a(374),_=a(509),l=a(855),v=a(859),S=a(381),C=11,f=C*Float32Array.BYTES_PER_ELEMENT;let o,u=0,h=0,d=0;class w extends v.Disposable{constructor(k,A,b,T){super(),this._terminal=k,this._gl=A,this._dimensions=b,this._optionsService=T,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const I=this._gl;_.TextureAtlas.maxAtlasPages===void 0&&(_.TextureAtlas.maxAtlasPages=Math.min(32,(0,g.throwIfFalsy)(I.getParameter(I.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,g.throwIfFalsy)(I.getParameter(I.MAX_TEXTURE_SIZE))),this._program=(0,g.throwIfFalsy)((0,S.createProgram)(I,`#version 300 es
|
|
52
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
53
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
54
|
+
layout (location = 2) in vec2 a_offset;
|
|
55
|
+
layout (location = 3) in vec2 a_size;
|
|
56
|
+
layout (location = 4) in float a_texpage;
|
|
57
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
58
|
+
layout (location = 6) in vec2 a_texsize;
|
|
59
|
+
|
|
60
|
+
uniform mat4 u_projection;
|
|
61
|
+
uniform vec2 u_resolution;
|
|
62
|
+
|
|
63
|
+
out vec2 v_texcoord;
|
|
64
|
+
flat out int v_texpage;
|
|
65
|
+
|
|
66
|
+
void main() {
|
|
67
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
68
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
69
|
+
v_texpage = int(a_texpage);
|
|
70
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
71
|
+
}`,(function(Z){let J="";for(let K=1;K<Z;K++)J+=` else if (v_texpage == ${K}) { outColor = texture(u_texture[${K}], v_texcoord); }`;return`#version 300 es
|
|
72
|
+
precision lowp float;
|
|
73
|
+
|
|
74
|
+
in vec2 v_texcoord;
|
|
75
|
+
flat in int v_texpage;
|
|
76
|
+
|
|
77
|
+
uniform sampler2D u_texture[${Z}];
|
|
78
|
+
|
|
79
|
+
out vec4 outColor;
|
|
80
|
+
|
|
81
|
+
void main() {
|
|
82
|
+
if (v_texpage == 0) {
|
|
83
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
84
|
+
} ${J}
|
|
85
|
+
}`})(_.TextureAtlas.maxAtlasPages))),this.register((0,v.toDisposable)((()=>I.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(I.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,g.throwIfFalsy)(I.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,g.throwIfFalsy)(I.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=I.createVertexArray(),I.bindVertexArray(this._vertexArrayObject);const W=new Float32Array([0,0,1,0,0,1,1,1]),O=I.createBuffer();this.register((0,v.toDisposable)((()=>I.deleteBuffer(O)))),I.bindBuffer(I.ARRAY_BUFFER,O),I.bufferData(I.ARRAY_BUFFER,W,I.STATIC_DRAW),I.enableVertexAttribArray(0),I.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const j=new Uint8Array([0,1,2,3]),z=I.createBuffer();this.register((0,v.toDisposable)((()=>I.deleteBuffer(z)))),I.bindBuffer(I.ELEMENT_ARRAY_BUFFER,z),I.bufferData(I.ELEMENT_ARRAY_BUFFER,j,I.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(I.createBuffer()),this.register((0,v.toDisposable)((()=>I.deleteBuffer(this._attributesBuffer)))),I.bindBuffer(I.ARRAY_BUFFER,this._attributesBuffer),I.enableVertexAttribArray(2),I.vertexAttribPointer(2,2,I.FLOAT,!1,f,0),I.vertexAttribDivisor(2,1),I.enableVertexAttribArray(3),I.vertexAttribPointer(3,2,I.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(3,1),I.enableVertexAttribArray(4),I.vertexAttribPointer(4,1,I.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(4,1),I.enableVertexAttribArray(5),I.vertexAttribPointer(5,2,I.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(5,1),I.enableVertexAttribArray(6),I.vertexAttribPointer(6,2,I.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(6,1),I.enableVertexAttribArray(1),I.vertexAttribPointer(1,2,I.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),I.vertexAttribDivisor(1,1),I.useProgram(this._program);const Y=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let Z=0;Z<_.TextureAtlas.maxAtlasPages;Z++)Y[Z]=Z;I.uniform1iv(this._textureLocation,Y),I.uniformMatrix4fv(this._projectionLocation,!1,S.PROJECTION_MATRIX),this._atlasTextures=[];for(let Z=0;Z<_.TextureAtlas.maxAtlasPages;Z++){const J=new S.GLTexture((0,g.throwIfFalsy)(I.createTexture()));this.register((0,v.toDisposable)((()=>I.deleteTexture(J.texture)))),I.activeTexture(I.TEXTURE0+Z),I.bindTexture(I.TEXTURE_2D,J.texture),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_S,I.CLAMP_TO_EDGE),I.texParameteri(I.TEXTURE_2D,I.TEXTURE_WRAP_T,I.CLAMP_TO_EDGE),I.texImage2D(I.TEXTURE_2D,0,I.RGBA,1,1,0,I.RGBA,I.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[Z]=J}I.enable(I.BLEND),I.blendFunc(I.SRC_ALPHA,I.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(k,A,b,T,I,W,O,j,z){this._updateCell(this._vertices.attributes,k,A,b,T,I,W,O,j,z)}_updateCell(k,A,b,T,I,W,O,j,z,Y){u=(b*this._terminal.cols+A)*C,T!==l.NULL_CELL_CODE&&T!==void 0?this._atlas&&(o=j&&j.length>1?this._atlas.getRasterizedGlyphCombinedChar(j,I,W,O,!1):this._atlas.getRasterizedGlyph(T,I,W,O,!1),h=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),I!==Y&&o.offset.x>h?(d=o.offset.x-h,k[u]=-(o.offset.x-d)+this._dimensions.device.char.left,k[u+1]=-o.offset.y+this._dimensions.device.char.top,k[u+2]=(o.size.x-d)/this._dimensions.device.canvas.width,k[u+3]=o.size.y/this._dimensions.device.canvas.height,k[u+4]=o.texturePage,k[u+5]=o.texturePositionClipSpace.x+d/this._atlas.pages[o.texturePage].canvas.width,k[u+6]=o.texturePositionClipSpace.y,k[u+7]=o.sizeClipSpace.x-d/this._atlas.pages[o.texturePage].canvas.width,k[u+8]=o.sizeClipSpace.y):(k[u]=-o.offset.x+this._dimensions.device.char.left,k[u+1]=-o.offset.y+this._dimensions.device.char.top,k[u+2]=o.size.x/this._dimensions.device.canvas.width,k[u+3]=o.size.y/this._dimensions.device.canvas.height,k[u+4]=o.texturePage,k[u+5]=o.texturePositionClipSpace.x,k[u+6]=o.texturePositionClipSpace.y,k[u+7]=o.sizeClipSpace.x,k[u+8]=o.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,g.allowRescaling)(T,z,o.size.x,this._dimensions.device.cell.width)&&(k[u+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):k.fill(0,u,u+C-1-2)}clear(){const k=this._terminal,A=k.cols*k.rows*C;this._vertices.count!==A?this._vertices.attributes=new Float32Array(A):this._vertices.attributes.fill(0);let b=0;for(;b<this._vertices.attributesBuffers.length;b++)this._vertices.count!==A?this._vertices.attributesBuffers[b]=new Float32Array(A):this._vertices.attributesBuffers[b].fill(0);this._vertices.count=A,b=0;for(let T=0;T<k.rows;T++)for(let I=0;I<k.cols;I++)this._vertices.attributes[b+9]=I/k.cols,this._vertices.attributes[b+10]=T/k.rows,b+=C}handleResize(){const k=this._gl;k.useProgram(this._program),k.viewport(0,0,k.canvas.width,k.canvas.height),k.uniform2f(this._resolutionLocation,k.canvas.width,k.canvas.height),this.clear()}render(k){if(!this._atlas)return;const A=this._gl;A.useProgram(this._program),A.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const b=this._vertices.attributesBuffers[this._activeBuffer];let T=0;for(let I=0;I<k.lineLengths.length;I++){const W=I*this._terminal.cols*C,O=this._vertices.attributes.subarray(W,W+k.lineLengths[I]*C);b.set(O,T),T+=O.length}A.bindBuffer(A.ARRAY_BUFFER,this._attributesBuffer),A.bufferData(A.ARRAY_BUFFER,b.subarray(0,T),A.STREAM_DRAW);for(let I=0;I<this._atlas.pages.length;I++)this._atlas.pages[I].version!==this._atlasTextures[I].version&&this._bindAtlasPageTexture(A,this._atlas,I);A.drawElementsInstanced(A.TRIANGLE_STRIP,4,A.UNSIGNED_BYTE,0,T/C)}setAtlas(k){this._atlas=k;for(const A of this._atlasTextures)A.version=-1}_bindAtlasPageTexture(k,A,b){k.activeTexture(k.TEXTURE0+b),k.bindTexture(k.TEXTURE_2D,this._atlasTextures[b].texture),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_S,k.CLAMP_TO_EDGE),k.texParameteri(k.TEXTURE_2D,k.TEXTURE_WRAP_T,k.CLAMP_TO_EDGE),k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,A.pages[b].canvas),k.generateMipmap(k.TEXTURE_2D),this._atlasTextures[b].version=A.pages[b].version}setDimensions(k){this._dimensions=k}}i.GlyphRenderer=w},742:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RectangleRenderer=void 0;const g=a(374),_=a(859),l=a(310),v=a(381),S=8*Float32Array.BYTES_PER_ELEMENT;class C{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,o=0,u=0,h=0,d=0,w=0,R=0;class k extends _.Disposable{constructor(b,T,I,W){super(),this._terminal=b,this._gl=T,this._dimensions=I,this._themeService=W,this._vertices=new C,this._verticesCursor=new C;const O=this._gl;this._program=(0,g.throwIfFalsy)((0,v.createProgram)(O,`#version 300 es
|
|
86
|
+
layout (location = 0) in vec2 a_position;
|
|
87
|
+
layout (location = 1) in vec2 a_size;
|
|
88
|
+
layout (location = 2) in vec4 a_color;
|
|
89
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
90
|
+
|
|
91
|
+
uniform mat4 u_projection;
|
|
92
|
+
|
|
93
|
+
out vec4 v_color;
|
|
94
|
+
|
|
95
|
+
void main() {
|
|
96
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
97
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
98
|
+
v_color = a_color;
|
|
99
|
+
}`,`#version 300 es
|
|
100
|
+
precision lowp float;
|
|
101
|
+
|
|
102
|
+
in vec4 v_color;
|
|
103
|
+
|
|
104
|
+
out vec4 outColor;
|
|
105
|
+
|
|
106
|
+
void main() {
|
|
107
|
+
outColor = v_color;
|
|
108
|
+
}`)),this.register((0,_.toDisposable)((()=>O.deleteProgram(this._program)))),this._projectionLocation=(0,g.throwIfFalsy)(O.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=O.createVertexArray(),O.bindVertexArray(this._vertexArrayObject);const j=new Float32Array([0,0,1,0,0,1,1,1]),z=O.createBuffer();this.register((0,_.toDisposable)((()=>O.deleteBuffer(z)))),O.bindBuffer(O.ARRAY_BUFFER,z),O.bufferData(O.ARRAY_BUFFER,j,O.STATIC_DRAW),O.enableVertexAttribArray(3),O.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const Y=new Uint8Array([0,1,2,3]),Z=O.createBuffer();this.register((0,_.toDisposable)((()=>O.deleteBuffer(Z)))),O.bindBuffer(O.ELEMENT_ARRAY_BUFFER,Z),O.bufferData(O.ELEMENT_ARRAY_BUFFER,Y,O.STATIC_DRAW),this._attributesBuffer=(0,g.throwIfFalsy)(O.createBuffer()),this.register((0,_.toDisposable)((()=>O.deleteBuffer(this._attributesBuffer)))),O.bindBuffer(O.ARRAY_BUFFER,this._attributesBuffer),O.enableVertexAttribArray(0),O.vertexAttribPointer(0,2,O.FLOAT,!1,S,0),O.vertexAttribDivisor(0,1),O.enableVertexAttribArray(1),O.vertexAttribPointer(1,2,O.FLOAT,!1,S,2*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(1,1),O.enableVertexAttribArray(2),O.vertexAttribPointer(2,4,O.FLOAT,!1,S,4*Float32Array.BYTES_PER_ELEMENT),O.vertexAttribDivisor(2,1),this._updateCachedColors(W.colors),this.register(this._themeService.onChangeColors((J=>{this._updateCachedColors(J),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(b){const T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),T.uniformMatrix4fv(this._projectionLocation,!1,v.PROJECTION_MATRIX),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,b.attributes,T.DYNAMIC_DRAW),T.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,b.count)}handleResize(){this._updateViewportRectangle()}setDimensions(b){this._dimensions=b}_updateCachedColors(b){this._bgFloat=this._colorToFloat32Array(b.background),this._cursorFloat=this._colorToFloat32Array(b.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(b){const T=this._terminal,I=this._vertices;let W,O,j,z,Y,Z,J,K,P,$,F,q=1;for(W=0;W<T.rows;W++){for(j=-1,z=0,Y=0,Z=!1,O=0;O<T.cols;O++)J=(W*T.cols+O)*l.RENDER_MODEL_INDICIES_PER_CELL,K=b.cells[J+l.RENDER_MODEL_BG_OFFSET],P=b.cells[J+l.RENDER_MODEL_FG_OFFSET],$=!!(67108864&P),(K!==z||P!==Y&&(Z||$))&&((z!==0||Z&&Y!==0)&&(F=8*q++,this._updateRectangle(I,F,Y,z,j,O,W)),j=O,z=K,Y=P,Z=$);(z!==0||Z&&Y!==0)&&(F=8*q++,this._updateRectangle(I,F,Y,z,j,T.cols,W))}I.count=q}updateCursor(b){const T=this._verticesCursor,I=b.cursor;if(!I||I.style==="block")return void(T.count=0);let W,O=0;I.style!=="bar"&&I.style!=="outline"||(W=8*O++,this._addRectangleFloat(T.attributes,W,I.x*this._dimensions.device.cell.width,I.y*this._dimensions.device.cell.height,I.style==="bar"?I.dpr*I.cursorWidth:I.dpr,this._dimensions.device.cell.height,this._cursorFloat)),I.style!=="underline"&&I.style!=="outline"||(W=8*O++,this._addRectangleFloat(T.attributes,W,I.x*this._dimensions.device.cell.width,(I.y+1)*this._dimensions.device.cell.height-I.dpr,I.width*this._dimensions.device.cell.width,I.dpr,this._cursorFloat)),I.style==="outline"&&(W=8*O++,this._addRectangleFloat(T.attributes,W,I.x*this._dimensions.device.cell.width,I.y*this._dimensions.device.cell.height,I.width*this._dimensions.device.cell.width,I.dpr,this._cursorFloat),W=8*O++,this._addRectangleFloat(T.attributes,W,(I.x+I.width)*this._dimensions.device.cell.width-I.dpr,I.y*this._dimensions.device.cell.height,I.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.count=O}_updateRectangle(b,T,I,W,O,j,z){if(67108864&I)switch(50331648&I){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:f=(16777215&I)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&W){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&W].rgba;break;case 50331648:f=(16777215&W)<<8;break;default:f=this._themeService.colors.background.rgba}b.attributes.length<T+4&&(b.attributes=(0,v.expandFloat32Array)(b.attributes,this._terminal.rows*this._terminal.cols*8)),o=O*this._dimensions.device.cell.width,u=z*this._dimensions.device.cell.height,h=(f>>24&255)/255,d=(f>>16&255)/255,w=(f>>8&255)/255,R=1,this._addRectangle(b.attributes,T,o,u,(j-O)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,h,d,w,R)}_addRectangle(b,T,I,W,O,j,z,Y,Z,J){b[T]=I/this._dimensions.device.canvas.width,b[T+1]=W/this._dimensions.device.canvas.height,b[T+2]=O/this._dimensions.device.canvas.width,b[T+3]=j/this._dimensions.device.canvas.height,b[T+4]=z,b[T+5]=Y,b[T+6]=Z,b[T+7]=J}_addRectangleFloat(b,T,I,W,O,j,z){b[T]=I/this._dimensions.device.canvas.width,b[T+1]=W/this._dimensions.device.canvas.height,b[T+2]=O/this._dimensions.device.canvas.width,b[T+3]=j/this._dimensions.device.canvas.height,b[T+4]=z[0],b[T+5]=z[1],b[T+6]=z[2],b[T+7]=z[3]}_colorToFloat32Array(b){return new Float32Array([(b.rgba>>24&255)/255,(b.rgba>>16&255)/255,(b.rgba>>8&255)/255,(255&b.rgba)/255])}}i.RectangleRenderer=k},310:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderModel=i.COMBINED_CHAR_BIT_MASK=i.RENDER_MODEL_EXT_OFFSET=i.RENDER_MODEL_FG_OFFSET=i.RENDER_MODEL_BG_OFFSET=i.RENDER_MODEL_INDICIES_PER_CELL=void 0;const g=a(296);i.RENDER_MODEL_INDICIES_PER_CELL=4,i.RENDER_MODEL_BG_OFFSET=1,i.RENDER_MODEL_FG_OFFSET=2,i.RENDER_MODEL_EXT_OFFSET=3,i.COMBINED_CHAR_BIT_MASK=2147483648,i.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,g.createSelectionRenderModel)()}resize(_,l){const v=_*l*i.RENDER_MODEL_INDICIES_PER_CELL;v!==this.cells.length&&(this.cells=new Uint32Array(v),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.JoinedCellData=i.WebglRenderer=void 0;const g=a(820),_=a(274),l=a(627),v=a(457),S=a(56),C=a(374),f=a(345),o=a(859),u=a(147),h=a(782),d=a(855),w=a(965),R=a(742),k=a(310),A=a(733);class b extends o.Disposable{constructor(O,j,z,Y,Z,J,K,P,$){super(),this._terminal=O,this._characterJoinerService=j,this._charSizeService=z,this._coreBrowserService=Y,this._coreService=Z,this._decorationService=J,this._optionsService=K,this._themeService=P,this._cursorBlinkStateManager=new o.MutableDisposable,this._charAtlasDisposable=this.register(new o.MutableDisposable),this._observerDisposable=this.register(new o.MutableDisposable),this._model=new k.RenderModel,this._workCell=new h.CellData,this._workCell2=new h.CellData,this._rectangleRenderer=this.register(new o.MutableDisposable),this._glyphRenderer=this.register(new o.MutableDisposable),this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new f.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new f.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new _.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new A.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,K,this._themeService)],this.dimensions=(0,C.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(K.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const F={antialias:!1,depth:!1,preserveDrawingBuffer:$};if(this._gl=this._canvas.getContext("webgl2",F),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextlost",(q=>{console.log("webglcontextlost event received"),q.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(q)}),3e3)}))),this.register((0,g.addDisposableDomListener)(this._canvas,"webglcontextrestored",(q=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((q,ne)=>this._setCanvasDevicePixelDimensions(q,ne))),this.register(this._coreBrowserService.onWindowChange((q=>{this._observerDisposable.value=(0,S.observeDevicePixelDimensions)(this._canvas,q,((ne,re)=>this._setCanvasDevicePixelDimensions(ne,re)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,o.toDisposable)((()=>{var q;for(const ne of this._renderLayers)ne.dispose();(q=this._canvas.parentElement)==null||q.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var O;return(O=this._charAtlas)==null?void 0:O.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(O,j){var z,Y,Z,J;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const K of this._renderLayers)K.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(z=this._rectangleRenderer.value)==null||z.setDimensions(this.dimensions),(Y=this._rectangleRenderer.value)==null||Y.handleResize(),(Z=this._glyphRenderer.value)==null||Z.setDimensions(this.dimensions),(J=this._glyphRenderer.value)==null||J.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var O;for(const j of this._renderLayers)j.handleBlur(this._terminal);(O=this._cursorBlinkStateManager.value)==null||O.pause(),this._requestRedrawViewport()}handleFocus(){var O;for(const j of this._renderLayers)j.handleFocus(this._terminal);(O=this._cursorBlinkStateManager.value)==null||O.resume(),this._requestRedrawViewport()}handleSelectionChanged(O,j,z){for(const Y of this._renderLayers)Y.handleSelectionChanged(this._terminal,O,j,z);this._model.selection.update(this._core,O,j,z),this._requestRedrawViewport()}handleCursorMove(){var O;for(const j of this._renderLayers)j.handleCursorMove(this._terminal);(O=this._cursorBlinkStateManager.value)==null||O.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new R.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new w.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var j;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const O=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==O&&(this._onChangeTextureAtlas.fire(O.pages[0].canvas),this._charAtlasDisposable.value=(0,o.getDisposeArrayDisposable)([(0,f.forwardEvent)(O.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,f.forwardEvent)(O.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=O,this._charAtlas.warmUp(),(j=this._glyphRenderer.value)==null||j.setAtlas(this._charAtlas)}_clearModel(O){var j;this._model.clear(),O&&((j=this._glyphRenderer.value)==null||j.clear())}clearTextureAtlas(){var O;(O=this._charAtlas)==null||O.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var O;this._clearModel(!0);for(const j of this._renderLayers)j.reset(this._terminal);(O=this._cursorBlinkStateManager.value)==null||O.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(O){return-1}deregisterCharacterJoiner(O){return!1}renderRows(O,j){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const z of this._renderLayers)z.handleGridChanged(this._terminal,O,j);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(O,j),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new v.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(O,j){const z=this._core;let Y,Z,J,K,P,$,F,q,ne,re,ie,Q,V,H,G=this._workCell;O=I(O,z.rows-1,0),j=I(j,z.rows-1,0);const ee=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,de=ee-z.buffer.ydisp,ue=Math.min(this._terminal.buffer.active.cursorX,z.cols-1);let Ee=-1;const ke=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let $e=!1;for(Z=O;Z<=j;Z++)for(J=Z+z.buffer.ydisp,K=z.buffer.lines.get(J),this._model.lineLengths[Z]=0,P=this._characterJoinerService.getJoinedCharacters(J),V=0;V<z.cols;V++)if(Y=this._cellColorResolver.result.bg,K.loadCell(V,G),V===0&&(Y=this._cellColorResolver.result.bg),$=!1,F=V,P.length>0&&V===P[0][0]&&($=!0,q=P.shift(),G=new T(G,K.translateToString(!0,q[0],q[1]),q[1]-q[0]),F=q[1]-1),ne=G.getChars(),re=G.getCode(),Q=(Z*z.cols+V)*k.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(G,V,J,this.dimensions.device.cell.width),ke&&J===ee&&(V===ue&&(this._model.cursor={x:ue,y:de,width:G.getWidth(),style:this._coreBrowserService.isFocused?z.options.cursorStyle||"block":z.options.cursorInactiveStyle,cursorWidth:z.options.cursorWidth,dpr:this._devicePixelRatio},Ee=ue+G.getWidth()-1),V>=ue&&V<=Ee&&(this._coreBrowserService.isFocused&&(z.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&z.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),re!==d.NULL_CELL_CODE&&(this._model.lineLengths[Z]=V+1),(this._model.cells[Q]!==re||this._model.cells[Q+k.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Q+k.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Q+k.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&($e=!0,ne.length>1&&(re|=k.COMBINED_CHAR_BIT_MASK),this._model.cells[Q]=re,this._model.cells[Q+k.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Q+k.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Q+k.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,ie=G.getWidth(),this._glyphRenderer.value.updateCell(V,Z,re,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,ne,ie,Y),$))for(G=this._workCell,V++;V<F;V++)H=(Z*z.cols+V)*k.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(V,Z,d.NULL_CELL_CODE,0,0,0,d.NULL_CELL_CHAR,0,0),this._model.cells[H]=d.NULL_CELL_CODE,this._model.cells[H+k.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[H+k.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[H+k.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;$e&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(O,j){this._canvas.width===O&&this._canvas.height===j||(this._canvas.width=O,this._canvas.height=j,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const O=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:O,end:O})}}i.WebglRenderer=b;class T extends u.AttributeData{constructor(O,j,z){super(),this.content=0,this.combinedData="",this.fg=O.fg,this.bg=O.bg,this.combinedData=j,this._width=z}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(O){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function I(W,O,j=0){return Math.max(Math.min(W,O),j)}i.JoinedCellData=T},381:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.GLTexture=i.expandFloat32Array=i.createShader=i.createProgram=i.PROJECTION_MATRIX=void 0;const g=a(374);function _(l,v,S){const C=(0,g.throwIfFalsy)(l.createShader(v));if(l.shaderSource(C,S),l.compileShader(C),l.getShaderParameter(C,l.COMPILE_STATUS))return C;console.error(l.getShaderInfoLog(C)),l.deleteShader(C)}i.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),i.createProgram=function(l,v,S){const C=(0,g.throwIfFalsy)(l.createProgram());if(l.attachShader(C,(0,g.throwIfFalsy)(_(l,l.VERTEX_SHADER,v))),l.attachShader(C,(0,g.throwIfFalsy)(_(l,l.FRAGMENT_SHADER,S))),l.linkProgram(C),l.getProgramParameter(C,l.LINK_STATUS))return C;console.error(l.getProgramInfoLog(C)),l.deleteProgram(C)},i.createShader=_,i.expandFloat32Array=function(l,v){const S=Math.min(2*l.length,v),C=new Float32Array(S);for(let f=0;f<l.length;f++)C[f]=l[f];return C},i.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BaseRenderLayer=void 0;const g=a(627),_=a(237),l=a(374),v=a(859);class S extends v.Disposable{constructor(f,o,u,h,d,w,R,k){super(),this._container=o,this._alpha=d,this._coreBrowserService=w,this._optionsService=R,this._themeService=k,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${u}-layer`),this._canvas.style.zIndex=h.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((A=>{this._refreshCharAtlas(f,A),this.reset(f)}))),this.register((0,v.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,o,u){}handleSelectionChanged(f,o,u,h=!1){}_setTransparency(f,o){if(o===this._alpha)return;const u=this._canvas;this._alpha=o,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,u),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,o){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,g.acquireTextureAtlas)(f,this._optionsService.rawOptions,o,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,o){this._deviceCellWidth=o.device.cell.width,this._deviceCellHeight=o.device.cell.height,this._deviceCharWidth=o.device.char.width,this._deviceCharHeight=o.device.char.height,this._deviceCharLeft=o.device.char.left,this._deviceCharTop=o.device.char.top,this._canvas.width=o.device.canvas.width,this._canvas.height=o.device.canvas.height,this._canvas.style.width=`${o.css.canvas.width}px`,this._canvas.style.height=`${o.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,o,u=1){this._ctx.fillRect(f*this._deviceCellWidth,(o+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,u*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,o,u,h){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,h*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,h*this._deviceCellHeight))}_fillCharTrueColor(f,o,u,h){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(u,h,o.getWidth()),this._ctx.fillText(o.getChars(),u*this._deviceCellWidth+this._deviceCharLeft,h*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,o,u){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,o*this._deviceCellHeight,u*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,o,u){return`${u?"italic":""} ${o?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}i.BaseRenderLayer=S},733:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkRenderLayer=void 0;const g=a(197),_=a(237),l=a(592);class v extends l.BaseRenderLayer{constructor(C,f,o,u,h,d,w){super(o,C,"link",f,!0,h,d,w),this.register(u.onShowLinkUnderline((R=>this._handleShowLinkUnderline(R)))),this.register(u.onHideLinkUnderline((R=>this._handleHideLinkUnderline(R))))}resize(C,f){super.resize(C,f),this._state=void 0}reset(C){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const C=this._state.y2-this._state.y1-1;C>0&&this._clearCells(0,this._state.y1+1,this._state.cols,C),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(C){if(C.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:C.fg!==void 0&&(0,g.is256Color)(C.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[C.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,C.y1===C.y2)this._fillBottomLineAtCells(C.x1,C.y1,C.x2-C.x1);else{this._fillBottomLineAtCells(C.x1,C.y1,C.cols-C.x1);for(let f=C.y1+1;f<C.y2;f++)this._fillBottomLineAtCells(0,f,C.cols);this._fillBottomLineAtCells(0,C.y2,C.x2)}this._state=C}_handleHideLinkUnderline(C){this._clearCurrentLink()}}i.LinkRenderLayer=v},820:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(a,g,_,l){a.addEventListener(g,_,l);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(g,_,l))}}}},274:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellColorResolver=void 0;const g=a(855),_=a(160),l=a(374);let v,S=0,C=0,f=!1,o=!1,u=!1,h=0;i.CellColorResolver=class{constructor(d,w,R,k,A,b){this._terminal=d,this._optionService=w,this._selectionRenderModel=R,this._decorationService=k,this._coreBrowserService=A,this._themeService=b,this.result={fg:0,bg:0,ext:0}}resolve(d,w,R,k){if(this.result.bg=d.bg,this.result.fg=d.fg,this.result.ext=268435456&d.bg?d.extended.ext:0,C=0,S=0,o=!1,f=!1,u=!1,v=this._themeService.colors,h=0,d.getCode()!==g.NULL_CELL_CODE&&d.extended.underlineStyle===4){const A=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));h=w*k%(2*Math.round(A))}if(this._decorationService.forEachDecorationAtCell(w,R,"bottom",(A=>{A.backgroundColorRGB&&(C=A.backgroundColorRGB.rgba>>8&16777215,o=!0),A.foregroundColorRGB&&(S=A.foregroundColorRGB.rgba>>8&16777215,f=!0)})),u=this._selectionRenderModel.isCellSelected(this._terminal,w,R),u){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}C=_.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else C=(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(o=!0,v.selectionForeground&&(S=v.selectionForeground.rgba>>8&16777215,f=!0),(0,l.treatGlyphAsBackgroundColor)(d.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)S=(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}S=_.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}f=!0}}this._decorationService.forEachDecorationAtCell(w,R,"top",(A=>{A.backgroundColorRGB&&(C=A.backgroundColorRGB.rgba>>8&16777215,o=!0),A.foregroundColorRGB&&(S=A.foregroundColorRGB.rgba>>8&16777215,f=!0)})),o&&(C=u?-16777216&d.bg&-134217729|C|50331648:-16777216&d.bg|C|50331648),f&&(S=-16777216&d.fg&-67108865|S|50331648),67108864&this.result.fg&&(o&&!f&&(S=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&v.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,f=!0),!o&&f&&(C=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&v.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,o=!0)),v=void 0,this.result.bg=o?C:this.result.bg,this.result.fg=f?S:this.result.fg,this.result.ext&=536870911,this.result.ext|=h<<29&3758096384}}},627:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.removeTerminalFromCache=i.acquireTextureAtlas=void 0;const g=a(509),_=a(197),l=[];i.acquireTextureAtlas=function(v,S,C,f,o,u,h,d){const w=(0,_.generateConfig)(f,o,u,h,S,C,d);for(let A=0;A<l.length;A++){const b=l[A],T=b.ownedBy.indexOf(v);if(T>=0){if((0,_.configEquals)(b.config,w))return b.atlas;b.ownedBy.length===1?(b.atlas.dispose(),l.splice(A,1)):b.ownedBy.splice(T,1);break}}for(let A=0;A<l.length;A++){const b=l[A];if((0,_.configEquals)(b.config,w))return b.ownedBy.push(v),b.atlas}const R=v._core,k={atlas:new g.TextureAtlas(document,w,R.unicodeService),config:w,ownedBy:[v]};return l.push(k),k.atlas},i.removeTerminalFromCache=function(v){for(let S=0;S<l.length;S++){const C=l[S].ownedBy.indexOf(v);if(C!==-1){l[S].ownedBy.length===1?(l[S].atlas.dispose(),l.splice(S,1)):l[S].ownedBy.splice(C,1);break}}}},197:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.is256Color=i.configEquals=i.generateConfig=void 0;const g=a(160);i.generateConfig=function(_,l,v,S,C,f,o){const u={foreground:f.foreground,background:f.background,cursor:g.NULL_COLOR,cursorAccent:g.NULL_COLOR,selectionForeground:g.NULL_COLOR,selectionBackgroundTransparent:g.NULL_COLOR,selectionBackgroundOpaque:g.NULL_COLOR,selectionInactiveBackgroundTransparent:g.NULL_COLOR,selectionInactiveBackgroundOpaque:g.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:C.customGlyphs,devicePixelRatio:o,letterSpacing:C.letterSpacing,lineHeight:C.lineHeight,deviceCellWidth:_,deviceCellHeight:l,deviceCharWidth:v,deviceCharHeight:S,fontFamily:C.fontFamily,fontSize:C.fontSize,fontWeight:C.fontWeight,fontWeightBold:C.fontWeightBold,allowTransparency:C.allowTransparency,drawBoldTextInBrightColors:C.drawBoldTextInBrightColors,minimumContrastRatio:C.minimumContrastRatio,colors:u}},i.configEquals=function(_,l){for(let v=0;v<_.colors.ansi.length;v++)if(_.colors.ansi[v].rgba!==l.colors.ansi[v].rgba)return!1;return _.devicePixelRatio===l.devicePixelRatio&&_.customGlyphs===l.customGlyphs&&_.lineHeight===l.lineHeight&&_.letterSpacing===l.letterSpacing&&_.fontFamily===l.fontFamily&&_.fontSize===l.fontSize&&_.fontWeight===l.fontWeight&&_.fontWeightBold===l.fontWeightBold&&_.allowTransparency===l.allowTransparency&&_.deviceCharWidth===l.deviceCharWidth&&_.deviceCharHeight===l.deviceCharHeight&&_.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&_.minimumContrastRatio===l.minimumContrastRatio&&_.colors.foreground.rgba===l.colors.foreground.rgba&&_.colors.background.rgba===l.colors.background.rgba},i.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const g=a(399);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},457:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CursorBlinkStateManager=void 0,i.CursorBlinkStateManager=class{constructor(a,g){this._renderCallback=a,this._coreBrowserService=g,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(a=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const g=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,g>0)return void this._restartInterval(g)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const g=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(g)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tryDrawCustomChar=i.powerlineDefinitions=i.boxDrawingDefinitions=i.blockElementDefinitions=void 0;const g=a(374);i.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const _={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};i.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"║":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,o)=>`M.5,1 L.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╓":{1:(f,o)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,o)=>`M1,${.5-o} L${.5-f},${.5-o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1`},"╕":{1:(f,o)=>`M0,${.5-o} L.5,${.5-o} L.5,1 M0,${.5+o} L.5,${.5+o}`},"╖":{1:(f,o)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,o)=>`M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M0,${.5-o} L${.5+f},${.5-o} L${.5+f},1`},"╘":{1:(f,o)=>`M.5,0 L.5,${.5+o} L1,${.5+o} M.5,${.5-o} L1,${.5-o}`},"╙":{1:(f,o)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,o)=>`M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0 M1,${.5+o} L${.5-f},${.5+o} L${.5-f},0`},"╛":{1:(f,o)=>`M0,${.5+o} L.5,${.5+o} L.5,0 M0,${.5-o} L.5,${.5-o}`},"╜":{1:(f,o)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,o)=>`M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M0,${.5+o} L${.5+f},${.5+o} L${.5+f},0`},"╞":{1:(f,o)=>`M.5,0 L.5,1 M.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╟":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,o)=>`M${.5-f},0 L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╡":{1:(f,o)=>`M.5,0 L.5,1 M0,${.5-o} L.5,${.5-o} M0,${.5+o} L.5,${.5+o}`},"╢":{1:(f,o)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,o)=>`M${.5+f},0 L${.5+f},1 M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0`},"╤":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o} M.5,${.5+o} L.5,1`},"╥":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1`},"╧":{1:(f,o)=>`M.5,0 L.5,${.5-o} M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╨":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,o)=>`M0,${.5+o} L1,${.5+o} M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╪":{1:(f,o)=>`M.5,0 L.5,1 M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╫":{1:(f,o)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,o)=>`M0,${.5+o} L${.5-f},${.5+o} L${.5-f},1 M1,${.5+o} L${.5+f},${.5+o} L${.5+f},1 M0,${.5-o} L${.5-f},${.5-o} L${.5-f},0 M1,${.5-o} L${.5+f},${.5-o} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,1,.5`},"╮":{1:(f,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,0,.5`},"╯":{1:(f,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,0,.5`},"╰":{1:(f,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,1,.5`}},i.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.powerlineDefinitions[""]=i.powerlineDefinitions[""],i.tryDrawCustomChar=function(f,o,u,h,d,w,R,k){const A=i.blockElementDefinitions[o];if(A)return(function(W,O,j,z,Y,Z){for(let J=0;J<O.length;J++){const K=O[J],P=Y/8,$=Z/8;W.fillRect(j+K.x*P,z+K.y*$,K.w*P,K.h*$)}})(f,A,u,h,d,w),!0;const b=_[o];if(b)return(function(W,O,j,z,Y,Z){let J=l.get(O);J||(J=new Map,l.set(O,J));const K=W.fillStyle;if(typeof K!="string")throw new Error(`Unexpected fillStyle type "${K}"`);let P=J.get(K);if(!P){const $=O[0].length,F=O.length,q=W.canvas.ownerDocument.createElement("canvas");q.width=$,q.height=F;const ne=(0,g.throwIfFalsy)(q.getContext("2d")),re=new ImageData($,F);let ie,Q,V,H;if(K.startsWith("#"))ie=parseInt(K.slice(1,3),16),Q=parseInt(K.slice(3,5),16),V=parseInt(K.slice(5,7),16),H=K.length>7&&parseInt(K.slice(7,9),16)||1;else{if(!K.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${K}" when drawing pattern glyph`);[ie,Q,V,H]=K.substring(5,K.length-1).split(",").map((G=>parseFloat(G)))}for(let G=0;G<F;G++)for(let ee=0;ee<$;ee++)re.data[4*(G*$+ee)]=ie,re.data[4*(G*$+ee)+1]=Q,re.data[4*(G*$+ee)+2]=V,re.data[4*(G*$+ee)+3]=O[G][ee]*(255*H);ne.putImageData(re,0,0),P=(0,g.throwIfFalsy)(W.createPattern(q,null)),J.set(K,P)}W.fillStyle=P,W.fillRect(j,z,Y,Z)})(f,b,u,h,d,w),!0;const T=i.boxDrawingDefinitions[o];if(T)return(function(W,O,j,z,Y,Z,J){W.strokeStyle=W.fillStyle;for(const[K,P]of Object.entries(O)){let $;W.beginPath(),W.lineWidth=J*Number.parseInt(K),$=typeof P=="function"?P(.15,.15/Z*Y):P;for(const F of $.split(" ")){const q=F[0],ne=S[q];if(!ne){console.error(`Could not find drawing instructions for "${q}"`);continue}const re=F.substring(1).split(",");re[0]&&re[1]&&ne(W,C(re,Y,Z,j,z,!0,J))}W.stroke(),W.closePath()}})(f,T,u,h,d,w,k),!0;const I=i.powerlineDefinitions[o];return!!I&&((function(W,O,j,z,Y,Z,J,K){const P=new Path2D;P.rect(j,z,Y,Z),W.clip(P),W.beginPath();const $=J/12;W.lineWidth=K*$;for(const F of O.d.split(" ")){const q=F[0],ne=S[q];if(!ne){console.error(`Could not find drawing instructions for "${q}"`);continue}const re=F.substring(1).split(",");re[0]&&re[1]&&ne(W,C(re,Y,Z,j,z,!1,K,(O.leftPadding??0)*($/2),(O.rightPadding??0)*($/2)))}O.type===1?(W.strokeStyle=W.fillStyle,W.stroke()):W.fill(),W.closePath()})(f,I,u,h,d,w,R,k),!0)};const l=new Map;function v(f,o,u=0){return Math.max(Math.min(f,o),u)}const S={C:(f,o)=>f.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]),L:(f,o)=>f.lineTo(o[0],o[1]),M:(f,o)=>f.moveTo(o[0],o[1])};function C(f,o,u,h,d,w,R,k=0,A=0){const b=f.map((T=>parseFloat(T)||parseInt(T)));if(b.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T<b.length;T+=2)b[T]*=o-k*R-A*R,w&&b[T]!==0&&(b[T]=v(Math.round(b[T]+.5)-.5,o,0)),b[T]+=h+k*R;for(let T=1;T<b.length;T+=2)b[T]*=u,w&&b[T]!==0&&(b[T]=v(Math.round(b[T]+.5)-.5,u,0)),b[T]+=d;return b}},56:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.observeDevicePixelDimensions=void 0;const g=a(859);i.observeDevicePixelDimensions=function(_,l,v){let S=new l.ResizeObserver((C=>{const f=C.find((h=>h.target===_));if(!f)return;if(!("devicePixelContentBoxSize"in f))return S==null||S.disconnect(),void(S=void 0);const o=f.devicePixelContentBoxSize[0].inlineSize,u=f.devicePixelContentBoxSize[0].blockSize;o>0&&u>0&&v(o,u)}));try{S.observe(_,{box:["device-pixel-content-box"]})}catch{S.disconnect(),S=void 0}return(0,g.toDisposable)((()=>S==null?void 0:S.disconnect()))}},374:(D,i)=>{function a(_){return 57508<=_&&_<=57558}function g(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},i.isPowerlineGlyph=a,i.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},i.isEmoji=g,i.allowRescaling=function(_,l,v,S){return l===1&&v>Math.ceil(1.5*S)&&_!==void 0&&_>255&&!g(_)&&!a(_)&&!(function(C){return 57344<=C&&C<=63743})(_)},i.treatGlyphAsBackgroundColor=function(_){return a(_)||(function(l){return 9472<=l&&l<=9631})(_)},i.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}}}},i.computeNextVariantOffset=function(_,l,v=0){return(_-(2*Math.round(l)-v))%(2*Math.round(l))}},296:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class a{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(_,l,v,S=!1){if(this.selectionStart=l,this.selectionEnd=v,!l||!v||l[0]===v[0]&&l[1]===v[1])return void this.clear();const C=_.buffers.active.ydisp,f=l[1]-C,o=v[1]-C,u=Math.max(f,0),h=Math.min(o,_.rows-1);u>=_.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=l[0],this.endCol=v[0])}isCellSelected(_,l,v){return!!this.hasSelection&&(v-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&v>=this.viewportCappedStartRow&&l<this.endCol&&v<=this.viewportCappedEndRow:l<this.startCol&&v>=this.viewportCappedStartRow&&l>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new a}},509:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TextureAtlas=void 0;const g=a(237),_=a(860),l=a(374),v=a(160),S=a(345),C=a(485),f=a(385),o=a(147),u=a(855),h={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let d;class w{get pages(){return this._pages}constructor(T,I,W){this._document=T,this._config=I,this._unicodeService=W,this._didWarmUp=!1,this._cacheMap=new C.FourKeyMap,this._cacheMapCombined=new C.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new S.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new S.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=A(T,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const T of this.pages)T.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const T=new f.IdleTaskQueue;for(let I=33;I<126;I++)T.enqueue((()=>{if(!this._cacheMap.get(I,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT)){const W=this._drawToCache(I,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT);this._cacheMap.set(I,u.DEFAULT_COLOR,u.DEFAULT_COLOR,u.DEFAULT_EXT,W)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const T of this._pages)T.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const I=this._pages.filter((J=>2*J.canvas.width<=(w.maxTextureSize||4096))).sort(((J,K)=>K.canvas.width!==J.canvas.width?K.canvas.width-J.canvas.width:K.percentageUsed-J.percentageUsed));let W=-1,O=0;for(let J=0;J<I.length;J++)if(I[J].canvas.width!==O)W=J,O=I[J].canvas.width;else if(J-W==3)break;const j=I.slice(W,W+4),z=j.map((J=>J.glyphs[0].texturePage)).sort(((J,K)=>J>K?1:-1)),Y=this.pages.length-j.length,Z=this._mergePages(j,Y);Z.version++;for(let J=z.length-1;J>=0;J--)this._deletePage(z[J]);this.pages.push(Z),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(Z.canvas)}const T=new R(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,I){const W=2*T[0].canvas.width,O=new R(this._document,W,T);for(const[j,z]of T.entries()){const Y=j*z.canvas.width%W,Z=Math.floor(j/2)*z.canvas.height;O.ctx.drawImage(z.canvas,Y,Z);for(const K of z.glyphs)K.texturePage=I,K.sizeClipSpace.x=K.size.x/W,K.sizeClipSpace.y=K.size.y/W,K.texturePosition.x+=Y,K.texturePosition.y+=Z,K.texturePositionClipSpace.x=K.texturePosition.x/W,K.texturePositionClipSpace.y=K.texturePosition.y/W;this._onRemoveTextureAtlasCanvas.fire(z.canvas);const J=this._activePages.indexOf(z);J!==-1&&this._activePages.splice(J,1)}return O}_deletePage(T){this._pages.splice(T,1);for(let I=T;I<this._pages.length;I++){const W=this._pages[I];for(const O of W.glyphs)O.texturePage--;W.version++}}getRasterizedGlyphCombinedChar(T,I,W,O,j){return this._getFromCacheMap(this._cacheMapCombined,T,I,W,O,j)}getRasterizedGlyph(T,I,W,O,j){return this._getFromCacheMap(this._cacheMap,T,I,W,O,j)}_getFromCacheMap(T,I,W,O,j,z=!1){return d=T.get(I,W,O,j),d||(d=this._drawToCache(I,W,O,j,z),T.set(I,W,O,j,d)),d}_getColorFromAnsiIndex(T){if(T>=this._config.colors.ansi.length)throw new Error("No color found for idx "+T);return this._config.colors.ansi[T]}_getBackgroundColor(T,I,W,O){if(this._config.allowTransparency)return v.NULL_COLOR;let j;switch(T){case 16777216:case 33554432:j=this._getColorFromAnsiIndex(I);break;case 50331648:const z=o.AttributeData.toColorRGB(I);j=v.channels.toColor(z[0],z[1],z[2]);break;default:j=W?v.color.opaque(this._config.colors.foreground):this._config.colors.background}return j}_getForegroundColor(T,I,W,O,j,z,Y,Z,J,K){const P=this._getMinimumContrastColor(T,I,W,O,j,z,Y,J,Z,K);if(P)return P;let $;switch(j){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&J&&z<8&&(z+=8),$=this._getColorFromAnsiIndex(z);break;case 50331648:const F=o.AttributeData.toColorRGB(z);$=v.channels.toColor(F[0],F[1],F[2]);break;default:$=Y?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&($=v.color.opaque($)),Z&&($=v.color.multiplyOpacity($,g.DIM_OPACITY)),$}_resolveBackgroundRgba(T,I,W){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(I).rgba;case 50331648:return I<<8;default:return W?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,I,W,O){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&O&&I<8&&(I+=8),this._getColorFromAnsiIndex(I).rgba;case 50331648:return I<<8;default:return W?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,I,W,O,j,z,Y,Z,J,K){if(this._config.minimumContrastRatio===1||K)return;const P=this._getContrastCache(J),$=P.getColor(T,O);if($!==void 0)return $||void 0;const F=this._resolveBackgroundRgba(I,W,Y),q=this._resolveForegroundRgba(j,z,Y,Z),ne=v.rgba.ensureContrastRatio(F,q,this._config.minimumContrastRatio/(J?2:1));if(!ne)return void P.setColor(T,O,null);const re=v.channels.toColor(ne>>24&255,ne>>16&255,ne>>8&255);return P.setColor(T,O,re),re}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,I,W,O,j=!1){const z=typeof T=="number"?String.fromCharCode(T):T,Y=Math.min(this._config.deviceCellWidth*Math.max(z.length,2)+4,this._textureSize);this._tmpCanvas.width<Y&&(this._tmpCanvas.width=Y);const Z=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<Z&&(this._tmpCanvas.height=Z),this._tmpCtx.save(),this._workAttributeData.fg=W,this._workAttributeData.bg=I,this._workAttributeData.extended.ext=O,this._workAttributeData.isInvisible())return h;const J=!!this._workAttributeData.isBold(),K=!!this._workAttributeData.isInverse(),P=!!this._workAttributeData.isDim(),$=!!this._workAttributeData.isItalic(),F=!!this._workAttributeData.isUnderline(),q=!!this._workAttributeData.isStrikethrough(),ne=!!this._workAttributeData.isOverline();let re=this._workAttributeData.getFgColor(),ie=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),V=this._workAttributeData.getBgColorMode();if(K){const _e=re;re=Q,Q=_e;const We=ie;ie=V,V=We}const H=this._getBackgroundColor(V,Q,K,P);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const G=J?this._config.fontWeightBold:this._config.fontWeight,ee=$?"italic":"";this._tmpCtx.font=`${ee} ${G} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=g.TEXT_BASELINE;const de=z.length===1&&(0,l.isPowerlineGlyph)(z.charCodeAt(0)),ue=z.length===1&&(0,l.isRestrictedPowerlineGlyph)(z.charCodeAt(0)),Ee=this._getForegroundColor(I,V,Q,W,ie,re,K,P,J,(0,l.treatGlyphAsBackgroundColor)(z.charCodeAt(0)));this._tmpCtx.fillStyle=Ee.css;const ke=ue?0:4;let $e=!1;this._config.customGlyphs!==!1&&($e=(0,_.tryDrawCustomChar)(this._tmpCtx,z,ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Ye,Te=!de;if(Ye=typeof T=="number"?this._unicodeService.wcwidth(T):this._unicodeService.getStringCellWidth(T),F){this._tmpCtx.save();const _e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=_e%2==1?.5:0;if(this._tmpCtx.lineWidth=_e,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Te=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Te=!1;let tt=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&tt<8&&(tt+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(tt).css}this._tmpCtx.beginPath();const Je=ke,Ze=Math.ceil(ke+this._config.deviceCharHeight)-We-(j?2*_e:0),St=Ze+_e,at=Ze+2*_e;let lt=this._workAttributeData.getUnderlineVariantOffset();for(let tt=0;tt<Ye;tt++){this._tmpCtx.save();const Ge=Je+tt*this._config.deviceCellWidth,fe=Je+(tt+1)*this._config.deviceCellWidth,ze=Ge+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ge,Ze),this._tmpCtx.lineTo(fe,Ze),this._tmpCtx.moveTo(Ge,at),this._tmpCtx.lineTo(fe,at);break;case 3:const st=_e<=1?at:Math.ceil(ke+this._config.deviceCharHeight-_e/2)-We,we=_e<=1?Ze:Math.ceil(ke+this._config.deviceCharHeight+_e/2)-We,Ke=new Path2D;Ke.rect(Ge,Ze,this._config.deviceCellWidth,at-Ze),this._tmpCtx.clip(Ke),this._tmpCtx.moveTo(Ge-this._config.deviceCellWidth/2,St),this._tmpCtx.bezierCurveTo(Ge-this._config.deviceCellWidth/2,we,Ge,we,Ge,St),this._tmpCtx.bezierCurveTo(Ge,st,ze,st,ze,St),this._tmpCtx.bezierCurveTo(ze,we,fe,we,fe,St),this._tmpCtx.bezierCurveTo(fe,st,fe+this._config.deviceCellWidth/2,st,fe+this._config.deviceCellWidth/2,St);break;case 4:const he=lt===0?0:lt>=_e?2*_e-lt:_e-lt;lt>=_e||he===0?(this._tmpCtx.setLineDash([Math.round(_e),Math.round(_e)]),this._tmpCtx.moveTo(Ge+he,Ze),this._tmpCtx.lineTo(fe,Ze)):(this._tmpCtx.setLineDash([Math.round(_e),Math.round(_e)]),this._tmpCtx.moveTo(Ge,Ze),this._tmpCtx.lineTo(Ge+he,Ze),this._tmpCtx.moveTo(Ge+he+_e,Ze),this._tmpCtx.lineTo(fe,Ze)),lt=(0,l.computeNextVariantOffset)(fe-Ge,_e,lt);break;case 5:const Oe=.6,be=.3,nt=fe-Ge,Ne=Math.floor(Oe*nt),ct=Math.floor(be*nt),dn=nt-Ne-ct;this._tmpCtx.setLineDash([Ne,ct,dn]),this._tmpCtx.moveTo(Ge,Ze),this._tmpCtx.lineTo(fe,Ze);break;default:this._tmpCtx.moveTo(Ge,Ze),this._tmpCtx.lineTo(fe,Ze)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!$e&&this._config.fontSize>=12&&!this._config.allowTransparency&&z!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const tt=this._tmpCtx.measureText(z);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in tt&&tt.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ge=new Path2D;Ge.rect(Je,Ze-Math.ceil(_e/2),this._config.deviceCellWidth*Ye,at-Ze+Math.ceil(_e/2)),this._tmpCtx.clip(Ge),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=H.css,this._tmpCtx.strokeText(z,ke,ke+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(ne){const _e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),We=_e%2==1?.5:0;this._tmpCtx.lineWidth=_e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ke,ke+We),this._tmpCtx.lineTo(ke+this._config.deviceCharWidth*Ye,ke+We),this._tmpCtx.stroke()}if($e||this._tmpCtx.fillText(z,ke,ke+this._config.deviceCharHeight),z==="_"&&!this._config.allowTransparency){let _e=k(this._tmpCtx.getImageData(ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight),H,Ee,Te);if(_e)for(let We=1;We<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=H.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(z,ke,ke+this._config.deviceCharHeight-We),_e=k(this._tmpCtx.getImageData(ke,ke,this._config.deviceCellWidth,this._config.deviceCellHeight),H,Ee,Te),_e);We++);}if(q){const _e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),We=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=_e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ke,ke+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.lineTo(ke+this._config.deviceCharWidth*Ye,ke+Math.floor(this._config.deviceCharHeight/2)-We),this._tmpCtx.stroke()}this._tmpCtx.restore();const ot=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ae;if(Ae=this._config.allowTransparency?(function(_e){for(let We=0;We<_e.data.length;We+=4)if(_e.data[We+3]>0)return!1;return!0})(ot):k(ot,H,Ee,Te),Ae)return h;const De=this._findGlyphBoundingBox(ot,this._workBoundingBox,Y,ue,$e,ke);let Ce,je;for(;;){if(this._activePages.length===0){const _e=this._createNewPage();Ce=_e,je=_e.currentRow,je.height=De.size.y;break}Ce=this._activePages[this._activePages.length-1],je=Ce.currentRow;for(const _e of this._activePages)De.size.y<=_e.currentRow.height&&(Ce=_e,je=_e.currentRow);for(let _e=this._activePages.length-1;_e>=0;_e--)for(const We of this._activePages[_e].fixedRows)We.height<=je.height&&De.size.y<=We.height&&(Ce=this._activePages[_e],je=We);if(je.y+De.size.y>=Ce.canvas.height||je.height>De.size.y+2){let _e=!1;if(Ce.currentRow.y+Ce.currentRow.height+De.size.y>=Ce.canvas.height){let We;for(const Je of this._activePages)if(Je.currentRow.y+Je.currentRow.height+De.size.y<Je.canvas.height){We=Je;break}if(We)Ce=We;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&je.y+De.size.y<=Ce.canvas.height&&je.height>=De.size.y&&je.x+De.size.x<=Ce.canvas.width)_e=!0;else{const Je=this._createNewPage();Ce=Je,je=Je.currentRow,je.height=De.size.y,_e=!0}}_e||(Ce.currentRow.height>0&&Ce.fixedRows.push(Ce.currentRow),je={x:0,y:Ce.currentRow.y+Ce.currentRow.height,height:De.size.y},Ce.fixedRows.push(je),Ce.currentRow={x:0,y:je.y+je.height,height:0})}if(je.x+De.size.x<=Ce.canvas.width)break;je===Ce.currentRow?(je.x=0,je.y+=je.height,je.height=0):Ce.fixedRows.splice(Ce.fixedRows.indexOf(je),1)}return De.texturePage=this._pages.indexOf(Ce),De.texturePosition.x=je.x,De.texturePosition.y=je.y,De.texturePositionClipSpace.x=je.x/Ce.canvas.width,De.texturePositionClipSpace.y=je.y/Ce.canvas.height,De.sizeClipSpace.x/=Ce.canvas.width,De.sizeClipSpace.y/=Ce.canvas.height,je.height=Math.max(je.height,De.size.y),je.x+=De.size.x,Ce.ctx.putImageData(ot,De.texturePosition.x-this._workBoundingBox.left,De.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,De.size.x,De.size.y),Ce.addGlyph(De),Ce.version++,De}_findGlyphBoundingBox(T,I,W,O,j,z){I.top=0;const Y=O?this._config.deviceCellHeight:this._tmpCanvas.height,Z=O?this._config.deviceCellWidth:W;let J=!1;for(let K=0;K<Y;K++){for(let P=0;P<Z;P++){const $=K*this._tmpCanvas.width*4+4*P+3;if(T.data[$]!==0){I.top=K,J=!0;break}}if(J)break}I.left=0,J=!1;for(let K=0;K<z+Z;K++){for(let P=0;P<Y;P++){const $=P*this._tmpCanvas.width*4+4*K+3;if(T.data[$]!==0){I.left=K,J=!0;break}}if(J)break}I.right=Z,J=!1;for(let K=z+Z-1;K>=z;K--){for(let P=0;P<Y;P++){const $=P*this._tmpCanvas.width*4+4*K+3;if(T.data[$]!==0){I.right=K,J=!0;break}}if(J)break}I.bottom=Y,J=!1;for(let K=Y-1;K>=0;K--){for(let P=0;P<Z;P++){const $=K*this._tmpCanvas.width*4+4*P+3;if(T.data[$]!==0){I.bottom=K,J=!0;break}}if(J)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:I.right-I.left+1,y:I.bottom-I.top+1},sizeClipSpace:{x:I.right-I.left+1,y:I.bottom-I.top+1},offset:{x:-I.left+z+(O||j?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-I.top+z+(O||j?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}i.TextureAtlas=w;class R{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(T){this._glyphs.push(T),this._usedPixels+=T.size.x*T.size.y}constructor(T,I,W){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],W)for(const O of W)this._glyphs.push(...O.glyphs),this._usedPixels+=O._usedPixels;this.canvas=A(T,I,I),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function k(b,T,I,W){const O=T.rgba>>>24,j=T.rgba>>>16&255,z=T.rgba>>>8&255,Y=I.rgba>>>24,Z=I.rgba>>>16&255,J=I.rgba>>>8&255,K=Math.floor((Math.abs(O-Y)+Math.abs(j-Z)+Math.abs(z-J))/12);let P=!0;for(let $=0;$<b.data.length;$+=4)b.data[$]===O&&b.data[$+1]===j&&b.data[$+2]===z||W&&Math.abs(b.data[$]-O)+Math.abs(b.data[$+1]-j)+Math.abs(b.data[$+2]-z)<K?b.data[$+3]=0:P=!1;return P}function A(b,T,I){const W=b.createElement("canvas");return W.width=T,W.height=I,W}},160:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let a=0,g=0,_=0,l=0;var v,S,C,f,o;function u(d){const w=d.toString(16);return w.length<2?"0"+w:w}function h(d,w){return d<w?(w+.05)/(d+.05):(d+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(w,R,k,A){return A!==void 0?`#${u(w)}${u(R)}${u(k)}${u(A)}`:`#${u(w)}${u(R)}${u(k)}`},d.toRgba=function(w,R,k,A=255){return(w<<24|R<<16|k<<8|A)>>>0},d.toColor=function(w,R,k,A){return{css:d.toCss(w,R,k,A),rgba:d.toRgba(w,R,k,A)}}})(v||(i.channels=v={})),(function(d){function w(R,k){return l=Math.round(255*k),[a,g,_]=o.toChannels(R.rgba),{css:v.toCss(a,g,_,l),rgba:v.toRgba(a,g,_,l)}}d.blend=function(R,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const A=k.rgba>>24&255,b=k.rgba>>16&255,T=k.rgba>>8&255,I=R.rgba>>24&255,W=R.rgba>>16&255,O=R.rgba>>8&255;return a=I+Math.round((A-I)*l),g=W+Math.round((b-W)*l),_=O+Math.round((T-O)*l),{css:v.toCss(a,g,_),rgba:v.toRgba(a,g,_)}},d.isOpaque=function(R){return(255&R.rgba)==255},d.ensureContrastRatio=function(R,k,A){const b=o.ensureContrastRatio(R.rgba,k.rgba,A);if(b)return v.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(R){const k=(255|R.rgba)>>>0;return[a,g,_]=o.toChannels(k),{css:v.toCss(a,g,_),rgba:k}},d.opacity=w,d.multiplyOpacity=function(R,k){return l=255&R.rgba,w(R,l*k/255)},d.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(S||(i.color=S={})),(function(d){let w,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const A=k.getContext("2d",{willReadFrequently:!0});A&&(w=A,w.globalCompositeOperation="copy",R=w.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return a=parseInt(k.slice(1,2).repeat(2),16),g=parseInt(k.slice(2,3).repeat(2),16),_=parseInt(k.slice(3,4).repeat(2),16),v.toColor(a,g,_);case 5:return a=parseInt(k.slice(1,2).repeat(2),16),g=parseInt(k.slice(2,3).repeat(2),16),_=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),v.toColor(a,g,_,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const A=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(A)return a=parseInt(A[1]),g=parseInt(A[2]),_=parseInt(A[3]),l=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),v.toColor(a,g,_,l);if(!w||!R)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=R,w.fillStyle=k,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[a,g,_,l]=w.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(a,g,_,l),css:k}}})(C||(i.css=C={})),(function(d){function w(R,k,A){const b=R/255,T=k/255,I=A/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}d.relativeLuminance=function(R){return w(R>>16&255,R>>8&255,255&R)},d.relativeLuminance2=w})(f||(i.rgb=f={})),(function(d){function w(k,A,b){const T=k>>24&255,I=k>>16&255,W=k>>8&255;let O=A>>24&255,j=A>>16&255,z=A>>8&255,Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));for(;Y<b&&(O>0||j>0||z>0);)O-=Math.max(0,Math.ceil(.1*O)),j-=Math.max(0,Math.ceil(.1*j)),z-=Math.max(0,Math.ceil(.1*z)),Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));return(O<<24|j<<16|z<<8|255)>>>0}function R(k,A,b){const T=k>>24&255,I=k>>16&255,W=k>>8&255;let O=A>>24&255,j=A>>16&255,z=A>>8&255,Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));for(;Y<b&&(O<255||j<255||z<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),j=Math.min(255,j+Math.ceil(.1*(255-j))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));return(O<<24|j<<16|z<<8|255)>>>0}d.blend=function(k,A){if(l=(255&A)/255,l===1)return A;const b=A>>24&255,T=A>>16&255,I=A>>8&255,W=k>>24&255,O=k>>16&255,j=k>>8&255;return a=W+Math.round((b-W)*l),g=O+Math.round((T-O)*l),_=j+Math.round((I-j)*l),v.toRgba(a,g,_)},d.ensureContrastRatio=function(k,A,b){const T=f.relativeLuminance(k>>8),I=f.relativeLuminance(A>>8);if(h(T,I)<b){if(I<T){const j=w(k,A,b),z=h(T,f.relativeLuminance(j>>8));if(z<b){const Y=R(k,A,b);return z>h(T,f.relativeLuminance(Y>>8))?j:Y}return j}const W=R(k,A,b),O=h(T,f.relativeLuminance(W>>8));if(O<b){const j=w(k,A,b);return O>h(T,f.relativeLuminance(j>>8))?W:j}return W}},d.reduceLuminance=w,d.increaseLuminance=R,d.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(i.rgba=o={})),i.toPaddedHex=u,i.contrastRatio=h},345:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let g=0;g<this._listeners.length;g++)if(this._listeners[g]===a)return void this._listeners.splice(g,1)}}})),this._event}fire(a,g){const _=[];for(let l=0;l<this._listeners.length;l++)_.push(this._listeners[l]);for(let l=0;l<_.length;l++)_[l].call(void 0,a,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(a,g){return a((_=>g.fire(_)))},i.runAndSubscribe=function(a,g){return g(void 0),a((_=>g(_)))}},859:(D,i)=>{function a(g){for(const _ of g)_.dispose();g.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const _=this._disposables.indexOf(g);_!==-1&&this._disposables.splice(_,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){var _;this._isDisposed||g===this._value||((_=this._value)==null||_.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){var g;this._isDisposed=!0,(g=this._value)==null||g.dispose(),this._value=void 0}},i.toDisposable=function(g){return{dispose:g}},i.disposeArray=a,i.getDisposeArrayDisposable=function(g){return{dispose:()=>a(g)}}},485:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,l,v){this._data[_]||(this._data[_]={}),this._data[_][l]=v}get(_,l){return this._data[_]?this._data[_][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=a,i.FourKeyMap=class{constructor(){this._data=new a}set(g,_,l,v,S){this._data.get(g,_)||this._data.set(g,_,new a),this._data.get(g,_).set(l,v,S)}get(g,_,l,v){var S;return(S=this._data.get(g,_))==null?void 0:S.get(l,v)}clear(){this._data.clear()}}},399:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const a=i.isNode?"node":navigator.userAgent,g=i.isNode?"node":navigator.platform;i.isFirefox=a.includes("Firefox"),i.isLegacyEdge=a.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(a),i.getSafariVersion=function(){if(!i.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),i.isIpad=g==="iPad",i.isIphone=g==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),i.isLinux=g.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(a)},385:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const g=a(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let C=0,f=0,o=S.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),f=Math.max(C,f),u=S.timeRemaining(),1.5*f>u)return o-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-C))}ms`),void this._start();o=u}this.clear()}}class l extends _{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const C=Date.now()+S;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},147:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}i.AttributeData=a;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,v=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=v}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=g},782:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const g=a(133),_=a(855),l=a(147);class v extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const f=new v;return f.setFromCharData(C),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(C[_.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(C[_.CHAR_DATA_CHAR_INDEX].length===2){const o=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|C[_.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[_.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=C[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},855:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},133:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},i.utf32ToString=function(a,g=0,_=a.length){let l="";for(let v=g;v<_;++v){let S=a[v];S>65535?(S-=65536,l+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):l+=String.fromCharCode(S)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,g){const _=a.length;if(!_)return 0;let l=0,v=0;if(this._interim){const S=a.charCodeAt(v++);56320<=S&&S<=57343?g[l++]=1024*(this._interim-55296)+S-56320+65536:(g[l++]=this._interim,g[l++]=S),this._interim=0}for(let S=v;S<_;++S){const C=a.charCodeAt(S);if(55296<=C&&C<=56319){if(++S>=_)return this._interim=C,l;const f=a.charCodeAt(S);56320<=f&&f<=57343?g[l++]=1024*(C-55296)+f-56320+65536:(g[l++]=C,g[l++]=f)}else C!==65279&&(g[l++]=C)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,g){const _=a.length;if(!_)return 0;let l,v,S,C,f=0,o=0,u=0;if(this.interim[0]){let w=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,A=0;for(;(k=63&this.interim[++A])&&A<4;)R<<=6,R|=k;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=b-A;for(;u<T;){if(u>=_)return 0;if(k=a[u++],(192&k)!=128){u--,w=!0;break}this.interim[A++]=k,R<<=6,R|=63&k}w||(b===2?R<128?u--:g[f++]=R:b===3?R<2048||R>=55296&&R<=57343||R===65279||(g[f++]=R):R<65536||R>1114111||(g[f++]=R)),this.interim.fill(0)}const h=_-4;let d=u;for(;d<_;){for(;!(!(d<h)||128&(l=a[d])||128&(v=a[d+1])||128&(S=a[d+2])||128&(C=a[d+3]));)g[f++]=l,g[f++]=v,g[f++]=S,g[f++]=C,d+=4;if(l=a[d++],l<128)g[f++]=l;else if((224&l)==192){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(o=(31&l)<<6|63&v,o<128){d--;continue}g[f++]=o}else if((240&l)==224){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,f;if(S=a[d++],(192&S)!=128){d--;continue}if(o=(15&l)<<12|(63&v)<<6|63&S,o<2048||o>=55296&&o<=57343||o===65279)continue;g[f++]=o}else if((248&l)==240){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,f;if(S=a[d++],(192&S)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,this.interim[2]=S,f;if(C=a[d++],(192&C)!=128){d--;continue}if(o=(7&l)<<18|(63&v)<<12|(63&S)<<6|63&C,o<65536||o>1114111)continue;g[f++]=o}}return f}}},776:function(D,i,a){var g=this&&this.__decorate||function(o,u,h,d){var w,R=arguments.length,k=R<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,h,d);else for(var A=o.length-1;A>=0;A--)(w=o[A])&&(k=(R<3?w(k):R>3?w(u,h,k):w(u,h))||k);return R>3&&k&&Object.defineProperty(u,h,k),k},_=this&&this.__param||function(o,u){return function(h,d){u(h,d,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const l=a(859),v=a(97),S={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,f=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,h){this._evalLazyOptionalParams(h),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...h)}trace(o,...u){var h;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var h;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var h;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var h;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var h;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,o,u)}};i.LogService=f=g([_(0,v.IOptionsService)],f),i.setTraceLogger=function(o){C=o},i.traceCall=function(o,u,h){if(typeof h.value!="function")throw new Error("not supported");const d=h.value;h.value=function(...w){if(C.logLevel!==v.LogLevelEnum.TRACE)return d.apply(this,w);C.trace(`GlyphRenderer#${d.name}(${w.map((k=>JSON.stringify(k))).join(", ")})`);const R=d.apply(this,w);return C.trace(`GlyphRenderer#${d.name} return`,R),R}}},726:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const a="di$target",g="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(_){return _[g]||[]},i.createDecorator=function(_){if(i.serviceRegistry.has(_))return i.serviceRegistry.get(_);const l=function(v,S,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,o,u){o[a]===o?o[g].push({id:f,index:u}):(o[g]=[{id:f,index:u}],o[a]=o)})(l,v,C)};return l.toString=()=>_,i.serviceRegistry.set(_,l),l}},97:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const g=a(726);var _;i.IBufferService=(0,g.createDecorator)("BufferService"),i.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),i.ICoreService=(0,g.createDecorator)("CoreService"),i.ICharsetService=(0,g.createDecorator)("CharsetService"),i.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(_||(i.LogLevelEnum=_={})),i.ILogService=(0,g.createDecorator)("LogService"),i.IOptionsService=(0,g.createDecorator)("OptionsService"),i.IOscLinkService=(0,g.createDecorator)("OscLinkService"),i.IUnicodeService=(0,g.createDecorator)("UnicodeService"),i.IDecorationService=(0,g.createDecorator)("DecorationService")}},y={};function E(D){var i=y[D];if(i!==void 0)return i.exports;var a=y[D]={exports:{}};return c[D].call(a.exports,a,a.exports,E),a.exports}var N={};return(()=>{var D=N;Object.defineProperty(D,"__esModule",{value:!0}),D.WebglAddon=void 0;const i=E(345),a=E(859),g=E(399),_=E(666),l=E(776);class v extends a.Disposable{constructor(C){if(g.isSafari&&(0,g.getSafariVersion)()<16){const f={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",f))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=C,this._onChangeTextureAtlas=this.register(new i.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new i.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new i.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new i.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(C){const f=C._core;if(!C.element)return void this.register(f.onWillOpen((()=>this.activate(C))));this._terminal=C;const o=f.coreService,u=f.optionsService,h=f,d=h._renderService,w=h._characterJoinerService,R=h._charSizeService,k=h._coreBrowserService,A=h._decorationService,b=h._logService,T=h._themeService;(0,l.setTraceLogger)(b),this._renderer=this.register(new _.WebglRenderer(C,w,R,k,o,A,u,T,this._preserveDrawingBuffer)),this.register((0,i.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,i.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,i.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,i.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),d.setRenderer(this._renderer),this.register((0,a.toDisposable)((()=>{const I=this._terminal._core._renderService;I.setRenderer(this._terminal._core._createRenderer()),I.handleResize(C.cols,C.rows)})))}get textureAtlas(){var C;return(C=this._renderer)==null?void 0:C.textureAtlas}clearTextureAtlas(){var C;(C=this._renderer)==null||C.clearTextureAtlas()}}D.WebglAddon=v})(),N})()))})(jl)),jl.exports}var R0=T0(),Bl={exports:{}},xd;function M0(){return xd||(xd=1,(function(r,n){(function(c,y){r.exports=y()})(globalThis,(()=>(()=>{var c={4567:function(D,i,a){var g=this&&this.__decorate||function(h,d,w,R){var k,A=arguments.length,b=A<3?d:R===null?R=Object.getOwnPropertyDescriptor(d,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,w,R);else for(var T=h.length-1;T>=0;T--)(k=h[T])&&(b=(A<3?k(b):A>3?k(d,w,b):k(d,w))||b);return A>3&&b&&Object.defineProperty(d,w,b),b},_=this&&this.__param||function(h,d){return function(w,R){d(w,R,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const l=a(9042),v=a(9924),S=a(844),C=a(4725),f=a(2585),o=a(3656);let u=i.AccessibilityManager=class extends S.Disposable{constructor(h,d,w,R){super(),this._terminal=h,this._coreBrowserService=w,this._renderService=R,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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 v.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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
109
|
+
`)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.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,S.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(h){for(let d=0;d<h;d++)this._handleChar(" ")}_handleChar(h){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==h&&(this._charsToAnnounce+=h):this._charsToAnnounce+=h,h===`
|
|
110
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(h){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(h)||this._charsToConsume.push(h)}_refreshRows(h,d){this._liveRegionDebouncer.refresh(h,d,this._terminal.rows)}_renderRows(h,d){const w=this._terminal.buffer,R=w.lines.length.toString();for(let k=h;k<=d;k++){const A=w.lines.get(w.ydisp+k),b=[],T=(A==null?void 0:A.translateToString(!0,void 0,void 0,b))||"",I=(w.ydisp+k+1).toString(),W=this._rowElements[k];W&&(T.length===0?(W.innerText=" ",this._rowColumns.set(W,[0,1])):(W.textContent=T,this._rowColumns.set(W,b)),W.setAttribute("aria-posinset",I),W.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(h,d){const w=h.target,R=this._rowElements[d===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(d===0?"1":`${this._terminal.buffer.lines.length}`)||h.relatedTarget!==R)return;let k,A;if(d===0?(k=w,A=this._rowElements.pop(),this._rowContainer.removeChild(A)):(k=this._rowElements.shift(),A=w,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),A.removeEventListener("focus",this._bottomBoundaryFocusListener),d===0){const b=this._createAccessibilityTreeNode();this._rowElements.unshift(b),this._rowContainer.insertAdjacentElement("afterbegin",b)}else{const b=this._createAccessibilityTreeNode();this._rowElements.push(b),this._rowContainer.appendChild(b)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(d===0?-1:1),this._rowElements[d===0?1:this._rowElements.length-2].focus(),h.preventDefault(),h.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const h=document.getSelection();if(!h)return;if(h.isCollapsed)return void(this._rowContainer.contains(h.anchorNode)&&this._terminal.clearSelection());if(!h.anchorNode||!h.focusNode)return void console.error("anchorNode and/or focusNode are null");let d={node:h.anchorNode,offset:h.anchorOffset},w={node:h.focusNode,offset:h.focusOffset};if((d.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||d.node===w.node&&d.offset>w.offset)&&([d,w]=[w,d]),d.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(d={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(d.node))return;const R=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:R,offset:((T=R.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(w.node))return;const k=({node:I,offset:W})=>{const O=I instanceof Text?I.parentNode:I;let j=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(j))return console.warn("row is invalid. Race condition?"),null;const z=this._rowColumns.get(O);if(!z)return console.warn("columns is null. Race condition?"),null;let Y=W<z.length?z[W]:z.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++j,Y=0),{row:j,column:Y}},A=k(d),b=k(w);if(A&&b){if(A.row>b.row||A.row===b.row&&A.column>=b.column)throw new Error("invalid range");this._terminal.select(A.column,A.row,(b.row-A.row)*this._terminal.cols-A.column+b.column)}}_handleResize(h){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let d=this._rowContainer.children.length;d<this._terminal.rows;d++)this._rowElements[d]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[d]);for(;this._rowElements.length>h;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const h=this._coreBrowserService.mainDocument.createElement("div");return h.setAttribute("role","listitem"),h.tabIndex=-1,this._refreshRowDimensions(h),h}_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 h=0;h<this._terminal.rows;h++)this._refreshRowDimensions(this._rowElements[h])}}_refreshRowDimensions(h){h.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=u=g([_(1,f.IInstantiationService),_(2,C.ICoreBrowserService),_(3,C.IRenderService)],u)},3614:(D,i)=>{function a(v){return v.replace(/\r?\n/g,"\r")}function g(v,S){return S?"\x1B[200~"+v+"\x1B[201~":v}function _(v,S,C,f){v=g(v=a(v),C.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),S.value=""}function l(v,S,C){const f=C.getBoundingClientRect(),o=v.clientX-f.left-10,u=v.clientY-f.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${o}px`,S.style.top=`${u}px`,S.style.zIndex="1000",S.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=a,i.bracketTextForPaste=g,i.copyHandler=function(v,S){v.clipboardData&&v.clipboardData.setData("text/plain",S.selectionText),v.preventDefault()},i.handlePasteEvent=function(v,S,C,f){v.stopPropagation(),v.clipboardData&&_(v.clipboardData.getData("text/plain"),S,C,f)},i.paste=_,i.moveTextAreaUnderMouseCursor=l,i.rightClickHandler=function(v,S,C,f,o){l(v,S,C),o&&f.rightClickSelect(v),S.value=f.selectionText,S.select()}},7239:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const g=a(1505);i.ColorContrastCache=class{constructor(){this._color=new g.TwoKeyMap,this._css=new g.TwoKeyMap}setCss(_,l,v){this._css.set(_,l,v)}getCss(_,l){return this._css.get(_,l)}setColor(_,l,v){this._color.set(_,l,v)}getColor(_,l){return this._color.get(_,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(a,g,_,l){a.addEventListener(g,_,l);let v=!1;return{dispose:()=>{v||(v=!0,a.removeEventListener(g,_,l))}}}},3551:function(D,i,a){var g=this&&this.__decorate||function(u,h,d,w){var R,k=arguments.length,A=k<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,d):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,h,d,w);else for(var b=u.length-1;b>=0;b--)(R=u[b])&&(A=(k<3?R(A):k>3?R(h,d,A):R(h,d))||A);return k>3&&A&&Object.defineProperty(h,d,A),A},_=this&&this.__param||function(u,h){return function(d,w){h(d,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const l=a(3656),v=a(8460),S=a(844),C=a(2585),f=a(4725);let o=i.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(u,h,d,w,R){super(),this._element=u,this._mouseService=h,this._renderService=d,this._bufferService=w,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const h=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const d=u.composedPath();for(let w=0;w<d.length;w++){const R=d[w];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&h.x===this._lastBufferCell.x&&h.y===this._lastBufferCell.y||(this._handleHover(h),this._lastBufferCell=h)}_handleHover(u){if(this._activeLine!==u.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(u,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,u)||(this._clearCurrentLink(),this._askForLink(u,!0))}_askForLink(u,h){var w,R;this._activeProviderReplies&&h||((w=this._activeProviderReplies)==null||w.forEach((k=>{k==null||k.forEach((A=>{A.link.dispose&&A.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let d=!1;for(const[k,A]of this._linkProviderService.linkProviders.entries())h?(R=this._activeProviderReplies)!=null&&R.get(k)&&(d=this._checkLinkProviderResult(k,u,d)):A.provideLinks(u.y,(b=>{var I,W;if(this._isMouseOut)return;const T=b==null?void 0:b.map((O=>({link:O})));(I=this._activeProviderReplies)==null||I.set(k,T),d=this._checkLinkProviderResult(k,u,d),((W=this._activeProviderReplies)==null?void 0:W.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,h){const d=new Set;for(let w=0;w<h.size;w++){const R=h.get(w);if(R)for(let k=0;k<R.length;k++){const A=R[k],b=A.link.range.start.y<u?0:A.link.range.start.x,T=A.link.range.end.y>u?this._bufferService.cols:A.link.range.end.x;for(let I=b;I<=T;I++){if(d.has(I)){R.splice(k--,1);break}d.add(I)}}}}_checkLinkProviderResult(u,h,d){var k;if(!this._activeProviderReplies)return d;const w=this._activeProviderReplies.get(u);let R=!1;for(let A=0;A<u;A++)this._activeProviderReplies.has(A)&&!this._activeProviderReplies.get(A)||(R=!0);if(!R&&w){const A=w.find((b=>this._linkAtPosition(b.link,h)));A&&(d=!0,this._handleNewLink(A))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!d)for(let A=0;A<this._activeProviderReplies.size;A++){const b=(k=this._activeProviderReplies.get(A))==null?void 0:k.find((T=>this._linkAtPosition(T.link,h)));if(b){d=!0,this._handleNewLink(b);break}}return d}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const h=this._positionFromMouseEvent(u,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,h){this._currentLink&&this._lastMouseEvent&&(!u||!h||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(u){if(!this._lastMouseEvent)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(u.link,h)&&(this._currentLink=u,this._currentLink.state={decorations:{underline:u.link.decorations===void 0||u.link.decorations.underline,pointerCursor:u.link.decorations===void 0||u.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,u.link,this._lastMouseEvent),u.link.decorations={},Object.defineProperties(u.link.decorations,{pointerCursor:{get:()=>{var d,w;return(w=(d=this._currentLink)==null?void 0:d.state)==null?void 0:w.decorations.pointerCursor},set:d=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==d&&(this._currentLink.state.decorations.pointerCursor=d,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",d))}},underline:{get:()=>{var d,w;return(w=(d=this._currentLink)==null?void 0:d.state)==null?void 0:w.decorations.underline},set:d=>{var w,R,k;(w=this._currentLink)!=null&&w.state&&((k=(R=this._currentLink)==null?void 0:R.state)==null?void 0:k.decorations.underline)!==d&&(this._currentLink.state.decorations.underline=d,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,d))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((d=>{if(!this._currentLink)return;const w=d.start===0?0:d.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+d.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(w,R),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(u,h,d){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(d,h.text)}_fireUnderlineEvent(u,h){const d=u.range,w=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(d.start.x-1,d.start.y-w-1,d.end.x,d.end.y-w-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(u,h,d){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(d,h.text)}_linkAtPosition(u,h){const d=u.range.start.y*this._bufferService.cols+u.range.start.x,w=u.range.end.y*this._bufferService.cols+u.range.end.x,R=h.y*this._bufferService.cols+h.x;return d<=R&&R<=w}_positionFromMouseEvent(u,h,d){const w=d.getCoords(u,h,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,h,d,w,R){return{x1:u,y1:h,x2:d,y2:w,cols:this._bufferService.cols,fg:R}}};i.Linkifier=o=g([_(1,f.IMouseService),_(2,f.IRenderService),_(3,C.IBufferService),_(4,f.ILinkProviderService)],o)},9042:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(D,i,a){var g=this&&this.__decorate||function(f,o,u,h){var d,w=arguments.length,R=w<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,u):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,o,u,h);else for(var k=f.length-1;k>=0;k--)(d=f[k])&&(R=(w<3?d(R):w>3?d(o,u,R):d(o,u))||R);return w>3&&R&&Object.defineProperty(o,u,R),R},_=this&&this.__param||function(f,o){return function(u,h){o(u,h,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const l=a(511),v=a(2585);let S=i.OscLinkProvider=class{constructor(f,o,u){this._bufferService=f,this._optionsService=o,this._oscLinkService=u}provideLinks(f,o){var T;const u=this._bufferService.buffer.lines.get(f-1);if(!u)return void o(void 0);const h=[],d=this._optionsService.rawOptions.linkHandler,w=new l.CellData,R=u.getTrimmedLength();let k=-1,A=-1,b=!1;for(let I=0;I<R;I++)if(A!==-1||u.hasContent(I)){if(u.loadCell(I,w),w.hasExtendedAttrs()&&w.extended.urlId){if(A===-1){A=I,k=w.extended.urlId;continue}b=w.extended.urlId!==k}else A!==-1&&(b=!0);if(b||A!==-1&&I===R-1){const W=(T=this._oscLinkService.getLinkData(k))==null?void 0:T.uri;if(W){const O={start:{x:A+1,y:f},end:{x:I+(b||I!==R-1?0:1),y:f}};let j=!1;if(!(d!=null&&d.allowNonHttpProtocols))try{const z=new URL(W);["http:","https:"].includes(z.protocol)||(j=!0)}catch{j=!0}j||h.push({text:W,range:O,activate:(z,Y)=>d?d.activate(z,Y,O):C(0,Y),hover:(z,Y)=>{var Z;return(Z=d==null?void 0:d.hover)==null?void 0:Z.call(d,z,Y,O)},leave:(z,Y)=>{var Z;return(Z=d==null?void 0:d.leave)==null?void 0:Z.call(d,z,Y,O)}})}b=!1,w.hasExtendedAttrs()&&w.extended.urlId?(A=I,k=w.extended.urlId):(A=-1,k=-1)}}o(h)}};function C(f,o){if(confirm(`Do you want to navigate to ${o}?
|
|
111
|
+
|
|
112
|
+
WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=S=g([_(0,v.IBufferService),_(1,v.IOptionsService),_(2,v.IOscLinkService)],S)},6193:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(a,g){this._renderCallback=a,this._coreBrowserService=g,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(a,g,_){this._rowCount=_,a=a!==void 0?a:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g,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 a=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,g),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const g=a(3614),_=a(3656),l=a(3551),v=a(9042),S=a(3730),C=a(1680),f=a(3107),o=a(5744),u=a(2950),h=a(1296),d=a(428),w=a(4269),R=a(5114),k=a(8934),A=a(3230),b=a(9312),T=a(4725),I=a(6731),W=a(8055),O=a(8969),j=a(8460),z=a(844),Y=a(6114),Z=a(8437),J=a(2584),K=a(7399),P=a(5941),$=a(9074),F=a(2585),q=a(5435),ne=a(4567),re=a(779);class ie extends O.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(V={}){super(V),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,G)=>this.refresh(H,G)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,z.toDisposable)((()=>{var H,G;this._customKeyEventHandler=void 0,(G=(H=this.element)==null?void 0:H.parentNode)==null||G.removeChild(this.element)})))}_handleColorEvent(V){if(this._themeService)for(const H of V){let G,ee="";switch(H.index){case 256:G="foreground",ee="10";break;case 257:G="background",ee="11";break;case 258:G="cursor",ee="12";break;default:G="ansi",ee="4;"+H.index}switch(H.type){case 0:const de=W.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${J.C0.ESC}]${ee};${(0,P.toRgbString)(de)}${J.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors((ue=>ue.ansi[H.index]=W.channels.toColor(...H.color)));else{const ue=G;this._themeService.modifyColors((Ee=>Ee[ue]=W.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(V){V?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ne.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(V){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var V;return(V=this.textarea)==null?void 0:V.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(J.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const V=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(V);if(!H)return;const G=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,de=H.getWidth(G),ue=this._renderService.dimensions.css.cell.width*de,Ee=this.buffer.y*this._renderService.dimensions.css.cell.height,ke=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ke+"px",this.textarea.style.top=Ee+"px",this.textarea.style.width=ue+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,g.copyHandler)(H,this._selectionService)})));const V=H=>(0,g.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",V)),this.register((0,_.addDisposableDomListener)(this.element,"paste",V)),Y.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,g.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,g.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,g.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(V=>this._keyUp(V)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(V=>this._keyDown(V)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(V=>this._keyPress(V)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(V=>this._compositionHelper.compositionupdate(V)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(V=>this._inputEvent(V)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(V){var G;if(!V)throw new Error("Terminal requires a parent element.");if(V.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((G=this.element)==null?void 0:G.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=V.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"),V.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.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,_.addDisposableDomListener)(this.screenElement,"mousemove",(ee=>this.updateCursorStyle(ee)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),Y.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(R.CoreBrowserService,this.textarea,V.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(d.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(A.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.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(b.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(ee=>this._selectionService.handleMouseDown(ee)))),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(ne.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&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(h.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const V=this,H=this.element;function G(ue){const Ee=V._mouseService.getMouseReportCoords(ue,V.screenElement);if(!Ee)return!1;let ke,$e;switch(ue.overrideType||ue.type){case"mousemove":$e=32,ue.buttons===void 0?(ke=3,ue.button!==void 0&&(ke=ue.button<3?ue.button:3)):ke=1&ue.buttons?0:4&ue.buttons?1:2&ue.buttons?2:3;break;case"mouseup":$e=0,ke=ue.button<3?ue.button:3;break;case"mousedown":$e=1,ke=ue.button<3?ue.button:3;break;case"wheel":if(V._customWheelEventHandler&&V._customWheelEventHandler(ue)===!1||V.viewport.getLinesScrolled(ue)===0)return!1;$e=ue.deltaY<0?0:1,ke=4;break;default:return!1}return!($e===void 0||ke===void 0||ke>4)&&V.coreMouseService.triggerMouseEvent({col:Ee.col,row:Ee.row,x:Ee.x,y:Ee.y,button:ke,action:$e,ctrl:ue.ctrlKey,alt:ue.altKey,shift:ue.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:ue=>(G(ue),ue.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(ue)),wheel:ue=>(G(ue),this.cancel(ue,!0)),mousedrag:ue=>{ue.buttons&&G(ue)},mousemove:ue=>{ue.buttons||G(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?ee.mousemove||(H.addEventListener("mousemove",de.mousemove),ee.mousemove=de.mousemove):(H.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&ue?ee.wheel||(H.addEventListener("wheel",de.wheel,{passive:!1}),ee.wheel=de.wheel):(H.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&ue?ee.mouseup||(ee.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&ue?ee.mousedrag||(ee.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(H,"mousedown",(ue=>{if(ue.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ue))return G(ue),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(ue)}))),this.register((0,_.addDisposableDomListener)(H,"wheel",(ue=>{if(!ee.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 ke=J.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ue.deltaY<0?"A":"B");let $e="";for(let Ye=0;Ye<Math.abs(Ee);Ye++)$e+=ke;return this.coreService.triggerDataEvent($e,!0),this.cancel(ue,!0)}return this.viewport.handleWheel(ue)?this.cancel(ue):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(H,"touchstart",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ue),this.cancel(ue)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(H,"touchmove",(ue=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ue)?void 0:this.cancel(ue)}),{passive:!1}))}refresh(V,H){var G;(G=this._renderService)==null||G.refreshRows(V,H)}updateCursorStyle(V){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(V)?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(V,H,G=0){var ee;G===1?(super.scrollLines(V,H,G),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(V)}paste(V){(0,g.paste)(V,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(V){this._customKeyEventHandler=V}attachCustomWheelEventHandler(V){this._customWheelEventHandler=V}registerLinkProvider(V){return this._linkProviderService.registerLinkProvider(V)}registerCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(V);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(V)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(V){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+V)}registerDecoration(V){return this._decorationService.registerDecoration(V)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(V,H,G){this._selectionService.setSelection(V,H,G)}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 V;(V=this._selectionService)==null||V.clearSelection()}selectAll(){var V;(V=this._selectionService)==null||V.selectAll()}selectLines(V,H){var G;(G=this._selectionService)==null||G.selectLines(V,H)}_keyDown(V){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&V.altKey;if(!H&&!this._compositionHelper.keydown(V))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||V.key!=="Dead"&&V.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,K.evaluateKeyboardEvent)(V,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(V),G.type===3||G.type===2){const ee=this.rows-1;return this.scrollLines(G.type===2?-ee:ee),this.cancel(V,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,V)||(G.cancel&&this.cancel(V,!0),!G.key||!!(V.key&&!V.ctrlKey&&!V.altKey&&!V.metaKey&&V.key.length===1&&V.key.charCodeAt(0)>=65&&V.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==J.C0.ETX&&G.key!==J.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||V.altKey||V.ctrlKey?this.cancel(V,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(V,H){const G=V.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||V.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||V.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?G:G&&(!H.keyCode||H.keyCode>47)}_keyUp(V){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(V)||this.focus(),this.updateCursorStyle(V),this._keyPressHandled=!1)}_keyPress(V){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;if(this.cancel(V),V.charCode)H=V.charCode;else if(V.which===null||V.which===void 0)H=V.keyCode;else{if(V.which===0||V.charCode===0)return!1;H=V.which}return!(!H||(V.altKey||V.ctrlKey||V.metaKey)&&!this._isThirdLevelShift(this.browser,V)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(V){if(V.data&&V.inputType==="insertText"&&(!V.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=V.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(V),!0}return!1}resize(V,H){V!==this.cols||H!==this.rows?super.resize(V,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(V,H){var G,ee;(G=this._charSizeService)==null||G.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var V;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(Z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(V=this.viewport)==null||V.reset(),this.refresh(0,this.rows-1)}}reset(){var H,G;this.options.rows=this.rows,this.options.cols=this.cols;const V=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(G=this.viewport)==null||G.reset(),this._customKeyEventHandler=V,this.refresh(0,this.rows-1)}clearTextureAtlas(){var V;(V=this._renderService)==null||V.clearTextureAtlas()}_reportFocus(){var V;(V=this.element)!=null&&V.classList.contains("focus")?this.coreService.triggerDataEvent(J.C0.ESC+"[I"):this.coreService.triggerDataEvent(J.C0.ESC+"[O")}_reportWindowsOptions(V){if(this._renderService)switch(V){case q.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[4;${G};${H}t`);break;case q.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${J.C0.ESC}[6;${de};${ee}t`)}}cancel(V,H){if(this.options.cancelEvents||H)return V.preventDefault(),V.stopPropagation(),!1}}i.Terminal=ie},9924:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(a,g=1e3){this._renderCallback=a,this._debounceThresholdMS=g,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,g,_){this._rowCount=_,a=a!==void 0?a:0,g=g!==void 0?g:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,g):g;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=l-this._lastRefreshMs,S=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),S)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),g=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,g)}}},1680:function(D,i,a){var g=this&&this.__decorate||function(u,h,d,w){var R,k=arguments.length,A=k<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,d):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,h,d,w);else for(var b=u.length-1;b>=0;b--)(R=u[b])&&(A=(k<3?R(A):k>3?R(h,d,A):R(h,d))||A);return k>3&&A&&Object.defineProperty(h,d,A),A},_=this&&this.__param||function(u,h){return function(d,w){h(d,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const l=a(3656),v=a(4725),S=a(8460),C=a(844),f=a(2585);let o=i.Viewport=class extends C.Disposable{constructor(u,h,d,w,R,k,A,b){super(),this._viewportElement=u,this._scrollArea=h,this._bufferService=d,this._optionsService=w,this._charSizeService=R,this._renderService=k,this._coreBrowserService=A,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((T=>this._activeBuffer=T.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((T=>this._renderDimensions=T))),this._handleThemeChange(b.colors),this.register(b.onChangeColors((T=>this._handleThemeChange(T)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(u){this._viewportElement.style.backgroundColor=u.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(u){if(u)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const h=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==h&&(this._lastRecordedBufferHeight=h,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const u=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==u&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=u),this._refreshAnimationFrame=null}syncScrollArea(u=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(u);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(u)}_handleScroll(u){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const h=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const u=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(u*(this._smoothScrollState.target-this._smoothScrollState.origin)),u<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(u,h){const d=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(h<0&&this._viewportElement.scrollTop!==0||h>0&&d<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const h=this._getPixelsScrolled(u);return h!==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+h:this._smoothScrollState.target+=h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=h,this._bubbleScroll(u,h))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const h=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+h,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:u,suppressScrollEvent:!1})}_getPixelsScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let h=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?h*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._currentRowHeight*this._bufferService.rows),h}getBufferElements(u,h){var b;let d,w="";const R=[],k=h??this._bufferService.buffer.lines.length,A=this._bufferService.buffer.lines;for(let T=u;T<k;T++){const I=A.get(T);if(!I)continue;const W=(b=A.get(T+1))==null?void 0:b.isWrapped;if(w+=I.translateToString(!W),!W||T===A.length-1){const O=document.createElement("div");O.textContent=w,R.push(O),w.length>0&&(d=O),w=""}}return{bufferElements:R,cursorElement:d}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let h=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(h/=this._currentRowHeight+0,this._wheelPartialScroll+=h,h=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(h*=this._bufferService.rows),h}_applyScrollModifier(u,h){const d=this._optionsService.rawOptions.fastScrollModifier;return d==="alt"&&h.altKey||d==="ctrl"&&h.ctrlKey||d==="shift"&&h.shiftKey?u*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:u*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(u){this._lastTouchY=u.touches[0].pageY}handleTouchMove(u){const h=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,h!==0&&(this._viewportElement.scrollTop+=h,this._bubbleScroll(u,h))}};i.Viewport=o=g([_(2,f.IBufferService),_(3,f.IOptionsService),_(4,v.ICharSizeService),_(5,v.IRenderService),_(6,v.ICoreBrowserService),_(7,v.IThemeService)],o)},3107:function(D,i,a){var g=this&&this.__decorate||function(f,o,u,h){var d,w=arguments.length,R=w<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,u):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,o,u,h);else for(var k=f.length-1;k>=0;k--)(d=f[k])&&(R=(w<3?d(R):w>3?d(o,u,R):d(o,u))||R);return w>3&&R&&Object.defineProperty(o,u,R),R},_=this&&this.__param||function(f,o){return function(u,h){o(u,h,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const l=a(4725),v=a(844),S=a(2585);let C=i.BufferDecorationRenderer=class extends v.Disposable{constructor(f,o,u,h,d){super(),this._screenElement=f,this._bufferService=o,this._coreBrowserService=u,this._decorationService=h,this._renderService=d,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((w=>this._removeDecoration(w)))),this.register((0,v.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 f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var h;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((h=f==null?void 0:f.options)==null?void 0:h.layer)==="top"),o.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(f.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 u=f.options.x??0;return u&&u>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(f,o),o}_refreshStyle(f){const o=f.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let u=this._decorationElements.get(f);u||(u=this._createElement(f),f.element=u,this._decorationElements.set(f,u),this._container.appendChild(u),f.onDispose((()=>{this._decorationElements.delete(f),u.remove()}))),u.style.top=o*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(u)}}_refreshXPosition(f,o=f.element){if(!o)return;const u=f.options.x??0;(f.options.anchor||"left")==="right"?o.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var o;(o=this._decorationElements.get(f))==null||o.remove(),this._decorationElements.delete(f),f.dispose()}};i.BufferDecorationRenderer=C=g([_(1,S.IBufferService),_(2,l.ICoreBrowserService),_(3,S.IDecorationService),_(4,l.IRenderService)],C)},5871:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(a){if(a.options.overviewRulerOptions){for(const g of this._zones)if(g.color===a.options.overviewRulerOptions.color&&g.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(g,a.marker.line))return;if(this._lineAdjacentToZone(g,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(g,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,g){return g>=a.startBufferLine&&g<=a.endBufferLine}_lineAdjacentToZone(a,g,_){return g>=a.startBufferLine-this._linePadding[_||"full"]&&g<=a.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(a,g){a.startBufferLine=Math.min(a.startBufferLine,g),a.endBufferLine=Math.max(a.endBufferLine,g)}}},5744:function(D,i,a){var g=this&&this.__decorate||function(d,w,R,k){var A,b=arguments.length,T=b<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(d,w,R,k);else for(var I=d.length-1;I>=0;I--)(A=d[I])&&(T=(b<3?A(T):b>3?A(w,R,T):A(w,R))||T);return b>3&&T&&Object.defineProperty(w,R,T),T},_=this&&this.__param||function(d,w){return function(R,k){w(R,k,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const l=a(5871),v=a(4725),S=a(844),C=a(2585),f={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let h=i.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(d,w,R,k,A,b,T){var W;super(),this._viewportElement=d,this._screenElement=w,this._bufferService=R,this._decorationService=k,this._renderService=A,this._optionsService=b,this._coreBrowserService=T,this._colorZoneStore=new l.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(),(W=this._viewportElement.parentElement)==null||W.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var O;(O=this._canvas)==null||O.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const d=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=d,o.center=w,o.right=d,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=o.left,u.right=o.left+o.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const d=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(d,12),6)*this._coreBrowserService.dpr);f.left=w,f.center=w,f.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.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 w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const d=this._colorZoneStore.zones;for(const w of d)w.position!=="full"&&this._renderColorZone(w);for(const w of d)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(d){this._ctx.fillStyle=d.color,this._ctx.fillRect(u[d.position||"full"],Math.round((this._canvas.height-1)*(d.startBufferLine/this._bufferService.buffers.active.lines.length)-f[d.position||"full"]/2),o[d.position||"full"],Math.round((this._canvas.height-1)*((d.endBufferLine-d.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[d.position||"full"]))}_queueRefresh(d,w){this._shouldUpdateDimensions=d||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};i.OverviewRulerRenderer=h=g([_(2,C.IBufferService),_(3,C.IDecorationService),_(4,v.IRenderService),_(5,C.IOptionsService),_(6,v.ICoreBrowserService)],h)},2950:function(D,i,a){var g=this&&this.__decorate||function(f,o,u,h){var d,w=arguments.length,R=w<3?o:h===null?h=Object.getOwnPropertyDescriptor(o,u):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,o,u,h);else for(var k=f.length-1;k>=0;k--)(d=f[k])&&(R=(w<3?d(R):w>3?d(o,u,R):d(o,u))||R);return w>3&&R&&Object.defineProperty(o,u,R),R},_=this&&this.__param||function(f,o){return function(u,h){o(u,h,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const l=a(4725),v=a(2585),S=a(2584);let C=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,o,u,h,d,w){this._textarea=f,this._compositionView=o,this._bufferService=u,this._optionsService=h,this._coreService=d,this._renderService=w,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(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),u.length>0&&this._coreService.triggerDataEvent(u,!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 f=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,u=o.replace(f,"");this._dataAlreadySent=u,o.length>f.length?this._coreService.triggerDataEvent(u,!0):o.length<f.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):o.length===f.length&&o!==f&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,h=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,d=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=d+"px",this._compositionView.style.top=h+"px",this._compositionView.style.height=u+"px",this._compositionView.style.lineHeight=u+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const w=this._compositionView.getBoundingClientRect();this._textarea.style.left=d+"px",this._textarea.style.top=h+"px",this._textarea.style.width=Math.max(w.width,1)+"px",this._textarea.style.height=Math.max(w.height,1)+"px",this._textarea.style.lineHeight=w.height+"px"}f||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=C=g([_(2,v.IBufferService),_(3,v.IOptionsService),_(4,v.ICoreService),_(5,l.IRenderService)],C)},9806:(D,i)=>{function a(g,_,l){const v=l.getBoundingClientRect(),S=g.getComputedStyle(l),C=parseInt(S.getPropertyValue("padding-left")),f=parseInt(S.getPropertyValue("padding-top"));return[_.clientX-v.left-C,_.clientY-v.top-f]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=a,i.getCoords=function(g,_,l,v,S,C,f,o,u){if(!C)return;const h=a(g,_,l);return h?(h[0]=Math.ceil((h[0]+(u?f/2:0))/f),h[1]=Math.ceil(h[1]/o),h[0]=Math.min(Math.max(h[0],1),v+(u?1:0)),h[1]=Math.min(Math.max(h[1],1),S),h):void 0}},9504:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const g=a(2584);function _(o,u,h,d){const w=o-l(o,h),R=u-l(u,h),k=Math.abs(w-R)-(function(A,b,T){let I=0;const W=A-l(A,T),O=b-l(b,T);for(let j=0;j<Math.abs(W-O);j++){const z=v(A,b)==="A"?-1:1,Y=T.buffer.lines.get(W+z*j);Y!=null&&Y.isWrapped&&I++}return I})(o,u,h);return f(k,C(v(o,u),d))}function l(o,u){let h=0,d=u.buffer.lines.get(o),w=d==null?void 0:d.isWrapped;for(;w&&o>=0&&o<u.rows;)h++,d=u.buffer.lines.get(--o),w=d==null?void 0:d.isWrapped;return h}function v(o,u){return o>u?"A":"B"}function S(o,u,h,d,w,R){let k=o,A=u,b="";for(;k!==h||A!==d;)k+=w?1:-1,w&&k>R.cols-1?(b+=R.buffer.translateBufferLineToString(A,!1,o,k),k=0,o=0,A++):!w&&k<0&&(b+=R.buffer.translateBufferLineToString(A,!1,0,o+1),k=R.cols-1,o=k,A--);return b+R.buffer.translateBufferLineToString(A,!1,o,k)}function C(o,u){const h=u?"O":"[";return g.C0.ESC+h+o}function f(o,u){o=Math.floor(o);let h="";for(let d=0;d<o;d++)h+=u;return h}i.moveToCellSequence=function(o,u,h,d){const w=h.buffer.x,R=h.buffer.y;if(!h.buffer.hasScrollback)return(function(b,T,I,W,O,j){return _(T,W,O,j).length===0?"":f(S(b,T,b,T-l(T,O),!1,O).length,C("D",j))})(w,R,0,u,h,d)+_(R,u,h,d)+(function(b,T,I,W,O,j){let z;z=_(T,W,O,j).length>0?W-l(W,O):T;const Y=W,Z=(function(J,K,P,$,F,q){let ne;return ne=_(P,$,F,q).length>0?$-l($,F):K,J<P&&ne<=$||J>=P&&ne<$?"C":"D"})(b,T,I,W,O,j);return f(S(b,z,I,Y,Z==="C",O).length,C(Z,j))})(w,R,o,u,h,d);let k;if(R===u)return k=w>o?"D":"C",f(Math.abs(w-o),C(k,d));k=R>u?"D":"C";const A=Math.abs(R-u);return f((function(b,T){return T.cols-b})(R>u?o:w,h)+(A-1)*h.cols+1+((R>u?w:o)-1),C(k,d))}},1296:function(D,i,a){var g=this&&this.__decorate||function(j,z,Y,Z){var J,K=arguments.length,P=K<3?z:Z===null?Z=Object.getOwnPropertyDescriptor(z,Y):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(j,z,Y,Z);else for(var $=j.length-1;$>=0;$--)(J=j[$])&&(P=(K<3?J(P):K>3?J(z,Y,P):J(z,Y))||P);return K>3&&P&&Object.defineProperty(z,Y,P),P},_=this&&this.__param||function(j,z){return function(Y,Z){z(Y,Z,j)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const l=a(3787),v=a(2550),S=a(2223),C=a(6171),f=a(6052),o=a(4725),u=a(8055),h=a(8460),d=a(844),w=a(2585),R="xterm-dom-renderer-owner-",k="xterm-rows",A="xterm-fg-",b="xterm-bg-",T="xterm-focus",I="xterm-selection";let W=1,O=i.DomRenderer=class extends d.Disposable{constructor(j,z,Y,Z,J,K,P,$,F,q,ne,re,ie){super(),this._terminal=j,this._document=z,this._element=Y,this._screenElement=Z,this._viewportElement=J,this._helperContainer=K,this._linkifier2=P,this._charSizeService=F,this._optionsService=q,this._bufferService=ne,this._coreBrowserService=re,this._themeService=ie,this._terminalClass=W++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((Q=>this._injectCss(Q)))),this._injectCss(this._themeService.colors),this._rowFactory=$.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((Q=>this._handleLinkHover(Q)))),this.register(this._linkifier2.onHideLinkUnderline((Q=>this._handleLinkLeave(Q)))),this.register((0,d.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.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 j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const z=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=z,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let z=`${this._terminalSelector} .${k} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;z+=`${this._terminalSelector} .${k} .xterm-dim { color: ${u.color.multiplyOpacity(j.foreground,.5).css};}`,z+=`${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 Y=`blink_underline_${this._terminalClass}`,Z=`blink_bar_${this._terminalClass}`,J=`blink_block_${this._terminalClass}`;z+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,z+=`@keyframes ${Z} { 50% { box-shadow: none; }}`,z+=`@keyframes ${J} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,z+=`${this._terminalSelector} .${k}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${k}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Z} 1s step-end infinite;}${this._terminalSelector} .${k}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${J} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,z+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[K,P]of j.ansi.entries())z+=`${this._terminalSelector} .${A}${K} { color: ${P.css}; }${this._terminalSelector} .${A}${K}.xterm-dim { color: ${u.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${b}${K} { background-color: ${P.css}; }`;z+=`${this._terminalSelector} .${A}${S.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(j.background).css}; }${this._terminalSelector} .${A}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${b}${S.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=z}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,z){for(let Y=this._rowElements.length;Y<=z;Y++){const Z=this._document.createElement("div");this._rowContainer.appendChild(Z),this._rowElements.push(Z)}for(;this._rowElements.length>z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,z){this._refreshRowElements(j,z),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(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,z,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,z,Y),this.renderRows(0,this._bufferService.rows-1),!j||!z)return;this._selectionRenderModel.update(this._terminal,j,z,Y);const Z=this._selectionRenderModel.viewportStartRow,J=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||P<0)return;const $=this._document.createDocumentFragment();if(Y){const F=j[0]>z[0];$.appendChild(this._createSelectionElement(K,F?z[0]:j[0],F?j[0]:z[0],P-K+1))}else{const F=Z===K?j[0]:0,q=K===J?z[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(K,F,q));const ne=P-K-1;if($.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,ne)),K!==P){const re=J===P?z[0]:this._bufferService.cols;$.appendChild(this._createSelectionElement(P,0,re))}}this._selectionContainer.appendChild($)}_createSelectionElement(j,z,Y,Z=1){const J=this._document.createElement("div"),K=z*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*(Y-z);return K+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-K),J.style.height=Z*this.dimensions.css.cell.height+"px",J.style.top=j*this.dimensions.css.cell.height+"px",J.style.left=`${K}px`,J.style.width=`${P}px`,J}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const j of this._rowElements)j.replaceChildren()}renderRows(j,z){const Y=this._bufferService.buffer,Z=Y.ybase+Y.y,J=Math.min(Y.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,$=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=j;F<=z;F++){const q=F+Y.ydisp,ne=this._rowElements[F],re=Y.lines.get(q);if(!ne||!re)break;ne.replaceChildren(...this._rowFactory.createRow(re,q,q===Z,P,$,J,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,z,Y,Z,J,K){Y<0&&(j=0),Z<0&&(z=0);const P=this._bufferService.rows-1;Y=Math.max(Math.min(Y,P),0),Z=Math.max(Math.min(Z,P),0),J=Math.min(J,this._bufferService.cols);const $=this._bufferService.buffer,F=$.ybase+$.y,q=Math.min($.x,J-1),ne=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=Y;Q<=Z;++Q){const V=Q+$.ydisp,H=this._rowElements[Q],G=$.lines.get(V);if(!H||!G)break;H.replaceChildren(...this._rowFactory.createRow(G,V,V===F,re,ie,q,ne,this.dimensions.css.cell.width,this._widthCache,K?Q===Y?j:0:-1,K?(Q===Z?z:J)-1:-1))}}};i.DomRenderer=O=g([_(7,w.IInstantiationService),_(8,o.ICharSizeService),_(9,w.IOptionsService),_(10,w.IBufferService),_(11,o.ICoreBrowserService),_(12,o.IThemeService)],O)},3787:function(D,i,a){var g=this&&this.__decorate||function(k,A,b,T){var I,W=arguments.length,O=W<3?A:T===null?T=Object.getOwnPropertyDescriptor(A,b):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,A,b,T);else for(var j=k.length-1;j>=0;j--)(I=k[j])&&(O=(W<3?I(O):W>3?I(A,b,O):I(A,b))||O);return W>3&&O&&Object.defineProperty(A,b,O),O},_=this&&this.__param||function(k,A){return function(b,T){A(b,T,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const l=a(2223),v=a(643),S=a(511),C=a(2585),f=a(8055),o=a(4725),u=a(4269),h=a(6171),d=a(3734);let w=i.DomRendererRowFactory=class{constructor(k,A,b,T,I,W,O){this._document=k,this._characterJoinerService=A,this._optionsService=b,this._coreBrowserService=T,this._coreService=I,this._decorationService=W,this._themeService=O,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,A,b){this._selectionStart=k,this._selectionEnd=A,this._columnSelectMode=b}createRow(k,A,b,T,I,W,O,j,z,Y,Z){const J=[],K=this._characterJoinerService.getJoinedCharacters(A),P=this._themeService.colors;let $,F=k.getNoBgTrimmedLength();b&&F<W+1&&(F=W+1);let q=0,ne="",re=0,ie=0,Q=0,V=!1,H=0,G=!1,ee=0;const de=[],ue=Y!==-1&&Z!==-1;for(let Ee=0;Ee<F;Ee++){k.loadCell(Ee,this._workCell);let ke=this._workCell.getWidth();if(ke===0)continue;let $e=!1,Ye=Ee,Te=this._workCell;if(K.length>0&&Ee===K[0][0]){$e=!0;const fe=K.shift();Te=new u.JoinedCellData(this._workCell,k.translateToString(!0,fe[0],fe[1]),fe[1]-fe[0]),Ye=fe[1]-1,ke=Te.getWidth()}const ot=this._isCellInSelection(Ee,A),Ae=b&&Ee===W,De=ue&&Ee>=Y&&Ee<=Z;let Ce=!1;this._decorationService.forEachDecorationAtCell(Ee,A,void 0,(fe=>{Ce=!0}));let je=Te.getChars()||v.WHITESPACE_CELL_CHAR;if(je===" "&&(Te.isUnderline()||Te.isOverline())&&(je=" "),ee=ke*j-z.get(je,Te.isBold(),Te.isItalic()),$){if(q&&(ot&&G||!ot&&!G&&Te.bg===re)&&(ot&&G&&P.selectionForeground||Te.fg===ie)&&Te.extended.ext===Q&&De===V&&ee===H&&!Ae&&!$e&&!Ce){Te.isInvisible()?ne+=v.WHITESPACE_CELL_CHAR:ne+=je,q++;continue}q&&($.textContent=ne),$=this._document.createElement("span"),q=0,ne=""}else $=this._document.createElement("span");if(re=Te.bg,ie=Te.fg,Q=Te.extended.ext,V=De,H=ee,G=ot,$e&&W>=Ee&&W<=Ye&&(W=Ee),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(de.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&de.push("xterm-cursor-blink"),de.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){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(Te.isBold()&&de.push("xterm-bold"),Te.isItalic()&&de.push("xterm-italic"),Te.isDim()&&de.push("xterm-dim"),ne=Te.isInvisible()?v.WHITESPACE_CELL_CHAR:Te.getChars()||v.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(de.push(`xterm-underline-${Te.extended.underlineStyle}`),ne===" "&&(ne=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${d.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let fe=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&fe<8&&(fe+=8),$.style.textDecorationColor=P.ansi[fe].css}Te.isOverline()&&(de.push("xterm-overline"),ne===" "&&(ne=" ")),Te.isStrikethrough()&&de.push("xterm-strikethrough"),De&&($.style.textDecoration="underline");let _e=Te.getFgColor(),We=Te.getFgColorMode(),Je=Te.getBgColor(),Ze=Te.getBgColorMode();const St=!!Te.isInverse();if(St){const fe=_e;_e=Je,Je=fe;const ze=We;We=Ze,Ze=ze}let at,lt,tt,Ge=!1;switch(this._decorationService.forEachDecorationAtCell(Ee,A,void 0,(fe=>{fe.options.layer!=="top"&&Ge||(fe.backgroundColorRGB&&(Ze=50331648,Je=fe.backgroundColorRGB.rgba>>8&16777215,at=fe.backgroundColorRGB),fe.foregroundColorRGB&&(We=50331648,_e=fe.foregroundColorRGB.rgba>>8&16777215,lt=fe.foregroundColorRGB),Ge=fe.options.layer==="top")})),!Ge&&ot&&(at=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,Je=at.rgba>>8&16777215,Ze=50331648,Ge=!0,P.selectionForeground&&(We=50331648,_e=P.selectionForeground.rgba>>8&16777215,lt=P.selectionForeground)),Ge&&de.push("xterm-decoration-top"),Ze){case 16777216:case 33554432:tt=P.ansi[Je],de.push(`xterm-bg-${Je}`);break;case 50331648:tt=f.channels.toColor(Je>>16,Je>>8&255,255&Je),this._addStyle($,`background-color:#${R((Je>>>0).toString(16),"0",6)}`);break;default:St?(tt=P.foreground,de.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):tt=P.background}switch(at||Te.isDim()&&(at=f.color.multiplyOpacity(tt,.5)),We){case 16777216:case 33554432:Te.isBold()&&_e<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(_e+=8),this._applyMinimumContrast($,tt,P.ansi[_e],Te,at,void 0)||de.push(`xterm-fg-${_e}`);break;case 50331648:const fe=f.channels.toColor(_e>>16&255,_e>>8&255,255&_e);this._applyMinimumContrast($,tt,fe,Te,at,lt)||this._addStyle($,`color:#${R(_e.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,tt,P.foreground,Te,at,lt)||St&&de.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}de.length&&($.className=de.join(" "),de.length=0),Ae||$e||Ce?$.textContent=ne:q++,ee!==this.defaultSpacing&&($.style.letterSpacing=`${ee}px`),J.push($),Ee=Ye}return $&&q&&($.textContent=ne),J}_applyMinimumContrast(k,A,b,T,I,W){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,h.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const O=this._getContrastCache(T);let j;if(I||W||(j=O.getColor(A.rgba,b.rgba)),j===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);j=f.color.ensureContrastRatio(I||A,W||b,z),O.setColor((I||A).rgba,(W||b).rgba,j??null)}return!!j&&(this._addStyle(k,`color:${j.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,A){k.setAttribute("style",`${k.getAttribute("style")||""}${A};`)}_isCellInSelection(k,A){const b=this._selectionStart,T=this._selectionEnd;return!(!b||!T)&&(this._columnSelectMode?b[0]<=T[0]?k>=b[0]&&A>=b[1]&&k<T[0]&&A<=T[1]:k<b[0]&&A>=b[1]&&k>=T[0]&&A<=T[1]:A>b[1]&&A<T[1]||b[1]===T[1]&&A===b[1]&&k>=b[0]&&k<T[0]||b[1]<T[1]&&A===T[1]&&k<T[0]||b[1]<T[1]&&A===b[1]&&k>=b[0])}};function R(k,A,b){for(;k.length<b;)k=A+k;return k}i.DomRendererRowFactory=w=g([_(1,o.ICharacterJoinerService),_(2,C.IOptionsService),_(3,o.ICoreBrowserService),_(4,C.ICoreService),_(5,C.IDecorationService),_(6,o.IThemeService)],w)},2550:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(a,g){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.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 _=a.createElement("span");_.classList.add("xterm-char-measure-element");const l=a.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const v=a.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const S=a.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[_,l,v,S],this._container.appendChild(_),this._container.appendChild(l),this._container.appendChild(v),this._container.appendChild(S),g.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(a,g,_,l){a===this._font&&g===this._fontSize&&_===this._weight&&l===this._weightBold||(this._font=a,this._fontSize=g,this._weight=_,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(a,g,_){let l=0;if(!g&&!_&&a.length===1&&(l=a.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const C=this._measure(a,0);return C>0&&(this._flat[l]=C),C}let v=a;g&&(v+="B"),_&&(v+="I");let S=this._holey.get(v);if(S===void 0){let C=0;g&&(C|=1),_&&(C|=2),S=this._measure(a,C),S>0&&this._holey.set(v,S)}return S}_measure(a,g){const _=this._measureElements[g];return _.textContent=a.repeat(32),_.offsetWidth/32}}},2223:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const g=a(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=g.isFirefox||g.isLegacyEdge?"bottom":"ideographic"},6171:(D,i)=>{function a(_){return 57508<=_&&_<=57558}function g(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},i.isPowerlineGlyph=a,i.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},i.isEmoji=g,i.allowRescaling=function(_,l,v,S){return l===1&&v>Math.ceil(1.5*S)&&_!==void 0&&_>255&&!g(_)&&!a(_)&&!(function(C){return 57344<=C&&C<=63743})(_)},i.treatGlyphAsBackgroundColor=function(_){return a(_)||(function(l){return 9472<=l&&l<=9631})(_)},i.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}}}},i.computeNextVariantOffset=function(_,l,v=0){return(_-(2*Math.round(l)-v))%(2*Math.round(l))}},6052:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class a{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(_,l,v,S=!1){if(this.selectionStart=l,this.selectionEnd=v,!l||!v||l[0]===v[0]&&l[1]===v[1])return void this.clear();const C=_.buffers.active.ydisp,f=l[1]-C,o=v[1]-C,u=Math.max(f,0),h=Math.min(o,_.rows-1);u>=_.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=f,this.viewportEndRow=o,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=l[0],this.endCol=v[0])}isCellSelected(_,l,v){return!!this.hasSelection&&(v-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&v>=this.viewportCappedStartRow&&l<this.endCol&&v<=this.viewportCappedEndRow:l<this.startCol&&v>=this.viewportCappedStartRow&&l>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&l>=this.startCol)}}i.createSelectionRenderModel=function(){return new a}},456:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,g=this.selectionEnd;return!(!a||!g)&&(a[1]>g[1]||a[1]===g[1]&&a[0]>g[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(D,i,a){var g=this&&this.__decorate||function(h,d,w,R){var k,A=arguments.length,b=A<3?d:R===null?R=Object.getOwnPropertyDescriptor(d,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,w,R);else for(var T=h.length-1;T>=0;T--)(k=h[T])&&(b=(A<3?k(b):A>3?k(d,w,b):k(d,w))||b);return A>3&&b&&Object.defineProperty(d,w,b),b},_=this&&this.__param||function(h,d){return function(w,R){d(w,R,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const l=a(2585),v=a(8460),S=a(844);let C=i.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(h,d,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new o(h,d,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const h=this._measureStrategy.measure();h.width===this.width&&h.height===this.height||(this.width=h.width,this.height=h.height,this._onCharSizeChange.fire())}};i.CharSizeService=C=g([_(2,l.IOptionsService)],C);class f extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(d,w){d!==void 0&&d>0&&w!==void 0&&w>0&&(this._result.width=d,this._result.height=w)}}class o extends f{constructor(d,w,R){super(),this._document=d,this._parentElement=w,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class u extends f{constructor(d){super(),this._optionsService=d,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const w=this._ctx.measureText("W");if(!("width"in w&&"fontBoundingBoxAscent"in w&&"fontBoundingBoxDescent"in w))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const d=this._ctx.measureText("W");return this._validateAndSet(d.width,d.fontBoundingBoxAscent+d.fontBoundingBoxDescent),this._result}}},4269:function(D,i,a){var g=this&&this.__decorate||function(u,h,d,w){var R,k=arguments.length,A=k<3?h:w===null?w=Object.getOwnPropertyDescriptor(h,d):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,h,d,w);else for(var b=u.length-1;b>=0;b--)(R=u[b])&&(A=(k<3?R(A):k>3?R(h,d,A):R(h,d))||A);return k>3&&A&&Object.defineProperty(h,d,A),A},_=this&&this.__param||function(u,h){return function(d,w){h(d,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const l=a(3734),v=a(643),S=a(511),C=a(2585);class f extends l.AttributeData{constructor(h,d,w){super(),this.content=0,this.combinedData="",this.fg=h.fg,this.bg=h.bg,this.combinedData=d,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(h){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=f;let o=i.CharacterJoinerService=class $f{constructor(h){this._bufferService=h,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(h){const d={id:this._nextCharacterJoinerId++,handler:h};return this._characterJoiners.push(d),d.id}deregister(h){for(let d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===h)return this._characterJoiners.splice(d,1),!0;return!1}getJoinedCharacters(h){if(this._characterJoiners.length===0)return[];const d=this._bufferService.buffer.lines.get(h);if(!d||d.length===0)return[];const w=[],R=d.translateToString(!0);let k=0,A=0,b=0,T=d.getFg(0),I=d.getBg(0);for(let W=0;W<d.getTrimmedLength();W++)if(d.loadCell(W,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==I){if(W-k>1){const O=this._getJoinedRanges(R,b,A,d,k);for(let j=0;j<O.length;j++)w.push(O[j])}k=W,b=A,T=this._workCell.fg,I=this._workCell.bg}A+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const W=this._getJoinedRanges(R,b,A,d,k);for(let O=0;O<W.length;O++)w.push(W[O])}return w}_getJoinedRanges(h,d,w,R,k){const A=h.substring(d,w);let b=[];try{b=this._characterJoiners[0].handler(A)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const I=this._characterJoiners[T].handler(A);for(let W=0;W<I.length;W++)$f._mergeRanges(b,I[W])}catch(I){console.error(I)}return this._stringRangesToCellRanges(b,R,k),b}_stringRangesToCellRanges(h,d,w){let R=0,k=!1,A=0,b=h[R];if(b){for(let T=w;T<this._bufferService.cols;T++){const I=d.getWidth(T),W=d.getString(T).length||v.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!k&&b[0]<=A&&(b[0]=T,k=!0),b[1]<=A){if(b[1]=T,b=h[++R],!b)break;b[0]<=A?(b[0]=T,k=!0):k=!1}A+=W}}b&&(b[1]=this._bufferService.cols)}}static _mergeRanges(h,d){let w=!1;for(let R=0;R<h.length;R++){const k=h[R];if(w){if(d[1]<=k[0])return h[R-1][1]=d[1],h;if(d[1]<=k[1])return h[R-1][1]=Math.max(d[1],k[1]),h.splice(R,1),h;h.splice(R,1),R--}else{if(d[1]<=k[0])return h.splice(R,0,d),h;if(d[1]<=k[1])return k[0]=Math.min(d[0],k[0]),h;d[0]<k[1]&&(k[0]=Math.min(d[0],k[0]),w=!0)}}return w?h[h.length-1][1]=d[1]:h.push(d),h}};i.CharacterJoinerService=o=g([_(0,C.IBufferService)],o)},5114:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const g=a(844),_=a(8460),l=a(3656);class v extends g.Disposable{constructor(f,o,u){super(),this._textarea=f,this._window=o,this.mainDocument=u,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new S(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((h=>this._screenDprMonitor.setWindow(h)))),this.register((0,_.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(f){this._window!==f&&(this._window=f,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}}i.CoreBrowserService=v;class S extends g.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new g.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,g.toDisposable)((()=>this.clearListener())))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.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:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const g=a(844);class _ extends g.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,g.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const S=this.linkProviders.indexOf(v);S!==-1&&this.linkProviders.splice(S,1)}}}}i.LinkProviderService=_},8934:function(D,i,a){var g=this&&this.__decorate||function(C,f,o,u){var h,d=arguments.length,w=d<3?f:u===null?u=Object.getOwnPropertyDescriptor(f,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(C,f,o,u);else for(var R=C.length-1;R>=0;R--)(h=C[R])&&(w=(d<3?h(w):d>3?h(f,o,w):h(f,o))||w);return d>3&&w&&Object.defineProperty(f,o,w),w},_=this&&this.__param||function(C,f){return function(o,u){f(o,u,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const l=a(4725),v=a(9806);let S=i.MouseService=class{constructor(C,f){this._renderService=C,this._charSizeService=f}getCoords(C,f,o,u,h){return(0,v.getCoords)(window,C,f,o,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,h)}getMouseReportCoords(C,f){const o=(0,v.getCoordsRelativeToElement)(window,C,f);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])}}};i.MouseService=S=g([_(0,l.IRenderService),_(1,l.ICharSizeService)],S)},3230:function(D,i,a){var g=this&&this.__decorate||function(h,d,w,R){var k,A=arguments.length,b=A<3?d:R===null?R=Object.getOwnPropertyDescriptor(d,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,w,R);else for(var T=h.length-1;T>=0;T--)(k=h[T])&&(b=(A<3?k(b):A>3?k(d,w,b):k(d,w))||b);return A>3&&b&&Object.defineProperty(d,w,b),b},_=this&&this.__param||function(h,d){return function(w,R){d(w,R,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const l=a(6193),v=a(4725),S=a(8460),C=a(844),f=a(7226),o=a(2585);let u=i.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(h,d,w,R,k,A,b,T){super(),this._rowCount=h,this._charSizeService=R,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new S.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new S.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new S.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new S.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((I,W)=>this._renderRows(I,W)),b),this.register(this._renderDebouncer),this.register(b.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(A.onResize((()=>this._fullRefresh()))),this.register(A.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(w.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(A.cols,A.rows),this._fullRefresh()}))),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(A.buffer.y,A.buffer.y,!0)))),this.register(T.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(b.window,d),this.register(b.onWindowChange((I=>this._registerIntersectionObserver(I,d))))}_registerIntersectionObserver(h,d){if("IntersectionObserver"in h){const w=new h.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});w.observe(d),this._observerDisposable.value=(0,C.toDisposable)((()=>w.disconnect()))}}_handleIntersectionChange(h){this._isPaused=h.isIntersecting===void 0?h.intersectionRatio===0:!h.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(h,d,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(h,d,this._rowCount))}_renderRows(h,d){this._renderer.value&&(h=Math.min(h,this._rowCount-1),d=Math.min(d,this._rowCount-1),this._renderer.value.renderRows(h,d),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:h,end:d}),this._onRender.fire({start:h,end:d}),this._isNextRenderRedrawOnly=!0)}resize(h,d){this._rowCount=d,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(h){this._renderer.value=h,this._renderer.value&&(this._renderer.value.onRequestRedraw((d=>this.refreshRows(d.start,d.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(h){return this._renderDebouncer.addRefreshCallback(h)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var h,d;this._renderer.value&&((d=(h=this._renderer.value).clearTextureAtlas)==null||d.call(h),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(h,d){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(h,d)})):this._renderer.value.handleResize(h,d),this._fullRefresh())}handleCharSizeChanged(){var h;(h=this._renderer.value)==null||h.handleCharSizeChanged()}handleBlur(){var h;(h=this._renderer.value)==null||h.handleBlur()}handleFocus(){var h;(h=this._renderer.value)==null||h.handleFocus()}handleSelectionChanged(h,d,w){var R;this._selectionState.start=h,this._selectionState.end=d,this._selectionState.columnSelectMode=w,(R=this._renderer.value)==null||R.handleSelectionChanged(h,d,w)}handleCursorMove(){var h;(h=this._renderer.value)==null||h.handleCursorMove()}clear(){var h;(h=this._renderer.value)==null||h.clear()}};i.RenderService=u=g([_(2,o.IOptionsService),_(3,v.ICharSizeService),_(4,o.IDecorationService),_(5,o.IBufferService),_(6,v.ICoreBrowserService),_(7,v.IThemeService)],u)},9312:function(D,i,a){var g=this&&this.__decorate||function(b,T,I,W){var O,j=arguments.length,z=j<3?T:W===null?W=Object.getOwnPropertyDescriptor(T,I):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(b,T,I,W);else for(var Y=b.length-1;Y>=0;Y--)(O=b[Y])&&(z=(j<3?O(z):j>3?O(T,I,z):O(T,I))||z);return j>3&&z&&Object.defineProperty(T,I,z),z},_=this&&this.__param||function(b,T){return function(I,W){T(I,W,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const l=a(9806),v=a(9504),S=a(456),C=a(4725),f=a(8460),o=a(844),u=a(6114),h=a(4841),d=a(511),w=a(2585),R=" ",k=new RegExp(R,"g");let A=i.SelectionService=class extends o.Disposable{constructor(b,T,I,W,O,j,z,Y,Z){super(),this._element=b,this._screenElement=T,this._linkifier=I,this._bufferService=W,this._coreService=O,this._mouseService=j,this._optionsService=z,this._renderService=Y,this._coreBrowserService=Z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new d.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=J=>this._handleMouseMove(J),this._mouseUpListener=J=>this._handleMouseUp(J),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((J=>this._handleTrim(J))),this.register(this._bufferService.buffers.onBufferActivate((J=>this._handleBufferActivate(J)))),this.enable(),this._model=new S.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 b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!b||!T||b[0]===T[0]&&b[1]===T[1])}get selectionText(){const b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!b||!T)return"";const I=this._bufferService.buffer,W=[];if(this._activeSelectionMode===3){if(b[0]===T[0])return"";const O=b[0]<T[0]?b[0]:T[0],j=b[0]<T[0]?T[0]:b[0];for(let z=b[1];z<=T[1];z++){const Y=I.translateBufferLineToString(z,!0,O,j);W.push(Y)}}else{const O=b[1]===T[1]?T[0]:void 0;W.push(I.translateBufferLineToString(b[1],!0,b[0],O));for(let j=b[1]+1;j<=T[1]-1;j++){const z=I.lines.get(j),Y=I.translateBufferLineToString(j,!0);z!=null&&z.isWrapped?W[W.length-1]+=Y:W.push(Y)}if(b[1]!==T[1]){const j=I.lines.get(T[1]),z=I.translateBufferLineToString(T[1],!0,0,T[0]);j&&j.isWrapped?W[W.length-1]+=z:W.push(z)}}return W.map((O=>O.replace(k," "))).join(u.isWindows?`\r
|
|
113
|
+
`:`
|
|
114
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(b){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&b&&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(b){const T=this._getMouseBufferCoords(b),I=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!!(I&&W&&T)&&this._areCoordsInSelection(T,I,W)}isCellInSelection(b,T){const I=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!(!I||!W)&&this._areCoordsInSelection([b,T],I,W)}_areCoordsInSelection(b,T,I){return b[1]>T[1]&&b[1]<I[1]||T[1]===I[1]&&b[1]===T[1]&&b[0]>=T[0]&&b[0]<I[0]||T[1]<I[1]&&b[1]===I[1]&&b[0]<I[0]||T[1]<I[1]&&b[1]===T[1]&&b[0]>=T[0]}_selectWordAtCursor(b,T){var O,j;const I=(j=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:j.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,h.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const W=this._getMouseBufferCoords(b);return!!W&&(this._selectWordAt(W,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(b,T){this._model.clearSelection(),b=Math.max(b,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,b],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(b){this._model.handleTrim(b)&&this.refresh()}_getMouseBufferCoords(b){const T=this._mouseService.getCoords(b,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(b){let T=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,b,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=I?0:(T>I&&(T-=I),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(b){return u.isMac?b.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:b.shiftKey}handleMouseDown(b){if(this._mouseDownTimeStamp=b.timeStamp,(b.button!==2||!this.hasSelection)&&b.button===0){if(!this._enabled){if(!this.shouldForceSelection(b))return;b.stopPropagation()}b.preventDefault(),this._dragScrollAmount=0,this._enabled&&b.shiftKey?this._handleIncrementalClick(b):b.detail===1?this._handleSingleClick(b):b.detail===2?this._handleDoubleClick(b):b.detail===3&&this._handleTripleClick(b),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(b){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(b))}_handleSingleClick(b){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(b)?3:0,this._model.selectionStart=this._getMouseBufferCoords(b),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(b){this._selectWordAtCursor(b,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(b){const T=this._getMouseBufferCoords(b);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(b){return b.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(b){if(b.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(b),!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(b),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const W=I.lines.get(this._model.selectionEnd[1]);W&&W.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}T&&T[0]===this._model.selectionEnd[0]&&T[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 b=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(b.ydisp+this._bufferService.rows,b.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=b.ydisp),this.refresh()}}_handleMouseUp(b){const T=b.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&b.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(b,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const W=(0,v.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(W,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const b=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,I=!(!b||!T||b[0]===T[0]&&b[1]===T[1]);I?b&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&b[0]===this._oldSelectionStart[0]&&b[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(b,T,I)):this._oldHasSelection&&this._fireOnSelectionChange(b,T,I)}_fireOnSelectionChange(b,T,I){this._oldSelectionStart=b,this._oldSelectionEnd=T,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(b){this.clearSelection(),this._trimListener.dispose(),this._trimListener=b.activeBuffer.lines.onTrim((T=>this._handleTrim(T)))}_convertViewportColToCharacterIndex(b,T){let I=T;for(let W=0;T>=W;W++){const O=b.loadCell(W,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:O>1&&T!==W&&(I+=O-1)}return I}setSelection(b,T,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[b,T],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(b){this._isClickInSelection(b)||(this._selectWordAtCursor(b,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(b,T,I=!0,W=!0){if(b[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,j=O.lines.get(b[1]);if(!j)return;const z=O.translateBufferLineToString(b[1],!1);let Y=this._convertViewportColToCharacterIndex(j,b[0]),Z=Y;const J=b[0]-Y;let K=0,P=0,$=0,F=0;if(z.charAt(Y)===" "){for(;Y>0&&z.charAt(Y-1)===" ";)Y--;for(;Z<z.length&&z.charAt(Z+1)===" ";)Z++}else{let re=b[0],ie=b[0];j.getWidth(re)===0&&(K++,re--),j.getWidth(ie)===2&&(P++,ie++);const Q=j.getString(ie).length;for(Q>1&&(F+=Q-1,Z+=Q-1);re>0&&Y>0&&!this._isCharWordSeparator(j.loadCell(re-1,this._workCell));){j.loadCell(re-1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,re--):V>1&&($+=V-1,Y-=V-1),Y--,re--}for(;ie<j.length&&Z+1<z.length&&!this._isCharWordSeparator(j.loadCell(ie+1,this._workCell));){j.loadCell(ie+1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,ie++):V>1&&(F+=V-1,Z+=V-1),Z++,ie++}}Z++;let q=Y+J-K+$,ne=Math.min(this._bufferService.cols,Z-Y+K+P-$-F);if(T||z.slice(Y,Z).trim()!==""){if(I&&q===0&&j.getCodePoint(0)!==32){const re=O.lines.get(b[1]-1);if(re&&j.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,b[1]-1],!1,!0,!1);if(ie){const Q=this._bufferService.cols-ie.start;q-=Q,ne+=Q}}}if(W&&q+ne===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const re=O.lines.get(b[1]+1);if(re!=null&&re.isWrapped&&re.getCodePoint(0)!==32){const ie=this._getWordAt([0,b[1]+1],!1,!1,!0);ie&&(ne+=ie.length)}}return{start:q,length:ne}}}_selectWordAt(b,T){const I=this._getWordAt(b,T);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,b[1]--;this._model.selectionStart=[I.start,b[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(b){const T=this._getWordAt(b,!0);if(T){let I=b[1];for(;T.start<0;)T.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,I]}}_isCharWordSeparator(b){return b.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(b.getChars())>=0}_selectLineAt(b){const T=this._bufferService.buffer.getWrappedRangeForLine(b),I={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,h.getRangeLength)(I,this._bufferService.cols)}};i.SelectionService=A=g([_(3,w.IBufferService),_(4,w.ICoreService),_(5,C.IMouseService),_(6,w.IOptionsService),_(7,C.IRenderService),_(8,C.ICoreBrowserService)],A)},4725:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const g=a(8343);i.ICharSizeService=(0,g.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,g.createDecorator)("CoreBrowserService"),i.IMouseService=(0,g.createDecorator)("MouseService"),i.IRenderService=(0,g.createDecorator)("RenderService"),i.ISelectionService=(0,g.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,g.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,g.createDecorator)("ThemeService"),i.ILinkProviderService=(0,g.createDecorator)("LinkProviderService")},6731:function(D,i,a){var g=this&&this.__decorate||function(A,b,T,I){var W,O=arguments.length,j=O<3?b:I===null?I=Object.getOwnPropertyDescriptor(b,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(A,b,T,I);else for(var z=A.length-1;z>=0;z--)(W=A[z])&&(j=(O<3?W(j):O>3?W(b,T,j):W(b,T))||j);return O>3&&j&&Object.defineProperty(b,T,j),j},_=this&&this.__param||function(A,b){return function(T,I){b(T,I,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const l=a(7239),v=a(8055),S=a(8460),C=a(844),f=a(2585),o=v.css.toColor("#ffffff"),u=v.css.toColor("#000000"),h=v.css.toColor("#ffffff"),d=v.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const A=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],b=[0,95,135,175,215,255];for(let T=0;T<216;T++){const I=b[T/36%6|0],W=b[T/6%6|0],O=b[T%6];A.push({css:v.channels.toCss(I,W,O),rgba:v.channels.toRgba(I,W,O)})}for(let T=0;T<24;T++){const I=8+10*T;A.push({css:v.channels.toCss(I,I,I),rgba:v.channels.toRgba(I,I,I)})}return A})());let R=i.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(A){super(),this._optionsService=A,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:u,cursor:h,cursorAccent:d,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:v.color.blend(u,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:v.color.blend(u,w),ansi:i.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(A={}){const b=this._colors;if(b.foreground=k(A.foreground,o),b.background=k(A.background,u),b.cursor=k(A.cursor,h),b.cursorAccent=k(A.cursorAccent,d),b.selectionBackgroundTransparent=k(A.selectionBackground,w),b.selectionBackgroundOpaque=v.color.blend(b.background,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundTransparent=k(A.selectionInactiveBackground,b.selectionBackgroundTransparent),b.selectionInactiveBackgroundOpaque=v.color.blend(b.background,b.selectionInactiveBackgroundTransparent),b.selectionForeground=A.selectionForeground?k(A.selectionForeground,v.NULL_COLOR):void 0,b.selectionForeground===v.NULL_COLOR&&(b.selectionForeground=void 0),v.color.isOpaque(b.selectionBackgroundTransparent)&&(b.selectionBackgroundTransparent=v.color.opacity(b.selectionBackgroundTransparent,.3)),v.color.isOpaque(b.selectionInactiveBackgroundTransparent)&&(b.selectionInactiveBackgroundTransparent=v.color.opacity(b.selectionInactiveBackgroundTransparent,.3)),b.ansi=i.DEFAULT_ANSI_COLORS.slice(),b.ansi[0]=k(A.black,i.DEFAULT_ANSI_COLORS[0]),b.ansi[1]=k(A.red,i.DEFAULT_ANSI_COLORS[1]),b.ansi[2]=k(A.green,i.DEFAULT_ANSI_COLORS[2]),b.ansi[3]=k(A.yellow,i.DEFAULT_ANSI_COLORS[3]),b.ansi[4]=k(A.blue,i.DEFAULT_ANSI_COLORS[4]),b.ansi[5]=k(A.magenta,i.DEFAULT_ANSI_COLORS[5]),b.ansi[6]=k(A.cyan,i.DEFAULT_ANSI_COLORS[6]),b.ansi[7]=k(A.white,i.DEFAULT_ANSI_COLORS[7]),b.ansi[8]=k(A.brightBlack,i.DEFAULT_ANSI_COLORS[8]),b.ansi[9]=k(A.brightRed,i.DEFAULT_ANSI_COLORS[9]),b.ansi[10]=k(A.brightGreen,i.DEFAULT_ANSI_COLORS[10]),b.ansi[11]=k(A.brightYellow,i.DEFAULT_ANSI_COLORS[11]),b.ansi[12]=k(A.brightBlue,i.DEFAULT_ANSI_COLORS[12]),b.ansi[13]=k(A.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),b.ansi[14]=k(A.brightCyan,i.DEFAULT_ANSI_COLORS[14]),b.ansi[15]=k(A.brightWhite,i.DEFAULT_ANSI_COLORS[15]),A.extendedAnsi){const T=Math.min(b.ansi.length-16,A.extendedAnsi.length);for(let I=0;I<T;I++)b.ansi[I+16]=k(A.extendedAnsi[I],i.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(A){this._restoreColor(A),this._onChangeColors.fire(this.colors)}_restoreColor(A){if(A!==void 0)switch(A){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[A]=this._restoreColors.ansi[A]}else for(let b=0;b<this._restoreColors.ansi.length;++b)this._colors.ansi[b]=this._restoreColors.ansi[b]}modifyColors(A){A(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 k(A,b){if(A!==void 0)try{return v.css.toColor(A)}catch{}return b}i.ThemeService=R=g([_(0,f.IOptionsService)],R)},6349:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const g=a(8460),_=a(844);class l extends _.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new g.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new g.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new g.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const C=new Array(S);for(let f=0;f<Math.min(S,this.length);f++)C[f]=this._array[this._getCyclicIndex(f)];this._array=C,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let C=this._length;C<S;C++)this._array[C]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,C){this._array[this._getCyclicIndex(S)]=C}push(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(S,C,...f){if(C){for(let o=S;o<this._length-C;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+C)];this._length-=C,this.onDeleteEmitter.fire({index:S,amount:C})}for(let o=this._length-1;o>=S;o--)this._array[this._getCyclicIndex(o+f.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<f.length;o++)this._array[this._getCyclicIndex(S+o)]=f[o];if(f.length&&this.onInsertEmitter.fire({index:S,amount:f.length}),this._length+f.length>this._maxLength){const o=this._length+f.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=f.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,C,f){if(!(C<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let u=C-1;u>=0;u--)this.set(S+u+f,this.get(S+u));const o=S+C+f-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<C;o++)this.set(S+o+f,this.get(S+o))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}i.CircularList=l},1439:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function a(g,_=5){if(typeof g!="object")return g;const l=Array.isArray(g)?[]:{};for(const v in g)l[v]=_<=1?g[v]:g[v]&&a(g[v],_-1);return l}},8055:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let a=0,g=0,_=0,l=0;var v,S,C,f,o;function u(d){const w=d.toString(16);return w.length<2?"0"+w:w}function h(d,w){return d<w?(w+.05)/(d+.05):(d+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(d){d.toCss=function(w,R,k,A){return A!==void 0?`#${u(w)}${u(R)}${u(k)}${u(A)}`:`#${u(w)}${u(R)}${u(k)}`},d.toRgba=function(w,R,k,A=255){return(w<<24|R<<16|k<<8|A)>>>0},d.toColor=function(w,R,k,A){return{css:d.toCss(w,R,k,A),rgba:d.toRgba(w,R,k,A)}}})(v||(i.channels=v={})),(function(d){function w(R,k){return l=Math.round(255*k),[a,g,_]=o.toChannels(R.rgba),{css:v.toCss(a,g,_,l),rgba:v.toRgba(a,g,_,l)}}d.blend=function(R,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const A=k.rgba>>24&255,b=k.rgba>>16&255,T=k.rgba>>8&255,I=R.rgba>>24&255,W=R.rgba>>16&255,O=R.rgba>>8&255;return a=I+Math.round((A-I)*l),g=W+Math.round((b-W)*l),_=O+Math.round((T-O)*l),{css:v.toCss(a,g,_),rgba:v.toRgba(a,g,_)}},d.isOpaque=function(R){return(255&R.rgba)==255},d.ensureContrastRatio=function(R,k,A){const b=o.ensureContrastRatio(R.rgba,k.rgba,A);if(b)return v.toColor(b>>24&255,b>>16&255,b>>8&255)},d.opaque=function(R){const k=(255|R.rgba)>>>0;return[a,g,_]=o.toChannels(k),{css:v.toCss(a,g,_),rgba:k}},d.opacity=w,d.multiplyOpacity=function(R,k){return l=255&R.rgba,w(R,l*k/255)},d.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(S||(i.color=S={})),(function(d){let w,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const A=k.getContext("2d",{willReadFrequently:!0});A&&(w=A,w.globalCompositeOperation="copy",R=w.createLinearGradient(0,0,1,1))}catch{}d.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return a=parseInt(k.slice(1,2).repeat(2),16),g=parseInt(k.slice(2,3).repeat(2),16),_=parseInt(k.slice(3,4).repeat(2),16),v.toColor(a,g,_);case 5:return a=parseInt(k.slice(1,2).repeat(2),16),g=parseInt(k.slice(2,3).repeat(2),16),_=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),v.toColor(a,g,_,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const A=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(A)return a=parseInt(A[1]),g=parseInt(A[2]),_=parseInt(A[3]),l=Math.round(255*(A[5]===void 0?1:parseFloat(A[5]))),v.toColor(a,g,_,l);if(!w||!R)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=R,w.fillStyle=k,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[a,g,_,l]=w.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(a,g,_,l),css:k}}})(C||(i.css=C={})),(function(d){function w(R,k,A){const b=R/255,T=k/255,I=A/255;return .2126*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}d.relativeLuminance=function(R){return w(R>>16&255,R>>8&255,255&R)},d.relativeLuminance2=w})(f||(i.rgb=f={})),(function(d){function w(k,A,b){const T=k>>24&255,I=k>>16&255,W=k>>8&255;let O=A>>24&255,j=A>>16&255,z=A>>8&255,Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));for(;Y<b&&(O>0||j>0||z>0);)O-=Math.max(0,Math.ceil(.1*O)),j-=Math.max(0,Math.ceil(.1*j)),z-=Math.max(0,Math.ceil(.1*z)),Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));return(O<<24|j<<16|z<<8|255)>>>0}function R(k,A,b){const T=k>>24&255,I=k>>16&255,W=k>>8&255;let O=A>>24&255,j=A>>16&255,z=A>>8&255,Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));for(;Y<b&&(O<255||j<255||z<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),j=Math.min(255,j+Math.ceil(.1*(255-j))),z=Math.min(255,z+Math.ceil(.1*(255-z))),Y=h(f.relativeLuminance2(O,j,z),f.relativeLuminance2(T,I,W));return(O<<24|j<<16|z<<8|255)>>>0}d.blend=function(k,A){if(l=(255&A)/255,l===1)return A;const b=A>>24&255,T=A>>16&255,I=A>>8&255,W=k>>24&255,O=k>>16&255,j=k>>8&255;return a=W+Math.round((b-W)*l),g=O+Math.round((T-O)*l),_=j+Math.round((I-j)*l),v.toRgba(a,g,_)},d.ensureContrastRatio=function(k,A,b){const T=f.relativeLuminance(k>>8),I=f.relativeLuminance(A>>8);if(h(T,I)<b){if(I<T){const j=w(k,A,b),z=h(T,f.relativeLuminance(j>>8));if(z<b){const Y=R(k,A,b);return z>h(T,f.relativeLuminance(Y>>8))?j:Y}return j}const W=R(k,A,b),O=h(T,f.relativeLuminance(W>>8));if(O<b){const j=w(k,A,b);return O>h(T,f.relativeLuminance(j>>8))?W:j}return W}},d.reduceLuminance=w,d.increaseLuminance=R,d.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(i.rgba=o={})),i.toPaddedHex=u,i.contrastRatio=h},8969:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const g=a(844),_=a(2585),l=a(4348),v=a(7866),S=a(744),C=a(7302),f=a(6975),o=a(8460),u=a(1753),h=a(1480),d=a(7994),w=a(9282),R=a(5435),k=a(5981),A=a(2660);let b=!1;class T extends g.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((W=>{var O;(O=this._onScrollApi)==null||O.fire(W.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(W){for(const O in W)this.optionsService.options[O]=W[O]}constructor(W){super(),this._windowsWrappingHeuristics=this.register(new g.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 l.InstantiationService,this.optionsService=this.register(new C.OptionsService(W)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(u.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(h.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(d.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(A.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.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((O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((O=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new k.WriteBuffer(((O,j)=>this._inputHandler.parse(O,j)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(W,O){this._writeBuffer.write(W,O)}writeSync(W,O){this._logService.logLevel<=_.LogLevelEnum.WARN&&!b&&(this._logService.warn("writeSync is unreliable and will be removed soon."),b=!0),this._writeBuffer.writeSync(W,O)}input(W,O=!0){this.coreService.triggerDataEvent(W,O)}resize(W,O){isNaN(W)||isNaN(O)||(W=Math.max(W,S.MINIMUM_COLS),O=Math.max(O,S.MINIMUM_ROWS),this._bufferService.resize(W,O))}scroll(W,O=!1){this._bufferService.scroll(W,O)}scrollLines(W,O,j){this._bufferService.scrollLines(W,O,j)}scrollPages(W){this.scrollLines(W*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(W){const O=W-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(W,O){return this._inputHandler.registerEscHandler(W,O)}registerDcsHandler(W,O){return this._inputHandler.registerDcsHandler(W,O)}registerCsiHandler(W,O){return this._inputHandler.registerCsiHandler(W,O)}registerOscHandler(W,O){return this._inputHandler.registerOscHandler(W,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let W=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?W=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(W=!0),W?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const W=[];W.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),W.push(this.registerCsiHandler({final:"H"},(()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,g.toDisposable)((()=>{for(const O of W)O.dispose()}))}}}i.CoreTerminal=T},8460:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let g=0;g<this._listeners.length;g++)if(this._listeners[g]===a)return void this._listeners.splice(g,1)}}})),this._event}fire(a,g){const _=[];for(let l=0;l<this._listeners.length;l++)_.push(this._listeners[l]);for(let l=0;l<_.length;l++)_[l].call(void 0,a,g)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(a,g){return a((_=>g.fire(_)))},i.runAndSubscribe=function(a,g){return g(void 0),a((_=>g(_)))}},5435:function(D,i,a){var g=this&&this.__decorate||function(K,P,$,F){var q,ne=arguments.length,re=ne<3?P:F===null?F=Object.getOwnPropertyDescriptor(P,$):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(K,P,$,F);else for(var ie=K.length-1;ie>=0;ie--)(q=K[ie])&&(re=(ne<3?q(re):ne>3?q(P,$,re):q(P,$))||re);return ne>3&&re&&Object.defineProperty(P,$,re),re},_=this&&this.__param||function(K,P){return function($,F){P($,F,K)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const l=a(2584),v=a(7116),S=a(2015),C=a(844),f=a(482),o=a(8437),u=a(8460),h=a(643),d=a(511),w=a(3734),R=a(2585),k=a(1480),A=a(6242),b=a(6351),T=a(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},W=131072;function O(K,P){if(K>24)return P.setWinLines||!1;switch(K){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var j;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(i.WindowsOptionsReportType=j={}));let z=0;class Y extends C.Disposable{getAttrData(){return this._curAttrData}constructor(P,$,F,q,ne,re,ie,Q,V=new S.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=$,this._coreService=F,this._logService=q,this._optionsService=ne,this._oscLinkService=re,this._coreMouseService=ie,this._unicodeService=Q,this._parser=V,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new d.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 u.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new u.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new u.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new u.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new u.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new u.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new u.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new u.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new u.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new u.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new u.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new Z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,G)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:G.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,G,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:G,data:ee})})),this._parser.setDcsHandlerFallback(((H,G,ee)=>{G==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:G,payload:ee})})),this._parser.setPrintHandler(((H,G,ee)=>this.print(H,G,ee))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new A.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new A.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new A.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new A.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new A.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new A.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new A.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new A.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new A.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new A.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new A.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new A.OscHandler((H=>this.restoreCursorColor(H)))),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 H in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler(((H,G)=>this.requestStatusString(H,G))))}_preserveStack(P,$,F,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=F,this._parseStack.position=q}_logSlowResolvingAsync(P){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([P,new Promise((($,F)=>setTimeout((()=>F("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(P,$){let F,q=this._activeBuffer.x,ne=this._activeBuffer.y,re=0;const ie=this._parseStack.paused;if(ie){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(F),F;q=this._parseStack.cursorStartX,ne=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>W&&(re=this._parseStack.position+W)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,(H=>String.fromCharCode(H))).join("")}"`),typeof P=="string"?P.split("").map((H=>H.charCodeAt(0))):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<W&&(this._parseBuffer=new Uint32Array(Math.min(P.length,W))),ie||this._dirtyRowTracker.clearRange(),P.length>W)for(let H=re;H<P.length;H+=W){const G=H+W<P.length?H+W:P.length,ee=typeof P=="string"?this._stringDecoder.decode(P.substring(H,G),this._parseBuffer):this._utf8Decoder.decode(P.subarray(H,G),this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,ee))return this._preserveStack(q,ne,ee,H),this._logSlowResolvingAsync(F),F}else if(!ie){const H=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(F=this._parser.parse(this._parseBuffer,H))return this._preserveStack(q,ne,H,0),this._logSlowResolvingAsync(F),F}this._activeBuffer.x===q&&this._activeBuffer.y===ne||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),V=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);V<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(V,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(P,$,F){let q,ne;const re=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,V=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,G=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&F-$>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,G);let de=this._parser.precedingJoinState;for(let ue=$;ue<F;++ue){if(q=P[ue],q<127&&re){const Ye=re[String.fromCharCode(q)];Ye&&(q=Ye.charCodeAt(0))}const Ee=this._unicodeService.charProperties(q,de);ne=k.UnicodeService.extractWidth(Ee);const ke=k.UnicodeService.extractShouldJoin(Ee),$e=ke?k.UnicodeService.extractWidth(de):0;if(de=Ee,ie&&this._onA11yChar.fire((0,f.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ne-$e>Q){if(V){const Ye=ee;let Te=this._activeBuffer.x-$e;for(this._activeBuffer.x=$e,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),$e>0&&ee instanceof o.BufferLine&&ee.copyCellsFrom(Ye,Te,0,$e,!1);Te<Q;)Ye.setCellFromCodepoint(Te++,0,1,G)}else if(this._activeBuffer.x=Q-1,ne===2)continue}if(ke&&this._activeBuffer.x){const Ye=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-Ye,q,ne);for(let Te=ne-$e;--Te>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}else if(H&&(ee.insertCells(this._activeBuffer.x,ne-$e,this._activeBuffer.getNullCell(G)),ee.getWidth(Q-1)===2&&ee.setCellFromCodepoint(Q-1,h.NULL_CELL_CODE,h.NULL_CELL_WIDTH,G)),ee.setCellFromCodepoint(this._activeBuffer.x++,q,ne,G),ne>0)for(;--ne;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}this._parser.precedingJoinState=de,this._activeBuffer.x<Q&&F-$>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,G),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(P,$){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,$):this._parser.registerCsiHandler(P,(F=>!O(F.params[0],this._optionsService.rawOptions.windowOptions)||$(F)))}registerDcsHandler(P,$){return this._parser.registerDcsHandler(P,new b.DcsHandler($))}registerEscHandler(P,$){return this._parser.registerEscHandler(P,$)}registerOscHandler(P,$){return this._parser.registerOscHandler(P,new A.OscHandler($))}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 P;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&&((P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&P.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);$.hasWidth(this._activeBuffer.x)&&!$.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,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(P,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=P,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+$)}cursorUp(P){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const $=P.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=P.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=P.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const $=P.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,$,F,q=!1,ne=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);re.replaceCells($,F,this._activeBuffer.getNullCell(this._eraseAttrData()),ne),q&&(re.isWrapped=!1)}_resetBufferLine(P,$=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),F.isWrapped=!1)}eraseInDisplay(P,$=!1){let F;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);F<this._bufferService.rows;F++)this._resetBufferLine(F,$);this._dirtyRowTracker.markDirty(F);break;case 1:for(F=this._activeBuffer.y,this._dirtyRowTracker.markDirty(F),this._eraseInBufferLine(F,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,$);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(P,$=!1){switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(P){this._restrictCursor();let $=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ne=this._bufferService.rows-1+this._activeBuffer.ybase-q+1;for(;$--;)this._activeBuffer.lines.splice(ne-1,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(P){this._restrictCursor();let $=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=this._activeBuffer.ybase+this._activeBuffer.y;let q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;$--;)this._activeBuffer.lines.splice(F,1),this._activeBuffer.lines.splice(q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let $=P.params[0]||1;for(;$--;)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(P){let $=P.params[0]||1;for(;$--;)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(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);q.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);q.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);q.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=P.params[0]||1;for(let F=this._activeBuffer.scrollTop;F<=this._activeBuffer.scrollBottom;++F){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+F);q.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const $=this._parser.precedingJoinState;if(!$)return!0;const F=P.params[0]||1,q=k.UnicodeService.extractWidth($),ne=this._activeBuffer.x-q,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ne),ie=new Uint32Array(re.length*F);let Q=0;for(let H=0;H<re.length;){const G=re.codePointAt(H)||0;ie[Q++]=G,H+=G>65535?2:1}let V=Q;for(let H=1;H<F;++H)ie.copyWithin(V,0,Q),V+=Q;return this.print(ie,0,V),!0}sendDeviceAttributesPrimary(P){return P.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(P){return P.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let $=0;$<P.length;$++)switch(P.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let $=0;$<P.length;$++)switch(P.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(P){for(let $=0;$<P.length;$++)switch(P.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let $=0;$<P.length;$++)switch(P.params[$]){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(),P.params[$]===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(P,$){const F=this._coreService.decPrivateModes,{activeProtocol:q,activeEncoding:ne}=this._coreMouseService,re=this._coreService,{buffers:ie,cols:Q}=this._bufferService,{active:V,alt:H}=ie,G=this._optionsService.rawOptions,ee=ke=>ke?1:2,de=P.params[0];return ue=de,Ee=$?de===2?4:de===4?ee(re.modes.insertMode):de===12?3:de===20?ee(G.convertEol):0:de===1?ee(F.applicationCursorKeys):de===3?G.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:de===6?ee(F.origin):de===7?ee(F.wraparound):de===8?3:de===9?ee(q==="X10"):de===12?ee(G.cursorBlink):de===25?ee(!re.isCursorHidden):de===45?ee(F.reverseWraparound):de===66?ee(F.applicationKeypad):de===67?4:de===1e3?ee(q==="VT200"):de===1002?ee(q==="DRAG"):de===1003?ee(q==="ANY"):de===1004?ee(F.sendFocus):de===1005?4:de===1006?ee(ne==="SGR"):de===1015?4:de===1016?ee(ne==="SGR_PIXELS"):de===1048?1:de===47||de===1047||de===1049?ee(V===H):de===2004?ee(F.bracketedPasteMode):0,re.triggerDataEvent(`${l.C0.ESC}[${$?"":"?"}${ue};${Ee}$y`),!0;var ue,Ee}_updateAttrColor(P,$,F,q,ne){return $===2?(P|=50331648,P&=-16777216,P|=w.AttributeData.fromColorRGB([F,q,ne])):$===5&&(P&=-50331904,P|=33554432|255&F),P}_extractColor(P,$,F){const q=[0,0,-1,0,0,0];let ne=0,re=0;do{if(q[re+ne]=P.params[$+re],P.hasSubParams($+re)){const ie=P.getSubParams($+re);let Q=0;do q[1]===5&&(ne=1),q[re+Q+1+ne]=ie[Q];while(++Q<ie.length&&Q+re+1+ne<q.length);break}if(q[1]===5&&re+ne>=2||q[1]===2&&re+ne>=5)break;q[1]&&(ne=1)}while(++re+$<P.length&&re+ne<q.length);for(let ie=2;ie<q.length;++ie)q[ie]===-1&&(q[ie]=0);switch(q[0]){case 38:F.fg=this._updateAttrColor(F.fg,q[1],q[3],q[4],q[5]);break;case 48:F.bg=this._updateAttrColor(F.bg,q[1],q[3],q[4],q[5]);break;case 58:F.extended=F.extended.clone(),F.extended.underlineColor=this._updateAttrColor(F.extended.underlineColor,q[1],q[3],q[4],q[5])}return re}_processUnderline(P,$){$.extended=$.extended.clone(),(!~P||P>5)&&(P=1),$.extended.underlineStyle=P,$.fg|=268435456,P===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(P){P.fg=o.DEFAULT_ATTR_DATA.fg,P.bg=o.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=P.length;let F;const q=this._curAttrData;for(let ne=0;ne<$;ne++)F=P.params[ne],F>=30&&F<=37?(q.fg&=-50331904,q.fg|=16777216|F-30):F>=40&&F<=47?(q.bg&=-50331904,q.bg|=16777216|F-40):F>=90&&F<=97?(q.fg&=-50331904,q.fg|=16777224|F-90):F>=100&&F<=107?(q.bg&=-50331904,q.bg|=16777224|F-100):F===0?this._processSGR0(q):F===1?q.fg|=134217728:F===3?q.bg|=67108864:F===4?(q.fg|=268435456,this._processUnderline(P.hasSubParams(ne)?P.getSubParams(ne)[0]:1,q)):F===5?q.fg|=536870912:F===7?q.fg|=67108864:F===8?q.fg|=1073741824:F===9?q.fg|=2147483648:F===2?q.bg|=134217728:F===21?this._processUnderline(2,q):F===22?(q.fg&=-134217729,q.bg&=-134217729):F===23?q.bg&=-67108865:F===24?(q.fg&=-268435457,this._processUnderline(0,q)):F===25?q.fg&=-536870913:F===27?q.fg&=-67108865:F===28?q.fg&=-1073741825:F===29?q.fg&=2147483647:F===39?(q.fg&=-67108864,q.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):F===49?(q.bg&=-67108864,q.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?ne+=this._extractColor(P,ne,q):F===53?q.bg|=1073741824:F===55?q.bg&=-1073741825:F===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):F===100?(q.fg&=-67108864,q.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${$};${F}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const $=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${$};${F}R`)}return!0}softReset(P){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(P){const $=P.params[0]||1;switch($){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 F=$%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(P){const $=P.params[0]||1;let F;return(P.length<2||(F=P.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(P){if(!O(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(P){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(P){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(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const $=[],F=P.split(";");for(;F.length>1;){const q=F.shift(),ne=F.shift();if(/^\d+$/.exec(q)){const re=parseInt(q);if(J(re))if(ne==="?")$.push({type:0,index:re});else{const ie=(0,T.parseColor)(ne);ie&&$.push({type:1,index:re,color:ie})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(P){const $=P.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(P,$){this._getCurrentLinkId()&&this._finishHyperlink();const F=P.split(":");let q;const ne=F.findIndex((re=>re.startsWith("id=")));return ne!==-1&&(q=F[ne].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(P,$){const F=P.split(";");for(let q=0;q<F.length&&!($>=this._specialColors.length);++q,++$)if(F[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const ne=(0,T.parseColor)(F[q]);ne&&this._onColor.fire([{type:1,index:this._specialColors[$],color:ne}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const $=[],F=P.split(";");for(let q=0;q<F.length;++q)if(/^\d+$/.exec(F[q])){const ne=parseInt(F[q]);J(ne)&&$.push({type:2,index:ne})}return $.length&&this._onColor.fire($),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){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,v.DEFAULT_CHARSET),!0}selectCharset(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(I[P[0]],v.CHARSETS[P[1]]||v.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 P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,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(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new d.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const F=this._activeBuffer.ybase+this._activeBuffer.y+$,q=this._activeBuffer.lines.get(F);q&&(q.fill(P),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,$){const F=this._bufferService.buffer,q=this._optionsService.rawOptions;return(ne=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${ne}${l.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,$){this._dirtyRowTracker.markRangeDirty(P,$)}}i.InputHandler=Y;let Z=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){K<this.start?this.start=K:K>this.end&&(this.end=K)}markRangeDirty(K,P){K>P&&(z=K,K=P,P=z),K<this.start&&(this.start=K),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function J(K){return 0<=K&&K<256}Z=g([_(0,R.IBufferService)],Z)},844:(D,i)=>{function a(g){for(const _ of g)_.dispose();g.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const g of this._disposables)g.dispose();this._disposables.length=0}register(g){return this._disposables.push(g),g}unregister(g){const _=this._disposables.indexOf(g);_!==-1&&this._disposables.splice(_,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(g){var _;this._isDisposed||g===this._value||((_=this._value)==null||_.dispose(),this._value=g)}clear(){this.value=void 0}dispose(){var g;this._isDisposed=!0,(g=this._value)==null||g.dispose(),this._value=void 0}},i.toDisposable=function(g){return{dispose:g}},i.disposeArray=a,i.getDisposeArrayDisposable=function(g){return{dispose:()=>a(g)}}},1505:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(_,l,v){this._data[_]||(this._data[_]={}),this._data[_][l]=v}get(_,l){return this._data[_]?this._data[_][l]:void 0}clear(){this._data={}}}i.TwoKeyMap=a,i.FourKeyMap=class{constructor(){this._data=new a}set(g,_,l,v,S){this._data.get(g,_)||this._data.set(g,_,new a),this._data.get(g,_).set(l,v,S)}get(g,_,l,v){var S;return(S=this._data.get(g,_))==null?void 0:S.get(l,v)}clear(){this._data.clear()}}},6114:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const a=i.isNode?"node":navigator.userAgent,g=i.isNode?"node":navigator.platform;i.isFirefox=a.includes("Firefox"),i.isLegacyEdge=a.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(a),i.getSafariVersion=function(){if(!i.isSafari)return 0;const _=a.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(g),i.isIpad=g==="iPad",i.isIphone=g==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(g),i.isLinux=g.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(a)},6106:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let a=0;i.SortedList=class{constructor(g){this._getKey=g,this._array=[]}clear(){this._array.length=0}insert(g){this._array.length!==0?(a=this._search(this._getKey(g)),this._array.splice(a,0,g)):this._array.push(g)}delete(g){if(this._array.length===0)return!1;const _=this._getKey(g);if(_===void 0||(a=this._search(_),a===-1)||this._getKey(this._array[a])!==_)return!1;do if(this._array[a]===g)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===_);return!1}*getKeyIterator(g){if(this._array.length!==0&&(a=this._search(g),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===g))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===g)}forEachByKey(g,_){if(this._array.length!==0&&(a=this._search(g),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===g))do _(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===g)}values(){return[...this._array].values()}_search(g){let _=0,l=this._array.length-1;for(;l>=_;){let v=_+l>>1;const S=this._getKey(this._array[v]);if(S>g)l=v-1;else{if(!(S<g)){for(;v>0&&this._getKey(this._array[v-1])===g;)v--;return v}_=v+1}}return _}}},7226:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const g=a(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let C=0,f=0,o=S.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),f=Math.max(C,f),u=S.timeRemaining(),1.5*f>u)return o-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-C))}ms`),void this._start();o=u}this.clear()}}class l extends _{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const C=Date.now()+S;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}i.PriorityTaskQueue=l,i.IdleTaskQueue=!g.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:l,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const g=a(643);i.updateWindowsModeWrappedState=function(_){const l=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),v=l==null?void 0:l.get(_.cols-1),S=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);S&&v&&(S.isWrapped=v[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE&&v[g.CHAR_DATA_CODE_INDEX]!==g.WHITESPACE_CELL_CODE)}},3734:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new g}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new a;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}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}}i.AttributeData=a;class g{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,v=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=v}clone(){return new g(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=g},9092:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const g=a(6349),_=a(7226),l=a(3734),v=a(8437),S=a(4634),C=a(511),f=a(643),o=a(4863),u=a(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(h,d,w){this._hasScrollback=h,this._optionsService=d,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(h){return h?(this._nullCell.fg=h.fg,this._nullCell.bg=h.bg,this._nullCell.extended=h.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(h){return h?(this._whitespaceCell.fg=h.fg,this._whitespaceCell.bg=h.bg,this._whitespaceCell.extended=h.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(h,d){return new v.BufferLine(this._bufferService.cols,this.getNullCell(h),d)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const h=this.ybase+this.y-this.ydisp;return h>=0&&h<this._rows}_getCorrectBufferLength(h){if(!this._hasScrollback)return h;const d=h+this._optionsService.rawOptions.scrollback;return d>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:d}fillViewportRows(h){if(this.lines.length===0){h===void 0&&(h=v.DEFAULT_ATTR_DATA);let d=this._rows;for(;d--;)this.lines.push(this.getBlankLine(h))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new g.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(h,d){const w=this.getNullCell(v.DEFAULT_ATTR_DATA);let R=0;const k=this._getCorrectBufferLength(d);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<h)for(let b=0;b<this.lines.length;b++)R+=+this.lines.get(b).resize(h,w);let A=0;if(this._rows<d)for(let b=this._rows;b<d;b++)this.lines.length<d+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(h,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+A+1?(this.ybase--,A++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(h,w)));else for(let b=this._rows;b>d;b--)this.lines.length>d+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const b=this.lines.length-k;b>0&&(this.lines.trimStart(b),this.ybase=Math.max(this.ybase-b,0),this.ydisp=Math.max(this.ydisp-b,0),this.savedY=Math.max(this.savedY-b,0)),this.lines.maxLength=k}this.x=Math.min(this.x,h-1),this.y=Math.min(this.y,d-1),A&&(this.y+=A),this.savedX=Math.min(this.savedX,h-1),this.scrollTop=0}if(this.scrollBottom=d-1,this._isReflowEnabled&&(this._reflow(h,d),this._cols>h))for(let A=0;A<this.lines.length;A++)R+=+this.lines.get(A).resize(h,w);this._cols=h,this._rows=d,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let h=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,h=!1);let d=0;for(;this._memoryCleanupPosition<this.lines.length;)if(d+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),d>100)return!0;return h}get _isReflowEnabled(){const h=this._optionsService.rawOptions.windowsPty;return h&&h.buildNumber?this._hasScrollback&&h.backend==="conpty"&&h.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(h,d){this._cols!==h&&(h>this._cols?this._reflowLarger(h,d):this._reflowSmaller(h,d))}_reflowLarger(h,d){const w=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,h,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(w.length>0){const R=(0,S.reflowLargerCreateNewLayout)(this.lines,w);(0,S.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(h,d,R.countRemoved)}}_reflowLargerAdjustViewport(h,d,w){const R=this.getNullCell(v.DEFAULT_ATTR_DATA);let k=w;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<d&&this.lines.push(new v.BufferLine(h,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(h,d){const w=this.getNullCell(v.DEFAULT_ATTR_DATA),R=[];let k=0;for(let A=this.lines.length-1;A>=0;A--){let b=this.lines.get(A);if(!b||!b.isWrapped&&b.getTrimmedLength()<=h)continue;const T=[b];for(;b.isWrapped&&A>0;)b=this.lines.get(--A),T.unshift(b);const I=this.ybase+this.y;if(I>=A&&I<A+T.length)continue;const W=T[T.length-1].getTrimmedLength(),O=(0,S.reflowSmallerGetNewLineLengths)(T,this._cols,h),j=O.length-T.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const Y=[];for(let F=0;F<j;F++){const q=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);Y.push(q)}Y.length>0&&(R.push({start:A+T.length+k,newLines:Y}),k+=Y.length),T.push(...Y);let Z=O.length-1,J=O[Z];J===0&&(Z--,J=O[Z]);let K=T.length-j-1,P=W;for(;K>=0;){const F=Math.min(P,J);if(T[Z]===void 0)break;if(T[Z].copyCellsFrom(T[K],P-F,J-F,F,!0),J-=F,J===0&&(Z--,J=O[Z]),P-=F,P===0){K--;const q=Math.max(K,0);P=(0,S.getWrappedLineTrimmedLength)(T,q,this._cols)}}for(let F=0;F<T.length;F++)O[F]<h&&T[F].setCell(O[F],w);let $=j-z;for(;$-- >0;)this.ybase===0?this.y<d-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-d&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+d-1)}if(R.length>0){const A=[],b=[];for(let Z=0;Z<this.lines.length;Z++)b.push(this.lines.get(Z));const T=this.lines.length;let I=T-1,W=0,O=R[W];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let j=0;for(let Z=Math.min(this.lines.maxLength-1,T+k-1);Z>=0;Z--)if(O&&O.start>I+j){for(let J=O.newLines.length-1;J>=0;J--)this.lines.set(Z--,O.newLines[J]);Z++,A.push({index:I+1,amount:O.newLines.length}),j+=O.newLines.length,O=R[++W]}else this.lines.set(Z,b[I--]);let z=0;for(let Z=A.length-1;Z>=0;Z--)A[Z].index+=z,this.lines.onInsertEmitter.fire(A[Z]),z+=A[Z].amount;const Y=Math.max(0,T+k-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(h,d,w=0,R){const k=this.lines.get(h);return k?k.translateToString(d,w,R):""}getWrappedRangeForLine(h){let d=h,w=h;for(;d>0&&this.lines.get(d).isWrapped;)d--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:d,last:w}}setupTabStops(h){for(h!=null?this.tabs[h]||(h=this.prevStop(h)):(this.tabs={},h=0);h<this._cols;h+=this._optionsService.rawOptions.tabStopWidth)this.tabs[h]=!0}prevStop(h){for(h==null&&(h=this.x);!this.tabs[--h]&&h>0;);return h>=this._cols?this._cols-1:h<0?0:h}nextStop(h){for(h==null&&(h=this.x);!this.tabs[++h]&&h<this._cols;);return h>=this._cols?this._cols-1:h<0?0:h}clearMarkers(h){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].line===h&&(this.markers[d].dispose(),this.markers.splice(d--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let h=0;h<this.markers.length;h++)this.markers[h].dispose(),this.markers.splice(h--,1);this._isClearing=!1}addMarker(h){const d=new o.Marker(h);return this.markers.push(d),d.register(this.lines.onTrim((w=>{d.line-=w,d.line<0&&d.dispose()}))),d.register(this.lines.onInsert((w=>{d.line>=w.index&&(d.line+=w.amount)}))),d.register(this.lines.onDelete((w=>{d.line>=w.index&&d.line<w.index+w.amount&&d.dispose(),d.line>w.index&&(d.line-=w.amount)}))),d.register(d.onDispose((()=>this._removeMarker(d)))),d}_removeMarker(h){this._isClearing||this.markers.splice(this.markers.indexOf(h),1)}}},8437:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const g=a(3734),_=a(511),l=a(643),v=a(482);i.DEFAULT_ATTR_DATA=Object.freeze(new g.AttributeData);let S=0;class C{constructor(o,u,h=!1){this.isWrapped=h,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const d=u||_.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let w=0;w<o;++w)this.setCell(w,d);this.length=o}get(o){const u=this._data[3*o+0],h=2097151&u;return[this._data[3*o+1],2097152&u?this._combined[o]:h?(0,v.stringFromCodePoint)(h):"",u>>22,2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):h]}set(o,u){this._data[3*o+1]=u[l.CHAR_DATA_ATTR_INDEX],u[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=u[1],this._data[3*o+0]=2097152|o|u[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=u[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[l.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 u=this._data[3*o+0];return 2097152&u?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&u}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const u=this._data[3*o+0];return 2097152&u?this._combined[o]:2097151&u?(0,v.stringFromCodePoint)(2097151&u):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,u){return S=3*o,u.content=this._data[S+0],u.fg=this._data[S+1],u.bg=this._data[S+2],2097152&u.content&&(u.combinedData=this._combined[o]),268435456&u.bg&&(u.extended=this._extendedAttrs[o]),u}setCell(o,u){2097152&u.content&&(this._combined[o]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[o]=u.extended),this._data[3*o+0]=u.content,this._data[3*o+1]=u.fg,this._data[3*o+2]=u.bg}setCellFromCodepoint(o,u,h,d){268435456&d.bg&&(this._extendedAttrs[o]=d.extended),this._data[3*o+0]=u|h<<22,this._data[3*o+1]=d.fg,this._data[3*o+2]=d.bg}addCodepointToCell(o,u,h){let d=this._data[3*o+0];2097152&d?this._combined[o]+=(0,v.stringFromCodePoint)(u):2097151&d?(this._combined[o]=(0,v.stringFromCodePoint)(2097151&d)+(0,v.stringFromCodePoint)(u),d&=-2097152,d|=2097152):d=u|4194304,h&&(d&=-12582913,d|=h<<22),this._data[3*o+0]=d}insertCells(o,u,h){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,h),u<this.length-o){const d=new _.CellData;for(let w=this.length-o-u-1;w>=0;--w)this.setCell(o+u+w,this.loadCell(o+w,d));for(let w=0;w<u;++w)this.setCell(o+w,h)}else for(let d=o;d<this.length;++d)this.setCell(d,h);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,h)}deleteCells(o,u,h){if(o%=this.length,u<this.length-o){const d=new _.CellData;for(let w=0;w<this.length-o-u;++w)this.setCell(o+w,this.loadCell(o+u+w,d));for(let w=this.length-u;w<this.length;++w)this.setCell(w,h)}else for(let d=o;d<this.length;++d)this.setCell(d,h);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,h),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,h)}replaceCells(o,u,h,d=!1){if(d)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,h),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,h);o<u&&o<this.length;)this.isProtected(o)||this.setCell(o,h),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,h),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,h);o<u&&o<this.length;)this.setCell(o++,h)}resize(o,u){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const h=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*h)this._data=new Uint32Array(this._data.buffer,0,h);else{const d=new Uint32Array(h);d.set(this._data),this._data=d}for(let d=this.length;d<o;++d)this.setCell(d,u)}else{this._data=this._data.subarray(0,h);const d=Object.keys(this._combined);for(let R=0;R<d.length;R++){const k=parseInt(d[R],10);k>=o&&delete this._combined[k]}const w=Object.keys(this._extendedAttrs);for(let R=0;R<w.length;R++){const k=parseInt(w[R],10);k>=o&&delete this._extendedAttrs[k]}}return this.length=o,4*h*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,u=!1){if(u)for(let h=0;h<this.length;++h)this.isProtected(h)||this.setCell(h,o);else{this._combined={},this._extendedAttrs={};for(let h=0;h<this.length;++h)this.setCell(h,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 u in o._combined)this._combined[u]=o._combined[u];this._extendedAttrs={};for(const u in o._extendedAttrs)this._extendedAttrs[u]=o._extendedAttrs[u];this.isWrapped=o.isWrapped}clone(){const o=new C(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const u in this._combined)o._combined[u]=this._combined[u];for(const u in this._extendedAttrs)o._extendedAttrs[u]=this._extendedAttrs[u];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,u,h,d,w){const R=o._data;if(w)for(let A=d-1;A>=0;A--){for(let b=0;b<3;b++)this._data[3*(h+A)+b]=R[3*(u+A)+b];268435456&R[3*(u+A)+2]&&(this._extendedAttrs[h+A]=o._extendedAttrs[u+A])}else for(let A=0;A<d;A++){for(let b=0;b<3;b++)this._data[3*(h+A)+b]=R[3*(u+A)+b];268435456&R[3*(u+A)+2]&&(this._extendedAttrs[h+A]=o._extendedAttrs[u+A])}const k=Object.keys(o._combined);for(let A=0;A<k.length;A++){const b=parseInt(k[A],10);b>=u&&(this._combined[b-u+h]=o._combined[b])}}translateToString(o,u,h,d){u=u??0,h=h??this.length,o&&(h=Math.min(h,this.getTrimmedLength())),d&&(d.length=0);let w="";for(;u<h;){const R=this._data[3*u+0],k=2097151&R,A=2097152&R?this._combined[u]:k?(0,v.stringFromCodePoint)(k):l.WHITESPACE_CELL_CHAR;if(w+=A,d)for(let b=0;b<A.length;++b)d.push(u);u+=R>>22||1}return d&&d.push(u),w}}i.BufferLine=C},4841:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(a,g){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return g*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(D,i)=>{function a(g,_,l){if(_===g.length-1)return g[_].getTrimmedLength();const v=!g[_].hasContent(l-1)&&g[_].getWidth(l-1)===1,S=g[_+1].getWidth(0)===2;return v&&S?l-1:l}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(g,_,l,v,S){const C=[];for(let f=0;f<g.length-1;f++){let o=f,u=g.get(++o);if(!u.isWrapped)continue;const h=[g.get(f)];for(;o<g.length&&u.isWrapped;)h.push(u),u=g.get(++o);if(v>=f&&v<o){f+=h.length-1;continue}let d=0,w=a(h,d,_),R=1,k=0;for(;R<h.length;){const b=a(h,R,_),T=b-k,I=l-w,W=Math.min(T,I);h[d].copyCellsFrom(h[R],k,w,W,!1),w+=W,w===l&&(d++,w=0),k+=W,k===b&&(R++,k=0),w===0&&d!==0&&h[d-1].getWidth(l-1)===2&&(h[d].copyCellsFrom(h[d-1],l-1,w++,1,!1),h[d-1].setCell(l-1,S))}h[d].replaceCells(w,l,S);let A=0;for(let b=h.length-1;b>0&&(b>d||h[b].getTrimmedLength()===0);b--)A++;A>0&&(C.push(f+h.length-A),C.push(A)),f+=h.length-1}return C},i.reflowLargerCreateNewLayout=function(g,_){const l=[];let v=0,S=_[v],C=0;for(let f=0;f<g.length;f++)if(S===f){const o=_[++v];g.onDeleteEmitter.fire({index:f-C,amount:o}),f+=o-1,C+=o,S=_[++v]}else l.push(f);return{layout:l,countRemoved:C}},i.reflowLargerApplyNewLayout=function(g,_){const l=[];for(let v=0;v<_.length;v++)l.push(g.get(_[v]));for(let v=0;v<l.length;v++)g.set(v,l[v]);g.length=_.length},i.reflowSmallerGetNewLineLengths=function(g,_,l){const v=[],S=g.map(((u,h)=>a(g,h,_))).reduce(((u,h)=>u+h));let C=0,f=0,o=0;for(;o<S;){if(S-o<l){v.push(S-o);break}C+=l;const u=a(g,f,_);C>u&&(C-=u,f++);const h=g[f].getWidth(C-1)===2;h&&C--;const d=h?l-1:l;v.push(d),o+=d}return v},i.getWrappedLineTrimmedLength=a},5295:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const g=a(8460),_=a(844),l=a(9092);class v extends _.Disposable{constructor(C,f){super(),this._optionsService=C,this._bufferService=f,this._onBufferActivate=this.register(new g.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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,f){this._normal.resize(C,f),this._alt.resize(C,f),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}i.BufferSet=v},511:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const g=a(482),_=a(643),l=a(3734);class v extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const f=new v;return f.setFromCharData(C),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,g.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(C[_.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(C[_.CHAR_DATA_CHAR_INDEX].length===2){const o=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const u=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(o-55296)+u-56320+65536|C[_.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=C[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[_.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=C[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=v},643:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const g=a(8460),_=a(844);class l{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}i.Marker=l,l._nextId=1},7116:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(D,i)=>{var a,g,_;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
115
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(a||(i.C0=a={})),(function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""})(g||(i.C1=g={})),(function(l){l.ST=`${a.ESC}\\`})(_||(i.C1_ESCAPED=_={}))},7399:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const g=a(2584),_={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:["'",'"']};i.evaluateKeyboardEvent=function(l,v,S,C){const f={type:0,cancel:!1,key:void 0},o=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?f.key=v?g.C0.ESC+"OA":g.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?f.key=v?g.C0.ESC+"OD":g.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?f.key=v?g.C0.ESC+"OC":g.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(f.key=v?g.C0.ESC+"OB":g.C0.ESC+"[B");break;case 8:f.key=l.ctrlKey?"\b":g.C0.DEL,l.altKey&&(f.key=g.C0.ESC+f.key);break;case 9:if(l.shiftKey){f.key=g.C0.ESC+"[Z";break}f.key=g.C0.HT,f.cancel=!0;break;case 13:f.key=l.altKey?g.C0.ESC+g.C0.CR:g.C0.CR,f.cancel=!0;break;case 27:f.key=g.C0.ESC,l.altKey&&(f.key=g.C0.ESC+g.C0.ESC),f.cancel=!0;break;case 37:if(l.metaKey)break;o?(f.key=g.C0.ESC+"[1;"+(o+1)+"D",f.key===g.C0.ESC+"[1;3D"&&(f.key=g.C0.ESC+(S?"b":"[1;5D"))):f.key=v?g.C0.ESC+"OD":g.C0.ESC+"[D";break;case 39:if(l.metaKey)break;o?(f.key=g.C0.ESC+"[1;"+(o+1)+"C",f.key===g.C0.ESC+"[1;3C"&&(f.key=g.C0.ESC+(S?"f":"[1;5C"))):f.key=v?g.C0.ESC+"OC":g.C0.ESC+"[C";break;case 38:if(l.metaKey)break;o?(f.key=g.C0.ESC+"[1;"+(o+1)+"A",S||f.key!==g.C0.ESC+"[1;3A"||(f.key=g.C0.ESC+"[1;5A")):f.key=v?g.C0.ESC+"OA":g.C0.ESC+"[A";break;case 40:if(l.metaKey)break;o?(f.key=g.C0.ESC+"[1;"+(o+1)+"B",S||f.key!==g.C0.ESC+"[1;3B"||(f.key=g.C0.ESC+"[1;5B")):f.key=v?g.C0.ESC+"OB":g.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(f.key=g.C0.ESC+"[2~");break;case 46:f.key=o?g.C0.ESC+"[3;"+(o+1)+"~":g.C0.ESC+"[3~";break;case 36:f.key=o?g.C0.ESC+"[1;"+(o+1)+"H":v?g.C0.ESC+"OH":g.C0.ESC+"[H";break;case 35:f.key=o?g.C0.ESC+"[1;"+(o+1)+"F":v?g.C0.ESC+"OF":g.C0.ESC+"[F";break;case 33:l.shiftKey?f.type=2:l.ctrlKey?f.key=g.C0.ESC+"[5;"+(o+1)+"~":f.key=g.C0.ESC+"[5~";break;case 34:l.shiftKey?f.type=3:l.ctrlKey?f.key=g.C0.ESC+"[6;"+(o+1)+"~":f.key=g.C0.ESC+"[6~";break;case 112:f.key=o?g.C0.ESC+"[1;"+(o+1)+"P":g.C0.ESC+"OP";break;case 113:f.key=o?g.C0.ESC+"[1;"+(o+1)+"Q":g.C0.ESC+"OQ";break;case 114:f.key=o?g.C0.ESC+"[1;"+(o+1)+"R":g.C0.ESC+"OR";break;case 115:f.key=o?g.C0.ESC+"[1;"+(o+1)+"S":g.C0.ESC+"OS";break;case 116:f.key=o?g.C0.ESC+"[15;"+(o+1)+"~":g.C0.ESC+"[15~";break;case 117:f.key=o?g.C0.ESC+"[17;"+(o+1)+"~":g.C0.ESC+"[17~";break;case 118:f.key=o?g.C0.ESC+"[18;"+(o+1)+"~":g.C0.ESC+"[18~";break;case 119:f.key=o?g.C0.ESC+"[19;"+(o+1)+"~":g.C0.ESC+"[19~";break;case 120:f.key=o?g.C0.ESC+"[20;"+(o+1)+"~":g.C0.ESC+"[20~";break;case 121:f.key=o?g.C0.ESC+"[21;"+(o+1)+"~":g.C0.ESC+"[21~";break;case 122:f.key=o?g.C0.ESC+"[23;"+(o+1)+"~":g.C0.ESC+"[23~";break;case 123:f.key=o?g.C0.ESC+"[24;"+(o+1)+"~":g.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(S&&!C||!l.altKey||l.metaKey)!S||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?f.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(f.key=g.C0.US),l.key==="@"&&(f.key=g.C0.NUL)):l.keyCode===65&&(f.type=1);else{const u=_[l.keyCode],h=u==null?void 0:u[l.shiftKey?1:0];if(h)f.key=g.C0.ESC+h;else if(l.keyCode>=65&&l.keyCode<=90){const d=l.ctrlKey?l.keyCode-64:l.keyCode+32;let w=String.fromCharCode(d);l.shiftKey&&(w=w.toUpperCase()),f.key=g.C0.ESC+w}else if(l.keyCode===32)f.key=g.C0.ESC+(l.ctrlKey?g.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let d=l.code.slice(3,4);l.shiftKey||(d=d.toLowerCase()),f.key=g.C0.ESC+d,f.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?f.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?f.key=g.C0.NUL:l.keyCode>=51&&l.keyCode<=55?f.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?f.key=g.C0.DEL:l.keyCode===219?f.key=g.C0.ESC:l.keyCode===220?f.key=g.C0.FS:l.keyCode===221&&(f.key=g.C0.GS)}return f}},482:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},i.utf32ToString=function(a,g=0,_=a.length){let l="";for(let v=g;v<_;++v){let S=a[v];S>65535?(S-=65536,l+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):l+=String.fromCharCode(S)}return l},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,g){const _=a.length;if(!_)return 0;let l=0,v=0;if(this._interim){const S=a.charCodeAt(v++);56320<=S&&S<=57343?g[l++]=1024*(this._interim-55296)+S-56320+65536:(g[l++]=this._interim,g[l++]=S),this._interim=0}for(let S=v;S<_;++S){const C=a.charCodeAt(S);if(55296<=C&&C<=56319){if(++S>=_)return this._interim=C,l;const f=a.charCodeAt(S);56320<=f&&f<=57343?g[l++]=1024*(C-55296)+f-56320+65536:(g[l++]=C,g[l++]=f)}else C!==65279&&(g[l++]=C)}return l}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,g){const _=a.length;if(!_)return 0;let l,v,S,C,f=0,o=0,u=0;if(this.interim[0]){let w=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,A=0;for(;(k=63&this.interim[++A])&&A<4;)R<<=6,R|=k;const b=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=b-A;for(;u<T;){if(u>=_)return 0;if(k=a[u++],(192&k)!=128){u--,w=!0;break}this.interim[A++]=k,R<<=6,R|=63&k}w||(b===2?R<128?u--:g[f++]=R:b===3?R<2048||R>=55296&&R<=57343||R===65279||(g[f++]=R):R<65536||R>1114111||(g[f++]=R)),this.interim.fill(0)}const h=_-4;let d=u;for(;d<_;){for(;!(!(d<h)||128&(l=a[d])||128&(v=a[d+1])||128&(S=a[d+2])||128&(C=a[d+3]));)g[f++]=l,g[f++]=v,g[f++]=S,g[f++]=C,d+=4;if(l=a[d++],l<128)g[f++]=l;else if((224&l)==192){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(o=(31&l)<<6|63&v,o<128){d--;continue}g[f++]=o}else if((240&l)==224){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,f;if(S=a[d++],(192&S)!=128){d--;continue}if(o=(15&l)<<12|(63&v)<<6|63&S,o<2048||o>=55296&&o<=57343||o===65279)continue;g[f++]=o}else if((248&l)==240){if(d>=_)return this.interim[0]=l,f;if(v=a[d++],(192&v)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,f;if(S=a[d++],(192&S)!=128){d--;continue}if(d>=_)return this.interim[0]=l,this.interim[1]=v,this.interim[2]=S,f;if(C=a[d++],(192&C)!=128){d--;continue}if(o=(7&l)<<18|(63&v)<<12|(63&S)<<6|63&C,o<65536||o>1114111)continue;g[f++]=o}}return f}}},225:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const g=a(1480),_=[[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]],l=[[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 v;i.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let S=0;S<_.length;++S)v.fill(0,_[S][0],_[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?v[S]:(function(C,f){let o,u=0,h=f.length-1;if(C<f[0][0]||C>f[h][1])return!1;for(;h>=u;)if(o=u+h>>1,C>f[o][1])u=o+1;else{if(!(C<f[o][0]))return!0;h=o-1}return!1})(S,l)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,C){let f=this.wcwidth(S),o=f===0&&C!==0;if(o){const u=g.UnicodeService.extractWidth(C);u===0?o=!1:u>f&&(f=u)}return g.UnicodeService.createPropertyValue(0,f,o)}}},5981:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const g=a(8460),_=a(844);class l extends _.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(C)}_innerWrite(S=0,C=!0){const f=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],u=this._action(o,C);if(u){const d=w=>Date.now()-f>=12?setTimeout((()=>this._innerWrite(0,w))):this._innerWrite(f,w);return void u.catch((w=>(queueMicrotask((()=>{throw w})),Promise.resolve(!1)))).then(d)}const h=this._callbacks[this._bufferOffset];if(h&&h(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-f>=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()}}i.WriteBuffer=l},5941:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const a=/^([\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})$/,g=/^[\da-f]+$/;function _(l,v){const S=l.toString(16),C=S.length<2?"0"+S:S;switch(v){case 4:return S[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}i.parseColor=function(l){if(!l)return;let v=l.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const S=a.exec(v);if(S){const C=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/C*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/C*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),g.exec(v)&&[3,6,9,12].includes(v.length))){const S=v.length/3,C=[0,0,0];for(let f=0;f<3;++f){const o=parseInt(v.slice(S*f,S*f+S),16);C[f]=S===1?o<<4:S===2?o:S===3?o>>4:o>>8}return C}},i.toRgbString=function(l,v=16){const[S,C,f]=l;return`rgb:${_(S,v)}/${_(C,v)}/${_(f,v)}`}},5770:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const g=a(482),_=a(8742),l=a(5770),v=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,f){this._handlers[C]===void 0&&(this._handlers[C]=[]);const o=this._handlers[C];return o.push(f),{dispose:()=>{const u=o.indexOf(f);u!==-1&&o.splice(u,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,f){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(C,f,o){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(C,f,o);else this._handlerFb(this._ident,"PUT",(0,g.utf32ToString)(C,f,o))}unhook(C,f=!0){if(this._active.length){let o=!1,u=this._active.length-1,h=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,o=f,h=this._stack.fallThrough,this._stack.paused=!1),!h&&o===!1){for(;u>=0&&(o=this._active[u].unhook(C),o!==!0);u--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,o;u--}for(;u>=0;u--)if(o=this._active[u].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const S=new _.Params;S.addParam(0),i.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=S,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():S,this._data="",this._hitLimit=!1}put(C,f,o){this._hitLimit||(this._data+=(0,g.utf32ToString)(C,f,o),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let f=!1;if(this._hitLimit)f=!1;else if(C&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then((o=>(this._params=S,this._data="",this._hitLimit=!1,o)));return this._params=S,this._data="",this._hitLimit=!1,f}}},2015:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const g=a(844),_=a(8742),l=a(6242),v=a(6351);class S{constructor(u){this.table=new Uint8Array(u)}setDefault(u,h){this.table.fill(u<<4|h)}add(u,h,d,w){this.table[h<<8|u]=d<<4|w}addMany(u,h,d,w){for(let R=0;R<u.length;R++)this.table[h<<8|u[R]]=d<<4|w}}i.TransitionTable=S;const C=160;i.VT500_TRANSITION_TABLE=(function(){const o=new S(4095),u=Array.apply(null,Array(256)).map(((A,b)=>b)),h=(A,b)=>u.slice(A,b),d=h(32,127),w=h(0,24);w.push(25),w.push.apply(w,h(28,32));const R=h(0,14);let k;for(k in o.setDefault(1,0),o.addMany(d,0,2,0),R)o.addMany([24,26,153,154],k,3,0),o.addMany(h(128,144),k,3,0),o.addMany(h(144,152),k,3,0),o.add(156,k,0,0),o.add(27,k,11,1),o.add(157,k,4,8),o.addMany([152,158,159],k,0,7),o.add(155,k,11,3),o.add(144,k,11,9);return o.addMany(w,0,3,0),o.addMany(w,1,3,1),o.add(127,1,0,1),o.addMany(w,8,0,8),o.addMany(w,3,3,3),o.add(127,3,0,3),o.addMany(w,4,3,4),o.add(127,4,0,4),o.addMany(w,6,3,6),o.addMany(w,5,3,5),o.add(127,5,0,5),o.addMany(w,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(d,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(h(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(d,7,0,7),o.addMany(w,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(h(64,127),3,7,0),o.addMany(h(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(h(48,60),4,8,4),o.addMany(h(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(h(32,64),6,0,6),o.add(127,6,0,6),o.addMany(h(64,127),6,0,0),o.addMany(h(32,48),3,9,5),o.addMany(h(32,48),5,9,5),o.addMany(h(48,64),5,0,6),o.addMany(h(64,127),5,7,0),o.addMany(h(32,48),4,9,5),o.addMany(h(32,48),1,9,2),o.addMany(h(32,48),2,9,2),o.addMany(h(48,127),2,10,0),o.addMany(h(48,80),1,10,0),o.addMany(h(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(h(96,127),1,10,0),o.add(80,1,11,9),o.addMany(w,9,0,9),o.add(127,9,0,9),o.addMany(h(28,32),9,0,9),o.addMany(h(32,48),9,9,12),o.addMany(h(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(w,11,0,11),o.addMany(h(32,128),11,0,11),o.addMany(h(28,32),11,0,11),o.addMany(w,10,0,10),o.add(127,10,0,10),o.addMany(h(28,32),10,0,10),o.addMany(h(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(h(32,48),10,9,12),o.addMany(w,12,0,12),o.add(127,12,0,12),o.addMany(h(28,32),12,0,12),o.addMany(h(32,48),12,9,12),o.addMany(h(48,64),12,0,11),o.addMany(h(64,127),12,12,13),o.addMany(h(64,127),10,12,13),o.addMany(h(64,127),9,12,13),o.addMany(w,13,13,13),o.addMany(d,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(C,0,2,0),o.add(C,8,5,8),o.add(C,6,0,6),o.add(C,11,0,11),o.add(C,13,13,13),o})();class f extends g.Disposable{constructor(u=i.VT500_TRANSITION_TABLE){super(),this._transitions=u,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(h,d,w)=>{},this._executeHandlerFb=h=>{},this._csiHandlerFb=(h,d)=>{},this._escHandlerFb=h=>{},this._errorHandlerFb=h=>h,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,g.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,h=[64,126]){let d=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(d=u.prefix.charCodeAt(0),d&&60>d||d>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(u.intermediates){if(u.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<u.intermediates.length;++R){const k=u.intermediates.charCodeAt(R);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");d<<=8,d|=k}}if(u.final.length!==1)throw new Error("final must be a single byte");const w=u.final.charCodeAt(0);if(h[0]>w||w>h[1])throw new Error(`final must be in range ${h[0]} .. ${h[1]}`);return d<<=8,d|=w,d}identToString(u){const h=[];for(;u;)h.push(String.fromCharCode(255&u)),u>>=8;return h.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,h){const d=this._identifier(u,[48,126]);this._escHandlers[d]===void 0&&(this._escHandlers[d]=[]);const w=this._escHandlers[d];return w.push(h),{dispose:()=>{const R=w.indexOf(h);R!==-1&&w.splice(R,1)}}}clearEscHandler(u){this._escHandlers[this._identifier(u,[48,126])]&&delete this._escHandlers[this._identifier(u,[48,126])]}setEscHandlerFallback(u){this._escHandlerFb=u}setExecuteHandler(u,h){this._executeHandlers[u.charCodeAt(0)]=h}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,h){const d=this._identifier(u);this._csiHandlers[d]===void 0&&(this._csiHandlers[d]=[]);const w=this._csiHandlers[d];return w.push(h),{dispose:()=>{const R=w.indexOf(h);R!==-1&&w.splice(R,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,h){return this._dcsParser.registerHandler(this._identifier(u),h)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,h){return this._oscParser.registerHandler(u,h)}clearOscHandler(u){this._oscParser.clearHandler(u)}setOscHandlerFallback(u){this._oscParser.setHandlerFallback(u)}setErrorHandler(u){this._errorHandler=u}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(u,h,d,w,R){this._parseStack.state=u,this._parseStack.handlers=h,this._parseStack.handlerPos=d,this._parseStack.transition=w,this._parseStack.chunkPos=R}parse(u,h,d){let w,R=0,k=0,A=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,A=this._parseStack.chunkPos+1;else{if(d===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const b=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(d===!1&&T>-1){for(;T>=0&&(w=b[T](this._params),w!==!0);T--)if(w instanceof Promise)return this._parseStack.handlerPos=T,w}this._parseStack.handlers=[];break;case 4:if(d===!1&&T>-1){for(;T>=0&&(w=b[T](),w!==!0);T--)if(w instanceof Promise)return this._parseStack.handlerPos=T,w}this._parseStack.handlers=[];break;case 6:if(R=u[this._parseStack.chunkPos],w=this._dcsParser.unhook(R!==24&&R!==26,d),w)return w;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=u[this._parseStack.chunkPos],w=this._oscParser.end(R!==24&&R!==26,d),w)return w;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,A=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let b=A;b<h;++b){switch(R=u[b],k=this._transitions.table[this.currentState<<8|(R<160?R:C)],k>>4){case 2:for(let j=b+1;;++j){if(j>=h||(R=u[j])<32||R>126&&R<C){this._printHandler(u,b,j),b=j-1;break}if(++j>=h||(R=u[j])<32||R>126&&R<C){this._printHandler(u,b,j),b=j-1;break}if(++j>=h||(R=u[j])<32||R>126&&R<C){this._printHandler(u,b,j),b=j-1;break}if(++j>=h||(R=u[j])<32||R>126&&R<C){this._printHandler(u,b,j),b=j-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:b,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|R];let I=T?T.length-1:-1;for(;I>=0&&(w=T[I](this._params),w!==!0);I--)if(w instanceof Promise)return this._preserveStack(3,T,I,k,b),w;I<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++b<h&&(R=u[b])>47&&R<60);b--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const W=this._escHandlers[this._collect<<8|R];let O=W?W.length-1:-1;for(;O>=0&&(w=W[O](),w!==!0);O--)if(w instanceof Promise)return this._preserveStack(4,W,O,k,b),w;O<0&&this._escHandlerFb(this._collect<<8|R),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|R,this._params);break;case 13:for(let j=b+1;;++j)if(j>=h||(R=u[j])===24||R===26||R===27||R>127&&R<C){this._dcsParser.put(u,b,j),b=j-1;break}break;case 14:if(w=this._dcsParser.unhook(R!==24&&R!==26),w)return this._preserveStack(6,[],0,k,b),w;R===27&&(k|=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 j=b+1;;j++)if(j>=h||(R=u[j])<32||R>127&&R<C){this._oscParser.put(u,b,j),b=j-1;break}break;case 6:if(w=this._oscParser.end(R!==24&&R!==26),w)return this._preserveStack(5,[],0,k,b),w;R===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}i.EscapeSequenceParser=f},6242:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const g=a(5770),_=a(482),l=[];i.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,S){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(S),{dispose:()=>{const f=C.indexOf(S);f!==-1&&C.splice(f,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,S,C){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(v,S,C);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(v,S,C))}start(){this.reset(),this._state=1}put(v,S,C){if(this._state!==3){if(this._state===1)for(;S<C;){const f=v[S++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&C-S>0&&this._put(v,S,C)}}end(v,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,f=this._active.length-1,o=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,C=S,o=this._stack.fallThrough,this._stack.paused=!1),!o&&C===!1){for(;f>=0&&(C=this._active[f].end(v),C!==!0);f--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,C;f--}for(;f>=0;f--)if(C=this._active[f].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=l,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,S,C){this._hitLimit||(this._data+=(0,_.utf32ToString)(v,S,C),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let S=!1;if(this._hitLimit)S=!1;else if(v&&(S=this._handler(this._data),S instanceof Promise))return S.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,S}}},8742:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const a=2147483647;class g{static fromArray(l){const v=new g;if(!l.length)return v;for(let S=Array.isArray(l[0])?1:0;S<l.length;++S){const C=l[S];if(Array.isArray(C))for(let f=0;f<C.length;++f)v.addSubParam(C[f]);else v.addParam(C)}return v}constructor(l=32,v=32){if(this.maxLength=l,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new g(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let v=0;v<this.length;++v){l.push(this.params[v]);const S=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-S>0&&l.push(Array.prototype.slice.call(this._subParams,S,C))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>a?a:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>a?a:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const v=this._subParamsIdx[l]>>8,S=255&this._subParamsIdx[l];return S-v>0?this._subParams.subarray(v,S):null}getSubParamsAll(){const l={};for(let v=0;v<this.length;++v){const S=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-S>0&&(l[v]=this._subParams.slice(S,C))}return l}addDigit(l){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,C=S[v-1];S[v-1]=~C?Math.min(10*C+l,a):l}}i.Params=g},5741:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,g){const _={instance:g,dispose:g.dispose,isDisposed:!1};this._addons.push(_),g.dispose=()=>this._wrappedAddonDispose(_),g.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let g=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===a){g=_;break}if(g===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(g,1)}}},8771:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const g=a(3785),_=a(511);i.BufferApiView=class{constructor(l,v){this._buffer=l,this.type=v}init(l){return this._buffer=l,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(l){const v=this._buffer.lines.get(l);if(v)return new g.BufferLineApiView(v)}getNullCell(){return new _.CellData}}},3785:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const g=a(511);i.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,l){if(!(_<0||_>=this._line.length))return l?(this._line.loadCell(_,l),l):this._line.loadCell(_,new g.CellData)}translateToString(_,l,v){return this._line.translateToString(_,l,v)}}},8285:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const g=a(8771),_=a(8460),l=a(844);class v extends l.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new g.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new g.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)}}i.BufferNamespaceApi=v},7975:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,g){return this._core.registerCsiHandler(a,(_=>g(_.toArray())))}addCsiHandler(a,g){return this.registerCsiHandler(a,g)}registerDcsHandler(a,g){return this._core.registerDcsHandler(a,((_,l)=>g(_,l.toArray())))}addDcsHandler(a,g){return this.registerDcsHandler(a,g)}registerEscHandler(a,g){return this._core.registerEscHandler(a,g)}addEscHandler(a,g){return this.registerEscHandler(a,g)}registerOscHandler(a,g){return this._core.registerOscHandler(a,g)}addOscHandler(a,g){return this.registerOscHandler(a,g)}}},7090:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(D,i,a){var g=this&&this.__decorate||function(o,u,h,d){var w,R=arguments.length,k=R<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,h,d);else for(var A=o.length-1;A>=0;A--)(w=o[A])&&(k=(R<3?w(k):R>3?w(u,h,k):w(u,h))||k);return R>3&&k&&Object.defineProperty(u,h,k),k},_=this&&this.__param||function(o,u){return function(h,d){u(h,d,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const l=a(8460),v=a(844),S=a(5295),C=a(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let f=i.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(o,this))}resize(o,u){this.cols=o,this.rows=u,this.buffers.resize(o,u),this._onResize.fire({cols:o,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,u=!1){const h=this.buffer;let d;d=this._cachedBlankLine,d&&d.length===this.cols&&d.getFg(0)===o.fg&&d.getBg(0)===o.bg||(d=h.getBlankLine(o,u),this._cachedBlankLine=d),d.isWrapped=u;const w=h.ybase+h.scrollTop,R=h.ybase+h.scrollBottom;if(h.scrollTop===0){const k=h.lines.isFull;R===h.lines.length-1?k?h.lines.recycle().copyFrom(d):h.lines.push(d.clone()):h.lines.splice(R+1,0,d.clone()),k?this.isUserScrolling&&(h.ydisp=Math.max(h.ydisp-1,0)):(h.ybase++,this.isUserScrolling||h.ydisp++)}else{const k=R-w+1;h.lines.shiftElements(w+1,k-1,-1),h.lines.set(R,d.clone())}this.isUserScrolling||(h.ydisp=h.ybase),this._onScroll.fire(h.ydisp)}scrollLines(o,u,h){const d=this.buffer;if(o<0){if(d.ydisp===0)return;this.isUserScrolling=!0}else o+d.ydisp>=d.ybase&&(this.isUserScrolling=!1);const w=d.ydisp;d.ydisp=Math.max(Math.min(d.ydisp+o,d.ybase),0),w!==d.ydisp&&(u||this._onScroll.fire(d.ydisp))}};i.BufferService=f=g([_(0,C.IOptionsService)],f)},7994:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,g){this._charsets[a]=g,this.glevel===a&&(this.charset=g)}}},1753:function(D,i,a){var g=this&&this.__decorate||function(d,w,R,k){var A,b=arguments.length,T=b<3?w:k===null?k=Object.getOwnPropertyDescriptor(w,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(d,w,R,k);else for(var I=d.length-1;I>=0;I--)(A=d[I])&&(T=(b<3?A(T):b>3?A(w,R,T):A(w,R))||T);return b>3&&T&&Object.defineProperty(w,R,T),T},_=this&&this.__param||function(d,w){return function(R,k){w(R,k,d)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const l=a(2585),v=a(8460),S=a(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:d=>d.button!==4&&d.action===1&&(d.ctrl=!1,d.alt=!1,d.shift=!1,!0)},VT200:{events:19,restrict:d=>d.action!==32},DRAG:{events:23,restrict:d=>d.action!==32||d.button!==3},ANY:{events:31,restrict:d=>!0}};function f(d,w){let R=(d.ctrl?16:0)|(d.shift?4:0)|(d.alt?8:0);return d.button===4?(R|=64,R|=d.action):(R|=3&d.button,4&d.button&&(R|=64),8&d.button&&(R|=128),d.action===32?R|=32:d.action!==0||w||(R|=3)),R}const o=String.fromCharCode,u={DEFAULT:d=>{const w=[f(d,!1)+32,d.col+32,d.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${o(w[0])}${o(w[1])}${o(w[2])}`},SGR:d=>{const w=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${f(d,!0)};${d.col};${d.row}${w}`},SGR_PIXELS:d=>{const w=d.action===0&&d.button!==4?"m":"M";return`\x1B[<${f(d,!0)};${d.x};${d.y}${w}`}};let h=i.CoreMouseService=class extends S.Disposable{constructor(d,w){super(),this._bufferService=d,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(C))this.addProtocol(R,C[R]);for(const R of Object.keys(u))this.addEncoding(R,u[R]);this.reset()}addProtocol(d,w){this._protocols[d]=w}addEncoding(d,w){this._encodings[d]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(d){if(!this._protocols[d])throw new Error(`unknown protocol "${d}"`);this._activeProtocol=d,this._onProtocolChange.fire(this._protocols[d].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(d){if(!this._encodings[d])throw new Error(`unknown encoding "${d}"`);this._activeEncoding=d}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(d){if(d.col<0||d.col>=this._bufferService.cols||d.row<0||d.row>=this._bufferService.rows||d.button===4&&d.action===32||d.button===3&&d.action!==32||d.button!==4&&(d.action===2||d.action===3)||(d.col++,d.row++,d.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,d,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(d))return!1;const w=this._encodings[this._activeEncoding](d);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=d,!0}explainEvents(d){return{down:!!(1&d),up:!!(2&d),drag:!!(4&d),move:!!(8&d),wheel:!!(16&d)}}_equalEvents(d,w,R){if(R){if(d.x!==w.x||d.y!==w.y)return!1}else if(d.col!==w.col||d.row!==w.row)return!1;return d.button===w.button&&d.action===w.action&&d.ctrl===w.ctrl&&d.alt===w.alt&&d.shift===w.shift}};i.CoreMouseService=h=g([_(0,l.IBufferService),_(1,l.ICoreService)],h)},6975:function(D,i,a){var g=this&&this.__decorate||function(h,d,w,R){var k,A=arguments.length,b=A<3?d:R===null?R=Object.getOwnPropertyDescriptor(d,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,d,w,R);else for(var T=h.length-1;T>=0;T--)(k=h[T])&&(b=(A<3?k(b):A>3?k(d,w,b):k(d,w))||b);return A>3&&b&&Object.defineProperty(d,w,b),b},_=this&&this.__param||function(h,d){return function(w,R){d(w,R,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const l=a(1439),v=a(8460),S=a(844),C=a(2585),f=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let u=i.CoreService=class extends S.Disposable{constructor(h,d,w){super(),this._bufferService=h,this._logService=d,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(o)}reset(){this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(o)}triggerDataEvent(h,d=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;d&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),d&&this._onUserInput.fire(),this._logService.debug(`sending data "${h}"`,(()=>h.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(h)}triggerBinaryEvent(h){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${h}"`,(()=>h.split("").map((d=>d.charCodeAt(0))))),this._onBinary.fire(h))}};i.CoreService=u=g([_(0,C.IBufferService),_(1,C.ILogService),_(2,C.IOptionsService)],u)},9074:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const g=a(8055),_=a(8460),l=a(844),v=a(6106);let S=0,C=0;class f extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((h=>h==null?void 0:h.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(h){if(h.marker.isDisposed)return;const d=new o(h);if(d){const w=d.marker.onDispose((()=>d.dispose()));d.onDispose((()=>{d&&(this._decorations.delete(d)&&this._onDecorationRemoved.fire(d),w.dispose())})),this._decorations.insert(d),this._onDecorationRegistered.fire(d)}return d}reset(){for(const h of this._decorations.values())h.dispose();this._decorations.clear()}*getDecorationsAtCell(h,d,w){let R=0,k=0;for(const A of this._decorations.getKeyIterator(d))R=A.options.x??0,k=R+(A.options.width??1),h>=R&&h<k&&(!w||(A.options.layer??"bottom")===w)&&(yield A)}forEachDecorationAtCell(h,d,w,R){this._decorations.forEachByKey(d,(k=>{S=k.options.x??0,C=S+(k.options.width??1),h>=S&&h<C&&(!w||(k.options.layer??"bottom")===w)&&R(k)}))}}i.DecorationService=f;class o extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=g.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=g.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(h){super(),this.options=h,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=h.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const g=a(2585),_=a(8343);class l{constructor(...S){this._entries=new Map;for(const[C,f]of S)this.set(C,f)}set(S,C){const f=this._entries.get(S);return this._entries.set(S,C),f}forEach(S){for(const[C,f]of this._entries.entries())S(C,f)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}i.ServiceCollection=l,i.InstantiationService=class{constructor(){this._services=new l,this._services.set(g.IInstantiationService,this)}setService(v,S){this._services.set(v,S)}getService(v){return this._services.get(v)}createInstance(v,...S){const C=(0,_.getServiceDependencies)(v).sort(((u,h)=>u.index-h.index)),f=[];for(const u of C){const h=this._services.get(u.id);if(!h)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${u.id}.`);f.push(h)}const o=C.length>0?C[0].index:S.length;if(S.length!==o)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${o+1} conflicts with ${S.length} static arguments`);return new v(...S,...f)}}},7866:function(D,i,a){var g=this&&this.__decorate||function(o,u,h,d){var w,R=arguments.length,k=R<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,h):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,u,h,d);else for(var A=o.length-1;A>=0;A--)(w=o[A])&&(k=(R<3?w(k):R>3?w(u,h,k):w(u,h))||k);return R>3&&k&&Object.defineProperty(u,h,k),k},_=this&&this.__param||function(o,u){return function(h,d){u(h,d,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const l=a(844),v=a(2585),S={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,f=i.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let u=0;u<o.length;u++)typeof o[u]=="function"&&(o[u]=o[u]())}_log(o,u,h){this._evalLazyOptionalParams(h),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...h)}trace(o,...u){var h;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.trace.bind(this._optionsService.options.logger))??console.log,o,u)}debug(o,...u){var h;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.debug.bind(this._optionsService.options.logger))??console.log,o,u)}info(o,...u){var h;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.info.bind(this._optionsService.options.logger))??console.info,o,u)}warn(o,...u){var h;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.warn.bind(this._optionsService.options.logger))??console.warn,o,u)}error(o,...u){var h;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((h=this._optionsService.options.logger)==null?void 0:h.error.bind(this._optionsService.options.logger))??console.error,o,u)}};i.LogService=f=g([_(0,v.IOptionsService)],f),i.setTraceLogger=function(o){C=o},i.traceCall=function(o,u,h){if(typeof h.value!="function")throw new Error("not supported");const d=h.value;h.value=function(...w){if(C.logLevel!==v.LogLevelEnum.TRACE)return d.apply(this,w);C.trace(`GlyphRenderer#${d.name}(${w.map((k=>JSON.stringify(k))).join(", ")})`);const R=d.apply(this,w);return C.trace(`GlyphRenderer#${d.name} return`,R),R}}},7302:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const g=a(8460),_=a(844),l=a(6114);i.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:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends _.Disposable{constructor(f){super(),this._onOptionChange=this.register(new g.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...i.DEFAULT_OPTIONS};for(const u in f)if(u in o)try{const h=f[u];o[u]=this._sanitizeAndValidateOption(u,h)}catch(h){console.error(h)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(f,o){return this.onOptionChange((u=>{u===f&&o(this.rawOptions[f])}))}onMultipleOptionChange(f,o){return this.onOptionChange((u=>{f.indexOf(u)!==-1&&o()}))}_setupOptions(){const f=u=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},o=(u,h)=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);h=this._sanitizeAndValidateOption(u,h),this.rawOptions[u]!==h&&(this.rawOptions[u]=h,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const h={get:f.bind(this,u),set:o.bind(this,u)};Object.defineProperty(this.options,u,h)}}_sanitizeAndValidateOption(f,o){switch(f){case"cursorStyle":if(o||(o=i.DEFAULT_OPTIONS[f]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${f}`);break;case"wordSeparator":o||(o=i.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=v.includes(o)?o:i.DEFAULT_OPTIONS[f];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${f} 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(`${f} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${f} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}i.OptionsService=S},2660:function(D,i,a){var g=this&&this.__decorate||function(S,C,f,o){var u,h=arguments.length,d=h<3?C:o===null?o=Object.getOwnPropertyDescriptor(C,f):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(S,C,f,o);else for(var w=S.length-1;w>=0;w--)(u=S[w])&&(d=(h<3?u(d):h>3?u(C,f,d):u(C,f))||d);return h>3&&d&&Object.defineProperty(C,f,d),d},_=this&&this.__param||function(S,C){return function(f,o){C(f,o,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const l=a(2585);let v=i.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const C=this._bufferService.buffer;if(S.id===void 0){const w=C.addMarker(C.ybase+C.y),R={data:S,id:this._nextId++,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(R,w))),this._dataByLinkId.set(R.id,R),R.id}const f=S,o=this._getEntryIdKey(f),u=this._entriesWithId.get(o);if(u)return this.addLineToLink(u.id,C.ybase+C.y),u.id;const h=C.addMarker(C.ybase+C.y),d={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[h]};return h.onDispose((()=>this._removeMarkerFromLink(d,h))),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(S,C){const f=this._dataByLinkId.get(S);if(f&&f.lines.every((o=>o.line!==C))){const o=this._bufferService.buffer.addMarker(C);f.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(f,o)))}}getLinkData(S){var C;return(C=this._dataByLinkId.get(S))==null?void 0:C.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,C){const f=S.lines.indexOf(C);f!==-1&&(S.lines.splice(f,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};i.OscLinkService=v=g([_(0,l.IBufferService)],v)},8343:(D,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const a="di$target",g="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(_){return _[g]||[]},i.createDecorator=function(_){if(i.serviceRegistry.has(_))return i.serviceRegistry.get(_);const l=function(v,S,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,o,u){o[a]===o?o[g].push({id:f,index:u}):(o[g]=[{id:f,index:u}],o[a]=o)})(l,v,C)};return l.toString=()=>_,i.serviceRegistry.set(_,l),l}},2585:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const g=a(8343);var _;i.IBufferService=(0,g.createDecorator)("BufferService"),i.ICoreMouseService=(0,g.createDecorator)("CoreMouseService"),i.ICoreService=(0,g.createDecorator)("CoreService"),i.ICharsetService=(0,g.createDecorator)("CharsetService"),i.IInstantiationService=(0,g.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(_||(i.LogLevelEnum=_={})),i.ILogService=(0,g.createDecorator)("LogService"),i.IOptionsService=(0,g.createDecorator)("OptionsService"),i.IOscLinkService=(0,g.createDecorator)("OscLinkService"),i.IUnicodeService=(0,g.createDecorator)("UnicodeService"),i.IDecorationService=(0,g.createDecorator)("DecorationService")},1480:(D,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const g=a(8460),_=a(225);class l{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,C,f=!1){return(16777215&S)<<3|(3&C)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new g.EventEmitter,this.onChange=this._onChange.event;const S=new _.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let C=0,f=0;const o=S.length;for(let u=0;u<o;++u){let h=S.charCodeAt(u);if(55296<=h&&h<=56319){if(++u>=o)return C+this.wcwidth(h);const R=S.charCodeAt(u);56320<=R&&R<=57343?h=1024*(h-55296)+R-56320+65536:C+=this.wcwidth(R)}const d=this.charProperties(h,f);let w=l.extractWidth(d);l.extractShouldJoin(d)&&(w-=l.extractWidth(f)),C+=w,f=d}return C}charProperties(S,C){return this._activeProvider.charProperties(S,C)}}i.UnicodeService=l}},y={};function E(D){var i=y[D];if(i!==void 0)return i.exports;var a=y[D]={exports:{}};return c[D].call(a.exports,a,a.exports,E),a.exports}var N={};return(()=>{var D=N;Object.defineProperty(D,"__esModule",{value:!0}),D.Terminal=void 0;const i=E(9042),a=E(3236),g=E(844),_=E(5741),l=E(8285),v=E(7975),S=E(7090),C=["cols","rows"];class f extends g.Disposable{constructor(u){super(),this._core=this.register(new a.Terminal(u)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const h=w=>this._core.options[w],d=(w,R)=>{this._checkReadonlyOptions(w),this._core.options[w]=R};for(const w in this._core.options){const R={get:h.bind(this,w),set:d.bind(this,w)};Object.defineProperty(this._publicOptions,w,R)}}_checkReadonlyOptions(u){if(C.includes(u))throw new Error(`Option "${u}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let h="none";switch(this._core.coreMouseService.activeProtocol){case"X10":h="x10";break;case"VT200":h="vt200";break;case"DRAG":h="drag";break;case"ANY":h="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:h,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const h in u)this._publicOptions[h]=u[h]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,h=!0){this._core.input(u,h)}resize(u,h){this._verifyIntegers(u,h),this._core.resize(u,h)}open(u){this._core.open(u)}attachCustomKeyEventHandler(u){this._core.attachCustomKeyEventHandler(u)}attachCustomWheelEventHandler(u){this._core.attachCustomWheelEventHandler(u)}registerLinkProvider(u){return this._core.registerLinkProvider(u)}registerCharacterJoiner(u){return this._checkProposedApi(),this._core.registerCharacterJoiner(u)}deregisterCharacterJoiner(u){this._checkProposedApi(),this._core.deregisterCharacterJoiner(u)}registerMarker(u=0){return this._verifyIntegers(u),this._core.registerMarker(u)}registerDecoration(u){return this._checkProposedApi(),this._verifyPositiveIntegers(u.x??0,u.width??0,u.height??0),this._core.registerDecoration(u)}hasSelection(){return this._core.hasSelection()}select(u,h,d){this._verifyIntegers(u,h,d),this._core.select(u,h,d)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,h){this._verifyIntegers(u,h),this._core.selectLines(u,h)}dispose(){super.dispose()}scrollLines(u){this._verifyIntegers(u),this._core.scrollLines(u)}scrollPages(u){this._verifyIntegers(u),this._core.scrollPages(u)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(u){this._verifyIntegers(u),this._core.scrollToLine(u)}clear(){this._core.clear()}write(u,h){this._core.write(u,h)}writeln(u,h){this._core.write(u),this._core.write(`\r
|
|
116
|
+
`,h)}paste(u){this._core.paste(u)}refresh(u,h){this._verifyIntegers(u,h),this._core.refresh(u,h)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(u){this._addonManager.loadAddon(this,u)}static get strings(){return i}_verifyIntegers(...u){for(const h of u)if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...u){for(const h of u)if(h&&(h===1/0||isNaN(h)||h%1!=0||h<0))throw new Error("This API only accepts positive integers")}}D.Terminal=f})(),N})()))})(Bl)),Bl.exports}var A0=M0();const D0=60;function I0(){return new URLSearchParams(window.location.search).get("renderer")==="webgl"?"webgl":"canvas"}const kd={dark:{background:"#12141a",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#2f3542"},light:{background:"#fbfbfd",foreground:"#22262e",cursor:"#22262e",selectionBackground:"#cfd8e3"}};function Wf({terminalId:r,connection:n,active:c,theme:y,autoFocus:E=!0}){const N=B.useRef(null),D=B.useRef(null),i=B.useRef(null),a=B.useRef(y);return a.current=y,B.useEffect(()=>{const g=N.current;if(g===null)return;const _=new A0.Terminal({convertEol:!1,cursorBlink:!0,fontFamily:'"Cascadia Mono", "Consolas", "Menlo", "DejaVu Sans Mono", monospace',fontSize:14,lineHeight:1.2,scrollback:1e4,allowProposedApi:!0,theme:kd[a.current]});D.current=_;const l=new k0.FitAddon;i.current=l,_.loadAddon(l),_.loadAddon(new L0.WebLinksAddon),_.open(g);let v=!1;const S=()=>{if(!(v||I0()!=="webgl")){v=!0;try{const T=new R0.WebglAddon;T.onContextLoss(()=>T.dispose()),_.loadAddon(T)}catch{console.info("[terminal] WebGL no disponible; se usa el renderer por defecto.")}}};let C={cols:0,rows:0},f;const o=()=>g.clientWidth>0&&g.clientHeight>0,u=T=>{const{cols:I,rows:W}=_;I<=0||W<=0||I===C.cols&&W===C.rows||(C={cols:I,rows:W},n.send({type:"resize",terminalId:r,cols:I,rows:W}))},h=()=>{if(o()){try{l.fit()}catch{return}_.cols>0&&_.rows>0&&S(),u()}},d=()=>{window.clearTimeout(f),f=window.setTimeout(h,D0)},w=new ResizeObserver(d);w.observe(g),window.addEventListener("resize",d);const R=_.onData(T=>{n.send({type:"input",terminalId:r,data:T})}),k=n.onMessage(T=>{switch(T.type){case"terminal.output":T.terminalId===r&&_.write(T.data);break;case"terminal.replay":if(T.terminalId!==r)break;_.reset(),T.truncated&&_.write(`\x1B[90m-- ${L("terminal.replayTruncated")} --\x1B[0m\r
|
|
117
|
+
`),_.write(T.data);break;case"terminal.exit":if(T.terminalId!==r)break;_.write(`\r
|
|
118
|
+
\x1B[90m-- ${L("terminal.exited",{code:T.exitCode})} --\x1B[0m\r
|
|
119
|
+
`);break}}),A=()=>{if(o())try{l.fit()}catch{}const T=_.cols>0?_.cols:80,I=_.rows>0?_.rows:24;C={cols:T,rows:I},n.send({type:"terminal.attach",terminalId:r,cols:T,rows:I})};A();const b=n.onReopen(A);return()=>{window.clearTimeout(f),window.removeEventListener("resize",d),w.disconnect(),R.dispose(),k(),b(),n.send({type:"terminal.detach",terminalId:r}),_.dispose(),D.current=null,i.current=null}},[r,n]),B.useEffect(()=>{const g=D.current;g!==null&&(g.options.theme=kd[y])},[y]),B.useEffect(()=>{if(!c)return;const g=D.current,_=i.current;if(g===null||_===null)return;const l=window.setTimeout(()=>{const v=N.current;if(!(v===null||v.clientWidth===0||v.clientHeight===0)){try{_.fit()}catch{return}E&&g.focus(),g.cols>0&&g.rows>0&&n.send({type:"resize",terminalId:r,cols:g.cols,rows:g.rows})}},0);return()=>window.clearTimeout(l)},[c,E,r,n]),m.jsx("div",{className:`terminal-surface${c?"":" terminal-surface-hidden"}`,ref:N})}function N0({connection:r,shells:n,activeShellId:c,cwd:y,shellName:E,theme:N,onSelect:D,onOpen:i,onCloseShell:a,onCollapse:g}){const _=E??L("console.name"),l=n.find(v=>v.terminalId===c)??n[0]??null;return m.jsxs("section",{className:"console-pane",children:[m.jsxs("header",{className:"console-header",children:[m.jsxs("div",{className:"strip-tabs",children:[n.map((v,S)=>m.jsxs("div",{className:`strip-tab${v.terminalId===(l==null?void 0:l.terminalId)?" is-active":""}${v.alive?"":" is-dead"}`,children:[m.jsx("button",{className:"strip-tab-label",onClick:()=>D(v.terminalId),title:v.alive?L("console.tab.title",{shell:_,number:S+1,cwd:y}):L("console.tab.exited",{code:v.exitCode??"?"}),children:L("console.tab.label",{number:S+1})}),m.jsx("button",{className:"strip-tab-close",onClick:()=>a(v.terminalId),title:L("console.tab.close"),children:"×"})]},v.terminalId)),E!==null&&m.jsx("button",{className:"strip-tab-new",onClick:i,title:L("console.openAnother",{shell:_,cwd:y}),children:"+"})]}),m.jsx("span",{className:"strip-spacer"}),m.jsx("button",{className:"icon-button",onClick:g,title:L("console.collapse"),children:"▾"})]}),m.jsx("div",{className:"console-body",children:n.length===0?m.jsx("div",{className:"console-empty",children:E===null?m.jsx("p",{className:"panel-note",children:L("console.noShell")}):m.jsx("button",{className:"link-button",onClick:i,children:L("console.openIn",{shell:_,cwd:y})})}):m.jsx("div",{className:"terminal-stack",children:n.map(v=>m.jsx(Wf,{terminalId:v.terminalId,connection:r,active:v.terminalId===(l==null?void 0:l.terminalId),theme:N},v.terminalId))})})]})}const P0=.75,O0=.9;function bn(r){if(r<1e3)return String(r);if(r<1e6){const n=r/1e3;return`${n<100?ds(n,1):Math.round(n)}k`}return`${ds(r/1e6,2)}M`}function j0({usage:r,source:n,instructionsFile:c,fallbackWindow:y=null,compact:E=!1,statusLineState:N=null,onConfigure:D}){const{lastRequestTokens:i,contextWindow:a}=r;if(D!==void 0&&N!==null&&Cv(n,{state:N}))return m.jsxs("div",{className:`meter meter-idle${E?" meter-compact":""}`,title:bv(N),children:[m.jsx("span",{className:"meter-label",children:L("meter.label")}),m.jsx("span",{className:`meter-bar${E?" meter-bar-inline":""}`}),m.jsx("span",{className:"meter-value",children:L("meter.unmeasured")}),m.jsx("button",{className:"link-button",onClick:D,children:L("meter.configure")})]});if(n===null)return m.jsxs("div",{className:`meter meter-idle${E?" meter-compact":""}`,title:L("meter.noTokensTitle"),children:[m.jsx("span",{className:"meter-label",children:L("meter.label")}),m.jsx("span",{className:`meter-bar${E?" meter-bar-inline":""}`}),m.jsx("span",{className:"meter-value",children:L("meter.noTokens")})]});if(!Sv(n,r)){const S=kv(c,n),C=wv(n,r,y);return m.jsxs("div",{className:`meter meter-idle${E?" meter-compact":""}`,title:S,children:[m.jsx("span",{className:"meter-label",children:L("meter.label")}),m.jsx("span",{className:`meter-bar${E?" meter-bar-inline":""}`}),m.jsxs("span",{className:"meter-value",children:[L("meter.unmeasured"),C!==null&&m.jsxs("span",{className:"meter-dim",children:[" / ",bn(C)]})]})]})}const g=a!==null&&a>0?Math.min(i/a,1):null,_=g===null?"unknown":g>=O0?"danger":g>=P0?"warn":"ok",l=a===null?"":` / ${bn(a)}${r.contextWindowEstimated?"+":""}`,v=xv(n,r);if(E){const S=[r.lastModel===null?null:r.lastModel,v,g===null?L("meter.unknownModelShort"):L("meter.windowPercent",{percent:Math.round(g*100)}),L("meter.output",{tokens:bn(r.lastOutputTokens)}),n==="status-line"?L("meter.responses",{count:r.assistantMessages}):L("meter.sessionTotals",{output:bn(r.totalOutputTokens),cache:bn(r.totalCacheReadTokens),count:r.assistantMessages})].filter(C=>C!==null).join(" · ");return m.jsxs("div",{className:"meter meter-compact",title:S,children:[m.jsx("span",{className:"meter-label",children:L("meter.label")}),g!==null&&m.jsx("span",{className:"meter-bar meter-bar-inline",children:m.jsx("span",{className:`meter-fill meter-fill-${_}`,style:{width:`${g*100}%`}})}),m.jsxs("span",{className:"meter-value",children:[bn(i),l.length>0&&m.jsx("span",{className:"meter-dim",children:l})]})]})}return m.jsxs("div",{className:"meter",children:[m.jsxs("div",{className:"meter-row",children:[m.jsx("span",{className:"meter-label",children:L("meter.label")}),m.jsxs("span",{className:"meter-value",children:[bn(i),a!==null&&m.jsxs("span",{className:"meter-dim",title:r.lastModel===null?void 0:v!==null?L("meter.modelWithOrigin",{model:r.lastModel,origin:v}):r.lastModel,children:[" ","/ ",bn(a),r.contextWindowEstimated&&"+"]})]})]}),g!==null?m.jsx("div",{className:"meter-bar",title:L("meter.windowPercent",{percent:Math.round(g*100)}),children:m.jsx("div",{className:`meter-fill meter-fill-${_}`,style:{width:`${g*100}%`}})}):m.jsx("div",{className:"meter-note",title:r.lastModel??void 0,children:L("meter.unknownModel")}),m.jsxs("div",{className:"meter-row meter-row-dim",children:[m.jsx("span",{title:L("meter.lastResponseTitle"),children:L("meter.output",{tokens:bn(r.lastOutputTokens)})}),m.jsx("span",{title:L("meter.sessionTitle"),children:L("meter.sessionTotals",{output:bn(r.totalOutputTokens),cache:bn(r.totalCacheReadTokens),count:r.assistantMessages})})]})]})}const Fl=["s","m","l"],Uf="m",Ed="agent-workbench.thread-font",B0={s:"threadFont.size.s",m:"threadFont.size.m",l:"threadFont.size.l"};function Ld(r){return L(B0[r])}function zf(r){const n=Fl.indexOf(r);return Fl[(n+1)%Fl.length]??Uf}function F0(r){return r==="s"||r==="m"||r==="l"?r:null}function Td(r){return L("threadFont.title",{current:Ld(r),next:Ld(zf(r))})}function qf({agents:r,preselected:n,anchor:c,label:y=L("agentMenu.openWith"),onPick:E,onClose:N}){const D=B.useMemo(()=>Af(r),[r]),[i,a]=B.useState(()=>Av(D,n)),[g,_]=B.useState(null),l=B.useRef(null),v=B.useRef([]);return B.useLayoutEffect(()=>{const S=l.current;if(S===null)return;const C=c.getBoundingClientRect(),f=S.getBoundingClientRect();_(Iv({left:C.left,top:C.top,bottom:C.bottom},{width:f.width,height:f.height},{width:window.innerWidth,height:window.innerHeight}))},[c]),B.useEffect(()=>{var S;(S=v.current[i])==null||S.focus()},[i,g]),B.useEffect(()=>{const S=o=>{if(!(o.altKey||o.ctrlKey||o.metaKey)){if(o.key==="Escape"){o.preventDefault(),o.stopPropagation(),N(),c.focus();return}if(o.key==="ArrowDown"||o.key==="ArrowUp"){o.preventDefault(),o.stopPropagation(),a(u=>Dv(u,o.key==="ArrowDown"?1:-1,D.length));return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation();const u=D[i];u!==void 0&&E(u.id);return}o.key==="Tab"&&N()}},C=o=>{var h;const u=o.target;u instanceof Node&&((h=l.current)!=null&&h.contains(u)||c.contains(u))||N()},f=o=>{Nv(o.target,c,l.current)&&N()};return window.addEventListener("keydown",S,!0),document.addEventListener("pointerdown",C,!0),window.addEventListener("scroll",f,!0),window.addEventListener("resize",N),()=>{window.removeEventListener("keydown",S,!0),document.removeEventListener("pointerdown",C,!0),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",N)}},[i,c,D,N,E]),Ff.createPortal(m.jsx("div",{ref:l,className:"agent-menu",role:"menu","aria-label":y,style:g===null?{left:0,top:0,visibility:"hidden"}:{left:`${g.left}px`,top:`${g.top}px`},children:D.map((S,C)=>m.jsxs("button",{ref:f=>{v.current[C]=f},className:`agent-menu-item${C===i?" agent-menu-item-active":""}`,role:"menuitem",tabIndex:C===i?0:-1,onMouseEnter:()=>a(C),onClick:()=>E(S.id),children:[m.jsx("span",{className:"agent-menu-label",children:S.label}),S.version!==null&&m.jsx("span",{className:"agent-menu-version",children:S.version})]},S.id))}),document.body)}function Vf({targets:r,className:n,text:c,blockedReason:y=null,onPick:E}){const[N,D]=B.useState(!1),i=B.useRef(null),a=B.useCallback(()=>D(!1),[]),g=B.useCallback(_=>{D(!1),E(_)},[E]);return r.length===0?null:m.jsxs(m.Fragment,{children:[m.jsx("button",{ref:i,className:n,onClick:()=>D(_=>!_),disabled:y!==null,"aria-haspopup":"menu","aria-expanded":N,title:y??Pv(),children:c}),N&&i.current!==null&&m.jsx(qf,{agents:r,preselected:null,anchor:i.current,label:L("continue.menuLabel"),onPick:g,onClose:a})]})}function Kf(r){switch(r.notice){case"compacted":return r.detail==="auto"?L("thread.notice.compactedAuto"):L("thread.notice.compacted");case"interrupted":return L("thread.notice.interrupted");case"error":return r.detail.length>0?L("thread.notice.error",{detail:r.detail}):L("thread.notice.errorNoDetail")}}const Gf="agent-workbench.locale",Xf="auto";function H0(r){return r==="auto"||bf(r)?r:null}function Yf(r){const n=r.trim().replace(/_/g,"-").toLowerCase();if(n.length===0)return null;const c=vc.find(N=>N.toLowerCase()===n);if(c!==void 0)return c;const[y="",...E]=n.split("-");return y==="zh"?E.includes("hant")||E.some(D=>D==="tw"||D==="hk"||D==="mo")?null:Hl("zh-CN"):Hl(y==="pt"?"pt-BR":y)}function Hl(r){return bf(r)?r:null}function Qf(r,n){if(r!=="auto")return r;for(const c of n){const y=Yf(c);if(y!==null)return y}return"en"}function Jf(r,n){for(const c of n)if(Yf(c)===r)try{if(Intl.DateTimeFormat.supportedLocalesOf([c]).length>0)return c}catch{}return V_(r)}let jo=Xf;const cc=new Set;function wc(){return Array.isArray(navigator.languages)&&navigator.languages.length>0?navigator.languages:typeof navigator.language=="string"?[navigator.language]:[]}function $0(){return Qf("auto",wc())}async function Zf(r){const n=wc(),c=Qf(r,n);await kf(c,Jf(c,n))}async function W0(){jo=$t(Gf,Xf,H0);try{await Zf(jo)}catch{await kf("en",Jf("en",wc()))}document.documentElement.lang=sc(),xf(()=>{document.documentElement.lang=sc()})}async function U0(r){await Zf(r),jo=r,Ot(Gf,r);for(const n of cc)n()}function z0(r){return cc.add(r),()=>cc.delete(r)}function q0(){return jo}function ci(){return B.useSyncExternalStore(xf,sc)}function V0(){return B.useSyncExternalStore(z0,q0)}const ep=String.raw`https?:\/\/[^\s<>"'\`]+`,K0=new RegExp([String.raw`(\`[^\`\n]+\`)`,String.raw`(\*\*[^*\n]+\*\*)`,String.raw`(__[^_\n]+__)`,String.raw`(\*[^*\n]+\*)`,String.raw`(~~[^~\n]+~~)`,String.raw`(\[[^\]\n]+\]\([^)\s]+\))`,`(${ep})`].join("|")),G0=/^(https?:|mailto:)/i,X0=new RegExp(ep);function Y0(r){const n=X0.exec(r);if(n===null||n.index===void 0)return null;const c=tp(n[0]);return{index:n.index,length:c.length,href:c}}function To(r,n){let c=0;for(const y of r)y===n&&(c+=1);return c}function tp(r){let n=r;for(;;){const c=n.slice(-1);if(c.length===0)return n;if(".,;:!?".includes(c)){n=n.slice(0,-1);continue}if(c===")"&&To(n,"(")<To(n,")")){n=n.slice(0,-1);continue}if(c==="]"&&To(n,"[")<To(n,"]")){n=n.slice(0,-1);continue}return n}}function Q0(r){const n=K0.exec(r);if(n===null||n.index===void 0)return null;const c=n[0],y=n.index,E=(D,i=c.length)=>({index:y,length:i,token:D});if(c.startsWith("`"))return E({kind:"code",text:c.slice(1,-1)});if(c.startsWith("**")||c.startsWith("__"))return E({kind:"strong",text:c.slice(2,-2)});if(c.startsWith("~~"))return E({kind:"del",text:c.slice(2,-2)});if(c.startsWith("*"))return E({kind:"em",text:c.slice(1,-1)});if(c.startsWith("[")){const D=c.indexOf("]("),i=c.slice(1,D),a=c.slice(D+2,-1);return G0.test(a)?E({kind:"link",label:i,href:a}):E({kind:"plain",text:c})}const N=tp(c);return E({kind:"link",label:N,href:N},N.length)}function dr(r,n,c){if(n.length===0)return[r];const y=r.toLowerCase(),E=n.toLowerCase(),N=[];let D=0,i=y.indexOf(E),a=0;for(;i!==-1;)i>D&&N.push(r.slice(D,i)),N.push(m.jsx("mark",{children:r.slice(i,i+n.length)},`${c}-m${a++}`)),D=i+n.length,i=y.indexOf(E,D);return D<r.length&&N.push(r.slice(D)),N}const J0=/^\[([^\]\n]+)\]\(([^)\s]+)\)$/;function Z0(r,n){const c=J0.exec(r);if(c===null)return null;const y=c[2]??"",E=n(y);return E===null?null:{label:c[1]??"",href:y,open:E}}function us(r,n,c,y){const E=[];let N=r,D=0;for(;N.length>0;){const i=Q0(N);if(i===null){E.push(...dr(N,n,`${c}-${D++}`));break}i.index>0&&E.push(...dr(N.slice(0,i.index),n,`${c}-${D++}`));const a=`${c}-i${D++}`,{token:g}=i;switch(g.kind){case"code":E.push(m.jsx("code",{children:g.text},a));break;case"strong":E.push(m.jsx("strong",{children:dr(g.text,n,a)},a));break;case"del":E.push(m.jsx("del",{children:dr(g.text,n,a)},a));break;case"em":E.push(m.jsx("em",{children:dr(g.text,n,a)},a));break;case"link":E.push(m.jsx("a",{href:g.href,target:"_blank",rel:"noreferrer noopener",children:dr(g.label,n,a)},a));break;default:{const _=y===void 0?null:Z0(g.text,y);if(_!==null){E.push(m.jsx("button",{className:"md-local-link",onClick:_.open,title:_.href,children:dr(_.label,n,a)},a));break}E.push(m.jsx("span",{children:dr(g.text,n,a)},a));break}}N=N.slice(i.index+i.length)}return E}function ey({code:r,language:n}){const[c,y]=B.useState(null);return B.useEffect(()=>{let E=!0;return Pn(async()=>{const{highlightCode:N}=await import("./highlight-BdawNAzW.js");return{highlightCode:N}},[]).then(({highlightCode:N})=>{E&&y(N(r,n))}).catch(()=>{E&&y(null)}),()=>{E=!1}},[r,n]),m.jsxs("pre",{className:"md-code hljs",children:[n!==null&&m.jsx("span",{className:"md-code-lang",children:n}),c===null?m.jsx("code",{children:r}):m.jsx("code",{dangerouslySetInnerHTML:{__html:c}})]})}const Rd=/^(#{1,6})\s+(.*)$/,$l=/^\s{0,3}[-*+]\s+(.*)$/,Ro=/^\s{0,3}(\d{1,3})[.)]\s+(.*)$/,Mo=/^>\s?(.*)$/,Wl=/^\s*```(\S*)\s*$/,Md=/^\s*(-{3,}|\*{3,}|_{3,})\s*$/,Ul=/^\s*\|.*\|\s*$/,ty=/^\s*\|[\s:|-]+\|\s*$/;function Ad(r){return r.trim().replace(/^\||\|$/g,"").split("|").map(n=>n.trim())}function Sc({text:r,needle:n="",localLink:c}){var D;const y=r.split(`
|
|
120
|
+
`),E=[];let N=0;for(;N<y.length;){const i=y[N]??"",a=`b${N}`,g=Wl.exec(i);if(g!==null){const v=(g[1]??"").length>0?g[1]:null,S=[];for(N+=1;N<y.length&&!Wl.test(y[N]??"");)S.push(y[N]??""),N+=1;N+=1,E.push({key:a,node:m.jsx(ey,{code:S.join(`
|
|
121
|
+
`),language:v},a)});continue}if(i.trim().length===0){N+=1;continue}if(Md.test(i)){E.push({key:a,node:m.jsx("hr",{className:"md-rule"},a)}),N+=1;continue}const _=Rd.exec(i);if(_!==null){const v=Math.min((_[1]??"#").length,6);E.push({key:a,node:m.jsx("p",{className:`md-heading md-h${v}`,children:us(_[2]??"",n,a,c)},a)}),N+=1;continue}if(Ul.test(i)&&ty.test(y[N+1]??"")){const v=Ad(i);N+=2;const S=[];for(;N<y.length&&Ul.test(y[N]??"");)S.push(Ad(y[N]??"")),N+=1;E.push({key:a,node:m.jsx("div",{className:"md-table-wrap",children:m.jsxs("table",{className:"md-table",children:[m.jsx("thead",{children:m.jsx("tr",{children:v.map((C,f)=>m.jsx("th",{children:us(C,n,`${a}-h${f}`,c)},f))})}),m.jsx("tbody",{children:S.map((C,f)=>m.jsx("tr",{children:C.map((o,u)=>m.jsx("td",{children:us(o,n,`${a}-${f}-${u}`,c)},u))},f))})]})},a)});continue}if(Mo.test(i)){const v=[];for(;N<y.length&&Mo.test(y[N]??"");)v.push(((D=Mo.exec(y[N]??""))==null?void 0:D[1])??""),N+=1;E.push({key:a,node:m.jsx("blockquote",{className:"md-quote",children:us(v.join(`
|
|
122
|
+
`),n,a,c)},a)});continue}if($l.test(i)||Ro.test(i)){const v=Ro.test(i),S=[];for(;N<y.length;){const f=y[N]??"",o=$l.exec(f),u=Ro.exec(f);if(v&&u!==null)S.push(u[2]??"");else if(!v&&o!==null)S.push(o[1]??"");else if(S.length>0&&/^\s{2,}\S/.test(f)&&o===null&&u===null)S[S.length-1]=`${S[S.length-1]??""} ${f.trim()}`;else break;N+=1}const C=S.map((f,o)=>m.jsx("li",{children:us(f,n,`${a}-l${o}`,c)},o));E.push({key:a,node:v?m.jsx("ol",{className:"md-list",children:C},a):m.jsx("ul",{className:"md-list",children:C},a)});continue}const l=[];for(;N<y.length;){const v=y[N]??"";if(v.trim().length===0||Wl.test(v)||Rd.test(v)||$l.test(v)||Ro.test(v)||Mo.test(v)||Md.test(v)||Ul.test(v))break;l.push(v),N+=1}E.push({key:a,node:m.jsx("p",{className:"md-paragraph",children:us(l.join(`
|
|
123
|
+
`),n,a,c)},a)})}return m.jsx("div",{className:"md",children:E.map(i=>i.node)})}const np=[{key:"shell",names:["Bash","PowerShell","BashOutput","KillShell","shell_command","bash"],run:"tools.run.shell"},{key:"read",names:["Read","NotebookRead","read"],run:"tools.run.read"},{key:"find",names:["Glob","Grep","LS","grep","glob","list"],run:"tools.run.find"},{key:"edit",names:["Edit","Write","NotebookEdit","MultiEdit","apply_patch","edit","write"],run:"tools.run.edit"},{key:"web",names:["WebSearch","WebFetch","ToolSearch","webfetch","websearch","codesearch"],run:"tools.run.web"},{key:"agent",names:["Task","Agent","task"],run:"tools.run.agent"},{key:"todo",names:["TodoWrite","update_plan","todowrite","todoread"],run:"tools.run.todo"}];function zl(r){const n=np.find(c=>c.names.includes(r));return n===void 0?{key:`name:${r}`,known:!1}:{key:n.key,known:!0}}function ny(r,n,c){const y=np.find(E=>E.key===r);return y===void 0?L("tools.run.callsTo",{count:n,name:c}):L(y.run,{count:n})}function kt(r){if(!og(r.key))return r.key;let n;if(r.params!==void 0){const c={};for(const[y,E]of Object.entries(r.params))c[y]=typeof E=="object"?kt(E):E;n=c}return L(`server.${r.key}`,n)}const ql={model:null,effort:null,contextWindow:null},ry=200,sy=2e4,iy={},oy={};function uc(r,n,c){return`${r}:${c}:${n}`}function ay(r,n){const[c,y]=B.useState([]),[E,N]=B.useState(Tl),[D,i]=B.useState(ql),[a,g]=B.useState("waiting"),[_,l]=B.useState(!1),[v,S]=B.useState(!1),[C,f]=B.useState({}),[o,u]=B.useState(null),[h,d]=B.useState(null),[w,R]=B.useState(!1),[k,A]=B.useState({}),[b,T]=B.useState({}),I=(n===null?void 0:k[n])??iy,W=(n===null?void 0:b[n])??oy,O=B.useRef(new Set),j=B.useRef(new Map),z=B.useRef(new Set),Y=B.useCallback((ne,re,ie)=>{T(Q=>({...Q,[ne]:{...Q[ne]??{},[re]:ie}}))},[]),Z=B.useCallback(ne=>{T(re=>{let ie=!1;const Q={};for(const[V,H]of Object.entries(re))if(ne in H){const G={...H};delete G[ne],Q[V]=G,ie=!0}else Q[V]=H;return ie?Q:re})},[]),J=B.useCallback((ne,re)=>{T(ie=>{const Q=ie[ne];if(Q===void 0||!(re in Q))return ie;const V={...Q};return delete V[re],{...ie,[ne]:V}})},[]);B.useEffect(()=>{for(const ne of c)for(const re of ne.parts){if(re.kind!=="tool-result")continue;z.current.add(re.toolUseId);const ie=j.current.get(re.toolUseId);ie!==void 0&&(window.clearTimeout(ie),j.current.delete(re.toolUseId)),Z(re.toolUseId)}},[c,Z]),B.useEffect(()=>{const ne=j.current;return()=>{for(const re of ne.values())window.clearTimeout(re);ne.clear()}},[]);const K=B.useRef(null);B.useEffect(()=>{if(n===null){y([]),N(Tl),i(ql),g("waiting"),l(!1),K.current=null;return}y([]),N(Tl),i(ql),g("waiting"),l(!1),S(!1),f({}),u(null),d(null),R(!1),O.current.clear(),K.current=null;const ne=r.onMessage(ie=>{var Q;switch(ie.type){case"conversation.reset":if(ie.terminalId!==n)break;y(ie.events),N(ie.usage),i(ie.defaults),u(ie.permissionMode),d(ie.waitingFor),R(ie.openToolCall),g(ie.state),l(ie.hasMore),S(!1),K.current=((Q=ie.events[0])==null?void 0:Q.eventId)??null;break;case"conversation.append":{if(ie.terminalId!==n)break;y(V=>{var ee;const H=new Set(V.map(de=>de.eventId)),G=ie.events.filter(de=>!H.has(de.eventId));return G.length===0?V:(K.current===null&&(K.current=((ee=G[0])==null?void 0:ee.eventId)??null),[...V,...G])}),N(ie.usage),ie.permissionMode!==null&&u(ie.permissionMode),g("live");break}case"conversation.page":{if(ie.terminalId!==n)break;y(V=>{var ee;const H=new Set(V.map(de=>de.eventId)),G=ie.events.filter(de=>!H.has(de.eventId));return G.length===0?V:(K.current=((ee=G[0])==null?void 0:ee.eventId)??K.current,[...G,...V])}),l(ie.hasMore),S(!1);break}case"conversation.turns":{if(ie.terminalId!==n)break;const V=new Map(ie.turns.map(H=>[H.eventId,H.durationMs]));y(H=>H.map(G=>{const ee=V.get(G.eventId);return ee===void 0?G:{...G,durationMs:ee}}));break}case"conversation.parts":{if(ie.terminalId!==n)break;const V=new Map(ie.updates.map(H=>[H.eventId,H.parts]));y(H=>H.map(G=>{const ee=V.get(G.eventId);return ee===void 0?G:{...G,parts:ee}}));break}case"conversation.imageData":{if(ie.terminalId!==n)break;const V=uc(ie.eventId,ie.index,ie.source);f(H=>({...H,[V]:ie.data===null?null:`data:${ie.mediaType};base64,${ie.data}`}));break}case"conversation.state":if(ie.terminalId!==n)break;g(ie.state);break;case"conversation.mode":if(ie.terminalId!==n)break;u(ie.mode);break;case"conversation.waiting":if(ie.terminalId!==n)break;d(ie.waitingFor);break;case"conversation.toolCall":if(ie.terminalId!==n)break;R(ie.open);break;case"error":{if(ie.code!=="answer-failed"||n===null)break;for(const[V,H]of j.current)window.clearTimeout(H),j.current.delete(V),A(G=>{const ee=G[n];if(ee===void 0||!(V in ee))return G;const de={...ee};return delete de[V],{...G,[n]:de}}),Y(n,V,kt(ie.text));break}}});r.send({type:"conversation.subscribe",terminalId:n});const re=r.onReopen(()=>{r.send({type:"conversation.subscribe",terminalId:n})});return()=>{ne(),re(),r.send({type:"conversation.unsubscribe",terminalId:n})}},[r,n,Y]);const P=B.useCallback(()=>{const ne=K.current;n===null||ne===null||v||(S(!0),r.send({type:"conversation.loadMore",terminalId:n,beforeEventId:ne,limit:ry}))},[r,n,v]),$=B.useCallback((ne,re,ie)=>{if(n===null)return;const Q=uc(ne,re,ie);O.current.has(Q)||(O.current.add(Q),r.send({type:"conversation.image",terminalId:n,eventId:ne,index:re,source:ie}))},[r,n]),F=B.useCallback((ne,re)=>{if(n===null)return;A(Q=>{const V=Q[n]??{};return ne in V?Q:{...Q,[n]:{...V,[ne]:re}}}),J(n,ne),r.send({type:"agent.answer",terminalId:n,toolUseId:ne,selections:re});const ie=window.setTimeout(()=>{z.current.has(ne)||(A(Q=>{const V=Q[n];if(V===void 0||!(ne in V))return Q;const H={...V};return delete H[ne],{...Q,[n]:H}}),Y(n,ne,L("conversation.answerUnconfirmed")))},sy);j.current.set(ne,ie)},[r,n,Y,J]),q=B.useCallback(ne=>{n!==null&&r.send({type:"agent.mode",terminalId:n,mode:ne})},[r,n]);return{events:c,usage:E,defaults:D,state:a,permissionMode:o,waitingFor:h,openToolCall:w,hasMore:_,loadingMore:v,loadMore:P,images:C,requestImage:$,answer:F,answered:I,answerFailed:W,setPermissionMode:q}}const ly=80,Dd=5;function Ao(r){return!Array.isArray(r)}function Id(r){const n=[];for(const c of r.parts){if(c.kind!=="tool-call")return null;n.push(c.name)}return n.length>0?n:null}function cy(r){const n=[];let c=0;for(;c<r.length;){const y=r[c];if(y===void 0)break;const E=Id(y),N=E===null?null:zl(E[0]??"");if(!(E!==null&&N!==null&&E.every(_=>zl(_).key===N.key))||E===null||N===null){n.push({kind:"card",card:y}),c+=1;continue}const i=[y];let a=E.length,g=c+1;for(;g<r.length;){const _=r[g];if(_===void 0)break;const l=Id(_);if(l===null||!l.every(v=>zl(v).key===N.key))break;i.push(_),a+=l.length,g+=1}if(a<2){n.push({kind:"card",card:y}),c+=1;continue}n.push({kind:"tools",id:`tools-${y.event.eventId}`,summary:ny(N.key,a,E[0]??""),at:y.event.at,cards:i}),c=g}return n}function uy(r){switch(r.kind){case"text":return r.text;case"tool-call":return`${r.name} ${r.input}`;case"tool-result":return r.text;case"question":return r.questions.map(n=>`${n.question} ${n.options.map(c=>c.label).join(" ")}`).join(`
|
|
124
|
+
`);case"notice":return Kf(r);case"thinking":case"image":return""}}function Nd(r,n){const c=[];for(const y of r.parts)if(c.push(uy(y)),y.kind==="tool-call"){const E=n.get(y.toolUseId);E!==void 0&&c.push(E.text)}return c.join(`
|
|
125
|
+
`)}function fr(r,n){if(n.length===0)return m.jsx(m.Fragment,{children:r});const c=r.toLowerCase(),y=n.toLowerCase(),E=[];let N=0,D=c.indexOf(y),i=0;for(;D!==-1;)D>N&&E.push(m.jsx("span",{children:r.slice(N,D)},i++)),E.push(m.jsx("mark",{children:r.slice(D,D+n.length)},i++)),N=D+n.length,D=c.indexOf(y,N);return N<r.length&&E.push(m.jsx("span",{children:r.slice(N)},i++)),m.jsx(m.Fragment,{children:E})}function rp(r,n){const c=[];let y=r,E=0;for(;y.length>0;){const N=Y0(y);if(N===null){c.push(m.jsx("span",{children:fr(y,n)},E++));break}N.index>0&&c.push(m.jsx("span",{children:fr(y.slice(0,N.index),n)},E++)),c.push(m.jsx("a",{href:N.href,target:"_blank",rel:"noreferrer noopener",children:fr(N.href,n)},E++)),y=y.slice(N.index+N.length)}return m.jsx(m.Fragment,{children:c})}function hy({view:r,onRewind:n,questionsAnswerable:c,contextWindowSource:y,instructionsFile:E,onGoToCli:N,cliPresence:D,exitCode:i,onWakeCli:a,waking:g,discovering:_=!1,toolCallNotice:l=null,serverClosed:v=null,statusLineState:S=null,onConfigureStatusLine:C,threadFont:f,continueTargets:o=[],continueBlockedReason:u=null,onContinue:h,searchRequest:d=null,onSearchRequestApplied:w}){const{events:R,usage:k,defaults:A,state:b,waitingFor:T,hasMore:I,loadingMore:W,loadMore:O,images:j,requestImage:z,answer:Y,answered:Z,answerFailed:J}=r,K=ci(),[P,$]=B.useState(""),[F,q]=B.useState(0),[ne,re]=B.useState(null);B.useEffect(()=>{d!==null&&($(d.query),w==null||w(d.seq))},[d,w]);const ie=B.useRef(null),Q=B.useRef(new Map),V=B.useRef(!0),{cards:H,results:G}=B.useMemo(()=>{const Ae=new Map,De=new Set;for(const je of R)for(const _e of je.parts)_e.kind==="tool-result"?Ae.set(_e.toolUseId,_e):(_e.kind==="tool-call"||_e.kind==="question")&&De.add(_e.toolUseId);const Ce=[];for(const je of R){const _e=je.parts.filter(We=>We.kind!=="thinking"&&!(We.kind==="tool-result"&&De.has(We.toolUseId)));_e.length!==0&&Ce.push({event:je,parts:_e})}return{cards:Ce,results:Ae}},[R]),ee=B.useMemo(()=>cy(H),[H,K]),de=P.trim(),ue=B.useMemo(()=>{if(de.length===0)return[];const Ae=de.toLowerCase();return H.filter(De=>Nd(De,G).toLowerCase().includes(Ae)).map(De=>De.event.eventId)},[H,G,de,K]);B.useEffect(()=>{q(0)},[de]);const Ee=B.useMemo(()=>new Set(ue),[ue]),ke=ue[F]??null;B.useEffect(()=>{var Ae;ke!==null&&((Ae=Q.current.get(ke))==null||Ae.scrollIntoView({block:"center"}))},[ke]),B.useLayoutEffect(()=>{const Ae=ie.current;Ae===null||!V.current||de.length>0||(Ae.scrollTop=Ae.scrollHeight)},[H.length,de]);const $e=B.useCallback(()=>{const Ae=ie.current;if(Ae===null)return;const De=Ae.scrollHeight-Ae.scrollTop-Ae.clientHeight;V.current=De<=ly},[]),Ye=B.useCallback((Ae,De)=>{De===null?Q.current.delete(Ae):Q.current.set(Ae,De)},[]),Te=B.useCallback(Ae=>{const De=Nd(Ae,G);navigator.clipboard.writeText(De).then(()=>{re(Ae.event.eventId),window.setTimeout(()=>re(null),1200)}).catch(()=>re(null))},[G,K]),ot=Ae=>{ue.length!==0&&q(De=>(De+Ae+ue.length)%ue.length)};return m.jsxs("div",{className:"conversation-pane",children:[m.jsxs("div",{className:"conversation-search",children:[m.jsx("input",{className:"conversation-search-input",type:"search",placeholder:L("thread.search.placeholder"),value:P,onChange:Ae=>$(Ae.target.value),onKeyDown:Ae=>{Ae.key==="Enter"&&ot(Ae.shiftKey?-1:1),Ae.stopPropagation()},spellCheck:!1}),de.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"conversation-matches",children:ue.length===0?L("thread.search.none"):`${F+1}/${ue.length}`}),m.jsx("button",{className:"icon-button",onClick:()=>ot(-1),disabled:ue.length===0,title:L("thread.search.previous"),children:"↑"}),m.jsx("button",{className:"icon-button",onClick:()=>ot(1),disabled:ue.length===0,title:L("thread.search.next"),children:"↓"})]}),m.jsx("span",{className:"conversation-spacer"}),h!==void 0&&m.jsx(Vf,{targets:o,className:"icon-button conversation-continue",text:L("thread.continueWith"),blockedReason:u,onPick:h}),f!==void 0&&m.jsx("button",{className:"icon-button thread-font-button",onClick:f.cycle,title:Td(f.size),"aria-label":Td(f.size),children:m.jsxs("span",{"aria-hidden":"true",children:["a",m.jsx("span",{className:"thread-font-big",children:"A"})]})}),m.jsx(j0,{usage:k,source:y,instructionsFile:E,fallbackWindow:A.contextWindow,compact:!0,statusLineState:S,onConfigure:C})]}),m.jsxs("div",{className:"conversation-scroll",ref:ie,onScroll:$e,children:[I&&m.jsx("button",{className:"conversation-more",onClick:O,disabled:W,children:L(W?"thread.loadingMore":"thread.loadEarlier")}),H.length===0&&m.jsxs("p",{className:"conversation-empty",children:[b==="unavailable"?L("thread.empty.unavailable"):b==="no-transcript"?Uv():L(b==="waiting"?"thread.empty.waiting":"thread.empty.noMessages"),b==="waiting"&&_&&m.jsxs(m.Fragment,{children:[m.jsx("br",{}),zv()]})]}),ee.map(Ae=>{if(Ae.kind==="card")return m.jsx(Pd,{card:Ae.card,results:G,needle:de,isMatch:Ae.card.event.eventId===ke,copied:ne===Ae.card.event.eventId,images:j,onRequestImage:z,onCopy:()=>Te(Ae.card),onRewind:n,register:Ye,answered:Z,answerFailed:J,answerable:c,onAnswer:Y},Ae.card.event.eventId);const De=Ae.cards.some(Ce=>Ee.has(Ce.event.eventId));return m.jsx(gy,{summary:Ae.summary,at:Ae.at,open:De,children:Ae.cards.map(Ce=>m.jsx(Pd,{card:Ce,results:G,needle:de,isMatch:Ce.event.eventId===ke,copied:ne===Ce.event.eventId,images:j,onRequestImage:z,onCopy:()=>Te(Ce),onRewind:n,register:Ye,answered:Z,answerFailed:J,answerable:c,onAnswer:Y},Ce.event.eventId))},Ae.id)})]}),v!==null&&(v.state==="relaunching"||D==="live")?m.jsx(fy,{text:v.text,relaunching:v.state==="relaunching",onRelaunch:a}):D==="live"?T===null&&l!==null?m.jsx(my,{notice:l,onGoToCli:N}):m.jsx(py,{waitingFor:T,questionsAnswerable:c,onGoToCli:N}):m.jsx(dy,{presence:D,exitCode:i,waking:g,onWake:a})]})}function dy({presence:r,exitCode:n,waking:c,onWake:y}){const E=r==="sleeping"?L("thread.wake.sleeping"):n===null?L("thread.wake.exited"):L("thread.wake.exitedWithCode",{code:n});return m.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[m.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),m.jsx("span",{children:E}),m.jsx("button",{className:"primary-button primary-button-small",onClick:y,disabled:c,children:L(c?"thread.wake.opening":"thread.wake.open")})]})}function fy({text:r,relaunching:n,onRelaunch:c}){return m.jsxs("div",{className:"conversation-waiting conversation-wake",role:"status",children:[m.jsx("span",{className:"conversation-wake-dot","aria-hidden":"true"}),m.jsx("span",{children:r}),m.jsx("button",{className:"primary-button primary-button-small",onClick:c,disabled:n,children:n?Xv():Gv()})]})}function py({waitingFor:r,questionsAnswerable:n,onGoToCli:c}){if(r===null)return null;const y=If(r,n);return m.jsxs("div",{className:"conversation-waiting",role:"status",children:[m.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),m.jsx("span",{children:y}),m.jsx("button",{className:"link-button",onClick:c,children:L("thread.goToCli")})]})}function my({notice:r,onGoToCli:n}){return m.jsxs("div",{className:"conversation-waiting",role:"status",children:[m.jsx("span",{className:"conversation-waiting-dot","aria-hidden":"true"}),m.jsx("span",{children:r}),m.jsx("button",{className:"link-button",onClick:n,children:L("thread.goToCli")})]})}function Pd({card:r,results:n,needle:c,isMatch:y,copied:E,images:N,onRequestImage:D,onCopy:i,onRewind:a,register:g,answered:_,answerFailed:l,answerable:v,onAnswer:S}){const{event:C}=r,f=C.role==="user",o=u=>{const h=_[u.toolUseId];return h!==void 0?h:n.has(u.toolUseId)?[]:null};return m.jsxs("article",{ref:u=>g(C.eventId,u),className:`turn turn-${C.role}${y?" turn-match":""}`,children:[m.jsxs("div",{className:"turn-actions",children:[m.jsx("button",{className:"icon-button",onClick:i,title:L("thread.copyMessage"),children:E?"✓":"⧉"}),f&&a!==void 0&&m.jsx("button",{className:"icon-button",onClick:a,title:L("thread.rewind"),children:"↩"})]}),r.parts.map((u,h)=>m.jsx(vy,{part:u,eventId:C.eventId,mine:f,result:u.kind==="tool-call"?n.get(u.toolUseId)??null:null,needle:c,images:N,onRequestImage:D,answeredAt:u.kind==="question"?o(u):null,failure:u.kind==="question"?l[u.toolUseId]??null:null,answerable:v,onAnswer:S},h)),m.jsx(_y,{event:C,mine:f})]})}function gy({summary:r,at:n,open:c,children:y}){const E=n>0?jf(n):"";return m.jsxs("details",{className:"tool-group",open:c,children:[m.jsxs("summary",{className:"tool-group-summary",children:[m.jsx("span",{className:"tool-group-chevron","aria-hidden":"true",children:"▸"}),m.jsx("span",{className:"tool-group-count",children:r}),E.length>0&&m.jsx("span",{className:"tool-group-time",children:E})]}),m.jsx("div",{className:"tool-group-body",children:y})]})}function _y({event:r,mine:n}){const c=r.at>0?jf(r.at):"",y=[];return r.durationMs!==null&&y.push(m0(r.durationMs)),r.effort!==null&&y.push(L("thread.turn.effort",{effort:r.effort})),m.jsxs("div",{className:"turn-meta",children:[n&&m.jsx("span",{className:"turn-who",children:L("thread.turn.you")}),c.length>0&&m.jsx("span",{children:c}),r.queued&&m.jsx("span",{className:"turn-queued",title:L("thread.turn.queuedTitle"),children:L("thread.turn.queued")}),y.map(E=>m.jsx("span",{className:"turn-meta-bit",children:E},E))]})}function vy({part:r,eventId:n,mine:c,result:y,needle:E,images:N,onRequestImage:D,answeredAt:i,failure:a,answerable:g,onAnswer:_}){switch(r.kind){case"text":return c?m.jsx(wy,{text:r.text,truncated:r.truncated,needle:E}):m.jsxs("div",{className:"part-text",children:[m.jsx(Sc,{text:r.text,needle:E}),r.truncated&&m.jsxs("span",{className:"part-truncated",children:[" ",L("thread.truncated")]})]});case"image":return m.jsx(Cy,{eventId:n,index:r.index,source:r.source,src:N[uc(n,r.index,r.source)],onRequest:D});case"thinking":return null;case"notice":return m.jsx("div",{className:`turn-notice turn-notice-${r.notice}`,children:fr(Kf(r),E)});case"question":return m.jsx(yy,{part:r,answeredAt:i,failure:a,answerable:g,onAnswer:_,needle:E});case"tool-call":{const l=E.length>0&&`${r.name} ${r.input} ${(y==null?void 0:y.text)??""}`.toLowerCase().includes(E.toLowerCase());return m.jsxs("details",{className:"tool",open:l,children:[m.jsxs("summary",{className:"tool-summary",children:[m.jsx("span",{className:"tool-name",children:r.name}),y!==null&&y.isError&&m.jsx("span",{className:"tool-error",children:L("thread.tool.error")}),y!==null&&y.imageCount>0&&m.jsx("span",{className:"tool-images",children:L("thread.tool.images",{count:y.imageCount})})]}),m.jsxs("div",{className:"tool-block",children:[m.jsx("span",{className:"tool-label",children:L("thread.tool.input")}),m.jsxs("pre",{className:"tool-pre",children:[fr(r.input,E),r.truncated&&m.jsxs("span",{className:"part-truncated",children:[" ",L("thread.truncated")]})]})]}),y!==null&&m.jsxs("div",{className:"tool-block",children:[m.jsx("span",{className:"tool-label",children:L("thread.tool.result")}),m.jsxs("pre",{className:`tool-pre${y.isError?" tool-pre-error":""}`,children:[y.text.length>0?fr(y.text,E):y.imageCount>0?L("thread.tool.imagesNotSent",{count:y.imageCount}):L("thread.tool.noOutput"),y.truncated&&m.jsxs("span",{className:"part-truncated",children:[" ",L("thread.truncated")]})]})]})]})}case"tool-result":return m.jsxs("div",{className:"tool-block",children:[m.jsx("span",{className:"tool-label",children:L("thread.tool.orphanResult")}),m.jsx("pre",{className:`tool-pre${r.isError?" tool-pre-error":""}`,children:fr(r.text,E)})]})}}function yy({part:r,answeredAt:n,failure:c,answerable:y,onAnswer:E,needle:N}){var R;const[D,i]=B.useState(()=>r.questions.map(()=>[])),[a,g]=B.useState(null),[_,l]=B.useState(""),v=n!==null,S=v||!y,C=n??D,f=r.questions.length===1&&((R=r.questions[0])==null?void 0:R.multiSelect)===!1,o=C.every(k=>Ao(k)?k.text.trim().length>0:k.length>0),u=k=>k===void 0||Ao(k)?[]:k,h=(k,A)=>{if(S)return;const b=r.questions[k];if(b!==void 0){if(f){E(r.toolUseId,[[A]]);return}g(T=>T===k?null:T),i(T=>T.map((I,W)=>{if(W!==k)return I;const O=u(I);return b.multiSelect?O.includes(A)?O.filter(j=>j!==A):[...O,A]:[A]}))}},d=k=>{const A=_.trim();if(A.length===0||S)return;const b={kind:"free",text:A};if(f){E(r.toolUseId,[b]);return}i(T=>T.map((I,W)=>W===k?b:I)),g(null),l("")},w=k=>{if(S)return;const A=C[k];l(A!==void 0&&Ao(A)?A.text:""),g(k)};return m.jsxs("div",{className:`question${v?" question-done":""}`,children:[r.questions.map((k,A)=>{const b=C[A],T=b!==void 0&&Ao(b)?b.text:null;return m.jsxs("div",{className:"question-item",children:[m.jsxs("div",{className:"question-head",children:[k.header.length>0&&m.jsx("span",{className:"question-header",children:k.header}),m.jsx("span",{className:"question-text",children:fr(k.question,N)}),k.multiSelect&&m.jsx("span",{className:"question-hint",children:L("thread.question.multi")})]}),m.jsxs("div",{className:"question-options",children:[k.options.map((I,W)=>{const O=u(b).includes(W);return m.jsxs("button",{type:"button",className:`question-option${O?" question-option-picked":""}`,disabled:S,onClick:()=>h(A,W),children:[m.jsx("span",{className:"question-option-label",children:I.label}),I.description.length>0&&m.jsx("span",{className:"question-option-desc",children:I.description})]},W)}),a===A&&!S?m.jsxs("div",{className:"question-write",children:[m.jsx("textarea",{className:"question-write-input",autoFocus:!0,rows:2,value:_,placeholder:L("thread.question.placeholder"),onChange:I=>l(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),d(A)),I.key==="Escape"&&g(null),I.stopPropagation()}}),m.jsxs("div",{className:"question-write-actions",children:[m.jsx("button",{type:"button",className:"question-send",disabled:_.trim().length===0,onClick:()=>d(A),children:L(f?"thread.question.send":"thread.question.useText")}),m.jsx("button",{type:"button",className:"question-write-cancel",onClick:()=>g(null),children:L("common.cancel")})]})]}):m.jsxs("button",{type:"button",className:`question-option question-option-write${T!==null?" question-option-picked":""}`,disabled:S,onClick:()=>w(A),children:[m.jsx("span",{className:"question-option-label",children:T!==null?T:L("thread.question.writeOther")}),T===null&&m.jsx("span",{className:"question-option-desc",children:L("thread.question.writeOtherHint")})]})]})]},A)}),m.jsxs("div",{className:"question-foot",children:[c!==null&&m.jsx("span",{className:"question-failed",children:c}),v?m.jsx("span",{className:"question-sent",children:L("thread.question.answered")}):y?m.jsxs(m.Fragment,{children:[!f&&m.jsx("button",{type:"button",className:"question-send",disabled:!o,onClick:()=>E(r.toolUseId,D),children:L("thread.question.sendAnswers")}),m.jsx("span",{className:"question-note",children:L(f?"thread.question.pickOne":"thread.question.pickEach")})]}):m.jsx("span",{className:"question-note",children:L("thread.question.answerInCli")})]})]})}function wy({text:r,truncated:n,needle:c}){const y=f0(r,n),E=y.length===1?y[0]:void 0;if(E!==void 0&&E.kind==="text")return m.jsx(Od,{text:r,truncated:n,needle:c});const N=y.length-1;return m.jsx("div",{className:"part-own",children:y.map((D,i)=>D.kind==="text"?m.jsx(Od,{text:D.text,truncated:n&&i===N,needle:c},i):m.jsx(Sy,{number:D.number,text:D.text,complete:D.complete,needle:c},i))})}function Sy({number:r,text:n,complete:c,needle:y}){const[E,N]=B.useState(!1),D=y.length>0&&n.toLowerCase().includes(y.toLowerCase()),i=E||D;return m.jsxs("div",{className:`thread-pasted${i?" thread-pasted-open":""}`,children:[m.jsxs("button",{className:"thread-pasted-toggle",onClick:()=>N(a=>!a),"aria-expanded":i,children:[m.jsx("span",{className:"chip-icon",children:"¶"}),L("thread.pasted",{number:r,count:oc(n)}),!c&&m.jsxs("span",{className:"part-truncated",children:[" ",L("thread.truncated")]}),m.jsx("span",{className:"chip-chevron",children:i?"▾":"▸"})]}),i&&m.jsx("div",{className:"thread-pasted-text part-mine",children:rp(n,y)})]})}function Od({text:r,truncated:n,needle:c}){const[y,E]=B.useState(!1),N=r.split(`
|
|
126
|
+
`),D=c.length>0&&r.toLowerCase().includes(c.toLowerCase()),i=N.length>=Dd&&!D,a=i&&!y?N.slice(0,Dd-1).join(`
|
|
127
|
+
`):r;return m.jsxs("div",{className:"part-text part-mine",children:[rp(a,c),n&&m.jsxs("span",{className:"part-truncated",children:[" ",L("thread.truncated")]}),i&&m.jsx("button",{className:"fold-toggle",onClick:()=>E(g=>!g),children:y?L("thread.fold.less"):L("thread.fold.more",{count:N.length})})]})}function Cy({eventId:r,index:n,source:c,src:y,onRequest:E}){const[N,D]=B.useState(!1);return B.useEffect(()=>{y===void 0&&E(r,n,c)},[y,r,n,c,E]),y===void 0?m.jsx("div",{className:"conversation-image-placeholder",children:L("thread.image.loading")}):y===null?m.jsx("div",{className:"conversation-image-placeholder",children:L("thread.image.gone")}):m.jsxs(m.Fragment,{children:[m.jsx("img",{className:"conversation-image",src:y,alt:L("thread.image.alt"),onClick:()=>D(!0),title:L("thread.image.openTitle")}),N&&m.jsx(Hf,{src:y,caption:L("thread.image.alt"),onClose:()=>D(!1)})]})}function jd({connection:r,title:n,confirmLabel:c,confirmTitle:y,onChoose:E,onClose:N}){const[D,i]=B.useState(null),[a,g]=B.useState(null),[_,l]=B.useState(!1),[v,S]=B.useState(""),C=B.useRef(null),f=B.useRef(null);B.useEffect(()=>{const d=r.onMessage(w=>{if(w.type==="picker.listing"){C.current=w.listing.pickerId,i(w.listing),g(null),l(!1),S("");return}w.type==="error"&&w.code==="picker-failed"&&g(kt(w.text))});return r.send({type:"picker.open"}),()=>{d();const w=C.current;w!==null&&r.send({type:"picker.close",pickerId:w})}},[r]),B.useEffect(()=>{const d=w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),N())};return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[N]),B.useEffect(()=>{var d;_&&((d=f.current)==null||d.focus())},[_]);const o=B.useCallback(d=>{const w=C.current;w!==null&&r.send({type:"picker.enter",pickerId:w,name:d})},[r]),u=B.useCallback(d=>{const w=C.current;w!==null&&r.send({type:"picker.root",pickerId:w,rootIndex:d})},[r]),h=B.useCallback(()=>{const d=C.current,w=v.trim();d===null||w.length===0||r.send({type:"picker.create",pickerId:d,name:w})},[r,v]);return m.jsx("div",{className:"modal-backdrop",onClick:N,children:m.jsxs("div",{className:"modal picker-modal",role:"dialog","aria-label":n,onClick:d=>d.stopPropagation(),children:[m.jsxs("header",{className:"modal-header",children:[m.jsx("span",{className:"modal-title",children:n}),m.jsx("button",{className:"icon-button",onClick:N,title:L("common.close"),children:"×"})]}),D===null?m.jsx("p",{className:"panel-note",children:L("picker.loading")}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"picker-roots",children:D.roots.map((d,w)=>m.jsx("button",{className:"picker-root",onClick:()=>u(w),title:L("picker.goTo",{root:d}),children:d},d))}),m.jsx("p",{className:"picker-path",title:D.path,children:D.path}),m.jsxs("div",{className:"picker-list",children:[D.canGoUp&&m.jsxs("button",{className:"picker-entry picker-up",onClick:()=>o(".."),children:["‹ ",L("picker.up")]}),D.entries.length===0&&!D.canGoUp&&m.jsx("p",{className:"panel-note",children:L("picker.empty")}),D.entries.map(d=>m.jsx("button",{className:"picker-entry",onClick:()=>o(d),children:d},d)),D.truncated&&m.jsx("p",{className:"panel-note",children:L("picker.truncated")})]}),a!==null&&m.jsx("p",{className:"picker-problem",children:a}),m.jsxs("footer",{className:"picker-footer",children:[_?m.jsxs("div",{className:"picker-create",children:[m.jsx("input",{ref:f,className:"picker-create-input",value:v,placeholder:L("picker.newFolderName"),onChange:d=>S(d.target.value),onKeyDown:d=>{d.key==="Enter"&&h(),d.key==="Escape"&&(d.stopPropagation(),l(!1)),d.stopPropagation()},spellCheck:!1}),m.jsx("button",{className:"link-button",onClick:h,children:L("picker.create")}),m.jsx("button",{className:"link-button",onClick:()=>l(!1),children:L("common.cancel")})]}):m.jsx("button",{className:"link-button",onClick:()=>l(!0),children:L("picker.createHere")}),m.jsx("span",{className:"composer-spacer"}),m.jsx("button",{className:"picker-open",onClick:()=>E(D.pickerId,D.path),title:y(D.path),children:c})]})]})]})})}function by(r,n){return gc(r)&&n!==null&&n.sessions>0}function xy(){return L("search.mode.titles")}function ky(){return L("search.mode.conversations")}function Ey(){return L("search.mode.conversationsTitle")}function Ly(r){return L(r==="conversations"?"search.placeholder.conversations":"search.placeholder.titles")}function Ty(){return L("search.tooShort",{min:_f})}function Ry(r){return[...r.trim()].length<_f}function My(){return L("search.off")}function Ay(r){const n=new Map;for(const c of r){const y=`${c.agent}:${c.sessionId}`;let E=n.get(y);E===void 0&&(E={key:y,agent:c.agent,sessionId:c.sessionId,title:c.title,titleHit:null,hits:[],lastAt:null},n.set(y,E)),c.eventId===null?E.titleHit=c:E.hits.push(c),c.at!==null&&(E.lastAt=Math.max(E.lastAt??0,c.at))}return[...n.values()]}const Dy=40;function sp(r,n=Dy){const c=r.matchStart+r.matchLength;let y=r.snippet.slice(0,r.matchStart);if(y.length>n){let E=y.length-n;const N=y.charCodeAt(E);N>=56320&&N<=57343&&(E+=1),y=`…${y.slice(E)}`}return{before:y,match:r.snippet.slice(r.matchStart,c),after:r.snippet.slice(c)}}function Iy(r){return r.role==="user"?L("search.role.user"):r.role==="assistant"?L("search.role.assistant"):L("search.role.title")}function ip(r){return sp(r).match.trim()}function Ny(r){const n=r.hits[0]??r.titleHit;return n===null?"":ip(n)}const hc=r=>L("search.sessions",{count:r});function Py(r,n){return{query:n.query,hits:r===null?[...n.hits]:[...r.hits,...n.hits],sessionsScanned:n.sessionsScanned,sessionsTotal:n.sessionsTotal,truncated:null}}function Oy(r){const{result:n}=r;if(r.searching&&r.error===null){if(n===null)return L("search.status.searching");const y={count:n.sessionsTotal,scanned:n.sessionsScanned};return n.hits.length===0?L("search.status.progress",y):L("search.status.progressFound",{...y,found:Bd(n)})}if(r.error!==null)return r.error;if(n===null)return null;const c=n.hits.length===0?L("search.status.none"):Bd(n);if(n.truncated===null&&n.hits.length===0&&n.sessionsScanned>0)return L("search.status.noneIn",{sessions:hc(n.sessionsScanned)});if(n.truncated==="results")return L("search.status.truncatedResults",{found:c});if(n.truncated==="time"){const y=Math.max(0,n.sessionsTotal-n.sessionsScanned);return L("search.status.truncatedTime",{found:c,seconds:Math.round(__/1e3),left:hc(y)})}return L("search.status.done",{found:c})}function Bd(r){const n=new Set(r.hits.map(c=>`${c.agent}:${c.sessionId}`)).size;return L("search.found",{hits:L("search.hits",{count:r.hits.length}),sessions:hc(n)})}function jy(r,n){const c=n.terminals.find(y=>y.kind==="agent"&&y.agent===r.agent&&y.sessionId===r.sessionId);if(c!==void 0)return{kind:"activate",terminalId:c.terminalId};for(const y of n.projects){const E=y.sessions.find(N=>N.agent===r.agent&&N.sessionId===r.sessionId);if(E!==void 0)return ic(E)&&y.cwdExists&&n.canResume(E.agent)?{kind:"resume",cwd:yf(E.cwd,y.cwd,n.platform),session:E}:{kind:"copy"}}return{kind:"copy"}}const By=/<(code|kbd|b|strong|em)>([\s\S]*?)<\/\1>|<br\s*\/?>/g;function At(r,n,c){const y=Ef(r,n),E=[];let N=0;for(const D of y.matchAll(By)){const i=D.index??0;i>N&&E.push(Io(y.slice(N,i),n));const a=D[1];if(a===void 0)E.push(B.createElement("br",{key:E.length}));else{const g=Io(D[2]??"",n);E.push(B.createElement(a,{key:E.length},g))}N=i+D[0].length}return N<y.length&&E.push(Io(y.slice(N),n)),E.length===1?E[0]:E}function Fy(){return[{keys:"Alt + T",description:L("shortcuts.app.newTab")},{keys:"Alt + W",description:L("shortcuts.app.closeTab")},{keys:"Alt + ← / →",description:L("shortcuts.app.switchTab")},{keys:"Alt + P",description:L("shortcuts.app.togglePanel")},{keys:"Shift + Tab",description:L("shortcuts.app.previousTab")}]}function Hy({agent:r,onClose:n}){return B.useEffect(()=>{const c=y=>{y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),n())};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[n]),m.jsx("div",{className:"modal-backdrop",onClick:n,children:m.jsxs("div",{className:"modal",role:"dialog","aria-label":L("shortcuts.ariaLabel"),onClick:c=>c.stopPropagation(),children:[m.jsxs("header",{className:"modal-header",children:[m.jsx("span",{className:"modal-title",children:L("shortcuts.title")}),m.jsx("button",{className:"icon-button",onClick:n,title:L("common.close"),children:"×"})]}),m.jsxs("div",{className:"modal-body",children:[m.jsx("h3",{className:"modal-section",children:L("shortcuts.section.app")}),m.jsx(Vl,{shortcuts:Fy()}),m.jsx("h3",{className:"modal-section",children:L("shortcuts.section.composer")}),m.jsx(Vl,{shortcuts:vv(r!==null&&r.capabilities.imagesByPath!==null)}),r!==null&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"modal-section",children:L("shortcuts.section.cli")}),m.jsx("p",{className:"modal-hint",children:At("shortcuts.cliHint")}),m.jsx(Vl,{shortcuts:ps[r.id].shortcuts}),ps[r.id].shortcutsNote!==null&&m.jsx("p",{className:"modal-hint",children:ps[r.id].shortcutsNote})]}),m.jsx("p",{className:"modal-hint",children:At("shortcuts.browserReserved")}),m.jsx("p",{className:"modal-hint",children:At("shortcuts.altNumber")})]})]})})}function Vl({shortcuts:r}){return m.jsx("dl",{className:"shortcut-list",children:r.map(n=>m.jsxs("div",{className:"shortcut-row",children:[m.jsx("dt",{children:m.jsx("kbd",{children:n.keys})}),m.jsx("dd",{children:n.description})]},n.keys))})}const $y=1e3,Wy=5e3;function Uy({info:r,agentLabel:n,onRefresh:c,onClose:y}){const[E,N]=B.useState(!1),[D,i]=B.useState(!1),a=B.useRef(null),g=B.useRef(null);B.useEffect(()=>{const C=f=>{f.key==="Escape"&&(f.preventDefault(),f.stopPropagation(),y())};return window.addEventListener("keydown",C,!0),()=>window.removeEventListener("keydown",C,!0)},[y]),B.useEffect(()=>{i(!1)},[r]),B.useEffect(()=>()=>{a.current!==null&&window.clearTimeout(a.current),g.current!==null&&window.clearTimeout(g.current)},[]);const _=C=>{navigator.clipboard.writeText(C).then(()=>{N(!0),a.current!==null&&window.clearTimeout(a.current),a.current=window.setTimeout(()=>N(!1),$y)}).catch(()=>N(!1))},l=()=>{i(!0),c(),g.current!==null&&window.clearTimeout(g.current),g.current=window.setTimeout(()=>i(!1),Wy)},v=r.state==="active",S=L("statusLine.title",{agent:n});return m.jsx("div",{className:"modal-backdrop",onClick:y,children:m.jsxs("div",{className:"modal",role:"dialog","aria-label":S,onClick:C=>C.stopPropagation(),children:[m.jsxs("header",{className:"modal-header",children:[m.jsx("span",{className:"modal-title",children:S}),m.jsx("button",{className:"icon-button",onClick:y,title:L("common.close"),children:"×"})]}),m.jsxs("div",{className:"modal-body",children:[m.jsx("p",{className:`status-line-state${v?" status-line-state-active":""}`,children:fv(r.state)}),m.jsx("p",{className:"modal-hint",children:L("statusLine.benefit")}),m.jsx("h3",{className:"modal-section",children:L("statusLine.lineSection")}),r.fragment===null?m.jsx("p",{className:"modal-hint",children:pv()}):m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"modal-hint",children:At("statusLine.mergeHint")}),m.jsxs("div",{className:"status-line-fragment",children:[m.jsx("pre",{className:"tool-pre",children:r.fragment}),m.jsx("button",{className:"link-button",onClick:()=>_(r.fragment??""),title:L("statusLine.copyTitle"),children:E?m.jsxs(m.Fragment,{children:["✓ ",L("statusLine.copied")]}):L("statusLine.copy")})]})]}),m.jsx("h3",{className:"modal-section",children:L("statusLine.whereSection")}),m.jsx("p",{className:"status-line-path",children:r.settingsPath}),m.jsx("p",{className:"modal-hint",children:L("statusLine.whereHint")}),m.jsx("h3",{className:"modal-section",children:L("statusLine.scriptSection")}),m.jsx("p",{className:"modal-hint",children:L("statusLine.scriptHint")}),m.jsx("p",{className:"status-line-path",children:r.scriptPath}),m.jsx("p",{className:"modal-hint",children:At("statusLine.runsEverywhere")}),m.jsxs("div",{className:"status-line-actions",children:[m.jsx("button",{className:"primary-button",onClick:l,disabled:D,children:L(D?"statusLine.checking":"statusLine.check")}),m.jsx("span",{className:"modal-hint",children:L("statusLine.checkHint")})]})]})]})})}function dc({agent:r,agents:n}){return m.jsx("span",{className:"agent-badge",title:li(r,n),children:ev(r)})}function op({className:r,text:n,title:c,disabled:y,offerAgentChoice:E,agents:N,agent:D,onOpen:i}){var C;const[a,g]=B.useState(!1),_=B.useRef(null),l=B.useCallback(()=>g(!1),[]),v=B.useCallback(f=>{g(!1),i(f)},[i]);if(!E)return m.jsx("button",{className:r,onClick:()=>i(),disabled:y,title:c,children:n});const S=((C=N.find(f=>f.id===D))==null?void 0:C.label)??null;return m.jsxs("span",{className:"split-button",children:[m.jsx("button",{className:`${r} split-button-main`,onClick:()=>i(D??void 0),disabled:y,title:S===null?c:L("agentMenu.titleWithAgent",{title:c,label:S}),children:n}),m.jsx("button",{ref:_,className:`${r} split-button-arrow`,onClick:()=>g(f=>!f),disabled:y,"aria-haspopup":"menu","aria-expanded":a,title:L("agentMenu.chooseTitle"),children:"▾"}),a&&_.current!==null&&m.jsx(qf,{agents:N,preselected:D,anchor:_.current,onPick:v,onClose:l})]})}function zy(r){const n=new Date(r);return n.setHours(0,0,0,0),n.getTime()}function ap(r,n,c,y){const E=new Set;for(const N of r)for(const D of N.sessions)D.agent===n&&(D.archived||D.updatedAt<c&&(y.has(D.sessionId)||E.add(D.sessionId)));return[...E]}function qy(r,n,c,y){const E=[];for(const i of r)for(const a of i.sessions)E.includes(a.agent)||E.push(a.agent);const N=y,D=i=>{const a=N.indexOf(i);return a===-1?y.length:a};return E.sort((i,a)=>D(i)-D(a)).map(i=>({agent:i,count:ap(r,i,n,c).length})).filter(i=>i.count>0)}function lp(r,n){const c=new Set;let y=0;for(const E of r.sessions)if(!E.archived){if(n.has(E.sessionId)){y+=1;continue}c.add(E.sessionId)}return{sessionIds:[...c],blocked:y}}function Vy(r){const{sessionIds:n,blocked:c}=r;if(n.length===0)return L("archive.allBlocked",{count:c});const y=L("archive.confirm",{count:n.length});return c===0?y:L("archive.withBlocked",{confirm:y,blocked:L("archive.blockedStays",{count:c})})}const Fd=12;function Ky(r){let n=2166136261;for(let c=0;c<r.length;c+=1)n^=r.charCodeAt(c),n=Math.imul(n,16777619);return n>>>0}function Cc(r){const n=r.toLowerCase().replace(/[\\/]+/g,"/").replace(/\/+$/,"");return`hsl(${Ky(n)%Fd*(360/Fd)} var(--project-color-s) var(--project-color-l))`}function oi(){return L("vault.name")}function Gy(){return L("vault.privacy")}function Xy(){return L("vault.archived")}function Yy(){return L("vault.mark.copy")}function Hd(){return L("vault.mark.copyTitle")}function Qy(){return L("vault.mark.partial")}function Jy(){return L("vault.mark.partialTitle")}function cp(r){return L("vault.sessions",{count:r})}function bc(r){return r==="measuring"||r==="writing"||r==="moving"}function Zy(r){const n=r.progress;switch(r.state){case"measuring":return n===null?L("vault.state.measuring"):L("vault.state.measuringProgress",{done:n.done,total:n.total});case"writing":return n===null?L("vault.state.writing"):L("vault.state.writingProgress",{done:n.done,total:n.total});case"moving":return L("vault.state.moving");default:return r.enabled?L("vault.state.on"):L("vault.state.off")}}function ew(r){if(r===null||!r.enabled)return null;const n=[oi(),cp(r.sessions)];return r.state==="writing"?n.push(r.progress===null?L("vault.line.copying"):L("vault.line.copyingProgress",{done:r.progress.done,total:r.progress.total})):r.state==="moving"?n.push(L("vault.line.moving")):r.state==="measuring"?n.push(L("vault.line.measuring")):n.push(r.lastPassAt===null?L("vault.line.neverCopied"):pr(r.lastPassAt)),r.pending>0&&n.push(L("vault.line.pending",{count:r.pending})),n.join(" · ")}function tw(r){return r===null?oi():r.enabled?L("vault.button.on"):L("vault.button.off")}function nw(r){return r.enabled?"enabled":bc(r.state)?"busy":r.measurement!==null?"measured":r.passSessions>0?"existing":"needs-measure"}function rw(r,n){return bc(r.state)?L("vault.busy"):n?null:L("vault.indexNotReady")}function sw(r){return bc(r.state)?L("vault.busy"):null}function iw(r){return L("vault.previousDir",{dir:r})}function ow(r){const n=[];return r.skippedEmpty>0&&n.push(L("vault.note.empty",{count:r.skippedEmpty})),r.unsupported>0&&n.push(L("vault.note.unsupported",{count:r.unsupported})),r.failed>0&&n.push(r.failureReasons.length>0?L("vault.note.failedWithReasons",{count:r.failed,reasons:r.failureReasons.map(kt).join("; ")}):L("vault.note.failed",{count:r.failed})),n.length===0?null:L("vault.note.notCopied",{parts:n.join(" · ")})}function aw(r,n){const c=r.byAgent.map(N=>({agent:N.agent,label:li(N.agent,n),sessions:N.sessions,bytes:N.eventBytes+N.imageBytes,images:N.images,imageBytes:N.imageBytes,skippedArchived:N.skippedArchived,note:ow(N)})),y=c.reduce((N,D)=>({sessions:N.sessions+D.sessions,bytes:N.bytes+D.bytes,images:N.images+D.images,skippedArchived:N.skippedArchived+D.skippedArchived}),{sessions:0,bytes:r.memoryBytes,images:0,skippedArchived:0}),E=pr(r.measuredAt);return{rows:c,memoryProjects:r.memoryProjects,memoryBytes:r.memoryBytes,total:y,summary:E.length>0?L("vault.measure.summary",{when:E,duration:_d(r.durationMs)}):L("vault.measure.summaryNoWhen",{duration:_d(r.durationMs)})}}function lw(r){const n=r.storage==="vault";return{copy:n,partial:n&&r.partial}}function cw(r){switch(r){case"exporting":return L("vault.export.exporting");case"done":return L("vault.export.done");default:return L("vault.export.idle")}}const uw=1e3;function $d({hit:r}){const{before:n,match:c,after:y}=sp(r);return m.jsxs(m.Fragment,{children:[n,m.jsx("mark",{children:c}),y]})}function hw({project:r,openSessionIds:n,onConfirm:c,onCancel:y}){const E=lp(r,n);return m.jsxs("div",{className:"project-archive-confirm",role:"group",children:[m.jsx("span",{className:"archive-history-text",children:Vy(E)}),E.sessionIds.length>0&&m.jsx("button",{className:"link-button",onClick:c,children:L("sidebar.action.archive")}),m.jsx("button",{className:"link-button",onClick:y,children:E.sessionIds.length>0?L("common.cancel"):L("common.close")})]})}function Kl(r){if(r.cwd.length===0)return r.fallbackName;const n=r.cwd.split(/[\\/]/).filter(c=>c.length>0);return n[n.length-1]??r.cwd}function Wd({out:r}){return m.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("rect",{x:"2.5",y:"3.5",width:"19",height:"5",rx:"1.2"}),m.jsx("path",{d:"M4.5 8.5v10a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-10"}),r?m.jsx("path",{d:"M12 18.5v-6M9.2 15.3 12 12.5l2.8 2.8"}):m.jsx("path",{d:"M10 12.5h4"})]})}function dw(){return m.jsxs("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M8 6.5V4.5a1.5 1.5 0 0 1 1.5-1.5h9A1.5 1.5 0 0 1 20 4.5v11a1.5 1.5 0 0 1-1.5 1.5H17"}),m.jsx("rect",{x:"4",y:"7",width:"12",height:"14",rx:"1.5"}),m.jsx("path",{d:"M7.5 12h5M7.5 15.5h5"})]})}function fw({done:r}){return m.jsx("svg",{className:"archive-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r?m.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5"}):m.jsxs(m.Fragment,{children:[m.jsx("path",{d:"M14 3H7a1.5 1.5 0 0 0-1.5 1.5v15A1.5 1.5 0 0 0 7 21h10a1.5 1.5 0 0 0 1.5-1.5V7.5z"}),m.jsx("path",{d:"M12 10.5v6.5M9.2 14.2 12 17l2.8-2.8"})]})})}function pw({candidates:r,agents:n,onArchiveAgent:c,onClose:y,anchorRef:E}){const[N,D]=B.useState(null),i=B.useRef(null);return B.useEffect(()=>{const a=l=>{var v,S;return l instanceof Node&&(((v=i.current)==null?void 0:v.contains(l))===!0||((S=E.current)==null?void 0:S.contains(l))===!0)},g=l=>{l.key!=="Escape"||!a(document.activeElement)||(l.preventDefault(),l.stopPropagation(),y())},_=l=>{a(l.target)||y()};return window.addEventListener("keydown",g,!0),document.addEventListener("pointerdown",_,!0),()=>{window.removeEventListener("keydown",g,!0),document.removeEventListener("pointerdown",_,!0)}},[E,y]),m.jsxs("div",{ref:i,className:"archive-history",role:"region","aria-label":L("sidebar.history.region"),children:[m.jsxs("div",{className:"archive-history-header",children:[m.jsx("span",{children:L("sidebar.history.heading")}),m.jsx("button",{className:"icon-button",onClick:y,title:L("common.closeEsc"),children:"×"})]}),r.map(({agent:a,count:g})=>{const _=li(a,n);return N===a?m.jsxs("div",{className:"archive-history-row archive-history-confirm",children:[m.jsx("span",{className:"archive-history-text",children:L("sidebar.history.confirm",{count:g,label:_})}),m.jsx("button",{className:"link-button",onClick:()=>c(a),children:L("sidebar.action.archive")}),m.jsx("button",{className:"link-button",onClick:()=>D(null),children:L("common.cancel")})]},a):m.jsxs("div",{className:"archive-history-row",children:[m.jsxs("span",{className:"archive-history-text",children:[m.jsx("span",{className:"archive-history-agent",children:_}),m.jsx("span",{className:"archive-history-count",children:L("sidebar.history.count",{count:g})})]}),m.jsx("button",{className:"link-button",onClick:()=>D(a),children:L("sidebar.action.archive")})]},a)})]})}function mw({projects:r,indexStatus:n,disabled:c,openSessionIds:y,openBlocked:E,onOpenProject:N,agents:D,offerAgentChoice:i,agentForProject:a,onOpenSession:g,canResume:_,platform:l,onRefresh:v,onArchive:S,onHide:C,width:f,onNewProject:o,vault:u,onOpenVault:h,onOpenVaultSession:d,onExportProject:w,exporting:R,lastExported:k,onContinueSession:A,globalSearch:b,onOpenSearchHit:T}){const[I,W]=B.useState(new Set),[O,j]=B.useState(null);B.useEffect(()=>{const he=k===null?0:k.at+uw-Date.now();if(k===null||he<=0)return;j(k.projectKey);const Oe=window.setTimeout(()=>j(null),he);return()=>window.clearTimeout(Oe)},[k]);const z=he=>R.has(he)?"exporting":O===he?"done":"idle",Y=ew(u),[Z,J]=B.useState(""),[K,P]=B.useState(!1),[$,F]=B.useState(new Set),[q,ne]=B.useState("titles"),re=b===null?"titles":q,[ie,Q]=B.useState(!1),V=b!==null&&re==="conversations"&&Z.trim().length>0&&(ie||b.submitted!==null),H=(b==null?void 0:b.result)??null,G=B.useMemo(()=>V&&H!==null?Ay(H.hits):[],[V,H]),ee=he=>{ne(he),Q(!1),b==null||b.clear()},de=()=>{if(b!==null){if(Ry(Z)){Q(!0),b.clear();return}Q(!1),b.search(Z.trim(),K)}},ue=(b==null?void 0:b.submitted)??null,Ee=b==null?void 0:b.search;B.useEffect(()=>{re!=="conversations"||ue===null||Ee===void 0||ue.includeArchived!==K&&Ee(ue.query,K)},[re,ue,Ee,K]);const ke=B.useMemo(()=>r.reduce((he,Oe)=>he+Oe.sessions.filter(be=>be.archived).length,0),[r]),$e=B.useMemo(()=>{const he=re==="titles"?Z.trim().toLowerCase():"";return r.map(Oe=>{const be=K?Oe.sessions:Oe.sessions.filter(ct=>!ct.archived);if(be.length===0)return null;if(he.length===0)return{...Oe,sessions:be};if(Kl(Oe).toLowerCase().includes(he)||Oe.cwd.toLowerCase().includes(he))return{...Oe,sessions:be};const Ne=be.filter(ct=>On(ct.title,ct.titleSource).toLowerCase().includes(he));return Ne.length>0?{...Oe,sessions:Ne}:null}).filter(Oe=>Oe!==null)},[r,Z,K,re]),Ye=re==="titles"&&Z.trim().length>0,Te=he=>he.archived||!y.has(he.sessionId),[ot,Ae]=B.useState(!1),De=B.useRef(null),Ce=zy(Date.now()),je=B.useMemo(()=>D.map(he=>he.id),[D]),_e=B.useMemo(()=>qy(r,Ce,y,je),[r,Ce,y,je]),[We,Je]=B.useState(null);B.useEffect(()=>{_e.length===0&&Ae(!1)},[_e.length]);const Ze=B.useCallback(()=>Ae(!1),[]),St=he=>{const Oe=ap(r,he,Ce,y);Oe.length>0&&(S(Oe,!0),Je({what:li(he,D),sessionIds:Oe})),Ae(!1)},[at,lt]=B.useState(null),tt=he=>{const Oe=lp(he,y);Oe.sessionIds.length>0&&(S(Oe.sessionIds,!0),Je({what:Kl(he),sessionIds:Oe.sessionIds})),lt(null)},Ge=()=>{We!==null&&S(We.sessionIds,!1),Je(null)},fe=he=>{F(Oe=>{const be=new Set(Oe);return be.has(he)?be.delete(he):be.add(he),be})},ze=B.useMemo(()=>{const he=[];for(const Oe of $e)for(const be of Oe.sessions)$.has(be.sessionId)&&he.push(be);return he},[$e,$]),st=he=>{const Oe=ze.filter(be=>he?Te(be):!0).map(be=>be.sessionId);Oe.length>0&&S(Oe,he),F(new Set)},we=he=>{W(Oe=>{const be=new Set(Oe);return be.has(he)?be.delete(he):be.add(he),be})},Ke=n.state==="scanning";return m.jsxs("aside",{className:"sidebar",style:{width:`${f}px`},children:[m.jsxs("div",{className:"sidebar-header",children:[m.jsx("input",{className:"sidebar-filter",type:"search",placeholder:Ly(re),value:Z,onChange:he=>{J(he.target.value),re==="conversations"&&(Q(!1),he.target.value.trim().length===0&&(b==null||b.clear()))},onKeyDown:he=>{re!=="conversations"||he.key!=="Enter"||(he.preventDefault(),de())},spellCheck:!1}),m.jsx("button",{className:"icon-button",onClick:o,title:L("sidebar.newProject"),disabled:c,children:"+"}),m.jsx("button",{className:"icon-button",onClick:v,title:L("sidebar.reindex"),disabled:Ke,children:"⟳"}),m.jsx("button",{className:`icon-button${(u==null?void 0:u.enabled)===!0?" icon-button-on":""}`,onClick:h,title:tw(u),"aria-label":oi(),children:m.jsx(dw,{})}),m.jsx("button",{className:"icon-button",onClick:C,title:L("sidebar.hide"),children:"«"})]}),b!==null&&m.jsxs("div",{className:"sidebar-search-mode",role:"group","aria-label":L("sidebar.searchMode.label"),children:[m.jsx("button",{className:`sidebar-search-mode-option${re==="titles"?" is-on":""}`,"aria-pressed":re==="titles",onClick:()=>ee("titles"),title:L("sidebar.searchMode.titlesTitle"),children:xy()}),m.jsx("button",{className:`sidebar-search-mode-option${re==="conversations"?" is-on":""}`,"aria-pressed":re==="conversations",onClick:()=>ee("conversations"),title:Ey(),children:ky()})]}),Ke&&m.jsx("div",{className:"sidebar-progress",children:L("sidebar.indexing",{scanned:n.scannedFiles,total:n.totalFiles})}),(ke>0||_e.length>0)&&m.jsxs("div",{className:"sidebar-archive-bar",children:[ke>0&&m.jsx("button",{className:`sidebar-archived-toggle${K?" is-on":""}`,onClick:()=>P(he=>!he),title:L("sidebar.archived.toggleTitle"),children:K?L("sidebar.archived.hide",{count:ke}):L("sidebar.archived.show",{count:ke})}),_e.length>0&&m.jsx("button",{ref:De,className:`link-button sidebar-archive-history${ot?" is-on":""}`,onClick:()=>Ae(he=>!he),"aria-expanded":ot,title:L("sidebar.history.buttonTitle"),children:L("sidebar.history.button")})]}),ot&&_e.length>0&&m.jsx(pw,{candidates:_e,agents:D,onArchiveAgent:St,onClose:Ze,anchorRef:De}),We!==null&&!ot&&m.jsxs("div",{className:"archive-history archive-history-undo",role:"status",children:[m.jsx("span",{className:"archive-history-text",children:L("sidebar.undo.text",{count:We.sessionIds.length,what:We.what})}),m.jsx("button",{className:"link-button",onClick:Ge,children:L("sidebar.action.undo")}),m.jsx("button",{className:"icon-button",onClick:()=>Je(null),title:L("sidebar.undo.dismissTitle"),children:"×"})]}),Y!==null&&m.jsx("button",{className:`sidebar-vault-line${(u==null?void 0:u.lastError)!=null?" is-problem":""}`,onClick:h,title:(u==null?void 0:u.lastError)!=null?L("sidebar.vaultLine.lastError",{error:kt(u.lastError)}):L("sidebar.vaultLine.title"),children:Y}),m.jsxs("div",{className:"sidebar-scroll",children:[V&&b!==null&&m.jsxs("div",{className:"search-results",children:[!b.vaultEnabled&&m.jsx("p",{className:"search-note",children:My()}),m.jsx("p",{className:`search-status${b.error!==null?" is-problem":""}`,role:"status",children:ie?Ty():Oy(b)}),!ie&&G.map(he=>{const Oe=he.hits[0]??he.titleHit;return Oe===null?null:m.jsxs("div",{className:"search-group",children:[m.jsxs("button",{className:"search-group-title",onClick:()=>T(Oe,Ny(he)),title:On(he.title),children:[m.jsx(dc,{agent:he.agent,agents:D}),he.titleHit!==null?m.jsx($d,{hit:he.titleHit}):On(he.title)]}),he.hits.map(be=>m.jsxs("button",{className:"search-hit",onClick:()=>T(be,ip(be)),children:[m.jsx("span",{className:"search-hit-snippet",children:m.jsx($d,{hit:be})}),m.jsxs("span",{className:"search-hit-meta",children:[Iy(be),be.at!==null?` · ${pr(be.at)}`:""]})]},be.eventId??"titulo"))]},he.key)})]}),!V&&$e.length===0&&!Ke&&m.jsx("p",{className:"sidebar-empty",children:r.length===0?L("sidebar.empty.noProjects"):L("sidebar.empty.noMatch")}),!V&&$e.map(he=>{const Oe=I.has(he.key)||Ye,be=!c&&he.cwdExists,nt=E(he.cwd);return m.jsxs("div",{className:"project",children:[m.jsxs("div",{className:"project-row",children:[m.jsxs("button",{className:"project-toggle",onClick:()=>we(he.key),title:he.cwd.length>0?he.cwd:he.fallbackName,children:[m.jsx("span",{className:`chevron${Oe?" chevron-open":""}`,children:"›"}),m.jsx("span",{className:"project-swatch",style:{background:Cc(he.cwd)},"aria-hidden":"true"}),m.jsx("span",{className:"project-name",children:Kl(he)}),m.jsx("span",{className:"project-count",children:he.sessions.length})]}),m.jsxs("span",{className:"project-actions",children:[m.jsx("button",{className:`icon-button project-action${z(he.key)!=="idle"?" project-action-busy":""}`,onClick:()=>w(he.key),disabled:z(he.key)==="exporting",title:cw(z(he.key)),"aria-label":L("sidebar.project.export"),children:m.jsx(fw,{done:z(he.key)==="done"})}),m.jsx("button",{className:`icon-button project-action${at===he.key?" project-action-busy":""}`,onClick:()=>lt(Ne=>Ne===he.key?null:he.key),title:L("sidebar.project.archiveTitle"),"aria-label":L("sidebar.project.archive"),"aria-expanded":at===he.key,children:m.jsx(Wd,{out:!1})})]}),m.jsx(op,{className:"icon-button",text:"+",title:nt?Nf():he.cwdExists?L("sidebar.project.newSession"):L("sidebar.project.folderGone"),disabled:!be||nt,offerAgentChoice:i,agents:D,agent:i?a(he):null,onOpen:Ne=>N(he.cwd,Ne)})]}),!he.cwdExists&&m.jsx("div",{className:"project-missing",title:he.cwd,children:L("sidebar.project.missing")}),at===he.key&&m.jsx(hw,{project:he,openSessionIds:y,onConfirm:()=>tt(he),onCancel:()=>lt(null)}),Oe&&m.jsx("ul",{className:"session-list",children:he.sessions.map(Ne=>{const ct=$.has(Ne.sessionId),dn=!Te(Ne),kn=$v(Ne.agent,D,i),En=lw(Ne),mr=ic(Ne)&&_(Ne.agent),Or=En.copy||be&&mr;return m.jsxs("li",{className:`session-row${Ne.archived?" session-archived":""}${ct?" session-selected":""}`,children:[m.jsxs("button",{className:"session-item",onClick:Ln=>{if(Ln.ctrlKey||Ln.metaKey){fe(Ne.sessionId);return}if(En.copy){d(Ne);return}ic(Ne)&&(Ne.archived&&S([Ne.sessionId],!1),g(yf(Ne.cwd,he.cwd,l),Ne))},disabled:!Or,title:En.copy?`${On(Ne.title,Ne.titleSource)}
|
|
128
|
+
${Hd()}`:kn.unavailableTitle??On(Ne.title,Ne.titleSource),children:[m.jsxs("span",{className:"session-title",children:[kn.badge&&m.jsx(dc,{agent:Ne.agent,agents:D}),En.copy&&m.jsx("span",{className:"session-vault-mark",title:Hd(),children:Yy()}),En.partial&&m.jsx("span",{className:"session-partial-mark",title:Jy(),children:Qy()}),On(Ne.title,Ne.titleSource)]}),m.jsx("span",{className:"session-meta",children:pr(Ne.updatedAt)})]}),m.jsx(Vf,{targets:Df(D,Ne.agent,Ne.partial),className:"icon-button session-continue",text:"↪",onPick:Ln=>A(Ne,Ln)}),m.jsx("button",{className:"icon-button session-action",onClick:()=>S([Ne.sessionId],!Ne.archived),disabled:dn,title:Ne.archived?L("sidebar.session.restore"):L(dn?"sidebar.session.blocked":"sidebar.session.archive"),children:m.jsx(Wd,{out:Ne.archived})})]},`${Ne.agent}:${Ne.sessionId}`)})})]},he.key)})]}),ze.length>0&&m.jsxs("div",{className:"sidebar-selection",children:[m.jsx("span",{children:L("sidebar.selection.count",{count:ze.length})}),ze.some(he=>!he.archived)&&m.jsx("button",{className:"link-button",onClick:()=>st(!0),children:L("sidebar.action.archive")}),ze.some(he=>he.archived)&&m.jsx("button",{className:"link-button",onClick:()=>st(!1),children:L("sidebar.action.restore")}),m.jsx("button",{className:"link-button",onClick:()=>F(new Set),children:L("common.cancel")})]})]})}function fc({x:r,y:n,items:c,onClose:y,anchor:E=null}){const N=B.useRef(null),[D,i]=B.useState({left:r,top:n});return B.useLayoutEffect(()=>{const a=N.current;if(a===null)return;const{width:g,height:_}=a.getBoundingClientRect();i({left:Math.max(4,Math.min(r,window.innerWidth-g-4)),top:Math.max(4,Math.min(n,window.innerHeight-_-4))})},[r,n]),B.useEffect(()=>{const a=_=>{_.key==="Escape"&&(_.stopPropagation(),y())},g=_=>{var v;const l=_.target;l instanceof Node&&((v=N.current)!=null&&v.contains(l)||E!=null&&E.contains(l))||y()};return window.addEventListener("keydown",a,!0),window.addEventListener("pointerdown",g,!0),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("keydown",a,!0),window.removeEventListener("pointerdown",g,!0),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[E,y]),m.jsx("div",{ref:N,className:"context-menu",style:{left:`${D.left}px`,top:`${D.top}px`},onPointerDown:a=>a.stopPropagation(),children:c.map(a=>m.jsxs("button",{className:"context-menu-item",lang:a.lang,role:a.checked===void 0?void 0:"menuitemradio","aria-checked":a.checked,onClick:()=>{a.onSelect(),y()},children:[a.checked!==void 0&&m.jsx("span",{className:"context-menu-check","aria-hidden":"true",children:a.checked?"✓":""}),a.label]},a.label))})}function gw({preview:r,onOpenWithSystem:n}){const[c,y]=B.useState(null);B.useEffect(()=>{if(r.binary||r.language===null){y(null);return}let D=!1;return Pn(async()=>{const{highlightCode:i}=await import("./highlight-BdawNAzW.js");return{highlightCode:i}},[]).then(({highlightCode:i})=>{D||y(i(r.text,r.language))}).catch(()=>{D||y(null)}),()=>{D=!0,y(null)}},[r.text,r.language,r.binary]);const E=B.useMemo(()=>r.binary?0:r.text.split(`
|
|
129
|
+
`).length,[r.text,r.binary]),N=m.jsx("button",{className:"primary-button primary-button-small preview-open",onClick:n,children:L("files.menu.openWithSystem")});return r.binary?m.jsxs("div",{className:"preview-fallback",children:[m.jsx("p",{className:"panel-note",children:L("files.preview.binary")}),N]}):m.jsxs("div",{className:"panel-scroll",children:[m.jsxs("div",{className:"preview",children:[m.jsx("div",{className:"preview-gutter","aria-hidden":"true",children:Array.from({length:E},(D,i)=>m.jsx("span",{children:i+1},i))}),c!==null?m.jsx("pre",{className:"preview-code hljs",dangerouslySetInnerHTML:{__html:c}}):m.jsx("pre",{className:"preview-code",children:r.text})]}),r.truncated&&m.jsxs("div",{className:"preview-fallback",children:[m.jsx("p",{className:"panel-note",children:L("files.preview.truncated")}),N]})]})}function xc(){return m.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:m.jsx("path",{d:"M1.5 3.5h4l1.2 1.6h7.8v7.4a1 1 0 0 1-1 1h-12a1 1 0 0 1-1-1V3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function _w(){return m.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[m.jsx("rect",{x:"5.5",y:"1.5",width:"9",height:"10",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("path",{d:"M10.5 13.2v.3a1 1 0 0 1-1 1h-7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h.3",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function vw({open:r}){return m.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:[m.jsx("path",{d:"M1.4 8S3.8 3.9 8 3.9 14.6 8 14.6 8 12.2 12.1 8 12.1 1.4 8 1.4 8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),m.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),!r&&m.jsx("path",{d:"M2.6 13.4L13.4 2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function yw(){return m.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13","aria-hidden":"true",focusable:"false",children:m.jsx("path",{d:"M3 8.5l3.2 3.2L13 4.8",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ho({className:r,title:n,onCopy:c}){const[y,E]=B.useState(!1),N=B.useRef(null);B.useEffect(()=>()=>{N.current!==null&&window.clearTimeout(N.current)},[]);const D=i=>{i.stopPropagation(),c(),E(!0),N.current!==null&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>E(!1),1200)};return m.jsx("button",{className:y?`${r} tree-action-done`:r,onClick:D,title:y?L("common.copied"):n,children:y?m.jsx(yw,{}):m.jsx(_w,{})})}function ww({view:r,cwd:n,platform:c,onInsert:y,onReveal:E}){const{listings:N,loading:D,preview:i,loadingPreview:a,closePreview:g,refresh:_,query:l,setQuery:v,showHidden:S,toggleHidden:C}=r,f=ci(),[o,u]=B.useState(null),h=c==="win32"?"\\":"/",d=B.useCallback(T=>{const I=T.split("/").join(h);return n.length===0?I:n.endsWith(h)?`${n}${I}`:`${n}${h}${I}`},[n,h]),w=B.useCallback(T=>{navigator.clipboard.writeText(T).catch(()=>{})},[]),R=B.useCallback(T=>w(`"${d(T)}"`),[d,w]),k=B.useCallback((T,I)=>{T.preventDefault(),T.stopPropagation(),u({x:T.clientX,y:T.clientY,items:[{label:L("files.menu.copyAbsolute"),onSelect:()=>w(d(I))},{label:L("files.menu.copyRelative"),onSelect:()=>w(I)},...y===void 0?[]:[{label:L("files.menu.insertMention"),onSelect:()=>y(`@${I}`)}],{label:L("files.menu.openWithSystem"),onSelect:()=>E(I)}]})},[d,w,y,E,f]);if(i!==null||a)return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsx("button",{className:"link-button",onClick:g,children:L("files.back")}),i!==null&&m.jsxs("span",{className:"panel-subhead-title",title:i.path,children:[i.path.split("/").pop(),m.jsxs("span",{className:"panel-tagline",children:[" ",Xt(i.sizeBytes)]})]})]}),a?m.jsx("p",{className:"panel-note",children:L("files.readingFile")}):i!==null&&m.jsx(gw,{preview:i,onOpenWithSystem:()=>E(i.path)}),o!==null&&m.jsx(fc,{x:o.x,y:o.y,items:o.items,onClose:()=>u(null)})]});const A=N.get(""),b=l.trim();return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsx("span",{className:"panel-subhead-title",title:n,children:n.split(/[\\/]/).filter(T=>T.length>0).pop()??n}),m.jsx(Ho,{className:"icon-button",title:L("files.copyFolderPath"),onCopy:()=>R("")}),m.jsx("button",{className:S?"icon-button icon-button-on":"icon-button",onClick:C,title:L(S?"files.hidden.hide":"files.hidden.show"),children:m.jsx(vw,{open:S})}),m.jsx("button",{className:"icon-button",onClick:()=>E(""),title:L("files.revealFolder"),children:m.jsx(xc,{})}),m.jsx("button",{className:"icon-button",onClick:_,title:L("files.refresh"),children:"⟳"})]}),m.jsxs("div",{className:"tree-search",children:[m.jsx("input",{className:"tree-search-input",value:l,placeholder:L("files.search.placeholder"),onChange:T=>v(T.target.value),onKeyDown:T=>{T.key==="Escape"&&l.length>0&&(T.stopPropagation(),v(""))}}),l.length>0&&m.jsx("button",{className:"tree-search-clear",onClick:()=>v(""),title:L("files.search.clear"),children:"×"})]}),m.jsx("div",{className:"panel-scroll",children:b.length>0?m.jsx(Sw,{view:r,onContextMenu:k,onReveal:E,onCopyPath:R}):A===void 0?m.jsx("p",{className:"panel-note",children:D.has("")?L("files.readingDir"):L("files.readDirFailed")}):m.jsx(up,{path:"",depth:0,view:r,onContextMenu:k,onReveal:E,onCopyPath:R})}),o!==null&&m.jsx(fc,{x:o.x,y:o.y,items:o.items,onClose:()=>u(null)})]})}function Sw({view:r,onContextMenu:n,onReveal:c,onCopyPath:y}){const{results:E,searching:N,openFile:D,toggleDirectory:i}=r;return E===null?m.jsx("p",{className:"panel-note",children:L(N?"files.search.searching":"files.search.prompt")}):E.entries.length===0?m.jsx("p",{className:"panel-note",children:L("files.search.none")}):m.jsxs("ul",{className:"tree tree-results",children:[E.entries.map(a=>m.jsx("li",{children:m.jsxs("div",{className:"tree-item",children:[m.jsxs("button",{className:`tree-row tree-row-${a.kind}${a.hidden===void 0?"":" tree-row-hidden"}`,onClick:()=>a.kind==="dir"?i(a.path):D(a.path),onContextMenu:g=>n(g,a.path,a.kind),title:a.path,children:[m.jsx("span",{className:"tree-chevron",children:a.kind==="dir"?"›":""}),m.jsxs("span",{className:"tree-result",children:[m.jsx("span",{className:"tree-name",children:a.name}),m.jsx("span",{className:"tree-result-path",children:a.path})]}),a.kind==="file"&&m.jsx("span",{className:"tree-size",children:Xt(a.sizeBytes)})]}),m.jsx(Ho,{className:"tree-action",title:L("files.copyPath",{name:a.name}),onCopy:()=>y(a.path)}),a.kind==="dir"&&m.jsx("button",{className:"tree-action",onClick:()=>c(a.path),title:L("files.reveal",{name:a.name}),children:m.jsx(xc,{})})]})},a.path)),E.truncated&&m.jsx("li",{className:"tree-hidden",title:L("files.search.moreTitle"),children:L("files.search.more")})]})}function up({path:r,depth:n,view:c,onContextMenu:y,onReveal:E,onCopyPath:N}){const{listings:D,loading:i}=c,a=D.get(r);return a===void 0?i.has(r)?m.jsx("div",{className:"tree-loading",children:L("files.loading")}):null:m.jsxs("ul",{className:"tree",children:[a.entries.map(g=>m.jsx(Cw,{entry:g,depth:n,view:c,onContextMenu:y,onReveal:E,onCopyPath:N},g.path)),a.entries.length===0&&m.jsx("li",{className:"tree-empty",style:{paddingLeft:`${n*12+8}px`},children:a.hiddenCount>0?L("files.allHidden"):L("files.empty")}),(a.truncated||a.hiddenCount>0)&&a.entries.length>0&&m.jsx("li",{className:"tree-hidden",style:{paddingLeft:`${n*12+8}px`},title:L("files.hiddenTitle"),children:a.truncated?L("files.moreEntries"):L("files.hiddenCount",{count:a.hiddenCount})})]})}function Cw({entry:r,depth:n,view:c,onContextMenu:y,onReveal:E,onCopyPath:N}){const{expanded:D,toggleDirectory:i,openFile:a}=c,g=r.kind==="dir"&&D.has(r.path);return m.jsxs("li",{children:[m.jsxs("div",{className:"tree-item",children:[m.jsxs("button",{className:`tree-row tree-row-${r.kind}${r.hidden===void 0?"":" tree-row-hidden"}`,style:{paddingLeft:`${n*12+6}px`},onClick:()=>r.kind==="dir"?i(r.path):a(r.path),onContextMenu:_=>y(_,r.path,r.kind),title:r.hidden===void 0?r.path:`${r.path}
|
|
130
|
+
${r.hidden==="ignored"?L("files.row.ignored"):L("files.row.alwaysHidden")}`,children:[m.jsx("span",{className:`tree-chevron${g?" tree-chevron-open":""}`,children:r.kind==="dir"?"›":""}),m.jsx("span",{className:"tree-name",children:r.name}),r.kind==="file"&&m.jsx("span",{className:"tree-size",children:Xt(r.sizeBytes)})]}),m.jsx(Ho,{className:"tree-action",title:L("files.copyPath",{name:r.name}),onCopy:()=>N(r.path)}),r.kind==="dir"&&m.jsx("button",{className:"tree-action",onClick:()=>E(r.path),title:L("files.reveal",{name:r.name}),children:m.jsx(xc,{})})]}),g&&m.jsx(up,{path:r.path,depth:n+1,view:c,onContextMenu:y,onReveal:E,onCopyPath:N})]})}const bw={added:"+",removed:"-",context:" ",hunk:"",meta:""};function xw({diff:r}){return r.binary?m.jsx("p",{className:"panel-note",children:L("diff.binary")}):r.lines.length===0?m.jsx("p",{className:"panel-note",children:r.message===null?L("diff.noChanges"):kt(r.message)}):m.jsxs("div",{className:"panel-scroll",children:[m.jsx("div",{className:"diff",children:r.lines.map((n,c)=>m.jsxs("div",{className:`diff-line diff-line-${n.kind}`,children:[m.jsx("span",{className:"diff-num","aria-hidden":"true",children:n.oldLine??""}),m.jsx("span",{className:"diff-num","aria-hidden":"true",children:n.newLine??""}),m.jsx("span",{className:"diff-marker","aria-hidden":"true",children:bw[n.kind]}),m.jsx("span",{className:"diff-text",children:n.text})]},c))}),r.truncated&&m.jsx("p",{className:"panel-note",children:L("diff.truncated")})]})}const kw={added:"A",modified:"M",deleted:"D",renamed:"R",copied:"C","type-changed":"T",untracked:"?",conflict:"!"},Ew={added:"git.kind.added",modified:"git.kind.modified",deleted:"git.kind.deleted",renamed:"git.kind.renamed",copied:"git.kind.copied","type-changed":"git.kind.typeChanged",untracked:"git.kind.untracked",conflict:"git.kind.conflict"},Lw=[{stage:"conflict",title:"git.group.conflict",hint:"git.group.conflictHint"},{stage:"staged",title:"git.group.staged",hint:"git.group.stagedHint"},{stage:"unstaged",title:"git.group.unstaged",hint:"git.group.unstagedHint"},{stage:"untracked",title:"git.group.untracked",hint:"git.group.untrackedHint"}];function Ud(r){const n=r.endsWith("/"),c=n?r.slice(0,-1):r,y=c.lastIndexOf("/"),E=y===-1?c:c.slice(y+1);return{dir:y===-1?"":c.slice(0,y+1),name:n?`${E}/`:E,isDirectory:n}}function Tw({status:r}){return m.jsxs("div",{className:"git-headline",children:[m.jsx("span",{className:"git-branch",title:r.repoRoot,children:r.branch??(r.head!==null?L("git.detachedAt",{head:r.head}):L("git.detached"))}),r.upstream!==null&&m.jsx("span",{className:"git-upstream",title:L("git.upstreamTitle",{upstream:r.upstream}),children:r.upstream}),(r.ahead>0||r.behind>0)&&m.jsxs("span",{className:"git-ab",title:L("git.aheadBehindTitle"),children:[r.ahead>0&&m.jsxs("span",{className:"git-ahead",children:["↑",r.ahead]}),r.behind>0&&m.jsxs("span",{className:"git-behind",children:["↓",r.behind]})]})]})}function Rw({view:r}){const{status:n,diff:c,loadingDiff:y,openDiff:E,closeDiff:N,refresh:D}=r;if(c!==null||y)return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsxs("button",{className:"link-button",onClick:N,children:["← ",L("git.backToChanges")]}),c!==null&&m.jsxs("span",{className:"panel-subhead-title",title:c.path,children:[Ud(c.path).name,c.staged&&m.jsxs("span",{className:"panel-tagline",children:[" ",L("git.stagedTag")]})]})]}),y?m.jsx("p",{className:"panel-note",children:L("git.readingDiff")}):c!==null&&m.jsx(xw,{diff:c})]});if(n.state!=="ready")return m.jsx("div",{className:"panel-body",children:m.jsx("p",{className:"panel-note",children:n.message===null?L("git.unknownState"):kt(n.message)})});const i=n.worktrees.filter(a=>!a.isCurrent);return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsx(Tw,{status:n}),m.jsx("button",{className:"icon-button",onClick:D,title:L("git.refresh"),children:"⟳"})]}),m.jsxs("div",{className:"panel-scroll",children:[n.changes.length===0&&m.jsx("p",{className:"panel-note",children:L("git.clean")}),Lw.map(a=>{const g=n.changes.filter(_=>_.stage===a.stage);return g.length===0?null:m.jsxs("section",{className:"git-group",children:[m.jsxs("h3",{className:"git-group-title",title:L(a.hint),children:[L(a.title),m.jsx("span",{className:"git-group-count",children:g.length})]}),m.jsx("ul",{className:"git-list",children:g.map(_=>{const{dir:l,name:v,isDirectory:S}=Ud(_.path),C=_.oldPath!==null?`${_.oldPath} → ${_.path}`:S?L("git.newFolderTitle",{path:_.path}):_.path,f=m.jsxs(m.Fragment,{children:[m.jsx("span",{className:`git-badge git-badge-${_.kind}`,title:L(Ew[_.kind]),children:kw[_.kind]}),m.jsxs("span",{className:"git-path",children:[m.jsx("span",{className:"git-path-name",children:v}),l.length>0&&m.jsx("span",{className:"git-path-dir",children:l})]})]});return m.jsx("li",{children:S?m.jsx("div",{className:"git-item git-item-static",title:C,children:f}):m.jsx("button",{className:"git-item",onClick:()=>E(_.path,_.stage==="staged"),title:C,children:f})},`${a.stage}:${_.path}`)})})]},a.stage)}),n.truncated&&m.jsx("p",{className:"panel-note",children:At("git.truncated")}),i.length>0&&m.jsxs("section",{className:"git-group",children:[m.jsxs("h3",{className:"git-group-title",title:L("git.worktrees.headingTitle"),children:[L("git.worktrees.heading"),m.jsx("span",{className:"git-group-count",children:i.length})]}),m.jsx("ul",{className:"git-list",children:i.map(a=>m.jsx("li",{children:m.jsxs("div",{className:"git-worktree",title:a.path,children:[m.jsx("span",{className:"git-worktree-branch",children:a.branch??L("git.worktrees.detached")}),m.jsx("span",{className:"git-worktree-path",children:a.path})]})},a.path))})]})]})]})}const Mw={create:"memory.action.create","append-block":"memory.action.appendBlock","replace-block":"memory.action.replaceBlock","append-lines":"memory.action.appendLines",copy:"memory.action.copy"},Aw={"AGENTS.md":["Codex","Antigravity","OpenCode"],"CLAUDE.md":["Claude Code"]};function $o(r){return r.brokenBlock||r.problem!==null}function Dw(r){return r.problem==="outside"?L("memory.problem.outside"):r.problem==="encoding"?L("memory.problem.encoding"):r.brokenBlock?L("memory.problem.brokenBlock"):null}function Iw(r){const n=r.files.filter(c=>!$o(c));return r.installed?{instructionFiles:n.filter(c=>c.hasBlock||c.exists).map(c=>c.name),gitMode:r.git.kind==="error"||r.git.kind==="repo"&&!r.git.ignored?"version":"ignore",importNative:!1,copyFromMainWorktree:!1}:{...i_(r),instructionFiles:n.map(c=>c.name)}}function Nw(r){const n=r.files.filter(E=>E.hasBlock&&!E.blockCurrent),c=r.files.filter(E=>E.exists&&!E.hasBlock&&!$o(E)),y=E=>Bf(E.map(N=>N.name));return n.length===0?c.length===0?null:L("memory.update.missing",{files:y(c)}):c.length===0?L("memory.update.outdated",{count:n.length,files:y(n)}):L("memory.update.outdatedAndMissing",{count:n.length,outdated:y(n),missing:y(c)})}function Pw(r){const n=r.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
131
|
+
`),c=/^---\n[\s\S]*?\n---(?:\n|$)/.exec(n);return c===null?n:n.slice(c[0].length)}function Ow(r){return r.split(/`([^`]+)`/).map((n,c)=>c%2===1?m.jsx("code",{children:n},c):n)}function jw({view:r}){var o;const{status:n,open:c,loading:y,error:E,closeNote:N,openNote:D}=r,[i,a]=B.useState(null),[g,_]=B.useState(!1),l=(n==null?void 0:n.cwd)??null;B.useEffect(()=>{a(null),_(!1)},[l]),B.useEffect(()=>{r.lastResult!==null&&(a(null),_(!1))},[r.lastResult]);const v=B.useCallback(u=>{if(n===null)return null;let h=u.replace(/^\.\//,"");try{h=decodeURIComponent(h)}catch{return null}return h===Po||n.notes.some(w=>w.name===h)?()=>D(h):null},[n,D]);if(n===null)return m.jsx("div",{className:"panel-body",children:m.jsx("p",{className:"panel-note",children:E??L("memory.loading")})});if(c!==null||y!==null){const u=(c==null?void 0:c.name)??y??"",h=u===Po?L("memory.index"):((o=n.notes.find(d=>d.name===u))==null?void 0:o.title)??u;return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsx("button",{className:"link-button",onClick:N,children:L("memory.back")}),m.jsx("span",{className:"panel-subhead-title",title:u,children:h})]}),c===null?m.jsx("p",{className:"panel-note",children:L("memory.note.loading")}):m.jsxs("div",{className:"panel-scroll",children:[m.jsx("div",{className:"plan-body",children:m.jsx(Sc,{text:Pw(c.text),localLink:v})}),c.truncated&&m.jsx("p",{className:"panel-note",children:L("memory.note.truncated")})]})]})}const S=i??Iw(n),C=n.installed?Nw(n):null,f=!n.installed||g||r.planned!==null;return m.jsxs("div",{className:"panel-body",children:[m.jsx(Bw,{reach:n.reach,onAdjust:n.installed&&!f&&C===null&&n.reach.some(u=>!u.reaches)?()=>_(!0):null}),m.jsxs("div",{className:"panel-scroll",children:[(E??r.lastResult)!==null&&m.jsxs("div",{className:`memory-message${E!==null?" memory-message-error":""}`,children:[m.jsx("span",{children:E??r.lastResult}),m.jsx("button",{className:"link-button",onClick:r.dismissMessage,title:L("common.dismissNotice"),children:"×"})]}),n.git.kind==="error"&&m.jsxs("div",{className:"memory-warning",children:[m.jsx("p",{className:"memory-warning-line",children:At("memory.git.errorWarning")}),m.jsx("pre",{className:"memory-git-message",children:kt(n.git.message)})]}),n.files.filter($o).map(u=>m.jsx("p",{className:"memory-warning",children:u.problem==="outside"?At("memory.problem.outsideWarning",{file:u.name}):u.problem==="encoding"?At("memory.problem.encodingWarning",{file:u.name}):At("memory.problem.brokenBlockWarning",{file:u.name})},u.name)),!n.installed&&m.jsxs("div",{className:"memory-intro",children:[m.jsx("p",{children:L("memory.intro.what")}),m.jsx("p",{children:At("memory.intro.where")})]}),n.installed&&C!==null&&!f&&m.jsxs("div",{className:"memory-callout",children:[m.jsx("span",{children:C}),m.jsx("button",{className:"primary-button primary-button-small",onClick:()=>_(!0),children:L("memory.update.button")})]}),f&&(r.planned===null?m.jsx(Fw,{status:n,options:S,busy:r.busy,onChange:a,onPlan:()=>{a(S),r.requestPlan(S)},onCancel:n.installed?()=>{_(!1),a(null)}:null}):m.jsx(Hw,{changes:r.planned,busy:r.busy,confirmLabel:n.installed?L("memory.plan.update"):L("memory.plan.install"),onConfirm:r.install,onCancel:r.cancelPlan})),n.installed&&n.native.pending>0&&!f&&m.jsxs("div",{className:"memory-callout",children:[m.jsx("span",{children:L("memory.native.pending",{count:n.native.pending})}),m.jsx("button",{className:"primary-button primary-button-small",disabled:r.busy!==null,onClick:r.importNative,children:r.busy==="import"?L("memory.native.importing"):L("memory.native.import",{count:n.native.pending})})]}),n.installed&&m.jsx($w,{notes:n.notes,indexExists:n.indexExists,onOpen:D}),n.globalFragments.length>0&&m.jsx(Ww,{fragments:n.globalFragments})]})]})}function Bw({reach:r,onAdjust:n}){return m.jsxs("div",{className:"memory-reach",children:[r.map(c=>m.jsxs("span",{className:`memory-reach-item${c.reaches?" memory-reach-on":""}`,title:L("memory.reach.title",{label:c.label,via:kt(c.via)}),children:[m.jsx("span",{className:"memory-reach-mark","aria-hidden":"true",children:c.reaches?"✓":"—"}),c.label,m.jsx("span",{className:"visually-hidden",children:c.reaches?L("memory.reach.reaches",{via:kt(c.via)}):L("memory.reach.doesNotReach",{via:kt(c.via)})})]},c.agent)),n!==null&&m.jsx("button",{className:"link-button memory-reach-adjust",onClick:n,title:L("memory.reach.adjustTitle"),children:L("memory.reach.adjust")})]})}function Fw({status:r,options:n,busy:c,onChange:y,onPlan:E,onCancel:N}){const{git:D}=r,i=D.kind==="repo"?D.worktree:null,a=D.kind==="error"&&n.gitMode==="ignore",g=(_,l)=>{const v=new Set(n.instructionFiles);l?v.add(_):v.delete(_),y({...n,instructionFiles:_c.filter(S=>v.has(S))})};return m.jsxs("div",{className:"memory-form",children:[m.jsx("p",{className:"memory-section-label",children:L("memory.form.files")}),r.files.map(_=>m.jsxs("label",{className:"memory-option",title:Dw(_)??void 0,children:[m.jsx("input",{type:"checkbox",checked:n.instructionFiles.includes(_.name),disabled:$o(_),onChange:l=>g(_.name,l.target.checked)}),m.jsx("code",{children:_.name}),m.jsx("span",{className:"memory-option-hint",children:Bf(Aw[_.name])})]},_.name)),D.kind==="repo"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"memory-section-label",children:"Git"}),m.jsxs("label",{className:"memory-option",children:[m.jsx("input",{type:"radio",name:"memory-git-mode",checked:n.gitMode==="ignore",onChange:()=>y({...n,gitMode:"ignore"})}),L("memory.git.ignore"),m.jsx("span",{className:"memory-option-hint",children:L("memory.git.ignoreHint")})]}),m.jsxs("label",{className:"memory-option",children:[m.jsx("input",{type:"radio",name:"memory-git-mode",checked:n.gitMode==="version",onChange:()=>y({...n,gitMode:"version"})}),L("memory.git.version"),m.jsx("span",{className:"memory-option-hint",children:L("memory.git.versionHint")})]}),D.ignored&&n.gitMode==="version"&&m.jsx("p",{className:"memory-warning",children:At("memory.git.alreadyIgnored")})]}),D.kind==="error"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"memory-section-label",children:"Git"}),m.jsxs("label",{className:"memory-option",children:[m.jsx("input",{type:"radio",name:"memory-git-mode",checked:n.gitMode==="version",onChange:()=>y({...n,gitMode:"version"})}),At("memory.git.dontTouch"),m.jsx("span",{className:"memory-option-hint",children:L("memory.git.errorHint")})]})]}),(r.native.pending>0||(i==null?void 0:i.mainHasMemory)===!0)&&m.jsx("p",{className:"memory-section-label",children:L("memory.form.existingNotes")}),r.native.pending>0&&m.jsxs("label",{className:"memory-option",children:[m.jsx("input",{type:"checkbox",checked:n.importNative,onChange:_=>y({...n,importNative:_.target.checked})}),L("memory.form.importNative",{count:r.native.pending})]}),(i==null?void 0:i.mainHasMemory)===!0&&m.jsxs("label",{className:"memory-option",title:i.mainPath,children:[m.jsx("input",{type:"checkbox",checked:n.copyFromMainWorktree,onChange:_=>y({...n,copyFromMainWorktree:_.target.checked})}),L("memory.form.copyFromMain")]}),m.jsxs("div",{className:"memory-actions",children:[m.jsx("button",{className:"primary-button primary-button-small",disabled:c!==null||n.instructionFiles.length===0||a,onClick:E,title:n.instructionFiles.length===0?L("memory.form.noFiles"):a?L("memory.git.blocked"):void 0,children:L(c==="plan"?"memory.form.planning":"memory.form.preview")}),N!==null&&m.jsx("button",{className:"link-button",onClick:N,disabled:c!==null,children:L("common.cancel")})]})]})}function Hw({changes:r,busy:n,confirmLabel:c,onConfirm:y,onCancel:E}){const N=n==="install";return m.jsxs("div",{className:"memory-form",children:[m.jsx("p",{className:"memory-section-label",children:L("memory.plan.changes")}),r.length===0?m.jsx("p",{className:"memory-empty",children:L("memory.plan.nothing")}):m.jsx("ul",{className:"memory-change-list",children:r.map((D,i)=>m.jsxs("li",{className:"memory-change",children:[m.jsxs("div",{className:"memory-change-head",children:[m.jsx("code",{className:"memory-change-file",children:D.file}),m.jsx("span",{className:"memory-option-hint",children:L(Mw[D.action])})]}),D.copiedFrom!==null&&m.jsx("p",{className:"memory-option-hint",children:L("memory.plan.copiedFrom",{path:D.copiedFrom})}),D.preview.length>0&&m.jsx("pre",{className:"memory-preview",children:D.preview})]},`${D.file}-${i}`))}),m.jsxs("div",{className:"memory-actions",children:[r.length>0&&m.jsx("button",{className:"primary-button primary-button-small",disabled:n!==null,onClick:y,children:N?L("memory.plan.writing"):c}),m.jsx("button",{className:"link-button",onClick:E,disabled:N,children:r.length===0?L("memory.plan.back"):L("common.cancel")})]})]})}function $w({notes:r,indexExists:n,onOpen:c}){return m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"memory-section-label",children:L("memory.list.notes")}),m.jsxs("ul",{className:"plan-list",children:[n&&m.jsx("li",{children:m.jsxs("button",{className:"plan-row",onClick:()=>c(Po),children:[m.jsx("span",{className:"plan-name",children:L("memory.index")}),m.jsx("span",{className:"plan-meta",children:Po})]})}),r.map(y=>m.jsx("li",{children:m.jsxs("button",{className:"plan-row",onClick:()=>c(y.name),title:y.name,children:[m.jsx("span",{className:"plan-name",children:y.title}),y.description.length>0&&m.jsx("span",{className:"memory-note-description",children:y.description}),m.jsxs("span",{className:"plan-meta",children:[pr(y.modifiedAt)," · ",Xt(y.sizeBytes)]})]})},y.name))]}),r.length===0&&m.jsx("p",{className:"memory-empty",children:L("memory.list.empty")})]})}function Ww({fragments:r}){const n=B.useCallback(c=>{navigator.clipboard.writeText(c).catch(()=>{})},[]);return m.jsxs("details",{className:"memory-global",children:[m.jsx("summary",{className:"memory-global-summary",children:L("memory.global.title")}),m.jsx("p",{className:"memory-empty",children:At("memory.global.intro")}),r.map(c=>m.jsxs("div",{className:"memory-fragment",children:[m.jsxs("div",{className:"memory-change-head",children:[m.jsx("span",{className:"memory-fragment-label",children:c.label}),m.jsx("code",{className:"memory-fragment-target",title:c.target,children:c.target})]}),m.jsxs("div",{className:"memory-fragment-body",children:[m.jsx("pre",{className:"memory-preview",children:c.text}),m.jsx(Ho,{className:"icon-button",title:L("memory.global.copy"),onCopy:()=>n(c.text)})]}),m.jsx("p",{className:"memory-fragment-note",children:Ow(kt(c.note))})]},c.agent))]})}function Uw(r){for(const n of r.split(`
|
|
132
|
+
`,40)){const c=/^#{1,3}\s+(.+)$/.exec(n.trim());if(c!==null)return(c[1]??"").trim()}return null}function zw({view:r}){var D,i;const{plans:n,open:c,loading:y,openPlan:E,closePlan:N}=r;if(c!==null||y!==null){const a=((D=n.find(l=>l.fileName===(c==null?void 0:c.fileName)))==null?void 0:D.path)??null,g=((i=n.find(l=>l.fileName===(c==null?void 0:c.fileName)))==null?void 0:i.title)??null,_=c===null?y:Uw(c.text)??g??y;return m.jsxs("div",{className:"panel-body",children:[m.jsxs("div",{className:"panel-subhead",children:[m.jsxs("button",{className:"link-button",onClick:N,children:["← ",L("plans.backToList")]}),m.jsx("span",{className:"panel-subhead-title",title:a??void 0,children:_})]}),c===null?m.jsx("p",{className:"panel-note",children:L("plans.loading")}):m.jsxs("div",{className:"panel-scroll",children:[m.jsx("div",{className:"plan-body",children:m.jsx(Sc,{text:c.text})}),c.truncated&&m.jsx("p",{className:"panel-note",children:L("plans.truncated")})]})]})}return m.jsx("div",{className:"panel-body",children:m.jsx("div",{className:"panel-scroll",children:n.length===0?m.jsx("p",{className:"panel-note",children:At("plans.empty")}):m.jsx("ul",{className:"plan-list",children:[...n].reverse().map(a=>m.jsx(qw,{plan:a,onOpen:()=>E(a)},a.fileName))})})})}function qw({plan:r,onOpen:n}){const c=r.path.length>0?r.path:null;return r.exists?m.jsx("li",{children:m.jsxs("button",{className:"plan-row",onClick:n,title:c??void 0,children:[m.jsx("span",{className:"plan-name",children:r.title}),c!==null&&m.jsx("span",{className:"plan-path",children:c}),m.jsxs("span",{className:"plan-meta",children:[pr(r.modifiedAt)," · ",Xt(r.sizeBytes)]})]})}):m.jsxs("li",{className:"plan-row plan-row-missing",title:c??L("plans.missingTitle"),children:[m.jsx("span",{className:"plan-name",children:r.title}),c!==null&&m.jsx("span",{className:"plan-path",children:c}),m.jsx("span",{className:"plan-meta",children:L("plans.missing")})]})}const Vw=[{id:"cli",labelKey:"panel.tab.cli"},{id:"git",labelKey:"panel.tab.git"},{id:"files",labelKey:"panel.tab.files"},{id:"plans",labelKey:"panel.tab.plans"},{id:"memory",labelKey:"panel.tab.memory"}];function Kw(r){return r.state!=="ready"?0:new Set(r.changes.map(n=>n.path)).size}function Gw({tab:r,plansAvailable:n,hidden:c,onTabChange:y,title:E,cwd:N,platform:D,cli:i,cliUnseen:a,expanded:g,onToggleExpanded:_,git:l,files:v,plans:S,memory:C,onInsert:f,onReveal:o,onHide:u}){var w;const h=Kw(l.status),d=((w=C.status)==null?void 0:w.installed)===!0?C.status.notes.length:0;return m.jsxs("section",{className:`side-panel${c?" side-panel-hidden":""}`,"aria-hidden":c,children:[m.jsxs("header",{className:"side-panel-header",children:[m.jsx("span",{className:"side-panel-title",title:N,children:E}),m.jsx("button",{className:"icon-button",onClick:_,title:L(g?"panel.restoreWidth":"panel.widen"),children:g?"⇥":"⇤"}),m.jsx("button",{className:"icon-button",onClick:u,title:L("panel.hide"),children:"×"})]}),m.jsx("nav",{className:"side-panel-tabs",children:mv(Vw,n).map(R=>m.jsxs("button",{className:`side-panel-tab${R.id===r?" side-panel-tab-active":""}`,onClick:()=>y(R.id),title:L(R.labelKey),children:[m.jsx("span",{className:"side-panel-tab-label",children:L(R.labelKey)}),R.id==="git"&&h>0&&m.jsx("span",{className:"side-panel-badge",children:h}),R.id==="plans"&&S.plans.length>0&&m.jsx("span",{className:"side-panel-badge",children:S.plans.length}),R.id==="memory"&&d>0&&m.jsx("span",{className:"side-panel-badge",children:d}),R.id==="cli"&&a&&r!=="cli"&&m.jsx("span",{className:"side-panel-dot",title:L("panel.cliUnseen")})]},R.id))}),m.jsxs("div",{className:"side-panel-body",children:[m.jsx("div",{className:`cli-slot${r==="cli"?"":" cli-slot-hidden"}`,children:i}),r==="git"&&m.jsx(Rw,{view:l}),r==="plans"&&m.jsx(zw,{view:S}),r==="memory"&&m.jsx(jw,{view:C}),r==="files"&&m.jsx(ww,{view:v,cwd:N,platform:D,onInsert:f,onReveal:o})]})]})}function Xw({placement:r}){return m.jsxs("div",{className:"tab tab-pending","aria-busy":"true",title:`${r.pending.cwd}
|
|
133
|
+
${L("tabs.state.opening")}`,style:{"--tab-project-color":Cc(r.pending.cwd)},children:[m.jsx("span",{className:"tab-opening","aria-label":L("tabs.aria.opening"),children:m.jsx("i",{})}),m.jsx("span",{className:"tab-label",children:r.label})]})}function Yw({terminal:r,activity:n,statusLine:c}){if(!r.alive){const y=r.sleeping;return m.jsx("span",{className:`tab-dot${y?" tab-dot-sleeping":" tab-dot-dead"}`,title:L(y?"tabs.dot.sleeping":"tabs.dot.exited")})}return n==="waiting"?m.jsx("span",{className:"tab-bang",title:L("tabs.dot.waiting"),children:"!"}):n==="busy"?m.jsxs("span",{className:"tab-working",title:L("tabs.dot.busy"),"aria-label":L("tabs.aria.working"),children:[m.jsx("i",{}),m.jsx("i",{}),m.jsx("i",{})]}):m.jsx("span",{className:"tab-dot",title:Ev(n,c)})}function zd(r){if(r.label.length>0)return r.label;const n=r.cwd.split(/[\\/]/).filter(y=>y.length>0),c=n[n.length-1]??r.cwd;return r.resumed?`${c} ↩`:c}function Qw(r){return r.alive?L("tabs.state.alive"):r.sleeping?L("tabs.state.sleeping"):L("tabs.state.exited",{code:r.exitCode??"?"})}function Jw({terminals:r,activeTerminalId:n,activity:c,canOpen:y,onSelect:E,onClose:N,onRename:D,onReorder:i,onNew:a,agents:g,offerAgentChoice:_,newTabAgent:l,pendingOpens:v,platform:S,newTabBlockedTitle:C}){const[f,o]=B.useState(null),[u,h]=B.useState(""),[d,w]=B.useState(null),R=B.useRef(null);B.useEffect(()=>{var O;f!==null&&((O=R.current)==null||O.select())},[f]);const k=O=>{o(O.terminalId),h(O.label.length>0?O.label:zd(O))},A=()=>{f!==null&&D(f,u.trim()),o(null)},b=O=>{if(d===null||d===O)return;const j=r.map(Z=>Z.terminalId),z=j.indexOf(d),Y=j.indexOf(O);z===-1||Y===-1||(j.splice(Y,0,...j.splice(z,1)),i(j),w(null))},T=e0(r,v,S),I=new Map;for(const O of T){const j=I.get(O.index);j===void 0?I.set(O.index,[O]):j.push(O)}const W=O=>(I.get(O)??[]).map(j=>m.jsx(Xw,{placement:j},`pending:${j.pending.requestId}`));return m.jsxs("div",{className:"tab-bar",children:[r.map((O,j)=>{var Z;const z=O.terminalId===n,Y=O.terminalId===f;return m.jsxs(ng.Fragment,{children:[W(j),m.jsx("div",{className:`tab${z?" tab-active":""}${O.alive||O.sleeping?"":" tab-dead"}`,draggable:!Y,onDragStart:()=>w(O.terminalId),onDragOver:J=>J.preventDefault(),onDrop:()=>b(O.terminalId),onDragEnd:()=>w(null),onClick:()=>E(O.terminalId),onDoubleClick:()=>k(O),title:`${O.cwd}
|
|
134
|
+
${Qw(O)}`,style:{"--tab-project-color":Cc(O.cwd)},children:Y?m.jsx("input",{ref:R,className:"tab-input",value:u,onChange:J=>h(J.target.value),onBlur:A,onKeyDown:J=>{J.key==="Enter"&&A(),J.key==="Escape"&&o(null),J.stopPropagation()},onClick:J=>J.stopPropagation()}):m.jsxs(m.Fragment,{children:[m.jsx(Yw,{terminal:O,activity:c.get(O.terminalId),statusLine:((Z=g.find(J=>J.id===O.agent))==null?void 0:Z.statusLine)??null}),m.jsxs("span",{className:"tab-label",children:[O.agent!==null&&Hv(_,O.agent)&&m.jsx(dc,{agent:O.agent,agents:g}),zd(O)]}),m.jsx("button",{className:"tab-close",onClick:J=>{J.stopPropagation(),N(O.terminalId)},title:L("tabs.close"),children:"×"})]})})]},O.terminalId)}),W(r.length),m.jsx(op,{className:"tab-new",text:"+",title:C??L("tabs.new"),disabled:!y||C!==null,offerAgentChoice:_,agents:g,agent:l,onOpen:a})]})}function Zw(r,n,c){const[y,E]=B.useState(!1);return B.useEffect(()=>{if(E(!1),!(n===null||c))return r.onMessage(N=>{N.type==="terminal.output"&&N.terminalId===n&&E(!0)})},[r,n,c]),y&&!c}const eS=200,qd="agent-workbench.files.hidden";function tS(r,n){const[c,y]=B.useState(new Map),[E,N]=B.useState(new Set),[D,i]=B.useState(new Set),[a,g]=B.useState(null),[_,l]=B.useState(!1),[v,S]=B.useState(""),[C,f]=B.useState(null),[o,u]=B.useState(!1),[h,d]=B.useState(()=>$t(qd,!1,O=>O==="true"?!0:O==="false"?!1:null)),w=B.useRef(new Set),R=B.useRef(h);R.current=h;const k=B.useCallback(O=>{n===null||w.current.has(O)||(w.current.add(O),i(j=>new Set(j).add(O)),r.send({type:"files.list",terminalId:n,path:O,includeHidden:R.current}))},[r,n]);B.useEffect(()=>{if(y(new Map),N(new Set),i(new Set),g(null),l(!1),S(""),f(null),u(!1),w.current=new Set,n===null)return;const O=r.onMessage(z=>{switch(z.type){case"files.listing":{if(z.terminalId!==n)break;const{listing:Y}=z;w.current.delete(Y.path),y(Z=>new Map(Z).set(Y.path,Y)),i(Z=>{const J=new Set(Z);return J.delete(Y.path),J});break}case"files.results":if(z.terminalId!==n)break;f(z.result),u(!1);break;case"files.preview":if(z.terminalId!==n)break;g(z.preview),l(!1);break;case"error":w.current=new Set,i(new Set),l(!1),u(!1);break}});r.send({type:"files.list",terminalId:n,path:"",includeHidden:R.current}),w.current.add(""),i(new Set([""]));const j=r.onReopen(()=>{w.current=new Set,r.send({type:"files.list",terminalId:n,path:"",includeHidden:R.current})});return()=>{O(),j()}},[r,n]),B.useEffect(()=>{const O=v.trim();if(n===null||O.length===0){f(null),u(!1);return}u(!0);const j=window.setTimeout(()=>{r.send({type:"files.search",terminalId:n,query:O,includeHidden:R.current})},eS);return()=>window.clearTimeout(j)},[r,n,v,h]);const A=B.useCallback(O=>{N(j=>{const z=new Set(j);return z.has(O)?z.delete(O):(z.add(O),k(O)),z})},[k]),b=B.useCallback(O=>{n!==null&&(l(!0),g(null),r.send({type:"files.read",terminalId:n,path:O}))},[r,n]),T=B.useCallback(()=>{g(null),l(!1)},[]),I=B.useCallback(()=>{if(n===null)return;w.current=new Set;const O=["",...E];for(const j of O)w.current.add(j),r.send({type:"files.list",terminalId:n,path:j,includeHidden:R.current});i(new Set(O))},[r,n,E]),W=B.useCallback(()=>{d(O=>{const j=!O;if(R.current=j,Ot(qd,String(j)),n!==null){w.current=new Set;const z=["",...E];for(const Y of z)w.current.add(Y),r.send({type:"files.list",terminalId:n,path:Y,includeHidden:j});i(new Set(z))}return j})},[r,n,E]);return{listings:c,expanded:E,loading:D,preview:a,loadingPreview:_,query:v,setQuery:S,results:C,searching:o,showHidden:h,toggleHidden:W,toggleDirectory:A,openFile:b,closePreview:T,refresh:I}}function nS(r){const[n,c]=B.useState(!1),[y,E]=B.useState(null),[N,D]=B.useState(null),[i,a]=B.useState(null),g=B.useRef(null);B.useEffect(()=>{const v=r.onMessage(C=>{switch(C.type){case"search.progress":if(g.current===null||C.searchId!==g.current)break;E(f=>Py(f,C.progress));break;case"search.results":if(g.current===null||C.searchId!==g.current)break;g.current=null,E(C.result),D(null),c(!1);break;case"error":if(C.code!=="search-failed"||g.current===null||C.requestId!==g.current)break;g.current=null,C.detail!==void 0&&console.error("[servidor]",C.detail),E(null),D(kt(C.text)),c(!1);break}}),S=r.onReopen(()=>{g.current!==null&&(g.current=null,c(!1),D(L("searchHook.connectionLost")))});return()=>{v(),S()}},[r]);const _=B.useCallback((v,S)=>{const C=crypto.randomUUID();g.current=C,a({query:v,includeArchived:S}),c(!0),D(null),E(null),r.send({type:"search.global",searchId:C,query:v,includeArchived:S})},[r]),l=B.useCallback(()=>{const v=g.current;g.current=null,v!==null&&r.send({type:"search.cancel",searchId:v}),a(null),c(!1),E(null),D(null)},[r]);return{searching:n,result:y,error:N,submitted:i,search:_,clear:l}}function rS(r,n){const[c,y]=B.useState([]),[E,N]=B.useState(null),[D,i]=B.useState(null);B.useEffect(()=>{if(y([]),N(null),i(null),n!==null)return r.onMessage(_=>{switch(_.type){case"conversation.plans":if(_.terminalId!==n)break;y(_.plans);break;case"plans.content":if(_.terminalId!==n)break;N(_.plan),i(null);break;case"error":i(null);break}})},[r,n]);const a=B.useCallback(_=>{n!==null&&(i(_.title),N(null),r.send({type:"plans.read",terminalId:n,fileName:_.fileName}))},[r,n]),g=B.useCallback(()=>{N(null),i(null)},[]);return{plans:c,open:E,loading:D,openPlan:a,closePlan:g}}function sS(r,n){const[c,y]=B.useState(Ml),[E,N]=B.useState(null),[D,i]=B.useState(!1);B.useEffect(()=>{if(n===null){y(Ml),N(null);return}y(Ml),N(null),i(!1);const l=r.onMessage(S=>{switch(S.type){case"git.status":S.terminalId===n&&y(S.status);break;case"git.diff":if(S.terminalId!==n)break;N(S.diff),i(!1);break;case"error":i(!1);break}});r.send({type:"git.subscribe",terminalId:n});const v=r.onReopen(()=>{r.send({type:"git.subscribe",terminalId:n})});return()=>{l(),v(),r.send({type:"git.unsubscribe",terminalId:n})}},[r,n]);const a=B.useCallback((l,v)=>{n!==null&&(i(!0),N(null),r.send({type:"git.diff",terminalId:n,path:l,staged:v}))},[r,n]),g=B.useCallback(()=>{N(null),i(!1)},[]),_=B.useCallback(()=>{n!==null&&r.send({type:"git.refresh",terminalId:n})},[r,n]);return{status:c,diff:E,loadingDiff:D,openDiff:a,closeDiff:g,refresh:_}}const pc=new Set;function iS(r){return r!==void 0&&pc.has(r)}function oS(r){return r.length===0?L("memory.result.nothingChanged"):L("memory.result.installed",{count:r.length})}function aS(r,n){const c=r.length===0?L("memory.result.nothingImported"):L("memory.result.imported",{count:r.length});return n.length===0?c:L("memory.result.withSkipped",{result:c,skipped:L("memory.result.skipped",{count:n.length,files:n.join(", ")})})}function lS(r,n){const[c,y]=B.useState(null),[E,N]=B.useState(null),[D,i]=B.useState(null),[a,g]=B.useState(null),[_,l]=B.useState(null),[v,S]=B.useState(null),[C,f]=B.useState(null),o=B.useRef(new Map),u=B.useRef(new Set),h=B.useRef(null),d=B.useRef(!1),w=B.useCallback(z=>{const Y=`memory-${crypto.randomUUID()}`;return o.current.set(Y,z),u.current.add(Y),pc.add(Y),Y},[]),R=B.useCallback(z=>{for(const[Y,Z]of o.current)Z===z&&o.current.delete(Y)},[]);B.useEffect(()=>{y(null),N(null),i(null),g(null),l(null),S(null),f(null),o.current.clear();for(const P of u.current)pc.delete(P);if(u.current.clear(),h.current=null,d.current=!1,n===null)return;const z=(P,$)=>P===void 0||o.current.get(P)!==$?!1:(o.current.delete(P),!0),Y=r.onMessage(P=>{switch(P.type){case"memory.status":if(P.terminalId!==n)break;y(P.status),d.current&&(d.current=!1,f(null));break;case"memory.planned":if(P.terminalId!==n||!z(P.requestId,"plan"))break;g(P.changes),l(null);break;case"memory.installed":if(P.terminalId!==n||!z(P.requestId,"install"))break;h.current=null,g(null),l(null),S(oS(P.applied));break;case"memory.imported":if(P.terminalId!==n||!z(P.requestId,"import"))break;l(null),S(aS(P.copied,P.skipped));break;case"memory.content":if(P.terminalId!==n||!z(P.requestId,"read"))break;N(P.note),i(null);break;case"error":{const $=P.requestId,F=$===void 0?void 0:o.current.get($);if($===void 0||F===void 0)break;o.current.delete($),F==="read"?i(null):F!=="subscribe"&&l(null),f(kt(P.text)),d.current=F==="subscribe";break}}}),Z=r.onStatus(P=>{if(P!=="reconnecting"&&P!=="failed")return;const $=new Set(o.current.values());o.current.clear(),l(null),i(null),($.has("install")||$.has("import"))&&(h.current=null,g(null),f(L("memory.error.connectionLost")))}),J=()=>{r.send({type:"memory.subscribe",terminalId:n,requestId:w("subscribe")})};J();const K=r.onReopen(J);return()=>{Y(),Z(),K(),r.send({type:"memory.unsubscribe",terminalId:n})}},[r,n,w]);const k=B.useCallback(()=>{d.current=!1,f(null),S(null)},[]),A=B.useCallback(z=>{n!==null&&(R("read"),k(),i(z),N(null),r.send({type:"memory.read",terminalId:n,name:z,requestId:w("read")}))},[r,n,k,R,w]),b=B.useCallback(()=>{R("read"),N(null),i(null)},[R]),T=B.useCallback(z=>{n!==null&&(k(),h.current=z,g(null),l("plan"),r.send({type:"memory.plan",terminalId:n,options:z,requestId:w("plan")}))},[r,n,k,w]),I=B.useCallback(()=>{const z=h.current;n===null||z===null||(k(),l("install"),r.send({type:"memory.install",terminalId:n,options:z,requestId:w("install")}))},[r,n,k,w]),W=B.useCallback(()=>{n!==null&&(k(),l("import"),r.send({type:"memory.import",terminalId:n,requestId:w("import")}))},[r,n,k,w]),O=B.useCallback(()=>{R("plan"),h.current=null,g(null)},[R]),j=B.useCallback(()=>{d.current=!1,f(null),S(null)},[]);return{status:c,open:E,loading:D,planned:a,busy:_,lastResult:v,error:C,openNote:A,closeNote:b,requestPlan:T,install:I,importNative:W,cancelPlan:O,dismissMessage:j}}function cS(r){const[n,c]=B.useState([]),[y,E]=B.useState({}),[N,D]=B.useState(null),i=B.useRef(new Set);B.useEffect(()=>{const o=r.onMessage(h=>{switch(h.type){case"notes.list":c(h.notes);break;case"notes.imageData":i.current.add(h.imageId),E(d=>({...d,[h.imageId]:h.data===null?null:`data:${h.mediaType};base64,${h.data}`}));break;case"error":h.code==="notes-failed"&&D(kt(h.text));break}}),u=r.onReopen(()=>{i.current.clear()});return()=>{o(),u()}},[r]);const a=B.useCallback(o=>{i.current.has(o)||(i.current.add(o),r.send({type:"notes.image",imageId:o}))},[r]),g=B.useCallback(()=>{const o=crypto.randomUUID(),u=Date.now();return c(h=>[...h,{noteId:o,text:"",images:[],createdAt:u,updatedAt:u}]),r.send({type:"notes.create",noteId:o}),o},[r]),_=B.useCallback((o,u)=>{c(h=>h.map(d=>d.noteId===o?{...d,text:u,updatedAt:Date.now()}:d)),r.send({type:"notes.update",noteId:o,text:u})},[r]),l=B.useCallback(o=>{c(u=>u.filter(h=>h.noteId!==o)),r.send({type:"notes.delete",noteId:o})},[r]),v=B.useCallback((o,u)=>{const h=n.find(w=>w.noteId===o);if(h!==void 0&&h.images.length>=rd){D(L("notes.tooManyImages",{count:rd}));return}if(u.size>Oo){D(L("notes.imageTooBig",{name:u.name||L("notes.imageFallbackName"),size:Math.round(u.size/1024/1024),max:Oo/1024/1024}));return}const d=new FileReader;d.onload=()=>{const w=d.result;if(typeof w!="string")return;const R=w.indexOf(",");R!==-1&&r.send({type:"notes.addImage",noteId:o,image:{mediaType:u.type,data:w.slice(R+1)}})},d.onerror=()=>D(L("notes.readFailed")),d.readAsDataURL(u)},[r,n]),S=B.useCallback((o,u)=>{c(h=>h.map(d=>d.noteId===o?{...d,images:d.images.filter(w=>w.imageId!==u)}:d)),r.send({type:"notes.removeImage",noteId:o,imageId:u})},[r]),C=B.useCallback((o,u)=>{r.send({type:"notes.send",noteId:o,terminalId:u})},[r]),f=B.useCallback(()=>D(null),[]);return{notes:n,images:y,problem:N,requestImage:a,create:g,updateText:_,remove:l,addImage:v,removeImage:S,sendToAgent:C,dismissProblem:f}}const hp="agent-workbench.theme",Gl=["system","light","dark"],uS={system:"theme.system",light:"theme.light",dark:"theme.dark"};function hS(r){return L("theme.title",{theme:L(uS[r])})}const dS={system:"◐",light:"☀",dark:"☾"};function fS(){try{const r=window.localStorage.getItem(hp);if(r==="light"||r==="dark"||r==="system")return r}catch{}return"system"}function pS(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function mS(){const[r,n]=B.useState(fS),[c,y]=B.useState(pS);B.useEffect(()=>{const D=window.matchMedia("(prefers-color-scheme: dark)"),i=a=>y(a.matches);return D.addEventListener("change",i),()=>D.removeEventListener("change",i)},[]);const E=r==="system"?c?"dark":"light":r;B.useEffect(()=>{document.documentElement.dataset.theme=E,document.documentElement.style.colorScheme=E},[E]);const N=B.useCallback(()=>{n(D=>{const i=Gl[(Gl.indexOf(D)+1)%Gl.length]??"system";try{window.localStorage.setItem(hp,i)}catch{}return i})},[]);return{preference:r,resolved:E,cycle:N}}const gS=1500;function _S(r,n){return r===void 0||r===n?null:n==="waiting"?"attention":n==="idle"&&r==="busy"?"done":null}function vS(r,n){const c={now:[],later:[],cancel:[]};for(const[y,E]of n){const N=r.get(y);if(N===E)continue;c.cancel.push(y);const D=_S(N,E);D==="attention"?c.now.push(y):D==="done"&&c.later.push(y)}for(const y of r.keys())n.has(y)||c.cancel.push(y);return c}const Vd="agent-workbench.sound";function yS(r){return r==="on"?!0:r==="off"?!1:null}function wS(r){return L(r?"sound.on":"sound.off")}const SS={done:[{frequency:880,at:0,duration:.18},{frequency:659.25,at:.14,duration:.28}],attention:[{frequency:659.25,at:0,duration:.18},{frequency:987.77,at:.14,duration:.28}]},dp=.02,kc=.8,fp=.2,Kd="agent-workbench.sound-volume";function Wo(r){return Math.min(kc,Math.max(dp,r))}function CS(r){if(r.trim().length===0)return null;const n=Number(r);return Number.isFinite(n)?Wo(n):null}function bS(r){return Math.round(Wo(r)/kc*100)}class xS{constructor(){nn(this,"context",null);nn(this,"volume",fp)}unlock(){typeof window>"u"||typeof window.AudioContext!="function"||(this.context??(this.context=new window.AudioContext),this.context.state==="suspended"&&this.context.resume().catch(()=>{}))}get ready(){var n;return((n=this.context)==null?void 0:n.state)==="running"}play(n){const c=this.context;if(c===null||c.state!=="running")return;const y=c.currentTime+.01;for(const E of SS[n]){const N=c.createOscillator(),D=c.createGain();N.type="sine",N.frequency.value=E.frequency;const i=y+E.at;D.gain.setValueAtTime(1e-4,i),D.gain.exponentialRampToValueAtTime(Wo(this.volume),i+.012),D.gain.exponentialRampToValueAtTime(1e-4,i+E.duration),N.connect(D),D.connect(c.destination),N.start(i),N.stop(i+E.duration+.02)}}}function kS(r){const[n,c]=B.useState(()=>$t(Vd,!0,yS)),y=B.useRef(n);y.current=n;const[E,N]=B.useState(()=>$t(Kd,fp,CS)),D=B.useRef(E);D.current=E;const i=B.useRef(null),a=B.useRef(new Map),g=B.useRef(new Map);B.useEffect(()=>{const S=new xS;S.volume=D.current,i.current=S;const C=()=>{S.unlock(),S.ready&&(window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",C))};return window.addEventListener("pointerdown",C),window.addEventListener("keydown",C),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",C),i.current=null}},[]),B.useEffect(()=>{var f;const S=vS(a.current,r);a.current=new Map(r);const C=g.current;for(const o of S.cancel){const u=C.get(o);u!==void 0&&(window.clearTimeout(u),C.delete(o))}S.now.length>0&&y.current&&((f=i.current)==null||f.play("attention"));for(const o of S.later)C.set(o,window.setTimeout(()=>{var u;C.delete(o),y.current&&((u=i.current)==null||u.play("done"))},gS))},[r]),B.useEffect(()=>{const S=g.current;return()=>{for(const C of S.values())window.clearTimeout(C);S.clear()}},[]);const _=B.useCallback(()=>{var S,C;c(f=>{const o=!f;return Ot(Vd,o?"on":"off"),o}),y.current||((S=i.current)==null||S.unlock(),(C=i.current)==null||C.play("done"))},[]),l=B.useCallback(S=>{const C=Wo(S);N(C),Ot(Kd,String(C)),i.current!==null&&(i.current.volume=C)},[]),v=B.useCallback(()=>{var S,C;y.current&&((S=i.current)==null||S.unlock(),(C=i.current)==null||C.play("done"))},[]);return{enabled:n,toggle:_,volume:E,setVolume:l,previewVolume:v}}function ES(){const[r,n]=B.useState(()=>$t(Ed,Uf,F0));B.useEffect(()=>{document.documentElement.dataset.threadFont=r},[r]);const c=B.useCallback(()=>{n(y=>{const E=zf(y);return Ot(Ed,E),E})},[]);return{size:r,cycle:c}}const LS=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]);function TS({sound:r}){return m.jsxs("span",{className:"sound-control",children:[m.jsx("button",{className:`icon-button${r.enabled?"":" icon-button-muted"}`,onClick:r.toggle,title:wS(r.enabled),"aria-pressed":r.enabled,children:"♪"}),r.enabled&&m.jsx("div",{className:"sound-volume",children:m.jsxs("div",{className:"sound-volume-box",children:[m.jsx("input",{className:"sound-volume-slider",type:"range",min:dp,max:kc,step:.01,value:r.volume,onChange:n=>r.setVolume(Number(n.target.value)),onPointerUp:r.previewVolume,onKeyUp:n=>{LS.has(n.key)&&r.previewVolume()},title:L("sound.volume"),"aria-label":L("sound.volume")}),m.jsxs("span",{className:"sound-volume-value",children:[bS(r.volume),"%"]})]})})]})}const Xl="agent-workbench.notes-open",Gd="agent-workbench.notes-active",Xd="agent-workbench.notes-height",Yl=160,RS=300;function Ql(r){try{return window.localStorage.getItem(r)}catch{return null}}function Do(r,n){try{window.localStorage.setItem(r,n)}catch{}}function MS(r){return r.text.trim().length===0?r.images.length>0?L("notes.imageOnly"):L("notes.untitled"):p_(r)}function AS({notes:r,onSendNote:n,sendTargetCwd:c,fill:y}){const[E,N]=B.useState(()=>Ql(Xl)==="true"),D=E||y,[i,a]=B.useState(()=>{const j=Number.parseInt(Ql(Xd)??"",10);return Number.isFinite(j)?Math.max(j,Yl):RS}),[g,_]=B.useState(()=>Ql(Gd)),[l,v]=B.useState(null),[S,C]=B.useState(null),[f,o]=B.useState(0),u=B.useMemo(()=>r.notes.length===0?null:r.notes.find(j=>j.noteId===g)??r.notes[r.notes.length-1]??null,[r.notes,g]),h=B.useCallback(j=>{_(j),Do(Gd,j),v(null)},[]),d=B.useCallback(()=>{N(j=>{const z=!j;return Do(Xl,String(z)),z})},[]),w=B.useCallback(()=>{const j=r.create();h(j),D||(N(!0),Do(Xl,"true")),o(z=>z+1)},[r,D,h]),R=B.useCallback(j=>{if(j.text.trim().length===0&&j.images.length===0){r.remove(j.noteId);return}h(j.noteId),v(j.noteId)},[r,h]),k=B.useCallback(()=>{l!==null&&r.remove(l),v(null)},[l,r]),A=B.useRef(null),b=B.useCallback(j=>{A.current={startY:j.clientY,startHeight:i},j.currentTarget.setPointerCapture(j.pointerId),j.preventDefault()},[i]),T=B.useCallback(j=>{const z=A.current;if(z===null)return;const Y=Math.max(Yl,Math.floor(window.innerHeight*.8));a(Math.min(Y,Math.max(Yl,z.startHeight+z.startY-j.clientY)))},[]),I=B.useCallback(j=>{A.current!==null&&(A.current=null,j.currentTarget.releasePointerCapture(j.pointerId),Do(Xd,String(i)))},[i]);B.useEffect(()=>{if(S===null)return;const j=z=>{z.key==="Escape"&&(z.stopPropagation(),C(null))};return window.addEventListener("keydown",j,!0),()=>window.removeEventListener("keydown",j,!0)},[S]);const W=S===null?void 0:r.images[S],O=r.notes.length;return m.jsxs("section",{className:`notes${D?" notes-open":""}${y?" notes-fill":""}`,style:D&&!y?{height:`${i}px`}:void 0,children:[D&&!y&&m.jsx("div",{className:"notes-resize",onPointerDown:b,onPointerMove:T,onPointerUp:I,onPointerCancel:I,title:L("notes.resize")}),D?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"notes-header",children:[m.jsxs("div",{className:"strip-tabs",role:"tablist",children:[r.notes.map(j=>{const z=j.noteId===(u==null?void 0:u.noteId),Y=MS(j);return m.jsxs("div",{className:`strip-tab${z?" is-active":""}`,role:"tab","aria-selected":z,children:[m.jsx("button",{className:"strip-tab-label",onClick:()=>h(j.noteId),title:Y,children:Y}),m.jsx("button",{className:"strip-tab-close",onClick:()=>R(j),title:L("notes.closeNote"),children:"×"})]},j.noteId)}),m.jsx("button",{className:"strip-tab-new",onClick:w,title:L("notes.new"),children:"+"})]}),m.jsx("span",{className:"strip-spacer"}),!y&&m.jsx("button",{className:"icon-button",onClick:d,title:L("notes.collapse"),children:"▾"})]}),m.jsx("div",{className:"notes-body",children:O===0||u===null?m.jsx("p",{className:"notes-empty",children:At("notes.empty")}):m.jsx(NS,{note:u,notes:r,closing:l===u.noteId,focusRequest:f,onConfirmClose:k,onCancelClose:()=>v(null),onOpenImage:C,onSend:n===null?null:()=>n(u.noteId),sendTargetCwd:c},u.noteId)})]}):m.jsxs("button",{className:"strip-collapsed",onClick:d,title:L("notes.expand"),children:[m.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),m.jsx("span",{children:L("notes.name")}),O>0&&m.jsx("span",{className:"strip-collapsed-count",children:O})]}),S!==null&&m.jsx("div",{className:"notes-lightbox",onClick:()=>C(null),title:L("notes.lightboxClose"),children:typeof W=="string"?m.jsx("img",{src:W,alt:L("notes.imageAlt")}):m.jsx("span",{className:"notes-lightbox-missing",children:L("notes.imageUnavailable")})})]})}function DS(){return m.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:m.jsx("path",{d:"M20 11.5 11.7 19.8a5 5 0 0 1-7.1-7.1l8.6-8.6a3.4 3.4 0 0 1 4.8 4.8l-8.5 8.5a1.8 1.8 0 0 1-2.5-2.5l7.9-7.9"})})}function IS(){return m.jsxs("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[m.jsx("path",{d:"M21.5 2.5 11 13"}),m.jsx("path",{d:"M21.5 2.5 15 21.5l-4-8.5-8.5-4z"})]})}function NS({note:r,notes:n,closing:c,focusRequest:y,onConfirmClose:E,onCancelClose:N,onOpenImage:D,onSend:i,sendTargetCwd:a}){const g=B.useRef(null),[_,l]=B.useState(!1),v=r.text.trim().length===0&&r.images.length===0;B.useEffect(()=>{var f;y>0&&((f=g.current)==null||f.focus())},[y]);const S=B.useCallback(f=>{const o=Array.from(f).filter(u=>u.type.startsWith("image/"));for(const u of o)n.addImage(r.noteId,u);return o.length>0},[n,r.noteId]),C=B.useCallback(f=>{f.clipboardData!==null&&S(f.clipboardData.files)&&f.preventDefault()},[S]);return m.jsxs("div",{className:`note-editor${_?" note-editor-dragging":""}`,onDragOver:f=>{Array.from(f.dataTransfer.types).includes("Files")&&(f.preventDefault(),l(!0))},onDragLeave:()=>l(!1),onDrop:f=>{f.preventDefault(),l(!1),S(f.dataTransfer.files)},children:[c&&m.jsxs("div",{className:"note-closing",children:[m.jsx("span",{children:L("notes.closeConfirm")}),m.jsx("button",{className:"link-button link-danger",onClick:E,children:L("common.close")}),m.jsx("button",{className:"link-button",onClick:N,children:L("common.cancel")})]}),n.problem!==null&&m.jsxs("div",{className:"composer-problem",children:[m.jsx("span",{children:n.problem}),m.jsx("button",{className:"icon-button",onClick:n.dismissProblem,title:L("common.close"),children:"×"})]}),m.jsx("textarea",{ref:g,className:"note-input",value:r.text,placeholder:L("notes.placeholder"),onChange:f=>n.updateText(r.noteId,f.target.value),onPaste:C,spellCheck:!1}),r.images.length>0&&m.jsx("div",{className:"note-images",children:r.images.map(f=>m.jsx(PS,{image:f,src:n.images[f.imageId],onRequest:n.requestImage,onOpen:()=>D(f.imageId),onRemove:()=>n.removeImage(r.noteId,f.imageId)},f.imageId))}),m.jsxs("div",{className:"note-footer",children:[m.jsx("span",{className:"note-meta",children:pr(r.updatedAt)}),m.jsx("span",{className:"composer-spacer"}),m.jsx("button",{className:"icon-button",onClick:()=>i==null?void 0:i(),disabled:i===null||v,title:Lv(i!==null,a,v),children:m.jsx(IS,{})}),m.jsxs("label",{className:"icon-button note-attach",title:L("notes.attach"),children:[m.jsx(DS,{}),m.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:f=>{f.target.files!==null&&S(f.target.files),f.target.value=""}})]})]})]})}function PS({image:r,src:n,onRequest:c,onOpen:y,onRemove:E}){return B.useEffect(()=>{n===void 0&&c(r.imageId)},[n,r.imageId,c]),m.jsxs("figure",{className:"chip chip-image note-thumb",title:Xt(r.bytes),children:[typeof n=="string"?m.jsx("img",{src:n,alt:L("notes.imageAlt"),onClick:y}):m.jsx("span",{className:"note-thumb-placeholder",children:n===null?L("notes.thumbMissing"):"…"}),m.jsx("button",{className:"chip-remove",onClick:E,title:L("notes.removeImage"),children:"×"})]})}const Jl=new Set;function OS(r){const[n,c]=B.useState(null),[y,E]=B.useState(null),[N,D]=B.useState(Jl),[i,a]=B.useState(null);B.useEffect(()=>{const o=r.onMessage(h=>{switch(h.type){case"vault.status":c(h.status);break;case"vault.exported":D(d=>{if(!d.has(h.projectKey))return d;const w=new Set(d);return w.delete(h.projectKey),w}),a({projectKey:h.projectKey,sessions:h.sessions,at:Date.now()});break;case"error":if(h.code!=="vault-failed")break;E(kt(h.text)),h.detail!==void 0&&console.error("[servidor]",h.detail),D(Jl);break}}),u=r.onReopen(()=>D(Jl));return()=>{o(),u()}},[r]);const g=B.useCallback(()=>{E(null),r.send({type:"vault.measure"})},[r]),_=B.useCallback(o=>{E(null),r.send({type:"vault.enable",enabled:o})},[r]),l=B.useCallback(o=>{E(null),r.send({type:"vault.setDir",pickerId:o})},[r]),v=B.useCallback(o=>{E(null),D(u=>new Set(u).add(o)),r.send({type:"vault.exportProject",projectKey:o})},[r]),S=B.useCallback((o,u)=>{E(null),r.send({type:"vault.openSession",agent:o,sessionId:u})},[r]),C=B.useCallback(()=>{E(null),r.send({type:"vault.reveal"})},[r]),f=B.useCallback(()=>E(null),[]);return{status:n,problem:y,exporting:N,lastExported:i,measure:g,setEnabled:_,chooseDir:l,exportProject:v,openSession:S,reveal:C,dismissProblem:f}}function jS(r){return L("summary.outdatedServer",{server:r,page:hs})}function BS(r){const[n,...c]=r;if(n===void 0||n.missingMessage===null)return null;const y=kt(n.missingMessage);return c.length===0?y:`${y}
|
|
135
|
+
${L("summary.alsoWorksWith",{names:c.map(E=>E.label).join(", ")})}`}function FS(r){const n=r.version??"?";return n.toLowerCase().includes(r.label.toLowerCase())?n:`${r.label} ${n}`}function HS(r,n,c=hs){var D,i;if(n&&c<hs)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:jS(c),environmentNotice:null};if(n&&c>hs)return{cliAvailable:!1,cliVersion:null,cliMissingMessage:L("summary.newerServer",{server:c,page:hs}),environmentNotice:null};const y=r.filter(a=>a.available);let E=null;y.length===1?E=((D=y[0])==null?void 0:D.version)??null:y.length>1&&(E=y.map(FS).join(" · "));const N=n&&y.length===0;return{cliAvailable:!n||y.length>0,cliVersion:E,cliMissingMessage:N?BS(r):null,environmentNotice:((i=r.find(a=>a.environmentNotice!==null))==null?void 0:i.environmentNotice)??null}}function $S(){const r=new URLSearchParams(window.location.search),n=r.get(ec);if(n===null||n.length===0)return null;r.delete(ec);const c=r.toString();return window.history.replaceState(null,"",`${window.location.pathname}${c.length>0?`?${c}`:""}`),n}const Yd=$S(),WS=500,US=8e3;class zS{constructor(){nn(this,"socket",null);nn(this,"status","connecting");nn(this,"attempt",0);nn(this,"closedByUs",!1);nn(this,"hasConnectedOnce",!1);nn(this,"reconnectTimer");nn(this,"messageHandlers",new Set);nn(this,"statusHandlers",new Set);nn(this,"reopenHandlers",new Set);nn(this,"outbox",[])}getStatus(){return this.status}onMessage(n){return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}onStatus(n){return this.statusHandlers.add(n),()=>this.statusHandlers.delete(n)}onReopen(n){return this.reopenHandlers.add(n),()=>this.reopenHandlers.delete(n)}connect(){if(this.socket!==null)return;const n=new URL(E_,window.location.href);n.protocol=window.location.protocol==="https:"?"wss:":"ws:",Yd!==null&&n.searchParams.set(ec,Yd);const c=new WebSocket(n);this.socket=c,c.onopen=()=>{for(this.attempt=0,this.setStatus("open");this.outbox.length>0;){const y=this.outbox.shift();y!==void 0&&c.send(od(y))}if(this.hasConnectedOnce)for(const y of this.reopenHandlers)y();this.hasConnectedOnce=!0},c.onmessage=y=>{const E=A_(y.data);if(E===null){console.warn("[conexion] mensaje del servidor no reconocido");return}for(const N of this.messageHandlers)N(E)},c.onclose=()=>{this.socket=null,!this.closedByUs&&(this.setStatus("reconnecting"),this.scheduleReconnect())},c.onerror=()=>{}}send(n){if(this.socket!==null&&this.socket.readyState===WebSocket.OPEN){this.socket.send(od(n));return}n.type!=="input"&&n.type!=="resize"&&this.outbox.push(n)}close(){var n;this.closedByUs=!0,window.clearTimeout(this.reconnectTimer),(n=this.socket)==null||n.close(),this.socket=null}setStatus(n){if(this.status!==n){this.status=n;for(const c of this.statusHandlers)c(n)}}scheduleReconnect(){if(this.attempt+=1,!this.hasConnectedOnce&&this.attempt>4){this.setStatus("failed");return}const n=Math.min(WS*2**(this.attempt-1),US);window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>this.connect(),n)}}const qS={state:"idle",scannedFiles:0,totalFiles:0};function VS(r,n,c){const y=new Map(c?[]:r.map(E=>[E.key,E]));for(const E of n)y.set(E.key,E);return[...y.values()].sort((E,N)=>N.lastActivityAt-E.lastActivityAt)}function KS(){const r=B.useMemo(()=>new zS,[]),[n,c]=B.useState("connecting"),[y,E]=B.useState([]),[N,D]=B.useState(null),[i,a]=B.useState(!1),[g,_]=B.useState(hs),[l,v]=B.useState(""),[S,C]=B.useState(""),[f,o]=B.useState(null),[u,h]=B.useState([]),[d,w]=B.useState([]),[R,k]=B.useState(qS),[A,b]=B.useState(null),[T,I]=B.useState(new Set),[W,O]=B.useState(new Map),[j,z]=B.useState(new Map),Y=B.useRef(new Map),Z=B.useRef(new Map),[J,K]=B.useState(new Set),[P,$]=B.useState(null),[F,q]=B.useState([]),[ne,re]=B.useState(new Map),[ie,Q]=B.useState([]),V=B.useRef(1),H=B.useRef(new Set),G=B.useRef(new Map),ee=B.useRef(new Map),de=B.useCallback(fe=>{const ze=ee.current.get(fe);ze!==void 0&&(clearTimeout(ze),ee.current.delete(fe)),q(st=>st.some(we=>we.requestId===fe)?st.filter(we=>we.requestId!==fe):st)},[]),ue=B.useCallback(()=>{for(const fe of ee.current.values())clearTimeout(fe);ee.current.clear(),q(fe=>fe.length===0?fe:[])},[]);B.useEffect(()=>{const fe=r.onStatus(we=>{c(we),we==="failed"&&$({message:L("workspace.connectFailed"),at:Date.now()})}),ze=r.onMessage(we=>{switch(we.type){case"agents":E(we.agents),D(we.defaultAgent);break;case"hello":E(we.agents),D(we.defaultAgent),a(!0),_(we.protocolVersion),v(we.platform),C(we.defaultCwd),o(we.shellName);break;case"terminal.list":{h(we.terminals);const Ke=Yv(Z.current,we.terminals),he=Ke.finished.length>0||[...Ke.phases].some(([be,nt])=>Z.current.get(be)!==nt);Z.current=Ke.phases,he&&K(new Set(Ke.phases.keys())),I(be=>{if(be.size===0)return be;const nt=new Set(be);for(const Ne of be){if(Ke.phases.has(Ne))continue;const ct=we.terminals.find(dn=>dn.terminalId===Ne);(ct===void 0||ct.alive)&&nt.delete(Ne)}return nt.size===be.size?be:nt}),z(be=>{if(be.size===0)return be;const nt=new Map([...be].filter(([Ne])=>we.terminals.some(ct=>ct.terminalId===Ne)));return nt.size===be.size?be:(Y.current=nt,nt)});const Oe=we.terminals.filter(be=>be.kind==="agent");b(be=>{var nt;return be!==null&&Oe.some(Ne=>Ne.terminalId===be)?be:((nt=Oe[0])==null?void 0:nt.terminalId)??null}),re(be=>{if(be.size===0)return be;const nt=new Map(be);for(const Ne of be.keys())we.terminals.some(ct=>ct.terminalId===Ne)||nt.delete(Ne);return nt.size===be.size?be:nt});break}case"session.continued":re(Ke=>new Map(Ke).set(we.terminalId,{sourceAgent:we.source.agent,includedTurns:we.includedTurns,totalTurns:we.totalTurns,totalTurnsIsMinimum:we.totalTurnsIsMinimum,delivery:we.delivery,prefillReason:null}));break;case"composer.prefill":{const Ke=V.current;V.current+=1,Q(he=>[...he,{id:Ke,terminalId:we.terminalId,text:we.text}]),re(he=>{const Oe=he.get(we.terminalId);return Oe===void 0?he:new Map(he).set(we.terminalId,{...Oe,delivery:"prefilled",prefillReason:we.reason})});break}case"terminal.opened":{de(we.requestId),H.current.delete(we.requestId)&&we.terminal.kind==="agent"&&b(we.terminal.terminalId);const Ke=G.current.get(we.requestId);Ke!==void 0&&(G.current.delete(we.requestId),Ke(we.terminal));break}case"terminal.activity":O(Ke=>Ke.get(we.terminalId)===we.activity?Ke:new Map(Ke).set(we.terminalId,we.activity)),z(Ke=>{const he=we.offlineReason??null;if((Ke.get(we.terminalId)??null)===he)return Ke;const Oe=new Map(Ke);return he===null?Oe.delete(we.terminalId):Oe.set(we.terminalId,he),Y.current=Oe,Oe});break;case"index.status":k(we.status);break;case"index.projects":w(Ke=>VS(Ke,we.projects,we.replace));break;case"error":if(iS(we.requestId)){we.detail!==void 0&&console.error("[servidor]",we.detail);break}if(we.code==="vault-failed"||we.code==="search-failed")break;$({message:kt(we.text),at:Date.now()}),I(Ke=>Ke.size===0?Ke:new Set),Z.current.size>0&&(Z.current=new Map,K(new Set)),we.detail!==void 0&&console.error("[servidor]",we.detail),we.requestId!==void 0&&(H.current.delete(we.requestId),G.current.delete(we.requestId),de(we.requestId));break}}),st=r.onReopen(()=>{ue(),I(we=>we.size===0?we:new Set),Z.current.size>0&&(Z.current=new Map,K(new Set))});return r.connect(),()=>{fe(),ze(),st(),r.close()}},[r,de,ue]),B.useEffect(()=>ue,[ue]);const Ee=B.useCallback(fe=>{const ze=crypto.randomUUID();H.current.add(ze),fe.onOpened!==void 0&&G.current.set(ze,fe.onOpened),q(we=>[...we,{requestId:ze,cwd:fe.cwd,agent:fe.agent??null,label:fe.label??"",at:Date.now()}]);const st=setTimeout(()=>de(ze),Jv);ee.current.set(ze,st),r.send({type:"terminal.open",requestId:ze,cwd:fe.cwd,...fe.resumeSessionId!==void 0?{resumeSessionId:fe.resumeSessionId}:{},...fe.label!==void 0?{label:fe.label}:{},...fe.agent!==void 0?{agent:fe.agent}:{}})},[r,de]),ke=B.useCallback(fe=>{r.send({type:"terminal.open",requestId:crypto.randomUUID(),cwd:fe,kind:"shell"})},[r]),$e=B.useCallback(fe=>r.send({type:"terminal.close",terminalId:fe}),[r]),Ye=B.useCallback(fe=>{I(ze=>new Set(ze).add(fe)),Y.current.get(fe)==="server-closed"&&(Z.current=new Map(Z.current).set(fe,"waiting-exit"),K(new Set(Z.current.keys()))),r.send({type:"terminal.wake",terminalId:fe})},[r]),Te=B.useCallback((fe,ze)=>r.send({type:"terminal.rename",terminalId:fe,label:ze}),[r]),ot=B.useCallback(fe=>r.send({type:"tabs.reorder",terminalIds:fe}),[r]),Ae=B.useCallback((fe,ze)=>r.send({type:"session.archive",sessionIds:fe,archived:ze}),[r]),De=B.useCallback((fe,ze,st)=>{const we=crypto.randomUUID();H.current.add(we),r.send({type:"session.continue",requestId:we,agent:fe.agent,sessionId:fe.sessionId,target:ze,label:st})},[r]),Ce=B.useCallback(fe=>{re(ze=>{if(!ze.has(fe))return ze;const st=new Map(ze);return st.delete(fe),st})},[]),je=B.useCallback(fe=>{Q(ze=>ze.some(st=>st.id===fe)?ze.filter(st=>st.id!==fe):ze)},[]),_e=B.useCallback(()=>r.send({type:"index.refresh"}),[r]),We=B.useCallback(()=>r.send({type:"agents.refresh"}),[r]),Je=B.useCallback(()=>$(null),[]),Ze=B.useMemo(()=>u.filter(fe=>fe.kind==="agent"),[u]),St=B.useMemo(()=>u.filter(fe=>fe.kind==="shell"),[u]),at=ci(),lt=B.useMemo(()=>HS(y,i,g),[y,i,g,at]),tt=B.useCallback(fe=>{var ze;return(fe===null||(ze=y.find(st=>st.id===fe))==null?void 0:ze.capabilities)??hf},[y]),Ge=B.useMemo(()=>gc(y),[y]);return{connection:r,status:n,agents:y,defaultAgent:N,capabilitiesFor:tt,offerAgentChoice:Ge,cliAvailable:lt.cliAvailable,cliVersion:lt.cliVersion,cliMissingMessage:lt.cliMissingMessage,platform:l,defaultCwd:S,environmentNotice:lt.environmentNotice,shellName:f,terminals:Ze,shells:St,pendingOpens:F,activeTerminalId:A,projects:d,indexStatus:R,error:P,dismissError:Je,setActiveTerminal:b,openTerminal:Ee,openShell:ke,closeTerminal:$e,wakeTerminal:Ye,waking:T,activity:W,offlineReasons:j,relaunching:J,renameTerminal:Te,reorderTabs:ot,refreshIndex:_e,refreshAgents:We,archiveSessions:Ae,continueSession:De,handoffs:ne,dismissHandoff:Ce,prefills:ie,prefillApplied:je}}function GS(){const r=ci(),n=V0(),[c,y]=B.useState(null),E=B.useCallback(()=>y(null),[]),N=B.useRef(null),D=g=>{U0(g).catch(()=>{})},i=[{label:L("header.locale.auto",{name:Il[$0()]}),checked:n==="auto",onSelect:()=>D("auto")},...vc.map(g=>({label:Il[g],lang:g,checked:n===g,onSelect:()=>D(g)}))],a=Il[r];return m.jsxs(m.Fragment,{children:[m.jsx("button",{ref:N,className:"icon-button locale-button",onClick:g=>{const _=g.currentTarget.getBoundingClientRect();y(l=>l===null?{x:_.left,y:_.bottom+4}:null)},title:n==="auto"?L("header.locale.titleAuto",{name:a}):L("header.locale.title",{name:a}),"aria-haspopup":"menu","aria-expanded":c!==null,children:z_[r]}),c!==null&&m.jsx(fc,{x:c.x,y:c.y,items:i,onClose:E,anchor:N.current})]})}function XS({status:r,agents:n,indexReady:c,problem:y,covered:E,onMeasure:N,onSetEnabled:D,onChangeDir:i,onReveal:a,onDismissProblem:g,onClose:_}){return B.useEffect(()=>{if(E)return;const l=v=>{v.key==="Escape"&&(v.preventDefault(),v.stopPropagation(),_())};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[E,_]),m.jsx("div",{className:"modal-backdrop",onClick:_,children:m.jsxs("div",{className:"modal vault-modal",role:"dialog","aria-label":oi(),onClick:l=>l.stopPropagation(),children:[m.jsxs("header",{className:"modal-header",children:[m.jsx("span",{className:"modal-title",children:oi()}),r!==null&&m.jsx("span",{className:`vault-state${r.enabled?" vault-state-on":""}`,children:Zy(r)}),m.jsx("button",{className:"icon-button",onClick:_,title:L("common.closeEsc"),children:"×"})]}),m.jsxs("div",{className:"modal-body",children:[m.jsx("p",{className:"vault-lead",children:Gy()}),m.jsx("p",{className:"modal-hint",children:Xy()}),r===null?m.jsx("p",{className:"modal-hint",children:L("vault.dialog.waiting")}):m.jsx(YS,{status:r,agents:n,indexReady:c,onMeasure:N,onSetEnabled:D,onChangeDir:i,onReveal:a}),y!==null&&m.jsxs("div",{className:"vault-problem",role:"alert",children:[m.jsx("span",{children:y}),m.jsx("button",{className:"icon-button",onClick:g,title:L("common.dismissNotice"),children:"×"})]})]})]})})}function YS({status:r,agents:n,indexReady:c,onMeasure:y,onSetEnabled:E,onChangeDir:N,onReveal:D}){const i=rw(r,c),a=sw(r),g=nw(r),_=r.measurement===null?null:aw(r.measurement,n),l=r.progress;return m.jsxs(m.Fragment,{children:[r.enabled&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"modal-section",children:L("vault.dialog.inFolder")}),m.jsxs("p",{className:"vault-summary",children:[cp(r.sessions)," · ",Xt(r.bytes),r.lastPassAt!==null&&m.jsxs(m.Fragment,{children:[" · ",L("vault.dialog.lastPass",{when:pr(r.lastPassAt)})]}),r.pending>0&&m.jsxs(m.Fragment,{children:[" · ",L("vault.dialog.pendingCalm",{count:r.pending})]})]})]}),l!==null&&l.total>0&&m.jsx("progress",{className:"vault-progress",value:l.done,max:l.total}),m.jsx("h3",{className:"modal-section",children:L("vault.dialog.sizeSection")}),m.jsxs("div",{className:"vault-actions",children:[m.jsx("button",{className:"link-button vault-measure",onClick:y,disabled:i!==null,title:i??L("vault.dialog.measureTitle"),children:r.state==="measuring"?L("vault.state.measuring"):L(_===null?"vault.dialog.measure":"vault.dialog.measureAgain")}),_!==null&&m.jsx("span",{className:"modal-hint",children:_.summary})]}),_!==null&&m.jsx("div",{className:"vault-table-wrap",children:m.jsxs("table",{className:"vault-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"CLI"}),m.jsx("th",{children:L("vault.dialog.table.sessions")}),m.jsx("th",{children:L("vault.dialog.table.size")}),m.jsx("th",{children:L("vault.dialog.table.images")}),m.jsx("th",{title:L("vault.dialog.table.archivedTitle"),children:L("vault.dialog.table.archived")})]})}),m.jsxs("tbody",{children:[_.rows.map(v=>m.jsxs("tr",{children:[m.jsxs("td",{children:[v.label,v.note!==null&&m.jsx("span",{className:"vault-table-note",children:v.note})]}),m.jsx("td",{children:v.sessions}),m.jsx("td",{children:Xt(v.bytes)}),m.jsx("td",{title:v.images>0?Xt(v.imageBytes):void 0,children:v.images}),m.jsx("td",{children:v.skippedArchived})]},v.agent)),m.jsxs("tr",{children:[m.jsx("td",{children:L("vault.dialog.table.memory",{count:_.memoryProjects})}),m.jsx("td",{}),m.jsx("td",{children:Xt(_.memoryBytes)}),m.jsx("td",{}),m.jsx("td",{})]})]}),m.jsx("tfoot",{children:m.jsxs("tr",{children:[m.jsx("td",{children:L("vault.dialog.table.total")}),m.jsx("td",{children:_.total.sessions}),m.jsx("td",{children:Xt(_.total.bytes)}),m.jsx("td",{children:_.total.images}),m.jsx("td",{children:_.total.skippedArchived})]})})]})}),m.jsxs("div",{className:"vault-actions vault-switch",children:[g==="enabled"&&m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"link-button",onClick:()=>E(!1),children:L("vault.dialog.turnOff")}),m.jsx("span",{className:"modal-hint",children:L("vault.dialog.turnOffHint")})]}),(g==="measured"||g==="existing")&&m.jsxs(m.Fragment,{children:[m.jsx("button",{className:"primary-button",onClick:()=>E(!0),title:L(g==="existing"?"vault.dialog.activateExistingTitle":"vault.dialog.activateMeasuredTitle"),children:L("vault.dialog.activate")}),m.jsx("span",{className:"modal-hint",children:L(g==="existing"?"vault.dialog.activateExistingHint":"vault.dialog.activateMeasuredHint")})]}),g==="needs-measure"&&m.jsx("span",{className:"modal-hint",children:L("vault.dialog.needsMeasure",{activate:L("vault.dialog.activate")})})]}),m.jsx("h3",{className:"modal-section",children:L("vault.dialog.folderSection")}),m.jsx("p",{className:"vault-dir",title:r.dir,children:r.dir}),r.isDefaultDir&&m.jsx("p",{className:"modal-hint",children:L("vault.dialog.defaultDir")}),m.jsxs("div",{className:"vault-actions",children:[m.jsx("button",{className:"link-button",onClick:N,disabled:a!==null,title:a??L("vault.dialog.changeDirTitle"),children:L("vault.dialog.changeDir")}),m.jsx("button",{className:"link-button",onClick:D,title:L("vault.dialog.openFolderTitle"),children:L("vault.dialog.openFolder")})]}),r.previousDir!==null&&m.jsx("p",{className:"modal-hint",children:iw(r.previousDir)}),r.lastError!==null&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"modal-section",children:L("vault.dialog.lastError")}),m.jsx("p",{className:"vault-error",children:kt(r.lastError)})]})]})}const QS={connecting:"app.status.connecting",open:"app.status.open",reconnecting:"app.status.reconnecting",failed:"app.status.failed"},Qd=320,JS=1400,ZS=640,Jd=200,Zd=560,eC=270,tC=120,nC=720,rC=260,ef="agent-workbench.panel-width",tf="agent-workbench.panel-visible",nf="agent-workbench.panel-tab",Zl="agent-workbench.panel-expanded",rf="agent-workbench.sidebar-visible",sf="agent-workbench.sidebar-width",of="agent-workbench.console-visible",af="agent-workbench.console-height",lf="agent-workbench.marker-notice-dismissed";function sC(){var Xn,Yn;const r=ci(),n=KS(),{connection:c,status:y,agents:E,defaultAgent:N,capabilitiesFor:D,offerAgentChoice:i,cliAvailable:a,cliVersion:g,cliMissingMessage:_,platform:l,defaultCwd:v,environmentNotice:S,shellName:C,terminals:f,archiveSessions:o,shells:u,pendingOpens:h,activeTerminalId:d,projects:w,indexStatus:R,error:k,dismissError:A,setActiveTerminal:b,openTerminal:T,openShell:I,closeTerminal:W,wakeTerminal:O,waking:j,activity:z,offlineReasons:Y,relaunching:Z,renameTerminal:J,reorderTabs:K,refreshIndex:P,refreshAgents:$,continueSession:F,handoffs:q,dismissHandoff:ne,prefills:re,prefillApplied:ie}=n,Q=mS(),V=kS(z),H=ES(),G=f.find(le=>le.terminalId===d)??null,ee=(G==null?void 0:G.agent)??null,de=D(ee),ue=B.useMemo(()=>sv(de),[de]),Ee=E.find(le=>le.id===ee)??null,ke=B.useMemo(()=>{if(G===null||ee===null)return null;for(const le of w){const Se=le.sessions.find(Qe=>Qe.agent===ee&&Qe.sessionId===G.sessionId);if(Se!==void 0)return On(Se.title,Se.titleSource)}return null},[G,ee,w,r]),$e=(Ee==null?void 0:Ee.statusLine)??null,Ye=(G==null?void 0:G.cwd)??v,Te=B.useMemo(()=>i?Rv(f,Ye,l,E,N):null,[i,f,Ye,l,E,N]),ot=B.useMemo(()=>md(h,Ye,l),[h,Ye,l]),Ae=ot?Nf():null,De=cS(c),Ce=OS(c),[je,_e]=B.useState(!1),We=nS(c),Je=by(E,Ce.status),[Ze,St]=B.useState(null),at=B.useRef(0),lt=B.useCallback(le=>{St(Se=>Se!==null&&Se.seq===le?null:Se)},[]),tt=(le,Se)=>{const Qe=jy(le,{projects:w,terminals:f,platform:l,canResume:Ls=>hd(E,Ls)}),gn=()=>{Se.length!==0&&(at.current+=1,St({query:Se,seq:at.current}))};switch(Qe.kind){case"activate":b(Qe.terminalId),gn();break;case"resume":Qe.session.archived&&o([Qe.session.sessionId],!1),T({cwd:Qe.cwd,resumeSessionId:Qe.session.sessionId,agent:Qe.session.agent,label:On(Qe.session.title,Qe.session.titleSource)}),gn();break;case"copy":Ce.openSession(le.agent,le.sessionId);break}},Ge=B.useMemo(()=>new Set(f.map(le=>le.sessionId).filter(le=>le.length>0)),[f]),[fe,ze]=B.useState(()=>$t(tf,!0,le=>le==="true")),[st,we]=B.useState(()=>$t(nf,"cli",le=>le==="git"||le==="files"||le==="cli"||le==="plans"||le==="memory"?le:le==="conversation"?"cli":null)),[Ke,he]=B.useState(()=>$t(ef,ZS,le=>{const Se=Number.parseInt(le,10);return Number.isFinite(Se)?Math.max(Se,Qd):null})),[Oe,be]=B.useState(()=>$t(Zl,!1,le=>le==="true")),[nt,Ne]=B.useState(()=>$t(rf,!0,le=>le==="true")),[ct,dn]=B.useState(()=>$t(sf,eC,le=>{const Se=Number.parseInt(le,10);return Number.isFinite(Se)?Math.min(Zd,Math.max(Jd,Se)):null})),[kn,En]=B.useState(()=>$t(of,!1,le=>le==="true")),[mr,Or]=B.useState(()=>$t(af,rC,le=>{const Se=Number.parseInt(le,10);return Number.isFinite(Se)?Se:null})),[Ln,ui]=B.useState(()=>$t(lf,!0,le=>le!=="true")),[gr,jr]=B.useState(!1),[_r,vs]=B.useState(!1);B.useEffect(()=>{$e===null&&vs(!1)},[$e]);const[Bn,fn]=B.useState(null),Tn=fe&&G!==null,vr=gv(st,ue.plansAvailable),Gn=G!==null?fe||kn:fe,ys=Oe&&G!==null,rn=B.useMemo(()=>G===null?[]:u.filter(le=>le.cwd===G.cwd),[u,G]),[Fn,ws]=B.useState(null),Br=rn.find(le=>le.terminalId===Fn)??rn[0]??null,Bt=ay(c,d),hi=sS(c,Tn?d:null),di=tS(c,Tn&&vr==="files"?d:null),fi=rS(c,d),pi=lS(c,Tn?d:null),Uo=Tn&&vr==="cli",mi=Bt.usage.lastModel,ft=Bt.usage.lastEffort??((Xn=[...Bt.events].reverse().find(le=>le.effort!==null))==null?void 0:Xn.effort)??null,gi=mi??Bt.defaults.model,Fr=ft??Bt.defaults.effort,_i=mi===null&&gi!==null,Hr=ft===null&&Fr!==null,zo=Zw(c,d,Uo),Ss=d===null?null:z.get(d)??null,yr=qv(de,Bt.openToolCall,(Ee==null?void 0:Ee.label)??null,(G==null?void 0:G.alive)??!1,Ss),Wt=Vv({offlineReason:d===null?null:Y.get(d)??null,alive:(G==null?void 0:G.alive)??!1,relaunching:d!==null&&Z.has(d)}),Cs=Wt===null?null:Kv((Ee==null?void 0:Ee.label)??null),Yt=Cs??yr??Qv(de,Bt.waitingFor,(G==null?void 0:G.alive)??!1),qo=!uf(de,Ss),Vo=B.useMemo(()=>Df(E,ee),[E,ee]),vi=G!==null&&Wv(ee,G.sessionId,de),Qt=d===null?null:q.get(d)??null,$r=Qt===null?null:{text:jv(li(Qt.sourceAgent,E),Qt.includedTurns,Qt.totalTurns,Qt.totalTurnsIsMinimum),status:Qt.prefillReason!==null?Fv(Qt.prefillReason):Qt.delivery==="sending"&&Bt.events.length===0?Bv():null},pn=B.useCallback(()=>{ze(le=>{const Se=!le;return Ot(tf,String(Se)),Se})},[]),wr=B.useCallback(()=>{Ne(le=>{const Se=!le;return Ot(rf,String(Se)),Se})},[]),yi=B.useCallback(()=>{En(le=>{const Se=!le;return Ot(of,String(Se)),Se})},[]),wi=B.useCallback(le=>{we(le),Ot(nf,le)},[]),bs=B.useCallback(()=>{be(le=>{const Se=!le;return Ot(Zl,String(Se)),Se})},[]),Si=B.useCallback(()=>{d!==null&&c.send({type:"input",terminalId:d,data:"\x1B\x1B"})},[c,d]),xs=B.useCallback(le=>{d!==null&&c.send({type:"input",terminalId:d,data:`${le} `})},[c,d]),Sr=B.useCallback(le=>{d!==null&&c.send({type:"agent.submit",terminalId:d,text:le,images:[]})},[c,d]),Ko=B.useCallback(le=>{d!==null&&c.send({type:"files.reveal",terminalId:d,path:le})},[c,d]),Rn=B.useRef(new Set);B.useEffect(()=>{if(!kn){Rn.current.clear();return}if(G===null)return;const{cwd:le}=G;if(u.some(Se=>Se.cwd===le)){Rn.current.delete(le);return}Rn.current.has(le)||(Rn.current.add(le),I(le))},[kn,G,u,I]);const it=B.useCallback(le=>{const Se=rn.find(Qe=>Qe.terminalId===le);Se!==void 0&&Rn.current.delete(Se.cwd),W(le)},[rn,W]),ks=B.useRef(new Set);B.useEffect(()=>{const le=rn.filter(Qe=>!ks.current.has(Qe.terminalId));for(const Qe of rn)ks.current.add(Qe.terminalId);const Se=le[le.length-1];Se!==void 0&&ws(Se.terminalId)},[rn]);const Ci=B.useCallback(()=>{G!==null&&(Rn.current.add(G.cwd),I(G.cwd))},[G,I]),Es=No({min:Qd,max:JS,value:Ke,measure:B.useCallback(le=>window.innerWidth-le.clientX,[]),onChange:he,onCommit:B.useCallback(le=>Ot(ef,String(le)),[]),onStart:B.useCallback(()=>{be(!1),Ot(Zl,"false")},[])}),bi=No({min:Jd,max:Zd,value:ct,measure:B.useCallback(le=>le.clientX,[]),onChange:dn,onCommit:B.useCallback(le=>Ot(sf,String(le)),[])}),xi=No({min:tC,max:nC,value:mr,measure:B.useCallback(le=>window.innerHeight-le.clientY,[]),onChange:Or,onCommit:B.useCallback(le=>Ot(af,String(le)),[])}),ki=B.useCallback(()=>{ui(!1),Ot(lf,"true")},[]),Cr=B.useCallback(le=>{if(f.length===0)return;const Qe=(f.findIndex(Ls=>Ls.terminalId===d)+le+f.length)%f.length,gn=f[Qe];gn!==void 0&&b(gn.terminalId)},[f,d,b]),br=B.useRef(null),sn=B.useRef(null);B.useEffect(()=>{d!==sn.current&&(br.current=sn.current,sn.current=d)},[d]);const mn=B.useCallback(()=>{const le=br.current;le===null||le===d||f.some(Se=>Se.terminalId===le)&&b(le)},[d,f,b]);B.useEffect(()=>{const le=Se=>{if(Se.key!=="Tab"||!Se.shiftKey||Se.altKey||Se.ctrlKey||Se.metaKey)return;const Qe=document.activeElement;Qe instanceof Element&&Qe.closest(".xterm")!==null||(Se.preventDefault(),Se.stopPropagation(),mn())};return window.addEventListener("keydown",le,!0),()=>window.removeEventListener("keydown",le,!0)},[mn]),B.useEffect(()=>{const le=Se=>{if(!Se.altKey||Se.ctrlKey||Se.metaKey)return;const Qe=Se.key.toLowerCase();if(Qe==="t"){a&&v.length>0&&!ot&&(Se.preventDefault(),Se.stopPropagation(),T({cwd:(G==null?void 0:G.cwd)??v}));return}if(Qe==="w"){d!==null&&(Se.preventDefault(),Se.stopPropagation(),W(d));return}if(Qe==="p"){Se.preventDefault(),Se.stopPropagation(),pn();return}if(Qe==="arrowright"||Qe==="pagedown"){Se.preventDefault(),Se.stopPropagation(),Cr(1);return}(Qe==="arrowleft"||Qe==="pageup")&&(Se.preventDefault(),Se.stopPropagation(),Cr(-1))};return window.addEventListener("keydown",le,!0),()=>window.removeEventListener("keydown",le,!0)},[G,d,a,W,Cr,v,ot,T,pn]);const Mn=G===null?L("app.panel.name"):G.label.length>0?G.label:G.cwd.split(/[\\/]/).filter(le=>le.length>0).pop()??G.cwd;return m.jsxs("div",{className:"app",children:[m.jsxs("header",{className:"app-header",children:[m.jsx("span",{className:"app-name",children:"Agent Workbench"}),m.jsx("span",{className:`status status-${y}`,children:L(QS[y])}),G!==null&&m.jsx("span",{className:"meta",title:G.cwd,children:G.cwd}),m.jsx("span",{className:"header-spacer"}),g!==null&&m.jsx("span",{className:"meta meta-dim",children:L("app.header.cliVersion",{version:g})}),m.jsx("button",{className:"icon-button",onClick:Q.cycle,title:hS(Q.preference),children:dS[Q.preference]}),m.jsx(GS,{}),m.jsx(TS,{sound:V}),m.jsx("button",{className:"icon-button",onClick:()=>jr(!0),title:L("app.header.shortcuts"),children:"?"})]}),!a&&_!==null&&m.jsx("div",{className:"banner banner-error banner-lines",children:_}),S==="child-session-marker"&&Ln&&m.jsxs("div",{className:"banner banner-notice",children:[m.jsx("span",{children:At("app.markerNotice",{variable:"CLAUDE_CODE_CHILD_SESSION"})}),m.jsx("button",{className:"banner-close",onClick:ki,title:L("common.gotIt"),children:"×"})]}),k!==null&&m.jsxs("div",{className:"banner banner-error",children:[m.jsx("span",{children:k.message}),m.jsx("button",{className:"banner-close",onClick:A,title:L("common.close"),children:"×"})]}),Ce.problem!==null&&!je&&m.jsxs("div",{className:"banner banner-error",children:[m.jsx("span",{children:Ce.problem}),m.jsx("button",{className:"banner-close",onClick:Ce.dismissProblem,title:L("common.close"),children:"×"})]}),m.jsxs("div",{className:"app-body",children:[!nt&&m.jsxs("button",{className:"panel-peek panel-peek-left",onClick:wr,title:L("app.sidebar.show"),children:[m.jsx("span",{className:"panel-peek-arrow",children:"›"}),m.jsx("span",{className:"panel-peek-label",children:L("app.sidebar.name")})]}),nt&&m.jsx(mw,{projects:w,indexStatus:R,disabled:!a,onOpenProject:(le,Se)=>T({cwd:le,...Se!==void 0?{agent:Se}:{}}),agents:E,offerAgentChoice:i,agentForProject:le=>Mv(f,le,l,E,N),onOpenSession:(le,Se)=>T({cwd:le,resumeSessionId:Se.sessionId,agent:Se.agent,label:On(Se.title,Se.titleSource)}),canResume:le=>hd(E,le),platform:l,onRefresh:P,openSessionIds:Ge,openBlocked:le=>md(h,le,l),onArchive:o,onHide:wr,width:ct,onNewProject:()=>fn("project"),vault:Ce.status,onOpenVault:()=>_e(!0),onOpenVaultSession:le=>Ce.openSession(le.agent,le.sessionId),onExportProject:Ce.exportProject,exporting:Ce.exporting,lastExported:Ce.lastExported,onContinueSession:(le,Se)=>F({agent:le.agent,sessionId:le.sessionId},Se,fd(On(le.title,le.titleSource))),globalSearch:Je?{...We,vaultEnabled:((Yn=Ce.status)==null?void 0:Yn.enabled)===!0}:null,onOpenSearchHit:tt}),nt&&m.jsx("div",{className:"divider",...bi,title:L("app.divider.width")}),m.jsxs("main",{className:`workspace${ys&&Gn?" workspace-narrow":""}`,children:[m.jsx(Jw,{terminals:f,activeTerminalId:d,activity:z,canOpen:a&&v.length>0,onSelect:b,onClose:W,onRename:J,onReorder:K,onNew:le=>T({cwd:Ye,...le!==void 0?{agent:le}:{}}),agents:E,offerAgentChoice:i,newTabAgent:Te,pendingOpens:h,platform:l,newTabBlockedTitle:Ae}),m.jsx("div",{className:"chat-stack",children:f.length===0?m.jsxs("div",{className:"empty-state",children:[m.jsx("p",{children:L("app.empty.noTabs")}),m.jsx("p",{className:"empty-hint",children:L("app.empty.hint")}),a&&v.length>0&&m.jsx("button",{className:"primary-button",onClick:()=>T({cwd:v}),disabled:ot,title:Ae??void 0,children:ot?L("app.empty.opening"):L("app.empty.newSession",{cwd:v})})]}):m.jsx(hy,{view:Bt,threadFont:H,onRewind:ue.rewind?Si:void 0,questionsAnswerable:ue.questionsAnswerable,contextWindowSource:ue.contextWindowSource,instructionsFile:rv(ee),onGoToCli:()=>{Tn||pn(),wi("cli")},cliPresence:G===null||G.alive?"live":G.sleeping?"sleeping":"exited",exitCode:(G==null?void 0:G.exitCode)??null,waking:d!==null&&j.has(d),onWakeCli:()=>{d!==null&&O(d)},discovering:vi,continueTargets:Vo,continueBlockedReason:Ov((G==null?void 0:G.sessionId)??"",vi,Bt.events.length>0),onContinue:G===null||ee===null?void 0:le=>F({agent:ee,sessionId:G.sessionId},le,fd(ke??G.label)),searchRequest:Ze,onSearchRequestApplied:lt,toolCallNotice:yr,serverClosed:Wt===null||Cs===null?null:{state:Wt,text:Cs},statusLineState:($e==null?void 0:$e.state)??null,onConfigureStatusLine:$e===null?void 0:()=>vs(!0)})}),G!==null&&m.jsx(C0,{connection:c,terminalId:d,alive:G.alive,sleeping:G.sleeping,imagesAllowed:ue.imagesAllowed,blockedReason:Yt,prefills:re,onPrefillApplied:ie,notice:$r,onDismissNotice:d===null?void 0:()=>ne(d),onSubmitted:ne,leading:ue.modeCycle===null?void 0:m.jsx(i0,{mode:Bt.permissionMode,cycle:ue.modeCycle,disabled:!G.alive,waitingFor:Bt.waitingFor,statusKnown:qo,onChange:Bt.setPermissionMode}),controls:ue.models===null&&ue.efforts===null?void 0:m.jsx(s0,{models:ue.models,efforts:ue.efforts,model:gi,effort:Fr,modelProvisional:_i,effortProvisional:Hr,savesChoice:nv(ee),disabled:!G.alive,onCommand:Sr})})]}),m.jsxs(m.Fragment,{children:[!Gn&&m.jsxs("button",{className:"panel-peek",onClick:pn,title:L("app.panel.show"),children:[m.jsx("span",{className:"panel-peek-arrow",children:"‹"}),m.jsx("span",{className:"panel-peek-label",children:L("app.panel.name")})]}),Gn&&m.jsx("div",{className:"divider",...Es,title:L("app.divider.width")}),m.jsxs("div",{className:`panel-slot${Gn?"":" panel-slot-collapsed"}${Gn&&ys?" panel-slot-expanded":""}`,style:Gn&&!ys?{width:`${Ke}px`}:void 0,children:[G!==null&&m.jsxs(m.Fragment,{children:[m.jsx(Gw,{tab:vr,plansAvailable:ue.plansAvailable,hidden:!fe,onTabChange:wi,title:Mn,cwd:G.cwd,platform:l,cli:m.jsx("div",{className:"terminal-stack",children:f.map(le=>m.jsx(Wf,{terminalId:le.terminalId,connection:c,active:le.terminalId===d,theme:Q.resolved,autoFocus:!1},le.terminalId))}),cliUnseen:zo,expanded:Oe,onToggleExpanded:bs,git:hi,files:di,plans:fi,memory:pi,onInsert:ue.fileMentions?xs:void 0,onReveal:Ko,onHide:pn}),kn?m.jsxs(m.Fragment,{children:[fe&&m.jsx("div",{className:"hdivider",...xi,title:L("app.divider.consoleHeight")}),m.jsx("div",{className:"console-slot",style:fe?{height:`${mr}px`}:{flex:"1 1 auto"},children:m.jsx(N0,{connection:c,shells:rn,activeShellId:(Br==null?void 0:Br.terminalId)??null,cwd:G.cwd,shellName:C,theme:Q.resolved,onSelect:ws,onOpen:Ci,onCloseShell:it,onCollapse:yi})})]}):m.jsxs("button",{className:"strip-collapsed",onClick:yi,title:C===null?L("console.openAnyIn",{cwd:G.cwd}):L("console.openIn",{shell:C,cwd:G.cwd}),children:[m.jsx("span",{className:"strip-collapsed-arrow",children:"▸"}),m.jsx("span",{children:C??L("console.name")}),rn.length>0&&m.jsx("span",{className:"strip-collapsed-count",children:rn.length})]})]}),m.jsx(AS,{notes:De,fill:G===null,onSendNote:G===null||!ue.noteSendable?null:le=>{const Se=G.cwd;T({cwd:Se,...G.agent!==null?{agent:G.agent}:{},onOpened:Qe=>c.send({type:"notes.send",noteId:le,terminalId:Qe.terminalId})})},sendTargetCwd:(G==null?void 0:G.cwd)??null})]})]})]}),_r&&$e!==null&&Ee!==null&&m.jsx(Uy,{info:$e,agentLabel:Ee.label,onRefresh:$,onClose:()=>vs(!1)}),gr&&m.jsx(Hy,{agent:_v(ee,E,N),onClose:()=>jr(!1)}),Bn==="project"&&m.jsx(jd,{connection:c,title:L("app.picker.project.title"),confirmLabel:L("app.picker.project.confirm"),confirmTitle:le=>L("app.picker.project.confirmTitle",{path:le}),onChoose:(le,Se)=>{fn(null),T({cwd:Se})},onClose:()=>fn(null)}),je&&m.jsx(XS,{status:Ce.status,agents:E,indexReady:R.state==="ready",problem:Ce.problem,covered:Bn==="vault",onMeasure:Ce.measure,onSetEnabled:Ce.setEnabled,onChangeDir:()=>fn("vault"),onReveal:Ce.reveal,onDismissProblem:Ce.dismissProblem,onClose:()=>_e(!1)}),Bn==="vault"&&m.jsx(jd,{connection:c,title:L("app.picker.vault.title"),confirmLabel:L("app.picker.vault.confirm"),confirmTitle:le=>L("app.picker.vault.confirmTitle",{path:le}),onChoose:le=>{Ce.chooseDir(le),fn(null)},onClose:()=>fn(null)})]})}const pp=document.getElementById("root");if(pp===null)throw new Error("Falta el contenedor #root.");const iC=tg.createRoot(pp);W0().then(()=>iC.render(m.jsx(sC,{})));export{Km as g};
|