claude-code-session-manager 0.2.0 → 0.2.1
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/dist/assets/{cssMode-BPFL9Hv1.js → cssMode-DbVwjtsF.js} +1 -1
- package/dist/assets/{editor.main-GK5d7XyY.js → editor.main-BnrhL2Ub.js} +3 -3
- package/dist/assets/{freemarker2-pd6zdJ_t.js → freemarker2-BSEwnssm.js} +1 -1
- package/dist/assets/{handlebars-Cx7E3FW6.js → handlebars-2A6Ao-MM.js} +1 -1
- package/dist/assets/{html-B431RGQC.js → html-D5SHl8IM.js} +1 -1
- package/dist/assets/{htmlMode-Bvb1VcPP.js → htmlMode-BsfbJLaF.js} +1 -1
- package/dist/assets/{index-C20BMlI9.js → index-BQcSEEpz.js} +29 -29
- package/dist/assets/{javascript-CciPHKan.js → javascript-D7ns9sFV.js} +1 -1
- package/dist/assets/{jsonMode-CCfflOHh.js → jsonMode-D8BOjEqQ.js} +1 -1
- package/dist/assets/{liquid-D7ZrreSr.js → liquid-DqFRm1iO.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-B0VCvKFN.js → lspLanguageFeatures-DFWVu75j.js} +1 -1
- package/dist/assets/{mdx-CuDopju5.js → mdx-Brygho1C.js} +1 -1
- package/dist/assets/{python-CUXmbseD.js → python-AViopZds.js} +1 -1
- package/dist/assets/{razor-DrGSFVTF.js → razor-DASVnUhs.js} +1 -1
- package/dist/assets/{tsMode-IQoj5wW-.js → tsMode-C-wV5DBK.js} +1 -1
- package/dist/assets/{typescript-wg4UmFR9.js → typescript-C0eDfVuQ.js} +1 -1
- package/dist/assets/{xml-D9xxVQ4G.js → xml-EMOZDtWW.js} +1 -1
- package/dist/assets/{yaml-BC5fZ7L4.js → yaml-BRUujrQC.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor.main-BnrhL2Ub.js","./editor-BTnBOi8r.css"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Qf=Object.defineProperty;var Yf=(a,p,f)=>p in a?Qf(a,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):a[p]=f;var Oa=(a,p,f)=>Yf(a,typeof p!="symbol"?p+"":p,f);(function(){const p=document.createElement("link").relList;if(p&&p.supports&&p.supports("modulepreload"))return;for(const j of document.querySelectorAll('link[rel="modulepreload"]'))C(j);new MutationObserver(j=>{for(const M of j)if(M.type==="childList")for(const R of M.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&C(R)}).observe(document,{childList:!0,subtree:!0});function f(j){const M={};return j.integrity&&(M.integrity=j.integrity),j.referrerPolicy&&(M.referrerPolicy=j.referrerPolicy),j.crossOrigin==="use-credentials"?M.credentials="include":j.crossOrigin==="anonymous"?M.credentials="omit":M.credentials="same-origin",M}function C(j){if(j.ep)return;j.ep=!0;const M=f(j);fetch(j.href,M)}})();function Td(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Na={exports:{}},hi={},Ia={exports:{}},Ee={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -7,7 +7,7 @@ var Qf=Object.defineProperty;var Yf=(a,p,f)=>p in a?Qf(a,p,{enumerable:!0,config
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Ju;function Zf(){if(Ju)return Ee;Ju=1;var a=Symbol.for("react.element"),p=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),R=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),h=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function n(T,F,ee){this.props=T,this.context=F,this.refs=v,this.updater=ee||S}n.prototype.isReactComponent={},n.prototype.setState=function(T,F){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,F,"setState")},n.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function
|
|
10
|
+
*/var Ju;function Zf(){if(Ju)return Ee;Ju=1;var a=Symbol.for("react.element"),p=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),R=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),h=Symbol.iterator;function y(T){return T===null||typeof T!="object"?null:(T=h&&T[h]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,v={};function n(T,F,ee){this.props=T,this.context=F,this.refs=v,this.updater=ee||S}n.prototype.isReactComponent={},n.prototype.setState=function(T,F){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,F,"setState")},n.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function c(){}c.prototype=n.prototype;function o(T,F,ee){this.props=T,this.context=F,this.refs=v,this.updater=ee||S}var l=o.prototype=new c;l.constructor=o,k(l,n.prototype),l.isPureReactComponent=!0;var w=Array.isArray,L=Object.prototype.hasOwnProperty,E={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function x(T,F,ee){var ne,ce={},de=null,G=null;if(F!=null)for(ne in F.ref!==void 0&&(G=F.ref),F.key!==void 0&&(de=""+F.key),F)L.call(F,ne)&&!D.hasOwnProperty(ne)&&(ce[ne]=F[ne]);var N=arguments.length-2;if(N===1)ce.children=ee;else if(1<N){for(var ie=Array(N),se=0;se<N;se++)ie[se]=arguments[se+2];ce.children=ie}if(T&&T.defaultProps)for(ne in N=T.defaultProps,N)ce[ne]===void 0&&(ce[ne]=N[ne]);return{$$typeof:a,type:T,key:de,ref:G,props:ce,_owner:E.current}}function P(T,F){return{$$typeof:a,type:T.type,key:F,ref:T.ref,props:T.props,_owner:T._owner}}function H(T){return typeof T=="object"&&T!==null&&T.$$typeof===a}function $(T){var F={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ee){return F[ee]})}var W=/\/+/g;function I(T,F){return typeof T=="object"&&T!==null&&T.key!=null?$(""+T.key):F.toString(36)}function X(T,F,ee,ne,ce){var de=typeof T;(de==="undefined"||de==="boolean")&&(T=null);var G=!1;if(T===null)G=!0;else switch(de){case"string":case"number":G=!0;break;case"object":switch(T.$$typeof){case a:case p:G=!0}}if(G)return G=T,ce=ce(G),T=ne===""?"."+I(G,0):ne,w(ce)?(ee="",T!=null&&(ee=T.replace(W,"$&/")+"/"),X(ce,F,ee,"",function(se){return se})):ce!=null&&(H(ce)&&(ce=P(ce,ee+(!ce.key||G&&G.key===ce.key?"":(""+ce.key).replace(W,"$&/")+"/")+T)),F.push(ce)),1;if(G=0,ne=ne===""?".":ne+":",w(T))for(var N=0;N<T.length;N++){de=T[N];var ie=ne+I(de,N);G+=X(de,F,ee,ie,ce)}else if(ie=y(T),typeof ie=="function")for(T=ie.call(T),N=0;!(de=T.next()).done;)de=de.value,ie=ne+I(de,N++),G+=X(de,F,ee,ie,ce);else if(de==="object")throw F=String(T),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return G}function q(T,F,ee){if(T==null)return T;var ne=[],ce=0;return X(T,ne,"","",function(de){return F.call(ee,de,ce++)}),ne}function z(T){if(T._status===-1){var F=T._result;F=F(),F.then(function(ee){(T._status===0||T._status===-1)&&(T._status=1,T._result=ee)},function(ee){(T._status===0||T._status===-1)&&(T._status=2,T._result=ee)}),T._status===-1&&(T._status=0,T._result=F)}if(T._status===1)return T._result.default;throw T._result}var re={current:null},Q={transition:null},A={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:Q,ReactCurrentOwner:E};function B(){throw Error("act(...) is not supported in production builds of React.")}return Ee.Children={map:q,forEach:function(T,F,ee){q(T,function(){F.apply(this,arguments)},ee)},count:function(T){var F=0;return q(T,function(){F++}),F},toArray:function(T){return q(T,function(F){return F})||[]},only:function(T){if(!H(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},Ee.Component=n,Ee.Fragment=f,Ee.Profiler=j,Ee.PureComponent=o,Ee.StrictMode=C,Ee.Suspense=d,Ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=A,Ee.act=B,Ee.cloneElement=function(T,F,ee){if(T==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+T+".");var ne=k({},T.props),ce=T.key,de=T.ref,G=T._owner;if(F!=null){if(F.ref!==void 0&&(de=F.ref,G=E.current),F.key!==void 0&&(ce=""+F.key),T.type&&T.type.defaultProps)var N=T.type.defaultProps;for(ie in F)L.call(F,ie)&&!D.hasOwnProperty(ie)&&(ne[ie]=F[ie]===void 0&&N!==void 0?N[ie]:F[ie])}var ie=arguments.length-2;if(ie===1)ne.children=ee;else if(1<ie){N=Array(ie);for(var se=0;se<ie;se++)N[se]=arguments[se+2];ne.children=N}return{$$typeof:a,type:T.type,key:ce,ref:de,props:ne,_owner:G}},Ee.createContext=function(T){return T={$$typeof:R,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},T.Provider={$$typeof:M,_context:T},T.Consumer=T},Ee.createElement=x,Ee.createFactory=function(T){var F=x.bind(null,T);return F.type=T,F},Ee.createRef=function(){return{current:null}},Ee.forwardRef=function(T){return{$$typeof:i,render:T}},Ee.isValidElement=H,Ee.lazy=function(T){return{$$typeof:_,_payload:{_status:-1,_result:T},_init:z}},Ee.memo=function(T,F){return{$$typeof:m,type:T,compare:F===void 0?null:F}},Ee.startTransition=function(T){var F=Q.transition;Q.transition={};try{T()}finally{Q.transition=F}},Ee.unstable_act=B,Ee.useCallback=function(T,F){return re.current.useCallback(T,F)},Ee.useContext=function(T){return re.current.useContext(T)},Ee.useDebugValue=function(){},Ee.useDeferredValue=function(T){return re.current.useDeferredValue(T)},Ee.useEffect=function(T,F){return re.current.useEffect(T,F)},Ee.useId=function(){return re.current.useId()},Ee.useImperativeHandle=function(T,F,ee){return re.current.useImperativeHandle(T,F,ee)},Ee.useInsertionEffect=function(T,F){return re.current.useInsertionEffect(T,F)},Ee.useLayoutEffect=function(T,F){return re.current.useLayoutEffect(T,F)},Ee.useMemo=function(T,F){return re.current.useMemo(T,F)},Ee.useReducer=function(T,F,ee){return re.current.useReducer(T,F,ee)},Ee.useRef=function(T){return re.current.useRef(T)},Ee.useState=function(T){return re.current.useState(T)},Ee.useSyncExternalStore=function(T,F,ee){return re.current.useSyncExternalStore(T,F,ee)},Ee.useTransition=function(){return re.current.useTransition()},Ee.version="18.3.1",Ee}var Xu;function tl(){return Xu||(Xu=1,Ia.exports=Zf()),Ia.exports}/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react-jsx-runtime.production.min.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@ var Qf=Object.defineProperty;var Yf=(a,p,f)=>p in a?Qf(a,p,{enumerable:!0,config
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Qu;function ep(){if(Qu)return hi;Qu=1;var a=tl(),p=Symbol.for("react.element"),f=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,j=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M={key:!0,ref:!0,__self:!0,__source:!0};function R(i,d,m){var _,h={},y=null,S=null;m!==void 0&&(y=""+m),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(S=d.ref);for(_ in d)C.call(d,_)&&!M.hasOwnProperty(_)&&(h[_]=d[_]);if(i&&i.defaultProps)for(_ in d=i.defaultProps,d)h[_]===void 0&&(h[_]=d[_]);return{$$typeof:p,type:i,key:y,ref:S,props:h,_owner:j.current}}return hi.Fragment=f,hi.jsx=R,hi.jsxs=R,hi}var Yu;function tp(){return Yu||(Yu=1,Na.exports=ep()),Na.exports}var
|
|
18
|
+
*/var Qu;function ep(){if(Qu)return hi;Qu=1;var a=tl(),p=Symbol.for("react.element"),f=Symbol.for("react.fragment"),C=Object.prototype.hasOwnProperty,j=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,M={key:!0,ref:!0,__self:!0,__source:!0};function R(i,d,m){var _,h={},y=null,S=null;m!==void 0&&(y=""+m),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(S=d.ref);for(_ in d)C.call(d,_)&&!M.hasOwnProperty(_)&&(h[_]=d[_]);if(i&&i.defaultProps)for(_ in d=i.defaultProps,d)h[_]===void 0&&(h[_]=d[_]);return{$$typeof:p,type:i,key:y,ref:S,props:h,_owner:j.current}}return hi.Fragment=f,hi.jsx=R,hi.jsxs=R,hi}var Yu;function tp(){return Yu||(Yu=1,Na.exports=ep()),Na.exports}var u=tp(),jn={},Ba={exports:{}},mt={},Fa={exports:{}},Ha={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* scheduler.production.min.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ var Qf=Object.defineProperty;var Yf=(a,p,f)=>p in a?Qf(a,p,{enumerable:!0,config
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Zu;function rp(){return Zu||(Zu=1,(function(a){function p(Q,A){var B=Q.length;Q.push(A);e:for(;0<B;){var T=B-1>>>1,F=Q[T];if(0<j(F,A))Q[T]=A,Q[B]=F,B=T;else break e}}function f(Q){return Q.length===0?null:Q[0]}function C(Q){if(Q.length===0)return null;var A=Q[0],B=Q.pop();if(B!==A){Q[0]=B;e:for(var T=0,F=Q.length,ee=F>>>1;T<ee;){var ne=2*(T+1)-1,ce=Q[ne],de=ne+1,G=Q[de];if(0>j(ce,B))de<F&&0>j(G,ce)?(Q[T]=G,Q[de]=B,T=de):(Q[T]=ce,Q[ne]=B,T=ne);else if(de<F&&0>j(G,B))Q[T]=G,Q[de]=B,T=de;else break e}}return A}function j(Q,A){var B=Q.sortIndex-A.sortIndex;return B!==0?B:Q.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var M=performance;a.unstable_now=function(){return M.now()}}else{var R=Date,i=R.now();a.unstable_now=function(){return R.now()-i}}var d=[],m=[],_=1,h=null,y=3,S=!1,k=!1,v=!1,n=typeof setTimeout=="function"?setTimeout:null,
|
|
26
|
+
*/var Zu;function rp(){return Zu||(Zu=1,(function(a){function p(Q,A){var B=Q.length;Q.push(A);e:for(;0<B;){var T=B-1>>>1,F=Q[T];if(0<j(F,A))Q[T]=A,Q[B]=F,B=T;else break e}}function f(Q){return Q.length===0?null:Q[0]}function C(Q){if(Q.length===0)return null;var A=Q[0],B=Q.pop();if(B!==A){Q[0]=B;e:for(var T=0,F=Q.length,ee=F>>>1;T<ee;){var ne=2*(T+1)-1,ce=Q[ne],de=ne+1,G=Q[de];if(0>j(ce,B))de<F&&0>j(G,ce)?(Q[T]=G,Q[de]=B,T=de):(Q[T]=ce,Q[ne]=B,T=ne);else if(de<F&&0>j(G,B))Q[T]=G,Q[de]=B,T=de;else break e}}return A}function j(Q,A){var B=Q.sortIndex-A.sortIndex;return B!==0?B:Q.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var M=performance;a.unstable_now=function(){return M.now()}}else{var R=Date,i=R.now();a.unstable_now=function(){return R.now()-i}}var d=[],m=[],_=1,h=null,y=3,S=!1,k=!1,v=!1,n=typeof setTimeout=="function"?setTimeout:null,c=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function l(Q){for(var A=f(m);A!==null;){if(A.callback===null)C(m);else if(A.startTime<=Q)C(m),A.sortIndex=A.expirationTime,p(d,A);else break;A=f(m)}}function w(Q){if(v=!1,l(Q),!k)if(f(d)!==null)k=!0,z(L);else{var A=f(m);A!==null&&re(w,A.startTime-Q)}}function L(Q,A){k=!1,v&&(v=!1,c(x),x=-1),S=!0;var B=y;try{for(l(A),h=f(d);h!==null&&(!(h.expirationTime>A)||Q&&!$());){var T=h.callback;if(typeof T=="function"){h.callback=null,y=h.priorityLevel;var F=T(h.expirationTime<=A);A=a.unstable_now(),typeof F=="function"?h.callback=F:h===f(d)&&C(d),l(A)}else C(d);h=f(d)}if(h!==null)var ee=!0;else{var ne=f(m);ne!==null&&re(w,ne.startTime-A),ee=!1}return ee}finally{h=null,y=B,S=!1}}var E=!1,D=null,x=-1,P=5,H=-1;function $(){return!(a.unstable_now()-H<P)}function W(){if(D!==null){var Q=a.unstable_now();H=Q;var A=!0;try{A=D(!0,Q)}finally{A?I():(E=!1,D=null)}}else E=!1}var I;if(typeof o=="function")I=function(){o(W)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,q=X.port2;X.port1.onmessage=W,I=function(){q.postMessage(null)}}else I=function(){n(W,0)};function z(Q){D=Q,E||(E=!0,I())}function re(Q,A){x=n(function(){Q(a.unstable_now())},A)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(Q){Q.callback=null},a.unstable_continueExecution=function(){k||S||(k=!0,z(L))},a.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<Q?Math.floor(1e3/Q):5},a.unstable_getCurrentPriorityLevel=function(){return y},a.unstable_getFirstCallbackNode=function(){return f(d)},a.unstable_next=function(Q){switch(y){case 1:case 2:case 3:var A=3;break;default:A=y}var B=y;y=A;try{return Q()}finally{y=B}},a.unstable_pauseExecution=function(){},a.unstable_requestPaint=function(){},a.unstable_runWithPriority=function(Q,A){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var B=y;y=Q;try{return A()}finally{y=B}},a.unstable_scheduleCallback=function(Q,A,B){var T=a.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?T+B:T):B=T,Q){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=B+F,Q={id:_++,callback:A,priorityLevel:Q,startTime:B,expirationTime:F,sortIndex:-1},B>T?(Q.sortIndex=B,p(m,Q),f(d)===null&&Q===f(m)&&(v?(c(x),x=-1):v=!0,re(w,B-T))):(Q.sortIndex=F,p(d,Q),k||S||(k=!0,z(L))),Q},a.unstable_shouldYield=$,a.unstable_wrapCallback=function(Q){var A=y;return function(){var B=y;y=A;try{return Q.apply(this,arguments)}finally{y=B}}}})(Ha)),Ha}var ed;function sp(){return ed||(ed=1,Fa.exports=rp()),Fa.exports}/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.min.js
|
|
29
29
|
*
|
|
@@ -31,28 +31,28 @@ var Qf=Object.defineProperty;var Yf=(a,p,f)=>p in a?Qf(a,p,{enumerable:!0,config
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var td;function ip(){if(td)return mt;td=1;var a=tl(),p=sp();function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C=new Set,j={};function M(e,t){R(e,t),R(e+"Capture",t)}function R(e,t){for(j[e]=t,e=0;e<t.length;e++)C.add(t[e])}var i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[: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]*$/,_={},h={};function y(e){return d.call(h,e)?!0:d.call(_,e)?!1:m.test(e)?h[e]=!0:(_[e]=!0,!1)}function S(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,r,s){if(t===null||typeof t>"u"||S(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,r,s,g,b,O){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=g,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=b,this.removeEmptyString=O}var n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){n[e]=new v(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];n[t]=new v(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){n[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){n[e]=new v(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){n[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){n[e]=new v(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){n[e]=new v(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){n[e]=new v(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){n[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var
|
|
34
|
+
*/var td;function ip(){if(td)return mt;td=1;var a=tl(),p=sp();function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C=new Set,j={};function M(e,t){R(e,t),R(e+"Capture",t)}function R(e,t){for(j[e]=t,e=0;e<t.length;e++)C.add(t[e])}var i=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[: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]*$/,_={},h={};function y(e){return d.call(h,e)?!0:d.call(_,e)?!1:m.test(e)?h[e]=!0:(_[e]=!0,!1)}function S(e,t,r,s){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,r,s){if(t===null||typeof t>"u"||S(e,t,r,s))return!0;if(s)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,r,s,g,b,O){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=g,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=b,this.removeEmptyString=O}var n={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){n[e]=new v(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];n[t]=new v(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){n[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){n[e]=new v(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){n[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){n[e]=new v(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){n[e]=new v(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){n[e]=new v(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){n[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var c=/[\-:]([a-z])/g;function o(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(c,o);n[t]=new v(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(c,o);n[t]=new v(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(c,o);n[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){n[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),n.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){n[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function l(e,t,r,s){var g=n.hasOwnProperty(t)?n[t]:null;(g!==null?g.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(k(t,r,g,s)&&(r=null),s||g===null?y(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):g.mustUseProperty?e[g.propertyName]=r===null?g.type===3?!1:"":r:(t=g.attributeName,s=g.attributeNamespace,r===null?e.removeAttribute(t):(g=g.type,r=g===3||g===4&&r===!0?"":""+r,s?e.setAttributeNS(s,t,r):e.setAttribute(t,r))))}var w=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),E=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),H=Symbol.for("react.provider"),$=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),Q=Symbol.iterator;function A(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var B=Object.assign,T;function F(e){if(T===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);T=t&&t[1]||""}return`
|
|
35
35
|
`+T+e}var ee=!1;function ne(e,t){if(!e||ee)return"";ee=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(te){var s=te}Reflect.construct(e,[],t)}else{try{t.call()}catch(te){s=te}e.call(t.prototype)}else{try{throw Error()}catch(te){s=te}e()}}catch(te){if(te&&s&&typeof te.stack=="string"){for(var g=te.stack.split(`
|
|
36
36
|
`),b=s.stack.split(`
|
|
37
37
|
`),O=g.length-1,U=b.length-1;1<=O&&0<=U&&g[O]!==b[U];)U--;for(;1<=O&&0<=U;O--,U--)if(g[O]!==b[U]){if(O!==1||U!==1)do if(O--,U--,0>U||g[O]!==b[U]){var V=`
|
|
38
|
-
`+g[O].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=O&&0<=U);break}}}finally{ee=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function ce(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function de(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 D:return"Fragment";case L:return"Portal";case P:return"Profiler";case x:return"StrictMode";case I:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}function G(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 de(t);case 8:return t===x?"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 N(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ie(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function se(e){var t=ie(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var g=r.get,b=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return g.call(this)},set:function(O){s=""+O,b.call(this,O)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(O){s=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fe(e){e._valueTracker||(e._valueTracker=se(e))}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=ie(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function ke(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 Te(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Me(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=N(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qe(e,t){t=t.checked,t!=null&&l(e,"checked",t,!1)}function be(e,t){Qe(e,t);var r=N(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mr(e,t.type,r):t.hasOwnProperty("defaultValue")&&Mr(e,t.type,N(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ar(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Mr(e,t,r){(t!=="number"||ke(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Qt=Array.isArray;function Ut(e,t,r,s){if(e=e.options,t){t={};for(var g=0;g<r.length;g++)t["$"+r[g]]=!0;for(r=0;r<e.length;r++)g=t.hasOwnProperty("$"+e[r].value),e[r].selected!==g&&(e[r].selected=g),g&&s&&(e[r].defaultSelected=!0)}else{for(r=""+N(r),t=null,g=0;g<e.length;g++){if(e[g].value===r){e[g].selected=!0,s&&(e[g].defaultSelected=!0);return}t!==null||e[g].disabled||(t=e[g])}t!==null&&(t.selected=!0)}}function lr(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(f(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nt(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(f(92));if(Qt(r)){if(1<r.length)throw Error(f(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:N(r)}}function cr(e,t){var r=N(t.value),s=N(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function gt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ur(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 Or(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ur(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vt,Nr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,g){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,g)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vt=vt||document.createElement("div"),vt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ct(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var At={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},Oe=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(e){Oe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),At[t]=At[e]})});function wi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||At.hasOwnProperty(e)&&At[e]?(""+t).trim():t+"px"}function dl(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,g=wi(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,g):e[r]=g}}var th=B({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 qn(e,t){if(t){if(th[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(f(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(f(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(f(61))}if(t.style!=null&&typeof t.style!="object")throw Error(f(62))}}function Kn(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 Gn=null;function Jn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xn=null,ts=null,rs=null;function hl(e){if(e=Qs(e)){if(typeof Xn!="function")throw Error(f(280));var t=e.stateNode;t&&(t=Wi(t),Xn(e.stateNode,e.type,t))}}function fl(e){ts?rs?rs.push(e):rs=[e]:ts=e}function pl(){if(ts){var e=ts,t=rs;if(rs=ts=null,hl(e),t)for(e=0;e<t.length;e++)hl(t[e])}}function ml(e,t){return e(t)}function gl(){}var Qn=!1;function vl(e,t,r){if(Qn)return e(t,r);Qn=!0;try{return ml(e,t,r)}finally{Qn=!1,(ts!==null||rs!==null)&&(gl(),pl())}}function Ds(e,t){var r=e.stateNode;if(r===null)return null;var s=Wi(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(f(231,t,typeof r));return r}var Yn=!1;if(i)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){Yn=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{Yn=!1}function rh(e,t,r,s,g,b,O,U,V){var te=Array.prototype.slice.call(arguments,3);try{t.apply(r,te)}catch(ae){this.onError(ae)}}var Ts=!1,Si=null,xi=!1,Zn=null,sh={onError:function(e){Ts=!0,Si=e}};function ih(e,t,r,s,g,b,O,U,V){Ts=!1,Si=null,rh.apply(sh,arguments)}function nh(e,t,r,s,g,b,O,U,V){if(ih.apply(this,arguments),Ts){if(Ts){var te=Si;Ts=!1,Si=null}else throw Error(f(198));xi||(xi=!0,Zn=te)}}function Ir(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function _l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function yl(e){if(Ir(e)!==e)throw Error(f(188))}function oh(e){var t=e.alternate;if(!t){if(t=Ir(e),t===null)throw Error(f(188));return t!==e?null:e}for(var r=e,s=t;;){var g=r.return;if(g===null)break;var b=g.alternate;if(b===null){if(s=g.return,s!==null){r=s;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===r)return yl(g),e;if(b===s)return yl(g),t;b=b.sibling}throw Error(f(188))}if(r.return!==s.return)r=g,s=b;else{for(var O=!1,U=g.child;U;){if(U===r){O=!0,r=g,s=b;break}if(U===s){O=!0,s=g,r=b;break}U=U.sibling}if(!O){for(U=b.child;U;){if(U===r){O=!0,r=b,s=g;break}if(U===s){O=!0,s=b,r=g;break}U=U.sibling}if(!O)throw Error(f(189))}}if(r.alternate!==s)throw Error(f(190))}if(r.tag!==3)throw Error(f(188));return r.stateNode.current===r?e:t}function wl(e){return e=oh(e),e!==null?Sl(e):null}function Sl(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Sl(e);if(t!==null)return t;e=e.sibling}return null}var xl=p.unstable_scheduleCallback,bl=p.unstable_cancelCallback,ah=p.unstable_shouldYield,lh=p.unstable_requestPaint,Ue=p.unstable_now,ch=p.unstable_getCurrentPriorityLevel,eo=p.unstable_ImmediatePriority,Cl=p.unstable_UserBlockingPriority,bi=p.unstable_NormalPriority,uh=p.unstable_LowPriority,kl=p.unstable_IdlePriority,Ci=null,Wt=null;function dh(e){if(Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Ci,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:ph,hh=Math.log,fh=Math.LN2;function ph(e){return e>>>=0,e===0?32:31-(hh(e)/fh|0)|0}var ki=64,Ei=4194304;function As(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 Li(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,g=e.suspendedLanes,b=e.pingedLanes,O=r&268435455;if(O!==0){var U=O&~g;U!==0?s=As(U):(b&=O,b!==0&&(s=As(b)))}else O=r&~g,O!==0?s=As(O):b!==0&&(s=As(b));if(s===0)return 0;if(t!==0&&t!==s&&(t&g)===0&&(g=s&-s,b=t&-t,g>=b||g===16&&(b&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Mt(t),g=1<<r,s|=e[r],t&=~g;return s}function mh(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 gh(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,g=e.expirationTimes,b=e.pendingLanes;0<b;){var O=31-Mt(b),U=1<<O,V=g[O];V===-1?((U&r)===0||(U&s)!==0)&&(g[O]=mh(U,t)):V<=t&&(e.expiredLanes|=U),b&=~U}}function to(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function El(){var e=ki;return ki<<=1,(ki&4194240)===0&&(ki=64),e}function ro(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ms(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=r}function vh(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var g=31-Mt(r),b=1<<g;t[g]=0,s[g]=-1,e[g]=-1,r&=~b}}function so(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Mt(r),g=1<<s;g&t|e[s]&t&&(e[s]|=t),r&=~g}}var De=0;function Ll(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Rl,io,jl,Dl,Pl,no=!1,Ri=[],dr=null,hr=null,fr=null,Os=new Map,Ns=new Map,pr=[],_h="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 Tl(e,t){switch(e){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ns.delete(t.pointerId)}}function Is(e,t,r,s,g,b){return e===null||e.nativeEvent!==b?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:b,targetContainers:[g]},t!==null&&(t=Qs(t),t!==null&&io(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,g!==null&&t.indexOf(g)===-1&&t.push(g),e)}function yh(e,t,r,s,g){switch(t){case"focusin":return dr=Is(dr,e,t,r,s,g),!0;case"dragenter":return hr=Is(hr,e,t,r,s,g),!0;case"mouseover":return fr=Is(fr,e,t,r,s,g),!0;case"pointerover":var b=g.pointerId;return Os.set(b,Is(Os.get(b)||null,e,t,r,s,g)),!0;case"gotpointercapture":return b=g.pointerId,Ns.set(b,Is(Ns.get(b)||null,e,t,r,s,g)),!0}return!1}function Al(e){var t=Br(e.target);if(t!==null){var r=Ir(t);if(r!==null){if(t=r.tag,t===13){if(t=_l(r),t!==null){e.blockedOn=t,Pl(e.priority,function(){jl(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Gn=s,r.target.dispatchEvent(s),Gn=null}else return t=Qs(r),t!==null&&io(t),e.blockedOn=r,!1;t.shift()}return!0}function Ml(e,t,r){ji(e)&&r.delete(t)}function wh(){no=!1,dr!==null&&ji(dr)&&(dr=null),hr!==null&&ji(hr)&&(hr=null),fr!==null&&ji(fr)&&(fr=null),Os.forEach(Ml),Ns.forEach(Ml)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,no||(no=!0,p.unstable_scheduleCallback(p.unstable_NormalPriority,wh)))}function Fs(e){function t(g){return Bs(g,e)}if(0<Ri.length){Bs(Ri[0],e);for(var r=1;r<Ri.length;r++){var s=Ri[r];s.blockedOn===e&&(s.blockedOn=null)}}for(dr!==null&&Bs(dr,e),hr!==null&&Bs(hr,e),fr!==null&&Bs(fr,e),Os.forEach(t),Ns.forEach(t),r=0;r<pr.length;r++)s=pr[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<pr.length&&(r=pr[0],r.blockedOn===null);)Al(r),r.blockedOn===null&&pr.shift()}var ss=w.ReactCurrentBatchConfig,Di=!0;function Sh(e,t,r,s){var g=De,b=ss.transition;ss.transition=null;try{De=1,oo(e,t,r,s)}finally{De=g,ss.transition=b}}function xh(e,t,r,s){var g=De,b=ss.transition;ss.transition=null;try{De=4,oo(e,t,r,s)}finally{De=g,ss.transition=b}}function oo(e,t,r,s){if(Di){var g=ao(e,t,r,s);if(g===null)ko(e,t,s,Pi,r),Tl(e,s);else if(yh(g,e,t,r,s))s.stopPropagation();else if(Tl(e,s),t&4&&-1<_h.indexOf(e)){for(;g!==null;){var b=Qs(g);if(b!==null&&Rl(b),b=ao(e,t,r,s),b===null&&ko(e,t,s,Pi,r),b===g)break;g=b}g!==null&&s.stopPropagation()}else ko(e,t,s,null,r)}}var Pi=null;function ao(e,t,r,s){if(Pi=null,e=Jn(s),e=Br(e),e!==null)if(t=Ir(e),t===null)e=null;else if(r=t.tag,r===13){if(e=_l(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Pi=e,null}function Ol(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(ch()){case eo:return 1;case Cl:return 4;case bi:case uh:return 16;case kl:return 536870912;default:return 16}default:return 16}}var mr=null,lo=null,Ti=null;function Nl(){if(Ti)return Ti;var e,t=lo,r=t.length,s,g="value"in mr?mr.value:mr.textContent,b=g.length;for(e=0;e<r&&t[e]===g[e];e++);var O=r-e;for(s=1;s<=O&&t[r-s]===g[b-s];s++);return Ti=g.slice(e,1<s?1-s:void 0)}function Ai(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 Mi(){return!0}function Il(){return!1}function _t(e){function t(r,s,g,b,O){this._reactName=r,this._targetInst=g,this.type=s,this.nativeEvent=b,this.target=O,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(r=e[U],this[U]=r?r(b):b[U]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Mi:Il,this.isPropagationStopped=Il,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Mi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Mi)},persist:function(){},isPersistent:Mi}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},co=_t(is),Hs=B({},is,{view:0,detail:0}),bh=_t(Hs),uo,ho,$s,Oi=B({},Hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:po,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!==$s&&($s&&e.type==="mousemove"?(uo=e.screenX-$s.screenX,ho=e.screenY-$s.screenY):ho=uo=0,$s=e),uo)},movementY:function(e){return"movementY"in e?e.movementY:ho}}),Bl=_t(Oi),Ch=B({},Oi,{dataTransfer:0}),kh=_t(Ch),Eh=B({},Hs,{relatedTarget:0}),fo=_t(Eh),Lh=B({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),Rh=_t(Lh),jh=B({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dh=_t(jh),Ph=B({},is,{data:0}),Fl=_t(Ph),Th={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={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"},Mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Oh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mh[e])?!!t[e]:!1}function po(){return Oh}var Nh=B({},Hs,{key:function(e){if(e.key){var t=Th[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:po,charCode:function(e){return e.type==="keypress"?Ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ih=_t(Nh),Bh=B({},Oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hl=_t(Bh),Fh=B({},Hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:po}),Hh=_t(Fh),$h=B({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=_t($h),Wh=B({},Oi,{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}),zh=_t(Wh),Vh=[9,13,27,32],mo=i&&"CompositionEvent"in window,Us=null;i&&"documentMode"in document&&(Us=document.documentMode);var qh=i&&"TextEvent"in window&&!Us,$l=i&&(!mo||Us&&8<Us&&11>=Us),Ul=" ",Wl=!1;function zl(e,t){switch(e){case"keyup":return Vh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ns=!1;function Kh(e,t){switch(e){case"compositionend":return Vl(t);case"keypress":return t.which!==32?null:(Wl=!0,Ul);case"textInput":return e=t.data,e===Ul&&Wl?null:e;default:return null}}function Gh(e,t){if(ns)return e==="compositionend"||!mo&&zl(e,t)?(e=Nl(),Ti=lo=mr=null,ns=!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 $l&&t.locale!=="ko"?null:t.data;default:return null}}var Jh={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 ql(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jh[e.type]:t==="textarea"}function Kl(e,t,r,s){fl(s),t=Hi(t,"onChange"),0<t.length&&(r=new co("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Ws=null,zs=null;function Xh(e){dc(e,0)}function Ni(e){var t=us(e);if(he(t))return e}function Qh(e,t){if(e==="change")return t}var Gl=!1;if(i){var go;if(i){var vo="oninput"in document;if(!vo){var Jl=document.createElement("div");Jl.setAttribute("oninput","return;"),vo=typeof Jl.oninput=="function"}go=vo}else go=!1;Gl=go&&(!document.documentMode||9<document.documentMode)}function Xl(){Ws&&(Ws.detachEvent("onpropertychange",Ql),zs=Ws=null)}function Ql(e){if(e.propertyName==="value"&&Ni(zs)){var t=[];Kl(t,zs,e,Jn(e)),vl(Xh,t)}}function Yh(e,t,r){e==="focusin"?(Xl(),Ws=t,zs=r,Ws.attachEvent("onpropertychange",Ql)):e==="focusout"&&Xl()}function Zh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ni(zs)}function ef(e,t){if(e==="click")return Ni(t)}function tf(e,t){if(e==="input"||e==="change")return Ni(t)}function rf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:rf;function Vs(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var g=r[s];if(!d.call(t,g)||!Ot(e[g],t[g]))return!1}return!0}function Yl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zl(e,t){var r=Yl(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yl(r)}}function ec(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ec(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tc(){for(var e=window,t=ke();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ke(e.document)}return t}function _o(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 sf(e){var t=tc(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ec(r.ownerDocument.documentElement,r)){if(s!==null&&_o(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var g=r.textContent.length,b=Math.min(s.start,g);s=s.end===void 0?b:Math.min(s.end,g),!e.extend&&b>s&&(g=s,s=b,b=g),g=Zl(r,b);var O=Zl(r,s);g&&O&&(e.rangeCount!==1||e.anchorNode!==g.node||e.anchorOffset!==g.offset||e.focusNode!==O.node||e.focusOffset!==O.offset)&&(t=t.createRange(),t.setStart(g.node,g.offset),e.removeAllRanges(),b>s?(e.addRange(t),e.extend(O.node,O.offset)):(t.setEnd(O.node,O.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nf=i&&"documentMode"in document&&11>=document.documentMode,os=null,yo=null,qs=null,wo=!1;function rc(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wo||os==null||os!==ke(s)||(s=os,"selectionStart"in s&&_o(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),qs&&Vs(qs,s)||(qs=s,s=Hi(yo,"onSelect"),0<s.length&&(t=new co("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=os)))}function Ii(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var as={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionend:Ii("Transition","TransitionEnd")},So={},sc={};i&&(sc=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function Bi(e){if(So[e])return So[e];if(!as[e])return e;var t=as[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in sc)return So[e]=t[r];return e}var ic=Bi("animationend"),nc=Bi("animationiteration"),oc=Bi("animationstart"),ac=Bi("transitionend"),lc=new Map,cc="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 gr(e,t){lc.set(e,t),M(t,[e])}for(var xo=0;xo<cc.length;xo++){var bo=cc[xo],of=bo.toLowerCase(),af=bo[0].toUpperCase()+bo.slice(1);gr(of,"on"+af)}gr(ic,"onAnimationEnd"),gr(nc,"onAnimationIteration"),gr(oc,"onAnimationStart"),gr("dblclick","onDoubleClick"),gr("focusin","onFocus"),gr("focusout","onBlur"),gr(ac,"onTransitionEnd"),R("onMouseEnter",["mouseout","mouseover"]),R("onMouseLeave",["mouseout","mouseover"]),R("onPointerEnter",["pointerout","pointerover"]),R("onPointerLeave",["pointerout","pointerover"]),M("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),M("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),M("onBeforeInput",["compositionend","keypress","textInput","paste"]),M("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),M("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),M("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),lf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ks));function uc(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,nh(s,t,void 0,e),e.currentTarget=null}function dc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],g=s.event;s=s.listeners;e:{var b=void 0;if(t)for(var O=s.length-1;0<=O;O--){var U=s[O],V=U.instance,te=U.currentTarget;if(U=U.listener,V!==b&&g.isPropagationStopped())break e;uc(g,U,te),b=V}else for(O=0;O<s.length;O++){if(U=s[O],V=U.instance,te=U.currentTarget,U=U.listener,V!==b&&g.isPropagationStopped())break e;uc(g,U,te),b=V}}}if(xi)throw e=Zn,xi=!1,Zn=null,e}function Ne(e,t){var r=t[Po];r===void 0&&(r=t[Po]=new Set);var s=e+"__bubble";r.has(s)||(hc(t,e,2,!1),r.add(s))}function Co(e,t,r){var s=0;t&&(s|=4),hc(r,e,s,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function Gs(e){if(!e[Fi]){e[Fi]=!0,C.forEach(function(r){r!=="selectionchange"&&(lf.has(r)||Co(r,!1,e),Co(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,Co("selectionchange",!1,t))}}function hc(e,t,r,s){switch(Ol(t)){case 1:var g=Sh;break;case 4:g=xh;break;default:g=oo}r=g.bind(null,t,r,e),g=void 0,!Yn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(g=!0),s?g!==void 0?e.addEventListener(t,r,{capture:!0,passive:g}):e.addEventListener(t,r,!0):g!==void 0?e.addEventListener(t,r,{passive:g}):e.addEventListener(t,r,!1)}function ko(e,t,r,s,g){var b=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var O=s.tag;if(O===3||O===4){var U=s.stateNode.containerInfo;if(U===g||U.nodeType===8&&U.parentNode===g)break;if(O===4)for(O=s.return;O!==null;){var V=O.tag;if((V===3||V===4)&&(V=O.stateNode.containerInfo,V===g||V.nodeType===8&&V.parentNode===g))return;O=O.return}for(;U!==null;){if(O=Br(U),O===null)return;if(V=O.tag,V===5||V===6){s=b=O;continue e}U=U.parentNode}}s=s.return}vl(function(){var te=b,ae=Jn(r),le=[];e:{var oe=lc.get(e);if(oe!==void 0){var pe=co,ge=e;switch(e){case"keypress":if(Ai(r)===0)break e;case"keydown":case"keyup":pe=Ih;break;case"focusin":ge="focus",pe=fo;break;case"focusout":ge="blur",pe=fo;break;case"beforeblur":case"afterblur":pe=fo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Bl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=Hh;break;case ic:case nc:case oc:pe=Rh;break;case ac:pe=Uh;break;case"scroll":pe=bh;break;case"wheel":pe=zh;break;case"copy":case"cut":case"paste":pe=Dh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Hl}var ve=(t&4)!==0,We=!ve&&e==="scroll",Y=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var J=te,Z;J!==null;){Z=J;var ue=Z.stateNode;if(Z.tag===5&&ue!==null&&(Z=ue,Y!==null&&(ue=Ds(J,Y),ue!=null&&ve.push(Js(J,ue,Z)))),We)break;J=J.return}0<ve.length&&(oe=new pe(oe,ge,null,r,ae),le.push({event:oe,listeners:ve}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",pe=e==="mouseout"||e==="pointerout",oe&&r!==Gn&&(ge=r.relatedTarget||r.fromElement)&&(Br(ge)||ge[Yt]))break e;if((pe||oe)&&(oe=ae.window===ae?ae:(oe=ae.ownerDocument)?oe.defaultView||oe.parentWindow:window,pe?(ge=r.relatedTarget||r.toElement,pe=te,ge=ge?Br(ge):null,ge!==null&&(We=Ir(ge),ge!==We||ge.tag!==5&&ge.tag!==6)&&(ge=null)):(pe=null,ge=te),pe!==ge)){if(ve=Bl,ue="onMouseLeave",Y="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Hl,ue="onPointerLeave",Y="onPointerEnter",J="pointer"),We=pe==null?oe:us(pe),Z=ge==null?oe:us(ge),oe=new ve(ue,J+"leave",pe,r,ae),oe.target=We,oe.relatedTarget=Z,ue=null,Br(ae)===te&&(ve=new ve(Y,J+"enter",ge,r,ae),ve.target=Z,ve.relatedTarget=We,ue=ve),We=ue,pe&&ge)t:{for(ve=pe,Y=ge,J=0,Z=ve;Z;Z=ls(Z))J++;for(Z=0,ue=Y;ue;ue=ls(ue))Z++;for(;0<J-Z;)ve=ls(ve),J--;for(;0<Z-J;)Y=ls(Y),Z--;for(;J--;){if(ve===Y||Y!==null&&ve===Y.alternate)break t;ve=ls(ve),Y=ls(Y)}ve=null}else ve=null;pe!==null&&fc(le,oe,pe,ve,!1),ge!==null&&We!==null&&fc(le,We,ge,ve,!0)}}e:{if(oe=te?us(te):window,pe=oe.nodeName&&oe.nodeName.toLowerCase(),pe==="select"||pe==="input"&&oe.type==="file")var _e=Qh;else if(ql(oe))if(Gl)_e=tf;else{_e=Zh;var we=Yh}else(pe=oe.nodeName)&&pe.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(_e=ef);if(_e&&(_e=_e(e,te))){Kl(le,_e,r,ae);break e}we&&we(e,oe,te),e==="focusout"&&(we=oe._wrapperState)&&we.controlled&&oe.type==="number"&&Mr(oe,"number",oe.value)}switch(we=te?us(te):window,e){case"focusin":(ql(we)||we.contentEditable==="true")&&(os=we,yo=te,qs=null);break;case"focusout":qs=yo=os=null;break;case"mousedown":wo=!0;break;case"contextmenu":case"mouseup":case"dragend":wo=!1,rc(le,r,ae);break;case"selectionchange":if(nf)break;case"keydown":case"keyup":rc(le,r,ae)}var Se;if(mo)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else ns?zl(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&($l&&r.locale!=="ko"&&(ns||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ns&&(Se=Nl()):(mr=ae,lo="value"in mr?mr.value:mr.textContent,ns=!0)),we=Hi(te,Ce),0<we.length&&(Ce=new Fl(Ce,e,null,r,ae),le.push({event:Ce,listeners:we}),Se?Ce.data=Se:(Se=Vl(r),Se!==null&&(Ce.data=Se)))),(Se=qh?Kh(e,r):Gh(e,r))&&(te=Hi(te,"onBeforeInput"),0<te.length&&(ae=new Fl("onBeforeInput","beforeinput",null,r,ae),le.push({event:ae,listeners:te}),ae.data=Se))}dc(le,t)})}function Js(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Hi(e,t){for(var r=t+"Capture",s=[];e!==null;){var g=e,b=g.stateNode;g.tag===5&&b!==null&&(g=b,b=Ds(e,r),b!=null&&s.unshift(Js(e,b,g)),b=Ds(e,t),b!=null&&s.push(Js(e,b,g))),e=e.return}return s}function ls(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fc(e,t,r,s,g){for(var b=t._reactName,O=[];r!==null&&r!==s;){var U=r,V=U.alternate,te=U.stateNode;if(V!==null&&V===s)break;U.tag===5&&te!==null&&(U=te,g?(V=Ds(r,b),V!=null&&O.unshift(Js(r,V,U))):g||(V=Ds(r,b),V!=null&&O.push(Js(r,V,U)))),r=r.return}O.length!==0&&e.push({event:t,listeners:O})}var cf=/\r\n?/g,uf=/\u0000|\uFFFD/g;function pc(e){return(typeof e=="string"?e:""+e).replace(cf,`
|
|
39
|
-
`).replace(uf,"")}function $i(e,t,r){if(t=pc(t),pc(e)!==t&&r)throw Error(f(425))}function Ui(){}var Eo=null,Lo=null;function Ro(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 jo=typeof setTimeout=="function"?setTimeout:void 0,df=typeof clearTimeout=="function"?clearTimeout:void 0,mc=typeof Promise=="function"?Promise:void 0,hf=typeof queueMicrotask=="function"?queueMicrotask:typeof mc<"u"?function(e){return mc.resolve(null).then(e).catch(ff)}:jo;function ff(e){setTimeout(function(){throw e})}function Do(e,t){var r=t,s=0;do{var g=r.nextSibling;if(e.removeChild(r),g&&g.nodeType===8)if(r=g.data,r==="/$"){if(s===0){e.removeChild(g),Fs(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=g}while(r);Fs(t)}function vr(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 gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var cs=Math.random().toString(36).slice(2),zt="__reactFiber$"+cs,Xs="__reactProps$"+cs,Yt="__reactContainer$"+cs,Po="__reactEvents$"+cs,pf="__reactListeners$"+cs,mf="__reactHandles$"+cs;function Br(e){var t=e[zt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yt]||r[zt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=gc(e);e!==null;){if(r=e[zt])return r;e=gc(e)}return t}e=r,r=e.parentNode}return null}function Qs(e){return e=e[zt]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function us(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(f(33))}function Wi(e){return e[Xs]||null}var To=[],ds=-1;function _r(e){return{current:e}}function Ie(e){0>ds||(e.current=To[ds],To[ds]=null,ds--)}function Ae(e,t){ds++,To[ds]=e.current,e.current=t}var yr={},tt=_r(yr),ut=_r(!1),Fr=yr;function hs(e,t){var r=e.type.contextTypes;if(!r)return yr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in r)g[b]=t[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=g),g}function dt(e){return e=e.childContextTypes,e!=null}function zi(){Ie(ut),Ie(tt)}function vc(e,t,r){if(tt.current!==yr)throw Error(f(168));Ae(tt,t),Ae(ut,r)}function _c(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var g in s)if(!(g in t))throw Error(f(108,G(e)||"Unknown",g));return B({},r,s)}function Vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yr,Fr=tt.current,Ae(tt,e),Ae(ut,ut.current),!0}function yc(e,t,r){var s=e.stateNode;if(!s)throw Error(f(169));r?(e=_c(e,t,Fr),s.__reactInternalMemoizedMergedChildContext=e,Ie(ut),Ie(tt),Ae(tt,e)):Ie(ut),Ae(ut,r)}var Zt=null,qi=!1,Ao=!1;function wc(e){Zt===null?Zt=[e]:Zt.push(e)}function gf(e){qi=!0,wc(e)}function wr(){if(!Ao&&Zt!==null){Ao=!0;var e=0,t=De;try{var r=Zt;for(De=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Zt=null,qi=!1}catch(g){throw Zt!==null&&(Zt=Zt.slice(e+1)),xl(eo,wr),g}finally{De=t,Ao=!1}}return null}var fs=[],ps=0,Ki=null,Gi=0,Ct=[],kt=0,Hr=null,er=1,tr="";function $r(e,t){fs[ps++]=Gi,fs[ps++]=Ki,Ki=e,Gi=t}function Sc(e,t,r){Ct[kt++]=er,Ct[kt++]=tr,Ct[kt++]=Hr,Hr=e;var s=er;e=tr;var g=32-Mt(s)-1;s&=~(1<<g),r+=1;var b=32-Mt(t)+g;if(30<b){var O=g-g%5;b=(s&(1<<O)-1).toString(32),s>>=O,g-=O,er=1<<32-Mt(t)+g|r<<g|s,tr=b+e}else er=1<<b|r<<g|s,tr=e}function Mo(e){e.return!==null&&($r(e,1),Sc(e,1,0))}function Oo(e){for(;e===Ki;)Ki=fs[--ps],fs[ps]=null,Gi=fs[--ps],fs[ps]=null;for(;e===Hr;)Hr=Ct[--kt],Ct[kt]=null,tr=Ct[--kt],Ct[kt]=null,er=Ct[--kt],Ct[kt]=null}var yt=null,wt=null,Be=!1,Nt=null;function xc(e,t){var r=jt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function bc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yt=e,wt=vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yt=e,wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Hr!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=jt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,yt=e,wt=null,!0):!1;default:return!1}}function No(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Io(e){if(Be){var t=wt;if(t){var r=t;if(!bc(e,t)){if(No(e))throw Error(f(418));t=vr(r.nextSibling);var s=yt;t&&bc(e,t)?xc(s,r):(e.flags=e.flags&-4097|2,Be=!1,yt=e)}}else{if(No(e))throw Error(f(418));e.flags=e.flags&-4097|2,Be=!1,yt=e}}}function Cc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yt=e}function Ji(e){if(e!==yt)return!1;if(!Be)return Cc(e),Be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ro(e.type,e.memoizedProps)),t&&(t=wt)){if(No(e))throw kc(),Error(f(418));for(;t;)xc(e,t),t=vr(t.nextSibling)}if(Cc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){wt=vr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}wt=null}}else wt=yt?vr(e.stateNode.nextSibling):null;return!0}function kc(){for(var e=wt;e;)e=vr(e.nextSibling)}function ms(){wt=yt=null,Be=!1}function Bo(e){Nt===null?Nt=[e]:Nt.push(e)}var vf=w.ReactCurrentBatchConfig;function Ys(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(f(309));var s=r.stateNode}if(!s)throw Error(f(147,e));var g=s,b=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===b?t.ref:(t=function(O){var U=g.refs;O===null?delete U[b]:U[b]=O},t._stringRef=b,t)}if(typeof e!="string")throw Error(f(284));if(!r._owner)throw Error(f(290,e))}return e}function Xi(e,t){throw e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ec(e){var t=e._init;return t(e._payload)}function Lc(e){function t(Y,J){if(e){var Z=Y.deletions;Z===null?(Y.deletions=[J],Y.flags|=16):Z.push(J)}}function r(Y,J){if(!e)return null;for(;J!==null;)t(Y,J),J=J.sibling;return null}function s(Y,J){for(Y=new Map;J!==null;)J.key!==null?Y.set(J.key,J):Y.set(J.index,J),J=J.sibling;return Y}function g(Y,J){return Y=Rr(Y,J),Y.index=0,Y.sibling=null,Y}function b(Y,J,Z){return Y.index=Z,e?(Z=Y.alternate,Z!==null?(Z=Z.index,Z<J?(Y.flags|=2,J):Z):(Y.flags|=2,J)):(Y.flags|=1048576,J)}function O(Y){return e&&Y.alternate===null&&(Y.flags|=2),Y}function U(Y,J,Z,ue){return J===null||J.tag!==6?(J=ja(Z,Y.mode,ue),J.return=Y,J):(J=g(J,Z),J.return=Y,J)}function V(Y,J,Z,ue){var _e=Z.type;return _e===D?ae(Y,J,Z.props.children,ue,Z.key):J!==null&&(J.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Ec(_e)===J.type)?(ue=g(J,Z.props),ue.ref=Ys(Y,J,Z),ue.return=Y,ue):(ue=Sn(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Ys(Y,J,Z),ue.return=Y,ue)}function te(Y,J,Z,ue){return J===null||J.tag!==4||J.stateNode.containerInfo!==Z.containerInfo||J.stateNode.implementation!==Z.implementation?(J=Da(Z,Y.mode,ue),J.return=Y,J):(J=g(J,Z.children||[]),J.return=Y,J)}function ae(Y,J,Z,ue,_e){return J===null||J.tag!==7?(J=Jr(Z,Y.mode,ue,_e),J.return=Y,J):(J=g(J,Z),J.return=Y,J)}function le(Y,J,Z){if(typeof J=="string"&&J!==""||typeof J=="number")return J=ja(""+J,Y.mode,Z),J.return=Y,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case E:return Z=Sn(J.type,J.key,J.props,null,Y.mode,Z),Z.ref=Ys(Y,null,J),Z.return=Y,Z;case L:return J=Da(J,Y.mode,Z),J.return=Y,J;case z:var ue=J._init;return le(Y,ue(J._payload),Z)}if(Qt(J)||A(J))return J=Jr(J,Y.mode,Z,null),J.return=Y,J;Xi(Y,J)}return null}function oe(Y,J,Z,ue){var _e=J!==null?J.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return _e!==null?null:U(Y,J,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:return Z.key===_e?V(Y,J,Z,ue):null;case L:return Z.key===_e?te(Y,J,Z,ue):null;case z:return _e=Z._init,oe(Y,J,_e(Z._payload),ue)}if(Qt(Z)||A(Z))return _e!==null?null:ae(Y,J,Z,ue,null);Xi(Y,Z)}return null}function pe(Y,J,Z,ue,_e){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Y=Y.get(Z)||null,U(J,Y,""+ue,_e);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return Y=Y.get(ue.key===null?Z:ue.key)||null,V(J,Y,ue,_e);case L:return Y=Y.get(ue.key===null?Z:ue.key)||null,te(J,Y,ue,_e);case z:var we=ue._init;return pe(Y,J,Z,we(ue._payload),_e)}if(Qt(ue)||A(ue))return Y=Y.get(Z)||null,ae(J,Y,ue,_e,null);Xi(J,ue)}return null}function ge(Y,J,Z,ue){for(var _e=null,we=null,Se=J,Ce=J=0,Xe=null;Se!==null&&Ce<Z.length;Ce++){Se.index>Ce?(Xe=Se,Se=null):Xe=Se.sibling;var je=oe(Y,Se,Z[Ce],ue);if(je===null){Se===null&&(Se=Xe);break}e&&Se&&je.alternate===null&&t(Y,Se),J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je,Se=Xe}if(Ce===Z.length)return r(Y,Se),Be&&$r(Y,Ce),_e;if(Se===null){for(;Ce<Z.length;Ce++)Se=le(Y,Z[Ce],ue),Se!==null&&(J=b(Se,J,Ce),we===null?_e=Se:we.sibling=Se,we=Se);return Be&&$r(Y,Ce),_e}for(Se=s(Y,Se);Ce<Z.length;Ce++)Xe=pe(Se,Y,Ce,Z[Ce],ue),Xe!==null&&(e&&Xe.alternate!==null&&Se.delete(Xe.key===null?Ce:Xe.key),J=b(Xe,J,Ce),we===null?_e=Xe:we.sibling=Xe,we=Xe);return e&&Se.forEach(function(jr){return t(Y,jr)}),Be&&$r(Y,Ce),_e}function ve(Y,J,Z,ue){var _e=A(Z);if(typeof _e!="function")throw Error(f(150));if(Z=_e.call(Z),Z==null)throw Error(f(151));for(var we=_e=null,Se=J,Ce=J=0,Xe=null,je=Z.next();Se!==null&&!je.done;Ce++,je=Z.next()){Se.index>Ce?(Xe=Se,Se=null):Xe=Se.sibling;var jr=oe(Y,Se,je.value,ue);if(jr===null){Se===null&&(Se=Xe);break}e&&Se&&jr.alternate===null&&t(Y,Se),J=b(jr,J,Ce),we===null?_e=jr:we.sibling=jr,we=jr,Se=Xe}if(je.done)return r(Y,Se),Be&&$r(Y,Ce),_e;if(Se===null){for(;!je.done;Ce++,je=Z.next())je=le(Y,je.value,ue),je!==null&&(J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je);return Be&&$r(Y,Ce),_e}for(Se=s(Y,Se);!je.done;Ce++,je=Z.next())je=pe(Se,Y,Ce,je.value,ue),je!==null&&(e&&je.alternate!==null&&Se.delete(je.key===null?Ce:je.key),J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je);return e&&Se.forEach(function(Xf){return t(Y,Xf)}),Be&&$r(Y,Ce),_e}function We(Y,J,Z,ue){if(typeof Z=="object"&&Z!==null&&Z.type===D&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case E:e:{for(var _e=Z.key,we=J;we!==null;){if(we.key===_e){if(_e=Z.type,_e===D){if(we.tag===7){r(Y,we.sibling),J=g(we,Z.props.children),J.return=Y,Y=J;break e}}else if(we.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Ec(_e)===we.type){r(Y,we.sibling),J=g(we,Z.props),J.ref=Ys(Y,we,Z),J.return=Y,Y=J;break e}r(Y,we);break}else t(Y,we);we=we.sibling}Z.type===D?(J=Jr(Z.props.children,Y.mode,ue,Z.key),J.return=Y,Y=J):(ue=Sn(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Ys(Y,J,Z),ue.return=Y,Y=ue)}return O(Y);case L:e:{for(we=Z.key;J!==null;){if(J.key===we)if(J.tag===4&&J.stateNode.containerInfo===Z.containerInfo&&J.stateNode.implementation===Z.implementation){r(Y,J.sibling),J=g(J,Z.children||[]),J.return=Y,Y=J;break e}else{r(Y,J);break}else t(Y,J);J=J.sibling}J=Da(Z,Y.mode,ue),J.return=Y,Y=J}return O(Y);case z:return we=Z._init,We(Y,J,we(Z._payload),ue)}if(Qt(Z))return ge(Y,J,Z,ue);if(A(Z))return ve(Y,J,Z,ue);Xi(Y,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,J!==null&&J.tag===6?(r(Y,J.sibling),J=g(J,Z),J.return=Y,Y=J):(r(Y,J),J=ja(Z,Y.mode,ue),J.return=Y,Y=J),O(Y)):r(Y,J)}return We}var gs=Lc(!0),Rc=Lc(!1),Qi=_r(null),Yi=null,vs=null,Fo=null;function Ho(){Fo=vs=Yi=null}function $o(e){var t=Qi.current;Ie(Qi),e._currentValue=t}function Uo(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function _s(e,t){Yi=e,Fo=vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ht=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Fo!==e)if(e={context:e,memoizedValue:t,next:null},vs===null){if(Yi===null)throw Error(f(308));vs=e,Yi.dependencies={lanes:0,firstContext:e}}else vs=vs.next=e;return t}var Ur=null;function Wo(e){Ur===null?Ur=[e]:Ur.push(e)}function jc(e,t,r,s){var g=t.interleaved;return g===null?(r.next=r,Wo(t)):(r.next=g.next,g.next=r),t.interleaved=r,rr(e,s)}function rr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Sr=!1;function zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dc(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 sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Re&2)!==0){var g=s.pending;return g===null?t.next=t:(t.next=g.next,g.next=t),s.pending=t,rr(e,r)}return g=s.interleaved,g===null?(t.next=t,Wo(s)):(t.next=g.next,g.next=t),s.interleaved=t,rr(e,r)}function Zi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,so(e,r)}}function Pc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var g=null,b=null;if(r=r.firstBaseUpdate,r!==null){do{var O={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};b===null?g=b=O:b=b.next=O,r=r.next}while(r!==null);b===null?g=b=t:b=b.next=t}else g=b=t;r={baseState:s.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function en(e,t,r,s){var g=e.updateQueue;Sr=!1;var b=g.firstBaseUpdate,O=g.lastBaseUpdate,U=g.shared.pending;if(U!==null){g.shared.pending=null;var V=U,te=V.next;V.next=null,O===null?b=te:O.next=te,O=V;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,U=ae.lastBaseUpdate,U!==O&&(U===null?ae.firstBaseUpdate=te:U.next=te,ae.lastBaseUpdate=V))}if(b!==null){var le=g.baseState;O=0,ae=te=V=null,U=b;do{var oe=U.lane,pe=U.eventTime;if((s&oe)===oe){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var ge=e,ve=U;switch(oe=t,pe=r,ve.tag){case 1:if(ge=ve.payload,typeof ge=="function"){le=ge.call(pe,le,oe);break e}le=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ve.payload,oe=typeof ge=="function"?ge.call(pe,le,oe):ge,oe==null)break e;le=B({},le,oe);break e;case 2:Sr=!0}}U.callback!==null&&U.lane!==0&&(e.flags|=64,oe=g.effects,oe===null?g.effects=[U]:oe.push(U))}else pe={eventTime:pe,lane:oe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ae===null?(te=ae=pe,V=le):ae=ae.next=pe,O|=oe;if(U=U.next,U===null){if(U=g.shared.pending,U===null)break;oe=U,U=oe.next,oe.next=null,g.lastBaseUpdate=oe,g.shared.pending=null}}while(!0);if(ae===null&&(V=le),g.baseState=V,g.firstBaseUpdate=te,g.lastBaseUpdate=ae,t=g.shared.interleaved,t!==null){g=t;do O|=g.lane,g=g.next;while(g!==t)}else b===null&&(g.shared.lanes=0);Vr|=O,e.lanes=O,e.memoizedState=le}}function Tc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],g=s.callback;if(g!==null){if(s.callback=null,s=r,typeof g!="function")throw Error(f(191,g));g.call(s)}}}var Zs={},Vt=_r(Zs),ei=_r(Zs),ti=_r(Zs);function Wr(e){if(e===Zs)throw Error(f(174));return e}function Vo(e,t){switch(Ae(ti,t),Ae(ei,e),Ae(Vt,Zs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Or(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Or(t,e)}Ie(Vt),Ae(Vt,t)}function ys(){Ie(Vt),Ie(ei),Ie(ti)}function Ac(e){Wr(ti.current);var t=Wr(Vt.current),r=Or(t,e.type);t!==r&&(Ae(ei,e),Ae(Vt,r))}function qo(e){ei.current===e&&(Ie(Vt),Ie(ei))}var Fe=_r(0);function tn(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ko=[];function Go(){for(var e=0;e<Ko.length;e++)Ko[e]._workInProgressVersionPrimary=null;Ko.length=0}var rn=w.ReactCurrentDispatcher,Jo=w.ReactCurrentBatchConfig,zr=0,He=null,Ve=null,Ge=null,sn=!1,ri=!1,si=0,_f=0;function rt(){throw Error(f(321))}function Xo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ot(e[r],t[r]))return!1;return!0}function Qo(e,t,r,s,g,b){if(zr=b,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rn.current=e===null||e.memoizedState===null?xf:bf,e=r(s,g),ri){b=0;do{if(ri=!1,si=0,25<=b)throw Error(f(301));b+=1,Ge=Ve=null,t.updateQueue=null,rn.current=Cf,e=r(s,g)}while(ri)}if(rn.current=an,t=Ve!==null&&Ve.next!==null,zr=0,Ge=Ve=He=null,sn=!1,t)throw Error(f(300));return e}function Yo(){var e=si!==0;return si=0,e}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Lt(){if(Ve===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ge===null?He.memoizedState:Ge.next;if(t!==null)Ge=t,Ve=e;else{if(e===null)throw Error(f(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function ii(e,t){return typeof t=="function"?t(e):t}function Zo(e){var t=Lt(),r=t.queue;if(r===null)throw Error(f(311));r.lastRenderedReducer=e;var s=Ve,g=s.baseQueue,b=r.pending;if(b!==null){if(g!==null){var O=g.next;g.next=b.next,b.next=O}s.baseQueue=g=b,r.pending=null}if(g!==null){b=g.next,s=s.baseState;var U=O=null,V=null,te=b;do{var ae=te.lane;if((zr&ae)===ae)V!==null&&(V=V.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),s=te.hasEagerState?te.eagerState:e(s,te.action);else{var le={lane:ae,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};V===null?(U=V=le,O=s):V=V.next=le,He.lanes|=ae,Vr|=ae}te=te.next}while(te!==null&&te!==b);V===null?O=s:V.next=U,Ot(s,t.memoizedState)||(ht=!0),t.memoizedState=s,t.baseState=O,t.baseQueue=V,r.lastRenderedState=s}if(e=r.interleaved,e!==null){g=e;do b=g.lane,He.lanes|=b,Vr|=b,g=g.next;while(g!==e)}else g===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ea(e){var t=Lt(),r=t.queue;if(r===null)throw Error(f(311));r.lastRenderedReducer=e;var s=r.dispatch,g=r.pending,b=t.memoizedState;if(g!==null){r.pending=null;var O=g=g.next;do b=e(b,O.action),O=O.next;while(O!==g);Ot(b,t.memoizedState)||(ht=!0),t.memoizedState=b,t.baseQueue===null&&(t.baseState=b),r.lastRenderedState=b}return[b,s]}function Mc(){}function Oc(e,t){var r=He,s=Lt(),g=t(),b=!Ot(s.memoizedState,g);if(b&&(s.memoizedState=g,ht=!0),s=s.queue,ta(Bc.bind(null,r,s,e),[e]),s.getSnapshot!==t||b||Ge!==null&&Ge.memoizedState.tag&1){if(r.flags|=2048,ni(9,Ic.bind(null,r,s,g,t),void 0,null),Je===null)throw Error(f(349));(zr&30)!==0||Nc(r,t,g)}return g}function Nc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Ic(e,t,r,s){t.value=r,t.getSnapshot=s,Fc(t)&&Hc(e)}function Bc(e,t,r){return r(function(){Fc(t)&&Hc(e)})}function Fc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ot(e,r)}catch{return!0}}function Hc(e){var t=rr(e,1);t!==null&&Ht(t,e,1,-1)}function $c(e){var t=qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:e},t.queue=e,e=e.dispatch=Sf.bind(null,He,e),[t.memoizedState,e]}function ni(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Uc(){return Lt().memoizedState}function nn(e,t,r,s){var g=qt();He.flags|=e,g.memoizedState=ni(1|t,r,void 0,s===void 0?null:s)}function on(e,t,r,s){var g=Lt();s=s===void 0?null:s;var b=void 0;if(Ve!==null){var O=Ve.memoizedState;if(b=O.destroy,s!==null&&Xo(s,O.deps)){g.memoizedState=ni(t,r,b,s);return}}He.flags|=e,g.memoizedState=ni(1|t,r,b,s)}function Wc(e,t){return nn(8390656,8,e,t)}function ta(e,t){return on(2048,8,e,t)}function zc(e,t){return on(4,2,e,t)}function Vc(e,t){return on(4,4,e,t)}function qc(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 Kc(e,t,r){return r=r!=null?r.concat([e]):null,on(4,4,qc.bind(null,t,e),r)}function ra(){}function Gc(e,t){var r=Lt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Xo(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function Jc(e,t){var r=Lt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Xo(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Xc(e,t,r){return(zr&21)===0?(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=r):(Ot(r,t)||(r=El(),He.lanes|=r,Vr|=r,e.baseState=!0),t)}function yf(e,t){var r=De;De=r!==0&&4>r?r:4,e(!0);var s=Jo.transition;Jo.transition={};try{e(!1),t()}finally{De=r,Jo.transition=s}}function Qc(){return Lt().memoizedState}function wf(e,t,r){var s=Er(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Yc(e))Zc(t,r);else if(r=jc(e,t,r,s),r!==null){var g=at();Ht(r,e,s,g),eu(r,t,s)}}function Sf(e,t,r){var s=Er(e),g={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Yc(e))Zc(t,g);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=t.lastRenderedReducer,b!==null))try{var O=t.lastRenderedState,U=b(O,r);if(g.hasEagerState=!0,g.eagerState=U,Ot(U,O)){var V=t.interleaved;V===null?(g.next=g,Wo(t)):(g.next=V.next,V.next=g),t.interleaved=g;return}}catch{}finally{}r=jc(e,t,g,s),r!==null&&(g=at(),Ht(r,e,s,g),eu(r,t,s))}}function Yc(e){var t=e.alternate;return e===He||t!==null&&t===He}function Zc(e,t){ri=sn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function eu(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,so(e,r)}}var an={readContext:Et,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},xf={readContext:Et,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Wc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,nn(4194308,4,qc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return nn(4194308,4,e,t)},useInsertionEffect:function(e,t){return nn(4,2,e,t)},useMemo:function(e,t){var r=qt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=qt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=wf.bind(null,He,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:$c,useDebugValue:ra,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=$c(!1),t=e[0];return e=yf.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=He,g=qt();if(Be){if(r===void 0)throw Error(f(407));r=r()}else{if(r=t(),Je===null)throw Error(f(349));(zr&30)!==0||Nc(s,t,r)}g.memoizedState=r;var b={value:r,getSnapshot:t};return g.queue=b,Wc(Bc.bind(null,s,b,e),[e]),s.flags|=2048,ni(9,Ic.bind(null,s,b,r,t),void 0,null),r},useId:function(){var e=qt(),t=Je.identifierPrefix;if(Be){var r=tr,s=er;r=(s&~(1<<32-Mt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=si++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_f++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bf={readContext:Et,useCallback:Gc,useContext:Et,useEffect:ta,useImperativeHandle:Kc,useInsertionEffect:zc,useLayoutEffect:Vc,useMemo:Jc,useReducer:Zo,useRef:Uc,useState:function(){return Zo(ii)},useDebugValue:ra,useDeferredValue:function(e){var t=Lt();return Xc(t,Ve.memoizedState,e)},useTransition:function(){var e=Zo(ii)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Mc,useSyncExternalStore:Oc,useId:Qc,unstable_isNewReconciler:!1},Cf={readContext:Et,useCallback:Gc,useContext:Et,useEffect:ta,useImperativeHandle:Kc,useInsertionEffect:zc,useLayoutEffect:Vc,useMemo:Jc,useReducer:ea,useRef:Uc,useState:function(){return ea(ii)},useDebugValue:ra,useDeferredValue:function(e){var t=Lt();return Ve===null?t.memoizedState=e:Xc(t,Ve.memoizedState,e)},useTransition:function(){var e=ea(ii)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Mc,useSyncExternalStore:Oc,useId:Qc,unstable_isNewReconciler:!1};function It(e,t){if(e&&e.defaultProps){t=B({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function sa(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:B({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ln={isMounted:function(e){return(e=e._reactInternals)?Ir(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=at(),g=Er(e),b=sr(s,g);b.payload=t,r!=null&&(b.callback=r),t=xr(e,b,g),t!==null&&(Ht(t,e,g,s),Zi(t,e,g))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=at(),g=Er(e),b=sr(s,g);b.tag=1,b.payload=t,r!=null&&(b.callback=r),t=xr(e,b,g),t!==null&&(Ht(t,e,g,s),Zi(t,e,g))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=at(),s=Er(e),g=sr(r,s);g.tag=2,t!=null&&(g.callback=t),t=xr(e,g,s),t!==null&&(Ht(t,e,s,r),Zi(t,e,s))}};function tu(e,t,r,s,g,b,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,b,O):t.prototype&&t.prototype.isPureReactComponent?!Vs(r,s)||!Vs(g,b):!0}function ru(e,t,r){var s=!1,g=yr,b=t.contextType;return typeof b=="object"&&b!==null?b=Et(b):(g=dt(t)?Fr:tt.current,s=t.contextTypes,b=(s=s!=null)?hs(e,g):yr),t=new t(r,b),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ln,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=g,e.__reactInternalMemoizedMaskedChildContext=b),t}function su(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&ln.enqueueReplaceState(t,t.state,null)}function ia(e,t,r,s){var g=e.stateNode;g.props=r,g.state=e.memoizedState,g.refs={},zo(e);var b=t.contextType;typeof b=="object"&&b!==null?g.context=Et(b):(b=dt(t)?Fr:tt.current,g.context=hs(e,b)),g.state=e.memoizedState,b=t.getDerivedStateFromProps,typeof b=="function"&&(sa(e,t,b,r),g.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(t=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),t!==g.state&&ln.enqueueReplaceState(g,g.state,null),en(e,r,g,s),g.state=e.memoizedState),typeof g.componentDidMount=="function"&&(e.flags|=4194308)}function ws(e,t){try{var r="",s=t;do r+=ce(s),s=s.return;while(s);var g=r}catch(b){g=`
|
|
38
|
+
`+g[O].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=O&&0<=U);break}}}finally{ee=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?F(e):""}function ce(e){switch(e.tag){case 5:return F(e.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return e=ne(e.type,!1),e;case 11:return e=ne(e.type.render,!1),e;case 1:return e=ne(e.type,!0),e;default:return""}}function de(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 D:return"Fragment";case E:return"Portal";case P:return"Profiler";case x:return"StrictMode";case I:return"Suspense";case X:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $:return(e.displayName||"Context")+".Consumer";case H:return(e._context.displayName||"Context")+".Provider";case W:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return de(e(t))}catch{}}return null}function G(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 de(t);case 8:return t===x?"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 N(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ie(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function se(e){var t=ie(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var g=r.get,b=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return g.call(this)},set:function(O){s=""+O,b.call(this,O)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(O){s=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fe(e){e._valueTracker||(e._valueTracker=se(e))}function he(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),s="";return e&&(s=ie(e)?e.checked?"true":"false":e.value),e=s,e!==r?(t.setValue(e),!0):!1}function ke(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 Te(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Me(e,t){var r=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;r=N(t.value!=null?t.value:r),e._wrapperState={initialChecked:s,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qe(e,t){t=t.checked,t!=null&&l(e,"checked",t,!1)}function be(e,t){Qe(e,t);var r=N(t.value),s=t.type;if(r!=null)s==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mr(e,t.type,r):t.hasOwnProperty("defaultValue")&&Mr(e,t.type,N(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ar(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Mr(e,t,r){(t!=="number"||ke(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Qt=Array.isArray;function Ut(e,t,r,s){if(e=e.options,t){t={};for(var g=0;g<r.length;g++)t["$"+r[g]]=!0;for(r=0;r<e.length;r++)g=t.hasOwnProperty("$"+e[r].value),e[r].selected!==g&&(e[r].selected=g),g&&s&&(e[r].defaultSelected=!0)}else{for(r=""+N(r),t=null,g=0;g<e.length;g++){if(e[g].value===r){e[g].selected=!0,s&&(e[g].defaultSelected=!0);return}t!==null||e[g].disabled||(t=e[g])}t!==null&&(t.selected=!0)}}function lr(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(f(91));return B({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function nt(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(f(92));if(Qt(r)){if(1<r.length)throw Error(f(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:N(r)}}function cr(e,t){var r=N(t.value),s=N(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),s!=null&&(e.defaultValue=""+s)}function gt(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ur(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 Or(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ur(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vt,Nr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,s,g){MSApp.execUnsafeLocalFunction(function(){return e(t,r,s,g)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(vt=vt||document.createElement("div"),vt.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vt.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ct(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var At={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},Oe=["Webkit","ms","Moz","O"];Object.keys(At).forEach(function(e){Oe.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),At[t]=At[e]})});function wi(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||At.hasOwnProperty(e)&&At[e]?(""+t).trim():t+"px"}function dl(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var s=r.indexOf("--")===0,g=wi(r,t[r],s);r==="float"&&(r="cssFloat"),s?e.setProperty(r,g):e[r]=g}}var th=B({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 qn(e,t){if(t){if(th[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(f(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(f(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(f(61))}if(t.style!=null&&typeof t.style!="object")throw Error(f(62))}}function Kn(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 Gn=null;function Jn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xn=null,ts=null,rs=null;function hl(e){if(e=Qs(e)){if(typeof Xn!="function")throw Error(f(280));var t=e.stateNode;t&&(t=Wi(t),Xn(e.stateNode,e.type,t))}}function fl(e){ts?rs?rs.push(e):rs=[e]:ts=e}function pl(){if(ts){var e=ts,t=rs;if(rs=ts=null,hl(e),t)for(e=0;e<t.length;e++)hl(t[e])}}function ml(e,t){return e(t)}function gl(){}var Qn=!1;function vl(e,t,r){if(Qn)return e(t,r);Qn=!0;try{return ml(e,t,r)}finally{Qn=!1,(ts!==null||rs!==null)&&(gl(),pl())}}function Ds(e,t){var r=e.stateNode;if(r===null)return null;var s=Wi(r);if(s===null)return null;r=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(f(231,t,typeof r));return r}var Yn=!1;if(i)try{var Ps={};Object.defineProperty(Ps,"passive",{get:function(){Yn=!0}}),window.addEventListener("test",Ps,Ps),window.removeEventListener("test",Ps,Ps)}catch{Yn=!1}function rh(e,t,r,s,g,b,O,U,V){var te=Array.prototype.slice.call(arguments,3);try{t.apply(r,te)}catch(ae){this.onError(ae)}}var Ts=!1,Si=null,xi=!1,Zn=null,sh={onError:function(e){Ts=!0,Si=e}};function ih(e,t,r,s,g,b,O,U,V){Ts=!1,Si=null,rh.apply(sh,arguments)}function nh(e,t,r,s,g,b,O,U,V){if(ih.apply(this,arguments),Ts){if(Ts){var te=Si;Ts=!1,Si=null}else throw Error(f(198));xi||(xi=!0,Zn=te)}}function Ir(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function _l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function yl(e){if(Ir(e)!==e)throw Error(f(188))}function oh(e){var t=e.alternate;if(!t){if(t=Ir(e),t===null)throw Error(f(188));return t!==e?null:e}for(var r=e,s=t;;){var g=r.return;if(g===null)break;var b=g.alternate;if(b===null){if(s=g.return,s!==null){r=s;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===r)return yl(g),e;if(b===s)return yl(g),t;b=b.sibling}throw Error(f(188))}if(r.return!==s.return)r=g,s=b;else{for(var O=!1,U=g.child;U;){if(U===r){O=!0,r=g,s=b;break}if(U===s){O=!0,s=g,r=b;break}U=U.sibling}if(!O){for(U=b.child;U;){if(U===r){O=!0,r=b,s=g;break}if(U===s){O=!0,s=b,r=g;break}U=U.sibling}if(!O)throw Error(f(189))}}if(r.alternate!==s)throw Error(f(190))}if(r.tag!==3)throw Error(f(188));return r.stateNode.current===r?e:t}function wl(e){return e=oh(e),e!==null?Sl(e):null}function Sl(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Sl(e);if(t!==null)return t;e=e.sibling}return null}var xl=p.unstable_scheduleCallback,bl=p.unstable_cancelCallback,ah=p.unstable_shouldYield,lh=p.unstable_requestPaint,Ue=p.unstable_now,ch=p.unstable_getCurrentPriorityLevel,eo=p.unstable_ImmediatePriority,Cl=p.unstable_UserBlockingPriority,bi=p.unstable_NormalPriority,uh=p.unstable_LowPriority,kl=p.unstable_IdlePriority,Ci=null,Wt=null;function dh(e){if(Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Ci,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:ph,hh=Math.log,fh=Math.LN2;function ph(e){return e>>>=0,e===0?32:31-(hh(e)/fh|0)|0}var ki=64,Ei=4194304;function As(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 Li(e,t){var r=e.pendingLanes;if(r===0)return 0;var s=0,g=e.suspendedLanes,b=e.pingedLanes,O=r&268435455;if(O!==0){var U=O&~g;U!==0?s=As(U):(b&=O,b!==0&&(s=As(b)))}else O=r&~g,O!==0?s=As(O):b!==0&&(s=As(b));if(s===0)return 0;if(t!==0&&t!==s&&(t&g)===0&&(g=s&-s,b=t&-t,g>=b||g===16&&(b&4194240)!==0))return t;if((s&4)!==0&&(s|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)r=31-Mt(t),g=1<<r,s|=e[r],t&=~g;return s}function mh(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 gh(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,g=e.expirationTimes,b=e.pendingLanes;0<b;){var O=31-Mt(b),U=1<<O,V=g[O];V===-1?((U&r)===0||(U&s)!==0)&&(g[O]=mh(U,t)):V<=t&&(e.expiredLanes|=U),b&=~U}}function to(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function El(){var e=ki;return ki<<=1,(ki&4194240)===0&&(ki=64),e}function ro(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ms(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=r}function vh(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var s=e.eventTimes;for(e=e.expirationTimes;0<r;){var g=31-Mt(r),b=1<<g;t[g]=0,s[g]=-1,e[g]=-1,r&=~b}}function so(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var s=31-Mt(r),g=1<<s;g&t|e[s]&t&&(e[s]|=t),r&=~g}}var De=0;function Ll(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Rl,io,jl,Dl,Pl,no=!1,Ri=[],dr=null,hr=null,fr=null,Os=new Map,Ns=new Map,pr=[],_h="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 Tl(e,t){switch(e){case"focusin":case"focusout":dr=null;break;case"dragenter":case"dragleave":hr=null;break;case"mouseover":case"mouseout":fr=null;break;case"pointerover":case"pointerout":Os.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ns.delete(t.pointerId)}}function Is(e,t,r,s,g,b){return e===null||e.nativeEvent!==b?(e={blockedOn:t,domEventName:r,eventSystemFlags:s,nativeEvent:b,targetContainers:[g]},t!==null&&(t=Qs(t),t!==null&&io(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,g!==null&&t.indexOf(g)===-1&&t.push(g),e)}function yh(e,t,r,s,g){switch(t){case"focusin":return dr=Is(dr,e,t,r,s,g),!0;case"dragenter":return hr=Is(hr,e,t,r,s,g),!0;case"mouseover":return fr=Is(fr,e,t,r,s,g),!0;case"pointerover":var b=g.pointerId;return Os.set(b,Is(Os.get(b)||null,e,t,r,s,g)),!0;case"gotpointercapture":return b=g.pointerId,Ns.set(b,Is(Ns.get(b)||null,e,t,r,s,g)),!0}return!1}function Al(e){var t=Br(e.target);if(t!==null){var r=Ir(t);if(r!==null){if(t=r.tag,t===13){if(t=_l(r),t!==null){e.blockedOn=t,Pl(e.priority,function(){jl(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ji(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var s=new r.constructor(r.type,r);Gn=s,r.target.dispatchEvent(s),Gn=null}else return t=Qs(r),t!==null&&io(t),e.blockedOn=r,!1;t.shift()}return!0}function Ml(e,t,r){ji(e)&&r.delete(t)}function wh(){no=!1,dr!==null&&ji(dr)&&(dr=null),hr!==null&&ji(hr)&&(hr=null),fr!==null&&ji(fr)&&(fr=null),Os.forEach(Ml),Ns.forEach(Ml)}function Bs(e,t){e.blockedOn===t&&(e.blockedOn=null,no||(no=!0,p.unstable_scheduleCallback(p.unstable_NormalPriority,wh)))}function Fs(e){function t(g){return Bs(g,e)}if(0<Ri.length){Bs(Ri[0],e);for(var r=1;r<Ri.length;r++){var s=Ri[r];s.blockedOn===e&&(s.blockedOn=null)}}for(dr!==null&&Bs(dr,e),hr!==null&&Bs(hr,e),fr!==null&&Bs(fr,e),Os.forEach(t),Ns.forEach(t),r=0;r<pr.length;r++)s=pr[r],s.blockedOn===e&&(s.blockedOn=null);for(;0<pr.length&&(r=pr[0],r.blockedOn===null);)Al(r),r.blockedOn===null&&pr.shift()}var ss=w.ReactCurrentBatchConfig,Di=!0;function Sh(e,t,r,s){var g=De,b=ss.transition;ss.transition=null;try{De=1,oo(e,t,r,s)}finally{De=g,ss.transition=b}}function xh(e,t,r,s){var g=De,b=ss.transition;ss.transition=null;try{De=4,oo(e,t,r,s)}finally{De=g,ss.transition=b}}function oo(e,t,r,s){if(Di){var g=ao(e,t,r,s);if(g===null)ko(e,t,s,Pi,r),Tl(e,s);else if(yh(g,e,t,r,s))s.stopPropagation();else if(Tl(e,s),t&4&&-1<_h.indexOf(e)){for(;g!==null;){var b=Qs(g);if(b!==null&&Rl(b),b=ao(e,t,r,s),b===null&&ko(e,t,s,Pi,r),b===g)break;g=b}g!==null&&s.stopPropagation()}else ko(e,t,s,null,r)}}var Pi=null;function ao(e,t,r,s){if(Pi=null,e=Jn(s),e=Br(e),e!==null)if(t=Ir(e),t===null)e=null;else if(r=t.tag,r===13){if(e=_l(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Pi=e,null}function Ol(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(ch()){case eo:return 1;case Cl:return 4;case bi:case uh:return 16;case kl:return 536870912;default:return 16}default:return 16}}var mr=null,lo=null,Ti=null;function Nl(){if(Ti)return Ti;var e,t=lo,r=t.length,s,g="value"in mr?mr.value:mr.textContent,b=g.length;for(e=0;e<r&&t[e]===g[e];e++);var O=r-e;for(s=1;s<=O&&t[r-s]===g[b-s];s++);return Ti=g.slice(e,1<s?1-s:void 0)}function Ai(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 Mi(){return!0}function Il(){return!1}function _t(e){function t(r,s,g,b,O){this._reactName=r,this._targetInst=g,this.type=s,this.nativeEvent=b,this.target=O,this.currentTarget=null;for(var U in e)e.hasOwnProperty(U)&&(r=e[U],this[U]=r?r(b):b[U]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Mi:Il,this.isPropagationStopped=Il,this}return B(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Mi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Mi)},persist:function(){},isPersistent:Mi}),t}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},co=_t(is),Hs=B({},is,{view:0,detail:0}),bh=_t(Hs),uo,ho,$s,Oi=B({},Hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:po,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!==$s&&($s&&e.type==="mousemove"?(uo=e.screenX-$s.screenX,ho=e.screenY-$s.screenY):ho=uo=0,$s=e),uo)},movementY:function(e){return"movementY"in e?e.movementY:ho}}),Bl=_t(Oi),Ch=B({},Oi,{dataTransfer:0}),kh=_t(Ch),Eh=B({},Hs,{relatedTarget:0}),fo=_t(Eh),Lh=B({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),Rh=_t(Lh),jh=B({},is,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dh=_t(jh),Ph=B({},is,{data:0}),Fl=_t(Ph),Th={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ah={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"},Mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Oh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mh[e])?!!t[e]:!1}function po(){return Oh}var Nh=B({},Hs,{key:function(e){if(e.key){var t=Th[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ah[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:po,charCode:function(e){return e.type==="keypress"?Ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ih=_t(Nh),Bh=B({},Oi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hl=_t(Bh),Fh=B({},Hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:po}),Hh=_t(Fh),$h=B({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),Uh=_t($h),Wh=B({},Oi,{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}),zh=_t(Wh),Vh=[9,13,27,32],mo=i&&"CompositionEvent"in window,Us=null;i&&"documentMode"in document&&(Us=document.documentMode);var qh=i&&"TextEvent"in window&&!Us,$l=i&&(!mo||Us&&8<Us&&11>=Us),Ul=" ",Wl=!1;function zl(e,t){switch(e){case"keyup":return Vh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ns=!1;function Kh(e,t){switch(e){case"compositionend":return Vl(t);case"keypress":return t.which!==32?null:(Wl=!0,Ul);case"textInput":return e=t.data,e===Ul&&Wl?null:e;default:return null}}function Gh(e,t){if(ns)return e==="compositionend"||!mo&&zl(e,t)?(e=Nl(),Ti=lo=mr=null,ns=!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 $l&&t.locale!=="ko"?null:t.data;default:return null}}var Jh={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 ql(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jh[e.type]:t==="textarea"}function Kl(e,t,r,s){fl(s),t=Hi(t,"onChange"),0<t.length&&(r=new co("onChange","change",null,r,s),e.push({event:r,listeners:t}))}var Ws=null,zs=null;function Xh(e){dc(e,0)}function Ni(e){var t=us(e);if(he(t))return e}function Qh(e,t){if(e==="change")return t}var Gl=!1;if(i){var go;if(i){var vo="oninput"in document;if(!vo){var Jl=document.createElement("div");Jl.setAttribute("oninput","return;"),vo=typeof Jl.oninput=="function"}go=vo}else go=!1;Gl=go&&(!document.documentMode||9<document.documentMode)}function Xl(){Ws&&(Ws.detachEvent("onpropertychange",Ql),zs=Ws=null)}function Ql(e){if(e.propertyName==="value"&&Ni(zs)){var t=[];Kl(t,zs,e,Jn(e)),vl(Xh,t)}}function Yh(e,t,r){e==="focusin"?(Xl(),Ws=t,zs=r,Ws.attachEvent("onpropertychange",Ql)):e==="focusout"&&Xl()}function Zh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ni(zs)}function ef(e,t){if(e==="click")return Ni(t)}function tf(e,t){if(e==="input"||e==="change")return Ni(t)}function rf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ot=typeof Object.is=="function"?Object.is:rf;function Vs(e,t){if(Ot(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(s=0;s<r.length;s++){var g=r[s];if(!d.call(t,g)||!Ot(e[g],t[g]))return!1}return!0}function Yl(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zl(e,t){var r=Yl(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yl(r)}}function ec(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ec(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tc(){for(var e=window,t=ke();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ke(e.document)}return t}function _o(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 sf(e){var t=tc(),r=e.focusedElem,s=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ec(r.ownerDocument.documentElement,r)){if(s!==null&&_o(r)){if(t=s.start,e=s.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var g=r.textContent.length,b=Math.min(s.start,g);s=s.end===void 0?b:Math.min(s.end,g),!e.extend&&b>s&&(g=s,s=b,b=g),g=Zl(r,b);var O=Zl(r,s);g&&O&&(e.rangeCount!==1||e.anchorNode!==g.node||e.anchorOffset!==g.offset||e.focusNode!==O.node||e.focusOffset!==O.offset)&&(t=t.createRange(),t.setStart(g.node,g.offset),e.removeAllRanges(),b>s?(e.addRange(t),e.extend(O.node,O.offset)):(t.setEnd(O.node,O.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var nf=i&&"documentMode"in document&&11>=document.documentMode,os=null,yo=null,qs=null,wo=!1;function rc(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;wo||os==null||os!==ke(s)||(s=os,"selectionStart"in s&&_o(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),qs&&Vs(qs,s)||(qs=s,s=Hi(yo,"onSelect"),0<s.length&&(t=new co("onSelect","select",null,t,r),e.push({event:t,listeners:s}),t.target=os)))}function Ii(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var as={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionend:Ii("Transition","TransitionEnd")},So={},sc={};i&&(sc=document.createElement("div").style,"AnimationEvent"in window||(delete as.animationend.animation,delete as.animationiteration.animation,delete as.animationstart.animation),"TransitionEvent"in window||delete as.transitionend.transition);function Bi(e){if(So[e])return So[e];if(!as[e])return e;var t=as[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in sc)return So[e]=t[r];return e}var ic=Bi("animationend"),nc=Bi("animationiteration"),oc=Bi("animationstart"),ac=Bi("transitionend"),lc=new Map,cc="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 gr(e,t){lc.set(e,t),M(t,[e])}for(var xo=0;xo<cc.length;xo++){var bo=cc[xo],of=bo.toLowerCase(),af=bo[0].toUpperCase()+bo.slice(1);gr(of,"on"+af)}gr(ic,"onAnimationEnd"),gr(nc,"onAnimationIteration"),gr(oc,"onAnimationStart"),gr("dblclick","onDoubleClick"),gr("focusin","onFocus"),gr("focusout","onBlur"),gr(ac,"onTransitionEnd"),R("onMouseEnter",["mouseout","mouseover"]),R("onMouseLeave",["mouseout","mouseover"]),R("onPointerEnter",["pointerout","pointerover"]),R("onPointerLeave",["pointerout","pointerover"]),M("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),M("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),M("onBeforeInput",["compositionend","keypress","textInput","paste"]),M("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),M("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),M("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ks="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(" "),lf=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ks));function uc(e,t,r){var s=e.type||"unknown-event";e.currentTarget=r,nh(s,t,void 0,e),e.currentTarget=null}function dc(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var s=e[r],g=s.event;s=s.listeners;e:{var b=void 0;if(t)for(var O=s.length-1;0<=O;O--){var U=s[O],V=U.instance,te=U.currentTarget;if(U=U.listener,V!==b&&g.isPropagationStopped())break e;uc(g,U,te),b=V}else for(O=0;O<s.length;O++){if(U=s[O],V=U.instance,te=U.currentTarget,U=U.listener,V!==b&&g.isPropagationStopped())break e;uc(g,U,te),b=V}}}if(xi)throw e=Zn,xi=!1,Zn=null,e}function Ne(e,t){var r=t[Po];r===void 0&&(r=t[Po]=new Set);var s=e+"__bubble";r.has(s)||(hc(t,e,2,!1),r.add(s))}function Co(e,t,r){var s=0;t&&(s|=4),hc(r,e,s,t)}var Fi="_reactListening"+Math.random().toString(36).slice(2);function Gs(e){if(!e[Fi]){e[Fi]=!0,C.forEach(function(r){r!=="selectionchange"&&(lf.has(r)||Co(r,!1,e),Co(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fi]||(t[Fi]=!0,Co("selectionchange",!1,t))}}function hc(e,t,r,s){switch(Ol(t)){case 1:var g=Sh;break;case 4:g=xh;break;default:g=oo}r=g.bind(null,t,r,e),g=void 0,!Yn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(g=!0),s?g!==void 0?e.addEventListener(t,r,{capture:!0,passive:g}):e.addEventListener(t,r,!0):g!==void 0?e.addEventListener(t,r,{passive:g}):e.addEventListener(t,r,!1)}function ko(e,t,r,s,g){var b=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var O=s.tag;if(O===3||O===4){var U=s.stateNode.containerInfo;if(U===g||U.nodeType===8&&U.parentNode===g)break;if(O===4)for(O=s.return;O!==null;){var V=O.tag;if((V===3||V===4)&&(V=O.stateNode.containerInfo,V===g||V.nodeType===8&&V.parentNode===g))return;O=O.return}for(;U!==null;){if(O=Br(U),O===null)return;if(V=O.tag,V===5||V===6){s=b=O;continue e}U=U.parentNode}}s=s.return}vl(function(){var te=b,ae=Jn(r),le=[];e:{var oe=lc.get(e);if(oe!==void 0){var pe=co,ge=e;switch(e){case"keypress":if(Ai(r)===0)break e;case"keydown":case"keyup":pe=Ih;break;case"focusin":ge="focus",pe=fo;break;case"focusout":ge="blur",pe=fo;break;case"beforeblur":case"afterblur":pe=fo;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Bl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=Hh;break;case ic:case nc:case oc:pe=Rh;break;case ac:pe=Uh;break;case"scroll":pe=bh;break;case"wheel":pe=zh;break;case"copy":case"cut":case"paste":pe=Dh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=Hl}var ve=(t&4)!==0,We=!ve&&e==="scroll",Y=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var J=te,Z;J!==null;){Z=J;var ue=Z.stateNode;if(Z.tag===5&&ue!==null&&(Z=ue,Y!==null&&(ue=Ds(J,Y),ue!=null&&ve.push(Js(J,ue,Z)))),We)break;J=J.return}0<ve.length&&(oe=new pe(oe,ge,null,r,ae),le.push({event:oe,listeners:ve}))}}if((t&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",pe=e==="mouseout"||e==="pointerout",oe&&r!==Gn&&(ge=r.relatedTarget||r.fromElement)&&(Br(ge)||ge[Yt]))break e;if((pe||oe)&&(oe=ae.window===ae?ae:(oe=ae.ownerDocument)?oe.defaultView||oe.parentWindow:window,pe?(ge=r.relatedTarget||r.toElement,pe=te,ge=ge?Br(ge):null,ge!==null&&(We=Ir(ge),ge!==We||ge.tag!==5&&ge.tag!==6)&&(ge=null)):(pe=null,ge=te),pe!==ge)){if(ve=Bl,ue="onMouseLeave",Y="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(ve=Hl,ue="onPointerLeave",Y="onPointerEnter",J="pointer"),We=pe==null?oe:us(pe),Z=ge==null?oe:us(ge),oe=new ve(ue,J+"leave",pe,r,ae),oe.target=We,oe.relatedTarget=Z,ue=null,Br(ae)===te&&(ve=new ve(Y,J+"enter",ge,r,ae),ve.target=Z,ve.relatedTarget=We,ue=ve),We=ue,pe&&ge)t:{for(ve=pe,Y=ge,J=0,Z=ve;Z;Z=ls(Z))J++;for(Z=0,ue=Y;ue;ue=ls(ue))Z++;for(;0<J-Z;)ve=ls(ve),J--;for(;0<Z-J;)Y=ls(Y),Z--;for(;J--;){if(ve===Y||Y!==null&&ve===Y.alternate)break t;ve=ls(ve),Y=ls(Y)}ve=null}else ve=null;pe!==null&&fc(le,oe,pe,ve,!1),ge!==null&&We!==null&&fc(le,We,ge,ve,!0)}}e:{if(oe=te?us(te):window,pe=oe.nodeName&&oe.nodeName.toLowerCase(),pe==="select"||pe==="input"&&oe.type==="file")var _e=Qh;else if(ql(oe))if(Gl)_e=tf;else{_e=Zh;var we=Yh}else(pe=oe.nodeName)&&pe.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(_e=ef);if(_e&&(_e=_e(e,te))){Kl(le,_e,r,ae);break e}we&&we(e,oe,te),e==="focusout"&&(we=oe._wrapperState)&&we.controlled&&oe.type==="number"&&Mr(oe,"number",oe.value)}switch(we=te?us(te):window,e){case"focusin":(ql(we)||we.contentEditable==="true")&&(os=we,yo=te,qs=null);break;case"focusout":qs=yo=os=null;break;case"mousedown":wo=!0;break;case"contextmenu":case"mouseup":case"dragend":wo=!1,rc(le,r,ae);break;case"selectionchange":if(nf)break;case"keydown":case"keyup":rc(le,r,ae)}var Se;if(mo)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else ns?zl(e,r)&&(Ce="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ce="onCompositionStart");Ce&&($l&&r.locale!=="ko"&&(ns||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&ns&&(Se=Nl()):(mr=ae,lo="value"in mr?mr.value:mr.textContent,ns=!0)),we=Hi(te,Ce),0<we.length&&(Ce=new Fl(Ce,e,null,r,ae),le.push({event:Ce,listeners:we}),Se?Ce.data=Se:(Se=Vl(r),Se!==null&&(Ce.data=Se)))),(Se=qh?Kh(e,r):Gh(e,r))&&(te=Hi(te,"onBeforeInput"),0<te.length&&(ae=new Fl("onBeforeInput","beforeinput",null,r,ae),le.push({event:ae,listeners:te}),ae.data=Se))}dc(le,t)})}function Js(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Hi(e,t){for(var r=t+"Capture",s=[];e!==null;){var g=e,b=g.stateNode;g.tag===5&&b!==null&&(g=b,b=Ds(e,r),b!=null&&s.unshift(Js(e,b,g)),b=Ds(e,t),b!=null&&s.push(Js(e,b,g))),e=e.return}return s}function ls(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function fc(e,t,r,s,g){for(var b=t._reactName,O=[];r!==null&&r!==s;){var U=r,V=U.alternate,te=U.stateNode;if(V!==null&&V===s)break;U.tag===5&&te!==null&&(U=te,g?(V=Ds(r,b),V!=null&&O.unshift(Js(r,V,U))):g||(V=Ds(r,b),V!=null&&O.push(Js(r,V,U)))),r=r.return}O.length!==0&&e.push({event:t,listeners:O})}var cf=/\r\n?/g,uf=/\u0000|\uFFFD/g;function pc(e){return(typeof e=="string"?e:""+e).replace(cf,`
|
|
39
|
+
`).replace(uf,"")}function $i(e,t,r){if(t=pc(t),pc(e)!==t&&r)throw Error(f(425))}function Ui(){}var Eo=null,Lo=null;function Ro(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 jo=typeof setTimeout=="function"?setTimeout:void 0,df=typeof clearTimeout=="function"?clearTimeout:void 0,mc=typeof Promise=="function"?Promise:void 0,hf=typeof queueMicrotask=="function"?queueMicrotask:typeof mc<"u"?function(e){return mc.resolve(null).then(e).catch(ff)}:jo;function ff(e){setTimeout(function(){throw e})}function Do(e,t){var r=t,s=0;do{var g=r.nextSibling;if(e.removeChild(r),g&&g.nodeType===8)if(r=g.data,r==="/$"){if(s===0){e.removeChild(g),Fs(t);return}s--}else r!=="$"&&r!=="$?"&&r!=="$!"||s++;r=g}while(r);Fs(t)}function vr(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 gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var cs=Math.random().toString(36).slice(2),zt="__reactFiber$"+cs,Xs="__reactProps$"+cs,Yt="__reactContainer$"+cs,Po="__reactEvents$"+cs,pf="__reactListeners$"+cs,mf="__reactHandles$"+cs;function Br(e){var t=e[zt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yt]||r[zt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=gc(e);e!==null;){if(r=e[zt])return r;e=gc(e)}return t}e=r,r=e.parentNode}return null}function Qs(e){return e=e[zt]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function us(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(f(33))}function Wi(e){return e[Xs]||null}var To=[],ds=-1;function _r(e){return{current:e}}function Ie(e){0>ds||(e.current=To[ds],To[ds]=null,ds--)}function Ae(e,t){ds++,To[ds]=e.current,e.current=t}var yr={},tt=_r(yr),ut=_r(!1),Fr=yr;function hs(e,t){var r=e.type.contextTypes;if(!r)return yr;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in r)g[b]=t[b];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=g),g}function dt(e){return e=e.childContextTypes,e!=null}function zi(){Ie(ut),Ie(tt)}function vc(e,t,r){if(tt.current!==yr)throw Error(f(168));Ae(tt,t),Ae(ut,r)}function _c(e,t,r){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return r;s=s.getChildContext();for(var g in s)if(!(g in t))throw Error(f(108,G(e)||"Unknown",g));return B({},r,s)}function Vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yr,Fr=tt.current,Ae(tt,e),Ae(ut,ut.current),!0}function yc(e,t,r){var s=e.stateNode;if(!s)throw Error(f(169));r?(e=_c(e,t,Fr),s.__reactInternalMemoizedMergedChildContext=e,Ie(ut),Ie(tt),Ae(tt,e)):Ie(ut),Ae(ut,r)}var Zt=null,qi=!1,Ao=!1;function wc(e){Zt===null?Zt=[e]:Zt.push(e)}function gf(e){qi=!0,wc(e)}function wr(){if(!Ao&&Zt!==null){Ao=!0;var e=0,t=De;try{var r=Zt;for(De=1;e<r.length;e++){var s=r[e];do s=s(!0);while(s!==null)}Zt=null,qi=!1}catch(g){throw Zt!==null&&(Zt=Zt.slice(e+1)),xl(eo,wr),g}finally{De=t,Ao=!1}}return null}var fs=[],ps=0,Ki=null,Gi=0,Ct=[],kt=0,Hr=null,er=1,tr="";function $r(e,t){fs[ps++]=Gi,fs[ps++]=Ki,Ki=e,Gi=t}function Sc(e,t,r){Ct[kt++]=er,Ct[kt++]=tr,Ct[kt++]=Hr,Hr=e;var s=er;e=tr;var g=32-Mt(s)-1;s&=~(1<<g),r+=1;var b=32-Mt(t)+g;if(30<b){var O=g-g%5;b=(s&(1<<O)-1).toString(32),s>>=O,g-=O,er=1<<32-Mt(t)+g|r<<g|s,tr=b+e}else er=1<<b|r<<g|s,tr=e}function Mo(e){e.return!==null&&($r(e,1),Sc(e,1,0))}function Oo(e){for(;e===Ki;)Ki=fs[--ps],fs[ps]=null,Gi=fs[--ps],fs[ps]=null;for(;e===Hr;)Hr=Ct[--kt],Ct[kt]=null,tr=Ct[--kt],Ct[kt]=null,er=Ct[--kt],Ct[kt]=null}var yt=null,wt=null,Be=!1,Nt=null;function xc(e,t){var r=jt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function bc(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,yt=e,wt=vr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,yt=e,wt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Hr!==null?{id:er,overflow:tr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=jt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,yt=e,wt=null,!0):!1;default:return!1}}function No(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Io(e){if(Be){var t=wt;if(t){var r=t;if(!bc(e,t)){if(No(e))throw Error(f(418));t=vr(r.nextSibling);var s=yt;t&&bc(e,t)?xc(s,r):(e.flags=e.flags&-4097|2,Be=!1,yt=e)}}else{if(No(e))throw Error(f(418));e.flags=e.flags&-4097|2,Be=!1,yt=e}}}function Cc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;yt=e}function Ji(e){if(e!==yt)return!1;if(!Be)return Cc(e),Be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ro(e.type,e.memoizedProps)),t&&(t=wt)){if(No(e))throw kc(),Error(f(418));for(;t;)xc(e,t),t=vr(t.nextSibling)}if(Cc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(f(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){wt=vr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}wt=null}}else wt=yt?vr(e.stateNode.nextSibling):null;return!0}function kc(){for(var e=wt;e;)e=vr(e.nextSibling)}function ms(){wt=yt=null,Be=!1}function Bo(e){Nt===null?Nt=[e]:Nt.push(e)}var vf=w.ReactCurrentBatchConfig;function Ys(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(f(309));var s=r.stateNode}if(!s)throw Error(f(147,e));var g=s,b=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===b?t.ref:(t=function(O){var U=g.refs;O===null?delete U[b]:U[b]=O},t._stringRef=b,t)}if(typeof e!="string")throw Error(f(284));if(!r._owner)throw Error(f(290,e))}return e}function Xi(e,t){throw e=Object.prototype.toString.call(t),Error(f(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Ec(e){var t=e._init;return t(e._payload)}function Lc(e){function t(Y,J){if(e){var Z=Y.deletions;Z===null?(Y.deletions=[J],Y.flags|=16):Z.push(J)}}function r(Y,J){if(!e)return null;for(;J!==null;)t(Y,J),J=J.sibling;return null}function s(Y,J){for(Y=new Map;J!==null;)J.key!==null?Y.set(J.key,J):Y.set(J.index,J),J=J.sibling;return Y}function g(Y,J){return Y=Rr(Y,J),Y.index=0,Y.sibling=null,Y}function b(Y,J,Z){return Y.index=Z,e?(Z=Y.alternate,Z!==null?(Z=Z.index,Z<J?(Y.flags|=2,J):Z):(Y.flags|=2,J)):(Y.flags|=1048576,J)}function O(Y){return e&&Y.alternate===null&&(Y.flags|=2),Y}function U(Y,J,Z,ue){return J===null||J.tag!==6?(J=ja(Z,Y.mode,ue),J.return=Y,J):(J=g(J,Z),J.return=Y,J)}function V(Y,J,Z,ue){var _e=Z.type;return _e===D?ae(Y,J,Z.props.children,ue,Z.key):J!==null&&(J.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Ec(_e)===J.type)?(ue=g(J,Z.props),ue.ref=Ys(Y,J,Z),ue.return=Y,ue):(ue=Sn(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Ys(Y,J,Z),ue.return=Y,ue)}function te(Y,J,Z,ue){return J===null||J.tag!==4||J.stateNode.containerInfo!==Z.containerInfo||J.stateNode.implementation!==Z.implementation?(J=Da(Z,Y.mode,ue),J.return=Y,J):(J=g(J,Z.children||[]),J.return=Y,J)}function ae(Y,J,Z,ue,_e){return J===null||J.tag!==7?(J=Jr(Z,Y.mode,ue,_e),J.return=Y,J):(J=g(J,Z),J.return=Y,J)}function le(Y,J,Z){if(typeof J=="string"&&J!==""||typeof J=="number")return J=ja(""+J,Y.mode,Z),J.return=Y,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case L:return Z=Sn(J.type,J.key,J.props,null,Y.mode,Z),Z.ref=Ys(Y,null,J),Z.return=Y,Z;case E:return J=Da(J,Y.mode,Z),J.return=Y,J;case z:var ue=J._init;return le(Y,ue(J._payload),Z)}if(Qt(J)||A(J))return J=Jr(J,Y.mode,Z,null),J.return=Y,J;Xi(Y,J)}return null}function oe(Y,J,Z,ue){var _e=J!==null?J.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number")return _e!==null?null:U(Y,J,""+Z,ue);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case L:return Z.key===_e?V(Y,J,Z,ue):null;case E:return Z.key===_e?te(Y,J,Z,ue):null;case z:return _e=Z._init,oe(Y,J,_e(Z._payload),ue)}if(Qt(Z)||A(Z))return _e!==null?null:ae(Y,J,Z,ue,null);Xi(Y,Z)}return null}function pe(Y,J,Z,ue,_e){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return Y=Y.get(Z)||null,U(J,Y,""+ue,_e);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case L:return Y=Y.get(ue.key===null?Z:ue.key)||null,V(J,Y,ue,_e);case E:return Y=Y.get(ue.key===null?Z:ue.key)||null,te(J,Y,ue,_e);case z:var we=ue._init;return pe(Y,J,Z,we(ue._payload),_e)}if(Qt(ue)||A(ue))return Y=Y.get(Z)||null,ae(J,Y,ue,_e,null);Xi(J,ue)}return null}function ge(Y,J,Z,ue){for(var _e=null,we=null,Se=J,Ce=J=0,Xe=null;Se!==null&&Ce<Z.length;Ce++){Se.index>Ce?(Xe=Se,Se=null):Xe=Se.sibling;var je=oe(Y,Se,Z[Ce],ue);if(je===null){Se===null&&(Se=Xe);break}e&&Se&&je.alternate===null&&t(Y,Se),J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je,Se=Xe}if(Ce===Z.length)return r(Y,Se),Be&&$r(Y,Ce),_e;if(Se===null){for(;Ce<Z.length;Ce++)Se=le(Y,Z[Ce],ue),Se!==null&&(J=b(Se,J,Ce),we===null?_e=Se:we.sibling=Se,we=Se);return Be&&$r(Y,Ce),_e}for(Se=s(Y,Se);Ce<Z.length;Ce++)Xe=pe(Se,Y,Ce,Z[Ce],ue),Xe!==null&&(e&&Xe.alternate!==null&&Se.delete(Xe.key===null?Ce:Xe.key),J=b(Xe,J,Ce),we===null?_e=Xe:we.sibling=Xe,we=Xe);return e&&Se.forEach(function(jr){return t(Y,jr)}),Be&&$r(Y,Ce),_e}function ve(Y,J,Z,ue){var _e=A(Z);if(typeof _e!="function")throw Error(f(150));if(Z=_e.call(Z),Z==null)throw Error(f(151));for(var we=_e=null,Se=J,Ce=J=0,Xe=null,je=Z.next();Se!==null&&!je.done;Ce++,je=Z.next()){Se.index>Ce?(Xe=Se,Se=null):Xe=Se.sibling;var jr=oe(Y,Se,je.value,ue);if(jr===null){Se===null&&(Se=Xe);break}e&&Se&&jr.alternate===null&&t(Y,Se),J=b(jr,J,Ce),we===null?_e=jr:we.sibling=jr,we=jr,Se=Xe}if(je.done)return r(Y,Se),Be&&$r(Y,Ce),_e;if(Se===null){for(;!je.done;Ce++,je=Z.next())je=le(Y,je.value,ue),je!==null&&(J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je);return Be&&$r(Y,Ce),_e}for(Se=s(Y,Se);!je.done;Ce++,je=Z.next())je=pe(Se,Y,Ce,je.value,ue),je!==null&&(e&&je.alternate!==null&&Se.delete(je.key===null?Ce:je.key),J=b(je,J,Ce),we===null?_e=je:we.sibling=je,we=je);return e&&Se.forEach(function(Xf){return t(Y,Xf)}),Be&&$r(Y,Ce),_e}function We(Y,J,Z,ue){if(typeof Z=="object"&&Z!==null&&Z.type===D&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case L:e:{for(var _e=Z.key,we=J;we!==null;){if(we.key===_e){if(_e=Z.type,_e===D){if(we.tag===7){r(Y,we.sibling),J=g(we,Z.props.children),J.return=Y,Y=J;break e}}else if(we.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===z&&Ec(_e)===we.type){r(Y,we.sibling),J=g(we,Z.props),J.ref=Ys(Y,we,Z),J.return=Y,Y=J;break e}r(Y,we);break}else t(Y,we);we=we.sibling}Z.type===D?(J=Jr(Z.props.children,Y.mode,ue,Z.key),J.return=Y,Y=J):(ue=Sn(Z.type,Z.key,Z.props,null,Y.mode,ue),ue.ref=Ys(Y,J,Z),ue.return=Y,Y=ue)}return O(Y);case E:e:{for(we=Z.key;J!==null;){if(J.key===we)if(J.tag===4&&J.stateNode.containerInfo===Z.containerInfo&&J.stateNode.implementation===Z.implementation){r(Y,J.sibling),J=g(J,Z.children||[]),J.return=Y,Y=J;break e}else{r(Y,J);break}else t(Y,J);J=J.sibling}J=Da(Z,Y.mode,ue),J.return=Y,Y=J}return O(Y);case z:return we=Z._init,We(Y,J,we(Z._payload),ue)}if(Qt(Z))return ge(Y,J,Z,ue);if(A(Z))return ve(Y,J,Z,ue);Xi(Y,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,J!==null&&J.tag===6?(r(Y,J.sibling),J=g(J,Z),J.return=Y,Y=J):(r(Y,J),J=ja(Z,Y.mode,ue),J.return=Y,Y=J),O(Y)):r(Y,J)}return We}var gs=Lc(!0),Rc=Lc(!1),Qi=_r(null),Yi=null,vs=null,Fo=null;function Ho(){Fo=vs=Yi=null}function $o(e){var t=Qi.current;Ie(Qi),e._currentValue=t}function Uo(e,t,r){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===r)break;e=e.return}}function _s(e,t){Yi=e,Fo=vs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(ht=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Fo!==e)if(e={context:e,memoizedValue:t,next:null},vs===null){if(Yi===null)throw Error(f(308));vs=e,Yi.dependencies={lanes:0,firstContext:e}}else vs=vs.next=e;return t}var Ur=null;function Wo(e){Ur===null?Ur=[e]:Ur.push(e)}function jc(e,t,r,s){var g=t.interleaved;return g===null?(r.next=r,Wo(t)):(r.next=g.next,g.next=r),t.interleaved=r,rr(e,s)}function rr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Sr=!1;function zo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dc(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 sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xr(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Re&2)!==0){var g=s.pending;return g===null?t.next=t:(t.next=g.next,g.next=t),s.pending=t,rr(e,r)}return g=s.interleaved,g===null?(t.next=t,Wo(s)):(t.next=g.next,g.next=t),s.interleaved=t,rr(e,r)}function Zi(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,so(e,r)}}function Pc(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var g=null,b=null;if(r=r.firstBaseUpdate,r!==null){do{var O={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};b===null?g=b=O:b=b.next=O,r=r.next}while(r!==null);b===null?g=b=t:b=b.next=t}else g=b=t;r={baseState:s.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:s.shared,effects:s.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function en(e,t,r,s){var g=e.updateQueue;Sr=!1;var b=g.firstBaseUpdate,O=g.lastBaseUpdate,U=g.shared.pending;if(U!==null){g.shared.pending=null;var V=U,te=V.next;V.next=null,O===null?b=te:O.next=te,O=V;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,U=ae.lastBaseUpdate,U!==O&&(U===null?ae.firstBaseUpdate=te:U.next=te,ae.lastBaseUpdate=V))}if(b!==null){var le=g.baseState;O=0,ae=te=V=null,U=b;do{var oe=U.lane,pe=U.eventTime;if((s&oe)===oe){ae!==null&&(ae=ae.next={eventTime:pe,lane:0,tag:U.tag,payload:U.payload,callback:U.callback,next:null});e:{var ge=e,ve=U;switch(oe=t,pe=r,ve.tag){case 1:if(ge=ve.payload,typeof ge=="function"){le=ge.call(pe,le,oe);break e}le=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=ve.payload,oe=typeof ge=="function"?ge.call(pe,le,oe):ge,oe==null)break e;le=B({},le,oe);break e;case 2:Sr=!0}}U.callback!==null&&U.lane!==0&&(e.flags|=64,oe=g.effects,oe===null?g.effects=[U]:oe.push(U))}else pe={eventTime:pe,lane:oe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ae===null?(te=ae=pe,V=le):ae=ae.next=pe,O|=oe;if(U=U.next,U===null){if(U=g.shared.pending,U===null)break;oe=U,U=oe.next,oe.next=null,g.lastBaseUpdate=oe,g.shared.pending=null}}while(!0);if(ae===null&&(V=le),g.baseState=V,g.firstBaseUpdate=te,g.lastBaseUpdate=ae,t=g.shared.interleaved,t!==null){g=t;do O|=g.lane,g=g.next;while(g!==t)}else b===null&&(g.shared.lanes=0);Vr|=O,e.lanes=O,e.memoizedState=le}}function Tc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],g=s.callback;if(g!==null){if(s.callback=null,s=r,typeof g!="function")throw Error(f(191,g));g.call(s)}}}var Zs={},Vt=_r(Zs),ei=_r(Zs),ti=_r(Zs);function Wr(e){if(e===Zs)throw Error(f(174));return e}function Vo(e,t){switch(Ae(ti,t),Ae(ei,e),Ae(Vt,Zs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Or(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Or(t,e)}Ie(Vt),Ae(Vt,t)}function ys(){Ie(Vt),Ie(ei),Ie(ti)}function Ac(e){Wr(ti.current);var t=Wr(Vt.current),r=Or(t,e.type);t!==r&&(Ae(ei,e),Ae(Vt,r))}function qo(e){ei.current===e&&(Ie(Vt),Ie(ei))}var Fe=_r(0);function tn(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ko=[];function Go(){for(var e=0;e<Ko.length;e++)Ko[e]._workInProgressVersionPrimary=null;Ko.length=0}var rn=w.ReactCurrentDispatcher,Jo=w.ReactCurrentBatchConfig,zr=0,He=null,Ve=null,Ge=null,sn=!1,ri=!1,si=0,_f=0;function rt(){throw Error(f(321))}function Xo(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ot(e[r],t[r]))return!1;return!0}function Qo(e,t,r,s,g,b){if(zr=b,He=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rn.current=e===null||e.memoizedState===null?xf:bf,e=r(s,g),ri){b=0;do{if(ri=!1,si=0,25<=b)throw Error(f(301));b+=1,Ge=Ve=null,t.updateQueue=null,rn.current=Cf,e=r(s,g)}while(ri)}if(rn.current=an,t=Ve!==null&&Ve.next!==null,zr=0,Ge=Ve=He=null,sn=!1,t)throw Error(f(300));return e}function Yo(){var e=si!==0;return si=0,e}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Lt(){if(Ve===null){var e=He.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=Ge===null?He.memoizedState:Ge.next;if(t!==null)Ge=t,Ve=e;else{if(e===null)throw Error(f(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},Ge===null?He.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function ii(e,t){return typeof t=="function"?t(e):t}function Zo(e){var t=Lt(),r=t.queue;if(r===null)throw Error(f(311));r.lastRenderedReducer=e;var s=Ve,g=s.baseQueue,b=r.pending;if(b!==null){if(g!==null){var O=g.next;g.next=b.next,b.next=O}s.baseQueue=g=b,r.pending=null}if(g!==null){b=g.next,s=s.baseState;var U=O=null,V=null,te=b;do{var ae=te.lane;if((zr&ae)===ae)V!==null&&(V=V.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),s=te.hasEagerState?te.eagerState:e(s,te.action);else{var le={lane:ae,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};V===null?(U=V=le,O=s):V=V.next=le,He.lanes|=ae,Vr|=ae}te=te.next}while(te!==null&&te!==b);V===null?O=s:V.next=U,Ot(s,t.memoizedState)||(ht=!0),t.memoizedState=s,t.baseState=O,t.baseQueue=V,r.lastRenderedState=s}if(e=r.interleaved,e!==null){g=e;do b=g.lane,He.lanes|=b,Vr|=b,g=g.next;while(g!==e)}else g===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ea(e){var t=Lt(),r=t.queue;if(r===null)throw Error(f(311));r.lastRenderedReducer=e;var s=r.dispatch,g=r.pending,b=t.memoizedState;if(g!==null){r.pending=null;var O=g=g.next;do b=e(b,O.action),O=O.next;while(O!==g);Ot(b,t.memoizedState)||(ht=!0),t.memoizedState=b,t.baseQueue===null&&(t.baseState=b),r.lastRenderedState=b}return[b,s]}function Mc(){}function Oc(e,t){var r=He,s=Lt(),g=t(),b=!Ot(s.memoizedState,g);if(b&&(s.memoizedState=g,ht=!0),s=s.queue,ta(Bc.bind(null,r,s,e),[e]),s.getSnapshot!==t||b||Ge!==null&&Ge.memoizedState.tag&1){if(r.flags|=2048,ni(9,Ic.bind(null,r,s,g,t),void 0,null),Je===null)throw Error(f(349));(zr&30)!==0||Nc(r,t,g)}return g}function Nc(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Ic(e,t,r,s){t.value=r,t.getSnapshot=s,Fc(t)&&Hc(e)}function Bc(e,t,r){return r(function(){Fc(t)&&Hc(e)})}function Fc(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ot(e,r)}catch{return!0}}function Hc(e){var t=rr(e,1);t!==null&&Ht(t,e,1,-1)}function $c(e){var t=qt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:e},t.queue=e,e=e.dispatch=Sf.bind(null,He,e),[t.memoizedState,e]}function ni(e,t,r,s){return e={tag:e,create:t,destroy:r,deps:s,next:null},t=He.updateQueue,t===null?(t={lastEffect:null,stores:null},He.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(s=r.next,r.next=e,e.next=s,t.lastEffect=e)),e}function Uc(){return Lt().memoizedState}function nn(e,t,r,s){var g=qt();He.flags|=e,g.memoizedState=ni(1|t,r,void 0,s===void 0?null:s)}function on(e,t,r,s){var g=Lt();s=s===void 0?null:s;var b=void 0;if(Ve!==null){var O=Ve.memoizedState;if(b=O.destroy,s!==null&&Xo(s,O.deps)){g.memoizedState=ni(t,r,b,s);return}}He.flags|=e,g.memoizedState=ni(1|t,r,b,s)}function Wc(e,t){return nn(8390656,8,e,t)}function ta(e,t){return on(2048,8,e,t)}function zc(e,t){return on(4,2,e,t)}function Vc(e,t){return on(4,4,e,t)}function qc(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 Kc(e,t,r){return r=r!=null?r.concat([e]):null,on(4,4,qc.bind(null,t,e),r)}function ra(){}function Gc(e,t){var r=Lt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Xo(t,s[1])?s[0]:(r.memoizedState=[e,t],e)}function Jc(e,t){var r=Lt();t=t===void 0?null:t;var s=r.memoizedState;return s!==null&&t!==null&&Xo(t,s[1])?s[0]:(e=e(),r.memoizedState=[e,t],e)}function Xc(e,t,r){return(zr&21)===0?(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=r):(Ot(r,t)||(r=El(),He.lanes|=r,Vr|=r,e.baseState=!0),t)}function yf(e,t){var r=De;De=r!==0&&4>r?r:4,e(!0);var s=Jo.transition;Jo.transition={};try{e(!1),t()}finally{De=r,Jo.transition=s}}function Qc(){return Lt().memoizedState}function wf(e,t,r){var s=Er(e);if(r={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null},Yc(e))Zc(t,r);else if(r=jc(e,t,r,s),r!==null){var g=at();Ht(r,e,s,g),eu(r,t,s)}}function Sf(e,t,r){var s=Er(e),g={lane:s,action:r,hasEagerState:!1,eagerState:null,next:null};if(Yc(e))Zc(t,g);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=t.lastRenderedReducer,b!==null))try{var O=t.lastRenderedState,U=b(O,r);if(g.hasEagerState=!0,g.eagerState=U,Ot(U,O)){var V=t.interleaved;V===null?(g.next=g,Wo(t)):(g.next=V.next,V.next=g),t.interleaved=g;return}}catch{}finally{}r=jc(e,t,g,s),r!==null&&(g=at(),Ht(r,e,s,g),eu(r,t,s))}}function Yc(e){var t=e.alternate;return e===He||t!==null&&t===He}function Zc(e,t){ri=sn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function eu(e,t,r){if((r&4194240)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,so(e,r)}}var an={readContext:Et,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useInsertionEffect:rt,useLayoutEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useMutableSource:rt,useSyncExternalStore:rt,useId:rt,unstable_isNewReconciler:!1},xf={readContext:Et,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Wc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,nn(4194308,4,qc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return nn(4194308,4,e,t)},useInsertionEffect:function(e,t){return nn(4,2,e,t)},useMemo:function(e,t){var r=qt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var s=qt();return t=r!==void 0?r(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=wf.bind(null,He,e),[s.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:$c,useDebugValue:ra,useDeferredValue:function(e){return qt().memoizedState=e},useTransition:function(){var e=$c(!1),t=e[0];return e=yf.bind(null,e[1]),qt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var s=He,g=qt();if(Be){if(r===void 0)throw Error(f(407));r=r()}else{if(r=t(),Je===null)throw Error(f(349));(zr&30)!==0||Nc(s,t,r)}g.memoizedState=r;var b={value:r,getSnapshot:t};return g.queue=b,Wc(Bc.bind(null,s,b,e),[e]),s.flags|=2048,ni(9,Ic.bind(null,s,b,r,t),void 0,null),r},useId:function(){var e=qt(),t=Je.identifierPrefix;if(Be){var r=tr,s=er;r=(s&~(1<<32-Mt(s)-1)).toString(32)+r,t=":"+t+"R"+r,r=si++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=_f++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bf={readContext:Et,useCallback:Gc,useContext:Et,useEffect:ta,useImperativeHandle:Kc,useInsertionEffect:zc,useLayoutEffect:Vc,useMemo:Jc,useReducer:Zo,useRef:Uc,useState:function(){return Zo(ii)},useDebugValue:ra,useDeferredValue:function(e){var t=Lt();return Xc(t,Ve.memoizedState,e)},useTransition:function(){var e=Zo(ii)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Mc,useSyncExternalStore:Oc,useId:Qc,unstable_isNewReconciler:!1},Cf={readContext:Et,useCallback:Gc,useContext:Et,useEffect:ta,useImperativeHandle:Kc,useInsertionEffect:zc,useLayoutEffect:Vc,useMemo:Jc,useReducer:ea,useRef:Uc,useState:function(){return ea(ii)},useDebugValue:ra,useDeferredValue:function(e){var t=Lt();return Ve===null?t.memoizedState=e:Xc(t,Ve.memoizedState,e)},useTransition:function(){var e=ea(ii)[0],t=Lt().memoizedState;return[e,t]},useMutableSource:Mc,useSyncExternalStore:Oc,useId:Qc,unstable_isNewReconciler:!1};function It(e,t){if(e&&e.defaultProps){t=B({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function sa(e,t,r,s){t=e.memoizedState,r=r(s,t),r=r==null?t:B({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ln={isMounted:function(e){return(e=e._reactInternals)?Ir(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var s=at(),g=Er(e),b=sr(s,g);b.payload=t,r!=null&&(b.callback=r),t=xr(e,b,g),t!==null&&(Ht(t,e,g,s),Zi(t,e,g))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var s=at(),g=Er(e),b=sr(s,g);b.tag=1,b.payload=t,r!=null&&(b.callback=r),t=xr(e,b,g),t!==null&&(Ht(t,e,g,s),Zi(t,e,g))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=at(),s=Er(e),g=sr(r,s);g.tag=2,t!=null&&(g.callback=t),t=xr(e,g,s),t!==null&&(Ht(t,e,s,r),Zi(t,e,s))}};function tu(e,t,r,s,g,b,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,b,O):t.prototype&&t.prototype.isPureReactComponent?!Vs(r,s)||!Vs(g,b):!0}function ru(e,t,r){var s=!1,g=yr,b=t.contextType;return typeof b=="object"&&b!==null?b=Et(b):(g=dt(t)?Fr:tt.current,s=t.contextTypes,b=(s=s!=null)?hs(e,g):yr),t=new t(r,b),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ln,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=g,e.__reactInternalMemoizedMaskedChildContext=b),t}function su(e,t,r,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,s),t.state!==e&&ln.enqueueReplaceState(t,t.state,null)}function ia(e,t,r,s){var g=e.stateNode;g.props=r,g.state=e.memoizedState,g.refs={},zo(e);var b=t.contextType;typeof b=="object"&&b!==null?g.context=Et(b):(b=dt(t)?Fr:tt.current,g.context=hs(e,b)),g.state=e.memoizedState,b=t.getDerivedStateFromProps,typeof b=="function"&&(sa(e,t,b,r),g.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(t=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),t!==g.state&&ln.enqueueReplaceState(g,g.state,null),en(e,r,g,s),g.state=e.memoizedState),typeof g.componentDidMount=="function"&&(e.flags|=4194308)}function ws(e,t){try{var r="",s=t;do r+=ce(s),s=s.return;while(s);var g=r}catch(b){g=`
|
|
40
40
|
Error generating stack: `+b.message+`
|
|
41
|
-
`+b.stack}return{value:e,source:t,stack:g,digest:null}}function na(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function oa(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var kf=typeof WeakMap=="function"?WeakMap:Map;function iu(e,t,r){r=sr(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){mn||(mn=!0,Sa=s),oa(e,t)},r}function nu(e,t,r){r=sr(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var g=t.value;r.payload=function(){return s(g)},r.callback=function(){oa(e,t)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(r.callback=function(){oa(e,t),typeof s!="function"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var O=t.stack;this.componentDidCatch(t.value,{componentStack:O!==null?O:""})}),r}function ou(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new kf;var g=new Set;s.set(t,g)}else g=s.get(t),g===void 0&&(g=new Set,s.set(t,g));g.has(r)||(g.add(r),e=Ff.bind(null,e,t,r),t.then(e,e))}function au(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 lu(e,t,r,s,g){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=sr(-1,1),t.tag=2,xr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=g,e)}var Ef=w.ReactCurrentOwner,ht=!1;function ot(e,t,r,s){t.child=e===null?Rc(t,null,r,s):gs(t,e.child,r,s)}function cu(e,t,r,s,g){r=r.render;var b=t.ref;return _s(t,g),s=Qo(e,t,r,s,b,g),r=Yo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~g,ir(e,t,g)):(Be&&r&&Mo(t),t.flags|=1,ot(e,t,s,g),t.child)}function uu(e,t,r,s,g){if(e===null){var b=r.type;return typeof b=="function"&&!Ra(b)&&b.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=b,du(e,t,b,s,g)):(e=Sn(r.type,null,s,t,t.mode,g),e.ref=t.ref,e.return=t,t.child=e)}if(b=e.child,(e.lanes&g)===0){var O=b.memoizedProps;if(r=r.compare,r=r!==null?r:Vs,r(O,s)&&e.ref===t.ref)return ir(e,t,g)}return t.flags|=1,e=Rr(b,s),e.ref=t.ref,e.return=t,t.child=e}function du(e,t,r,s,g){if(e!==null){var b=e.memoizedProps;if(Vs(b,s)&&e.ref===t.ref)if(ht=!1,t.pendingProps=s=b,(e.lanes&g)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,ir(e,t,g)}return aa(e,t,r,s,g)}function hu(e,t,r){var s=t.pendingProps,g=s.children,b=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(xs,St),St|=r;else{if((r&1073741824)===0)return e=b!==null?b.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ae(xs,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=b!==null?b.baseLanes:r,Ae(xs,St),St|=s}else b!==null?(s=b.baseLanes|r,t.memoizedState=null):s=r,Ae(xs,St),St|=s;return ot(e,t,g,r),t.child}function fu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function aa(e,t,r,s,g){var b=dt(r)?Fr:tt.current;return b=hs(t,b),_s(t,g),r=Qo(e,t,r,s,b,g),s=Yo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~g,ir(e,t,g)):(Be&&s&&Mo(t),t.flags|=1,ot(e,t,r,g),t.child)}function pu(e,t,r,s,g){if(dt(r)){var b=!0;Vi(t)}else b=!1;if(_s(t,g),t.stateNode===null)un(e,t),ru(t,r,s),ia(t,r,s,g),s=!0;else if(e===null){var O=t.stateNode,U=t.memoizedProps;O.props=U;var V=O.context,te=r.contextType;typeof te=="object"&&te!==null?te=Et(te):(te=dt(r)?Fr:tt.current,te=hs(t,te));var ae=r.getDerivedStateFromProps,le=typeof ae=="function"||typeof O.getSnapshotBeforeUpdate=="function";le||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==s||V!==te)&&su(t,O,s,te),Sr=!1;var oe=t.memoizedState;O.state=oe,en(t,s,O,g),V=t.memoizedState,U!==s||oe!==V||ut.current||Sr?(typeof ae=="function"&&(sa(t,r,ae,s),V=t.memoizedState),(U=Sr||tu(t,r,U,s,oe,V,te))?(le||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(t.flags|=4194308)):(typeof O.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=V),O.props=s,O.state=V,O.context=te,s=U):(typeof O.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{O=t.stateNode,Dc(e,t),U=t.memoizedProps,te=t.type===t.elementType?U:It(t.type,U),O.props=te,le=t.pendingProps,oe=O.context,V=r.contextType,typeof V=="object"&&V!==null?V=Et(V):(V=dt(r)?Fr:tt.current,V=hs(t,V));var pe=r.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==le||oe!==V)&&su(t,O,s,V),Sr=!1,oe=t.memoizedState,O.state=oe,en(t,s,O,g);var ge=t.memoizedState;U!==le||oe!==ge||ut.current||Sr?(typeof pe=="function"&&(sa(t,r,pe,s),ge=t.memoizedState),(te=Sr||tu(t,r,te,s,oe,ge,V)||!1)?(ae||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(s,ge,V),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(s,ge,V)),typeof O.componentDidUpdate=="function"&&(t.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof O.componentDidUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ge),O.props=s,O.state=ge,O.context=V,s=te):(typeof O.componentDidUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),s=!1)}return la(e,t,r,s,b,g)}function la(e,t,r,s,g,b){fu(e,t);var O=(t.flags&128)!==0;if(!s&&!O)return g&&yc(t,r,!1),ir(e,t,b);s=t.stateNode,Ef.current=t;var U=O&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&O?(t.child=gs(t,e.child,null,b),t.child=gs(t,null,U,b)):ot(e,t,U,b),t.memoizedState=s.state,g&&yc(t,r,!0),t.child}function mu(e){var t=e.stateNode;t.pendingContext?vc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&vc(e,t.context,!1),Vo(e,t.containerInfo)}function gu(e,t,r,s,g){return ms(),Bo(g),t.flags|=256,ot(e,t,r,s),t.child}var ca={dehydrated:null,treeContext:null,retryLane:0};function ua(e){return{baseLanes:e,cachePool:null,transitions:null}}function vu(e,t,r){var s=t.pendingProps,g=Fe.current,b=!1,O=(t.flags&128)!==0,U;if((U=O)||(U=e!==null&&e.memoizedState===null?!1:(g&2)!==0),U?(b=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(g|=1),Ae(Fe,g&1),e===null)return Io(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):(O=s.children,e=s.fallback,b?(s=t.mode,b=t.child,O={mode:"hidden",children:O},(s&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=O):b=xn(O,s,0,null),e=Jr(e,s,r,null),b.return=t,e.return=t,b.sibling=e,t.child=b,t.child.memoizedState=ua(r),t.memoizedState=ca,e):da(t,O));if(g=e.memoizedState,g!==null&&(U=g.dehydrated,U!==null))return Lf(e,t,O,s,U,g,r);if(b){b=s.fallback,O=t.mode,g=e.child,U=g.sibling;var V={mode:"hidden",children:s.children};return(O&1)===0&&t.child!==g?(s=t.child,s.childLanes=0,s.pendingProps=V,t.deletions=null):(s=Rr(g,V),s.subtreeFlags=g.subtreeFlags&14680064),U!==null?b=Rr(U,b):(b=Jr(b,O,r,null),b.flags|=2),b.return=t,s.return=t,s.sibling=b,t.child=s,s=b,b=t.child,O=e.child.memoizedState,O=O===null?ua(r):{baseLanes:O.baseLanes|r,cachePool:null,transitions:O.transitions},b.memoizedState=O,b.childLanes=e.childLanes&~r,t.memoizedState=ca,s}return b=e.child,e=b.sibling,s=Rr(b,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function da(e,t){return t=xn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cn(e,t,r,s){return s!==null&&Bo(s),gs(t,e.child,null,r),e=da(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lf(e,t,r,s,g,b,O){if(r)return t.flags&256?(t.flags&=-257,s=na(Error(f(422))),cn(e,t,O,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(b=s.fallback,g=t.mode,s=xn({mode:"visible",children:s.children},g,0,null),b=Jr(b,g,O,null),b.flags|=2,s.return=t,b.return=t,s.sibling=b,t.child=s,(t.mode&1)!==0&&gs(t,e.child,null,O),t.child.memoizedState=ua(O),t.memoizedState=ca,b);if((t.mode&1)===0)return cn(e,t,O,null);if(g.data==="$!"){if(s=g.nextSibling&&g.nextSibling.dataset,s)var U=s.dgst;return s=U,b=Error(f(419)),s=na(b,s,void 0),cn(e,t,O,s)}if(U=(O&e.childLanes)!==0,ht||U){if(s=Je,s!==null){switch(O&-O){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(s.suspendedLanes|O))!==0?0:g,g!==0&&g!==b.retryLane&&(b.retryLane=g,rr(e,g),Ht(s,e,g,-1))}return La(),s=na(Error(f(421))),cn(e,t,O,s)}return g.data==="$?"?(t.flags|=128,t.child=e.child,t=Hf.bind(null,e),g._reactRetry=t,null):(e=b.treeContext,wt=vr(g.nextSibling),yt=t,Be=!0,Nt=null,e!==null&&(Ct[kt++]=er,Ct[kt++]=tr,Ct[kt++]=Hr,er=e.id,tr=e.overflow,Hr=t),t=da(t,s.children),t.flags|=4096,t)}function _u(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Uo(e.return,t,r)}function ha(e,t,r,s,g){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:g}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=g)}function yu(e,t,r){var s=t.pendingProps,g=s.revealOrder,b=s.tail;if(ot(e,t,s.children,r),s=Fe.current,(s&2)!==0)s=s&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&&_u(e,r,t);else if(e.tag===19)_u(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Ae(Fe,s),(t.mode&1)===0)t.memoizedState=null;else switch(g){case"forwards":for(r=t.child,g=null;r!==null;)e=r.alternate,e!==null&&tn(e)===null&&(g=r),r=r.sibling;r=g,r===null?(g=t.child,t.child=null):(g=r.sibling,r.sibling=null),ha(t,!1,g,r,b);break;case"backwards":for(r=null,g=t.child,t.child=null;g!==null;){if(e=g.alternate,e!==null&&tn(e)===null){t.child=g;break}e=g.sibling,g.sibling=r,r=g,g=e}ha(t,!0,r,null,b);break;case"together":ha(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function un(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ir(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Vr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,r=Rr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Rr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Rf(e,t,r){switch(t.tag){case 3:mu(t),ms();break;case 5:Ac(t);break;case 1:dt(t.type)&&Vi(t);break;case 4:Vo(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,g=t.memoizedProps.value;Ae(Qi,s._currentValue),s._currentValue=g;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Ae(Fe,Fe.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?vu(e,t,r):(Ae(Fe,Fe.current&1),e=ir(e,t,r),e!==null?e.sibling:null);Ae(Fe,Fe.current&1);break;case 19:if(s=(r&t.childLanes)!==0,(e.flags&128)!==0){if(s)return yu(e,t,r);t.flags|=128}if(g=t.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ae(Fe,Fe.current),s)break;return null;case 22:case 23:return t.lanes=0,hu(e,t,r)}return ir(e,t,r)}var wu,fa,Su,xu;wu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},fa=function(){},Su=function(e,t,r,s){var g=e.memoizedProps;if(g!==s){e=t.stateNode,Wr(Vt.current);var b=null;switch(r){case"input":g=Te(e,g),s=Te(e,s),b=[];break;case"select":g=B({},g,{value:void 0}),s=B({},s,{value:void 0}),b=[];break;case"textarea":g=lr(e,g),s=lr(e,s),b=[];break;default:typeof g.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Ui)}qn(r,s);var O;r=null;for(te in g)if(!s.hasOwnProperty(te)&&g.hasOwnProperty(te)&&g[te]!=null)if(te==="style"){var U=g[te];for(O in U)U.hasOwnProperty(O)&&(r||(r={}),r[O]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(j.hasOwnProperty(te)?b||(b=[]):(b=b||[]).push(te,null));for(te in s){var V=s[te];if(U=g!=null?g[te]:void 0,s.hasOwnProperty(te)&&V!==U&&(V!=null||U!=null))if(te==="style")if(U){for(O in U)!U.hasOwnProperty(O)||V&&V.hasOwnProperty(O)||(r||(r={}),r[O]="");for(O in V)V.hasOwnProperty(O)&&U[O]!==V[O]&&(r||(r={}),r[O]=V[O])}else r||(b||(b=[]),b.push(te,r)),r=V;else te==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,U=U?U.__html:void 0,V!=null&&U!==V&&(b=b||[]).push(te,V)):te==="children"?typeof V!="string"&&typeof V!="number"||(b=b||[]).push(te,""+V):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(j.hasOwnProperty(te)?(V!=null&&te==="onScroll"&&Ne("scroll",e),b||U===V||(b=[])):(b=b||[]).push(te,V))}r&&(b=b||[]).push("style",r);var te=b;(t.updateQueue=te)&&(t.flags|=4)}},xu=function(e,t,r,s){r!==s&&(t.flags|=4)};function oi(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var g=e.child;g!==null;)r|=g.lanes|g.childLanes,s|=g.subtreeFlags&14680064,s|=g.flags&14680064,g.return=e,g=g.sibling;else for(g=e.child;g!==null;)r|=g.lanes|g.childLanes,s|=g.subtreeFlags,s|=g.flags,g.return=e,g=g.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function jf(e,t,r){var s=t.pendingProps;switch(Oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return dt(t.type)&&zi(),st(t),null;case 3:return s=t.stateNode,ys(),Ie(ut),Ie(tt),Go(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nt!==null&&(Ca(Nt),Nt=null))),fa(e,t),st(t),null;case 5:qo(t);var g=Wr(ti.current);if(r=t.type,e!==null&&t.stateNode!=null)Su(e,t,r,s,g),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(f(166));return st(t),null}if(e=Wr(Vt.current),Ji(t)){s=t.stateNode,r=t.type;var b=t.memoizedProps;switch(s[zt]=t,s[Xs]=b,e=(t.mode&1)!==0,r){case"dialog":Ne("cancel",s),Ne("close",s);break;case"iframe":case"object":case"embed":Ne("load",s);break;case"video":case"audio":for(g=0;g<Ks.length;g++)Ne(Ks[g],s);break;case"source":Ne("error",s);break;case"img":case"image":case"link":Ne("error",s),Ne("load",s);break;case"details":Ne("toggle",s);break;case"input":Me(s,b),Ne("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!b.multiple},Ne("invalid",s);break;case"textarea":nt(s,b),Ne("invalid",s)}qn(r,b),g=null;for(var O in b)if(b.hasOwnProperty(O)){var U=b[O];O==="children"?typeof U=="string"?s.textContent!==U&&(b.suppressHydrationWarning!==!0&&$i(s.textContent,U,e),g=["children",U]):typeof U=="number"&&s.textContent!==""+U&&(b.suppressHydrationWarning!==!0&&$i(s.textContent,U,e),g=["children",""+U]):j.hasOwnProperty(O)&&U!=null&&O==="onScroll"&&Ne("scroll",s)}switch(r){case"input":fe(s),ar(s,b,!0);break;case"textarea":fe(s),gt(s);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(s.onclick=Ui)}s=g,t.updateQueue=s,s!==null&&(t.flags|=4)}else{O=g.nodeType===9?g:g.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ur(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=O.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=O.createElement(r,{is:s.is}):(e=O.createElement(r),r==="select"&&(O=e,s.multiple?O.multiple=!0:s.size&&(O.size=s.size))):e=O.createElementNS(e,r),e[zt]=t,e[Xs]=s,wu(e,t,!1,!1),t.stateNode=e;e:{switch(O=Kn(r,s),r){case"dialog":Ne("cancel",e),Ne("close",e),g=s;break;case"iframe":case"object":case"embed":Ne("load",e),g=s;break;case"video":case"audio":for(g=0;g<Ks.length;g++)Ne(Ks[g],e);g=s;break;case"source":Ne("error",e),g=s;break;case"img":case"image":case"link":Ne("error",e),Ne("load",e),g=s;break;case"details":Ne("toggle",e),g=s;break;case"input":Me(e,s),g=Te(e,s),Ne("invalid",e);break;case"option":g=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},g=B({},s,{value:void 0}),Ne("invalid",e);break;case"textarea":nt(e,s),g=lr(e,s),Ne("invalid",e);break;default:g=s}qn(r,g),U=g;for(b in U)if(U.hasOwnProperty(b)){var V=U[b];b==="style"?dl(e,V):b==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Nr(e,V)):b==="children"?typeof V=="string"?(r!=="textarea"||V!=="")&&ct(e,V):typeof V=="number"&&ct(e,""+V):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(j.hasOwnProperty(b)?V!=null&&b==="onScroll"&&Ne("scroll",e):V!=null&&l(e,b,V,O))}switch(r){case"input":fe(e),ar(e,s,!1);break;case"textarea":fe(e),gt(e);break;case"option":s.value!=null&&e.setAttribute("value",""+N(s.value));break;case"select":e.multiple=!!s.multiple,b=s.value,b!=null?Ut(e,!!s.multiple,b,!1):s.defaultValue!=null&&Ut(e,!!s.multiple,s.defaultValue,!0);break;default:typeof g.onClick=="function"&&(e.onclick=Ui)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return st(t),null;case 6:if(e&&t.stateNode!=null)xu(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(f(166));if(r=Wr(ti.current),Wr(Vt.current),Ji(t)){if(s=t.stateNode,r=t.memoizedProps,s[zt]=t,(b=s.nodeValue!==r)&&(e=yt,e!==null))switch(e.tag){case 3:$i(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$i(s.nodeValue,r,(e.mode&1)!==0)}b&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[zt]=t,t.stateNode=s}return st(t),null;case 13:if(Ie(Fe),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Be&&wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)kc(),ms(),t.flags|=98560,b=!1;else if(b=Ji(t),s!==null&&s.dehydrated!==null){if(e===null){if(!b)throw Error(f(318));if(b=t.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(f(317));b[zt]=t}else ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),b=!1}else Nt!==null&&(Ca(Nt),Nt=null),b=!0;if(!b)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Fe.current&1)!==0?qe===0&&(qe=3):La())),t.updateQueue!==null&&(t.flags|=4),st(t),null);case 4:return ys(),fa(e,t),e===null&&Gs(t.stateNode.containerInfo),st(t),null;case 10:return $o(t.type._context),st(t),null;case 17:return dt(t.type)&&zi(),st(t),null;case 19:if(Ie(Fe),b=t.memoizedState,b===null)return st(t),null;if(s=(t.flags&128)!==0,O=b.rendering,O===null)if(s)oi(b,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(O=tn(e),O!==null){for(t.flags|=128,oi(b,!1),s=O.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)b=r,e=s,b.flags&=14680066,O=b.alternate,O===null?(b.childLanes=0,b.lanes=e,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=O.childLanes,b.lanes=O.lanes,b.child=O.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=O.memoizedProps,b.memoizedState=O.memoizedState,b.updateQueue=O.updateQueue,b.type=O.type,e=O.dependencies,b.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ae(Fe,Fe.current&1|2),t.child}e=e.sibling}b.tail!==null&&Ue()>bs&&(t.flags|=128,s=!0,oi(b,!1),t.lanes=4194304)}else{if(!s)if(e=tn(O),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),oi(b,!0),b.tail===null&&b.tailMode==="hidden"&&!O.alternate&&!Be)return st(t),null}else 2*Ue()-b.renderingStartTime>bs&&r!==1073741824&&(t.flags|=128,s=!0,oi(b,!1),t.lanes=4194304);b.isBackwards?(O.sibling=t.child,t.child=O):(r=b.last,r!==null?r.sibling=O:t.child=O,b.last=O)}return b.tail!==null?(t=b.tail,b.rendering=t,b.tail=t.sibling,b.renderingStartTime=Ue(),t.sibling=null,r=Fe.current,Ae(Fe,s?r&1|2:r&1),t):(st(t),null);case 22:case 23:return Ea(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(St&1073741824)!==0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),null;case 24:return null;case 25:return null}throw Error(f(156,t.tag))}function Df(e,t){switch(Oo(t),t.tag){case 1:return dt(t.type)&&zi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(),Ie(ut),Ie(tt),Go(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return qo(t),null;case 13:if(Ie(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Fe),null;case 4:return ys(),null;case 10:return $o(t.type._context),null;case 22:case 23:return Ea(),null;case 24:return null;default:return null}}var dn=!1,it=!1,Pf=typeof WeakSet=="function"?WeakSet:Set,me=null;function Ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){$e(e,t,s)}else r.current=null}function pa(e,t,r){try{r()}catch(s){$e(e,t,s)}}var bu=!1;function Tf(e,t){if(Eo=Di,e=tc(),_o(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var g=s.anchorOffset,b=s.focusNode;s=s.focusOffset;try{r.nodeType,b.nodeType}catch{r=null;break e}var O=0,U=-1,V=-1,te=0,ae=0,le=e,oe=null;t:for(;;){for(var pe;le!==r||g!==0&&le.nodeType!==3||(U=O+g),le!==b||s!==0&&le.nodeType!==3||(V=O+s),le.nodeType===3&&(O+=le.nodeValue.length),(pe=le.firstChild)!==null;)oe=le,le=pe;for(;;){if(le===e)break t;if(oe===r&&++te===g&&(U=O),oe===b&&++ae===s&&(V=O),(pe=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=pe}r=U===-1||V===-1?null:{start:U,end:V}}else r=null}r=r||{start:0,end:0}}else r=null;for(Lo={focusedElem:e,selectionRange:r},Di=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var ge=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ge!==null){var ve=ge.memoizedProps,We=ge.memoizedState,Y=t.stateNode,J=Y.getSnapshotBeforeUpdate(t.elementType===t.type?ve:It(t.type,ve),We);Y.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var Z=t.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(f(163))}}catch(ue){$e(t,t.return,ue)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return ge=bu,bu=!1,ge}function ai(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var g=s=s.next;do{if((g.tag&e)===e){var b=g.destroy;g.destroy=void 0,b!==void 0&&pa(t,r,b)}g=g.next}while(g!==s)}}function hn(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function ma(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[Xs],delete t[Po],delete t[pf],delete t[mf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ku(e){return e.tag===5||e.tag===3||e.tag===4}function Eu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ku(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 ga(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ui));else if(s!==4&&(e=e.child,e!==null))for(ga(e,t,r),e=e.sibling;e!==null;)ga(e,t,r),e=e.sibling}function va(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(va(e,t,r),e=e.sibling;e!==null;)va(e,t,r),e=e.sibling}var Ye=null,Bt=!1;function br(e,t,r){for(r=r.child;r!==null;)Lu(e,t,r),r=r.sibling}function Lu(e,t,r){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Ci,r)}catch{}switch(r.tag){case 5:it||Ss(r,t);case 6:var s=Ye,g=Bt;Ye=null,br(e,t,r),Ye=s,Bt=g,Ye!==null&&(Bt?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Bt?(e=Ye,r=r.stateNode,e.nodeType===8?Do(e.parentNode,r):e.nodeType===1&&Do(e,r),Fs(e)):Do(Ye,r.stateNode));break;case 4:s=Ye,g=Bt,Ye=r.stateNode.containerInfo,Bt=!0,br(e,t,r),Ye=s,Bt=g;break;case 0:case 11:case 14:case 15:if(!it&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){g=s=s.next;do{var b=g,O=b.destroy;b=b.tag,O!==void 0&&((b&2)!==0||(b&4)!==0)&&pa(r,t,O),g=g.next}while(g!==s)}br(e,t,r);break;case 1:if(!it&&(Ss(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(U){$e(r,t,U)}br(e,t,r);break;case 21:br(e,t,r);break;case 22:r.mode&1?(it=(s=it)||r.memoizedState!==null,br(e,t,r),it=s):br(e,t,r);break;default:br(e,t,r)}}function Ru(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Pf),t.forEach(function(s){var g=$f.bind(null,e,s);r.has(s)||(r.add(s),s.then(g,g))})}}function Ft(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var g=r[s];try{var b=e,O=t,U=O;e:for(;U!==null;){switch(U.tag){case 5:Ye=U.stateNode,Bt=!1;break e;case 3:Ye=U.stateNode.containerInfo,Bt=!0;break e;case 4:Ye=U.stateNode.containerInfo,Bt=!0;break e}U=U.return}if(Ye===null)throw Error(f(160));Lu(b,O,g),Ye=null,Bt=!1;var V=g.alternate;V!==null&&(V.return=null),g.return=null}catch(te){$e(g,t,te)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ju(t,e),t=t.sibling}function ju(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ft(t,e),Kt(e),s&4){try{ai(3,e,e.return),hn(3,e)}catch(ve){$e(e,e.return,ve)}try{ai(5,e,e.return)}catch(ve){$e(e,e.return,ve)}}break;case 1:Ft(t,e),Kt(e),s&512&&r!==null&&Ss(r,r.return);break;case 5:if(Ft(t,e),Kt(e),s&512&&r!==null&&Ss(r,r.return),e.flags&32){var g=e.stateNode;try{ct(g,"")}catch(ve){$e(e,e.return,ve)}}if(s&4&&(g=e.stateNode,g!=null)){var b=e.memoizedProps,O=r!==null?r.memoizedProps:b,U=e.type,V=e.updateQueue;if(e.updateQueue=null,V!==null)try{U==="input"&&b.type==="radio"&&b.name!=null&&Qe(g,b),Kn(U,O);var te=Kn(U,b);for(O=0;O<V.length;O+=2){var ae=V[O],le=V[O+1];ae==="style"?dl(g,le):ae==="dangerouslySetInnerHTML"?Nr(g,le):ae==="children"?ct(g,le):l(g,ae,le,te)}switch(U){case"input":be(g,b);break;case"textarea":cr(g,b);break;case"select":var oe=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!b.multiple;var pe=b.value;pe!=null?Ut(g,!!b.multiple,pe,!1):oe!==!!b.multiple&&(b.defaultValue!=null?Ut(g,!!b.multiple,b.defaultValue,!0):Ut(g,!!b.multiple,b.multiple?[]:"",!1))}g[Xs]=b}catch(ve){$e(e,e.return,ve)}}break;case 6:if(Ft(t,e),Kt(e),s&4){if(e.stateNode===null)throw Error(f(162));g=e.stateNode,b=e.memoizedProps;try{g.nodeValue=b}catch(ve){$e(e,e.return,ve)}}break;case 3:if(Ft(t,e),Kt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Fs(t.containerInfo)}catch(ve){$e(e,e.return,ve)}break;case 4:Ft(t,e),Kt(e);break;case 13:Ft(t,e),Kt(e),g=e.child,g.flags&8192&&(b=g.memoizedState!==null,g.stateNode.isHidden=b,!b||g.alternate!==null&&g.alternate.memoizedState!==null||(wa=Ue())),s&4&&Ru(e);break;case 22:if(ae=r!==null&&r.memoizedState!==null,e.mode&1?(it=(te=it)||ae,Ft(t,e),it=te):Ft(t,e),Kt(e),s&8192){if(te=e.memoizedState!==null,(e.stateNode.isHidden=te)&&!ae&&(e.mode&1)!==0)for(me=e,ae=e.child;ae!==null;){for(le=me=ae;me!==null;){switch(oe=me,pe=oe.child,oe.tag){case 0:case 11:case 14:case 15:ai(4,oe,oe.return);break;case 1:Ss(oe,oe.return);var ge=oe.stateNode;if(typeof ge.componentWillUnmount=="function"){s=oe,r=oe.return;try{t=s,ge.props=t.memoizedProps,ge.state=t.memoizedState,ge.componentWillUnmount()}catch(ve){$e(s,r,ve)}}break;case 5:Ss(oe,oe.return);break;case 22:if(oe.memoizedState!==null){Tu(le);continue}}pe!==null?(pe.return=oe,me=pe):Tu(le)}ae=ae.sibling}e:for(ae=null,le=e;;){if(le.tag===5){if(ae===null){ae=le;try{g=le.stateNode,te?(b=g.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(U=le.stateNode,V=le.memoizedProps.style,O=V!=null&&V.hasOwnProperty("display")?V.display:null,U.style.display=wi("display",O))}catch(ve){$e(e,e.return,ve)}}}else if(le.tag===6){if(ae===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(ve){$e(e,e.return,ve)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===e)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===e)break e;for(;le.sibling===null;){if(le.return===null||le.return===e)break e;ae===le&&(ae=null),le=le.return}ae===le&&(ae=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:Ft(t,e),Kt(e),s&4&&Ru(e);break;case 21:break;default:Ft(t,e),Kt(e)}}function Kt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ku(r)){var s=r;break e}r=r.return}throw Error(f(160))}switch(s.tag){case 5:var g=s.stateNode;s.flags&32&&(ct(g,""),s.flags&=-33);var b=Eu(e);va(e,b,g);break;case 3:case 4:var O=s.stateNode.containerInfo,U=Eu(e);ga(e,U,O);break;default:throw Error(f(161))}}catch(V){$e(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Af(e,t,r){me=e,Du(e)}function Du(e,t,r){for(var s=(e.mode&1)!==0;me!==null;){var g=me,b=g.child;if(g.tag===22&&s){var O=g.memoizedState!==null||dn;if(!O){var U=g.alternate,V=U!==null&&U.memoizedState!==null||it;U=dn;var te=it;if(dn=O,(it=V)&&!te)for(me=g;me!==null;)O=me,V=O.child,O.tag===22&&O.memoizedState!==null?Au(g):V!==null?(V.return=O,me=V):Au(g);for(;b!==null;)me=b,Du(b),b=b.sibling;me=g,dn=U,it=te}Pu(e)}else(g.subtreeFlags&8772)!==0&&b!==null?(b.return=g,me=b):Pu(e)}}function Pu(e){for(;me!==null;){var t=me;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:it||hn(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!it)if(r===null)s.componentDidMount();else{var g=t.elementType===t.type?r.memoizedProps:It(t.type,r.memoizedProps);s.componentDidUpdate(g,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var b=t.updateQueue;b!==null&&Tc(t,b,s);break;case 3:var O=t.updateQueue;if(O!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Tc(t,O,r)}break;case 5:var U=t.stateNode;if(r===null&&t.flags&4){r=U;var V=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&r.focus();break;case"img":V.src&&(r.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var te=t.alternate;if(te!==null){var ae=te.memoizedState;if(ae!==null){var le=ae.dehydrated;le!==null&&Fs(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(f(163))}it||t.flags&512&&ma(t)}catch(oe){$e(t,t.return,oe)}}if(t===e){me=null;break}if(r=t.sibling,r!==null){r.return=t.return,me=r;break}me=t.return}}function Tu(e){for(;me!==null;){var t=me;if(t===e){me=null;break}var r=t.sibling;if(r!==null){r.return=t.return,me=r;break}me=t.return}}function Au(e){for(;me!==null;){var t=me;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{hn(4,t)}catch(V){$e(t,r,V)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var g=t.return;try{s.componentDidMount()}catch(V){$e(t,g,V)}}var b=t.return;try{ma(t)}catch(V){$e(t,b,V)}break;case 5:var O=t.return;try{ma(t)}catch(V){$e(t,O,V)}}}catch(V){$e(t,t.return,V)}if(t===e){me=null;break}var U=t.sibling;if(U!==null){U.return=t.return,me=U;break}me=t.return}}var Mf=Math.ceil,fn=w.ReactCurrentDispatcher,_a=w.ReactCurrentOwner,Rt=w.ReactCurrentBatchConfig,Re=0,Je=null,ze=null,Ze=0,St=0,xs=_r(0),qe=0,li=null,Vr=0,pn=0,ya=0,ci=null,ft=null,wa=0,bs=1/0,nr=null,mn=!1,Sa=null,Cr=null,gn=!1,kr=null,vn=0,ui=0,xa=null,_n=-1,yn=0;function at(){return(Re&6)!==0?Ue():_n!==-1?_n:_n=Ue()}function Er(e){return(e.mode&1)===0?1:(Re&2)!==0&&Ze!==0?Ze&-Ze:vf.transition!==null?(yn===0&&(yn=El()),yn):(e=De,e!==0||(e=window.event,e=e===void 0?16:Ol(e.type)),e)}function Ht(e,t,r,s){if(50<ui)throw ui=0,xa=null,Error(f(185));Ms(e,r,s),((Re&2)===0||e!==Je)&&(e===Je&&((Re&2)===0&&(pn|=r),qe===4&&Lr(e,Ze)),pt(e,s),r===1&&Re===0&&(t.mode&1)===0&&(bs=Ue()+500,qi&&wr()))}function pt(e,t){var r=e.callbackNode;gh(e,t);var s=Li(e,e===Je?Ze:0);if(s===0)r!==null&&bl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&bl(r),t===1)e.tag===0?gf(Ou.bind(null,e)):wc(Ou.bind(null,e)),hf(function(){(Re&6)===0&&wr()}),r=null;else{switch(Ll(s)){case 1:r=eo;break;case 4:r=Cl;break;case 16:r=bi;break;case 536870912:r=kl;break;default:r=bi}r=Wu(r,Mu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mu(e,t){if(_n=-1,yn=0,(Re&6)!==0)throw Error(f(327));var r=e.callbackNode;if(Cs()&&e.callbackNode!==r)return null;var s=Li(e,e===Je?Ze:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=wn(e,s);else{t=s;var g=Re;Re|=2;var b=Iu();(Je!==e||Ze!==t)&&(nr=null,bs=Ue()+500,Kr(e,t));do try{If();break}catch(U){Nu(e,U)}while(!0);Ho(),fn.current=b,Re=g,ze!==null?t=0:(Je=null,Ze=0,t=qe)}if(t!==0){if(t===2&&(g=to(e),g!==0&&(s=g,t=ba(e,g))),t===1)throw r=li,Kr(e,0),Lr(e,s),pt(e,Ue()),r;if(t===6)Lr(e,s);else{if(g=e.current.alternate,(s&30)===0&&!Of(g)&&(t=wn(e,s),t===2&&(b=to(e),b!==0&&(s=b,t=ba(e,b))),t===1))throw r=li,Kr(e,0),Lr(e,s),pt(e,Ue()),r;switch(e.finishedWork=g,e.finishedLanes=s,t){case 0:case 1:throw Error(f(345));case 2:Gr(e,ft,nr);break;case 3:if(Lr(e,s),(s&130023424)===s&&(t=wa+500-Ue(),10<t)){if(Li(e,0)!==0)break;if(g=e.suspendedLanes,(g&s)!==s){at(),e.pingedLanes|=e.suspendedLanes&g;break}e.timeoutHandle=jo(Gr.bind(null,e,ft,nr),t);break}Gr(e,ft,nr);break;case 4:if(Lr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,g=-1;0<s;){var O=31-Mt(s);b=1<<O,O=t[O],O>g&&(g=O),s&=~b}if(s=g,s=Ue()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Mf(s/1960))-s,10<s){e.timeoutHandle=jo(Gr.bind(null,e,ft,nr),s);break}Gr(e,ft,nr);break;case 5:Gr(e,ft,nr);break;default:throw Error(f(329))}}}return pt(e,Ue()),e.callbackNode===r?Mu.bind(null,e):null}function ba(e,t){var r=ci;return e.current.memoizedState.isDehydrated&&(Kr(e,t).flags|=256),e=wn(e,t),e!==2&&(t=ft,ft=r,t!==null&&Ca(t)),e}function Ca(e){ft===null?ft=e:ft.push.apply(ft,e)}function Of(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var g=r[s],b=g.getSnapshot;g=g.value;try{if(!Ot(b(),g))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Lr(e,t){for(t&=~ya,t&=~pn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Mt(t),s=1<<r;e[r]=-1,t&=~s}}function Ou(e){if((Re&6)!==0)throw Error(f(327));Cs();var t=Li(e,0);if((t&1)===0)return pt(e,Ue()),null;var r=wn(e,t);if(e.tag!==0&&r===2){var s=to(e);s!==0&&(t=s,r=ba(e,s))}if(r===1)throw r=li,Kr(e,0),Lr(e,t),pt(e,Ue()),r;if(r===6)throw Error(f(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Gr(e,ft,nr),pt(e,Ue()),null}function ka(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(bs=Ue()+500,qi&&wr())}}function qr(e){kr!==null&&kr.tag===0&&(Re&6)===0&&Cs();var t=Re;Re|=1;var r=Rt.transition,s=De;try{if(Rt.transition=null,De=1,e)return e()}finally{De=s,Rt.transition=r,Re=t,(Re&6)===0&&wr()}}function Ea(){St=xs.current,Ie(xs)}function Kr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,df(r)),ze!==null)for(r=ze.return;r!==null;){var s=r;switch(Oo(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&zi();break;case 3:ys(),Ie(ut),Ie(tt),Go();break;case 5:qo(s);break;case 4:ys();break;case 13:Ie(Fe);break;case 19:Ie(Fe);break;case 10:$o(s.type._context);break;case 22:case 23:Ea()}r=r.return}if(Je=e,ze=e=Rr(e.current,null),Ze=St=t,qe=0,li=null,ya=pn=Vr=0,ft=ci=null,Ur!==null){for(t=0;t<Ur.length;t++)if(r=Ur[t],s=r.interleaved,s!==null){r.interleaved=null;var g=s.next,b=r.pending;if(b!==null){var O=b.next;b.next=g,s.next=O}r.pending=s}Ur=null}return e}function Nu(e,t){do{var r=ze;try{if(Ho(),rn.current=an,sn){for(var s=He.memoizedState;s!==null;){var g=s.queue;g!==null&&(g.pending=null),s=s.next}sn=!1}if(zr=0,Ge=Ve=He=null,ri=!1,si=0,_a.current=null,r===null||r.return===null){qe=1,li=t,ze=null;break}e:{var b=e,O=r.return,U=r,V=t;if(t=Ze,U.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var te=V,ae=U,le=ae.tag;if((ae.mode&1)===0&&(le===0||le===11||le===15)){var oe=ae.alternate;oe?(ae.updateQueue=oe.updateQueue,ae.memoizedState=oe.memoizedState,ae.lanes=oe.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var pe=au(O);if(pe!==null){pe.flags&=-257,lu(pe,O,U,b,t),pe.mode&1&&ou(b,te,t),t=pe,V=te;var ge=t.updateQueue;if(ge===null){var ve=new Set;ve.add(V),t.updateQueue=ve}else ge.add(V);break e}else{if((t&1)===0){ou(b,te,t),La();break e}V=Error(f(426))}}else if(Be&&U.mode&1){var We=au(O);if(We!==null){(We.flags&65536)===0&&(We.flags|=256),lu(We,O,U,b,t),Bo(ws(V,U));break e}}b=V=ws(V,U),qe!==4&&(qe=2),ci===null?ci=[b]:ci.push(b),b=O;do{switch(b.tag){case 3:b.flags|=65536,t&=-t,b.lanes|=t;var Y=iu(b,V,t);Pc(b,Y);break e;case 1:U=V;var J=b.type,Z=b.stateNode;if((b.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(Cr===null||!Cr.has(Z)))){b.flags|=65536,t&=-t,b.lanes|=t;var ue=nu(b,U,t);Pc(b,ue);break e}}b=b.return}while(b!==null)}Fu(r)}catch(_e){t=_e,ze===r&&r!==null&&(ze=r=r.return);continue}break}while(!0)}function Iu(){var e=fn.current;return fn.current=an,e===null?an:e}function La(){(qe===0||qe===3||qe===2)&&(qe=4),Je===null||(Vr&268435455)===0&&(pn&268435455)===0||Lr(Je,Ze)}function wn(e,t){var r=Re;Re|=2;var s=Iu();(Je!==e||Ze!==t)&&(nr=null,Kr(e,t));do try{Nf();break}catch(g){Nu(e,g)}while(!0);if(Ho(),Re=r,fn.current=s,ze!==null)throw Error(f(261));return Je=null,Ze=0,qe}function Nf(){for(;ze!==null;)Bu(ze)}function If(){for(;ze!==null&&!ah();)Bu(ze)}function Bu(e){var t=Uu(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?Fu(e):ze=t,_a.current=null}function Fu(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=jf(r,t,St),r!==null){ze=r;return}}else{if(r=Df(r,t),r!==null){r.flags&=32767,ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qe=6,ze=null;return}}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);qe===0&&(qe=5)}function Gr(e,t,r){var s=De,g=Rt.transition;try{Rt.transition=null,De=1,Bf(e,t,r,s)}finally{Rt.transition=g,De=s}return null}function Bf(e,t,r,s){do Cs();while(kr!==null);if((Re&6)!==0)throw Error(f(327));r=e.finishedWork;var g=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(f(177));e.callbackNode=null,e.callbackPriority=0;var b=r.lanes|r.childLanes;if(vh(e,b),e===Je&&(ze=Je=null,Ze=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||gn||(gn=!0,Wu(bi,function(){return Cs(),null})),b=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||b){b=Rt.transition,Rt.transition=null;var O=De;De=1;var U=Re;Re|=4,_a.current=null,Tf(e,r),ju(r,e),sf(Lo),Di=!!Eo,Lo=Eo=null,e.current=r,Af(r),lh(),Re=U,De=O,Rt.transition=b}else e.current=r;if(gn&&(gn=!1,kr=e,vn=g),b=e.pendingLanes,b===0&&(Cr=null),dh(r.stateNode),pt(e,Ue()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)g=t[r],s(g.value,{componentStack:g.stack,digest:g.digest});if(mn)throw mn=!1,e=Sa,Sa=null,e;return(vn&1)!==0&&e.tag!==0&&Cs(),b=e.pendingLanes,(b&1)!==0?e===xa?ui++:(ui=0,xa=e):ui=0,wr(),null}function Cs(){if(kr!==null){var e=Ll(vn),t=Rt.transition,r=De;try{if(Rt.transition=null,De=16>e?16:e,kr===null)var s=!1;else{if(e=kr,kr=null,vn=0,(Re&6)!==0)throw Error(f(331));var g=Re;for(Re|=4,me=e.current;me!==null;){var b=me,O=b.child;if((me.flags&16)!==0){var U=b.deletions;if(U!==null){for(var V=0;V<U.length;V++){var te=U[V];for(me=te;me!==null;){var ae=me;switch(ae.tag){case 0:case 11:case 15:ai(8,ae,b)}var le=ae.child;if(le!==null)le.return=ae,me=le;else for(;me!==null;){ae=me;var oe=ae.sibling,pe=ae.return;if(Cu(ae),ae===te){me=null;break}if(oe!==null){oe.return=pe,me=oe;break}me=pe}}}var ge=b.alternate;if(ge!==null){var ve=ge.child;if(ve!==null){ge.child=null;do{var We=ve.sibling;ve.sibling=null,ve=We}while(ve!==null)}}me=b}}if((b.subtreeFlags&2064)!==0&&O!==null)O.return=b,me=O;else e:for(;me!==null;){if(b=me,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:ai(9,b,b.return)}var Y=b.sibling;if(Y!==null){Y.return=b.return,me=Y;break e}me=b.return}}var J=e.current;for(me=J;me!==null;){O=me;var Z=O.child;if((O.subtreeFlags&2064)!==0&&Z!==null)Z.return=O,me=Z;else e:for(O=J;me!==null;){if(U=me,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:hn(9,U)}}catch(_e){$e(U,U.return,_e)}if(U===O){me=null;break e}var ue=U.sibling;if(ue!==null){ue.return=U.return,me=ue;break e}me=U.return}}if(Re=g,wr(),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Ci,e)}catch{}s=!0}return s}finally{De=r,Rt.transition=t}}return!1}function Hu(e,t,r){t=ws(r,t),t=iu(e,t,1),e=xr(e,t,1),t=at(),e!==null&&(Ms(e,1,t),pt(e,t))}function $e(e,t,r){if(e.tag===3)Hu(e,e,r);else for(;t!==null;){if(t.tag===3){Hu(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Cr===null||!Cr.has(s))){e=ws(r,e),e=nu(t,e,1),t=xr(t,e,1),e=at(),t!==null&&(Ms(t,1,e),pt(t,e));break}}t=t.return}}function Ff(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&r,Je===e&&(Ze&r)===r&&(qe===4||qe===3&&(Ze&130023424)===Ze&&500>Ue()-wa?Kr(e,0):ya|=r),pt(e,t)}function $u(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ei,Ei<<=1,(Ei&130023424)===0&&(Ei=4194304)));var r=at();e=rr(e,t),e!==null&&(Ms(e,t,r),pt(e,r))}function Hf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$u(e,r)}function $f(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,g=e.memoizedState;g!==null&&(r=g.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(f(314))}s!==null&&s.delete(t),$u(e,r)}var Uu;Uu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)ht=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ht=!1,Rf(e,t,r);ht=(e.flags&131072)!==0}else ht=!1,Be&&(t.flags&1048576)!==0&&Sc(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;un(e,t),e=t.pendingProps;var g=hs(t,tt.current);_s(t,r),g=Qo(null,t,s,e,g,r);var b=Yo();return t.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(s)?(b=!0,Vi(t)):b=!1,t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,zo(t),g.updater=ln,t.stateNode=g,g._reactInternals=t,ia(t,s,e,r),t=la(null,t,s,!0,b,r)):(t.tag=0,Be&&b&&Mo(t),ot(null,t,g,r),t=t.child),t;case 16:s=t.elementType;e:{switch(un(e,t),e=t.pendingProps,g=s._init,s=g(s._payload),t.type=s,g=t.tag=Wf(s),e=It(s,e),g){case 0:t=aa(null,t,s,e,r);break e;case 1:t=pu(null,t,s,e,r);break e;case 11:t=cu(null,t,s,e,r);break e;case 14:t=uu(null,t,s,It(s.type,e),r);break e}throw Error(f(306,s,""))}return t;case 0:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),aa(e,t,s,g,r);case 1:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),pu(e,t,s,g,r);case 3:e:{if(mu(t),e===null)throw Error(f(387));s=t.pendingProps,b=t.memoizedState,g=b.element,Dc(e,t),en(t,s,null,r);var O=t.memoizedState;if(s=O.element,b.isDehydrated)if(b={element:s,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},t.updateQueue.baseState=b,t.memoizedState=b,t.flags&256){g=ws(Error(f(423)),t),t=gu(e,t,s,r,g);break e}else if(s!==g){g=ws(Error(f(424)),t),t=gu(e,t,s,r,g);break e}else for(wt=vr(t.stateNode.containerInfo.firstChild),yt=t,Be=!0,Nt=null,r=Rc(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ms(),s===g){t=ir(e,t,r);break e}ot(e,t,s,r)}t=t.child}return t;case 5:return Ac(t),e===null&&Io(t),s=t.type,g=t.pendingProps,b=e!==null?e.memoizedProps:null,O=g.children,Ro(s,g)?O=null:b!==null&&Ro(s,b)&&(t.flags|=32),fu(e,t),ot(e,t,O,r),t.child;case 6:return e===null&&Io(t),null;case 13:return vu(e,t,r);case 4:return Vo(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gs(t,null,s,r):ot(e,t,s,r),t.child;case 11:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),cu(e,t,s,g,r);case 7:return ot(e,t,t.pendingProps,r),t.child;case 8:return ot(e,t,t.pendingProps.children,r),t.child;case 12:return ot(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,g=t.pendingProps,b=t.memoizedProps,O=g.value,Ae(Qi,s._currentValue),s._currentValue=O,b!==null)if(Ot(b.value,O)){if(b.children===g.children&&!ut.current){t=ir(e,t,r);break e}}else for(b=t.child,b!==null&&(b.return=t);b!==null;){var U=b.dependencies;if(U!==null){O=b.child;for(var V=U.firstContext;V!==null;){if(V.context===s){if(b.tag===1){V=sr(-1,r&-r),V.tag=2;var te=b.updateQueue;if(te!==null){te=te.shared;var ae=te.pending;ae===null?V.next=V:(V.next=ae.next,ae.next=V),te.pending=V}}b.lanes|=r,V=b.alternate,V!==null&&(V.lanes|=r),Uo(b.return,r,t),U.lanes|=r;break}V=V.next}}else if(b.tag===10)O=b.type===t.type?null:b.child;else if(b.tag===18){if(O=b.return,O===null)throw Error(f(341));O.lanes|=r,U=O.alternate,U!==null&&(U.lanes|=r),Uo(O,r,t),O=b.sibling}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===t){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}ot(e,t,g.children,r),t=t.child}return t;case 9:return g=t.type,s=t.pendingProps.children,_s(t,r),g=Et(g),s=s(g),t.flags|=1,ot(e,t,s,r),t.child;case 14:return s=t.type,g=It(s,t.pendingProps),g=It(s.type,g),uu(e,t,s,g,r);case 15:return du(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),un(e,t),t.tag=1,dt(s)?(e=!0,Vi(t)):e=!1,_s(t,r),ru(t,s,g),ia(t,s,g,r),la(null,t,s,!0,e,r);case 19:return yu(e,t,r);case 22:return hu(e,t,r)}throw Error(f(156,t.tag))};function Wu(e,t){return xl(e,t)}function Uf(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,r,s){return new Uf(e,t,r,s)}function Ra(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wf(e){if(typeof e=="function")return Ra(e)?1:0;if(e!=null){if(e=e.$$typeof,e===W)return 11;if(e===q)return 14}return 2}function Rr(e,t){var r=e.alternate;return r===null?(r=jt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Sn(e,t,r,s,g,b){var O=2;if(s=e,typeof e=="function")Ra(e)&&(O=1);else if(typeof e=="string")O=5;else e:switch(e){case D:return Jr(r.children,g,b,t);case x:O=8,g|=8;break;case P:return e=jt(12,r,t,g|2),e.elementType=P,e.lanes=b,e;case I:return e=jt(13,r,t,g),e.elementType=I,e.lanes=b,e;case X:return e=jt(19,r,t,g),e.elementType=X,e.lanes=b,e;case re:return xn(r,g,b,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:O=10;break e;case $:O=9;break e;case W:O=11;break e;case q:O=14;break e;case z:O=16,s=null;break e}throw Error(f(130,e==null?e:typeof e,""))}return t=jt(O,r,t,g),t.elementType=e,t.type=s,t.lanes=b,t}function Jr(e,t,r,s){return e=jt(7,e,s,t),e.lanes=r,e}function xn(e,t,r,s){return e=jt(22,e,s,t),e.elementType=re,e.lanes=r,e.stateNode={isHidden:!1},e}function ja(e,t,r){return e=jt(6,e,null,t),e.lanes=r,e}function Da(e,t,r){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zf(e,t,r,s,g){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=ro(0),this.expirationTimes=ro(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ro(0),this.identifierPrefix=s,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Pa(e,t,r,s,g,b,O,U,V){return e=new zf(e,t,r,U,V),t===1?(t=1,b===!0&&(t|=8)):t=0,b=jt(3,null,null,t),e.current=b,b.stateNode=e,b.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zo(b),e}function Vf(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:L,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function zu(e){if(!e)return yr;e=e._reactInternals;e:{if(Ir(e)!==e||e.tag!==1)throw Error(f(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(f(171))}if(e.tag===1){var r=e.type;if(dt(r))return _c(e,r,t)}return t}function Vu(e,t,r,s,g,b,O,U,V){return e=Pa(r,s,!0,e,g,b,O,U,V),e.context=zu(null),r=e.current,s=at(),g=Er(r),b=sr(s,g),b.callback=t??null,xr(r,b,g),e.current.lanes=g,Ms(e,g,s),pt(e,s),e}function bn(e,t,r,s){var g=t.current,b=at(),O=Er(g);return r=zu(r),t.context===null?t.context=r:t.pendingContext=r,t=sr(b,O),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=xr(g,t,O),e!==null&&(Ht(e,g,O,b),Zi(e,g,O)),O}function Cn(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 qu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ta(e,t){qu(e,t),(e=e.alternate)&&qu(e,t)}function qf(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Aa(e){this._internalRoot=e}kn.prototype.render=Aa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));bn(e,t,null,null)},kn.prototype.unmount=Aa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qr(function(){bn(null,e,null,null)}),t[Yt]=null}};function kn(e){this._internalRoot=e}kn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<pr.length&&t!==0&&t<pr[r].priority;r++);pr.splice(r,0,e),r===0&&Al(e)}};function Ma(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function En(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gu(){}function Kf(e,t,r,s,g){if(g){if(typeof s=="function"){var b=s;s=function(){var te=Cn(O);b.call(te)}}var O=Vu(t,s,e,0,null,!1,!1,"",Gu);return e._reactRootContainer=O,e[Yt]=O.current,Gs(e.nodeType===8?e.parentNode:e),qr(),O}for(;g=e.lastChild;)e.removeChild(g);if(typeof s=="function"){var U=s;s=function(){var te=Cn(V);U.call(te)}}var V=Pa(e,0,!1,null,null,!1,!1,"",Gu);return e._reactRootContainer=V,e[Yt]=V.current,Gs(e.nodeType===8?e.parentNode:e),qr(function(){bn(t,V,r,s)}),V}function Ln(e,t,r,s,g){var b=r._reactRootContainer;if(b){var O=b;if(typeof g=="function"){var U=g;g=function(){var V=Cn(O);U.call(V)}}bn(t,O,e,g)}else O=Kf(r,t,e,g,s);return Cn(O)}Rl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=As(t.pendingLanes);r!==0&&(so(t,r|1),pt(t,Ue()),(Re&6)===0&&(bs=Ue()+500,wr()))}break;case 13:qr(function(){var s=rr(e,1);if(s!==null){var g=at();Ht(s,e,1,g)}}),Ta(e,1)}},io=function(e){if(e.tag===13){var t=rr(e,134217728);if(t!==null){var r=at();Ht(t,e,134217728,r)}Ta(e,134217728)}},jl=function(e){if(e.tag===13){var t=Er(e),r=rr(e,t);if(r!==null){var s=at();Ht(r,e,t,s)}Ta(e,t)}},Dl=function(){return De},Pl=function(e,t){var r=De;try{return De=e,t()}finally{De=r}},Xn=function(e,t,r){switch(t){case"input":if(be(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var g=Wi(s);if(!g)throw Error(f(90));he(s),be(s,g)}}}break;case"textarea":cr(e,r);break;case"select":t=r.value,t!=null&&Ut(e,!!r.multiple,t,!1)}},ml=ka,gl=qr;var Gf={usingClientEntryPoint:!1,Events:[Qs,us,Wi,fl,pl,ka]},di={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jf={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.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=wl(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||qf,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 Rn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rn.isDisabled&&Rn.supportsFiber)try{Ci=Rn.inject(Jf),Wt=Rn}catch{}}return mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gf,mt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(f(200));return Vf(e,t,null,r)},mt.createRoot=function(e,t){if(!Ma(e))throw Error(f(299));var r=!1,s="",g=Ku;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Pa(e,1,!1,null,null,r,!1,s,g),e[Yt]=t.current,Gs(e.nodeType===8?e.parentNode:e),new Aa(t)},mt.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(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=wl(t),e=e===null?null:e.stateNode,e},mt.flushSync=function(e){return qr(e)},mt.hydrate=function(e,t,r){if(!En(t))throw Error(f(200));return Ln(null,e,t,!0,r)},mt.hydrateRoot=function(e,t,r){if(!Ma(e))throw Error(f(405));var s=r!=null&&r.hydratedSources||null,g=!1,b="",O=Ku;if(r!=null&&(r.unstable_strictMode===!0&&(g=!0),r.identifierPrefix!==void 0&&(b=r.identifierPrefix),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),t=Vu(t,null,e,1,r??null,g,!1,b,O),e[Yt]=t.current,Gs(e),s)for(e=0;e<s.length;e++)r=s[e],g=r._getVersion,g=g(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,g]:t.mutableSourceEagerHydrationData.push(r,g);return new kn(t)},mt.render=function(e,t,r){if(!En(t))throw Error(f(200));return Ln(null,e,t,!1,r)},mt.unmountComponentAtNode=function(e){if(!En(e))throw Error(f(40));return e._reactRootContainer?(qr(function(){Ln(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1},mt.unstable_batchedUpdates=ka,mt.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!En(r))throw Error(f(200));if(e==null||e._reactInternals===void 0)throw Error(f(38));return Ln(e,t,r,!1,s)},mt.version="18.3.1-next-f1338f8080-20240426",mt}var rd;function np(){if(rd)return Ba.exports;rd=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(p){console.error(p)}}return a(),Ba.exports=ip(),Ba.exports}var sd;function op(){if(sd)return jn;sd=1;var a=np();return jn.createRoot=a.createRoot,jn.hydrateRoot=a.hydrateRoot,jn}var ap=op();const lp=Td(ap);var K=tl();const Gt=Td(K),id=a=>{let p;const f=new Set,C=(m,_)=>{const h=typeof m=="function"?m(p):m;if(!Object.is(h,p)){const y=p;p=_??(typeof h!="object"||h===null)?h:Object.assign({},p,h),f.forEach(S=>S(p,y))}},j=()=>p,i={setState:C,getState:j,getInitialState:()=>d,subscribe:m=>(f.add(m),()=>f.delete(m))},d=p=a(C,j,i);return i},cp=(a=>a?id(a):id),up=a=>a;function dp(a,p=up){const f=Gt.useSyncExternalStore(a.subscribe,Gt.useCallback(()=>p(a.getState()),[a,p]),Gt.useCallback(()=>p(a.getInitialState()),[a,p]));return Gt.useDebugValue(f),f}const nd=a=>{const p=cp(a),f=C=>dp(p,C);return Object.assign(f,p),f},$n=(a=>a?nd(a):nd);function $t(a){return"'"+a.replace(/'/g,"'\\''")+"'"}const $a=({sessionId:a})=>`claude --dangerously-skip-permissions --session-id ${$t(a)}`,od=({sessionId:a})=>`claude --session-id ${$t(a)}`,hp=()=>"claude --resume",Ad=[{id:"sm-dangerous",label:"Session Manager (skip perms)",description:"claude --dangerously-skip-permissions in this project",category:"build",cwd:"app-cwd",command:$a},{id:"sm-safe",label:"Session Manager (safe)",description:"claude with normal permission prompts in this project",category:"build",cwd:"app-cwd",command:od},{id:"home-dangerous",label:"Home (skip perms)",description:"claude --dangerously-skip-permissions in ~",category:"build",cwd:"home",command:$a},{id:"pick-dangerous",label:"Pick directory (skip perms)…",description:"Choose a folder, launch claude --dangerously-skip-permissions",category:"build",cwd:"pick",command:$a},{id:"pick-safe",label:"Pick directory (safe)…",description:"Choose a folder, launch claude with normal prompts",category:"build",cwd:"pick",command:od},{id:"pick-resume",label:"Pick directory + resume…",description:"Choose a folder, then pick a past session to resume",category:"build",cwd:"pick",command:hp},{id:"pick-shell",label:"Pick directory (shell only)…",description:"Bare interactive shell, no claude auto-launch",category:"build",cwd:"pick",command:null}];let Dt=null;async function fp(){if(Dt)return Dt;try{const a=await window.api.app.engageRulesPath();if(!a)return Dt=[],Dt;const p=await window.api.config.readJson(a);if(!p.exists||p.parseError||!p.data)return Dt=[],Dt;const f=p.data;if(!f.presets||!Array.isArray(f.presets))return Dt=[],Dt;const C=f.projectPath;return Dt=f.presets.map(j=>({id:j.id,label:j.label,description:j.description,category:"engage",cwd:C,platform:j.platform,pipeline:j.pipeline,rules:j.rules,command:()=>`cd ${$t(C)} && ${j.cliEntry}`})),Dt}catch(a){return console.warn("[presets] Failed to load engage presets:",a),Dt=[],Dt}}async function pp(a){const p=Ad.find(C=>C.id===a);return p||((await fp()).find(C=>C.id===a)??null)}async function mp(a){return a.cwd==="app-cwd"?window.api.app.cwd():a.cwd==="home"?window.api.app.homeDir():a.cwd==="pick"?window.api.app.pickDirectory():a.cwd}function Md(a,p){return a.command?a.command(p):null}function gp(a){const p=a.split("/").filter(Boolean);return p[p.length-1]||a}const Le=$n((a,p)=>({tabs:[],activeTabId:null,hydrated:!1,addTab:({id:f,cwd:C,startupCommand:j,presetId:M=null,label:R})=>{const i=f??crypto.randomUUID();if(p().tabs.find(_=>_.id===i))return a({activeTabId:i}),i;const m={id:i,claudeSessionId:i,label:R??gp(C),cwd:C,pid:null,status:"spawning",exitCode:null,startupCommand:j,presetId:M,generation:0};return a({tabs:[...p().tabs,m],activeTabId:i}),i},setTabRunning:(f,C)=>a({tabs:p().tabs.map(j=>j.id===f?{...j,pid:C,status:"running"}:j)}),setTabExited:(f,C)=>a({tabs:p().tabs.map(j=>j.id===f?{...j,status:"exited",exitCode:C}:j)}),closeTab:f=>{var M;window.api.pty.kill(f);const C=p().tabs.filter(R=>R.id!==f),j=p().activeTabId===f?((M=C[C.length-1])==null?void 0:M.id)??null:p().activeTabId;a({tabs:C,activeTabId:j})},setActive:f=>a({activeTabId:f}),restartTab:f=>{const C=p().tabs.find(R=>R.id===f);if(!C)return;window.api.pty.kill(f);const j=crypto.randomUUID(),M=R=>{a({tabs:p().tabs.map(i=>i.id===f?{...i,claudeSessionId:j,pid:null,status:"spawning",exitCode:null,startupCommand:R,generation:i.generation+1}:i)})};C.presetId?pp(C.presetId).then(R=>{M(R?Md(R,{sessionId:j,cwd:C.cwd}):`claude --dangerously-skip-permissions --session-id ${$t(j)}`)}):M(`claude --dangerously-skip-permissions --session-id ${$t(j)}`)},reorderTab:(f,C)=>{const j=[...p().tabs];if(f<0||f>=j.length||C<0||C>=j.length||f===C)return;const[M]=j.splice(f,1);j.splice(C,0,M),a({tabs:j})},restoreTabs:(f,C)=>a({tabs:f,activeTabId:C,hydrated:!0})}));async function vp(){var f;if(Le.getState().hydrated)return;try{const{tabs:C,activeTabId:j,freshStart:M}=await window.api.sessions.load();if(C.length>0){const R=await Promise.all(C.map(async d=>{let m=!M;if(m){const h=await window.api.transcripts.pathFor(d.cwd,d.claudeSessionId);m=await window.api.config.exists(h)}const _=m?d.claudeSessionId:crypto.randomUUID();return{id:d.id,claudeSessionId:_,cwd:d.cwd,label:d.label,presetId:d.presetId,pid:null,status:"spawning",exitCode:null,startupCommand:m?`claude --dangerously-skip-permissions --resume ${$t(_)}`:`claude --dangerously-skip-permissions --session-id ${$t(_)}`,generation:0}})),i=j&&R.find(d=>d.id===j)?j:((f=R[0])==null?void 0:f.id)??null;Le.getState().restoreTabs(R,i)}else Le.setState({hydrated:!0})}catch(C){console.warn("[sessions] hydrate failed:",C),Le.setState({hydrated:!0})}const a=()=>{const{tabs:C,activeTabId:j}=Le.getState(),M=C.map(R=>({id:R.id,claudeSessionId:R.claudeSessionId,cwd:R.cwd,label:R.label,presetId:R.presetId}));window.api.sessions.save({tabs:M,activeTabId:j}).catch(R=>{console.warn("[sessions] save failed:",R)})};let p=null;Le.subscribe((C,j)=>{C.hydrated&&(C.tabs===j.tabs&&C.activeTabId===j.activeTabId||(p!==null&&window.clearTimeout(p),p=window.setTimeout(a,200)))}),a()}const _p=4,ad=40,ld=6;function yp(a){const{tabCount:p,onReorder:f}=a,C=K.useRef(null),j=K.useRef(null),M=K.useRef(0),R=K.useRef(0),[i,d]=K.useState(!1),[,m]=K.useState(0),_=K.useCallback(()=>C.current?Array.from(C.current.querySelectorAll("[data-drag-index]")):[],[]),h=K.useCallback((v,n,u)=>{for(let o=0;o<n.length;o++){const l=n[o].left+n[o].width/2;if(v<l)return o<=u?o:o-1}return n.length-1},[]),y=K.useCallback(()=>{const v=j.current,n=C.current;if(!(v!=null&&v.active)||!n)return;const u=n.getBoundingClientRect(),o=v.startX+v.deltaX,l=o-u.left,w=u.right-o;l<ad?n.scrollLeft-=ld:w<ad&&(n.scrollLeft+=ld),M.current=requestAnimationFrame(y)},[]);K.useEffect(()=>{const v=C.current;if(!v)return;let n=!1;const u=()=>{n||(n=!0,R.current=requestAnimationFrame(()=>{n=!1,m(w=>w+1)}))},o=w=>{const E=j.current;if(!E)return;const L=w.clientX-E.startX;if(!E.active&&Math.abs(L)<_p)return;E.active||(E.active=!0,E.tabRects=_().map(P=>P.getBoundingClientRect()),d(!0),M.current=requestAnimationFrame(y)),E.deltaX=L;const D=E.tabRects[E.fromIndex],x=D.left+D.width/2+L;E.currentIndex=h(x,E.tabRects,E.fromIndex),u()},l=w=>{const E=j.current;if(E&&E.pointerId===w.pointerId){cancelAnimationFrame(M.current),cancelAnimationFrame(R.current);try{v.releasePointerCapture(E.pointerId)}catch{}E.active&&E.fromIndex!==E.currentIndex&&f(E.fromIndex,E.currentIndex),j.current=null,d(!1),m(L=>L+1)}};return v.addEventListener("pointermove",o),v.addEventListener("pointerup",l),v.addEventListener("pointercancel",l),()=>{v.removeEventListener("pointermove",o),v.removeEventListener("pointerup",l),v.removeEventListener("pointercancel",l),cancelAnimationFrame(M.current),cancelAnimationFrame(R.current)}},[f,_,h,y]);const S=K.useCallback((v,n)=>{var o;v.button!==0||p<=1||v.target.closest("button")||((o=C.current)==null||o.setPointerCapture(v.pointerId),j.current={active:!1,fromIndex:n,currentIndex:n,startX:v.clientX,deltaX:0,tabRects:[],pointerId:v.pointerId})},[p]);return{getTabDragProps:K.useCallback(v=>{var o;const n=j.current,u={};if(n!=null&&n.active)if(v===n.fromIndex)u.transform=`translateX(${n.deltaX}px) scale(1.03)`,u.zIndex=10,u.opacity=.85,u.boxShadow="0 2px 8px rgba(0,0,0,0.4)",u.position="relative",u.pointerEvents="none";else{const l=n.fromIndex,w=n.currentIndex,L=(((o=n.tabRects[l])==null?void 0:o.width)??0)+4;u.transition="transform 0.15s ease",l<w&&v>l&&v<=w?u.transform=`translateX(-${L}px)`:l>w&&v>=w&&v<l?u.transform=`translateX(${L}px)`:u.transform="translateX(0)"}return{onPointerDown:l=>S(l,v),style:u,"data-drag-index":v}},[S]),isDragging:i,containerRef:C}}function wp(){const{tabs:a,activeTabId:p,addTab:f,closeTab:C,setActive:j,reorderTab:M}=Le(),[R,i]=K.useState(null),{getTabDragProps:d,isDragging:m,containerRef:_}=yp({tabCount:a.length,onReorder:M}),h=async()=>{i(null);try{const y=await window.api.app.pickDirectory();if(!y)return;const S=crypto.randomUUID(),k=`claude --dangerously-skip-permissions --session-id ${$t(S)}`;f({id:S,cwd:y,startupCommand:k,presetId:"pick-dangerous"})}catch(y){const S=y instanceof Error?y.message:String(y);i(S),console.error("[TabBar] createPickedSession failed:",y)}};return c.jsxs("div",{className:"h-9 bg-bg-elev border-b border-line flex items-center px-2 gap-1 shrink-0",children:[c.jsx("div",{ref:_,className:`flex items-center gap-1 overflow-x-auto min-w-0 flex-1 select-none ${m?"cursor-grabbing":""}`,children:a.map((y,S)=>{const k=y.id===p,v=d(S);return c.jsxs("div",{onClick:()=>{m||j(y.id)},...v,style:v.style,className:`group px-3 py-1 flex items-center gap-2 border border-line rounded-t text-xs shrink-0 ${m?"":"cursor-grab"} ${k?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg"}`,title:y.cwd,children:[c.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${y.status==="running"?"bg-green-500":y.status==="spawning"?"bg-yellow-500 animate-pulse":"bg-fg-faint"}`}),c.jsx("span",{children:y.label}),c.jsx("button",{onClick:n=>{n.stopPropagation(),C(y.id)},className:"text-fg-faint opacity-0 group-hover:opacity-100 hover:text-fg ml-1",title:"Close session",children:"×"})]},y.id)})}),c.jsx("div",{className:"shrink-0",children:c.jsx("button",{onClick:h,className:"px-2 py-1 text-fg-dim hover:text-fg text-xs",title:"New session — pick a project directory",children:"+ new"})}),R&&c.jsx("div",{className:"text-red-400 text-xs px-2 shrink-0",children:R}),c.jsx("div",{className:"text-fg-faint text-xs px-2 shrink-0",children:"Claude Session Manager"})]})}const Sp=5e3,On=16e3;let Dn=null,In=!1,Qr=!1;function Od(){return Dn||(Dn=new Worker(new URL(""+new URL("whisperWorker-BhZpQ_3S.js",import.meta.url).href,import.meta.url),{type:"module"}),Dn)}function xp(a){if(In||Qr)return;Qr=!0;const p=Od(),f=C=>{C.data.type==="status"&&(a==null||a(C.data.status,C.data.message),C.data.status==="ready"&&(In=!0,Qr=!1)),C.data.type==="error"&&(Qr=!1,a==null||a("error",C.data.error))};p.addEventListener("message",f),p.postMessage({type:"load"})}function bp(){var a;return typeof Worker<"u"&&!!((a=navigator.mediaDevices)!=null&&a.getUserMedia)}async function Cp(a){const p=await a.arrayBuffer(),C=await new OfflineAudioContext(1,1,On).decodeAudioData(p),j=new OfflineAudioContext(1,Math.ceil(C.duration*On),On),M=j.createBufferSource();return M.buffer=C,M.connect(j.destination),M.start(),(await j.startRendering()).getChannelData(0)}function kp(a){const p=Od();let f=!1,C=null,j=null,M=[],R=null;const i=async()=>{if(M.length===0)return;const m=new Blob(M,{type:M[0].type});M=[];try{const _=await Cp(m);p.postMessage({type:"transcribe",audio:_},[_.buffer])}catch{}},d=m=>{var _;if(!f)if(m.data.type==="result"){const h=m.data.text;h&&a.onFinal(h)}else m.data.type==="error"?a.onError(m.data.error):m.data.type==="status"&&((_=a.onModelStatus)==null||_.call(a,m.data.status,m.data.message),m.data.status==="ready"&&(In=!0,Qr=!1))};return p.addEventListener("message",d),{start:async()=>{if(!f){!In&&!Qr&&(Qr=!0,a.onInterim("Loading speech model..."),p.postMessage({type:"load"}));try{j=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:On,channelCount:1,echoCancellation:!0}})}catch(m){const _=m instanceof Error?m.message:"Microphone access denied";a.onError(_);return}C=new MediaRecorder(j,{mimeType:MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm"}),C.ondataavailable=m=>{m.data.size>0&&M.push(m.data)},C.start(1e3),a.onInterim("Listening..."),R=setInterval(()=>{!f&&M.length>0&&(a.onInterim("Transcribing..."),i())},Sp)}},stop:()=>{R&&(clearInterval(R),R=null),C&&C.state!=="inactive"&&C.stop(),M.length>0&&(a.onInterim("Transcribing..."),i()),j==null||j.getTracks().forEach(m=>m.stop()),j=null,C=null},destroy:()=>{if(f=!0,R&&(clearInterval(R),R=null),C&&C.state!=="inactive")try{C.stop()}catch{}j==null||j.getTracks().forEach(m=>m.stop()),j=null,C=null,p.removeEventListener("message",d)}}}let or=null;const bt=$n((a,p)=>({isRecording:!1,ttsEnabled:!1,autoSend:!1,lastTranscript:"",error:null,modelStatus:"idle",initModel:()=>{p().modelStatus==="idle"&&(a({modelStatus:"loading"}),xp(f=>{a(f==="ready"?{modelStatus:"ready"}:f==="error"?{modelStatus:"error"}:{modelStatus:"loading"})}))},startRecording:f=>{if(!p().isRecording){if(!bp()){a({error:"Microphone or Web Worker not available"});return}try{const C=kp({onInterim:j=>a({lastTranscript:j}),onFinal:j=>{const M=p().autoSend?j+`
|
|
42
|
-
`:j;window.api.pty.write({tabId:f,data:M}),a({lastTranscript:""})},onError:j=>{a({error:j,isRecording:!1}),or==null||or.destroy(),or=null},onModelStatus:j=>{j==="ready"?a({modelStatus:"ready"}):j==="loading"&&a({modelStatus:"loading"})}});C.start(),or=C,a({isRecording:!0,error:null,lastTranscript:""})}catch(C){a({error:C instanceof Error?C.message:"Failed to start recording"})}}},stopRecording:()=>{or&&(or.stop(),or.destroy(),or=null),a({isRecording:!1,lastTranscript:""})},toggleTTS:()=>a(f=>({ttsEnabled:!f.ttsEnabled})),setAutoSend:f=>a({autoSend:f}),clearError:()=>a({error:null})}));function Ep(){const a=bt(_=>_.isRecording),p=bt(_=>_.error),f=bt(_=>_.modelStatus),C=bt(_=>_.startRecording),j=bt(_=>_.stopRecording),M=bt(_=>_.initModel),R=Le(_=>_.activeTabId);K.useEffect(()=>{M()},[M]);const i=()=>{a?j():R&&C(R)},d=f==="loading",m=p||(d?"Downloading speech model...":a?"Stop recording":"Voice input (local Whisper, fully offline)");return
|
|
43
|
-
`)))),this.register(this._terminal.onA11yTab((
|
|
44
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,l){this._liveRegionDebouncer.refresh(o,l,this._terminal.rows)}_renderRows(o,l){const w=this._terminal.buffer,E=w.lines.length.toString();for(let L=o;L<=l;L++){const D=w.lines.get(w.ydisp+L),x=[],P=(D==null?void 0:D.translateToString(!0,void 0,void 0,x))||"",H=(w.ydisp+L+1).toString(),$=this._rowElements[L];$&&(P.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=P,this._rowColumns.set($,x)),$.setAttribute("aria-posinset",H),$.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,l){const w=o.target,E=this._rowElements[l===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==E)return;let L,D;if(l===0?(L=w,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(L=this._rowElements.shift(),D=w,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var P;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:o.anchorNode,offset:o.anchorOffset},w={node:o.focusNode,offset:o.focusOffset};if((l.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===w.node&&l.offset>w.offset)&&([l,w]=[w,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const E=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:E,offset:((P=E.textContent)==null?void 0:P.length)??0}),!this._rowContainer.contains(w.node))return;const L=({node:H,offset:$})=>{const W=H instanceof Text?H.parentNode:H;let I=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const X=this._rowColumns.get(W);if(!X)return console.warn("columns is null. Race condition?"),null;let q=$<X.length?X[$]:X.slice(-1)[0]+1;return q>=this._terminal.cols&&(++I,q=0),{row:I,column:q}},D=L(l),x=L(w);if(D&&x){if(D.row>x.row||D.row===x.row&&D.column>=x.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(x.row-D.row)*this._terminal.cols-D.column+x.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_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 o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=u=m([_(1,v.IInstantiationService),_(2,k.ICoreBrowserService),_(3,k.IRenderService)],u)},3614:(R,i)=>{function d(y){return y.replace(/\r?\n/g,"\r")}function m(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function _(y,S,k,v){y=m(y=d(y),k.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(y,!0),S.value=""}function h(y,S,k){const v=k.getBoundingClientRect(),n=y.clientX-v.left-10,u=y.clientY-v.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${n}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=d,i.bracketTextForPaste=m,i.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},i.handlePasteEvent=function(y,S,k,v){y.stopPropagation(),y.clipboardData&&_(y.clipboardData.getData("text/plain"),S,k,v)},i.paste=_,i.moveTextAreaUnderMouseCursor=h,i.rightClickHandler=function(y,S,k,v,n){h(y,S,k),n&&v.rightClickSelect(y),S.value=v.selectionText,S.select()}},7239:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const m=d(1505);i.ColorContrastCache=class{constructor(){this._color=new m.TwoKeyMap,this._css=new m.TwoKeyMap}setCss(_,h,y){this._css.set(_,h,y)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,y){this._color.set(_,h,y)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(d,m,_,h){d.addEventListener(m,_,h);let y=!1;return{dispose:()=>{y||(y=!0,d.removeEventListener(m,_,h))}}}},3551:function(R,i,d){var m=this&&this.__decorate||function(u,o,l,w){var E,L=arguments.length,D=L<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,o,l,w);else for(var x=u.length-1;x>=0;x--)(E=u[x])&&(D=(L<3?E(D):L>3?E(o,l,D):E(o,l))||D);return L>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(u,o){return function(l,w){o(l,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const h=d(3656),y=d(8460),S=d(844),k=d(2585),v=d(4725);let n=i.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(u,o,l,w,E){super(),this._element=u,this._mouseService=o,this._renderService=l,this._bufferService=w,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var L;this._lastMouseEvent=void 0,(L=this._activeProviderReplies)==null||L.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(u){this._lastMouseEvent=u;const o=this._positionFromMouseEvent(u,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const l=u.composedPath();for(let w=0;w<l.length;w++){const E=l[w];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_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,o){var w,E;this._activeProviderReplies&&o||((w=this._activeProviderReplies)==null||w.forEach((L=>{L==null||L.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=u.y);let l=!1;for(const[L,D]of this._linkProviderService.linkProviders.entries())o?(E=this._activeProviderReplies)!=null&&E.get(L)&&(l=this._checkLinkProviderResult(L,u,l)):D.provideLinks(u.y,(x=>{var H,$;if(this._isMouseOut)return;const P=x==null?void 0:x.map((W=>({link:W})));(H=this._activeProviderReplies)==null||H.set(L,P),l=this._checkLinkProviderResult(L,u,l),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(u.y,this._activeProviderReplies)}))}_removeIntersectingLinks(u,o){const l=new Set;for(let w=0;w<o.size;w++){const E=o.get(w);if(E)for(let L=0;L<E.length;L++){const D=E[L],x=D.link.range.start.y<u?0:D.link.range.start.x,P=D.link.range.end.y>u?this._bufferService.cols:D.link.range.end.x;for(let H=x;H<=P;H++){if(l.has(H)){E.splice(L--,1);break}l.add(H)}}}}_checkLinkProviderResult(u,o,l){var L;if(!this._activeProviderReplies)return l;const w=this._activeProviderReplies.get(u);let E=!1;for(let D=0;D<u;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(E=!0);if(!E&&w){const D=w.find((x=>this._linkAtPosition(x.link,o)));D&&(l=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let D=0;D<this._activeProviderReplies.size;D++){const x=(L=this._activeProviderReplies.get(D))==null?void 0:L.find((P=>this._linkAtPosition(P.link,o)));if(x){l=!0,this._handleNewLink(x);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(u){if(!this._currentLink)return;const o=this._positionFromMouseEvent(u,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(u,this._currentLink.link.text)}_clearCurrentLink(u,o){this._currentLink&&this._lastMouseEvent&&(!u||!o||this._currentLink.link.range.start.y>=u&&this._currentLink.link.range.end.y<=o)&&(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 o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(u.link,o)&&(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 l,w;return(w=(l=this._currentLink)==null?void 0:l.state)==null?void 0:w.decorations.pointerCursor},set:l=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,w;return(w=(l=this._currentLink)==null?void 0:l.state)==null?void 0:w.decorations.underline},set:l=>{var w,E,L;(w=this._currentLink)!=null&&w.state&&((L=(E=this._currentLink)==null?void 0:E.state)==null?void 0:L.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(u.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const w=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(w,E),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(u,o,l){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&u.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(l,o.text)}_fireUnderlineEvent(u,o){const l=u.range,w=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-w-1,l.end.x,l.end.y-w-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(u,o,l){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&u.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(l,o.text)}_linkAtPosition(u,o){const l=u.range.start.y*this._bufferService.cols+u.range.start.x,w=u.range.end.y*this._bufferService.cols+u.range.end.x,E=o.y*this._bufferService.cols+o.x;return l<=E&&E<=w}_positionFromMouseEvent(u,o,l){const w=l.getCoords(u,o,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(u,o,l,w,E){return{x1:u,y1:o,x2:l,y2:w,cols:this._bufferService.cols,fg:E}}};i.Linkifier=n=m([_(1,v.IMouseService),_(2,v.IRenderService),_(3,k.IBufferService),_(4,v.ILinkProviderService)],n)},9042:(R,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(R,i,d){var m=this&&this.__decorate||function(v,n,u,o){var l,w=arguments.length,E=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,u,o);else for(var L=v.length-1;L>=0;L--)(l=v[L])&&(E=(w<3?l(E):w>3?l(n,u,E):l(n,u))||E);return w>3&&E&&Object.defineProperty(n,u,E),E},_=this&&this.__param||function(v,n){return function(u,o){n(u,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const h=d(511),y=d(2585);let S=i.OscLinkProvider=class{constructor(v,n,u){this._bufferService=v,this._optionsService=n,this._oscLinkService=u}provideLinks(v,n){var P;const u=this._bufferService.buffer.lines.get(v-1);if(!u)return void n(void 0);const o=[],l=this._optionsService.rawOptions.linkHandler,w=new h.CellData,E=u.getTrimmedLength();let L=-1,D=-1,x=!1;for(let H=0;H<E;H++)if(D!==-1||u.hasContent(H)){if(u.loadCell(H,w),w.hasExtendedAttrs()&&w.extended.urlId){if(D===-1){D=H,L=w.extended.urlId;continue}x=w.extended.urlId!==L}else D!==-1&&(x=!0);if(x||D!==-1&&H===E-1){const $=(P=this._oscLinkService.getLinkData(L))==null?void 0:P.uri;if($){const W={start:{x:D+1,y:v},end:{x:H+(x||H!==E-1?0:1),y:v}};let I=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const X=new URL($);["http:","https:"].includes(X.protocol)||(I=!0)}catch{I=!0}I||o.push({text:$,range:W,activate:(X,q)=>l?l.activate(X,q,W):k(0,q),hover:(X,q)=>{var z;return(z=l==null?void 0:l.hover)==null?void 0:z.call(l,X,q,W)},leave:(X,q)=>{var z;return(z=l==null?void 0:l.leave)==null?void 0:z.call(l,X,q,W)}})}x=!1,w.hasExtendedAttrs()&&w.extended.urlId?(D=H,L=w.extended.urlId):(D=-1,L=-1)}}n(o)}};function k(v,n){if(confirm(`Do you want to navigate to ${n}?
|
|
41
|
+
`+b.stack}return{value:e,source:t,stack:g,digest:null}}function na(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function oa(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var kf=typeof WeakMap=="function"?WeakMap:Map;function iu(e,t,r){r=sr(-1,r),r.tag=3,r.payload={element:null};var s=t.value;return r.callback=function(){mn||(mn=!0,Sa=s),oa(e,t)},r}function nu(e,t,r){r=sr(-1,r),r.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var g=t.value;r.payload=function(){return s(g)},r.callback=function(){oa(e,t)}}var b=e.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(r.callback=function(){oa(e,t),typeof s!="function"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var O=t.stack;this.componentDidCatch(t.value,{componentStack:O!==null?O:""})}),r}function ou(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new kf;var g=new Set;s.set(t,g)}else g=s.get(t),g===void 0&&(g=new Set,s.set(t,g));g.has(r)||(g.add(r),e=Ff.bind(null,e,t,r),t.then(e,e))}function au(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 lu(e,t,r,s,g){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=sr(-1,1),t.tag=2,xr(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=g,e)}var Ef=w.ReactCurrentOwner,ht=!1;function ot(e,t,r,s){t.child=e===null?Rc(t,null,r,s):gs(t,e.child,r,s)}function cu(e,t,r,s,g){r=r.render;var b=t.ref;return _s(t,g),s=Qo(e,t,r,s,b,g),r=Yo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~g,ir(e,t,g)):(Be&&r&&Mo(t),t.flags|=1,ot(e,t,s,g),t.child)}function uu(e,t,r,s,g){if(e===null){var b=r.type;return typeof b=="function"&&!Ra(b)&&b.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=b,du(e,t,b,s,g)):(e=Sn(r.type,null,s,t,t.mode,g),e.ref=t.ref,e.return=t,t.child=e)}if(b=e.child,(e.lanes&g)===0){var O=b.memoizedProps;if(r=r.compare,r=r!==null?r:Vs,r(O,s)&&e.ref===t.ref)return ir(e,t,g)}return t.flags|=1,e=Rr(b,s),e.ref=t.ref,e.return=t,t.child=e}function du(e,t,r,s,g){if(e!==null){var b=e.memoizedProps;if(Vs(b,s)&&e.ref===t.ref)if(ht=!1,t.pendingProps=s=b,(e.lanes&g)!==0)(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,ir(e,t,g)}return aa(e,t,r,s,g)}function hu(e,t,r){var s=t.pendingProps,g=s.children,b=e!==null?e.memoizedState:null;if(s.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ae(xs,St),St|=r;else{if((r&1073741824)===0)return e=b!==null?b.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ae(xs,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=b!==null?b.baseLanes:r,Ae(xs,St),St|=s}else b!==null?(s=b.baseLanes|r,t.memoizedState=null):s=r,Ae(xs,St),St|=s;return ot(e,t,g,r),t.child}function fu(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function aa(e,t,r,s,g){var b=dt(r)?Fr:tt.current;return b=hs(t,b),_s(t,g),r=Qo(e,t,r,s,b,g),s=Yo(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~g,ir(e,t,g)):(Be&&s&&Mo(t),t.flags|=1,ot(e,t,r,g),t.child)}function pu(e,t,r,s,g){if(dt(r)){var b=!0;Vi(t)}else b=!1;if(_s(t,g),t.stateNode===null)un(e,t),ru(t,r,s),ia(t,r,s,g),s=!0;else if(e===null){var O=t.stateNode,U=t.memoizedProps;O.props=U;var V=O.context,te=r.contextType;typeof te=="object"&&te!==null?te=Et(te):(te=dt(r)?Fr:tt.current,te=hs(t,te));var ae=r.getDerivedStateFromProps,le=typeof ae=="function"||typeof O.getSnapshotBeforeUpdate=="function";le||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==s||V!==te)&&su(t,O,s,te),Sr=!1;var oe=t.memoizedState;O.state=oe,en(t,s,O,g),V=t.memoizedState,U!==s||oe!==V||ut.current||Sr?(typeof ae=="function"&&(sa(t,r,ae,s),V=t.memoizedState),(U=Sr||tu(t,r,U,s,oe,V,te))?(le||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(t.flags|=4194308)):(typeof O.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=V),O.props=s,O.state=V,O.context=te,s=U):(typeof O.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{O=t.stateNode,Dc(e,t),U=t.memoizedProps,te=t.type===t.elementType?U:It(t.type,U),O.props=te,le=t.pendingProps,oe=O.context,V=r.contextType,typeof V=="object"&&V!==null?V=Et(V):(V=dt(r)?Fr:tt.current,V=hs(t,V));var pe=r.getDerivedStateFromProps;(ae=typeof pe=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(U!==le||oe!==V)&&su(t,O,s,V),Sr=!1,oe=t.memoizedState,O.state=oe,en(t,s,O,g);var ge=t.memoizedState;U!==le||oe!==ge||ut.current||Sr?(typeof pe=="function"&&(sa(t,r,pe,s),ge=t.memoizedState),(te=Sr||tu(t,r,te,s,oe,ge,V)||!1)?(ae||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(s,ge,V),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(s,ge,V)),typeof O.componentDidUpdate=="function"&&(t.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof O.componentDidUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ge),O.props=s,O.state=ge,O.context=V,s=te):(typeof O.componentDidUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||U===e.memoizedProps&&oe===e.memoizedState||(t.flags|=1024),s=!1)}return la(e,t,r,s,b,g)}function la(e,t,r,s,g,b){fu(e,t);var O=(t.flags&128)!==0;if(!s&&!O)return g&&yc(t,r,!1),ir(e,t,b);s=t.stateNode,Ef.current=t;var U=O&&typeof r.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&O?(t.child=gs(t,e.child,null,b),t.child=gs(t,null,U,b)):ot(e,t,U,b),t.memoizedState=s.state,g&&yc(t,r,!0),t.child}function mu(e){var t=e.stateNode;t.pendingContext?vc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&vc(e,t.context,!1),Vo(e,t.containerInfo)}function gu(e,t,r,s,g){return ms(),Bo(g),t.flags|=256,ot(e,t,r,s),t.child}var ca={dehydrated:null,treeContext:null,retryLane:0};function ua(e){return{baseLanes:e,cachePool:null,transitions:null}}function vu(e,t,r){var s=t.pendingProps,g=Fe.current,b=!1,O=(t.flags&128)!==0,U;if((U=O)||(U=e!==null&&e.memoizedState===null?!1:(g&2)!==0),U?(b=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(g|=1),Ae(Fe,g&1),e===null)return Io(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):(O=s.children,e=s.fallback,b?(s=t.mode,b=t.child,O={mode:"hidden",children:O},(s&1)===0&&b!==null?(b.childLanes=0,b.pendingProps=O):b=xn(O,s,0,null),e=Jr(e,s,r,null),b.return=t,e.return=t,b.sibling=e,t.child=b,t.child.memoizedState=ua(r),t.memoizedState=ca,e):da(t,O));if(g=e.memoizedState,g!==null&&(U=g.dehydrated,U!==null))return Lf(e,t,O,s,U,g,r);if(b){b=s.fallback,O=t.mode,g=e.child,U=g.sibling;var V={mode:"hidden",children:s.children};return(O&1)===0&&t.child!==g?(s=t.child,s.childLanes=0,s.pendingProps=V,t.deletions=null):(s=Rr(g,V),s.subtreeFlags=g.subtreeFlags&14680064),U!==null?b=Rr(U,b):(b=Jr(b,O,r,null),b.flags|=2),b.return=t,s.return=t,s.sibling=b,t.child=s,s=b,b=t.child,O=e.child.memoizedState,O=O===null?ua(r):{baseLanes:O.baseLanes|r,cachePool:null,transitions:O.transitions},b.memoizedState=O,b.childLanes=e.childLanes&~r,t.memoizedState=ca,s}return b=e.child,e=b.sibling,s=Rr(b,{mode:"visible",children:s.children}),(t.mode&1)===0&&(s.lanes=r),s.return=t,s.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=s,t.memoizedState=null,s}function da(e,t){return t=xn({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cn(e,t,r,s){return s!==null&&Bo(s),gs(t,e.child,null,r),e=da(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lf(e,t,r,s,g,b,O){if(r)return t.flags&256?(t.flags&=-257,s=na(Error(f(422))),cn(e,t,O,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(b=s.fallback,g=t.mode,s=xn({mode:"visible",children:s.children},g,0,null),b=Jr(b,g,O,null),b.flags|=2,s.return=t,b.return=t,s.sibling=b,t.child=s,(t.mode&1)!==0&&gs(t,e.child,null,O),t.child.memoizedState=ua(O),t.memoizedState=ca,b);if((t.mode&1)===0)return cn(e,t,O,null);if(g.data==="$!"){if(s=g.nextSibling&&g.nextSibling.dataset,s)var U=s.dgst;return s=U,b=Error(f(419)),s=na(b,s,void 0),cn(e,t,O,s)}if(U=(O&e.childLanes)!==0,ht||U){if(s=Je,s!==null){switch(O&-O){case 4:g=2;break;case 16:g=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:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(s.suspendedLanes|O))!==0?0:g,g!==0&&g!==b.retryLane&&(b.retryLane=g,rr(e,g),Ht(s,e,g,-1))}return La(),s=na(Error(f(421))),cn(e,t,O,s)}return g.data==="$?"?(t.flags|=128,t.child=e.child,t=Hf.bind(null,e),g._reactRetry=t,null):(e=b.treeContext,wt=vr(g.nextSibling),yt=t,Be=!0,Nt=null,e!==null&&(Ct[kt++]=er,Ct[kt++]=tr,Ct[kt++]=Hr,er=e.id,tr=e.overflow,Hr=t),t=da(t,s.children),t.flags|=4096,t)}function _u(e,t,r){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Uo(e.return,t,r)}function ha(e,t,r,s,g){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:r,tailMode:g}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=s,b.tail=r,b.tailMode=g)}function yu(e,t,r){var s=t.pendingProps,g=s.revealOrder,b=s.tail;if(ot(e,t,s.children,r),s=Fe.current,(s&2)!==0)s=s&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&&_u(e,r,t);else if(e.tag===19)_u(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}s&=1}if(Ae(Fe,s),(t.mode&1)===0)t.memoizedState=null;else switch(g){case"forwards":for(r=t.child,g=null;r!==null;)e=r.alternate,e!==null&&tn(e)===null&&(g=r),r=r.sibling;r=g,r===null?(g=t.child,t.child=null):(g=r.sibling,r.sibling=null),ha(t,!1,g,r,b);break;case"backwards":for(r=null,g=t.child,t.child=null;g!==null;){if(e=g.alternate,e!==null&&tn(e)===null){t.child=g;break}e=g.sibling,g.sibling=r,r=g,g=e}ha(t,!0,r,null,b);break;case"together":ha(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function un(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ir(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Vr|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(f(153));if(t.child!==null){for(e=t.child,r=Rr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Rr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Rf(e,t,r){switch(t.tag){case 3:mu(t),ms();break;case 5:Ac(t);break;case 1:dt(t.type)&&Vi(t);break;case 4:Vo(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,g=t.memoizedProps.value;Ae(Qi,s._currentValue),s._currentValue=g;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(Ae(Fe,Fe.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?vu(e,t,r):(Ae(Fe,Fe.current&1),e=ir(e,t,r),e!==null?e.sibling:null);Ae(Fe,Fe.current&1);break;case 19:if(s=(r&t.childLanes)!==0,(e.flags&128)!==0){if(s)return yu(e,t,r);t.flags|=128}if(g=t.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ae(Fe,Fe.current),s)break;return null;case 22:case 23:return t.lanes=0,hu(e,t,r)}return ir(e,t,r)}var wu,fa,Su,xu;wu=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},fa=function(){},Su=function(e,t,r,s){var g=e.memoizedProps;if(g!==s){e=t.stateNode,Wr(Vt.current);var b=null;switch(r){case"input":g=Te(e,g),s=Te(e,s),b=[];break;case"select":g=B({},g,{value:void 0}),s=B({},s,{value:void 0}),b=[];break;case"textarea":g=lr(e,g),s=lr(e,s),b=[];break;default:typeof g.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Ui)}qn(r,s);var O;r=null;for(te in g)if(!s.hasOwnProperty(te)&&g.hasOwnProperty(te)&&g[te]!=null)if(te==="style"){var U=g[te];for(O in U)U.hasOwnProperty(O)&&(r||(r={}),r[O]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(j.hasOwnProperty(te)?b||(b=[]):(b=b||[]).push(te,null));for(te in s){var V=s[te];if(U=g!=null?g[te]:void 0,s.hasOwnProperty(te)&&V!==U&&(V!=null||U!=null))if(te==="style")if(U){for(O in U)!U.hasOwnProperty(O)||V&&V.hasOwnProperty(O)||(r||(r={}),r[O]="");for(O in V)V.hasOwnProperty(O)&&U[O]!==V[O]&&(r||(r={}),r[O]=V[O])}else r||(b||(b=[]),b.push(te,r)),r=V;else te==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,U=U?U.__html:void 0,V!=null&&U!==V&&(b=b||[]).push(te,V)):te==="children"?typeof V!="string"&&typeof V!="number"||(b=b||[]).push(te,""+V):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(j.hasOwnProperty(te)?(V!=null&&te==="onScroll"&&Ne("scroll",e),b||U===V||(b=[])):(b=b||[]).push(te,V))}r&&(b=b||[]).push("style",r);var te=b;(t.updateQueue=te)&&(t.flags|=4)}},xu=function(e,t,r,s){r!==s&&(t.flags|=4)};function oi(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var s=null;r!==null;)r.alternate!==null&&(s=r),r=r.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,s=0;if(t)for(var g=e.child;g!==null;)r|=g.lanes|g.childLanes,s|=g.subtreeFlags&14680064,s|=g.flags&14680064,g.return=e,g=g.sibling;else for(g=e.child;g!==null;)r|=g.lanes|g.childLanes,s|=g.subtreeFlags,s|=g.flags,g.return=e,g=g.sibling;return e.subtreeFlags|=s,e.childLanes=r,t}function jf(e,t,r){var s=t.pendingProps;switch(Oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return dt(t.type)&&zi(),st(t),null;case 3:return s=t.stateNode,ys(),Ie(ut),Ie(tt),Go(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ji(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nt!==null&&(Ca(Nt),Nt=null))),fa(e,t),st(t),null;case 5:qo(t);var g=Wr(ti.current);if(r=t.type,e!==null&&t.stateNode!=null)Su(e,t,r,s,g),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(f(166));return st(t),null}if(e=Wr(Vt.current),Ji(t)){s=t.stateNode,r=t.type;var b=t.memoizedProps;switch(s[zt]=t,s[Xs]=b,e=(t.mode&1)!==0,r){case"dialog":Ne("cancel",s),Ne("close",s);break;case"iframe":case"object":case"embed":Ne("load",s);break;case"video":case"audio":for(g=0;g<Ks.length;g++)Ne(Ks[g],s);break;case"source":Ne("error",s);break;case"img":case"image":case"link":Ne("error",s),Ne("load",s);break;case"details":Ne("toggle",s);break;case"input":Me(s,b),Ne("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!b.multiple},Ne("invalid",s);break;case"textarea":nt(s,b),Ne("invalid",s)}qn(r,b),g=null;for(var O in b)if(b.hasOwnProperty(O)){var U=b[O];O==="children"?typeof U=="string"?s.textContent!==U&&(b.suppressHydrationWarning!==!0&&$i(s.textContent,U,e),g=["children",U]):typeof U=="number"&&s.textContent!==""+U&&(b.suppressHydrationWarning!==!0&&$i(s.textContent,U,e),g=["children",""+U]):j.hasOwnProperty(O)&&U!=null&&O==="onScroll"&&Ne("scroll",s)}switch(r){case"input":fe(s),ar(s,b,!0);break;case"textarea":fe(s),gt(s);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(s.onclick=Ui)}s=g,t.updateQueue=s,s!==null&&(t.flags|=4)}else{O=g.nodeType===9?g:g.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ur(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=O.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=O.createElement(r,{is:s.is}):(e=O.createElement(r),r==="select"&&(O=e,s.multiple?O.multiple=!0:s.size&&(O.size=s.size))):e=O.createElementNS(e,r),e[zt]=t,e[Xs]=s,wu(e,t,!1,!1),t.stateNode=e;e:{switch(O=Kn(r,s),r){case"dialog":Ne("cancel",e),Ne("close",e),g=s;break;case"iframe":case"object":case"embed":Ne("load",e),g=s;break;case"video":case"audio":for(g=0;g<Ks.length;g++)Ne(Ks[g],e);g=s;break;case"source":Ne("error",e),g=s;break;case"img":case"image":case"link":Ne("error",e),Ne("load",e),g=s;break;case"details":Ne("toggle",e),g=s;break;case"input":Me(e,s),g=Te(e,s),Ne("invalid",e);break;case"option":g=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},g=B({},s,{value:void 0}),Ne("invalid",e);break;case"textarea":nt(e,s),g=lr(e,s),Ne("invalid",e);break;default:g=s}qn(r,g),U=g;for(b in U)if(U.hasOwnProperty(b)){var V=U[b];b==="style"?dl(e,V):b==="dangerouslySetInnerHTML"?(V=V?V.__html:void 0,V!=null&&Nr(e,V)):b==="children"?typeof V=="string"?(r!=="textarea"||V!=="")&&ct(e,V):typeof V=="number"&&ct(e,""+V):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(j.hasOwnProperty(b)?V!=null&&b==="onScroll"&&Ne("scroll",e):V!=null&&l(e,b,V,O))}switch(r){case"input":fe(e),ar(e,s,!1);break;case"textarea":fe(e),gt(e);break;case"option":s.value!=null&&e.setAttribute("value",""+N(s.value));break;case"select":e.multiple=!!s.multiple,b=s.value,b!=null?Ut(e,!!s.multiple,b,!1):s.defaultValue!=null&&Ut(e,!!s.multiple,s.defaultValue,!0);break;default:typeof g.onClick=="function"&&(e.onclick=Ui)}switch(r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return st(t),null;case 6:if(e&&t.stateNode!=null)xu(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(f(166));if(r=Wr(ti.current),Wr(Vt.current),Ji(t)){if(s=t.stateNode,r=t.memoizedProps,s[zt]=t,(b=s.nodeValue!==r)&&(e=yt,e!==null))switch(e.tag){case 3:$i(s.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$i(s.nodeValue,r,(e.mode&1)!==0)}b&&(t.flags|=4)}else s=(r.nodeType===9?r:r.ownerDocument).createTextNode(s),s[zt]=t,t.stateNode=s}return st(t),null;case 13:if(Ie(Fe),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Be&&wt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)kc(),ms(),t.flags|=98560,b=!1;else if(b=Ji(t),s!==null&&s.dehydrated!==null){if(e===null){if(!b)throw Error(f(318));if(b=t.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(f(317));b[zt]=t}else ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),b=!1}else Nt!==null&&(Ca(Nt),Nt=null),b=!0;if(!b)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Fe.current&1)!==0?qe===0&&(qe=3):La())),t.updateQueue!==null&&(t.flags|=4),st(t),null);case 4:return ys(),fa(e,t),e===null&&Gs(t.stateNode.containerInfo),st(t),null;case 10:return $o(t.type._context),st(t),null;case 17:return dt(t.type)&&zi(),st(t),null;case 19:if(Ie(Fe),b=t.memoizedState,b===null)return st(t),null;if(s=(t.flags&128)!==0,O=b.rendering,O===null)if(s)oi(b,!1);else{if(qe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(O=tn(e),O!==null){for(t.flags|=128,oi(b,!1),s=O.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=r,r=t.child;r!==null;)b=r,e=s,b.flags&=14680066,O=b.alternate,O===null?(b.childLanes=0,b.lanes=e,b.child=null,b.subtreeFlags=0,b.memoizedProps=null,b.memoizedState=null,b.updateQueue=null,b.dependencies=null,b.stateNode=null):(b.childLanes=O.childLanes,b.lanes=O.lanes,b.child=O.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=O.memoizedProps,b.memoizedState=O.memoizedState,b.updateQueue=O.updateQueue,b.type=O.type,e=O.dependencies,b.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ae(Fe,Fe.current&1|2),t.child}e=e.sibling}b.tail!==null&&Ue()>bs&&(t.flags|=128,s=!0,oi(b,!1),t.lanes=4194304)}else{if(!s)if(e=tn(O),e!==null){if(t.flags|=128,s=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),oi(b,!0),b.tail===null&&b.tailMode==="hidden"&&!O.alternate&&!Be)return st(t),null}else 2*Ue()-b.renderingStartTime>bs&&r!==1073741824&&(t.flags|=128,s=!0,oi(b,!1),t.lanes=4194304);b.isBackwards?(O.sibling=t.child,t.child=O):(r=b.last,r!==null?r.sibling=O:t.child=O,b.last=O)}return b.tail!==null?(t=b.tail,b.rendering=t,b.tail=t.sibling,b.renderingStartTime=Ue(),t.sibling=null,r=Fe.current,Ae(Fe,s?r&1|2:r&1),t):(st(t),null);case 22:case 23:return Ea(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&(t.mode&1)!==0?(St&1073741824)!==0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),null;case 24:return null;case 25:return null}throw Error(f(156,t.tag))}function Df(e,t){switch(Oo(t),t.tag){case 1:return dt(t.type)&&zi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ys(),Ie(ut),Ie(tt),Go(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return qo(t),null;case 13:if(Ie(Fe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(f(340));ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Fe),null;case 4:return ys(),null;case 10:return $o(t.type._context),null;case 22:case 23:return Ea(),null;case 24:return null;default:return null}}var dn=!1,it=!1,Pf=typeof WeakSet=="function"?WeakSet:Set,me=null;function Ss(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(s){$e(e,t,s)}else r.current=null}function pa(e,t,r){try{r()}catch(s){$e(e,t,s)}}var bu=!1;function Tf(e,t){if(Eo=Di,e=tc(),_o(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var s=r.getSelection&&r.getSelection();if(s&&s.rangeCount!==0){r=s.anchorNode;var g=s.anchorOffset,b=s.focusNode;s=s.focusOffset;try{r.nodeType,b.nodeType}catch{r=null;break e}var O=0,U=-1,V=-1,te=0,ae=0,le=e,oe=null;t:for(;;){for(var pe;le!==r||g!==0&&le.nodeType!==3||(U=O+g),le!==b||s!==0&&le.nodeType!==3||(V=O+s),le.nodeType===3&&(O+=le.nodeValue.length),(pe=le.firstChild)!==null;)oe=le,le=pe;for(;;){if(le===e)break t;if(oe===r&&++te===g&&(U=O),oe===b&&++ae===s&&(V=O),(pe=le.nextSibling)!==null)break;le=oe,oe=le.parentNode}le=pe}r=U===-1||V===-1?null:{start:U,end:V}}else r=null}r=r||{start:0,end:0}}else r=null;for(Lo={focusedElem:e,selectionRange:r},Di=!1,me=t;me!==null;)if(t=me,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,me=e;else for(;me!==null;){t=me;try{var ge=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(ge!==null){var ve=ge.memoizedProps,We=ge.memoizedState,Y=t.stateNode,J=Y.getSnapshotBeforeUpdate(t.elementType===t.type?ve:It(t.type,ve),We);Y.__reactInternalSnapshotBeforeUpdate=J}break;case 3:var Z=t.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(f(163))}}catch(ue){$e(t,t.return,ue)}if(e=t.sibling,e!==null){e.return=t.return,me=e;break}me=t.return}return ge=bu,bu=!1,ge}function ai(e,t,r){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var g=s=s.next;do{if((g.tag&e)===e){var b=g.destroy;g.destroy=void 0,b!==void 0&&pa(t,r,b)}g=g.next}while(g!==s)}}function hn(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var s=r.create;r.destroy=s()}r=r.next}while(r!==t)}}function ma(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zt],delete t[Xs],delete t[Po],delete t[pf],delete t[mf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ku(e){return e.tag===5||e.tag===3||e.tag===4}function Eu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ku(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 ga(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Ui));else if(s!==4&&(e=e.child,e!==null))for(ga(e,t,r),e=e.sibling;e!==null;)ga(e,t,r),e=e.sibling}function va(e,t,r){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(va(e,t,r),e=e.sibling;e!==null;)va(e,t,r),e=e.sibling}var Ye=null,Bt=!1;function br(e,t,r){for(r=r.child;r!==null;)Lu(e,t,r),r=r.sibling}function Lu(e,t,r){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Ci,r)}catch{}switch(r.tag){case 5:it||Ss(r,t);case 6:var s=Ye,g=Bt;Ye=null,br(e,t,r),Ye=s,Bt=g,Ye!==null&&(Bt?(e=Ye,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ye.removeChild(r.stateNode));break;case 18:Ye!==null&&(Bt?(e=Ye,r=r.stateNode,e.nodeType===8?Do(e.parentNode,r):e.nodeType===1&&Do(e,r),Fs(e)):Do(Ye,r.stateNode));break;case 4:s=Ye,g=Bt,Ye=r.stateNode.containerInfo,Bt=!0,br(e,t,r),Ye=s,Bt=g;break;case 0:case 11:case 14:case 15:if(!it&&(s=r.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){g=s=s.next;do{var b=g,O=b.destroy;b=b.tag,O!==void 0&&((b&2)!==0||(b&4)!==0)&&pa(r,t,O),g=g.next}while(g!==s)}br(e,t,r);break;case 1:if(!it&&(Ss(r,t),s=r.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=r.memoizedProps,s.state=r.memoizedState,s.componentWillUnmount()}catch(U){$e(r,t,U)}br(e,t,r);break;case 21:br(e,t,r);break;case 22:r.mode&1?(it=(s=it)||r.memoizedState!==null,br(e,t,r),it=s):br(e,t,r);break;default:br(e,t,r)}}function Ru(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Pf),t.forEach(function(s){var g=$f.bind(null,e,s);r.has(s)||(r.add(s),s.then(g,g))})}}function Ft(e,t){var r=t.deletions;if(r!==null)for(var s=0;s<r.length;s++){var g=r[s];try{var b=e,O=t,U=O;e:for(;U!==null;){switch(U.tag){case 5:Ye=U.stateNode,Bt=!1;break e;case 3:Ye=U.stateNode.containerInfo,Bt=!0;break e;case 4:Ye=U.stateNode.containerInfo,Bt=!0;break e}U=U.return}if(Ye===null)throw Error(f(160));Lu(b,O,g),Ye=null,Bt=!1;var V=g.alternate;V!==null&&(V.return=null),g.return=null}catch(te){$e(g,t,te)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ju(t,e),t=t.sibling}function ju(e,t){var r=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ft(t,e),Kt(e),s&4){try{ai(3,e,e.return),hn(3,e)}catch(ve){$e(e,e.return,ve)}try{ai(5,e,e.return)}catch(ve){$e(e,e.return,ve)}}break;case 1:Ft(t,e),Kt(e),s&512&&r!==null&&Ss(r,r.return);break;case 5:if(Ft(t,e),Kt(e),s&512&&r!==null&&Ss(r,r.return),e.flags&32){var g=e.stateNode;try{ct(g,"")}catch(ve){$e(e,e.return,ve)}}if(s&4&&(g=e.stateNode,g!=null)){var b=e.memoizedProps,O=r!==null?r.memoizedProps:b,U=e.type,V=e.updateQueue;if(e.updateQueue=null,V!==null)try{U==="input"&&b.type==="radio"&&b.name!=null&&Qe(g,b),Kn(U,O);var te=Kn(U,b);for(O=0;O<V.length;O+=2){var ae=V[O],le=V[O+1];ae==="style"?dl(g,le):ae==="dangerouslySetInnerHTML"?Nr(g,le):ae==="children"?ct(g,le):l(g,ae,le,te)}switch(U){case"input":be(g,b);break;case"textarea":cr(g,b);break;case"select":var oe=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!b.multiple;var pe=b.value;pe!=null?Ut(g,!!b.multiple,pe,!1):oe!==!!b.multiple&&(b.defaultValue!=null?Ut(g,!!b.multiple,b.defaultValue,!0):Ut(g,!!b.multiple,b.multiple?[]:"",!1))}g[Xs]=b}catch(ve){$e(e,e.return,ve)}}break;case 6:if(Ft(t,e),Kt(e),s&4){if(e.stateNode===null)throw Error(f(162));g=e.stateNode,b=e.memoizedProps;try{g.nodeValue=b}catch(ve){$e(e,e.return,ve)}}break;case 3:if(Ft(t,e),Kt(e),s&4&&r!==null&&r.memoizedState.isDehydrated)try{Fs(t.containerInfo)}catch(ve){$e(e,e.return,ve)}break;case 4:Ft(t,e),Kt(e);break;case 13:Ft(t,e),Kt(e),g=e.child,g.flags&8192&&(b=g.memoizedState!==null,g.stateNode.isHidden=b,!b||g.alternate!==null&&g.alternate.memoizedState!==null||(wa=Ue())),s&4&&Ru(e);break;case 22:if(ae=r!==null&&r.memoizedState!==null,e.mode&1?(it=(te=it)||ae,Ft(t,e),it=te):Ft(t,e),Kt(e),s&8192){if(te=e.memoizedState!==null,(e.stateNode.isHidden=te)&&!ae&&(e.mode&1)!==0)for(me=e,ae=e.child;ae!==null;){for(le=me=ae;me!==null;){switch(oe=me,pe=oe.child,oe.tag){case 0:case 11:case 14:case 15:ai(4,oe,oe.return);break;case 1:Ss(oe,oe.return);var ge=oe.stateNode;if(typeof ge.componentWillUnmount=="function"){s=oe,r=oe.return;try{t=s,ge.props=t.memoizedProps,ge.state=t.memoizedState,ge.componentWillUnmount()}catch(ve){$e(s,r,ve)}}break;case 5:Ss(oe,oe.return);break;case 22:if(oe.memoizedState!==null){Tu(le);continue}}pe!==null?(pe.return=oe,me=pe):Tu(le)}ae=ae.sibling}e:for(ae=null,le=e;;){if(le.tag===5){if(ae===null){ae=le;try{g=le.stateNode,te?(b=g.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(U=le.stateNode,V=le.memoizedProps.style,O=V!=null&&V.hasOwnProperty("display")?V.display:null,U.style.display=wi("display",O))}catch(ve){$e(e,e.return,ve)}}}else if(le.tag===6){if(ae===null)try{le.stateNode.nodeValue=te?"":le.memoizedProps}catch(ve){$e(e,e.return,ve)}}else if((le.tag!==22&&le.tag!==23||le.memoizedState===null||le===e)&&le.child!==null){le.child.return=le,le=le.child;continue}if(le===e)break e;for(;le.sibling===null;){if(le.return===null||le.return===e)break e;ae===le&&(ae=null),le=le.return}ae===le&&(ae=null),le.sibling.return=le.return,le=le.sibling}}break;case 19:Ft(t,e),Kt(e),s&4&&Ru(e);break;case 21:break;default:Ft(t,e),Kt(e)}}function Kt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ku(r)){var s=r;break e}r=r.return}throw Error(f(160))}switch(s.tag){case 5:var g=s.stateNode;s.flags&32&&(ct(g,""),s.flags&=-33);var b=Eu(e);va(e,b,g);break;case 3:case 4:var O=s.stateNode.containerInfo,U=Eu(e);ga(e,U,O);break;default:throw Error(f(161))}}catch(V){$e(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Af(e,t,r){me=e,Du(e)}function Du(e,t,r){for(var s=(e.mode&1)!==0;me!==null;){var g=me,b=g.child;if(g.tag===22&&s){var O=g.memoizedState!==null||dn;if(!O){var U=g.alternate,V=U!==null&&U.memoizedState!==null||it;U=dn;var te=it;if(dn=O,(it=V)&&!te)for(me=g;me!==null;)O=me,V=O.child,O.tag===22&&O.memoizedState!==null?Au(g):V!==null?(V.return=O,me=V):Au(g);for(;b!==null;)me=b,Du(b),b=b.sibling;me=g,dn=U,it=te}Pu(e)}else(g.subtreeFlags&8772)!==0&&b!==null?(b.return=g,me=b):Pu(e)}}function Pu(e){for(;me!==null;){var t=me;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:it||hn(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!it)if(r===null)s.componentDidMount();else{var g=t.elementType===t.type?r.memoizedProps:It(t.type,r.memoizedProps);s.componentDidUpdate(g,r.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var b=t.updateQueue;b!==null&&Tc(t,b,s);break;case 3:var O=t.updateQueue;if(O!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Tc(t,O,r)}break;case 5:var U=t.stateNode;if(r===null&&t.flags&4){r=U;var V=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":V.autoFocus&&r.focus();break;case"img":V.src&&(r.src=V.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var te=t.alternate;if(te!==null){var ae=te.memoizedState;if(ae!==null){var le=ae.dehydrated;le!==null&&Fs(le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(f(163))}it||t.flags&512&&ma(t)}catch(oe){$e(t,t.return,oe)}}if(t===e){me=null;break}if(r=t.sibling,r!==null){r.return=t.return,me=r;break}me=t.return}}function Tu(e){for(;me!==null;){var t=me;if(t===e){me=null;break}var r=t.sibling;if(r!==null){r.return=t.return,me=r;break}me=t.return}}function Au(e){for(;me!==null;){var t=me;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{hn(4,t)}catch(V){$e(t,r,V)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var g=t.return;try{s.componentDidMount()}catch(V){$e(t,g,V)}}var b=t.return;try{ma(t)}catch(V){$e(t,b,V)}break;case 5:var O=t.return;try{ma(t)}catch(V){$e(t,O,V)}}}catch(V){$e(t,t.return,V)}if(t===e){me=null;break}var U=t.sibling;if(U!==null){U.return=t.return,me=U;break}me=t.return}}var Mf=Math.ceil,fn=w.ReactCurrentDispatcher,_a=w.ReactCurrentOwner,Rt=w.ReactCurrentBatchConfig,Re=0,Je=null,ze=null,Ze=0,St=0,xs=_r(0),qe=0,li=null,Vr=0,pn=0,ya=0,ci=null,ft=null,wa=0,bs=1/0,nr=null,mn=!1,Sa=null,Cr=null,gn=!1,kr=null,vn=0,ui=0,xa=null,_n=-1,yn=0;function at(){return(Re&6)!==0?Ue():_n!==-1?_n:_n=Ue()}function Er(e){return(e.mode&1)===0?1:(Re&2)!==0&&Ze!==0?Ze&-Ze:vf.transition!==null?(yn===0&&(yn=El()),yn):(e=De,e!==0||(e=window.event,e=e===void 0?16:Ol(e.type)),e)}function Ht(e,t,r,s){if(50<ui)throw ui=0,xa=null,Error(f(185));Ms(e,r,s),((Re&2)===0||e!==Je)&&(e===Je&&((Re&2)===0&&(pn|=r),qe===4&&Lr(e,Ze)),pt(e,s),r===1&&Re===0&&(t.mode&1)===0&&(bs=Ue()+500,qi&&wr()))}function pt(e,t){var r=e.callbackNode;gh(e,t);var s=Li(e,e===Je?Ze:0);if(s===0)r!==null&&bl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(r!=null&&bl(r),t===1)e.tag===0?gf(Ou.bind(null,e)):wc(Ou.bind(null,e)),hf(function(){(Re&6)===0&&wr()}),r=null;else{switch(Ll(s)){case 1:r=eo;break;case 4:r=Cl;break;case 16:r=bi;break;case 536870912:r=kl;break;default:r=bi}r=Wu(r,Mu.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mu(e,t){if(_n=-1,yn=0,(Re&6)!==0)throw Error(f(327));var r=e.callbackNode;if(Cs()&&e.callbackNode!==r)return null;var s=Li(e,e===Je?Ze:0);if(s===0)return null;if((s&30)!==0||(s&e.expiredLanes)!==0||t)t=wn(e,s);else{t=s;var g=Re;Re|=2;var b=Iu();(Je!==e||Ze!==t)&&(nr=null,bs=Ue()+500,Kr(e,t));do try{If();break}catch(U){Nu(e,U)}while(!0);Ho(),fn.current=b,Re=g,ze!==null?t=0:(Je=null,Ze=0,t=qe)}if(t!==0){if(t===2&&(g=to(e),g!==0&&(s=g,t=ba(e,g))),t===1)throw r=li,Kr(e,0),Lr(e,s),pt(e,Ue()),r;if(t===6)Lr(e,s);else{if(g=e.current.alternate,(s&30)===0&&!Of(g)&&(t=wn(e,s),t===2&&(b=to(e),b!==0&&(s=b,t=ba(e,b))),t===1))throw r=li,Kr(e,0),Lr(e,s),pt(e,Ue()),r;switch(e.finishedWork=g,e.finishedLanes=s,t){case 0:case 1:throw Error(f(345));case 2:Gr(e,ft,nr);break;case 3:if(Lr(e,s),(s&130023424)===s&&(t=wa+500-Ue(),10<t)){if(Li(e,0)!==0)break;if(g=e.suspendedLanes,(g&s)!==s){at(),e.pingedLanes|=e.suspendedLanes&g;break}e.timeoutHandle=jo(Gr.bind(null,e,ft,nr),t);break}Gr(e,ft,nr);break;case 4:if(Lr(e,s),(s&4194240)===s)break;for(t=e.eventTimes,g=-1;0<s;){var O=31-Mt(s);b=1<<O,O=t[O],O>g&&(g=O),s&=~b}if(s=g,s=Ue()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Mf(s/1960))-s,10<s){e.timeoutHandle=jo(Gr.bind(null,e,ft,nr),s);break}Gr(e,ft,nr);break;case 5:Gr(e,ft,nr);break;default:throw Error(f(329))}}}return pt(e,Ue()),e.callbackNode===r?Mu.bind(null,e):null}function ba(e,t){var r=ci;return e.current.memoizedState.isDehydrated&&(Kr(e,t).flags|=256),e=wn(e,t),e!==2&&(t=ft,ft=r,t!==null&&Ca(t)),e}function Ca(e){ft===null?ft=e:ft.push.apply(ft,e)}function Of(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var s=0;s<r.length;s++){var g=r[s],b=g.getSnapshot;g=g.value;try{if(!Ot(b(),g))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Lr(e,t){for(t&=~ya,t&=~pn,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Mt(t),s=1<<r;e[r]=-1,t&=~s}}function Ou(e){if((Re&6)!==0)throw Error(f(327));Cs();var t=Li(e,0);if((t&1)===0)return pt(e,Ue()),null;var r=wn(e,t);if(e.tag!==0&&r===2){var s=to(e);s!==0&&(t=s,r=ba(e,s))}if(r===1)throw r=li,Kr(e,0),Lr(e,t),pt(e,Ue()),r;if(r===6)throw Error(f(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Gr(e,ft,nr),pt(e,Ue()),null}function ka(e,t){var r=Re;Re|=1;try{return e(t)}finally{Re=r,Re===0&&(bs=Ue()+500,qi&&wr())}}function qr(e){kr!==null&&kr.tag===0&&(Re&6)===0&&Cs();var t=Re;Re|=1;var r=Rt.transition,s=De;try{if(Rt.transition=null,De=1,e)return e()}finally{De=s,Rt.transition=r,Re=t,(Re&6)===0&&wr()}}function Ea(){St=xs.current,Ie(xs)}function Kr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,df(r)),ze!==null)for(r=ze.return;r!==null;){var s=r;switch(Oo(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&zi();break;case 3:ys(),Ie(ut),Ie(tt),Go();break;case 5:qo(s);break;case 4:ys();break;case 13:Ie(Fe);break;case 19:Ie(Fe);break;case 10:$o(s.type._context);break;case 22:case 23:Ea()}r=r.return}if(Je=e,ze=e=Rr(e.current,null),Ze=St=t,qe=0,li=null,ya=pn=Vr=0,ft=ci=null,Ur!==null){for(t=0;t<Ur.length;t++)if(r=Ur[t],s=r.interleaved,s!==null){r.interleaved=null;var g=s.next,b=r.pending;if(b!==null){var O=b.next;b.next=g,s.next=O}r.pending=s}Ur=null}return e}function Nu(e,t){do{var r=ze;try{if(Ho(),rn.current=an,sn){for(var s=He.memoizedState;s!==null;){var g=s.queue;g!==null&&(g.pending=null),s=s.next}sn=!1}if(zr=0,Ge=Ve=He=null,ri=!1,si=0,_a.current=null,r===null||r.return===null){qe=1,li=t,ze=null;break}e:{var b=e,O=r.return,U=r,V=t;if(t=Ze,U.flags|=32768,V!==null&&typeof V=="object"&&typeof V.then=="function"){var te=V,ae=U,le=ae.tag;if((ae.mode&1)===0&&(le===0||le===11||le===15)){var oe=ae.alternate;oe?(ae.updateQueue=oe.updateQueue,ae.memoizedState=oe.memoizedState,ae.lanes=oe.lanes):(ae.updateQueue=null,ae.memoizedState=null)}var pe=au(O);if(pe!==null){pe.flags&=-257,lu(pe,O,U,b,t),pe.mode&1&&ou(b,te,t),t=pe,V=te;var ge=t.updateQueue;if(ge===null){var ve=new Set;ve.add(V),t.updateQueue=ve}else ge.add(V);break e}else{if((t&1)===0){ou(b,te,t),La();break e}V=Error(f(426))}}else if(Be&&U.mode&1){var We=au(O);if(We!==null){(We.flags&65536)===0&&(We.flags|=256),lu(We,O,U,b,t),Bo(ws(V,U));break e}}b=V=ws(V,U),qe!==4&&(qe=2),ci===null?ci=[b]:ci.push(b),b=O;do{switch(b.tag){case 3:b.flags|=65536,t&=-t,b.lanes|=t;var Y=iu(b,V,t);Pc(b,Y);break e;case 1:U=V;var J=b.type,Z=b.stateNode;if((b.flags&128)===0&&(typeof J.getDerivedStateFromError=="function"||Z!==null&&typeof Z.componentDidCatch=="function"&&(Cr===null||!Cr.has(Z)))){b.flags|=65536,t&=-t,b.lanes|=t;var ue=nu(b,U,t);Pc(b,ue);break e}}b=b.return}while(b!==null)}Fu(r)}catch(_e){t=_e,ze===r&&r!==null&&(ze=r=r.return);continue}break}while(!0)}function Iu(){var e=fn.current;return fn.current=an,e===null?an:e}function La(){(qe===0||qe===3||qe===2)&&(qe=4),Je===null||(Vr&268435455)===0&&(pn&268435455)===0||Lr(Je,Ze)}function wn(e,t){var r=Re;Re|=2;var s=Iu();(Je!==e||Ze!==t)&&(nr=null,Kr(e,t));do try{Nf();break}catch(g){Nu(e,g)}while(!0);if(Ho(),Re=r,fn.current=s,ze!==null)throw Error(f(261));return Je=null,Ze=0,qe}function Nf(){for(;ze!==null;)Bu(ze)}function If(){for(;ze!==null&&!ah();)Bu(ze)}function Bu(e){var t=Uu(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?Fu(e):ze=t,_a.current=null}function Fu(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=jf(r,t,St),r!==null){ze=r;return}}else{if(r=Df(r,t),r!==null){r.flags&=32767,ze=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{qe=6,ze=null;return}}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);qe===0&&(qe=5)}function Gr(e,t,r){var s=De,g=Rt.transition;try{Rt.transition=null,De=1,Bf(e,t,r,s)}finally{Rt.transition=g,De=s}return null}function Bf(e,t,r,s){do Cs();while(kr!==null);if((Re&6)!==0)throw Error(f(327));r=e.finishedWork;var g=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(f(177));e.callbackNode=null,e.callbackPriority=0;var b=r.lanes|r.childLanes;if(vh(e,b),e===Je&&(ze=Je=null,Ze=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||gn||(gn=!0,Wu(bi,function(){return Cs(),null})),b=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||b){b=Rt.transition,Rt.transition=null;var O=De;De=1;var U=Re;Re|=4,_a.current=null,Tf(e,r),ju(r,e),sf(Lo),Di=!!Eo,Lo=Eo=null,e.current=r,Af(r),lh(),Re=U,De=O,Rt.transition=b}else e.current=r;if(gn&&(gn=!1,kr=e,vn=g),b=e.pendingLanes,b===0&&(Cr=null),dh(r.stateNode),pt(e,Ue()),t!==null)for(s=e.onRecoverableError,r=0;r<t.length;r++)g=t[r],s(g.value,{componentStack:g.stack,digest:g.digest});if(mn)throw mn=!1,e=Sa,Sa=null,e;return(vn&1)!==0&&e.tag!==0&&Cs(),b=e.pendingLanes,(b&1)!==0?e===xa?ui++:(ui=0,xa=e):ui=0,wr(),null}function Cs(){if(kr!==null){var e=Ll(vn),t=Rt.transition,r=De;try{if(Rt.transition=null,De=16>e?16:e,kr===null)var s=!1;else{if(e=kr,kr=null,vn=0,(Re&6)!==0)throw Error(f(331));var g=Re;for(Re|=4,me=e.current;me!==null;){var b=me,O=b.child;if((me.flags&16)!==0){var U=b.deletions;if(U!==null){for(var V=0;V<U.length;V++){var te=U[V];for(me=te;me!==null;){var ae=me;switch(ae.tag){case 0:case 11:case 15:ai(8,ae,b)}var le=ae.child;if(le!==null)le.return=ae,me=le;else for(;me!==null;){ae=me;var oe=ae.sibling,pe=ae.return;if(Cu(ae),ae===te){me=null;break}if(oe!==null){oe.return=pe,me=oe;break}me=pe}}}var ge=b.alternate;if(ge!==null){var ve=ge.child;if(ve!==null){ge.child=null;do{var We=ve.sibling;ve.sibling=null,ve=We}while(ve!==null)}}me=b}}if((b.subtreeFlags&2064)!==0&&O!==null)O.return=b,me=O;else e:for(;me!==null;){if(b=me,(b.flags&2048)!==0)switch(b.tag){case 0:case 11:case 15:ai(9,b,b.return)}var Y=b.sibling;if(Y!==null){Y.return=b.return,me=Y;break e}me=b.return}}var J=e.current;for(me=J;me!==null;){O=me;var Z=O.child;if((O.subtreeFlags&2064)!==0&&Z!==null)Z.return=O,me=Z;else e:for(O=J;me!==null;){if(U=me,(U.flags&2048)!==0)try{switch(U.tag){case 0:case 11:case 15:hn(9,U)}}catch(_e){$e(U,U.return,_e)}if(U===O){me=null;break e}var ue=U.sibling;if(ue!==null){ue.return=U.return,me=ue;break e}me=U.return}}if(Re=g,wr(),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Ci,e)}catch{}s=!0}return s}finally{De=r,Rt.transition=t}}return!1}function Hu(e,t,r){t=ws(r,t),t=iu(e,t,1),e=xr(e,t,1),t=at(),e!==null&&(Ms(e,1,t),pt(e,t))}function $e(e,t,r){if(e.tag===3)Hu(e,e,r);else for(;t!==null;){if(t.tag===3){Hu(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Cr===null||!Cr.has(s))){e=ws(r,e),e=nu(t,e,1),t=xr(t,e,1),e=at(),t!==null&&(Ms(t,1,e),pt(t,e));break}}t=t.return}}function Ff(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&r,Je===e&&(Ze&r)===r&&(qe===4||qe===3&&(Ze&130023424)===Ze&&500>Ue()-wa?Kr(e,0):ya|=r),pt(e,t)}function $u(e,t){t===0&&((e.mode&1)===0?t=1:(t=Ei,Ei<<=1,(Ei&130023424)===0&&(Ei=4194304)));var r=at();e=rr(e,t),e!==null&&(Ms(e,t,r),pt(e,r))}function Hf(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),$u(e,r)}function $f(e,t){var r=0;switch(e.tag){case 13:var s=e.stateNode,g=e.memoizedState;g!==null&&(r=g.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(f(314))}s!==null&&s.delete(t),$u(e,r)}var Uu;Uu=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ut.current)ht=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return ht=!1,Rf(e,t,r);ht=(e.flags&131072)!==0}else ht=!1,Be&&(t.flags&1048576)!==0&&Sc(t,Gi,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;un(e,t),e=t.pendingProps;var g=hs(t,tt.current);_s(t,r),g=Qo(null,t,s,e,g,r);var b=Yo();return t.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(s)?(b=!0,Vi(t)):b=!1,t.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,zo(t),g.updater=ln,t.stateNode=g,g._reactInternals=t,ia(t,s,e,r),t=la(null,t,s,!0,b,r)):(t.tag=0,Be&&b&&Mo(t),ot(null,t,g,r),t=t.child),t;case 16:s=t.elementType;e:{switch(un(e,t),e=t.pendingProps,g=s._init,s=g(s._payload),t.type=s,g=t.tag=Wf(s),e=It(s,e),g){case 0:t=aa(null,t,s,e,r);break e;case 1:t=pu(null,t,s,e,r);break e;case 11:t=cu(null,t,s,e,r);break e;case 14:t=uu(null,t,s,It(s.type,e),r);break e}throw Error(f(306,s,""))}return t;case 0:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),aa(e,t,s,g,r);case 1:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),pu(e,t,s,g,r);case 3:e:{if(mu(t),e===null)throw Error(f(387));s=t.pendingProps,b=t.memoizedState,g=b.element,Dc(e,t),en(t,s,null,r);var O=t.memoizedState;if(s=O.element,b.isDehydrated)if(b={element:s,isDehydrated:!1,cache:O.cache,pendingSuspenseBoundaries:O.pendingSuspenseBoundaries,transitions:O.transitions},t.updateQueue.baseState=b,t.memoizedState=b,t.flags&256){g=ws(Error(f(423)),t),t=gu(e,t,s,r,g);break e}else if(s!==g){g=ws(Error(f(424)),t),t=gu(e,t,s,r,g);break e}else for(wt=vr(t.stateNode.containerInfo.firstChild),yt=t,Be=!0,Nt=null,r=Rc(t,null,s,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ms(),s===g){t=ir(e,t,r);break e}ot(e,t,s,r)}t=t.child}return t;case 5:return Ac(t),e===null&&Io(t),s=t.type,g=t.pendingProps,b=e!==null?e.memoizedProps:null,O=g.children,Ro(s,g)?O=null:b!==null&&Ro(s,b)&&(t.flags|=32),fu(e,t),ot(e,t,O,r),t.child;case 6:return e===null&&Io(t),null;case 13:return vu(e,t,r);case 4:return Vo(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=gs(t,null,s,r):ot(e,t,s,r),t.child;case 11:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),cu(e,t,s,g,r);case 7:return ot(e,t,t.pendingProps,r),t.child;case 8:return ot(e,t,t.pendingProps.children,r),t.child;case 12:return ot(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(s=t.type._context,g=t.pendingProps,b=t.memoizedProps,O=g.value,Ae(Qi,s._currentValue),s._currentValue=O,b!==null)if(Ot(b.value,O)){if(b.children===g.children&&!ut.current){t=ir(e,t,r);break e}}else for(b=t.child,b!==null&&(b.return=t);b!==null;){var U=b.dependencies;if(U!==null){O=b.child;for(var V=U.firstContext;V!==null;){if(V.context===s){if(b.tag===1){V=sr(-1,r&-r),V.tag=2;var te=b.updateQueue;if(te!==null){te=te.shared;var ae=te.pending;ae===null?V.next=V:(V.next=ae.next,ae.next=V),te.pending=V}}b.lanes|=r,V=b.alternate,V!==null&&(V.lanes|=r),Uo(b.return,r,t),U.lanes|=r;break}V=V.next}}else if(b.tag===10)O=b.type===t.type?null:b.child;else if(b.tag===18){if(O=b.return,O===null)throw Error(f(341));O.lanes|=r,U=O.alternate,U!==null&&(U.lanes|=r),Uo(O,r,t),O=b.sibling}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===t){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}ot(e,t,g.children,r),t=t.child}return t;case 9:return g=t.type,s=t.pendingProps.children,_s(t,r),g=Et(g),s=s(g),t.flags|=1,ot(e,t,s,r),t.child;case 14:return s=t.type,g=It(s,t.pendingProps),g=It(s.type,g),uu(e,t,s,g,r);case 15:return du(e,t,t.type,t.pendingProps,r);case 17:return s=t.type,g=t.pendingProps,g=t.elementType===s?g:It(s,g),un(e,t),t.tag=1,dt(s)?(e=!0,Vi(t)):e=!1,_s(t,r),ru(t,s,g),ia(t,s,g,r),la(null,t,s,!0,e,r);case 19:return yu(e,t,r);case 22:return hu(e,t,r)}throw Error(f(156,t.tag))};function Wu(e,t){return xl(e,t)}function Uf(e,t,r,s){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,r,s){return new Uf(e,t,r,s)}function Ra(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wf(e){if(typeof e=="function")return Ra(e)?1:0;if(e!=null){if(e=e.$$typeof,e===W)return 11;if(e===q)return 14}return 2}function Rr(e,t){var r=e.alternate;return r===null?(r=jt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Sn(e,t,r,s,g,b){var O=2;if(s=e,typeof e=="function")Ra(e)&&(O=1);else if(typeof e=="string")O=5;else e:switch(e){case D:return Jr(r.children,g,b,t);case x:O=8,g|=8;break;case P:return e=jt(12,r,t,g|2),e.elementType=P,e.lanes=b,e;case I:return e=jt(13,r,t,g),e.elementType=I,e.lanes=b,e;case X:return e=jt(19,r,t,g),e.elementType=X,e.lanes=b,e;case re:return xn(r,g,b,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:O=10;break e;case $:O=9;break e;case W:O=11;break e;case q:O=14;break e;case z:O=16,s=null;break e}throw Error(f(130,e==null?e:typeof e,""))}return t=jt(O,r,t,g),t.elementType=e,t.type=s,t.lanes=b,t}function Jr(e,t,r,s){return e=jt(7,e,s,t),e.lanes=r,e}function xn(e,t,r,s){return e=jt(22,e,s,t),e.elementType=re,e.lanes=r,e.stateNode={isHidden:!1},e}function ja(e,t,r){return e=jt(6,e,null,t),e.lanes=r,e}function Da(e,t,r){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function zf(e,t,r,s,g){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=ro(0),this.expirationTimes=ro(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ro(0),this.identifierPrefix=s,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Pa(e,t,r,s,g,b,O,U,V){return e=new zf(e,t,r,U,V),t===1?(t=1,b===!0&&(t|=8)):t=0,b=jt(3,null,null,t),e.current=b,b.stateNode=e,b.memoizedState={element:s,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},zo(b),e}function Vf(e,t,r){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:E,key:s==null?null:""+s,children:e,containerInfo:t,implementation:r}}function zu(e){if(!e)return yr;e=e._reactInternals;e:{if(Ir(e)!==e||e.tag!==1)throw Error(f(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(f(171))}if(e.tag===1){var r=e.type;if(dt(r))return _c(e,r,t)}return t}function Vu(e,t,r,s,g,b,O,U,V){return e=Pa(r,s,!0,e,g,b,O,U,V),e.context=zu(null),r=e.current,s=at(),g=Er(r),b=sr(s,g),b.callback=t??null,xr(r,b,g),e.current.lanes=g,Ms(e,g,s),pt(e,s),e}function bn(e,t,r,s){var g=t.current,b=at(),O=Er(g);return r=zu(r),t.context===null?t.context=r:t.pendingContext=r,t=sr(b,O),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=xr(g,t,O),e!==null&&(Ht(e,g,O,b),Zi(e,g,O)),O}function Cn(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 qu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Ta(e,t){qu(e,t),(e=e.alternate)&&qu(e,t)}function qf(){return null}var Ku=typeof reportError=="function"?reportError:function(e){console.error(e)};function Aa(e){this._internalRoot=e}kn.prototype.render=Aa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(f(409));bn(e,t,null,null)},kn.prototype.unmount=Aa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;qr(function(){bn(null,e,null,null)}),t[Yt]=null}};function kn(e){this._internalRoot=e}kn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dl();e={blockedOn:null,target:e,priority:t};for(var r=0;r<pr.length&&t!==0&&t<pr[r].priority;r++);pr.splice(r,0,e),r===0&&Al(e)}};function Ma(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function En(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gu(){}function Kf(e,t,r,s,g){if(g){if(typeof s=="function"){var b=s;s=function(){var te=Cn(O);b.call(te)}}var O=Vu(t,s,e,0,null,!1,!1,"",Gu);return e._reactRootContainer=O,e[Yt]=O.current,Gs(e.nodeType===8?e.parentNode:e),qr(),O}for(;g=e.lastChild;)e.removeChild(g);if(typeof s=="function"){var U=s;s=function(){var te=Cn(V);U.call(te)}}var V=Pa(e,0,!1,null,null,!1,!1,"",Gu);return e._reactRootContainer=V,e[Yt]=V.current,Gs(e.nodeType===8?e.parentNode:e),qr(function(){bn(t,V,r,s)}),V}function Ln(e,t,r,s,g){var b=r._reactRootContainer;if(b){var O=b;if(typeof g=="function"){var U=g;g=function(){var V=Cn(O);U.call(V)}}bn(t,O,e,g)}else O=Kf(r,t,e,g,s);return Cn(O)}Rl=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=As(t.pendingLanes);r!==0&&(so(t,r|1),pt(t,Ue()),(Re&6)===0&&(bs=Ue()+500,wr()))}break;case 13:qr(function(){var s=rr(e,1);if(s!==null){var g=at();Ht(s,e,1,g)}}),Ta(e,1)}},io=function(e){if(e.tag===13){var t=rr(e,134217728);if(t!==null){var r=at();Ht(t,e,134217728,r)}Ta(e,134217728)}},jl=function(e){if(e.tag===13){var t=Er(e),r=rr(e,t);if(r!==null){var s=at();Ht(r,e,t,s)}Ta(e,t)}},Dl=function(){return De},Pl=function(e,t){var r=De;try{return De=e,t()}finally{De=r}},Xn=function(e,t,r){switch(t){case"input":if(be(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var s=r[t];if(s!==e&&s.form===e.form){var g=Wi(s);if(!g)throw Error(f(90));he(s),be(s,g)}}}break;case"textarea":cr(e,r);break;case"select":t=r.value,t!=null&&Ut(e,!!r.multiple,t,!1)}},ml=ka,gl=qr;var Gf={usingClientEntryPoint:!1,Events:[Qs,us,Wi,fl,pl,ka]},di={findFiberByHostInstance:Br,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jf={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.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=wl(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||qf,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 Rn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rn.isDisabled&&Rn.supportsFiber)try{Ci=Rn.inject(Jf),Wt=Rn}catch{}}return mt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Gf,mt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(f(200));return Vf(e,t,null,r)},mt.createRoot=function(e,t){if(!Ma(e))throw Error(f(299));var r=!1,s="",g=Ku;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Pa(e,1,!1,null,null,r,!1,s,g),e[Yt]=t.current,Gs(e.nodeType===8?e.parentNode:e),new Aa(t)},mt.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(f(188)):(e=Object.keys(e).join(","),Error(f(268,e)));return e=wl(t),e=e===null?null:e.stateNode,e},mt.flushSync=function(e){return qr(e)},mt.hydrate=function(e,t,r){if(!En(t))throw Error(f(200));return Ln(null,e,t,!0,r)},mt.hydrateRoot=function(e,t,r){if(!Ma(e))throw Error(f(405));var s=r!=null&&r.hydratedSources||null,g=!1,b="",O=Ku;if(r!=null&&(r.unstable_strictMode===!0&&(g=!0),r.identifierPrefix!==void 0&&(b=r.identifierPrefix),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),t=Vu(t,null,e,1,r??null,g,!1,b,O),e[Yt]=t.current,Gs(e),s)for(e=0;e<s.length;e++)r=s[e],g=r._getVersion,g=g(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,g]:t.mutableSourceEagerHydrationData.push(r,g);return new kn(t)},mt.render=function(e,t,r){if(!En(t))throw Error(f(200));return Ln(null,e,t,!1,r)},mt.unmountComponentAtNode=function(e){if(!En(e))throw Error(f(40));return e._reactRootContainer?(qr(function(){Ln(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1},mt.unstable_batchedUpdates=ka,mt.unstable_renderSubtreeIntoContainer=function(e,t,r,s){if(!En(r))throw Error(f(200));if(e==null||e._reactInternals===void 0)throw Error(f(38));return Ln(e,t,r,!1,s)},mt.version="18.3.1-next-f1338f8080-20240426",mt}var rd;function np(){if(rd)return Ba.exports;rd=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(p){console.error(p)}}return a(),Ba.exports=ip(),Ba.exports}var sd;function op(){if(sd)return jn;sd=1;var a=np();return jn.createRoot=a.createRoot,jn.hydrateRoot=a.hydrateRoot,jn}var ap=op();const lp=Td(ap);var K=tl();const Gt=Td(K),id=a=>{let p;const f=new Set,C=(m,_)=>{const h=typeof m=="function"?m(p):m;if(!Object.is(h,p)){const y=p;p=_??(typeof h!="object"||h===null)?h:Object.assign({},p,h),f.forEach(S=>S(p,y))}},j=()=>p,i={setState:C,getState:j,getInitialState:()=>d,subscribe:m=>(f.add(m),()=>f.delete(m))},d=p=a(C,j,i);return i},cp=(a=>a?id(a):id),up=a=>a;function dp(a,p=up){const f=Gt.useSyncExternalStore(a.subscribe,Gt.useCallback(()=>p(a.getState()),[a,p]),Gt.useCallback(()=>p(a.getInitialState()),[a,p]));return Gt.useDebugValue(f),f}const nd=a=>{const p=cp(a),f=C=>dp(p,C);return Object.assign(f,p),f},$n=(a=>a?nd(a):nd);function $t(a){return"'"+a.replace(/'/g,"'\\''")+"'"}const $a=({sessionId:a})=>`claude --dangerously-skip-permissions --session-id ${$t(a)}`,od=({sessionId:a})=>`claude --session-id ${$t(a)}`,hp=()=>"claude --resume",Ad=[{id:"sm-dangerous",label:"Session Manager (skip perms)",description:"claude --dangerously-skip-permissions in this project",category:"build",cwd:"app-cwd",command:$a},{id:"sm-safe",label:"Session Manager (safe)",description:"claude with normal permission prompts in this project",category:"build",cwd:"app-cwd",command:od},{id:"home-dangerous",label:"Home (skip perms)",description:"claude --dangerously-skip-permissions in ~",category:"build",cwd:"home",command:$a},{id:"pick-dangerous",label:"Pick directory (skip perms)…",description:"Choose a folder, launch claude --dangerously-skip-permissions",category:"build",cwd:"pick",command:$a},{id:"pick-safe",label:"Pick directory (safe)…",description:"Choose a folder, launch claude with normal prompts",category:"build",cwd:"pick",command:od},{id:"pick-resume",label:"Pick directory + resume…",description:"Choose a folder, then pick a past session to resume",category:"build",cwd:"pick",command:hp},{id:"pick-shell",label:"Pick directory (shell only)…",description:"Bare interactive shell, no claude auto-launch",category:"build",cwd:"pick",command:null}];let Dt=null;async function fp(){if(Dt)return Dt;try{const a=await window.api.app.engageRulesPath();if(!a)return Dt=[],Dt;const p=await window.api.config.readJson(a);if(!p.exists||p.parseError||!p.data)return Dt=[],Dt;const f=p.data;if(!f.presets||!Array.isArray(f.presets))return Dt=[],Dt;const C=f.projectPath;return Dt=f.presets.map(j=>({id:j.id,label:j.label,description:j.description,category:"engage",cwd:C,platform:j.platform,pipeline:j.pipeline,rules:j.rules,command:()=>`cd ${$t(C)} && ${j.cliEntry}`})),Dt}catch(a){return console.warn("[presets] Failed to load engage presets:",a),Dt=[],Dt}}async function pp(a){const p=Ad.find(C=>C.id===a);return p||((await fp()).find(C=>C.id===a)??null)}async function mp(a){return a.cwd==="app-cwd"?window.api.app.cwd():a.cwd==="home"?window.api.app.homeDir():a.cwd==="pick"?window.api.app.pickDirectory():a.cwd}function Md(a,p){return a.command?a.command(p):null}function gp(a){const p=a.split("/").filter(Boolean);return p[p.length-1]||a}const Le=$n((a,p)=>({tabs:[],activeTabId:null,hydrated:!1,addTab:({id:f,cwd:C,startupCommand:j,presetId:M=null,label:R})=>{const i=f??crypto.randomUUID();if(p().tabs.find(_=>_.id===i))return a({activeTabId:i}),i;const m={id:i,claudeSessionId:i,label:R??gp(C),cwd:C,pid:null,status:"spawning",exitCode:null,startupCommand:j,presetId:M,generation:0};return a({tabs:[...p().tabs,m],activeTabId:i}),i},setTabRunning:(f,C)=>a({tabs:p().tabs.map(j=>j.id===f?{...j,pid:C,status:"running"}:j)}),setTabExited:(f,C)=>a({tabs:p().tabs.map(j=>j.id===f?{...j,status:"exited",exitCode:C}:j)}),closeTab:f=>{var M;window.api.pty.kill(f);const C=p().tabs.filter(R=>R.id!==f),j=p().activeTabId===f?((M=C[C.length-1])==null?void 0:M.id)??null:p().activeTabId;a({tabs:C,activeTabId:j})},setActive:f=>a({activeTabId:f}),restartTab:f=>{const C=p().tabs.find(R=>R.id===f);if(!C)return;window.api.pty.kill(f);const j=crypto.randomUUID(),M=R=>{a({tabs:p().tabs.map(i=>i.id===f?{...i,claudeSessionId:j,pid:null,status:"spawning",exitCode:null,startupCommand:R,generation:i.generation+1}:i)})};C.presetId?pp(C.presetId).then(R=>{M(R?Md(R,{sessionId:j,cwd:C.cwd}):`claude --dangerously-skip-permissions --session-id ${$t(j)}`)}):M(`claude --dangerously-skip-permissions --session-id ${$t(j)}`)},reorderTab:(f,C)=>{const j=[...p().tabs];if(f<0||f>=j.length||C<0||C>=j.length||f===C)return;const[M]=j.splice(f,1);j.splice(C,0,M),a({tabs:j})},restoreTabs:(f,C)=>a({tabs:f,activeTabId:C,hydrated:!0})}));async function vp(){var f;if(Le.getState().hydrated)return;try{const{tabs:C,activeTabId:j,freshStart:M}=await window.api.sessions.load();if(C.length>0){const R=await Promise.all(C.map(async d=>{let m=!M;if(m){const h=await window.api.transcripts.pathFor(d.cwd,d.claudeSessionId);m=await window.api.config.exists(h)}const _=m?d.claudeSessionId:crypto.randomUUID();return{id:d.id,claudeSessionId:_,cwd:d.cwd,label:d.label,presetId:d.presetId,pid:null,status:"spawning",exitCode:null,startupCommand:m?`claude --dangerously-skip-permissions --resume ${$t(_)}`:`claude --dangerously-skip-permissions --session-id ${$t(_)}`,generation:0}})),i=j&&R.find(d=>d.id===j)?j:((f=R[0])==null?void 0:f.id)??null;Le.getState().restoreTabs(R,i)}else Le.setState({hydrated:!0})}catch(C){console.warn("[sessions] hydrate failed:",C),Le.setState({hydrated:!0})}const a=()=>{const{tabs:C,activeTabId:j}=Le.getState(),M=C.map(R=>({id:R.id,claudeSessionId:R.claudeSessionId,cwd:R.cwd,label:R.label,presetId:R.presetId}));window.api.sessions.save({tabs:M,activeTabId:j}).catch(R=>{console.warn("[sessions] save failed:",R)})};let p=null;Le.subscribe((C,j)=>{C.hydrated&&(C.tabs===j.tabs&&C.activeTabId===j.activeTabId||(p!==null&&window.clearTimeout(p),p=window.setTimeout(a,200)))}),a()}const _p=4,ad=40,ld=6;function yp(a){const{onReorder:p,onActivate:f}=a,C=K.useRef(null),j=K.useRef(null),M=K.useRef(0),R=K.useRef(0),[i,d]=K.useState(!1),[,m]=K.useState(0),_=K.useRef(f);_.current=f;const h=K.useCallback(()=>C.current?Array.from(C.current.querySelectorAll("[data-drag-index]")):[],[]),y=K.useCallback((n,c,o)=>{for(let l=0;l<c.length;l++){const w=c[l].left+c[l].width/2;if(n<w)return l<=o?l:l-1}return c.length-1},[]),S=K.useCallback(()=>{const n=j.current,c=C.current;if(!(n!=null&&n.active)||!c)return;const o=c.getBoundingClientRect(),l=n.startX+n.deltaX,w=l-o.left,L=o.right-l;w<ad?c.scrollLeft-=ld:L<ad&&(c.scrollLeft+=ld),M.current=requestAnimationFrame(S)},[]);K.useEffect(()=>{const n=C.current;if(!n)return;let c=!1;const o=()=>{c||(c=!0,R.current=requestAnimationFrame(()=>{c=!1,m(L=>L+1)}))},l=L=>{var H;const E=j.current;if(!E)return;const D=L.clientX-E.startX;if(!E.active&&Math.abs(D)<_p)return;if(!E.active){E.active=!0,E.tabRects=h().map($=>$.getBoundingClientRect()),d(!0);try{(H=C.current)==null||H.setPointerCapture(E.pointerId)}catch{}M.current=requestAnimationFrame(S)}E.deltaX=D;const x=E.tabRects[E.fromIndex],P=x.left+x.width/2+D;E.currentIndex=y(P,E.tabRects,E.fromIndex),o()},w=L=>{const E=j.current;if(E&&E.pointerId===L.pointerId){cancelAnimationFrame(M.current),cancelAnimationFrame(R.current);try{n.releasePointerCapture(E.pointerId)}catch{}E.active&&E.fromIndex!==E.currentIndex?p(E.fromIndex,E.currentIndex):_.current(E.fromIndex),j.current=null,d(!1),m(D=>D+1)}};return n.addEventListener("pointermove",l),n.addEventListener("pointerup",w),n.addEventListener("pointercancel",w),()=>{n.removeEventListener("pointermove",l),n.removeEventListener("pointerup",w),n.removeEventListener("pointercancel",w),cancelAnimationFrame(M.current),cancelAnimationFrame(R.current)}},[p,h,y,S]);const k=K.useCallback((n,c)=>{n.button!==0||n.target.closest("button")||(j.current={active:!1,fromIndex:c,currentIndex:c,startX:n.clientX,deltaX:0,tabRects:[],pointerId:n.pointerId})},[]);return{getTabDragProps:K.useCallback(n=>{var l;const c=j.current,o={};if(c!=null&&c.active)if(n===c.fromIndex)o.transform=`translateX(${c.deltaX}px) scale(1.03)`,o.zIndex=10,o.opacity=.85,o.boxShadow="0 2px 8px rgba(0,0,0,0.4)",o.position="relative",o.pointerEvents="none";else{const w=c.fromIndex,L=c.currentIndex,D=(((l=c.tabRects[w])==null?void 0:l.width)??0)+4;o.transition="transform 0.15s ease",w<L&&n>w&&n<=L?o.transform=`translateX(-${D}px)`:w>L&&n>=L&&n<w?o.transform=`translateX(${D}px)`:o.transform="translateX(0)"}return{onPointerDown:w=>k(w,n),style:o,"data-drag-index":n}},[k]),isDragging:i,containerRef:C}}function wp(){const{tabs:a,activeTabId:p,addTab:f,closeTab:C,setActive:j,reorderTab:M}=Le(),[R,i]=K.useState(null),{getTabDragProps:d,isDragging:m,containerRef:_}=yp({tabCount:a.length,onReorder:M,onActivate:y=>{const S=a[y];S&&j(S.id)}}),h=async()=>{i(null);try{const y=await window.api.app.pickDirectory();if(!y)return;const S=crypto.randomUUID(),k=`claude --dangerously-skip-permissions --session-id ${$t(S)}`;f({id:S,cwd:y,startupCommand:k,presetId:"pick-dangerous"})}catch(y){const S=y instanceof Error?y.message:String(y);i(S),console.error("[TabBar] createPickedSession failed:",y)}};return u.jsxs("div",{className:"h-9 bg-bg-elev border-b border-line flex items-center px-2 gap-1 shrink-0",children:[u.jsx("div",{ref:_,className:`flex items-center gap-1 overflow-x-auto min-w-0 flex-1 select-none ${m?"cursor-grabbing":""}`,children:a.map((y,S)=>{const k=y.id===p,v=d(S);return u.jsxs("div",{...v,style:v.style,className:`group px-3 py-1 flex items-center gap-2 border border-line rounded-t text-xs shrink-0 ${m?"":"cursor-grab"} ${k?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg"}`,title:y.cwd,children:[u.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${y.status==="running"?"bg-green-500":y.status==="spawning"?"bg-yellow-500 animate-pulse":"bg-fg-faint"}`}),u.jsx("span",{children:y.label}),u.jsx("button",{onClick:n=>{n.stopPropagation(),C(y.id)},className:"text-fg-faint opacity-0 group-hover:opacity-100 hover:text-fg ml-1",title:"Close session",children:"×"})]},y.id)})}),u.jsx("div",{className:"shrink-0",children:u.jsx("button",{onClick:h,className:"px-2 py-1 text-fg-dim hover:text-fg text-xs",title:"New session — pick a project directory",children:"+ new"})}),R&&u.jsx("div",{className:"text-red-400 text-xs px-2 shrink-0",children:R}),u.jsx("div",{className:"text-fg-faint text-xs px-2 shrink-0",children:"Claude Session Manager"})]})}const Sp=5e3,On=16e3;let Dn=null,In=!1,Qr=!1;function Od(){return Dn||(Dn=new Worker(new URL(""+new URL("whisperWorker-BhZpQ_3S.js",import.meta.url).href,import.meta.url),{type:"module"}),Dn)}function xp(a){if(In||Qr)return;Qr=!0;const p=Od(),f=C=>{C.data.type==="status"&&(a==null||a(C.data.status,C.data.message),C.data.status==="ready"&&(In=!0,Qr=!1)),C.data.type==="error"&&(Qr=!1,a==null||a("error",C.data.error))};p.addEventListener("message",f),p.postMessage({type:"load"})}function bp(){var a;return typeof Worker<"u"&&!!((a=navigator.mediaDevices)!=null&&a.getUserMedia)}async function Cp(a){const p=await a.arrayBuffer(),C=await new OfflineAudioContext(1,1,On).decodeAudioData(p),j=new OfflineAudioContext(1,Math.ceil(C.duration*On),On),M=j.createBufferSource();return M.buffer=C,M.connect(j.destination),M.start(),(await j.startRendering()).getChannelData(0)}function kp(a){const p=Od();let f=!1,C=null,j=null,M=[],R=null;const i=async()=>{if(M.length===0)return;const m=new Blob(M,{type:M[0].type});M=[];try{const _=await Cp(m);p.postMessage({type:"transcribe",audio:_},[_.buffer])}catch{}},d=m=>{var _;if(!f)if(m.data.type==="result"){const h=m.data.text;h&&a.onFinal(h)}else m.data.type==="error"?a.onError(m.data.error):m.data.type==="status"&&((_=a.onModelStatus)==null||_.call(a,m.data.status,m.data.message),m.data.status==="ready"&&(In=!0,Qr=!1))};return p.addEventListener("message",d),{start:async()=>{if(!f){!In&&!Qr&&(Qr=!0,a.onInterim("Loading speech model..."),p.postMessage({type:"load"}));try{j=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:On,channelCount:1,echoCancellation:!0}})}catch(m){const _=m instanceof Error?m.message:"Microphone access denied";a.onError(_);return}C=new MediaRecorder(j,{mimeType:MediaRecorder.isTypeSupported("audio/webm;codecs=opus")?"audio/webm;codecs=opus":"audio/webm"}),C.ondataavailable=m=>{m.data.size>0&&M.push(m.data)},C.start(1e3),a.onInterim("Listening..."),R=setInterval(()=>{!f&&M.length>0&&(a.onInterim("Transcribing..."),i())},Sp)}},stop:()=>{R&&(clearInterval(R),R=null),C&&C.state!=="inactive"&&C.stop(),M.length>0&&(a.onInterim("Transcribing..."),i()),j==null||j.getTracks().forEach(m=>m.stop()),j=null,C=null},destroy:()=>{if(f=!0,R&&(clearInterval(R),R=null),C&&C.state!=="inactive")try{C.stop()}catch{}j==null||j.getTracks().forEach(m=>m.stop()),j=null,C=null,p.removeEventListener("message",d)}}}let or=null;const bt=$n((a,p)=>({isRecording:!1,ttsEnabled:!1,autoSend:!1,lastTranscript:"",error:null,modelStatus:"idle",initModel:()=>{p().modelStatus==="idle"&&(a({modelStatus:"loading"}),xp(f=>{a(f==="ready"?{modelStatus:"ready"}:f==="error"?{modelStatus:"error"}:{modelStatus:"loading"})}))},startRecording:f=>{if(!p().isRecording){if(!bp()){a({error:"Microphone or Web Worker not available"});return}try{const C=kp({onInterim:j=>a({lastTranscript:j}),onFinal:j=>{const M=p().autoSend?j+`
|
|
42
|
+
`:j;window.api.pty.write({tabId:f,data:M}),a({lastTranscript:""})},onError:j=>{a({error:j,isRecording:!1}),or==null||or.destroy(),or=null},onModelStatus:j=>{j==="ready"?a({modelStatus:"ready"}):j==="loading"&&a({modelStatus:"loading"})}});C.start(),or=C,a({isRecording:!0,error:null,lastTranscript:""})}catch(C){a({error:C instanceof Error?C.message:"Failed to start recording"})}}},stopRecording:()=>{or&&(or.stop(),or.destroy(),or=null),a({isRecording:!1,lastTranscript:""})},toggleTTS:()=>a(f=>({ttsEnabled:!f.ttsEnabled})),setAutoSend:f=>a({autoSend:f}),clearError:()=>a({error:null})}));function Ep(){const a=bt(_=>_.isRecording),p=bt(_=>_.error),f=bt(_=>_.modelStatus),C=bt(_=>_.startRecording),j=bt(_=>_.stopRecording),M=bt(_=>_.initModel),R=Le(_=>_.activeTabId);K.useEffect(()=>{M()},[M]);const i=()=>{a?j():R&&C(R)},d=f==="loading",m=p||(d?"Downloading speech model...":a?"Stop recording":"Voice input (local Whisper, fully offline)");return u.jsx("button",{onClick:i,disabled:d,title:m,className:`p-1.5 rounded transition-colors ${d?"text-fg-faint animate-pulse cursor-wait":a?"text-red-400 ring-2 ring-red-400 animate-pulse":"text-fg-dim hover:text-fg"}`,children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("rect",{x:"9",y:"1",width:"6",height:"12",rx:"3"}),u.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),u.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21"}),u.jsx("line",{x1:"8",y1:"21",x2:"16",y2:"21"})]})})}function Lp(){const a=bt(f=>f.ttsEnabled),p=bt(f=>f.toggleTTS);return u.jsx("button",{onClick:p,title:a?"Disable TTS":"Enable TTS",className:`p-1.5 rounded transition-colors ${a?"text-accent":"text-fg-dim hover:text-fg"}`,children:u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[u.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),a?u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07"}),u.jsx("path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14"})]}):u.jsxs(u.Fragment,{children:[u.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),u.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})]})})}const Rp=[{key:"overview",label:"Overview"},{key:"terminal",label:"Terminal"},{key:"system-prompt",label:"System Prompt"},{key:"settings",label:"Settings"},{key:"permissions",label:"Permissions"},{key:"skills",label:"Skills"},{key:"plugins",label:"Plugins"},{key:"mcp",label:"MCP Servers"},{key:"hooks",label:"Hooks"},{key:"subagents",label:"Subagents",live:!0},{key:"plans",label:"Plans"},{key:"tasks",label:"Tasks",live:!0},{key:"projects",label:"Projects"},{key:"history",label:"History"},{key:"keybindings",label:"Keybindings"},{key:"usage",label:"Usage"}];function jp({active:a,onChange:p,onNewSession:f}){return u.jsxs("nav",{className:"w-52 bg-bg-elev border-r border-line shrink-0 overflow-y-auto py-2 flex flex-col",children:[u.jsx("div",{className:"flex-1",children:Rp.map(C=>u.jsxs("button",{onClick:()=>p(C.key),className:`w-full text-left px-4 py-1.5 text-xs flex items-center justify-between transition-colors ${a===C.key?"bg-bg-hi text-fg border-l-2 border-accent":"text-fg-dim hover:text-fg hover:bg-bg-hi border-l-2 border-transparent"}`,children:[u.jsx("span",{children:C.label}),C.live&&u.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-accent animate-pulse"})]},C.key))}),f&&u.jsxs("div",{className:"px-3 py-3 border-t border-line flex items-center gap-2",children:[u.jsx(Ep,{}),u.jsx(Lp,{}),u.jsx("button",{onClick:f,className:"flex-1 px-3 py-1.5 text-xs text-fg-dim hover:text-fg bg-bg hover:bg-bg-hi border border-line rounded transition-colors",children:"+ New Session"})]})]})}function Dp(){const a=Le(j=>j.tabs),p=Le(j=>j.activeTabId),f=Le(j=>j.restartTab),C=a.find(j=>j.id===p)??null;return u.jsxs("div",{className:"h-6 bg-bg-elev border-t border-line flex items-center px-3 gap-4 text-xs text-fg-faint shrink-0",children:[u.jsxs("span",{children:["status: ",u.jsx("span",{className:"text-fg-dim",children:(C==null?void 0:C.status)??"—"})]}),u.jsxs("span",{children:["pid: ",u.jsx("span",{className:"text-fg-dim",children:(C==null?void 0:C.pid)??"—"})]}),u.jsx("span",{children:"tokens: — in / — out"}),u.jsx("span",{children:"cost: $—"}),u.jsx("div",{className:"flex-1"}),C&&C.status==="running"&&u.jsx("button",{onClick:()=>f(C.id),className:"text-fg-faint hover:text-fg transition-colors",title:"Restart session — kill claude and start fresh (picks up config changes)",children:"restart session"}),u.jsx("button",{onClick:()=>window.api.app.rebootApp(),className:"text-fg-faint hover:text-fg transition-colors",title:"Restart Session Manager — reload app code (Ctrl+Shift+R)",children:"restart app"}),u.jsxs("span",{className:"truncate max-w-md",children:["cwd: ",u.jsx("span",{className:"text-fg-dim",children:(C==null?void 0:C.cwd)??"—"})]})]})}var Ua={exports:{}},cd;function Pp(){return cd||(cd=1,(function(a,p){(function(f,C){a.exports=C()})(globalThis,(()=>(()=>{var f={4567:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,L){var E,D=arguments.length,x=D<3?l:L===null?L=Object.getOwnPropertyDescriptor(l,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,L);else for(var P=o.length-1;P>=0;P--)(E=o[P])&&(x=(D<3?E(x):D>3?E(l,w,x):E(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,L){l(w,L,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const h=d(9042),y=d(9924),S=d(844),k=d(4725),v=d(2585),n=d(3656);let c=i.AccessibilityManager=class extends S.Disposable{constructor(o,l,w,L){super(),this._terminal=o,this._coreBrowserService=w,this._renderService=L,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 E=0;E<this._terminal.rows;E++)this._rowElements[E]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[E]);if(this._topBoundaryFocusListener=E=>this._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 y.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
43
|
+
`)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.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(o){for(let l=0;l<o;l++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
|
|
44
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,l){this._liveRegionDebouncer.refresh(o,l,this._terminal.rows)}_renderRows(o,l){const w=this._terminal.buffer,L=w.lines.length.toString();for(let E=o;E<=l;E++){const D=w.lines.get(w.ydisp+E),x=[],P=(D==null?void 0:D.translateToString(!0,void 0,void 0,x))||"",H=(w.ydisp+E+1).toString(),$=this._rowElements[E];$&&(P.length===0?($.innerText=" ",this._rowColumns.set($,[0,1])):($.textContent=P,this._rowColumns.set($,x)),$.setAttribute("aria-posinset",H),$.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,l){const w=o.target,L=this._rowElements[l===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==L)return;let E,D;if(l===0?(E=w,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(E=this._rowElements.shift(),D=w,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const x=this._createAccessibilityTreeNode();this._rowElements.unshift(x),this._rowContainer.insertAdjacentElement("afterbegin",x)}else{const x=this._createAccessibilityTreeNode();this._rowElements.push(x),this._rowContainer.appendChild(x)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var P;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:o.anchorNode,offset:o.anchorOffset},w={node:o.focusNode,offset:o.focusOffset};if((l.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===w.node&&l.offset>w.offset)&&([l,w]=[w,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const L=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:L,offset:((P=L.textContent)==null?void 0:P.length)??0}),!this._rowContainer.contains(w.node))return;const E=({node:H,offset:$})=>{const W=H instanceof Text?H.parentNode:H;let I=parseInt(W==null?void 0:W.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const X=this._rowColumns.get(W);if(!X)return console.warn("columns is null. Race condition?"),null;let q=$<X.length?X[$]:X.slice(-1)[0]+1;return q>=this._terminal.cols&&(++I,q=0),{row:I,column:q}},D=E(l),x=E(w);if(D&&x){if(D.row>x.row||D.row===x.row&&D.column>=x.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(x.row-D.row)*this._terminal.cols-D.column+x.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_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 o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=c=m([_(1,v.IInstantiationService),_(2,k.ICoreBrowserService),_(3,k.IRenderService)],c)},3614:(R,i)=>{function d(y){return y.replace(/\r?\n/g,"\r")}function m(y,S){return S?"\x1B[200~"+y+"\x1B[201~":y}function _(y,S,k,v){y=m(y=d(y),k.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(y,!0),S.value=""}function h(y,S,k){const v=k.getBoundingClientRect(),n=y.clientX-v.left-10,c=y.clientY-v.top-10;S.style.width="20px",S.style.height="20px",S.style.left=`${n}px`,S.style.top=`${c}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=d,i.bracketTextForPaste=m,i.copyHandler=function(y,S){y.clipboardData&&y.clipboardData.setData("text/plain",S.selectionText),y.preventDefault()},i.handlePasteEvent=function(y,S,k,v){y.stopPropagation(),y.clipboardData&&_(y.clipboardData.getData("text/plain"),S,k,v)},i.paste=_,i.moveTextAreaUnderMouseCursor=h,i.rightClickHandler=function(y,S,k,v,n){h(y,S,k),n&&v.rightClickSelect(y),S.value=v.selectionText,S.select()}},7239:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const m=d(1505);i.ColorContrastCache=class{constructor(){this._color=new m.TwoKeyMap,this._css=new m.TwoKeyMap}setCss(_,h,y){this._css.set(_,h,y)}getCss(_,h){return this._css.get(_,h)}setColor(_,h,y){this._color.set(_,h,y)}getColor(_,h){return this._color.get(_,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(d,m,_,h){d.addEventListener(m,_,h);let y=!1;return{dispose:()=>{y||(y=!0,d.removeEventListener(m,_,h))}}}},3551:function(R,i,d){var m=this&&this.__decorate||function(c,o,l,w){var L,E=arguments.length,D=E<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,o,l,w);else for(var x=c.length-1;x>=0;x--)(L=c[x])&&(D=(E<3?L(D):E>3?L(o,l,D):L(o,l))||D);return E>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(c,o){return function(l,w){o(l,w,c)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const h=d(3656),y=d(8460),S=d(844),k=d(2585),v=d(4725);let n=i.Linkifier=class extends S.Disposable{get currentLink(){return this._currentLink}constructor(c,o,l,w,L){super(),this._element=c,this._mouseService=o,this._renderService=l,this._bufferService=w,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,S.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,S.toDisposable)((()=>{var E;this._lastMouseEvent=void 0,(E=this._activeProviderReplies)==null||E.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const l=c.composedPath();for(let w=0;w<l.length;w++){const L=l[w];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,o){var w,L;this._activeProviderReplies&&o||((w=this._activeProviderReplies)==null||w.forEach((E=>{E==null||E.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let l=!1;for(const[E,D]of this._linkProviderService.linkProviders.entries())o?(L=this._activeProviderReplies)!=null&&L.get(E)&&(l=this._checkLinkProviderResult(E,c,l)):D.provideLinks(c.y,(x=>{var H,$;if(this._isMouseOut)return;const P=x==null?void 0:x.map((W=>({link:W})));(H=this._activeProviderReplies)==null||H.set(E,P),l=this._checkLinkProviderResult(E,c,l),(($=this._activeProviderReplies)==null?void 0:$.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,o){const l=new Set;for(let w=0;w<o.size;w++){const L=o.get(w);if(L)for(let E=0;E<L.length;E++){const D=L[E],x=D.link.range.start.y<c?0:D.link.range.start.x,P=D.link.range.end.y>c?this._bufferService.cols:D.link.range.end.x;for(let H=x;H<=P;H++){if(l.has(H)){L.splice(E--,1);break}l.add(H)}}}}_checkLinkProviderResult(c,o,l){var E;if(!this._activeProviderReplies)return l;const w=this._activeProviderReplies.get(c);let L=!1;for(let D=0;D<c;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(L=!0);if(!L&&w){const D=w.find((x=>this._linkAtPosition(x.link,o)));D&&(l=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let D=0;D<this._activeProviderReplies.size;D++){const x=(E=this._activeProviderReplies.get(D))==null?void 0:E.find((P=>this._linkAtPosition(P.link,o)));if(x){l=!0,this._handleNewLink(x);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const o=this._positionFromMouseEvent(c,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,o){this._currentLink&&this._lastMouseEvent&&(!c||!o||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,S.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(c.link,o)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var l,w;return(w=(l=this._currentLink)==null?void 0:l.state)==null?void 0:w.decorations.pointerCursor},set:l=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,w;return(w=(l=this._currentLink)==null?void 0:l.state)==null?void 0:w.decorations.underline},set:l=>{var w,L,E;(w=this._currentLink)!=null&&w.state&&((E=(L=this._currentLink)==null?void 0:L.state)==null?void 0:E.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const w=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(w,L),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(c,o,l){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(l,o.text)}_fireUnderlineEvent(c,o){const l=c.range,w=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-w-1,l.end.x,l.end.y-w-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(c,o,l){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(l,o.text)}_linkAtPosition(c,o){const l=c.range.start.y*this._bufferService.cols+c.range.start.x,w=c.range.end.y*this._bufferService.cols+c.range.end.x,L=o.y*this._bufferService.cols+o.x;return l<=L&&L<=w}_positionFromMouseEvent(c,o,l){const w=l.getCoords(c,o,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,o,l,w,L){return{x1:c,y1:o,x2:l,y2:w,cols:this._bufferService.cols,fg:L}}};i.Linkifier=n=m([_(1,v.IMouseService),_(2,v.IRenderService),_(3,k.IBufferService),_(4,v.ILinkProviderService)],n)},9042:(R,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(R,i,d){var m=this&&this.__decorate||function(v,n,c,o){var l,w=arguments.length,L=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,n,c,o);else for(var E=v.length-1;E>=0;E--)(l=v[E])&&(L=(w<3?l(L):w>3?l(n,c,L):l(n,c))||L);return w>3&&L&&Object.defineProperty(n,c,L),L},_=this&&this.__param||function(v,n){return function(c,o){n(c,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const h=d(511),y=d(2585);let S=i.OscLinkProvider=class{constructor(v,n,c){this._bufferService=v,this._optionsService=n,this._oscLinkService=c}provideLinks(v,n){var P;const c=this._bufferService.buffer.lines.get(v-1);if(!c)return void n(void 0);const o=[],l=this._optionsService.rawOptions.linkHandler,w=new h.CellData,L=c.getTrimmedLength();let E=-1,D=-1,x=!1;for(let H=0;H<L;H++)if(D!==-1||c.hasContent(H)){if(c.loadCell(H,w),w.hasExtendedAttrs()&&w.extended.urlId){if(D===-1){D=H,E=w.extended.urlId;continue}x=w.extended.urlId!==E}else D!==-1&&(x=!0);if(x||D!==-1&&H===L-1){const $=(P=this._oscLinkService.getLinkData(E))==null?void 0:P.uri;if($){const W={start:{x:D+1,y:v},end:{x:H+(x||H!==L-1?0:1),y:v}};let I=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const X=new URL($);["http:","https:"].includes(X.protocol)||(I=!0)}catch{I=!0}I||o.push({text:$,range:W,activate:(X,q)=>l?l.activate(X,q,W):k(0,q),hover:(X,q)=>{var z;return(z=l==null?void 0:l.hover)==null?void 0:z.call(l,X,q,W)},leave:(X,q)=>{var z;return(z=l==null?void 0:l.leave)==null?void 0:z.call(l,X,q,W)}})}x=!1,w.hasExtendedAttrs()&&w.extended.urlId?(D=H,E=w.extended.urlId):(D=-1,E=-1)}}n(o)}};function k(v,n){if(confirm(`Do you want to navigate to ${n}?
|
|
45
45
|
|
|
46
|
-
WARNING: This link could potentially be dangerous`)){const u=window.open();if(u){try{u.opener=null}catch{}u.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=S=m([_(0,y.IBufferService),_(1,y.IOptionsService),_(2,y.IOscLinkService)],S)},6193:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(d,m){this._renderCallback=d,this._coreBrowserService=m,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,m,_){this._rowCount=_,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const m=d(3614),_=d(3656),h=d(3551),y=d(9042),S=d(3730),k=d(1680),v=d(3107),n=d(5744),u=d(2950),o=d(1296),l=d(428),w=d(4269),E=d(5114),L=d(8934),D=d(3230),x=d(9312),P=d(4725),H=d(6731),$=d(8055),W=d(8969),I=d(8460),X=d(844),q=d(6114),z=d(8437),re=d(2584),Q=d(7399),A=d(5941),B=d(9074),T=d(2585),F=d(5435),ee=d(4567),ne=d(779);class ce extends W.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(G={}){super(G),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,ie)=>this.refresh(N,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,X.toDisposable)((()=>{var N,ie;this._customKeyEventHandler=void 0,(ie=(N=this.element)==null?void 0:N.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const N of G){let ie,se="";switch(N.index){case 256:ie="foreground",se="10";break;case 257:ie="background",se="11";break;case 258:ie="cursor",se="12";break;default:ie="ansi",se="4;"+N.index}switch(N.type){case 0:const fe=$.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${re.C0.ESC}]${se};${(0,A.toRgbString)(fe)}${re.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((he=>he.ansi[N.index]=$.channels.toColor(...N.color)));else{const he=ie;this._themeService.modifyColors((ke=>ke[he]=$.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ee.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.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 G=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(G);if(!N)return;const ie=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,fe=N.getWidth(ie),he=this._renderService.dimensions.css.cell.width*fe,ke=this.buffer.y*this._renderService.dimensions.css.cell.height,Te=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Te+"px",this.textarea.style.top=ke+"px",this.textarea.style.width=he+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,m.copyHandler)(N,this._selectionService)})));const G=N=>(0,m.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,_.addDisposableDomListener)(this.element,"paste",G)),q.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,m.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var ie;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.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"),G.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.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",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),q.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(E.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(u.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(x.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(P.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(ee.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,N=this.element;function ie(he){const ke=G._mouseService.getMouseReportCoords(he,G.screenElement);if(!ke)return!1;let Te,Me;switch(he.overrideType||he.type){case"mousemove":Me=32,he.buttons===void 0?(Te=3,he.button!==void 0&&(Te=he.button<3?he.button:3)):Te=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Me=0,Te=he.button<3?he.button:3;break;case"mousedown":Me=1,Te=he.button<3?he.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler(he)===!1||G.viewport.getLinesScrolled(he)===0)return!1;Me=he.deltaY<0?0:1,Te=4;break;default:return!1}return!(Me===void 0||Te===void 0||Te>4)&&G.coreMouseService.triggerMouseEvent({col:ke.col,row:ke.row,x:ke.x,y:ke.y,button:Te,action:Me,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},fe={mouseup:he=>(ie(he),he.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(he)),wheel:he=>(ie(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ie(he)},mousemove:he=>{he.buttons||ie(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?se.mousemove||(N.addEventListener("mousemove",fe.mousemove),se.mousemove=fe.mousemove):(N.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&he?se.wheel||(N.addEventListener("wheel",fe.wheel,{passive:!1}),se.wheel=fe.wheel):(N.removeEventListener("wheel",se.wheel),se.wheel=null),2&he?se.mouseup||(se.mouseup=fe.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&he?se.mousedrag||(se.mousedrag=fe.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(N,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ie(he),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(he)}))),this.register((0,_.addDisposableDomListener)(N,"wheel",(he=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ke=this.viewport.getLinesScrolled(he);if(ke===0)return;const Te=re.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Me="";for(let Qe=0;Qe<Math.abs(ke);Qe++)Me+=Te;return this.coreService.triggerDataEvent(Me,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(N,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(N,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(G,N){var ie;(ie=this._renderService)==null||ie.refreshRows(G,N)}updateCursorStyle(G){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(G)?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(G,N,ie=0){var se;ie===1?(super.scrollLines(G,N,ie),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(G)}paste(G){(0,m.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,N,ie){this._selectionService.setSelection(G,N,ie)}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 G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,N){var ie;(ie=this._selectionService)==null||ie.selectLines(G,N)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!N&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,Q.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),ie.type===3||ie.type===2){const se=this.rows-1;return this.scrollLines(ie.type===2?-se:se),this.cancel(G,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(ie.cancel&&this.cancel(G,!0),!ie.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==re.C0.ETX&&ie.key!==re.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,N){const ie=G.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||G.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||G.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?ie:ie&&(!N.keyCode||N.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)N=G.charCode;else if(G.which===null||G.which===void 0)N=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;N=G.which}return!(!N||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=G.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(G),!0}return!1}resize(G,N){G!==this.cols||N!==this.rows?super.resize(G,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,N){var ie,se;(ie=this._charSizeService)==null||ie.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var G;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var N,ie;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(re.C0.ESC+"[I"):this.coreService.triggerDataEvent(re.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[4;${ie};${N}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),fe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[6;${fe};${se}t`)}}cancel(G,N){if(this.options.cancelEvents||N)return G.preventDefault(),G.stopPropagation(),!1}}i.Terminal=ce},9924:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(d,m=1e3){this._renderCallback=d,this._debounceThresholdMS=m,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,m,_){this._rowCount=_,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=h-this._lastRefreshMs,S=this._debounceThresholdMS-y;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 d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m)}}},1680:function(R,i,d){var m=this&&this.__decorate||function(u,o,l,w){var E,L=arguments.length,D=L<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,o,l,w);else for(var x=u.length-1;x>=0;x--)(E=u[x])&&(D=(L<3?E(D):L>3?E(o,l,D):E(o,l))||D);return L>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(u,o){return function(l,w){o(l,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const h=d(3656),y=d(4725),S=d(8460),k=d(844),v=d(2585);let n=i.Viewport=class extends k.Disposable{constructor(u,o,l,w,E,L,D,x){super(),this._viewportElement=u,this._scrollArea=o,this._bufferService=l,this._optionsService=w,this._charSizeService=E,this._renderService=L,this._coreBrowserService=D,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,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((P=>this._renderDimensions=P))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((P=>this._handleThemeChange(P)))),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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,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,o){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&l<this._lastRecordedBufferHeight)||(u.cancelable&&u.preventDefault(),!1)}handleWheel(u){const o=this._getPixelsScrolled(u);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(u,o))}scrollLines(u){if(u!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=u*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,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 o=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(u,o){var x;let l,w="";const E=[],L=o??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let P=u;P<L;P++){const H=D.get(P);if(!H)continue;const $=(x=D.get(P+1))==null?void 0:x.isWrapped;if(w+=H.translateToString(!$),!$||P===D.length-1){const W=document.createElement("div");W.textContent=w,E.push(W),w.length>0&&(l=W),w=""}}return{bufferElements:E,cursorElement:l}}getLinesScrolled(u){if(u.deltaY===0||u.shiftKey)return 0;let o=this._applyScrollModifier(u.deltaY,u);return u.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):u.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(u,o){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&o.altKey||l==="ctrl"&&o.ctrlKey||l==="shift"&&o.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 o=this._lastTouchY-u.touches[0].pageY;return this._lastTouchY=u.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(u,o))}};i.Viewport=n=m([_(2,v.IBufferService),_(3,v.IOptionsService),_(4,y.ICharSizeService),_(5,y.IRenderService),_(6,y.ICoreBrowserService),_(7,y.IThemeService)],n)},3107:function(R,i,d){var m=this&&this.__decorate||function(v,n,u,o){var l,w=arguments.length,E=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,u,o);else for(var L=v.length-1;L>=0;L--)(l=v[L])&&(E=(w<3?l(E):w>3?l(n,u,E):l(n,u))||E);return w>3&&E&&Object.defineProperty(n,u,E),E},_=this&&this.__param||function(v,n){return function(u,o){n(u,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const h=d(4725),y=d(844),S=d(2585);let k=i.BufferDecorationRenderer=class extends y.Disposable{constructor(v,n,u,o,l){super(),this._screenElement=v,this._bufferService=n,this._coreBrowserService=u,this._decorationService=o,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((w=>this._removeDecoration(w)))),this.register((0,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=v==null?void 0:v.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const u=v.options.x??0;return u&&u>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(v,n),n}_refreshStyle(v){const n=v.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let u=this._decorationElements.get(v);u||(u=this._createElement(v),v.element=u,this._decorationElements.set(v,u),this._container.appendChild(u),v.onDispose((()=>{this._decorationElements.delete(v),u.remove()}))),u.style.top=n*this._renderService.dimensions.css.cell.height+"px",u.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(u)}}_refreshXPosition(v,n=v.element){if(!n)return;const u=v.options.x??0;(v.options.anchor||"left")==="right"?n.style.right=u?u*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=u?u*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var n;(n=this._decorationElements.get(v))==null||n.remove(),this._decorationElements.delete(v),v.dispose()}};i.BufferDecorationRenderer=k=m([_(1,S.IBufferService),_(2,h.ICoreBrowserService),_(3,S.IDecorationService),_(4,h.IRenderService)],k)},5871:(R,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(d){if(d.options.overviewRulerOptions){for(const m of this._zones)if(m.color===d.options.overviewRulerOptions.color&&m.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(m,d.marker.line))return;if(this._lineAdjacentToZone(m,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(m,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,m){return m>=d.startBufferLine&&m<=d.endBufferLine}_lineAdjacentToZone(d,m,_){return m>=d.startBufferLine-this._linePadding[_||"full"]&&m<=d.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(d,m){d.startBufferLine=Math.min(d.startBufferLine,m),d.endBufferLine=Math.max(d.endBufferLine,m)}}},5744:function(R,i,d){var m=this&&this.__decorate||function(l,w,E,L){var D,x=arguments.length,P=x<3?w:L===null?L=Object.getOwnPropertyDescriptor(w,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,w,E,L);else for(var H=l.length-1;H>=0;H--)(D=l[H])&&(P=(x<3?D(P):x>3?D(w,E,P):D(w,E))||P);return x>3&&P&&Object.defineProperty(w,E,P),P},_=this&&this.__param||function(l,w){return function(E,L){w(E,L,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const h=d(5871),y=d(4725),S=d(844),k=d(2585),v={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0};let o=i.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,w,E,L,D,x,P){var $;super(),this._viewportElement=l,this._screenElement=w,this._bufferService=E,this._decorationService=L,this._renderService=D,this._optionsService=x,this._coreBrowserService=P,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var W;(W=this._canvas)==null||W.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const l=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=l,n.center=w,n.right=l,this._refreshDrawHeightConstants(),u.full=0,u.left=0,u.center=n.left,u.right=n.left+n.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);v.left=w,v.center=w,v.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const w of l)w.position!=="full"&&this._renderColorZone(w);for(const w of l)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(u[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-v[l.position||"full"]/2),n[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[l.position||"full"]))}_queueRefresh(l,w){this._shouldUpdateDimensions=l||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=o=m([_(2,k.IBufferService),_(3,k.IDecorationService),_(4,y.IRenderService),_(5,k.IOptionsService),_(6,y.ICoreBrowserService)],o)},2950:function(R,i,d){var m=this&&this.__decorate||function(v,n,u,o){var l,w=arguments.length,E=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,n,u,o);else for(var L=v.length-1;L>=0;L--)(l=v[L])&&(E=(w<3?l(E):w>3?l(n,u,E):l(n,u))||E);return w>3&&E&&Object.defineProperty(n,u,E),E},_=this&&this.__param||function(v,n){return function(u,o){n(u,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const h=d(4725),y=d(2585),S=d(2584);let k=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,n,u,o,l,w){this._textarea=v,this._compositionView=n,this._bufferService=u,this._optionsService=o,this._coreService=l,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let u;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,u=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),u.length>0&&this._coreService.triggerDataEvent(u,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,u=n.replace(v,"");this._dataAlreadySent=u,n.length>v.length?this._coreService.triggerDataEvent(u,!0):n.length<v.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):n.length===v.length&&n!==v&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),u=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=o+"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=l+"px",this._textarea.style.top=o+"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"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=k=m([_(2,y.IBufferService),_(3,y.IOptionsService),_(4,y.ICoreService),_(5,h.IRenderService)],k)},9806:(R,i)=>{function d(m,_,h){const y=h.getBoundingClientRect(),S=m.getComputedStyle(h),k=parseInt(S.getPropertyValue("padding-left")),v=parseInt(S.getPropertyValue("padding-top"));return[_.clientX-y.left-k,_.clientY-y.top-v]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=d,i.getCoords=function(m,_,h,y,S,k,v,n,u){if(!k)return;const o=d(m,_,h);return o?(o[0]=Math.ceil((o[0]+(u?v/2:0))/v),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),y+(u?1:0)),o[1]=Math.min(Math.max(o[1],1),S),o):void 0}},9504:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const m=d(2584);function _(n,u,o,l){const w=n-h(n,o),E=u-h(u,o),L=Math.abs(w-E)-(function(D,x,P){let H=0;const $=D-h(D,P),W=x-h(x,P);for(let I=0;I<Math.abs($-W);I++){const X=y(D,x)==="A"?-1:1,q=P.buffer.lines.get($+X*I);q!=null&&q.isWrapped&&H++}return H})(n,u,o);return v(L,k(y(n,u),l))}function h(n,u){let o=0,l=u.buffer.lines.get(n),w=l==null?void 0:l.isWrapped;for(;w&&n>=0&&n<u.rows;)o++,l=u.buffer.lines.get(--n),w=l==null?void 0:l.isWrapped;return o}function y(n,u){return n>u?"A":"B"}function S(n,u,o,l,w,E){let L=n,D=u,x="";for(;L!==o||D!==l;)L+=w?1:-1,w&&L>E.cols-1?(x+=E.buffer.translateBufferLineToString(D,!1,n,L),L=0,n=0,D++):!w&&L<0&&(x+=E.buffer.translateBufferLineToString(D,!1,0,n+1),L=E.cols-1,n=L,D--);return x+E.buffer.translateBufferLineToString(D,!1,n,L)}function k(n,u){const o=u?"O":"[";return m.C0.ESC+o+n}function v(n,u){n=Math.floor(n);let o="";for(let l=0;l<n;l++)o+=u;return o}i.moveToCellSequence=function(n,u,o,l){const w=o.buffer.x,E=o.buffer.y;if(!o.buffer.hasScrollback)return(function(x,P,H,$,W,I){return _(P,$,W,I).length===0?"":v(S(x,P,x,P-h(P,W),!1,W).length,k("D",I))})(w,E,0,u,o,l)+_(E,u,o,l)+(function(x,P,H,$,W,I){let X;X=_(P,$,W,I).length>0?$-h($,W):P;const q=$,z=(function(re,Q,A,B,T,F){let ee;return ee=_(A,B,T,F).length>0?B-h(B,T):Q,re<A&&ee<=B||re>=A&&ee<B?"C":"D"})(x,P,H,$,W,I);return v(S(x,X,H,q,z==="C",W).length,k(z,I))})(w,E,n,u,o,l);let L;if(E===u)return L=w>n?"D":"C",v(Math.abs(w-n),k(L,l));L=E>u?"D":"C";const D=Math.abs(E-u);return v((function(x,P){return P.cols-x})(E>u?n:w,o)+(D-1)*o.cols+1+((E>u?w:n)-1),k(L,l))}},1296:function(R,i,d){var m=this&&this.__decorate||function(I,X,q,z){var re,Q=arguments.length,A=Q<3?X:z===null?z=Object.getOwnPropertyDescriptor(X,q):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(I,X,q,z);else for(var B=I.length-1;B>=0;B--)(re=I[B])&&(A=(Q<3?re(A):Q>3?re(X,q,A):re(X,q))||A);return Q>3&&A&&Object.defineProperty(X,q,A),A},_=this&&this.__param||function(I,X){return function(q,z){X(q,z,I)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const h=d(3787),y=d(2550),S=d(2223),k=d(6171),v=d(6052),n=d(4725),u=d(8055),o=d(8460),l=d(844),w=d(2585),E="xterm-dom-renderer-owner-",L="xterm-rows",D="xterm-fg-",x="xterm-bg-",P="xterm-focus",H="xterm-selection";let $=1,W=i.DomRenderer=class extends l.Disposable{constructor(I,X,q,z,re,Q,A,B,T,F,ee,ne,ce){super(),this._terminal=I,this._document=X,this._element=q,this._screenElement=z,this._viewportElement=re,this._helperContainer=Q,this._linkifier2=A,this._charSizeService=T,this._optionsService=F,this._bufferService=ee,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(H),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((de=>this._handleLinkHover(de)))),this.register(this._linkifier2.onHideLinkUnderline((de=>this._handleLinkLeave(de)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${L} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${L} .xterm-dim { color: ${u.color.multiplyOpacity(I.foreground,.5).css};}`,X+=`${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 q=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,re=`blink_block_${this._terminalClass}`;X+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${z} { 50% { box-shadow: none; }}`,X+=`@keyframes ${re} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,X+=`${this._terminalSelector} .${L}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${L}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${L}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[Q,A]of I.ansi.entries())X+=`${this._terminalSelector} .${D}${Q} { color: ${A.css}; }${this._terminalSelector} .${D}${Q}.xterm-dim { color: ${u.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${x}${Q} { background-color: ${A.css}; }`;X+=`${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR} { color: ${u.color.opaque(I.background).css}; }${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${u.color.multiplyOpacity(u.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${x}${S.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,X){for(let q=this._rowElements.length;q<=X;q++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,X){this._refreshRowElements(I,X),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(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,X,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,X,q),this.renderRows(0,this._bufferService.rows-1),!I||!X)return;this._selectionRenderModel.update(this._terminal,I,X,q);const z=this._selectionRenderModel.viewportStartRow,re=this._selectionRenderModel.viewportEndRow,Q=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(Q>=this._bufferService.rows||A<0)return;const B=this._document.createDocumentFragment();if(q){const T=I[0]>X[0];B.appendChild(this._createSelectionElement(Q,T?X[0]:I[0],T?I[0]:X[0],A-Q+1))}else{const T=z===Q?I[0]:0,F=Q===re?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(Q,T,F));const ee=A-Q-1;if(B.appendChild(this._createSelectionElement(Q+1,0,this._bufferService.cols,ee)),Q!==A){const ne=re===A?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(A,0,ne))}}this._selectionContainer.appendChild(B)}_createSelectionElement(I,X,q,z=1){const re=this._document.createElement("div"),Q=X*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(q-X);return Q+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-Q),re.style.height=z*this.dimensions.css.cell.height+"px",re.style.top=I*this.dimensions.css.cell.height+"px",re.style.left=`${Q}px`,re.style.width=`${A}px`,re}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,X){const q=this._bufferService.buffer,z=q.ybase+q.y,re=Math.min(q.x,this._bufferService.cols-1),Q=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=I;T<=X;T++){const F=T+q.ydisp,ee=this._rowElements[T],ne=q.lines.get(F);if(!ee||!ne)break;ee.replaceChildren(...this._rowFactory.createRow(ne,F,F===z,A,B,re,Q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,X,q,z,re,Q){q<0&&(I=0),z<0&&(X=0);const A=this._bufferService.rows-1;q=Math.max(Math.min(q,A),0),z=Math.max(Math.min(z,A),0),re=Math.min(re,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,F=Math.min(B.x,re-1),ee=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=q;de<=z;++de){const G=de+B.ydisp,N=this._rowElements[de],ie=B.lines.get(G);if(!N||!ie)break;N.replaceChildren(...this._rowFactory.createRow(ie,G,G===T,ne,ce,F,ee,this.dimensions.css.cell.width,this._widthCache,Q?de===q?I:0:-1,Q?(de===z?X:re)-1:-1))}}};i.DomRenderer=W=m([_(7,w.IInstantiationService),_(8,n.ICharSizeService),_(9,w.IOptionsService),_(10,w.IBufferService),_(11,n.ICoreBrowserService),_(12,n.IThemeService)],W)},3787:function(R,i,d){var m=this&&this.__decorate||function(L,D,x,P){var H,$=arguments.length,W=$<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,x):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(L,D,x,P);else for(var I=L.length-1;I>=0;I--)(H=L[I])&&(W=($<3?H(W):$>3?H(D,x,W):H(D,x))||W);return $>3&&W&&Object.defineProperty(D,x,W),W},_=this&&this.__param||function(L,D){return function(x,P){D(x,P,L)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const h=d(2223),y=d(643),S=d(511),k=d(2585),v=d(8055),n=d(4725),u=d(4269),o=d(6171),l=d(3734);let w=i.DomRendererRowFactory=class{constructor(L,D,x,P,H,$,W){this._document=L,this._characterJoinerService=D,this._optionsService=x,this._coreBrowserService=P,this._coreService=H,this._decorationService=$,this._themeService=W,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,D,x){this._selectionStart=L,this._selectionEnd=D,this._columnSelectMode=x}createRow(L,D,x,P,H,$,W,I,X,q,z){const re=[],Q=this._characterJoinerService.getJoinedCharacters(D),A=this._themeService.colors;let B,T=L.getNoBgTrimmedLength();x&&T<$+1&&(T=$+1);let F=0,ee="",ne=0,ce=0,de=0,G=!1,N=0,ie=!1,se=0;const fe=[],he=q!==-1&&z!==-1;for(let ke=0;ke<T;ke++){L.loadCell(ke,this._workCell);let Te=this._workCell.getWidth();if(Te===0)continue;let Me=!1,Qe=ke,be=this._workCell;if(Q.length>0&&ke===Q[0][0]){Me=!0;const Oe=Q.shift();be=new u.JoinedCellData(this._workCell,L.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),Qe=Oe[1]-1,Te=be.getWidth()}const ar=this._isCellInSelection(ke,D),Mr=x&&ke===$,Qt=he&&ke>=q&&ke<=z;let Ut=!1;this._decorationService.forEachDecorationAtCell(ke,D,void 0,(Oe=>{Ut=!0}));let lr=be.getChars()||y.WHITESPACE_CELL_CHAR;if(lr===" "&&(be.isUnderline()||be.isOverline())&&(lr=" "),se=Te*I-X.get(lr,be.isBold(),be.isItalic()),B){if(F&&(ar&&ie||!ar&&!ie&&be.bg===ne)&&(ar&&ie&&A.selectionForeground||be.fg===ce)&&be.extended.ext===de&&Qt===G&&se===N&&!Mr&&!Me&&!Ut){be.isInvisible()?ee+=y.WHITESPACE_CELL_CHAR:ee+=lr,F++;continue}F&&(B.textContent=ee),B=this._document.createElement("span"),F=0,ee=""}else B=this._document.createElement("span");if(ne=be.bg,ce=be.fg,de=be.extended.ext,G=Qt,N=se,ie=ar,Me&&$>=ke&&$<=Qe&&($=ke),!this._coreService.isCursorHidden&&Mr&&this._coreService.isCursorInitialized){if(fe.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&fe.push("xterm-cursor-blink"),fe.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":fe.push("xterm-cursor-outline");break;case"block":fe.push("xterm-cursor-block");break;case"bar":fe.push("xterm-cursor-bar");break;case"underline":fe.push("xterm-cursor-underline")}}if(be.isBold()&&fe.push("xterm-bold"),be.isItalic()&&fe.push("xterm-italic"),be.isDim()&&fe.push("xterm-dim"),ee=be.isInvisible()?y.WHITESPACE_CELL_CHAR:be.getChars()||y.WHITESPACE_CELL_CHAR,be.isUnderline()&&(fe.push(`xterm-underline-${be.extended.underlineStyle}`),ee===" "&&(ee=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Oe=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Oe<8&&(Oe+=8),B.style.textDecorationColor=A.ansi[Oe].css}be.isOverline()&&(fe.push("xterm-overline"),ee===" "&&(ee=" ")),be.isStrikethrough()&&fe.push("xterm-strikethrough"),Qt&&(B.style.textDecoration="underline");let nt=be.getFgColor(),cr=be.getFgColorMode(),gt=be.getBgColor(),ur=be.getBgColorMode();const Or=!!be.isInverse();if(Or){const Oe=nt;nt=gt,gt=Oe;const wi=cr;cr=ur,ur=wi}let vt,Nr,ct,At=!1;switch(this._decorationService.forEachDecorationAtCell(ke,D,void 0,(Oe=>{Oe.options.layer!=="top"&&At||(Oe.backgroundColorRGB&&(ur=50331648,gt=Oe.backgroundColorRGB.rgba>>8&16777215,vt=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(cr=50331648,nt=Oe.foregroundColorRGB.rgba>>8&16777215,Nr=Oe.foregroundColorRGB),At=Oe.options.layer==="top")})),!At&&ar&&(vt=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,gt=vt.rgba>>8&16777215,ur=50331648,At=!0,A.selectionForeground&&(cr=50331648,nt=A.selectionForeground.rgba>>8&16777215,Nr=A.selectionForeground)),At&&fe.push("xterm-decoration-top"),ur){case 16777216:case 33554432:ct=A.ansi[gt],fe.push(`xterm-bg-${gt}`);break;case 50331648:ct=v.channels.toColor(gt>>16,gt>>8&255,255>),this._addStyle(B,`background-color:#${E((gt>>>0).toString(16),"0",6)}`);break;default:Or?(ct=A.foreground,fe.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):ct=A.background}switch(vt||be.isDim()&&(vt=v.color.multiplyOpacity(ct,.5)),cr){case 16777216:case 33554432:be.isBold()&&nt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(nt+=8),this._applyMinimumContrast(B,ct,A.ansi[nt],be,vt,void 0)||fe.push(`xterm-fg-${nt}`);break;case 50331648:const Oe=v.channels.toColor(nt>>16&255,nt>>8&255,255&nt);this._applyMinimumContrast(B,ct,Oe,be,vt,Nr)||this._addStyle(B,`color:#${E(nt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,ct,A.foreground,be,vt,Nr)||Or&&fe.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}fe.length&&(B.className=fe.join(" "),fe.length=0),Mr||Me||Ut?B.textContent=ee:F++,se!==this.defaultSpacing&&(B.style.letterSpacing=`${se}px`),re.push(B),ke=Qe}return B&&F&&(B.textContent=ee),re}_applyMinimumContrast(L,D,x,P,H,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const W=this._getContrastCache(P);let I;if(H||$||(I=W.getColor(D.rgba,x.rgba)),I===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);I=v.color.ensureContrastRatio(H||D,$||x,X),W.setColor((H||D).rgba,($||x).rgba,I??null)}return!!I&&(this._addStyle(L,`color:${I.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,D){L.setAttribute("style",`${L.getAttribute("style")||""}${D};`)}_isCellInSelection(L,D){const x=this._selectionStart,P=this._selectionEnd;return!(!x||!P)&&(this._columnSelectMode?x[0]<=P[0]?L>=x[0]&&D>=x[1]&&L<P[0]&&D<=P[1]:L<x[0]&&D>=x[1]&&L>=P[0]&&D<=P[1]:D>x[1]&&D<P[1]||x[1]===P[1]&&D===x[1]&&L>=x[0]&&L<P[0]||x[1]<P[1]&&D===P[1]&&L<P[0]||x[1]<P[1]&&D===x[1]&&L>=x[0])}};function E(L,D,x){for(;L.length<x;)L=D+L;return L}i.DomRendererRowFactory=w=m([_(1,n.ICharacterJoinerService),_(2,k.IOptionsService),_(3,n.ICoreBrowserService),_(4,k.ICoreService),_(5,k.IDecorationService),_(6,n.IThemeService)],w)},2550:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(d,m){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=d.createElement("span");_.classList.add("xterm-char-measure-element");const h=d.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const y=d.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const S=d.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[_,h,y,S],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(y),this._container.appendChild(S),m.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(d,m,_,h){d===this._font&&m===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=d,this._fontSize=m,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(d,m,_){let h=0;if(!m&&!_&&d.length===1&&(h=d.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const k=this._measure(d,0);return k>0&&(this._flat[h]=k),k}let y=d;m&&(y+="B"),_&&(y+="I");let S=this._holey.get(y);if(S===void 0){let k=0;m&&(k|=1),_&&(k|=2),S=this._measure(d,k),S>0&&this._holey.set(y,S)}return S}_measure(d,m){const _=this._measureElements[m];return _.textContent=d.repeat(32),_.offsetWidth/32}}},2223:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const m=d(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},6171:(R,i)=>{function d(_){return 57508<=_&&_<=57558}function m(_){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=d,i.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},i.isEmoji=m,i.allowRescaling=function(_,h,y,S){return h===1&&y>Math.ceil(1.5*S)&&_!==void 0&&_>255&&!m(_)&&!d(_)&&!(function(k){return 57344<=k&&k<=63743})(_)},i.treatGlyphAsBackgroundColor=function(_){return d(_)||(function(h){return 9472<=h&&h<=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(_,h,y=0){return(_-(2*Math.round(h)-y))%(2*Math.round(h))}},6052:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,y,S=!1){if(this.selectionStart=h,this.selectionEnd=y,!h||!y||h[0]===y[0]&&h[1]===y[1])return void this.clear();const k=_.buffers.active.ydisp,v=h[1]-k,n=y[1]-k,u=Math.max(v,0),o=Math.min(n,_.rows-1);u>=_.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=v,this.viewportEndRow=n,this.viewportCappedStartRow=u,this.viewportCappedEndRow=o,this.startCol=h[0],this.endCol=y[0])}isCellSelected(_,h,y){return!!this.hasSelection&&(y-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&y>=this.viewportCappedStartRow&&h<this.endCol&&y<=this.viewportCappedEndRow:h<this.startCol&&y>=this.viewportCappedStartRow&&h>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol)}}i.createSelectionRenderModel=function(){return new d}},456:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,m=this.selectionEnd;return!(!d||!m)&&(d[1]>m[1]||d[1]===m[1]&&d[0]>m[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,E){var L,D=arguments.length,x=D<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,E);else for(var P=o.length-1;P>=0;P--)(L=o[P])&&(x=(D<3?L(x):D>3?L(l,w,x):L(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,E){l(w,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const h=d(2585),y=d(8460),S=d(844);let k=i.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,l,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new u(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};i.CharSizeService=k=m([_(2,h.IOptionsService)],k);class v extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,w){l!==void 0&&l>0&&w!==void 0&&w>0&&(this._result.width=l,this._result.height=w)}}class n extends v{constructor(l,w,E){super(),this._document=l,this._parentElement=w,this._optionsService=E,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 v{constructor(l){super(),this._optionsService=l,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 l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(R,i,d){var m=this&&this.__decorate||function(u,o,l,w){var E,L=arguments.length,D=L<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(u,o,l,w);else for(var x=u.length-1;x>=0;x--)(E=u[x])&&(D=(L<3?E(D):L>3?E(o,l,D):E(o,l))||D);return L>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(u,o){return function(l,w){o(l,w,u)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const h=d(3734),y=d(643),S=d(511),k=d(2585);class v extends h.AttributeData{constructor(o,l,w){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=l,this._width=w}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()]}}i.JoinedCellData=v;let n=i.CharacterJoinerService=class Nd{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(o){const l={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(l),l.id}deregister(o){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===o)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(o);if(!l||l.length===0)return[];const w=[],E=l.translateToString(!0);let L=0,D=0,x=0,P=l.getFg(0),H=l.getBg(0);for(let $=0;$<l.getTrimmedLength();$++)if(l.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==H){if($-L>1){const W=this._getJoinedRanges(E,x,D,l,L);for(let I=0;I<W.length;I++)w.push(W[I])}L=$,x=D,P=this._workCell.fg,H=this._workCell.bg}D+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const $=this._getJoinedRanges(E,x,D,l,L);for(let W=0;W<$.length;W++)w.push($[W])}return w}_getJoinedRanges(o,l,w,E,L){const D=o.substring(l,w);let x=[];try{x=this._characterJoiners[0].handler(D)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const H=this._characterJoiners[P].handler(D);for(let $=0;$<H.length;$++)Nd._mergeRanges(x,H[$])}catch(H){console.error(H)}return this._stringRangesToCellRanges(x,E,L),x}_stringRangesToCellRanges(o,l,w){let E=0,L=!1,D=0,x=o[E];if(x){for(let P=w;P<this._bufferService.cols;P++){const H=l.getWidth(P),$=l.getString(P).length||y.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!L&&x[0]<=D&&(x[0]=P,L=!0),x[1]<=D){if(x[1]=P,x=o[++E],!x)break;x[0]<=D?(x[0]=P,L=!0):L=!1}D+=$}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(o,l){let w=!1;for(let E=0;E<o.length;E++){const L=o[E];if(w){if(l[1]<=L[0])return o[E-1][1]=l[1],o;if(l[1]<=L[1])return o[E-1][1]=Math.max(l[1],L[1]),o.splice(E,1),o;o.splice(E,1),E--}else{if(l[1]<=L[0])return o.splice(E,0,l),o;if(l[1]<=L[1])return L[0]=Math.min(l[0],L[0]),o;l[0]<L[1]&&(L[0]=Math.min(l[0],L[0]),w=!0)}}return w?o[o.length-1][1]=l[1]:o.push(l),o}};i.CharacterJoinerService=n=m([_(0,k.IBufferService)],n)},5114:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const m=d(844),_=d(8460),h=d(3656);class y extends m.Disposable{constructor(v,n,u){super(),this._textarea=v,this._window=n,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((o=>this._screenDprMonitor.setWindow(o)))),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(v){this._window!==v&&(this._window=v,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=y;class S extends m.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new m.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,m.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const m=d(844);class _ extends m.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,m.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const S=this.linkProviders.indexOf(y);S!==-1&&this.linkProviders.splice(S,1)}}}}i.LinkProviderService=_},8934:function(R,i,d){var m=this&&this.__decorate||function(k,v,n,u){var o,l=arguments.length,w=l<3?v:u===null?u=Object.getOwnPropertyDescriptor(v,n):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(k,v,n,u);else for(var E=k.length-1;E>=0;E--)(o=k[E])&&(w=(l<3?o(w):l>3?o(v,n,w):o(v,n))||w);return l>3&&w&&Object.defineProperty(v,n,w),w},_=this&&this.__param||function(k,v){return function(n,u){v(n,u,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const h=d(4725),y=d(9806);let S=i.MouseService=class{constructor(k,v){this._renderService=k,this._charSizeService=v}getCoords(k,v,n,u,o){return(0,y.getCoords)(window,k,v,n,u,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(k,v){const n=(0,y.getCoordsRelativeToElement)(window,k,v);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};i.MouseService=S=m([_(0,h.IRenderService),_(1,h.ICharSizeService)],S)},3230:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,E){var L,D=arguments.length,x=D<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,E);else for(var P=o.length-1;P>=0;P--)(L=o[P])&&(x=(D<3?L(x):D>3?L(l,w,x):L(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,E){l(w,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const h=d(6193),y=d(4725),S=d(8460),k=d(844),v=d(7226),n=d(2585);let u=i.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,l,w,E,L,D,x,P){super(),this._rowCount=o,this._charSizeService=E,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 h.RenderDebouncer(((H,$)=>this._renderRows(H,$)),x),this.register(this._renderDebouncer),this.register(x.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var H;return(H=this._renderer.value)==null?void 0:H.clear()}))),this.register(w.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(P.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(x.window,l),this.register(x.onWindowChange((H=>this._registerIntersectionObserver(H,l))))}_registerIntersectionObserver(o,l){if("IntersectionObserver"in o){const w=new o.IntersectionObserver((E=>this._handleIntersectionChange(E[E.length-1])),{threshold:0});w.observe(l),this._observerDisposable.value=(0,k.toDisposable)((()=>w.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,l,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,l,this._rowCount))}_renderRows(o,l){this._renderer.value&&(o=Math.min(o,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(o,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:l}),this._onRender.fire({start:o,end:l}),this._isNextRenderRedrawOnly=!0)}resize(o,l){this._rowCount=l,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,l;this._renderer.value&&((l=(o=this._renderer.value).clearTextureAtlas)==null||l.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(o,l)})):this._renderer.value.handleResize(o,l),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,l,w){var E;this._selectionState.start=o,this._selectionState.end=l,this._selectionState.columnSelectMode=w,(E=this._renderer.value)==null||E.handleSelectionChanged(o,l,w)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};i.RenderService=u=m([_(2,n.IOptionsService),_(3,y.ICharSizeService),_(4,n.IDecorationService),_(5,n.IBufferService),_(6,y.ICoreBrowserService),_(7,y.IThemeService)],u)},9312:function(R,i,d){var m=this&&this.__decorate||function(x,P,H,$){var W,I=arguments.length,X=I<3?P:$===null?$=Object.getOwnPropertyDescriptor(P,H):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(x,P,H,$);else for(var q=x.length-1;q>=0;q--)(W=x[q])&&(X=(I<3?W(X):I>3?W(P,H,X):W(P,H))||X);return I>3&&X&&Object.defineProperty(P,H,X),X},_=this&&this.__param||function(x,P){return function(H,$){P(H,$,x)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const h=d(9806),y=d(9504),S=d(456),k=d(4725),v=d(8460),n=d(844),u=d(6114),o=d(4841),l=d(511),w=d(2585),E=" ",L=new RegExp(E,"g");let D=i.SelectionService=class extends n.Disposable{constructor(x,P,H,$,W,I,X,q,z){super(),this._element=x,this._screenElement=P,this._linkifier=H,this._bufferService=$,this._coreService=W,this._mouseService=I,this._optionsService=X,this._renderService=q,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=re=>this._handleMouseMove(re),this._mouseUpListener=re=>this._handleMouseUp(re),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((re=>this._handleTrim(re))),this.register(this._bufferService.buffers.onBufferActivate((re=>this._handleBufferActivate(re)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!x||!P||x[0]===P[0]&&x[1]===P[1])}get selectionText(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!x||!P)return"";const H=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(x[0]===P[0])return"";const W=x[0]<P[0]?x[0]:P[0],I=x[0]<P[0]?P[0]:x[0];for(let X=x[1];X<=P[1];X++){const q=H.translateBufferLineToString(X,!0,W,I);$.push(q)}}else{const W=x[1]===P[1]?P[0]:void 0;$.push(H.translateBufferLineToString(x[1],!0,x[0],W));for(let I=x[1]+1;I<=P[1]-1;I++){const X=H.lines.get(I),q=H.translateBufferLineToString(I,!0);X!=null&&X.isWrapped?$[$.length-1]+=q:$.push(q)}if(x[1]!==P[1]){const I=H.lines.get(P[1]),X=H.translateBufferLineToString(P[1],!0,0,P[0]);I&&I.isWrapped?$[$.length-1]+=X:$.push(X)}}return $.map((W=>W.replace(L," "))).join(u.isWindows?`\r
|
|
46
|
+
WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=S=m([_(0,y.IBufferService),_(1,y.IOptionsService),_(2,y.IOscLinkService)],S)},6193:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(d,m){this._renderCallback=d,this._coreBrowserService=m,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(d){return this._refreshCallbacks.push(d),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(d,m,_){this._rowCount=_,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const d of this._refreshCallbacks)d(0);this._refreshCallbacks=[]}}},3236:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const m=d(3614),_=d(3656),h=d(3551),y=d(9042),S=d(3730),k=d(1680),v=d(3107),n=d(5744),c=d(2950),o=d(1296),l=d(428),w=d(4269),L=d(5114),E=d(8934),D=d(3230),x=d(9312),P=d(4725),H=d(6731),$=d(8055),W=d(8969),I=d(8460),X=d(844),q=d(6114),z=d(8437),re=d(2584),Q=d(7399),A=d(5941),B=d(9074),T=d(2585),F=d(5435),ee=d(4567),ne=d(779);class ce extends W.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(G={}){super(G),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(P.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(S.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((N,ie)=>this.refresh(N,ie)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((N=>this._reportWindowsOptions(N)))),this.register(this._inputHandler.onColor((N=>this._handleColorEvent(N)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((N=>this._afterResize(N.cols,N.rows)))),this.register((0,X.toDisposable)((()=>{var N,ie;this._customKeyEventHandler=void 0,(ie=(N=this.element)==null?void 0:N.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const N of G){let ie,se="";switch(N.index){case 256:ie="foreground",se="10";break;case 257:ie="background",se="11";break;case 258:ie="cursor",se="12";break;default:ie="ansi",se="4;"+N.index}switch(N.type){case 0:const fe=$.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[N.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${re.C0.ESC}]${se};${(0,A.toRgbString)(fe)}${re.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((he=>he.ansi[N.index]=$.channels.toColor(...N.color)));else{const he=ie;this._themeService.modifyColors((ke=>ke[he]=$.channels.toColor(...N.color)))}break;case 2:this._themeService.restoreColor(N.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(ee.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(re.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 G=this.buffer.ybase+this.buffer.y,N=this.buffer.lines.get(G);if(!N)return;const ie=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,fe=N.getWidth(ie),he=this._renderService.dimensions.css.cell.width*fe,ke=this.buffer.y*this._renderService.dimensions.css.cell.height,Te=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Te+"px",this.textarea.style.top=ke+"px",this.textarea.style.width=he+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(N=>{this.hasSelection()&&(0,m.copyHandler)(N,this._selectionService)})));const G=N=>(0,m.handlePasteEvent)(N,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,_.addDisposableDomListener)(this.element,"paste",G)),q.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(N=>{N.button===2&&(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(N=>{(0,m.rightClickHandler)(N,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(N=>{N.button===1&&(0,m.moveTextAreaUnderMouseCursor)(N,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var ie;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.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"),G.appendChild(this.element);const N=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),N.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",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),N.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),q.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(L.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(P.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(P.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(H.ThemeService),this._instantiationService.setService(P.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(P.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(P.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(P.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(N);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(x.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(P.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(ee.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,N=this.element;function ie(he){const ke=G._mouseService.getMouseReportCoords(he,G.screenElement);if(!ke)return!1;let Te,Me;switch(he.overrideType||he.type){case"mousemove":Me=32,he.buttons===void 0?(Te=3,he.button!==void 0&&(Te=he.button<3?he.button:3)):Te=1&he.buttons?0:4&he.buttons?1:2&he.buttons?2:3;break;case"mouseup":Me=0,Te=he.button<3?he.button:3;break;case"mousedown":Me=1,Te=he.button<3?he.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler(he)===!1||G.viewport.getLinesScrolled(he)===0)return!1;Me=he.deltaY<0?0:1,Te=4;break;default:return!1}return!(Me===void 0||Te===void 0||Te>4)&&G.coreMouseService.triggerMouseEvent({col:ke.col,row:ke.row,x:ke.x,y:ke.y,button:Te,action:Me,ctrl:he.ctrlKey,alt:he.altKey,shift:he.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},fe={mouseup:he=>(ie(he),he.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(he)),wheel:he=>(ie(he),this.cancel(he,!0)),mousedrag:he=>{he.buttons&&ie(he)},mousemove:he=>{he.buttons||ie(he)}};this.register(this.coreMouseService.onProtocolChange((he=>{he?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(he)),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&he?se.mousemove||(N.addEventListener("mousemove",fe.mousemove),se.mousemove=fe.mousemove):(N.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&he?se.wheel||(N.addEventListener("wheel",fe.wheel,{passive:!1}),se.wheel=fe.wheel):(N.removeEventListener("wheel",se.wheel),se.wheel=null),2&he?se.mouseup||(se.mouseup=fe.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&he?se.mousedrag||(se.mousedrag=fe.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(N,"mousedown",(he=>{if(he.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(he))return ie(he),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(he)}))),this.register((0,_.addDisposableDomListener)(N,"wheel",(he=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(he)===!1)return!1;if(!this.buffer.hasScrollback){const ke=this.viewport.getLinesScrolled(he);if(ke===0)return;const Te=re.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(he.deltaY<0?"A":"B");let Me="";for(let Qe=0;Qe<Math.abs(ke);Qe++)Me+=Te;return this.coreService.triggerDataEvent(Me,!0),this.cancel(he,!0)}return this.viewport.handleWheel(he)?this.cancel(he):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(N,"touchstart",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(he),this.cancel(he)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(N,"touchmove",(he=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(he)?void 0:this.cancel(he)}),{passive:!1}))}refresh(G,N){var ie;(ie=this._renderService)==null||ie.refreshRows(G,N)}updateCursorStyle(G){var N;(N=this._selectionService)!=null&&N.shouldColumnSelect(G)?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(G,N,ie=0){var se;ie===1?(super.scrollLines(G,N,ie),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines(G)}paste(G){(0,m.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const N=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),N}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,N,ie){this._selectionService.setSelection(G,N,ie)}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 G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,N){var ie;(ie=this._selectionService)==null||ie.selectLines(G,N)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const N=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!N&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;N||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,Q.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),ie.type===3||ie.type===2){const se=this.rows-1;return this.scrollLines(ie.type===2?-se:se),this.cancel(G,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(ie.cancel&&this.cancel(G,!0),!ie.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==re.C0.ETX&&ie.key!==re.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,N){const ie=G.isMac&&!this.options.macOptionIsMeta&&N.altKey&&!N.ctrlKey&&!N.metaKey||G.isWindows&&N.altKey&&N.ctrlKey&&!N.metaKey||G.isWindows&&N.getModifierState("AltGraph");return N.type==="keypress"?ie:ie&&(!N.keyCode||N.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(N){return N.keyCode===16||N.keyCode===17||N.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let N;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)N=G.charCode;else if(G.which===null||G.which===void 0)N=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;N=G.which}return!(!N||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(N=String.fromCharCode(N),this._onKey.fire({key:N,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(N,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const N=G.data;return this.coreService.triggerDataEvent(N,!0),this.cancel(G),!0}return!1}resize(G,N){G!==this.cols||N!==this.rows?super.resize(G,N):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,N){var ie,se;(ie=this._charSizeService)==null||ie.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var G;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 N=1;N<this.rows;N++)this.buffer.lines.push(this.buffer.getBlankLine(z.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var N,ie;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(N=this._selectionService)==null||N.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(re.C0.ESC+"[I"):this.coreService.triggerDataEvent(re.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const N=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[4;${ie};${N}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),fe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${re.C0.ESC}[6;${fe};${se}t`)}}cancel(G,N){if(this.options.cancelEvents||N)return G.preventDefault(),G.stopPropagation(),!1}}i.Terminal=ce},9924:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(d,m=1e3){this._renderCallback=d,this._debounceThresholdMS=m,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(d,m,_){this._rowCount=_,d=d!==void 0?d:0,m=m!==void 0?m:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,m):m;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=h-this._lastRefreshMs,S=this._debounceThresholdMS-y;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 d=Math.max(this._rowStart,0),m=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(d,m)}}},1680:function(R,i,d){var m=this&&this.__decorate||function(c,o,l,w){var L,E=arguments.length,D=E<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,o,l,w);else for(var x=c.length-1;x>=0;x--)(L=c[x])&&(D=(E<3?L(D):E>3?L(o,l,D):L(o,l))||D);return E>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(c,o){return function(l,w){o(l,w,c)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const h=d(3656),y=d(4725),S=d(8460),k=d(844),v=d(2585);let n=i.Viewport=class extends k.Disposable{constructor(c,o,l,w,L,E,D,x){super(),this._viewportElement=c,this._scrollArea=o,this._bufferService=l,this._optionsService=w,this._charSizeService=L,this._renderService=E,this._coreBrowserService=D,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,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((P=>this._activeBuffer=P.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((P=>this._renderDimensions=P))),this._handleThemeChange(x.colors),this.register(x.onChangeColors((P=>this._handleThemeChange(P)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)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 o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,o){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&l<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const o=this._getPixelsScrolled(c);return o!==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+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(c,o){var x;let l,w="";const L=[],E=o??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let P=c;P<E;P++){const H=D.get(P);if(!H)continue;const $=(x=D.get(P+1))==null?void 0:x.isWrapped;if(w+=H.translateToString(!$),!$||P===D.length-1){const W=document.createElement("div");W.textContent=w,L.push(W),w.length>0&&(l=W),w=""}}return{bufferElements:L,cursorElement:l}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let o=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(c,o){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&o.altKey||l==="ctrl"&&o.ctrlKey||l==="shift"&&o.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const o=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(c,o))}};i.Viewport=n=m([_(2,v.IBufferService),_(3,v.IOptionsService),_(4,y.ICharSizeService),_(5,y.IRenderService),_(6,y.ICoreBrowserService),_(7,y.IThemeService)],n)},3107:function(R,i,d){var m=this&&this.__decorate||function(v,n,c,o){var l,w=arguments.length,L=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,n,c,o);else for(var E=v.length-1;E>=0;E--)(l=v[E])&&(L=(w<3?l(L):w>3?l(n,c,L):l(n,c))||L);return w>3&&L&&Object.defineProperty(n,c,L),L},_=this&&this.__param||function(v,n){return function(c,o){n(c,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const h=d(4725),y=d(844),S=d(2585);let k=i.BufferDecorationRenderer=class extends y.Disposable{constructor(v,n,c,o,l){super(),this._screenElement=v,this._bufferService=n,this._coreBrowserService=c,this._decorationService=o,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((w=>this._removeDecoration(w)))),this.register((0,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=v==null?void 0:v.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=v.options.x??0;return c&&c>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(v,n),n}_refreshStyle(v){const n=v.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let c=this._decorationElements.get(v);c||(c=this._createElement(v),v.element=c,this._decorationElements.set(v,c),this._container.appendChild(c),v.onDispose((()=>{this._decorationElements.delete(v),c.remove()}))),c.style.top=n*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(c)}}_refreshXPosition(v,n=v.element){if(!n)return;const c=v.options.x??0;(v.options.anchor||"left")==="right"?n.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var n;(n=this._decorationElements.get(v))==null||n.remove(),this._decorationElements.delete(v),v.dispose()}};i.BufferDecorationRenderer=k=m([_(1,S.IBufferService),_(2,h.ICoreBrowserService),_(3,S.IDecorationService),_(4,h.IRenderService)],k)},5871:(R,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(d){if(d.options.overviewRulerOptions){for(const m of this._zones)if(m.color===d.options.overviewRulerOptions.color&&m.position===d.options.overviewRulerOptions.position){if(this._lineIntersectsZone(m,d.marker.line))return;if(this._lineAdjacentToZone(m,d.marker.line,d.options.overviewRulerOptions.position))return void this._addLineToZone(m,d.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=d.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=d.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=d.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=d.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:d.options.overviewRulerOptions.color,position:d.options.overviewRulerOptions.position,startBufferLine:d.marker.line,endBufferLine:d.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(d){this._linePadding=d}_lineIntersectsZone(d,m){return m>=d.startBufferLine&&m<=d.endBufferLine}_lineAdjacentToZone(d,m,_){return m>=d.startBufferLine-this._linePadding[_||"full"]&&m<=d.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(d,m){d.startBufferLine=Math.min(d.startBufferLine,m),d.endBufferLine=Math.max(d.endBufferLine,m)}}},5744:function(R,i,d){var m=this&&this.__decorate||function(l,w,L,E){var D,x=arguments.length,P=x<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,L):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,w,L,E);else for(var H=l.length-1;H>=0;H--)(D=l[H])&&(P=(x<3?D(P):x>3?D(w,L,P):D(w,L))||P);return x>3&&P&&Object.defineProperty(w,L,P),P},_=this&&this.__param||function(l,w){return function(L,E){w(L,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const h=d(5871),y=d(4725),S=d(844),k=d(2585),v={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let o=i.OverviewRulerRenderer=class extends S.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,w,L,E,D,x,P){var $;super(),this._viewportElement=l,this._screenElement=w,this._bufferService=L,this._decorationService=E,this._renderService=D,this._optionsService=x,this._coreBrowserService=P,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),($=this._viewportElement.parentElement)==null||$.insertBefore(this._canvas,this._viewportElement);const H=this._canvas.getContext("2d");if(!H)throw new Error("Ctx cannot be null");this._ctx=H,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,S.toDisposable)((()=>{var W;(W=this._canvas)==null||W.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const l=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=l,n.center=w,n.right=l,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=n.left,c.right=n.left+n.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);v.left=w,v.center=w,v.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const w of l)w.position!=="full"&&this._renderColorZone(w);for(const w of l)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(c[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-v[l.position||"full"]/2),n[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[l.position||"full"]))}_queueRefresh(l,w){this._shouldUpdateDimensions=l||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=o=m([_(2,k.IBufferService),_(3,k.IDecorationService),_(4,y.IRenderService),_(5,k.IOptionsService),_(6,y.ICoreBrowserService)],o)},2950:function(R,i,d){var m=this&&this.__decorate||function(v,n,c,o){var l,w=arguments.length,L=w<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,c):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(v,n,c,o);else for(var E=v.length-1;E>=0;E--)(l=v[E])&&(L=(w<3?l(L):w>3?l(n,c,L):l(n,c))||L);return w>3&&L&&Object.defineProperty(n,c,L),L},_=this&&this.__param||function(v,n){return function(c,o){n(c,o,v)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const h=d(4725),y=d(2585),S=d(2584);let k=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,n,c,o,l,w){this._textarea=v,this._compositionView=n,this._bufferService=c,this._optionsService=o,this._coreService=l,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,c=n.replace(v,"");this._dataAlreadySent=c,n.length>v.length?this._coreService.triggerDataEvent(c,!0):n.length<v.length?this._coreService.triggerDataEvent(`${S.C0.DEL}`,!0):n.length===v.length&&n!==v&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"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=l+"px",this._textarea.style.top=o+"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"}v||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};i.CompositionHelper=k=m([_(2,y.IBufferService),_(3,y.IOptionsService),_(4,y.ICoreService),_(5,h.IRenderService)],k)},9806:(R,i)=>{function d(m,_,h){const y=h.getBoundingClientRect(),S=m.getComputedStyle(h),k=parseInt(S.getPropertyValue("padding-left")),v=parseInt(S.getPropertyValue("padding-top"));return[_.clientX-y.left-k,_.clientY-y.top-v]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=d,i.getCoords=function(m,_,h,y,S,k,v,n,c){if(!k)return;const o=d(m,_,h);return o?(o[0]=Math.ceil((o[0]+(c?v/2:0))/v),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),y+(c?1:0)),o[1]=Math.min(Math.max(o[1],1),S),o):void 0}},9504:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const m=d(2584);function _(n,c,o,l){const w=n-h(n,o),L=c-h(c,o),E=Math.abs(w-L)-(function(D,x,P){let H=0;const $=D-h(D,P),W=x-h(x,P);for(let I=0;I<Math.abs($-W);I++){const X=y(D,x)==="A"?-1:1,q=P.buffer.lines.get($+X*I);q!=null&&q.isWrapped&&H++}return H})(n,c,o);return v(E,k(y(n,c),l))}function h(n,c){let o=0,l=c.buffer.lines.get(n),w=l==null?void 0:l.isWrapped;for(;w&&n>=0&&n<c.rows;)o++,l=c.buffer.lines.get(--n),w=l==null?void 0:l.isWrapped;return o}function y(n,c){return n>c?"A":"B"}function S(n,c,o,l,w,L){let E=n,D=c,x="";for(;E!==o||D!==l;)E+=w?1:-1,w&&E>L.cols-1?(x+=L.buffer.translateBufferLineToString(D,!1,n,E),E=0,n=0,D++):!w&&E<0&&(x+=L.buffer.translateBufferLineToString(D,!1,0,n+1),E=L.cols-1,n=E,D--);return x+L.buffer.translateBufferLineToString(D,!1,n,E)}function k(n,c){const o=c?"O":"[";return m.C0.ESC+o+n}function v(n,c){n=Math.floor(n);let o="";for(let l=0;l<n;l++)o+=c;return o}i.moveToCellSequence=function(n,c,o,l){const w=o.buffer.x,L=o.buffer.y;if(!o.buffer.hasScrollback)return(function(x,P,H,$,W,I){return _(P,$,W,I).length===0?"":v(S(x,P,x,P-h(P,W),!1,W).length,k("D",I))})(w,L,0,c,o,l)+_(L,c,o,l)+(function(x,P,H,$,W,I){let X;X=_(P,$,W,I).length>0?$-h($,W):P;const q=$,z=(function(re,Q,A,B,T,F){let ee;return ee=_(A,B,T,F).length>0?B-h(B,T):Q,re<A&&ee<=B||re>=A&&ee<B?"C":"D"})(x,P,H,$,W,I);return v(S(x,X,H,q,z==="C",W).length,k(z,I))})(w,L,n,c,o,l);let E;if(L===c)return E=w>n?"D":"C",v(Math.abs(w-n),k(E,l));E=L>c?"D":"C";const D=Math.abs(L-c);return v((function(x,P){return P.cols-x})(L>c?n:w,o)+(D-1)*o.cols+1+((L>c?w:n)-1),k(E,l))}},1296:function(R,i,d){var m=this&&this.__decorate||function(I,X,q,z){var re,Q=arguments.length,A=Q<3?X:z===null?z=Object.getOwnPropertyDescriptor(X,q):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(I,X,q,z);else for(var B=I.length-1;B>=0;B--)(re=I[B])&&(A=(Q<3?re(A):Q>3?re(X,q,A):re(X,q))||A);return Q>3&&A&&Object.defineProperty(X,q,A),A},_=this&&this.__param||function(I,X){return function(q,z){X(q,z,I)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const h=d(3787),y=d(2550),S=d(2223),k=d(6171),v=d(6052),n=d(4725),c=d(8055),o=d(8460),l=d(844),w=d(2585),L="xterm-dom-renderer-owner-",E="xterm-rows",D="xterm-fg-",x="xterm-bg-",P="xterm-focus",H="xterm-selection";let $=1,W=i.DomRenderer=class extends l.Disposable{constructor(I,X,q,z,re,Q,A,B,T,F,ee,ne,ce){super(),this._terminal=I,this._document=X,this._element=q,this._screenElement=z,this._viewportElement=re,this._helperContainer=Q,this._linkifier2=A,this._charSizeService=T,this._optionsService=F,this._bufferService=ee,this._coreBrowserService=ne,this._themeService=ce,this._terminalClass=$++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(H),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((de=>this._handleLinkHover(de)))),this.register(this._linkifier2.onHideLinkUnderline((de=>this._handleLinkLeave(de)))),this.register((0,l.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${E} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${E} .xterm-dim { color: ${c.color.multiplyOpacity(I.foreground,.5).css};}`,X+=`${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 q=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,re=`blink_block_${this._terminalClass}`;X+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${z} { 50% { box-shadow: none; }}`,X+=`@keyframes ${re} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,X+=`${this._terminalSelector} .${E}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${E}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${E}.${P} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${H} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${H} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${H} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[Q,A]of I.ansi.entries())X+=`${this._terminalSelector} .${D}${Q} { color: ${A.css}; }${this._terminalSelector} .${D}${Q}.xterm-dim { color: ${c.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${x}${Q} { background-color: ${A.css}; }`;X+=`${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(I.background).css}; }${this._terminalSelector} .${D}${S.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${x}${S.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,X){for(let q=this._rowElements.length;q<=X;q++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,X){this._refreshRowElements(I,X),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(P),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(P),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,X,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,X,q),this.renderRows(0,this._bufferService.rows-1),!I||!X)return;this._selectionRenderModel.update(this._terminal,I,X,q);const z=this._selectionRenderModel.viewportStartRow,re=this._selectionRenderModel.viewportEndRow,Q=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(Q>=this._bufferService.rows||A<0)return;const B=this._document.createDocumentFragment();if(q){const T=I[0]>X[0];B.appendChild(this._createSelectionElement(Q,T?X[0]:I[0],T?I[0]:X[0],A-Q+1))}else{const T=z===Q?I[0]:0,F=Q===re?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(Q,T,F));const ee=A-Q-1;if(B.appendChild(this._createSelectionElement(Q+1,0,this._bufferService.cols,ee)),Q!==A){const ne=re===A?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(A,0,ne))}}this._selectionContainer.appendChild(B)}_createSelectionElement(I,X,q,z=1){const re=this._document.createElement("div"),Q=X*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(q-X);return Q+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-Q),re.style.height=z*this.dimensions.css.cell.height+"px",re.style.top=I*this.dimensions.css.cell.height+"px",re.style.left=`${Q}px`,re.style.width=`${A}px`,re}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,X){const q=this._bufferService.buffer,z=q.ybase+q.y,re=Math.min(q.x,this._bufferService.cols-1),Q=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=I;T<=X;T++){const F=T+q.ydisp,ee=this._rowElements[T],ne=q.lines.get(F);if(!ee||!ne)break;ee.replaceChildren(...this._rowFactory.createRow(ne,F,F===z,A,B,re,Q,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,X,q,z,re,Q){q<0&&(I=0),z<0&&(X=0);const A=this._bufferService.rows-1;q=Math.max(Math.min(q,A),0),z=Math.max(Math.min(z,A),0),re=Math.min(re,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,F=Math.min(B.x,re-1),ee=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=q;de<=z;++de){const G=de+B.ydisp,N=this._rowElements[de],ie=B.lines.get(G);if(!N||!ie)break;N.replaceChildren(...this._rowFactory.createRow(ie,G,G===T,ne,ce,F,ee,this.dimensions.css.cell.width,this._widthCache,Q?de===q?I:0:-1,Q?(de===z?X:re)-1:-1))}}};i.DomRenderer=W=m([_(7,w.IInstantiationService),_(8,n.ICharSizeService),_(9,w.IOptionsService),_(10,w.IBufferService),_(11,n.ICoreBrowserService),_(12,n.IThemeService)],W)},3787:function(R,i,d){var m=this&&this.__decorate||function(E,D,x,P){var H,$=arguments.length,W=$<3?D:P===null?P=Object.getOwnPropertyDescriptor(D,x):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,D,x,P);else for(var I=E.length-1;I>=0;I--)(H=E[I])&&(W=($<3?H(W):$>3?H(D,x,W):H(D,x))||W);return $>3&&W&&Object.defineProperty(D,x,W),W},_=this&&this.__param||function(E,D){return function(x,P){D(x,P,E)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const h=d(2223),y=d(643),S=d(511),k=d(2585),v=d(8055),n=d(4725),c=d(4269),o=d(6171),l=d(3734);let w=i.DomRendererRowFactory=class{constructor(E,D,x,P,H,$,W){this._document=E,this._characterJoinerService=D,this._optionsService=x,this._coreBrowserService=P,this._coreService=H,this._decorationService=$,this._themeService=W,this._workCell=new S.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,D,x){this._selectionStart=E,this._selectionEnd=D,this._columnSelectMode=x}createRow(E,D,x,P,H,$,W,I,X,q,z){const re=[],Q=this._characterJoinerService.getJoinedCharacters(D),A=this._themeService.colors;let B,T=E.getNoBgTrimmedLength();x&&T<$+1&&(T=$+1);let F=0,ee="",ne=0,ce=0,de=0,G=!1,N=0,ie=!1,se=0;const fe=[],he=q!==-1&&z!==-1;for(let ke=0;ke<T;ke++){E.loadCell(ke,this._workCell);let Te=this._workCell.getWidth();if(Te===0)continue;let Me=!1,Qe=ke,be=this._workCell;if(Q.length>0&&ke===Q[0][0]){Me=!0;const Oe=Q.shift();be=new c.JoinedCellData(this._workCell,E.translateToString(!0,Oe[0],Oe[1]),Oe[1]-Oe[0]),Qe=Oe[1]-1,Te=be.getWidth()}const ar=this._isCellInSelection(ke,D),Mr=x&&ke===$,Qt=he&&ke>=q&&ke<=z;let Ut=!1;this._decorationService.forEachDecorationAtCell(ke,D,void 0,(Oe=>{Ut=!0}));let lr=be.getChars()||y.WHITESPACE_CELL_CHAR;if(lr===" "&&(be.isUnderline()||be.isOverline())&&(lr=" "),se=Te*I-X.get(lr,be.isBold(),be.isItalic()),B){if(F&&(ar&&ie||!ar&&!ie&&be.bg===ne)&&(ar&&ie&&A.selectionForeground||be.fg===ce)&&be.extended.ext===de&&Qt===G&&se===N&&!Mr&&!Me&&!Ut){be.isInvisible()?ee+=y.WHITESPACE_CELL_CHAR:ee+=lr,F++;continue}F&&(B.textContent=ee),B=this._document.createElement("span"),F=0,ee=""}else B=this._document.createElement("span");if(ne=be.bg,ce=be.fg,de=be.extended.ext,G=Qt,N=se,ie=ar,Me&&$>=ke&&$<=Qe&&($=ke),!this._coreService.isCursorHidden&&Mr&&this._coreService.isCursorInitialized){if(fe.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&fe.push("xterm-cursor-blink"),fe.push(P==="bar"?"xterm-cursor-bar":P==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(H)switch(H){case"outline":fe.push("xterm-cursor-outline");break;case"block":fe.push("xterm-cursor-block");break;case"bar":fe.push("xterm-cursor-bar");break;case"underline":fe.push("xterm-cursor-underline")}}if(be.isBold()&&fe.push("xterm-bold"),be.isItalic()&&fe.push("xterm-italic"),be.isDim()&&fe.push("xterm-dim"),ee=be.isInvisible()?y.WHITESPACE_CELL_CHAR:be.getChars()||y.WHITESPACE_CELL_CHAR,be.isUnderline()&&(fe.push(`xterm-underline-${be.extended.underlineStyle}`),ee===" "&&(ee=" "),!be.isUnderlineColorDefault()))if(be.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(be.getUnderlineColor()).join(",")})`;else{let Oe=be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&be.isBold()&&Oe<8&&(Oe+=8),B.style.textDecorationColor=A.ansi[Oe].css}be.isOverline()&&(fe.push("xterm-overline"),ee===" "&&(ee=" ")),be.isStrikethrough()&&fe.push("xterm-strikethrough"),Qt&&(B.style.textDecoration="underline");let nt=be.getFgColor(),cr=be.getFgColorMode(),gt=be.getBgColor(),ur=be.getBgColorMode();const Or=!!be.isInverse();if(Or){const Oe=nt;nt=gt,gt=Oe;const wi=cr;cr=ur,ur=wi}let vt,Nr,ct,At=!1;switch(this._decorationService.forEachDecorationAtCell(ke,D,void 0,(Oe=>{Oe.options.layer!=="top"&&At||(Oe.backgroundColorRGB&&(ur=50331648,gt=Oe.backgroundColorRGB.rgba>>8&16777215,vt=Oe.backgroundColorRGB),Oe.foregroundColorRGB&&(cr=50331648,nt=Oe.foregroundColorRGB.rgba>>8&16777215,Nr=Oe.foregroundColorRGB),At=Oe.options.layer==="top")})),!At&&ar&&(vt=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,gt=vt.rgba>>8&16777215,ur=50331648,At=!0,A.selectionForeground&&(cr=50331648,nt=A.selectionForeground.rgba>>8&16777215,Nr=A.selectionForeground)),At&&fe.push("xterm-decoration-top"),ur){case 16777216:case 33554432:ct=A.ansi[gt],fe.push(`xterm-bg-${gt}`);break;case 50331648:ct=v.channels.toColor(gt>>16,gt>>8&255,255>),this._addStyle(B,`background-color:#${L((gt>>>0).toString(16),"0",6)}`);break;default:Or?(ct=A.foreground,fe.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):ct=A.background}switch(vt||be.isDim()&&(vt=v.color.multiplyOpacity(ct,.5)),cr){case 16777216:case 33554432:be.isBold()&&nt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(nt+=8),this._applyMinimumContrast(B,ct,A.ansi[nt],be,vt,void 0)||fe.push(`xterm-fg-${nt}`);break;case 50331648:const Oe=v.channels.toColor(nt>>16&255,nt>>8&255,255&nt);this._applyMinimumContrast(B,ct,Oe,be,vt,Nr)||this._addStyle(B,`color:#${L(nt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,ct,A.foreground,be,vt,Nr)||Or&&fe.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}fe.length&&(B.className=fe.join(" "),fe.length=0),Mr||Me||Ut?B.textContent=ee:F++,se!==this.defaultSpacing&&(B.style.letterSpacing=`${se}px`),re.push(B),ke=Qe}return B&&F&&(B.textContent=ee),re}_applyMinimumContrast(E,D,x,P,H,$){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(P.getCode()))return!1;const W=this._getContrastCache(P);let I;if(H||$||(I=W.getColor(D.rgba,x.rgba)),I===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(P.isDim()?2:1);I=v.color.ensureContrastRatio(H||D,$||x,X),W.setColor((H||D).rgba,($||x).rgba,I??null)}return!!I&&(this._addStyle(E,`color:${I.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,D){E.setAttribute("style",`${E.getAttribute("style")||""}${D};`)}_isCellInSelection(E,D){const x=this._selectionStart,P=this._selectionEnd;return!(!x||!P)&&(this._columnSelectMode?x[0]<=P[0]?E>=x[0]&&D>=x[1]&&E<P[0]&&D<=P[1]:E<x[0]&&D>=x[1]&&E>=P[0]&&D<=P[1]:D>x[1]&&D<P[1]||x[1]===P[1]&&D===x[1]&&E>=x[0]&&E<P[0]||x[1]<P[1]&&D===P[1]&&E<P[0]||x[1]<P[1]&&D===x[1]&&E>=x[0])}};function L(E,D,x){for(;E.length<x;)E=D+E;return E}i.DomRendererRowFactory=w=m([_(1,n.ICharacterJoinerService),_(2,k.IOptionsService),_(3,n.ICoreBrowserService),_(4,k.ICoreService),_(5,k.IDecorationService),_(6,n.IThemeService)],w)},2550:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(d,m){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=d.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const _=d.createElement("span");_.classList.add("xterm-char-measure-element");const h=d.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const y=d.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const S=d.createElement("span");S.classList.add("xterm-char-measure-element"),S.style.fontWeight="bold",S.style.fontStyle="italic",this._measureElements=[_,h,y,S],this._container.appendChild(_),this._container.appendChild(h),this._container.appendChild(y),this._container.appendChild(S),m.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(d,m,_,h){d===this._font&&m===this._fontSize&&_===this._weight&&h===this._weightBold||(this._font=d,this._fontSize=m,this._weight=_,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(d,m,_){let h=0;if(!m&&!_&&d.length===1&&(h=d.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const k=this._measure(d,0);return k>0&&(this._flat[h]=k),k}let y=d;m&&(y+="B"),_&&(y+="I");let S=this._holey.get(y);if(S===void 0){let k=0;m&&(k|=1),_&&(k|=2),S=this._measure(d,k),S>0&&this._holey.set(y,S)}return S}_measure(d,m){const _=this._measureElements[m];return _.textContent=d.repeat(32),_.offsetWidth/32}}},2223:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const m=d(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=m.isFirefox||m.isLegacyEdge?"bottom":"ideographic"},6171:(R,i)=>{function d(_){return 57508<=_&&_<=57558}function m(_){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=d,i.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},i.isEmoji=m,i.allowRescaling=function(_,h,y,S){return h===1&&y>Math.ceil(1.5*S)&&_!==void 0&&_>255&&!m(_)&&!d(_)&&!(function(k){return 57344<=k&&k<=63743})(_)},i.treatGlyphAsBackgroundColor=function(_){return d(_)||(function(h){return 9472<=h&&h<=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(_,h,y=0){return(_-(2*Math.round(h)-y))%(2*Math.round(h))}},6052:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class d{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(_,h,y,S=!1){if(this.selectionStart=h,this.selectionEnd=y,!h||!y||h[0]===y[0]&&h[1]===y[1])return void this.clear();const k=_.buffers.active.ydisp,v=h[1]-k,n=y[1]-k,c=Math.max(v,0),o=Math.min(n,_.rows-1);c>=_.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=S,this.viewportStartRow=v,this.viewportEndRow=n,this.viewportCappedStartRow=c,this.viewportCappedEndRow=o,this.startCol=h[0],this.endCol=y[0])}isCellSelected(_,h,y){return!!this.hasSelection&&(y-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&y>=this.viewportCappedStartRow&&h<this.endCol&&y<=this.viewportCappedEndRow:h<this.startCol&&y>=this.viewportCappedStartRow&&h>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&h>=this.startCol)}}i.createSelectionRenderModel=function(){return new d}},456:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?d%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)-1]:[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[Math.max(d,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const d=this.selectionStart,m=this.selectionEnd;return!(!d||!m)&&(d[1]>m[1]||d[1]===m[1]&&d[0]>m[0])}handleTrim(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,L){var E,D=arguments.length,x=D<3?l:L===null?L=Object.getOwnPropertyDescriptor(l,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,L);else for(var P=o.length-1;P>=0;P--)(E=o[P])&&(x=(D<3?E(x):D>3?E(l,w,x):E(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,L){l(w,L,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const h=d(2585),y=d(8460),S=d(844);let k=i.CharSizeService=class extends S.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,l,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};i.CharSizeService=k=m([_(2,h.IOptionsService)],k);class v extends S.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,w){l!==void 0&&l>0&&w!==void 0&&w>0&&(this._result.width=l,this._result.height=w)}}class n extends v{constructor(l,w,L){super(),this._document=l,this._parentElement=w,this._optionsService=L,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 c extends v{constructor(l){super(),this._optionsService=l,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 l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(R,i,d){var m=this&&this.__decorate||function(c,o,l,w){var L,E=arguments.length,D=E<3?o:w===null?w=Object.getOwnPropertyDescriptor(o,l):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,o,l,w);else for(var x=c.length-1;x>=0;x--)(L=c[x])&&(D=(E<3?L(D):E>3?L(o,l,D):L(o,l))||D);return E>3&&D&&Object.defineProperty(o,l,D),D},_=this&&this.__param||function(c,o){return function(l,w){o(l,w,c)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const h=d(3734),y=d(643),S=d(511),k=d(2585);class v extends h.AttributeData{constructor(o,l,w){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=l,this._width=w}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()]}}i.JoinedCellData=v;let n=i.CharacterJoinerService=class Nd{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new S.CellData}register(o){const l={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(l),l.id}deregister(o){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===o)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(o);if(!l||l.length===0)return[];const w=[],L=l.translateToString(!0);let E=0,D=0,x=0,P=l.getFg(0),H=l.getBg(0);for(let $=0;$<l.getTrimmedLength();$++)if(l.loadCell($,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==P||this._workCell.bg!==H){if($-E>1){const W=this._getJoinedRanges(L,x,D,l,E);for(let I=0;I<W.length;I++)w.push(W[I])}E=$,x=D,P=this._workCell.fg,H=this._workCell.bg}D+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const $=this._getJoinedRanges(L,x,D,l,E);for(let W=0;W<$.length;W++)w.push($[W])}return w}_getJoinedRanges(o,l,w,L,E){const D=o.substring(l,w);let x=[];try{x=this._characterJoiners[0].handler(D)}catch(P){console.error(P)}for(let P=1;P<this._characterJoiners.length;P++)try{const H=this._characterJoiners[P].handler(D);for(let $=0;$<H.length;$++)Nd._mergeRanges(x,H[$])}catch(H){console.error(H)}return this._stringRangesToCellRanges(x,L,E),x}_stringRangesToCellRanges(o,l,w){let L=0,E=!1,D=0,x=o[L];if(x){for(let P=w;P<this._bufferService.cols;P++){const H=l.getWidth(P),$=l.getString(P).length||y.WHITESPACE_CELL_CHAR.length;if(H!==0){if(!E&&x[0]<=D&&(x[0]=P,E=!0),x[1]<=D){if(x[1]=P,x=o[++L],!x)break;x[0]<=D?(x[0]=P,E=!0):E=!1}D+=$}}x&&(x[1]=this._bufferService.cols)}}static _mergeRanges(o,l){let w=!1;for(let L=0;L<o.length;L++){const E=o[L];if(w){if(l[1]<=E[0])return o[L-1][1]=l[1],o;if(l[1]<=E[1])return o[L-1][1]=Math.max(l[1],E[1]),o.splice(L,1),o;o.splice(L,1),L--}else{if(l[1]<=E[0])return o.splice(L,0,l),o;if(l[1]<=E[1])return E[0]=Math.min(l[0],E[0]),o;l[0]<E[1]&&(E[0]=Math.min(l[0],E[0]),w=!0)}}return w?o[o.length-1][1]=l[1]:o.push(l),o}};i.CharacterJoinerService=n=m([_(0,k.IBufferService)],n)},5114:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const m=d(844),_=d(8460),h=d(3656);class y extends m.Disposable{constructor(v,n,c){super(),this._textarea=v,this._window=n,this.mainDocument=c,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((o=>this._screenDprMonitor.setWindow(o)))),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(v){this._window!==v&&(this._window=v,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}i.CoreBrowserService=y;class S extends m.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new m.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,m.toDisposable)((()=>this.clearListener())))}setWindow(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const m=d(844);class _ extends m.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,m.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const S=this.linkProviders.indexOf(y);S!==-1&&this.linkProviders.splice(S,1)}}}}i.LinkProviderService=_},8934:function(R,i,d){var m=this&&this.__decorate||function(k,v,n,c){var o,l=arguments.length,w=l<3?v:c===null?c=Object.getOwnPropertyDescriptor(v,n):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(k,v,n,c);else for(var L=k.length-1;L>=0;L--)(o=k[L])&&(w=(l<3?o(w):l>3?o(v,n,w):o(v,n))||w);return l>3&&w&&Object.defineProperty(v,n,w),w},_=this&&this.__param||function(k,v){return function(n,c){v(n,c,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const h=d(4725),y=d(9806);let S=i.MouseService=class{constructor(k,v){this._renderService=k,this._charSizeService=v}getCoords(k,v,n,c,o){return(0,y.getCoords)(window,k,v,n,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(k,v){const n=(0,y.getCoordsRelativeToElement)(window,k,v);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};i.MouseService=S=m([_(0,h.IRenderService),_(1,h.ICharSizeService)],S)},3230:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,L){var E,D=arguments.length,x=D<3?l:L===null?L=Object.getOwnPropertyDescriptor(l,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,L);else for(var P=o.length-1;P>=0;P--)(E=o[P])&&(x=(D<3?E(x):D>3?E(l,w,x):E(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,L){l(w,L,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const h=d(6193),y=d(4725),S=d(8460),k=d(844),v=d(7226),n=d(2585);let c=i.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,l,w,L,E,D,x,P){super(),this._rowCount=o,this._charSizeService=L,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 h.RenderDebouncer(((H,$)=>this._renderRows(H,$)),x),this.register(this._renderDebouncer),this.register(x.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var H;return(H=this._renderer.value)==null?void 0:H.clear()}))),this.register(w.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(P.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(x.window,l),this.register(x.onWindowChange((H=>this._registerIntersectionObserver(H,l))))}_registerIntersectionObserver(o,l){if("IntersectionObserver"in o){const w=new o.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});w.observe(l),this._observerDisposable.value=(0,k.toDisposable)((()=>w.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,l,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,l,this._rowCount))}_renderRows(o,l){this._renderer.value&&(o=Math.min(o,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(o,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:l}),this._onRender.fire({start:o,end:l}),this._isNextRenderRedrawOnly=!0)}resize(o,l){this._rowCount=l,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,l;this._renderer.value&&((l=(o=this._renderer.value).clearTextureAtlas)==null||l.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(o,l)})):this._renderer.value.handleResize(o,l),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,l,w){var L;this._selectionState.start=o,this._selectionState.end=l,this._selectionState.columnSelectMode=w,(L=this._renderer.value)==null||L.handleSelectionChanged(o,l,w)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};i.RenderService=c=m([_(2,n.IOptionsService),_(3,y.ICharSizeService),_(4,n.IDecorationService),_(5,n.IBufferService),_(6,y.ICoreBrowserService),_(7,y.IThemeService)],c)},9312:function(R,i,d){var m=this&&this.__decorate||function(x,P,H,$){var W,I=arguments.length,X=I<3?P:$===null?$=Object.getOwnPropertyDescriptor(P,H):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(x,P,H,$);else for(var q=x.length-1;q>=0;q--)(W=x[q])&&(X=(I<3?W(X):I>3?W(P,H,X):W(P,H))||X);return I>3&&X&&Object.defineProperty(P,H,X),X},_=this&&this.__param||function(x,P){return function(H,$){P(H,$,x)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const h=d(9806),y=d(9504),S=d(456),k=d(4725),v=d(8460),n=d(844),c=d(6114),o=d(4841),l=d(511),w=d(2585),L=" ",E=new RegExp(L,"g");let D=i.SelectionService=class extends n.Disposable{constructor(x,P,H,$,W,I,X,q,z){super(),this._element=x,this._screenElement=P,this._linkifier=H,this._bufferService=$,this._coreService=W,this._mouseService=I,this._optionsService=X,this._renderService=q,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=re=>this._handleMouseMove(re),this._mouseUpListener=re=>this._handleMouseUp(re),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((re=>this._handleTrim(re))),this.register(this._bufferService.buffers.onBufferActivate((re=>this._handleBufferActivate(re)))),this.enable(),this._model=new S.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.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 x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!x||!P||x[0]===P[0]&&x[1]===P[1])}get selectionText(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;if(!x||!P)return"";const H=this._bufferService.buffer,$=[];if(this._activeSelectionMode===3){if(x[0]===P[0])return"";const W=x[0]<P[0]?x[0]:P[0],I=x[0]<P[0]?P[0]:x[0];for(let X=x[1];X<=P[1];X++){const q=H.translateBufferLineToString(X,!0,W,I);$.push(q)}}else{const W=x[1]===P[1]?P[0]:void 0;$.push(H.translateBufferLineToString(x[1],!0,x[0],W));for(let I=x[1]+1;I<=P[1]-1;I++){const X=H.lines.get(I),q=H.translateBufferLineToString(I,!0);X!=null&&X.isWrapped?$[$.length-1]+=q:$.push(q)}if(x[1]!==P[1]){const I=H.lines.get(P[1]),X=H.translateBufferLineToString(P[1],!0,0,P[0]);I&&I.isWrapped?$[$.length-1]+=X:$.push(X)}}return $.map((W=>W.replace(E," "))).join(c.isWindows?`\r
|
|
47
47
|
`:`
|
|
48
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),u.isLinux&&x&&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(x){const P=this._getMouseBufferCoords(x),H=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(H&&$&&P)&&this._areCoordsInSelection(P,H,$)}isCellInSelection(x,P){const H=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!H||!$)&&this._areCoordsInSelection([x,P],H,$)}_areCoordsInSelection(x,P,H){return x[1]>P[1]&&x[1]<H[1]||P[1]===H[1]&&x[1]===P[1]&&x[0]>=P[0]&&x[0]<H[0]||P[1]<H[1]&&x[1]===H[1]&&x[0]<H[0]||P[1]<H[1]&&x[1]===P[1]&&x[0]>=P[0]}_selectWordAtCursor(x,P){var W,I;const H=(I=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:I.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(x);return!!$&&(this._selectWordAt($,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,P){this._model.clearSelection(),x=Math.max(x,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const P=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(x){let P=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const H=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=H?0:(P>H&&(P-=H),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(x){return u.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),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(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const P=this._getMouseBufferCoords(x);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(x){return x.altKey&&!(u.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!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(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const $=H.lines.get(this._model.selectionEnd[1]);$&&$.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[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 x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const P=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const H=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const $=(0,y.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,H=!(!x||!P||x[0]===P[0]&&x[1]===P[1]);H?x&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,P,H)):this._oldHasSelection&&this._fireOnSelectionChange(x,P,H)}_fireOnSelectionChange(x,P,H){this._oldSelectionStart=x,this._oldSelectionEnd=P,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((P=>this._handleTrim(P)))}_convertViewportColToCharacterIndex(x,P){let H=P;for(let $=0;P>=$;$++){const W=x.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:W>1&&P!==$&&(H+=W-1)}return H}setSelection(x,P,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,P],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,P,H=!0,$=!0){if(x[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(x[1]);if(!I)return;const X=W.translateBufferLineToString(x[1],!1);let q=this._convertViewportColToCharacterIndex(I,x[0]),z=q;const re=x[0]-q;let Q=0,A=0,B=0,T=0;if(X.charAt(q)===" "){for(;q>0&&X.charAt(q-1)===" ";)q--;for(;z<X.length&&X.charAt(z+1)===" ";)z++}else{let ne=x[0],ce=x[0];I.getWidth(ne)===0&&(Q++,ne--),I.getWidth(ce)===2&&(A++,ce++);const de=I.getString(ce).length;for(de>1&&(T+=de-1,z+=de-1);ne>0&&q>0&&!this._isCharWordSeparator(I.loadCell(ne-1,this._workCell));){I.loadCell(ne-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(Q++,ne--):G>1&&(B+=G-1,q-=G-1),q--,ne--}for(;ce<I.length&&z+1<X.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ce++):G>1&&(T+=G-1,z+=G-1),z++,ce++}}z++;let F=q+re-Q+B,ee=Math.min(this._bufferService.cols,z-q+Q+A-B-T);if(P||X.slice(q,z).trim()!==""){if(H&&F===0&&I.getCodePoint(0)!==32){const ne=W.lines.get(x[1]-1);if(ne&&I.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(ce){const de=this._bufferService.cols-ce.start;F-=de,ee+=de}}}if($&&F+ee===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ne=W.lines.get(x[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,x[1]+1],!1,!1,!0);ce&&(ee+=ce.length)}}return{start:F,length:ee}}}_selectWordAt(x,P){const H=this._getWordAt(x,P);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[H.start,x[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(x){const P=this._getWordAt(x,!0);if(P){let H=x[1];for(;P.start<0;)P.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,H]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const P=this._bufferService.buffer.getWrappedRangeForLine(x),H={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols)}};i.SelectionService=D=m([_(3,w.IBufferService),_(4,w.ICoreService),_(5,k.IMouseService),_(6,w.IOptionsService),_(7,k.IRenderService),_(8,k.ICoreBrowserService)],D)},4725:(R,i,d)=>{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 m=d(8343);i.ICharSizeService=(0,m.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),i.IMouseService=(0,m.createDecorator)("MouseService"),i.IRenderService=(0,m.createDecorator)("RenderService"),i.ISelectionService=(0,m.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,m.createDecorator)("ThemeService"),i.ILinkProviderService=(0,m.createDecorator)("LinkProviderService")},6731:function(R,i,d){var m=this&&this.__decorate||function(D,x,P,H){var $,W=arguments.length,I=W<3?x:H===null?H=Object.getOwnPropertyDescriptor(x,P):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(D,x,P,H);else for(var X=D.length-1;X>=0;X--)($=D[X])&&(I=(W<3?$(I):W>3?$(x,P,I):$(x,P))||I);return W>3&&I&&Object.defineProperty(x,P,I),I},_=this&&this.__param||function(D,x){return function(P,H){x(P,H,D)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const h=d(7239),y=d(8055),S=d(8460),k=d(844),v=d(2585),n=y.css.toColor("#ffffff"),u=y.css.toColor("#000000"),o=y.css.toColor("#ffffff"),l=y.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let P=0;P<216;P++){const H=x[P/36%6|0],$=x[P/6%6|0],W=x[P%6];D.push({css:y.channels.toCss(H,$,W),rgba:y.channels.toRgba(H,$,W)})}for(let P=0;P<24;P++){const H=8+10*P;D.push({css:y.channels.toCss(H,H,H),rgba:y.channels.toRgba(H,H,H)})}return D})());let E=i.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:u,cursor:o,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:y.color.blend(u,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:y.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(D={}){const x=this._colors;if(x.foreground=L(D.foreground,n),x.background=L(D.background,u),x.cursor=L(D.cursor,o),x.cursorAccent=L(D.cursorAccent,l),x.selectionBackgroundTransparent=L(D.selectionBackground,w),x.selectionBackgroundOpaque=y.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=L(D.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=y.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=D.selectionForeground?L(D.selectionForeground,y.NULL_COLOR):void 0,x.selectionForeground===y.NULL_COLOR&&(x.selectionForeground=void 0),y.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=y.color.opacity(x.selectionBackgroundTransparent,.3)),y.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=y.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=i.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=L(D.black,i.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=L(D.red,i.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=L(D.green,i.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=L(D.yellow,i.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=L(D.blue,i.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=L(D.magenta,i.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=L(D.cyan,i.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=L(D.white,i.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=L(D.brightBlack,i.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=L(D.brightRed,i.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=L(D.brightGreen,i.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=L(D.brightYellow,i.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=L(D.brightBlue,i.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=L(D.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=L(D.brightCyan,i.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=L(D.brightWhite,i.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const P=Math.min(x.ansi.length-16,D.extendedAnsi.length);for(let H=0;H<P;H++)x.ansi[H+16]=L(D.extendedAnsi[H],i.DEFAULT_ANSI_COLORS[H+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function L(D,x){if(D!==void 0)try{return y.css.toColor(D)}catch{}return x}i.ThemeService=E=m([_(0,v.IOptionsService)],E)},6349:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const m=d(8460),_=d(844);class h extends _.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new m.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new m.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new m.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 k=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)k[v]=this._array[this._getCyclicIndex(v)];this._array=k,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let k=this._length;k<S;k++)this._array[k]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,k){this._array[this._getCyclicIndex(S)]=k}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,k,...v){if(k){for(let n=S;n<this._length-k;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+k)];this._length-=k,this.onDeleteEmitter.fire({index:S,amount:k})}for(let n=this._length-1;n>=S;n--)this._array[this._getCyclicIndex(n+v.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<v.length;n++)this._array[this._getCyclicIndex(S+n)]=v[n];if(v.length&&this.onInsertEmitter.fire({index:S,amount:v.length}),this._length+v.length>this._maxLength){const n=this._length+v.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=v.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,k,v){if(!(k<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let u=k-1;u>=0;u--)this.set(S+u+v,this.get(S+u));const n=S+k+v-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<k;n++)this.set(S+n+v,this.get(S+n))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}i.CircularList=h},1439:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function d(m,_=5){if(typeof m!="object")return m;const h=Array.isArray(m)?[]:{};for(const y in m)h[y]=_<=1?m[y]:m[y]&&d(m[y],_-1);return h}},8055:(R,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 d=0,m=0,_=0,h=0;var y,S,k,v,n;function u(l){const w=l.toString(16);return w.length<2?"0"+w:w}function o(l,w){return l<w?(w+.05)/(l+.05):(l+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(w,E,L,D){return D!==void 0?`#${u(w)}${u(E)}${u(L)}${u(D)}`:`#${u(w)}${u(E)}${u(L)}`},l.toRgba=function(w,E,L,D=255){return(w<<24|E<<16|L<<8|D)>>>0},l.toColor=function(w,E,L,D){return{css:l.toCss(w,E,L,D),rgba:l.toRgba(w,E,L,D)}}})(y||(i.channels=y={})),(function(l){function w(E,L){return h=Math.round(255*L),[d,m,_]=n.toChannels(E.rgba),{css:y.toCss(d,m,_,h),rgba:y.toRgba(d,m,_,h)}}l.blend=function(E,L){if(h=(255&L.rgba)/255,h===1)return{css:L.css,rgba:L.rgba};const D=L.rgba>>24&255,x=L.rgba>>16&255,P=L.rgba>>8&255,H=E.rgba>>24&255,$=E.rgba>>16&255,W=E.rgba>>8&255;return d=H+Math.round((D-H)*h),m=$+Math.round((x-$)*h),_=W+Math.round((P-W)*h),{css:y.toCss(d,m,_),rgba:y.toRgba(d,m,_)}},l.isOpaque=function(E){return(255&E.rgba)==255},l.ensureContrastRatio=function(E,L,D){const x=n.ensureContrastRatio(E.rgba,L.rgba,D);if(x)return y.toColor(x>>24&255,x>>16&255,x>>8&255)},l.opaque=function(E){const L=(255|E.rgba)>>>0;return[d,m,_]=n.toChannels(L),{css:y.toCss(d,m,_),rgba:L}},l.opacity=w,l.multiplyOpacity=function(E,L){return h=255&E.rgba,w(E,h*L/255)},l.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}})(S||(i.color=S={})),(function(l){let w,E;try{const L=document.createElement("canvas");L.width=1,L.height=1;const D=L.getContext("2d",{willReadFrequently:!0});D&&(w=D,w.globalCompositeOperation="copy",E=w.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return d=parseInt(L.slice(1,2).repeat(2),16),m=parseInt(L.slice(2,3).repeat(2),16),_=parseInt(L.slice(3,4).repeat(2),16),y.toColor(d,m,_);case 5:return d=parseInt(L.slice(1,2).repeat(2),16),m=parseInt(L.slice(2,3).repeat(2),16),_=parseInt(L.slice(3,4).repeat(2),16),h=parseInt(L.slice(4,5).repeat(2),16),y.toColor(d,m,_,h);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const D=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return d=parseInt(D[1]),m=parseInt(D[2]),_=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),y.toColor(d,m,_,h);if(!w||!E)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=E,w.fillStyle=L,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[d,m,_,h]=w.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(d,m,_,h),css:L}}})(k||(i.css=k={})),(function(l){function w(E,L,D){const x=E/255,P=L/255,H=D/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}l.relativeLuminance=function(E){return w(E>>16&255,E>>8&255,255&E)},l.relativeLuminance2=w})(v||(i.rgb=v={})),(function(l){function w(L,D,x){const P=L>>24&255,H=L>>16&255,$=L>>8&255;let W=D>>24&255,I=D>>16&255,X=D>>8&255,q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));for(;q<x&&(W>0||I>0||X>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),X-=Math.max(0,Math.ceil(.1*X)),q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));return(W<<24|I<<16|X<<8|255)>>>0}function E(L,D,x){const P=L>>24&255,H=L>>16&255,$=L>>8&255;let W=D>>24&255,I=D>>16&255,X=D>>8&255,q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));for(;q<x&&(W<255||I<255||X<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),X=Math.min(255,X+Math.ceil(.1*(255-X))),q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));return(W<<24|I<<16|X<<8|255)>>>0}l.blend=function(L,D){if(h=(255&D)/255,h===1)return D;const x=D>>24&255,P=D>>16&255,H=D>>8&255,$=L>>24&255,W=L>>16&255,I=L>>8&255;return d=$+Math.round((x-$)*h),m=W+Math.round((P-W)*h),_=I+Math.round((H-I)*h),y.toRgba(d,m,_)},l.ensureContrastRatio=function(L,D,x){const P=v.relativeLuminance(L>>8),H=v.relativeLuminance(D>>8);if(o(P,H)<x){if(H<P){const I=w(L,D,x),X=o(P,v.relativeLuminance(I>>8));if(X<x){const q=E(L,D,x);return X>o(P,v.relativeLuminance(q>>8))?I:q}return I}const $=E(L,D,x),W=o(P,v.relativeLuminance($>>8));if(W<x){const I=w(L,D,x);return W>o(P,v.relativeLuminance(I>>8))?$:I}return $}},l.reduceLuminance=w,l.increaseLuminance=E,l.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(n||(i.rgba=n={})),i.toPaddedHex=u,i.contrastRatio=o},8969:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const m=d(844),_=d(2585),h=d(4348),y=d(7866),S=d(744),k=d(7302),v=d(6975),n=d(8460),u=d(1753),o=d(1480),l=d(7994),w=d(9282),E=d(5435),L=d(5981),D=d(2660);let x=!1;class P extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(($=>{var W;(W=this._onScrollApi)==null||W.fire($.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($){for(const W in $)this.optionsService.options[W]=$[W]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new m.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),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(y.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.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(o.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,W){this._writeBuffer.write($,W)}writeSync($,W){this._logService.logLevel<=_.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync($,W)}input($,W=!0){this.coreService.triggerDataEvent($,W)}resize($,W){isNaN($)||isNaN(W)||($=Math.max($,S.MINIMUM_COLS),W=Math.max(W,S.MINIMUM_ROWS),this._bufferService.resize($,W))}scroll($,W=!1){this._bufferService.scroll($,W)}scrollLines($,W,I){this._bufferService.scrollLines($,W,I)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const W=$-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler($,W){return this._inputHandler.registerEscHandler($,W)}registerDcsHandler($,W){return this._inputHandler.registerDcsHandler($,W)}registerCsiHandler($,W){return this._inputHandler.registerCsiHandler($,W)}registerOscHandler($,W){return this._inputHandler.registerOscHandler($,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?$=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const W of $)W.dispose()}))}}}i.CoreTerminal=P},8460:(R,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=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===d)return void this._listeners.splice(m,1)}}})),this._event}fire(d,m){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,d,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(d,m){return d((_=>m.fire(_)))},i.runAndSubscribe=function(d,m){return m(void 0),d((_=>m(_)))}},5435:function(R,i,d){var m=this&&this.__decorate||function(Q,A,B,T){var F,ee=arguments.length,ne=ee<3?A:T===null?T=Object.getOwnPropertyDescriptor(A,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Q,A,B,T);else for(var ce=Q.length-1;ce>=0;ce--)(F=Q[ce])&&(ne=(ee<3?F(ne):ee>3?F(A,B,ne):F(A,B))||ne);return ee>3&&ne&&Object.defineProperty(A,B,ne),ne},_=this&&this.__param||function(Q,A){return function(B,T){A(B,T,Q)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const h=d(2584),y=d(7116),S=d(2015),k=d(844),v=d(482),n=d(8437),u=d(8460),o=d(643),l=d(511),w=d(3734),E=d(2585),L=d(1480),D=d(6242),x=d(6351),P=d(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function W(Q,A){if(Q>24)return A.setWinLines||!1;switch(Q){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var I;(function(Q){Q[Q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Q[Q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(i.WindowsOptionsReportType=I={}));let X=0;class q extends k.Disposable{getAttrData(){return this._curAttrData}constructor(A,B,T,F,ee,ne,ce,de,G=new S.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=B,this._coreService=T,this._logService=F,this._optionsService=ee,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=de,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.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((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:ie.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,ie,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:ie,data:se})})),this._parser.setDcsHandlerFallback(((N,ie,se)=>{ie==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:ie,payload:se})})),this._parser.setPrintHandler(((N,ie,se)=>this.print(N,ie,se))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new D.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new D.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new D.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new D.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new D.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new D.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new D.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new D.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new D.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new D.OscHandler((N=>this.restoreCursorColor(N)))),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 N in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((N,ie)=>this.requestStatusString(N,ie))))}_preserveStack(A,B,T,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=F}_logSlowResolvingAsync(A){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([A,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,B){let T,F=this._activeBuffer.x,ee=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;F=this._parseStack.cursorStartX,ee=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>$&&(ne=this._parseStack.position+$)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(N=>String.fromCharCode(N))).join("")}"`),typeof A=="string"?A.split("").map((N=>N.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<$&&(this._parseBuffer=new Uint32Array(Math.min(A.length,$))),ce||this._dirtyRowTracker.clearRange(),A.length>$)for(let N=ne;N<A.length;N+=$){const ie=N+$<A.length?N+$:A.length,se=typeof A=="string"?this._stringDecoder.decode(A.substring(N,ie),this._parseBuffer):this._utf8Decoder.decode(A.subarray(N,ie),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,se))return this._preserveStack(F,ee,se,N),this._logSlowResolvingAsync(T),T}else if(!ce){const N=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,N))return this._preserveStack(F,ee,N,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===F&&this._activeBuffer.y===ee||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(A,B,T){let F,ee;const ne=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,ie=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let fe=this._parser.precedingJoinState;for(let he=B;he<T;++he){if(F=A[he],F<127&&ne){const Qe=ne[String.fromCharCode(F)];Qe&&(F=Qe.charCodeAt(0))}const ke=this._unicodeService.charProperties(F,fe);ee=L.UnicodeService.extractWidth(ke);const Te=L.UnicodeService.extractShouldJoin(ke),Me=Te?L.UnicodeService.extractWidth(fe):0;if(fe=ke,ce&&this._onA11yChar.fire((0,v.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ee-Me>de){if(G){const Qe=se;let be=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,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),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&se instanceof n.BufferLine&&se.copyCellsFrom(Qe,be,0,Me,!1);be<de;)Qe.setCellFromCodepoint(be++,0,1,ie)}else if(this._activeBuffer.x=de-1,ee===2)continue}if(Te&&this._activeBuffer.x){const Qe=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-Qe,F,ee);for(let be=ee-Me;--be>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(N&&(se.insertCells(this._activeBuffer.x,ee-Me,this._activeBuffer.getNullCell(ie)),se.getWidth(de-1)===2&&se.setCellFromCodepoint(de-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ie)),se.setCellFromCodepoint(this._activeBuffer.x++,F,ee,ie),ee>0)for(;--ee;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=fe,this._activeBuffer.x<de&&T-B>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,B){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,B):this._parser.registerCsiHandler(A,(T=>!W(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(A,B){return this._parser.registerDcsHandler(A,new x.DcsHandler(B))}registerEscHandler(A,B){return this._parser.registerEscHandler(A,B)}registerOscHandler(A,B){return this._parser.registerOscHandler(A,new D.OscHandler(B))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=A,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+B)}cursorUp(A){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const B=A.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const B=A.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,B,T,F=!1,ee=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);ne.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),ee),F&&(ne.isWrapped=!1)}_resetBufferLine(A,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),T.isWrapped=!1)}eraseInDisplay(A,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(A,B=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ee=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;B--;)this._activeBuffer.lines.splice(ee-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;B--;)this._activeBuffer.lines.splice(T,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}insertChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let B=A.params[0]||1;for(;B--;)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(A){let B=A.params[0]||1;for(;B--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const B=this._parser.precedingJoinState;if(!B)return!0;const T=A.params[0]||1,F=L.UnicodeService.extractWidth(B),ee=this._activeBuffer.x-F,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ee),ce=new Uint32Array(ne.length*T);let de=0;for(let N=0;N<ne.length;){const ie=ne.codePointAt(N)||0;ce[de++]=ie,N+=ie>65535?2:1}let G=de;for(let N=1;N<T;++N)ce.copyWithin(G,0,de),G+=de;return this.print(ce,0,G),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){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(),A.params[B]===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(A,B){const T=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:ee}=this._coreMouseService,ne=this._coreService,{buffers:ce,cols:de}=this._bufferService,{active:G,alt:N}=ce,ie=this._optionsService.rawOptions,se=Te=>Te?1:2,fe=A.params[0];return he=fe,ke=B?fe===2?4:fe===4?se(ne.modes.insertMode):fe===12?3:fe===20?se(ie.convertEol):0:fe===1?se(T.applicationCursorKeys):fe===3?ie.windowOptions.setWinLines?de===80?2:de===132?1:0:0:fe===6?se(T.origin):fe===7?se(T.wraparound):fe===8?3:fe===9?se(F==="X10"):fe===12?se(ie.cursorBlink):fe===25?se(!ne.isCursorHidden):fe===45?se(T.reverseWraparound):fe===66?se(T.applicationKeypad):fe===67?4:fe===1e3?se(F==="VT200"):fe===1002?se(F==="DRAG"):fe===1003?se(F==="ANY"):fe===1004?se(T.sendFocus):fe===1005?4:fe===1006?se(ee==="SGR"):fe===1015?4:fe===1016?se(ee==="SGR_PIXELS"):fe===1048?1:fe===47||fe===1047||fe===1049?se(G===N):fe===2004?se(T.bracketedPasteMode):0,ne.triggerDataEvent(`${h.C0.ESC}[${B?"":"?"}${he};${ke}$y`),!0;var he,ke}_updateAttrColor(A,B,T,F,ee){return B===2?(A|=50331648,A&=-16777216,A|=w.AttributeData.fromColorRGB([T,F,ee])):B===5&&(A&=-50331904,A|=33554432|255&T),A}_extractColor(A,B,T){const F=[0,0,-1,0,0,0];let ee=0,ne=0;do{if(F[ne+ee]=A.params[B+ne],A.hasSubParams(B+ne)){const ce=A.getSubParams(B+ne);let de=0;do F[1]===5&&(ee=1),F[ne+de+1+ee]=ce[de];while(++de<ce.length&&de+ne+1+ee<F.length);break}if(F[1]===5&&ne+ee>=2||F[1]===2&&ne+ee>=5)break;F[1]&&(ee=1)}while(++ne+B<A.length&&ne+ee<F.length);for(let ce=2;ce<F.length;++ce)F[ce]===-1&&(F[ce]=0);switch(F[0]){case 38:T.fg=this._updateAttrColor(T.fg,F[1],F[3],F[4],F[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,F[1],F[3],F[4],F[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,F[1],F[3],F[4],F[5])}return ne}_processUnderline(A,B){B.extended=B.extended.clone(),(!~A||A>5)&&(A=1),B.extended.underlineStyle=A,B.fg|=268435456,A===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(A){A.fg=n.DEFAULT_ATTR_DATA.fg,A.bg=n.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=A.length;let T;const F=this._curAttrData;for(let ee=0;ee<B;ee++)T=A.params[ee],T>=30&&T<=37?(F.fg&=-50331904,F.fg|=16777216|T-30):T>=40&&T<=47?(F.bg&=-50331904,F.bg|=16777216|T-40):T>=90&&T<=97?(F.fg&=-50331904,F.fg|=16777224|T-90):T>=100&&T<=107?(F.bg&=-50331904,F.bg|=16777224|T-100):T===0?this._processSGR0(F):T===1?F.fg|=134217728:T===3?F.bg|=67108864:T===4?(F.fg|=268435456,this._processUnderline(A.hasSubParams(ee)?A.getSubParams(ee)[0]:1,F)):T===5?F.fg|=536870912:T===7?F.fg|=67108864:T===8?F.fg|=1073741824:T===9?F.fg|=2147483648:T===2?F.bg|=134217728:T===21?this._processUnderline(2,F):T===22?(F.fg&=-134217729,F.bg&=-134217729):T===23?F.bg&=-67108865:T===24?(F.fg&=-268435457,this._processUnderline(0,F)):T===25?F.fg&=-536870913:T===27?F.fg&=-67108865:T===28?F.fg&=-1073741825:T===29?F.fg&=2147483647:T===39?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):T===49?(F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?ee+=this._extractColor(A,ee,F):T===53?F.bg|=1073741824:T===55?F.bg&=-1073741825:T===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):T===100?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${B};${T}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(A){const B=A.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(A){const B=A.params[0]||1;let T;return(A.length<2||(T=A.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(A){if(!W(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const B=[],T=A.split(";");for(;T.length>1;){const F=T.shift(),ee=T.shift();if(/^\d+$/.exec(F)){const ne=parseInt(F);if(re(ne))if(ee==="?")B.push({type:0,index:ne});else{const ce=(0,P.parseColor)(ee);ce&&B.push({type:1,index:ne,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(A){const B=A.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(A,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=A.split(":");let F;const ee=T.findIndex((ne=>ne.startsWith("id=")));return ee!==-1&&(F=T[ee].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,B){const T=A.split(";");for(let F=0;F<T.length&&!(B>=this._specialColors.length);++F,++B)if(T[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const ee=(0,P.parseColor)(T[F]);ee&&this._onColor.fire([{type:1,index:this._specialColors[B],color:ee}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const B=[],T=A.split(";");for(let F=0;F<T.length;++F)if(/^\d+$/.exec(T[F])){const ee=parseInt(T[F]);re(ee)&&B.push({type:2,index:ee})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,y.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(H[A[0]],y.CHARSETS[A[1]]||y.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new l.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,F=this._activeBuffer.lines.get(T);F&&(F.fill(A),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,B){const T=this._bufferService.buffer,F=this._optionsService.rawOptions;return(ee=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ee}${h.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,B){this._dirtyRowTracker.markRangeDirty(A,B)}}i.InputHandler=q;let z=class{constructor(Q){this._bufferService=Q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Q){Q<this.start?this.start=Q:Q>this.end&&(this.end=Q)}markRangeDirty(Q,A){Q>A&&(X=Q,Q=A,A=X),Q<this.start&&(this.start=Q),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function re(Q){return 0<=Q&&Q<256}z=m([_(0,E.IBufferService)],z)},844:(R,i)=>{function d(m){for(const _ of m)_.dispose();m.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 m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const _=this._disposables.indexOf(m);_!==-1&&this._disposables.splice(_,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){var _;this._isDisposed||m===this._value||((_=this._value)==null||_.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){var m;this._isDisposed=!0,(m=this._value)==null||m.dispose(),this._value=void 0}},i.toDisposable=function(m){return{dispose:m}},i.disposeArray=d,i.getDisposeArrayDisposable=function(m){return{dispose:()=>d(m)}}},1505:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(_,h,y){this._data[_]||(this._data[_]={}),this._data[_][h]=y}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}i.TwoKeyMap=d,i.FourKeyMap=class{constructor(){this._data=new d}set(m,_,h,y,S){this._data.get(m,_)||this._data.set(m,_,new d),this._data.get(m,_).set(h,y,S)}get(m,_,h,y){var S;return(S=this._data.get(m,_))==null?void 0:S.get(h,y)}clear(){this._data.clear()}}},6114:(R,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 d=i.isNode?"node":navigator.userAgent,m=i.isNode?"node":navigator.platform;i.isFirefox=d.includes("Firefox"),i.isLegacyEdge=d.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(d),i.getSafariVersion=function(){if(!i.isSafari)return 0;const _=d.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),i.isIpad=m==="iPad",i.isIphone=m==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),i.isLinux=m.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(d)},6106:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let d=0;i.SortedList=class{constructor(m){this._getKey=m,this._array=[]}clear(){this._array.length=0}insert(m){this._array.length!==0?(d=this._search(this._getKey(m)),this._array.splice(d,0,m)):this._array.push(m)}delete(m){if(this._array.length===0)return!1;const _=this._getKey(m);if(_===void 0||(d=this._search(_),d===-1)||this._getKey(this._array[d])!==_)return!1;do if(this._array[d]===m)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===_);return!1}*getKeyIterator(m){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===m)}forEachByKey(m,_){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do _(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===m)}values(){return[...this._array].values()}_search(m){let _=0,h=this._array.length-1;for(;h>=_;){let y=_+h>>1;const S=this._getKey(this._array[y]);if(S>m)h=y-1;else{if(!(S<m)){for(;y>0&&this._getKey(this._array[y-1])===m;)y--;return y}_=y+1}}return _}}},7226:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const m=d(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 k=0,v=0,n=S.timeRemaining(),u=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),v=Math.max(k,v),u=S.timeRemaining(),1.5*v>u)return n-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-k))}ms`),void this._start();n=u}this.clear()}}class h extends _{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}i.PriorityTaskQueue=h,i.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:h,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const m=d(643);i.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),y=h==null?void 0:h.get(_.cols-1),S=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);S&&y&&(S.isWrapped=y[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&y[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new d;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=d;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,y=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=y}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=m},9092:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const m=d(6349),_=d(7226),h=d(3734),y=d(8437),S=d(4634),k=d(511),v=d(643),n=d(4863),u=d(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(o,l,w){this._hasScrollback=o,this._optionsService=l,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=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.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 m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,l){return new y.BufferLine(this._bufferService.cols,this.getNullCell(o),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const l=o+this._optionsService.rawOptions.scrollback;return l>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:l}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=y.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,l){const w=this.getNullCell(y.DEFAULT_ATTR_DATA);let E=0;const L=this._getCorrectBufferLength(l);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<o)for(let x=0;x<this.lines.length;x++)E+=+this.lines.get(x).resize(o,w);let D=0;if(this._rows<l)for(let x=this._rows;x<l;x++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(o,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(o,w)));else for(let x=this._rows;x>l;x--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const x=this.lines.length-L;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=L}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,l-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(o,l),this._cols>o))for(let D=0;D<this.lines.length;D++)E+=+this.lines.get(D).resize(o,w);this._cols=o,this._rows=l,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,l){this._cols!==o&&(o>this._cols?this._reflowLarger(o,l):this._reflowSmaller(o,l))}_reflowLarger(o,l){const w=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(w.length>0){const E=(0,S.reflowLargerCreateNewLayout)(this.lines,w);(0,S.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(o,l,E.countRemoved)}}_reflowLargerAdjustViewport(o,l,w){const E=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=w;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new y.BufferLine(o,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(o,l){const w=this.getNullCell(y.DEFAULT_ATTR_DATA),E=[];let L=0;for(let D=this.lines.length-1;D>=0;D--){let x=this.lines.get(D);if(!x||!x.isWrapped&&x.getTrimmedLength()<=o)continue;const P=[x];for(;x.isWrapped&&D>0;)x=this.lines.get(--D),P.unshift(x);const H=this.ybase+this.y;if(H>=D&&H<D+P.length)continue;const $=P[P.length-1].getTrimmedLength(),W=(0,S.reflowSmallerGetNewLineLengths)(P,this._cols,o),I=W.length-P.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const q=[];for(let T=0;T<I;T++){const F=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);q.push(F)}q.length>0&&(E.push({start:D+P.length+L,newLines:q}),L+=q.length),P.push(...q);let z=W.length-1,re=W[z];re===0&&(z--,re=W[z]);let Q=P.length-I-1,A=$;for(;Q>=0;){const T=Math.min(A,re);if(P[z]===void 0)break;if(P[z].copyCellsFrom(P[Q],A-T,re-T,T,!0),re-=T,re===0&&(z--,re=W[z]),A-=T,A===0){Q--;const F=Math.max(Q,0);A=(0,S.getWrappedLineTrimmedLength)(P,F,this._cols)}}for(let T=0;T<P.length;T++)W[T]<o&&P[T].setCell(W[T],w);let B=I-X;for(;B-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+l-1)}if(E.length>0){const D=[],x=[];for(let z=0;z<this.lines.length;z++)x.push(this.lines.get(z));const P=this.lines.length;let H=P-1,$=0,W=E[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let I=0;for(let z=Math.min(this.lines.maxLength-1,P+L-1);z>=0;z--)if(W&&W.start>H+I){for(let re=W.newLines.length-1;re>=0;re--)this.lines.set(z--,W.newLines[re]);z++,D.push({index:H+1,amount:W.newLines.length}),I+=W.newLines.length,W=E[++$]}else this.lines.set(z,x[H--]);let X=0;for(let z=D.length-1;z>=0;z--)D[z].index+=X,this.lines.onInsertEmitter.fire(D[z]),X+=D[z].amount;const q=Math.max(0,P+L-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(o,l,w=0,E){const L=this.lines.get(o);return L?L.translateToString(l,w,E):""}getWrappedRangeForLine(o){let l=o,w=o;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:l,last:w}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===o&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const l=new n.Marker(o);return this.markers.push(l),l.register(this.lines.onTrim((w=>{l.line-=w,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((w=>{l.line>=w.index&&(l.line+=w.amount)}))),l.register(this.lines.onDelete((w=>{l.line>=w.index&&l.line<w.index+w.amount&&l.dispose(),l.line>w.index&&(l.line-=w.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const m=d(3734),_=d(511),h=d(643),y=d(482);i.DEFAULT_ATTR_DATA=Object.freeze(new m.AttributeData);let S=0;class k{constructor(n,u,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const l=u||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let w=0;w<n;++w)this.setCell(w,l);this.length=n}get(n){const u=this._data[3*n+0],o=2097151&u;return[this._data[3*n+1],2097152&u?this._combined[n]:o?(0,y.stringFromCodePoint)(o):"",u>>22,2097152&u?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,u){this._data[3*n+1]=u[h.CHAR_DATA_ATTR_INDEX],u[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=u[1],this._data[3*n+0]=2097152|n|u[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=u[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|u[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const u=this._data[3*n+0];return 2097152&u?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&u}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const u=this._data[3*n+0];return 2097152&u?this._combined[n]:2097151&u?(0,y.stringFromCodePoint)(2097151&u):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,u){return S=3*n,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[n]),268435456&u.bg&&(u.extended=this._extendedAttrs[n]),u}setCell(n,u){2097152&u.content&&(this._combined[n]=u.combinedData),268435456&u.bg&&(this._extendedAttrs[n]=u.extended),this._data[3*n+0]=u.content,this._data[3*n+1]=u.fg,this._data[3*n+2]=u.bg}setCellFromCodepoint(n,u,o,l){268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=u|o<<22,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}addCodepointToCell(n,u,o){let l=this._data[3*n+0];2097152&l?this._combined[n]+=(0,y.stringFromCodePoint)(u):2097151&l?(this._combined[n]=(0,y.stringFromCodePoint)(2097151&l)+(0,y.stringFromCodePoint)(u),l&=-2097152,l|=2097152):l=u|4194304,o&&(l&=-12582913,l|=o<<22),this._data[3*n+0]=l}insertCells(n,u,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),u<this.length-n){const l=new _.CellData;for(let w=this.length-n-u-1;w>=0;--w)this.setCell(n+u+w,this.loadCell(n+w,l));for(let w=0;w<u;++w)this.setCell(n+w,o)}else for(let l=n;l<this.length;++l)this.setCell(l,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,u,o){if(n%=this.length,u<this.length-n){const l=new _.CellData;for(let w=0;w<this.length-n-u;++w)this.setCell(n+w,this.loadCell(n+u+w,l));for(let w=this.length-u;w<this.length;++w)this.setCell(w,o)}else for(let l=n;l<this.length;++l)this.setCell(l,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,u,o,l=!1){if(l)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),u<this.length&&this.getWidth(u-1)===2&&!this.isProtected(u)&&this.setCellFromCodepoint(u,0,1,o);n<u&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),u<this.length&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u,0,1,o);n<u&&n<this.length;)this.setCell(n++,o)}resize(n,u){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const l=new Uint32Array(o);l.set(this._data),this._data=l}for(let l=this.length;l<n;++l)this.setCell(l,u)}else{this._data=this._data.subarray(0,o);const l=Object.keys(this._combined);for(let E=0;E<l.length;E++){const L=parseInt(l[E],10);L>=n&&delete this._combined[L]}const w=Object.keys(this._extendedAttrs);for(let E=0;E<w.length;E++){const L=parseInt(w[E],10);L>=n&&delete this._extendedAttrs[L]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,u=!1){if(u)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const u in n._combined)this._combined[u]=n._combined[u];this._extendedAttrs={};for(const u in n._extendedAttrs)this._extendedAttrs[u]=n._extendedAttrs[u];this.isWrapped=n.isWrapped}clone(){const n=new k(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const u in this._combined)n._combined[u]=this._combined[u];for(const u in this._extendedAttrs)n._extendedAttrs[u]=this._extendedAttrs[u];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,u,o,l,w){const E=n._data;if(w)for(let D=l-1;D>=0;D--){for(let x=0;x<3;x++)this._data[3*(o+D)+x]=E[3*(u+D)+x];268435456&E[3*(u+D)+2]&&(this._extendedAttrs[o+D]=n._extendedAttrs[u+D])}else for(let D=0;D<l;D++){for(let x=0;x<3;x++)this._data[3*(o+D)+x]=E[3*(u+D)+x];268435456&E[3*(u+D)+2]&&(this._extendedAttrs[o+D]=n._extendedAttrs[u+D])}const L=Object.keys(n._combined);for(let D=0;D<L.length;D++){const x=parseInt(L[D],10);x>=u&&(this._combined[x-u+o]=n._combined[x])}}translateToString(n,u,o,l){u=u??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),l&&(l.length=0);let w="";for(;u<o;){const E=this._data[3*u+0],L=2097151&E,D=2097152&E?this._combined[u]:L?(0,y.stringFromCodePoint)(L):h.WHITESPACE_CELL_CHAR;if(w+=D,l)for(let x=0;x<D.length;++x)l.push(u);u+=E>>22||1}return l&&l.push(u),w}}i.BufferLine=k},4841:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(d,m){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return m*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(R,i)=>{function d(m,_,h){if(_===m.length-1)return m[_].getTrimmedLength();const y=!m[_].hasContent(h-1)&&m[_].getWidth(h-1)===1,S=m[_+1].getWidth(0)===2;return y&&S?h-1:h}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(m,_,h,y,S){const k=[];for(let v=0;v<m.length-1;v++){let n=v,u=m.get(++n);if(!u.isWrapped)continue;const o=[m.get(v)];for(;n<m.length&&u.isWrapped;)o.push(u),u=m.get(++n);if(y>=v&&y<n){v+=o.length-1;continue}let l=0,w=d(o,l,_),E=1,L=0;for(;E<o.length;){const x=d(o,E,_),P=x-L,H=h-w,$=Math.min(P,H);o[l].copyCellsFrom(o[E],L,w,$,!1),w+=$,w===h&&(l++,w=0),L+=$,L===x&&(E++,L=0),w===0&&l!==0&&o[l-1].getWidth(h-1)===2&&(o[l].copyCellsFrom(o[l-1],h-1,w++,1,!1),o[l-1].setCell(h-1,S))}o[l].replaceCells(w,h,S);let D=0;for(let x=o.length-1;x>0&&(x>l||o[x].getTrimmedLength()===0);x--)D++;D>0&&(k.push(v+o.length-D),k.push(D)),v+=o.length-1}return k},i.reflowLargerCreateNewLayout=function(m,_){const h=[];let y=0,S=_[y],k=0;for(let v=0;v<m.length;v++)if(S===v){const n=_[++y];m.onDeleteEmitter.fire({index:v-k,amount:n}),v+=n-1,k+=n,S=_[++y]}else h.push(v);return{layout:h,countRemoved:k}},i.reflowLargerApplyNewLayout=function(m,_){const h=[];for(let y=0;y<_.length;y++)h.push(m.get(_[y]));for(let y=0;y<h.length;y++)m.set(y,h[y]);m.length=_.length},i.reflowSmallerGetNewLineLengths=function(m,_,h){const y=[],S=m.map(((u,o)=>d(m,o,_))).reduce(((u,o)=>u+o));let k=0,v=0,n=0;for(;n<S;){if(S-n<h){y.push(S-n);break}k+=h;const u=d(m,v,_);k>u&&(k-=u,v++);const o=m[v].getWidth(k-1)===2;o&&k--;const l=o?h-1:h;y.push(l),n+=l}return y},i.getWrappedLineTrimmedLength=d},5295:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const m=d(8460),_=d(844),h=d(9092);class y extends _.Disposable{constructor(k,v){super(),this._optionsService=k,this._bufferService=v,this._onBufferActivate=this.register(new m.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,v){this._normal.resize(k,v),this._alt.resize(k,v),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}i.BufferSet=y},511:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const m=d(482),_=d(643),h=d(3734);class y extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const v=new y;return v.setFromCharData(k),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(k[_.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(k[_.CHAR_DATA_CHAR_INDEX].length===2){const n=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const u=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=u&&u<=57343?this.content=1024*(n-55296)+u-56320+65536|k[_.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[_.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=k[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=y},643:(R,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:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const m=d(8460),_=d(844);class h{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new m.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=h,h._nextId=1},7116:(R,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:(R,i)=>{var d,m,_;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
49
|
-
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(d||(i.C0=d={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(m||(i.C1=m={})),(function(h){h.ST=`${d.ESC}\\`})(_||(i.C1_ESCAPED=_={}))},7399:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const m=d(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(h,y,S,k){const v={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=y?m.C0.ESC+"OA":m.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=y?m.C0.ESC+"OD":m.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=y?m.C0.ESC+"OC":m.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=y?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":m.C0.DEL,h.altKey&&(v.key=m.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=m.C0.ESC+"[Z";break}v.key=m.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,v.cancel=!0;break;case 27:v.key=m.C0.ESC,h.altKey&&(v.key=m.C0.ESC+m.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"D",v.key===m.C0.ESC+"[1;3D"&&(v.key=m.C0.ESC+(S?"b":"[1;5D"))):v.key=y?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"C",v.key===m.C0.ESC+"[1;3C"&&(v.key=m.C0.ESC+(S?"f":"[1;5C"))):v.key=y?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"A",S||v.key!==m.C0.ESC+"[1;3A"||(v.key=m.C0.ESC+"[1;5A")):v.key=y?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"B",S||v.key!==m.C0.ESC+"[1;3B"||(v.key=m.C0.ESC+"[1;5B")):v.key=y?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=m.C0.ESC+"[2~");break;case 46:v.key=n?m.C0.ESC+"[3;"+(n+1)+"~":m.C0.ESC+"[3~";break;case 36:v.key=n?m.C0.ESC+"[1;"+(n+1)+"H":y?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:v.key=n?m.C0.ESC+"[1;"+(n+1)+"F":y?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=m.C0.ESC+"[5;"+(n+1)+"~":v.key=m.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=m.C0.ESC+"[6;"+(n+1)+"~":v.key=m.C0.ESC+"[6~";break;case 112:v.key=n?m.C0.ESC+"[1;"+(n+1)+"P":m.C0.ESC+"OP";break;case 113:v.key=n?m.C0.ESC+"[1;"+(n+1)+"Q":m.C0.ESC+"OQ";break;case 114:v.key=n?m.C0.ESC+"[1;"+(n+1)+"R":m.C0.ESC+"OR";break;case 115:v.key=n?m.C0.ESC+"[1;"+(n+1)+"S":m.C0.ESC+"OS";break;case 116:v.key=n?m.C0.ESC+"[15;"+(n+1)+"~":m.C0.ESC+"[15~";break;case 117:v.key=n?m.C0.ESC+"[17;"+(n+1)+"~":m.C0.ESC+"[17~";break;case 118:v.key=n?m.C0.ESC+"[18;"+(n+1)+"~":m.C0.ESC+"[18~";break;case 119:v.key=n?m.C0.ESC+"[19;"+(n+1)+"~":m.C0.ESC+"[19~";break;case 120:v.key=n?m.C0.ESC+"[20;"+(n+1)+"~":m.C0.ESC+"[20~";break;case 121:v.key=n?m.C0.ESC+"[21;"+(n+1)+"~":m.C0.ESC+"[21~";break;case 122:v.key=n?m.C0.ESC+"[23;"+(n+1)+"~":m.C0.ESC+"[23~";break;case 123:v.key=n?m.C0.ESC+"[24;"+(n+1)+"~":m.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!k||!h.altKey||h.metaKey)!S||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=m.C0.US),h.key==="@"&&(v.key=m.C0.NUL)):h.keyCode===65&&(v.type=1);else{const u=_[h.keyCode],o=u==null?void 0:u[h.shiftKey?1:0];if(o)v.key=m.C0.ESC+o;else if(h.keyCode>=65&&h.keyCode<=90){const l=h.ctrlKey?h.keyCode-64:h.keyCode+32;let w=String.fromCharCode(l);h.shiftKey&&(w=w.toUpperCase()),v.key=m.C0.ESC+w}else if(h.keyCode===32)v.key=m.C0.ESC+(h.ctrlKey?m.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let l=h.code.slice(3,4);h.shiftKey||(l=l.toLowerCase()),v.key=m.C0.ESC+l,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=m.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=m.C0.DEL:h.keyCode===219?v.key=m.C0.ESC:h.keyCode===220?v.key=m.C0.FS:h.keyCode===221&&(v.key=m.C0.GS)}return v}},482:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},i.utf32ToString=function(d,m=0,_=d.length){let h="";for(let y=m;y<_;++y){let S=d[y];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,m){const _=d.length;if(!_)return 0;let h=0,y=0;if(this._interim){const S=d.charCodeAt(y++);56320<=S&&S<=57343?m[h++]=1024*(this._interim-55296)+S-56320+65536:(m[h++]=this._interim,m[h++]=S),this._interim=0}for(let S=y;S<_;++S){const k=d.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=_)return this._interim=k,h;const v=d.charCodeAt(S);56320<=v&&v<=57343?m[h++]=1024*(k-55296)+v-56320+65536:(m[h++]=k,m[h++]=v)}else k!==65279&&(m[h++]=k)}return h}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,m){const _=d.length;if(!_)return 0;let h,y,S,k,v=0,n=0,u=0;if(this.interim[0]){let w=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let L,D=0;for(;(L=63&this.interim[++D])&&D<4;)E<<=6,E|=L;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=x-D;for(;u<P;){if(u>=_)return 0;if(L=d[u++],(192&L)!=128){u--,w=!0;break}this.interim[D++]=L,E<<=6,E|=63&L}w||(x===2?E<128?u--:m[v++]=E:x===3?E<2048||E>=55296&&E<=57343||E===65279||(m[v++]=E):E<65536||E>1114111||(m[v++]=E)),this.interim.fill(0)}const o=_-4;let l=u;for(;l<_;){for(;!(!(l<o)||128&(h=d[l])||128&(y=d[l+1])||128&(S=d[l+2])||128&(k=d[l+3]));)m[v++]=h,m[v++]=y,m[v++]=S,m[v++]=k,l+=4;if(h=d[l++],h<128)m[v++]=h;else if((224&h)==192){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(n=(31&h)<<6|63&y,n<128){l--;continue}m[v++]=n}else if((240&h)==224){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,v;if(S=d[l++],(192&S)!=128){l--;continue}if(n=(15&h)<<12|(63&y)<<6|63&S,n<2048||n>=55296&&n<=57343||n===65279)continue;m[v++]=n}else if((248&h)==240){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,v;if(S=d[l++],(192&S)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,this.interim[2]=S,v;if(k=d[l++],(192&k)!=128){l--;continue}if(n=(7&h)<<18|(63&y)<<12|(63&S)<<6|63&k,n<65536||n>1114111)continue;m[v++]=n}}return v}}},225:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const m=d(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]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;i.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let S=0;S<_.length;++S)y.fill(0,_[S][0],_[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?y[S]:(function(k,v){let n,u=0,o=v.length-1;if(k<v[0][0]||k>v[o][1])return!1;for(;o>=u;)if(n=u+o>>1,k>v[n][1])u=n+1;else{if(!(k<v[n][0]))return!0;o=n-1}return!1})(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,k){let v=this.wcwidth(S),n=v===0&&k!==0;if(n){const u=m.UnicodeService.extractWidth(k);u===0?n=!1:u>v&&(v=u)}return m.UnicodeService.createPropertyValue(0,v,n)}}},5981:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const m=d(8460),_=d(844);class h 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 m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,k){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(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k)}_innerWrite(S=0,k=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],u=this._action(n,k);if(u){const l=w=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,w))):this._innerWrite(v,w);return void u.catch((w=>(queueMicrotask((()=>{throw w})),Promise.resolve(!1)))).then(l)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=h},5941:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const d=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,m=/^[\da-f]+$/;function _(h,y){const S=h.toString(16),k=S.length<2?"0"+S:S;switch(y){case 4:return S[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}i.parseColor=function(h){if(!h)return;let y=h.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const S=d.exec(y);if(S){const k=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/k*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/k*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/k*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),m.exec(y)&&[3,6,9,12].includes(y.length))){const S=y.length/3,k=[0,0,0];for(let v=0;v<3;++v){const n=parseInt(y.slice(S*v,S*v+S),16);k[v]=S===1?n<<4:S===2?n:S===3?n>>4:n>>8}return k}},i.toRgbString=function(h,y=16){const[S,k,v]=h;return`rgb:${_(S,y)}/${_(k,y)}/${_(v,y)}`}},5770:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const m=d(482),_=d(8742),h=d(5770),y=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(k,v){this._handlers[k]===void 0&&(this._handlers[k]=[]);const n=this._handlers[k];return n.push(v),{dispose:()=>{const u=n.indexOf(v);u!==-1&&n.splice(u,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(k,v){if(this.reset(),this._ident=k,this._active=this._handlers[k]||y,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(k,v,n){if(this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].put(k,v,n);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(k,v,n))}unhook(k,v=!0){if(this._active.length){let n=!1,u=this._active.length-1,o=!1;if(this._stack.paused&&(u=this._stack.loopPosition-1,n=v,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;u>=0&&(n=this._active[u].unhook(k),n!==!0);u--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!1,n;u--}for(;u>=0;u--)if(n=this._active[u].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=u,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",k);this._active=y,this._ident=0}};const S=new _.Params;S.addParam(0),i.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=S,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():S,this._data="",this._hitLimit=!1}put(k,v,n){this._hitLimit||(this._data+=(0,m.utf32ToString)(k,v,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let v=!1;if(this._hitLimit)v=!1;else if(k&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((n=>(this._params=S,this._data="",this._hitLimit=!1,n)));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const m=d(844),_=d(8742),h=d(6242),y=d(6351);class S{constructor(u){this.table=new Uint8Array(u)}setDefault(u,o){this.table.fill(u<<4|o)}add(u,o,l,w){this.table[o<<8|u]=l<<4|w}addMany(u,o,l,w){for(let E=0;E<u.length;E++)this.table[o<<8|u[E]]=l<<4|w}}i.TransitionTable=S;const k=160;i.VT500_TRANSITION_TABLE=(function(){const n=new S(4095),u=Array.apply(null,Array(256)).map(((D,x)=>x)),o=(D,x)=>u.slice(D,x),l=o(32,127),w=o(0,24);w.push(25),w.push.apply(w,o(28,32));const E=o(0,14);let L;for(L in n.setDefault(1,0),n.addMany(l,0,2,0),E)n.addMany([24,26,153,154],L,3,0),n.addMany(o(128,144),L,3,0),n.addMany(o(144,152),L,3,0),n.add(156,L,0,0),n.add(27,L,11,1),n.add(157,L,4,8),n.addMany([152,158,159],L,0,7),n.add(155,L,11,3),n.add(144,L,11,9);return n.addMany(w,0,3,0),n.addMany(w,1,3,1),n.add(127,1,0,1),n.addMany(w,8,0,8),n.addMany(w,3,3,3),n.add(127,3,0,3),n.addMany(w,4,3,4),n.add(127,4,0,4),n.addMany(w,6,3,6),n.addMany(w,5,3,5),n.add(127,5,0,5),n.addMany(w,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(l,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(l,7,0,7),n.addMany(w,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(w,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(w,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(w,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(w,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(w,13,13,13),n.addMany(l,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(k,0,2,0),n.add(k,8,5,8),n.add(k,6,0,6),n.add(k,11,0,11),n.add(k,13,13,13),n})();class v extends m.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=(o,l,w)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,l)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,m.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(u,o=[64,126]){let l=0;if(u.prefix){if(u.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=u.prefix.charCodeAt(0),l&&60>l||l>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 E=0;E<u.intermediates.length;++E){const L=u.intermediates.charCodeAt(E);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=L}}if(u.final.length!==1)throw new Error("final must be a single byte");const w=u.final.charCodeAt(0);if(o[0]>w||w>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return l<<=8,l|=w,l}identToString(u){const o=[];for(;u;)o.push(String.fromCharCode(255&u)),u>>=8;return o.reverse().join("")}setPrintHandler(u){this._printHandler=u}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(u,o){const l=this._identifier(u,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const w=this._escHandlers[l];return w.push(o),{dispose:()=>{const E=w.indexOf(o);E!==-1&&w.splice(E,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,o){this._executeHandlers[u.charCodeAt(0)]=o}clearExecuteHandler(u){this._executeHandlers[u.charCodeAt(0)]&&delete this._executeHandlers[u.charCodeAt(0)]}setExecuteHandlerFallback(u){this._executeHandlerFb=u}registerCsiHandler(u,o){const l=this._identifier(u);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const w=this._csiHandlers[l];return w.push(o),{dispose:()=>{const E=w.indexOf(o);E!==-1&&w.splice(E,1)}}}clearCsiHandler(u){this._csiHandlers[this._identifier(u)]&&delete this._csiHandlers[this._identifier(u)]}setCsiHandlerFallback(u){this._csiHandlerFb=u}registerDcsHandler(u,o){return this._dcsParser.registerHandler(this._identifier(u),o)}clearDcsHandler(u){this._dcsParser.clearHandler(this._identifier(u))}setDcsHandlerFallback(u){this._dcsParser.setHandlerFallback(u)}registerOscHandler(u,o){return this._oscParser.registerHandler(u,o)}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,o,l,w,E){this._parseStack.state=u,this._parseStack.handlers=o,this._parseStack.handlerPos=l,this._parseStack.transition=w,this._parseStack.chunkPos=E}parse(u,o,l){let w,E=0,L=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&P>-1){for(;P>=0&&(w=x[P](this._params),w!==!0);P--)if(w instanceof Promise)return this._parseStack.handlerPos=P,w}this._parseStack.handlers=[];break;case 4:if(l===!1&&P>-1){for(;P>=0&&(w=x[P](),w!==!0);P--)if(w instanceof Promise)return this._parseStack.handlerPos=P,w}this._parseStack.handlers=[];break;case 6:if(E=u[this._parseStack.chunkPos],w=this._dcsParser.unhook(E!==24&&E!==26,l),w)return w;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=u[this._parseStack.chunkPos],w=this._oscParser.end(E!==24&&E!==26,l),w)return w;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=D;x<o;++x){switch(E=u[x],L=this._transitions.table[this.currentState<<8|(E<160?E:k)],L>>4){case 2:for(let I=x+1;;++I){if(I>=o||(E=u[I])<32||E>126&&E<k){this._printHandler(u,x,I),x=I-1;break}if(++I>=o||(E=u[I])<32||E>126&&E<k){this._printHandler(u,x,I),x=I-1;break}if(++I>=o||(E=u[I])<32||E>126&&E<k){this._printHandler(u,x,I),x=I-1;break}if(++I>=o||(E=u[I])<32||E>126&&E<k){this._printHandler(u,x,I),x=I-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const P=this._csiHandlers[this._collect<<8|E];let H=P?P.length-1:-1;for(;H>=0&&(w=P[H](this._params),w!==!0);H--)if(w instanceof Promise)return this._preserveStack(3,P,H,L,x),w;H<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++x<o&&(E=u[x])>47&&E<60);x--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const $=this._escHandlers[this._collect<<8|E];let W=$?$.length-1:-1;for(;W>=0&&(w=$[W](),w!==!0);W--)if(w instanceof Promise)return this._preserveStack(4,$,W,L,x),w;W<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let I=x+1;;++I)if(I>=o||(E=u[I])===24||E===26||E===27||E>127&&E<k){this._dcsParser.put(u,x,I),x=I-1;break}break;case 14:if(w=this._dcsParser.unhook(E!==24&&E!==26),w)return this._preserveStack(6,[],0,L,x),w;E===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=x+1;;I++)if(I>=o||(E=u[I])<32||E>127&&E<k){this._oscParser.put(u,x,I),x=I-1;break}break;case 6:if(w=this._oscParser.end(E!==24&&E!==26),w)return this._preserveStack(5,[],0,L,x),w;E===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}i.EscapeSequenceParser=v},6242:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const m=d(5770),_=d(482),h=[];i.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,S){this._handlers[y]===void 0&&(this._handlers[y]=[]);const k=this._handlers[y];return k.push(S),{dispose:()=>{const v=k.indexOf(S);v!==-1&&k.splice(v,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,S,k){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(y,S,k);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(y,S,k))}start(){this.reset(),this._state=1}put(y,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const v=y[S++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&k-S>0&&this._put(y,S,k)}}end(y,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,v=this._active.length-1,n=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,k=S,n=this._stack.fallThrough,this._stack.paused=!1),!n&&k===!1){for(;v>=0&&(k=this._active[v].end(y),k!==!0);v--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,k;v--}for(;v>=0;v--)if(k=this._active[v].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",y);this._active=h,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,S,k){this._hitLimit||(this._data+=(0,_.utf32ToString)(y,S,k),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let S=!1;if(this._hitLimit)S=!1;else if(y&&(S=this._handler(this._data),S instanceof Promise))return S.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,S}}},8742:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const d=2147483647;class m{static fromArray(h){const y=new m;if(!h.length)return y;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const k=h[S];if(Array.isArray(k))for(let v=0;v<k.length;++v)y.addSubParam(k[v]);else y.addParam(k)}return y}constructor(h=32,y=32){if(this.maxLength=h,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new m(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let y=0;y<this.length;++y){h.push(this.params[y]);const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,k))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>d?d:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>d?d:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const y=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-y>0?this._subParams.subarray(y,S):null}getSubParamsAll(){const h={};for(let y=0;y<this.length;++y){const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&(h[y]=this._subParams.slice(S,k))}return h}addDigit(h){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[y-1];S[y-1]=~k?Math.min(10*k+h,d):h}}i.Params=m},5741:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,m){const _={instance:m,dispose:m.dispose,isDisposed:!1};this._addons.push(_),m.dispose=()=>this._wrappedAddonDispose(_),m.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let m=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===d){m=_;break}if(m===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(m,1)}}},8771:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const m=d(3785),_=d(511);i.BufferApiView=class{constructor(h,y){this._buffer=h,this.type=y}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const y=this._buffer.lines.get(h);if(y)return new m.BufferLineApiView(y)}getNullCell(){return new _.CellData}}},3785:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const m=d(511);i.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new m.CellData)}translateToString(_,h,y){return this._line.translateToString(_,h,y)}}},8285:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const m=d(8771),_=d(8460),h=d(844);class y extends h.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.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=y},7975:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,m){return this._core.registerCsiHandler(d,(_=>m(_.toArray())))}addCsiHandler(d,m){return this.registerCsiHandler(d,m)}registerDcsHandler(d,m){return this._core.registerDcsHandler(d,((_,h)=>m(_,h.toArray())))}addDcsHandler(d,m){return this.registerDcsHandler(d,m)}registerEscHandler(d,m){return this._core.registerEscHandler(d,m)}addEscHandler(d,m){return this.registerEscHandler(d,m)}registerOscHandler(d,m){return this._core.registerOscHandler(d,m)}addOscHandler(d,m){return this.registerOscHandler(d,m)}}},7090:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(R,i,d){var m=this&&this.__decorate||function(n,u,o,l){var w,E=arguments.length,L=E<3?u:l===null?l=Object.getOwnPropertyDescriptor(u,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(n,u,o,l);else for(var D=n.length-1;D>=0;D--)(w=n[D])&&(L=(E<3?w(L):E>3?w(u,o,L):w(u,o))||L);return E>3&&L&&Object.defineProperty(u,o,L),L},_=this&&this.__param||function(n,u){return function(o,l){u(o,l,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const h=d(8460),y=d(844),S=d(5295),k=d(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let v=i.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(n,this))}resize(n,u){this.cols=n,this.rows=u,this.buffers.resize(n,u),this._onResize.fire({cols:n,rows:u})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,u=!1){const o=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===n.fg&&l.getBg(0)===n.bg||(l=o.getBlankLine(n,u),this._cachedBlankLine=l),l.isWrapped=u;const w=o.ybase+o.scrollTop,E=o.ybase+o.scrollBottom;if(o.scrollTop===0){const L=o.lines.isFull;E===o.lines.length-1?L?o.lines.recycle().copyFrom(l):o.lines.push(l.clone()):o.lines.splice(E+1,0,l.clone()),L?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const L=E-w+1;o.lines.shiftElements(w+1,L-1,-1),o.lines.set(E,l.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,u,o){const l=this.buffer;if(n<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else n+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const w=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+n,l.ybase),0),w!==l.ydisp&&(u||this._onScroll.fire(l.ydisp))}};i.BufferService=v=m([_(0,k.IOptionsService)],v)},7994:(R,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(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,m){this._charsets[d]=m,this.glevel===d&&(this.charset=m)}}},1753:function(R,i,d){var m=this&&this.__decorate||function(l,w,E,L){var D,x=arguments.length,P=x<3?w:L===null?L=Object.getOwnPropertyDescriptor(w,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,w,E,L);else for(var H=l.length-1;H>=0;H--)(D=l[H])&&(P=(x<3?D(P):x>3?D(w,E,P):D(w,E))||P);return x>3&&P&&Object.defineProperty(w,E,P),P},_=this&&this.__param||function(l,w){return function(E,L){w(E,L,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const h=d(2585),y=d(8460),S=d(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function v(l,w){let E=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(E|=64,E|=l.action):(E|=3&l.button,4&l.button&&(E|=64),8&l.button&&(E|=128),l.action===32?E|=32:l.action!==0||w||(E|=3)),E}const n=String.fromCharCode,u={DEFAULT:l=>{const w=[v(l,!1)+32,l.col+32,l.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${n(w[0])}${n(w[1])}${n(w[2])}`},SGR:l=>{const w=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.col};${l.row}${w}`},SGR_PIXELS:l=>{const w=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.x};${l.y}${w}`}};let o=i.CoreMouseService=class extends S.Disposable{constructor(l,w){super(),this._bufferService=l,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(k))this.addProtocol(E,k[E]);for(const E of Object.keys(u))this.addEncoding(E,u[E]);this.reset()}addProtocol(l,w){this._protocols[l]=w}addEncoding(l,w){this._encodings[l]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const w=this._encodings[this._activeEncoding](l);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,w,E){if(E){if(l.x!==w.x||l.y!==w.y)return!1}else if(l.col!==w.col||l.row!==w.row)return!1;return l.button===w.button&&l.action===w.action&&l.ctrl===w.ctrl&&l.alt===w.alt&&l.shift===w.shift}};i.CoreMouseService=o=m([_(0,h.IBufferService),_(1,h.ICoreService)],o)},6975:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,E){var L,D=arguments.length,x=D<3?l:E===null?E=Object.getOwnPropertyDescriptor(l,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,E);else for(var P=o.length-1;P>=0;P--)(L=o[P])&&(x=(D<3?L(x):D>3?L(l,w,x):L(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,E){l(w,E,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const h=d(1439),y=d(8460),S=d(844),k=d(2585),v=Object.freeze({insertMode:!1}),n=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(o,l,w){super(),this._bufferService=o,this._logService=l,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(o,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((E=>E.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(o))}};i.CoreService=u=m([_(0,k.IBufferService),_(1,k.ILogService),_(2,k.IOptionsService)],u)},9074:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const m=d(8055),_=d(8460),h=d(844),y=d(6106);let S=0,k=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((o=>o==null?void 0:o.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,h.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const l=new n(o);if(l){const w=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),w.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,l,w){let E=0,L=0;for(const D of this._decorations.getKeyIterator(l))E=D.options.x??0,L=E+(D.options.width??1),o>=E&&o<L&&(!w||(D.options.layer??"bottom")===w)&&(yield D)}forEachDecorationAtCell(o,l,w,E){this._decorations.forEachByKey(l,(L=>{S=L.options.x??0,k=S+(L.options.width??1),o>=S&&o<k&&(!w||(L.options.layer??"bottom")===w)&&E(L)}))}}i.DecorationService=v;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=m.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=m.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,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=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const m=d(2585),_=d(8343);class h{constructor(...S){this._entries=new Map;for(const[k,v]of S)this.set(k,v)}set(S,k){const v=this._entries.get(S);return this._entries.set(S,k),v}forEach(S){for(const[k,v]of this._entries.entries())S(k,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}i.ServiceCollection=h,i.InstantiationService=class{constructor(){this._services=new h,this._services.set(m.IInstantiationService,this)}setService(y,S){this._services.set(y,S)}getService(y){return this._services.get(y)}createInstance(y,...S){const k=(0,_.getServiceDependencies)(y).sort(((u,o)=>u.index-o.index)),v=[];for(const u of k){const o=this._services.get(u.id);if(!o)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${u.id}.`);v.push(o)}const n=k.length>0?k[0].index:S.length;if(S.length!==n)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${n+1} conflicts with ${S.length} static arguments`);return new y(...S,...v)}}},7866:function(R,i,d){var m=this&&this.__decorate||function(n,u,o,l){var w,E=arguments.length,L=E<3?u:l===null?l=Object.getOwnPropertyDescriptor(u,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(n,u,o,l);else for(var D=n.length-1;D>=0;D--)(w=n[D])&&(L=(E<3?w(L):E>3?w(u,o,L):w(u,o))||L);return E>3&&L&&Object.defineProperty(u,o,L),L},_=this&&this.__param||function(n,u){return function(o,l){u(o,l,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const h=d(844),y=d(2585),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let k,v=i.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let u=0;u<n.length;u++)typeof n[u]=="function"&&(n[u]=n[u]())}_log(n,u,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+u,...o)}trace(n,...u){var o;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,u)}debug(n,...u){var o;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,u)}info(n,...u){var o;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,u)}warn(n,...u){var o;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,u)}error(n,...u){var o;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,u)}};i.LogService=v=m([_(0,y.IOptionsService)],v),i.setTraceLogger=function(n){k=n},i.traceCall=function(n,u,o){if(typeof o.value!="function")throw new Error("not supported");const l=o.value;o.value=function(...w){if(k.logLevel!==y.LogLevelEnum.TRACE)return l.apply(this,w);k.trace(`GlyphRenderer#${l.name}(${w.map((L=>JSON.stringify(L))).join(", ")})`);const E=l.apply(this,w);return k.trace(`GlyphRenderer#${l.name} return`,E),E}}},7302:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const m=d(8460),_=d(844),h=d(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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends _.Disposable{constructor(v){super(),this._onOptionChange=this.register(new m.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...i.DEFAULT_OPTIONS};for(const u in v)if(u in n)try{const o=v[u];n[u]=this._sanitizeAndValidateOption(u,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,n){return this.onOptionChange((u=>{u===v&&n(this.rawOptions[v])}))}onMultipleOptionChange(v,n){return this.onOptionChange((u=>{v.indexOf(u)!==-1&&n()}))}_setupOptions(){const v=u=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);return this.rawOptions[u]},n=(u,o)=>{if(!(u in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${u}"`);o=this._sanitizeAndValidateOption(u,o),this.rawOptions[u]!==o&&(this.rawOptions[u]=o,this._onOptionChange.fire(u))};for(const u in this.rawOptions){const o={get:v.bind(this,u),set:n.bind(this,u)};Object.defineProperty(this.options,u,o)}}_sanitizeAndValidateOption(v,n){switch(v){case"cursorStyle":if(n||(n=i.DEFAULT_OPTIONS[v]),!(function(u){return u==="block"||u==="underline"||u==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${v}`);break;case"wordSeparator":n||(n=i.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=y.includes(n)?n:i.DEFAULT_OPTIONS[v];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${v} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${v} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}i.OptionsService=S},2660:function(R,i,d){var m=this&&this.__decorate||function(S,k,v,n){var u,o=arguments.length,l=o<3?k:n===null?n=Object.getOwnPropertyDescriptor(k,v):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,k,v,n);else for(var w=S.length-1;w>=0;w--)(u=S[w])&&(l=(o<3?u(l):o>3?u(k,v,l):u(k,v))||l);return o>3&&l&&Object.defineProperty(k,v,l),l},_=this&&this.__param||function(S,k){return function(v,n){k(v,n,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const h=d(2585);let y=i.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const k=this._bufferService.buffer;if(S.id===void 0){const w=k.addMarker(k.ybase+k.y),E={data:S,id:this._nextId++,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(E,w))),this._dataByLinkId.set(E.id,E),E.id}const v=S,n=this._getEntryIdKey(v),u=this._entriesWithId.get(n);if(u)return this.addLineToLink(u.id,k.ybase+k.y),u.id;const o=k.addMarker(k.ybase+k.y),l={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(l,o))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,k){const v=this._dataByLinkId.get(S);if(v&&v.lines.every((n=>n.line!==k))){const n=this._bufferService.buffer.addMarker(k);v.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(v,n)))}}getLinkData(S){var k;return(k=this._dataByLinkId.get(S))==null?void 0:k.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,k){const v=S.lines.indexOf(k);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};i.OscLinkService=y=m([_(0,h.IBufferService)],y)},8343:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const d="di$target",m="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(_){return _[m]||[]},i.createDecorator=function(_){if(i.serviceRegistry.has(_))return i.serviceRegistry.get(_);const h=function(y,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,n,u){n[d]===n?n[m].push({id:v,index:u}):(n[m]=[{id:v,index:u}],n[d]=n)})(h,y,k)};return h.toString=()=>_,i.serviceRegistry.set(_,h),h}},2585:(R,i,d)=>{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 m=d(8343);var _;i.IBufferService=(0,m.createDecorator)("BufferService"),i.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),i.ICoreService=(0,m.createDecorator)("CoreService"),i.ICharsetService=(0,m.createDecorator)("CharsetService"),i.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(_||(i.LogLevelEnum=_={})),i.ILogService=(0,m.createDecorator)("LogService"),i.IOptionsService=(0,m.createDecorator)("OptionsService"),i.IOscLinkService=(0,m.createDecorator)("OscLinkService"),i.IUnicodeService=(0,m.createDecorator)("UnicodeService"),i.IDecorationService=(0,m.createDecorator)("DecorationService")},1480:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const m=d(8460),_=d(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,k,v=!1){return(16777215&S)<<3|(3&k)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new m.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 k=0,v=0;const n=S.length;for(let u=0;u<n;++u){let o=S.charCodeAt(u);if(55296<=o&&o<=56319){if(++u>=n)return k+this.wcwidth(o);const E=S.charCodeAt(u);56320<=E&&E<=57343?o=1024*(o-55296)+E-56320+65536:k+=this.wcwidth(E)}const l=this.charProperties(o,v);let w=h.extractWidth(l);h.extractShouldJoin(l)&&(w-=h.extractWidth(v)),k+=w,v=l}return k}charProperties(S,k){return this._activeProvider.charProperties(S,k)}}i.UnicodeService=h}},C={};function j(R){var i=C[R];if(i!==void 0)return i.exports;var d=C[R]={exports:{}};return f[R].call(d.exports,d,d.exports,j),d.exports}var M={};return(()=>{var R=M;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const i=j(9042),d=j(3236),m=j(844),_=j(5741),h=j(8285),y=j(7975),S=j(7090),k=["cols","rows"];class v extends m.Disposable{constructor(u){super(),this._core=this.register(new d.Terminal(u)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const o=w=>this._core.options[w],l=(w,E)=>{this._checkReadonlyOptions(w),this._core.options[w]=E};for(const w in this._core.options){const E={get:o.bind(this,w),set:l.bind(this,w)};Object.defineProperty(this._publicOptions,w,E)}}_checkReadonlyOptions(u){if(k.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 y.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const u=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:u.applicationCursorKeys,applicationKeypadMode:u.applicationKeypad,bracketedPasteMode:u.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:u.origin,reverseWraparoundMode:u.reverseWraparound,sendFocusMode:u.sendFocus,wraparoundMode:u.wraparound}}get options(){return this._publicOptions}set options(u){for(const o in u)this._publicOptions[o]=u[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(u,o=!0){this._core.input(u,o)}resize(u,o){this._verifyIntegers(u,o),this._core.resize(u,o)}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,o,l){this._verifyIntegers(u,o,l),this._core.select(u,o,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(u,o){this._verifyIntegers(u,o),this._core.selectLines(u,o)}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,o){this._core.write(u,o)}writeln(u,o){this._core.write(u),this._core.write(`\r
|
|
50
|
-
`,o)}paste(
|
|
48
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(x){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&x&&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(x){const P=this._getMouseBufferCoords(x),H=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!!(H&&$&&P)&&this._areCoordsInSelection(P,H,$)}isCellInSelection(x,P){const H=this._model.finalSelectionStart,$=this._model.finalSelectionEnd;return!(!H||!$)&&this._areCoordsInSelection([x,P],H,$)}_areCoordsInSelection(x,P,H){return x[1]>P[1]&&x[1]<H[1]||P[1]===H[1]&&x[1]===P[1]&&x[0]>=P[0]&&x[0]<H[0]||P[1]<H[1]&&x[1]===H[1]&&x[0]<H[0]||P[1]<H[1]&&x[1]===P[1]&&x[0]>=P[0]}_selectWordAtCursor(x,P){var W,I;const H=(I=(W=this._linkifier.currentLink)==null?void 0:W.link)==null?void 0:I.range;if(H)return this._model.selectionStart=[H.start.x-1,H.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const $=this._getMouseBufferCoords(x);return!!$&&(this._selectWordAt($,P),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(x,P){this._model.clearSelection(),x=Math.max(x,0),P=Math.min(P,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,x],this._model.selectionEnd=[this._bufferService.cols,P],this.refresh(),this._onSelectionChange.fire()}_handleTrim(x){this._model.handleTrim(x)&&this.refresh()}_getMouseBufferCoords(x){const P=this._mouseService.getCoords(x,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(P)return P[0]--,P[1]--,P[1]+=this._bufferService.buffer.ydisp,P}_getMouseEventScrollAmount(x){let P=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,x,this._screenElement)[1];const H=this._renderService.dimensions.css.canvas.height;return P>=0&&P<=H?0:(P>H&&(P-=H),P=Math.min(Math.max(P,-50),50),P/=50,P/Math.abs(P)+Math.round(14*P))}shouldForceSelection(x){return c.isMac?x.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:x.shiftKey}handleMouseDown(x){if(this._mouseDownTimeStamp=x.timeStamp,(x.button!==2||!this.hasSelection)&&x.button===0){if(!this._enabled){if(!this.shouldForceSelection(x))return;x.stopPropagation()}x.preventDefault(),this._dragScrollAmount=0,this._enabled&&x.shiftKey?this._handleIncrementalClick(x):x.detail===1?this._handleSingleClick(x):x.detail===2?this._handleDoubleClick(x):x.detail===3&&this._handleTripleClick(x),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(x){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(x))}_handleSingleClick(x){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(x)?3:0,this._model.selectionStart=this._getMouseBufferCoords(x),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const P=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);P&&P.length!==this._model.selectionStart[0]&&P.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(x){this._selectWordAtCursor(x,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(x){const P=this._getMouseBufferCoords(x);P&&(this._activeSelectionMode=2,this._selectLineAt(P[1]))}shouldColumnSelect(x){return x.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(x){if(x.stopImmediatePropagation(),!this._model.selectionStart)return;const P=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(x),!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(x),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const H=this._bufferService.buffer;if(this._model.selectionEnd[1]<H.lines.length){const $=H.lines.get(this._model.selectionEnd[1]);$&&$.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}P&&P[0]===this._model.selectionEnd[0]&&P[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 x=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(x.ydisp+this._bufferService.rows,x.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=x.ydisp),this.refresh()}}_handleMouseUp(x){const P=x.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&P<500&&x.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const H=this._mouseService.getCoords(x,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(H&&H[0]!==void 0&&H[1]!==void 0){const $=(0,y.moveToCellSequence)(H[0]-1,H[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent($,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const x=this._model.finalSelectionStart,P=this._model.finalSelectionEnd,H=!(!x||!P||x[0]===P[0]&&x[1]===P[1]);H?x&&P&&(this._oldSelectionStart&&this._oldSelectionEnd&&x[0]===this._oldSelectionStart[0]&&x[1]===this._oldSelectionStart[1]&&P[0]===this._oldSelectionEnd[0]&&P[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(x,P,H)):this._oldHasSelection&&this._fireOnSelectionChange(x,P,H)}_fireOnSelectionChange(x,P,H){this._oldSelectionStart=x,this._oldSelectionEnd=P,this._oldHasSelection=H,this._onSelectionChange.fire()}_handleBufferActivate(x){this.clearSelection(),this._trimListener.dispose(),this._trimListener=x.activeBuffer.lines.onTrim((P=>this._handleTrim(P)))}_convertViewportColToCharacterIndex(x,P){let H=P;for(let $=0;P>=$;$++){const W=x.loadCell($,this._workCell).getChars().length;this._workCell.getWidth()===0?H--:W>1&&P!==$&&(H+=W-1)}return H}setSelection(x,P,H){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[x,P],this._model.selectionStartLength=H,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(x){this._isClickInSelection(x)||(this._selectWordAtCursor(x,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(x,P,H=!0,$=!0){if(x[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(x[1]);if(!I)return;const X=W.translateBufferLineToString(x[1],!1);let q=this._convertViewportColToCharacterIndex(I,x[0]),z=q;const re=x[0]-q;let Q=0,A=0,B=0,T=0;if(X.charAt(q)===" "){for(;q>0&&X.charAt(q-1)===" ";)q--;for(;z<X.length&&X.charAt(z+1)===" ";)z++}else{let ne=x[0],ce=x[0];I.getWidth(ne)===0&&(Q++,ne--),I.getWidth(ce)===2&&(A++,ce++);const de=I.getString(ce).length;for(de>1&&(T+=de-1,z+=de-1);ne>0&&q>0&&!this._isCharWordSeparator(I.loadCell(ne-1,this._workCell));){I.loadCell(ne-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(Q++,ne--):G>1&&(B+=G-1,q-=G-1),q--,ne--}for(;ce<I.length&&z+1<X.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,ce++):G>1&&(T+=G-1,z+=G-1),z++,ce++}}z++;let F=q+re-Q+B,ee=Math.min(this._bufferService.cols,z-q+Q+A-B-T);if(P||X.slice(q,z).trim()!==""){if(H&&F===0&&I.getCodePoint(0)!==32){const ne=W.lines.get(x[1]-1);if(ne&&I.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,x[1]-1],!1,!0,!1);if(ce){const de=this._bufferService.cols-ce.start;F-=de,ee+=de}}}if($&&F+ee===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ne=W.lines.get(x[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ce=this._getWordAt([0,x[1]+1],!1,!1,!0);ce&&(ee+=ce.length)}}return{start:F,length:ee}}}_selectWordAt(x,P){const H=this._getWordAt(x,P);if(H){for(;H.start<0;)H.start+=this._bufferService.cols,x[1]--;this._model.selectionStart=[H.start,x[1]],this._model.selectionStartLength=H.length}}_selectToWordAt(x){const P=this._getWordAt(x,!0);if(P){let H=x[1];for(;P.start<0;)P.start+=this._bufferService.cols,H--;if(!this._model.areSelectionValuesReversed())for(;P.start+P.length>this._bufferService.cols;)P.length-=this._bufferService.cols,H++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?P.start:P.start+P.length,H]}}_isCharWordSeparator(x){return x.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(x.getChars())>=0}_selectLineAt(x){const P=this._bufferService.buffer.getWrappedRangeForLine(x),H={start:{x:0,y:P.first},end:{x:this._bufferService.cols-1,y:P.last}};this._model.selectionStart=[0,P.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(H,this._bufferService.cols)}};i.SelectionService=D=m([_(3,w.IBufferService),_(4,w.ICoreService),_(5,k.IMouseService),_(6,w.IOptionsService),_(7,k.IRenderService),_(8,k.ICoreBrowserService)],D)},4725:(R,i,d)=>{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 m=d(8343);i.ICharSizeService=(0,m.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,m.createDecorator)("CoreBrowserService"),i.IMouseService=(0,m.createDecorator)("MouseService"),i.IRenderService=(0,m.createDecorator)("RenderService"),i.ISelectionService=(0,m.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,m.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,m.createDecorator)("ThemeService"),i.ILinkProviderService=(0,m.createDecorator)("LinkProviderService")},6731:function(R,i,d){var m=this&&this.__decorate||function(D,x,P,H){var $,W=arguments.length,I=W<3?x:H===null?H=Object.getOwnPropertyDescriptor(x,P):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(D,x,P,H);else for(var X=D.length-1;X>=0;X--)($=D[X])&&(I=(W<3?$(I):W>3?$(x,P,I):$(x,P))||I);return W>3&&I&&Object.defineProperty(x,P,I),I},_=this&&this.__param||function(D,x){return function(P,H){x(P,H,D)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const h=d(7239),y=d(8055),S=d(8460),k=d(844),v=d(2585),n=y.css.toColor("#ffffff"),c=y.css.toColor("#000000"),o=y.css.toColor("#ffffff"),l=y.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],x=[0,95,135,175,215,255];for(let P=0;P<216;P++){const H=x[P/36%6|0],$=x[P/6%6|0],W=x[P%6];D.push({css:y.channels.toCss(H,$,W),rgba:y.channels.toRgba(H,$,W)})}for(let P=0;P<24;P++){const H=8+10*P;D.push({css:y.channels.toCss(H,H,H),rgba:y.channels.toRgba(H,H,H)})}return D})());let L=i.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:c,cursor:o,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:y.color.blend(c,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:y.color.blend(c,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(D={}){const x=this._colors;if(x.foreground=E(D.foreground,n),x.background=E(D.background,c),x.cursor=E(D.cursor,o),x.cursorAccent=E(D.cursorAccent,l),x.selectionBackgroundTransparent=E(D.selectionBackground,w),x.selectionBackgroundOpaque=y.color.blend(x.background,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundTransparent=E(D.selectionInactiveBackground,x.selectionBackgroundTransparent),x.selectionInactiveBackgroundOpaque=y.color.blend(x.background,x.selectionInactiveBackgroundTransparent),x.selectionForeground=D.selectionForeground?E(D.selectionForeground,y.NULL_COLOR):void 0,x.selectionForeground===y.NULL_COLOR&&(x.selectionForeground=void 0),y.color.isOpaque(x.selectionBackgroundTransparent)&&(x.selectionBackgroundTransparent=y.color.opacity(x.selectionBackgroundTransparent,.3)),y.color.isOpaque(x.selectionInactiveBackgroundTransparent)&&(x.selectionInactiveBackgroundTransparent=y.color.opacity(x.selectionInactiveBackgroundTransparent,.3)),x.ansi=i.DEFAULT_ANSI_COLORS.slice(),x.ansi[0]=E(D.black,i.DEFAULT_ANSI_COLORS[0]),x.ansi[1]=E(D.red,i.DEFAULT_ANSI_COLORS[1]),x.ansi[2]=E(D.green,i.DEFAULT_ANSI_COLORS[2]),x.ansi[3]=E(D.yellow,i.DEFAULT_ANSI_COLORS[3]),x.ansi[4]=E(D.blue,i.DEFAULT_ANSI_COLORS[4]),x.ansi[5]=E(D.magenta,i.DEFAULT_ANSI_COLORS[5]),x.ansi[6]=E(D.cyan,i.DEFAULT_ANSI_COLORS[6]),x.ansi[7]=E(D.white,i.DEFAULT_ANSI_COLORS[7]),x.ansi[8]=E(D.brightBlack,i.DEFAULT_ANSI_COLORS[8]),x.ansi[9]=E(D.brightRed,i.DEFAULT_ANSI_COLORS[9]),x.ansi[10]=E(D.brightGreen,i.DEFAULT_ANSI_COLORS[10]),x.ansi[11]=E(D.brightYellow,i.DEFAULT_ANSI_COLORS[11]),x.ansi[12]=E(D.brightBlue,i.DEFAULT_ANSI_COLORS[12]),x.ansi[13]=E(D.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),x.ansi[14]=E(D.brightCyan,i.DEFAULT_ANSI_COLORS[14]),x.ansi[15]=E(D.brightWhite,i.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const P=Math.min(x.ansi.length-16,D.extendedAnsi.length);for(let H=0;H<P;H++)x.ansi[H+16]=E(D.extendedAnsi[H],i.DEFAULT_ANSI_COLORS[H+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let x=0;x<this._restoreColors.ansi.length;++x)this._colors.ansi[x]=this._restoreColors.ansi[x]}modifyColors(D){D(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 E(D,x){if(D!==void 0)try{return y.css.toColor(D)}catch{}return x}i.ThemeService=L=m([_(0,v.IOptionsService)],L)},6349:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const m=d(8460),_=d(844);class h extends _.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new m.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new m.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new m.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 k=new Array(S);for(let v=0;v<Math.min(S,this.length);v++)k[v]=this._array[this._getCyclicIndex(v)];this._array=k,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let k=this._length;k<S;k++)this._array[k]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,k){this._array[this._getCyclicIndex(S)]=k}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,k,...v){if(k){for(let n=S;n<this._length-k;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+k)];this._length-=k,this.onDeleteEmitter.fire({index:S,amount:k})}for(let n=this._length-1;n>=S;n--)this._array[this._getCyclicIndex(n+v.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<v.length;n++)this._array[this._getCyclicIndex(S+n)]=v[n];if(v.length&&this.onInsertEmitter.fire({index:S,amount:v.length}),this._length+v.length>this._maxLength){const n=this._length+v.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=v.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,k,v){if(!(k<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let c=k-1;c>=0;c--)this.set(S+c+v,this.get(S+c));const n=S+k+v-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<k;n++)this.set(S+n+v,this.get(S+n))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}i.CircularList=h},1439:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function d(m,_=5){if(typeof m!="object")return m;const h=Array.isArray(m)?[]:{};for(const y in m)h[y]=_<=1?m[y]:m[y]&&d(m[y],_-1);return h}},8055:(R,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 d=0,m=0,_=0,h=0;var y,S,k,v,n;function c(l){const w=l.toString(16);return w.length<2?"0"+w:w}function o(l,w){return l<w?(w+.05)/(l+.05):(l+.05)/(w+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(w,L,E,D){return D!==void 0?`#${c(w)}${c(L)}${c(E)}${c(D)}`:`#${c(w)}${c(L)}${c(E)}`},l.toRgba=function(w,L,E,D=255){return(w<<24|L<<16|E<<8|D)>>>0},l.toColor=function(w,L,E,D){return{css:l.toCss(w,L,E,D),rgba:l.toRgba(w,L,E,D)}}})(y||(i.channels=y={})),(function(l){function w(L,E){return h=Math.round(255*E),[d,m,_]=n.toChannels(L.rgba),{css:y.toCss(d,m,_,h),rgba:y.toRgba(d,m,_,h)}}l.blend=function(L,E){if(h=(255&E.rgba)/255,h===1)return{css:E.css,rgba:E.rgba};const D=E.rgba>>24&255,x=E.rgba>>16&255,P=E.rgba>>8&255,H=L.rgba>>24&255,$=L.rgba>>16&255,W=L.rgba>>8&255;return d=H+Math.round((D-H)*h),m=$+Math.round((x-$)*h),_=W+Math.round((P-W)*h),{css:y.toCss(d,m,_),rgba:y.toRgba(d,m,_)}},l.isOpaque=function(L){return(255&L.rgba)==255},l.ensureContrastRatio=function(L,E,D){const x=n.ensureContrastRatio(L.rgba,E.rgba,D);if(x)return y.toColor(x>>24&255,x>>16&255,x>>8&255)},l.opaque=function(L){const E=(255|L.rgba)>>>0;return[d,m,_]=n.toChannels(E),{css:y.toCss(d,m,_),rgba:E}},l.opacity=w,l.multiplyOpacity=function(L,E){return h=255&L.rgba,w(L,h*E/255)},l.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(S||(i.color=S={})),(function(l){let w,L;try{const E=document.createElement("canvas");E.width=1,E.height=1;const D=E.getContext("2d",{willReadFrequently:!0});D&&(w=D,w.globalCompositeOperation="copy",L=w.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return d=parseInt(E.slice(1,2).repeat(2),16),m=parseInt(E.slice(2,3).repeat(2),16),_=parseInt(E.slice(3,4).repeat(2),16),y.toColor(d,m,_);case 5:return d=parseInt(E.slice(1,2).repeat(2),16),m=parseInt(E.slice(2,3).repeat(2),16),_=parseInt(E.slice(3,4).repeat(2),16),h=parseInt(E.slice(4,5).repeat(2),16),y.toColor(d,m,_,h);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const D=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return d=parseInt(D[1]),m=parseInt(D[2]),_=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),y.toColor(d,m,_,h);if(!w||!L)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=L,w.fillStyle=E,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[d,m,_,h]=w.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(d,m,_,h),css:E}}})(k||(i.css=k={})),(function(l){function w(L,E,D){const x=L/255,P=E/255,H=D/255;return .2126*(x<=.03928?x/12.92:Math.pow((x+.055)/1.055,2.4))+.7152*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))+.0722*(H<=.03928?H/12.92:Math.pow((H+.055)/1.055,2.4))}l.relativeLuminance=function(L){return w(L>>16&255,L>>8&255,255&L)},l.relativeLuminance2=w})(v||(i.rgb=v={})),(function(l){function w(E,D,x){const P=E>>24&255,H=E>>16&255,$=E>>8&255;let W=D>>24&255,I=D>>16&255,X=D>>8&255,q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));for(;q<x&&(W>0||I>0||X>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),X-=Math.max(0,Math.ceil(.1*X)),q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));return(W<<24|I<<16|X<<8|255)>>>0}function L(E,D,x){const P=E>>24&255,H=E>>16&255,$=E>>8&255;let W=D>>24&255,I=D>>16&255,X=D>>8&255,q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));for(;q<x&&(W<255||I<255||X<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),X=Math.min(255,X+Math.ceil(.1*(255-X))),q=o(v.relativeLuminance2(W,I,X),v.relativeLuminance2(P,H,$));return(W<<24|I<<16|X<<8|255)>>>0}l.blend=function(E,D){if(h=(255&D)/255,h===1)return D;const x=D>>24&255,P=D>>16&255,H=D>>8&255,$=E>>24&255,W=E>>16&255,I=E>>8&255;return d=$+Math.round((x-$)*h),m=W+Math.round((P-W)*h),_=I+Math.round((H-I)*h),y.toRgba(d,m,_)},l.ensureContrastRatio=function(E,D,x){const P=v.relativeLuminance(E>>8),H=v.relativeLuminance(D>>8);if(o(P,H)<x){if(H<P){const I=w(E,D,x),X=o(P,v.relativeLuminance(I>>8));if(X<x){const q=L(E,D,x);return X>o(P,v.relativeLuminance(q>>8))?I:q}return I}const $=L(E,D,x),W=o(P,v.relativeLuminance($>>8));if(W<x){const I=w(E,D,x);return W>o(P,v.relativeLuminance(I>>8))?$:I}return $}},l.reduceLuminance=w,l.increaseLuminance=L,l.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(n||(i.rgba=n={})),i.toPaddedHex=c,i.contrastRatio=o},8969:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const m=d(844),_=d(2585),h=d(4348),y=d(7866),S=d(744),k=d(7302),v=d(6975),n=d(8460),c=d(1753),o=d(1480),l=d(7994),w=d(9282),L=d(5435),E=d(5981),D=d(2660);let x=!1;class P extends m.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event(($=>{var W;(W=this._onScrollApi)==null||W.fire($.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($){for(const W in $)this.optionsService.options[W]=$[W]}constructor($){super(),this._windowsWrappingHeuristics=this.register(new m.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new k.OptionsService($)),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(y.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((W=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new E.WriteBuffer(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write($,W){this._writeBuffer.write($,W)}writeSync($,W){this._logService.logLevel<=_.LogLevelEnum.WARN&&!x&&(this._logService.warn("writeSync is unreliable and will be removed soon."),x=!0),this._writeBuffer.writeSync($,W)}input($,W=!0){this.coreService.triggerDataEvent($,W)}resize($,W){isNaN($)||isNaN(W)||($=Math.max($,S.MINIMUM_COLS),W=Math.max(W,S.MINIMUM_ROWS),this._bufferService.resize($,W))}scroll($,W=!1){this._bufferService.scroll($,W)}scrollLines($,W,I){this._bufferService.scrollLines($,W,I)}scrollPages($){this.scrollLines($*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine($){const W=$-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler($,W){return this._inputHandler.registerEscHandler($,W)}registerDcsHandler($,W){return this._inputHandler.registerDcsHandler($,W)}registerCsiHandler($,W){return this._inputHandler.registerCsiHandler($,W)}registerOscHandler($,W){return this._inputHandler.registerOscHandler($,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let $=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?$=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&($=!0),$?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const $=[];$.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),$.push(this.registerCsiHandler({final:"H"},(()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,m.toDisposable)((()=>{for(const W of $)W.dispose()}))}}}i.CoreTerminal=P},8460:(R,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=d=>(this._listeners.push(d),{dispose:()=>{if(!this._disposed){for(let m=0;m<this._listeners.length;m++)if(this._listeners[m]===d)return void this._listeners.splice(m,1)}}})),this._event}fire(d,m){const _=[];for(let h=0;h<this._listeners.length;h++)_.push(this._listeners[h]);for(let h=0;h<_.length;h++)_[h].call(void 0,d,m)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(d,m){return d((_=>m.fire(_)))},i.runAndSubscribe=function(d,m){return m(void 0),d((_=>m(_)))}},5435:function(R,i,d){var m=this&&this.__decorate||function(Q,A,B,T){var F,ee=arguments.length,ne=ee<3?A:T===null?T=Object.getOwnPropertyDescriptor(A,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Q,A,B,T);else for(var ce=Q.length-1;ce>=0;ce--)(F=Q[ce])&&(ne=(ee<3?F(ne):ee>3?F(A,B,ne):F(A,B))||ne);return ee>3&&ne&&Object.defineProperty(A,B,ne),ne},_=this&&this.__param||function(Q,A){return function(B,T){A(B,T,Q)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const h=d(2584),y=d(7116),S=d(2015),k=d(844),v=d(482),n=d(8437),c=d(8460),o=d(643),l=d(511),w=d(3734),L=d(2585),E=d(1480),D=d(6242),x=d(6351),P=d(5941),H={"(":0,")":1,"*":2,"+":3,"-":1,".":2},$=131072;function W(Q,A){if(Q>24)return A.setWinLines||!1;switch(Q){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var I;(function(Q){Q[Q.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Q[Q.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(i.WindowsOptionsReportType=I={}));let X=0;class q extends k.Disposable{getAttrData(){return this._curAttrData}constructor(A,B,T,F,ee,ne,ce,de,G=new S.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=B,this._coreService=T,this._logService=F,this._optionsService=ee,this._oscLinkService=ne,this._coreMouseService=ce,this._unicodeService=de,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.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((N=>this._activeBuffer=N.activeBuffer))),this._parser.setCsiHandlerFallback(((N,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(N),params:ie.toArray()})})),this._parser.setEscHandlerFallback((N=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(N)})})),this._parser.setExecuteHandlerFallback((N=>{this._logService.debug("Unknown EXECUTE code: ",{code:N})})),this._parser.setOscHandlerFallback(((N,ie,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:N,action:ie,data:se})})),this._parser.setDcsHandlerFallback(((N,ie,se)=>{ie==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(N),action:ie,payload:se})})),this._parser.setPrintHandler(((N,ie,se)=>this.print(N,ie,se))),this._parser.registerCsiHandler({final:"@"},(N=>this.insertChars(N))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(N=>this.scrollLeft(N))),this._parser.registerCsiHandler({final:"A"},(N=>this.cursorUp(N))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(N=>this.scrollRight(N))),this._parser.registerCsiHandler({final:"B"},(N=>this.cursorDown(N))),this._parser.registerCsiHandler({final:"C"},(N=>this.cursorForward(N))),this._parser.registerCsiHandler({final:"D"},(N=>this.cursorBackward(N))),this._parser.registerCsiHandler({final:"E"},(N=>this.cursorNextLine(N))),this._parser.registerCsiHandler({final:"F"},(N=>this.cursorPrecedingLine(N))),this._parser.registerCsiHandler({final:"G"},(N=>this.cursorCharAbsolute(N))),this._parser.registerCsiHandler({final:"H"},(N=>this.cursorPosition(N))),this._parser.registerCsiHandler({final:"I"},(N=>this.cursorForwardTab(N))),this._parser.registerCsiHandler({final:"J"},(N=>this.eraseInDisplay(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(N=>this.eraseInDisplay(N,!0))),this._parser.registerCsiHandler({final:"K"},(N=>this.eraseInLine(N,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(N=>this.eraseInLine(N,!0))),this._parser.registerCsiHandler({final:"L"},(N=>this.insertLines(N))),this._parser.registerCsiHandler({final:"M"},(N=>this.deleteLines(N))),this._parser.registerCsiHandler({final:"P"},(N=>this.deleteChars(N))),this._parser.registerCsiHandler({final:"S"},(N=>this.scrollUp(N))),this._parser.registerCsiHandler({final:"T"},(N=>this.scrollDown(N))),this._parser.registerCsiHandler({final:"X"},(N=>this.eraseChars(N))),this._parser.registerCsiHandler({final:"Z"},(N=>this.cursorBackwardTab(N))),this._parser.registerCsiHandler({final:"`"},(N=>this.charPosAbsolute(N))),this._parser.registerCsiHandler({final:"a"},(N=>this.hPositionRelative(N))),this._parser.registerCsiHandler({final:"b"},(N=>this.repeatPrecedingCharacter(N))),this._parser.registerCsiHandler({final:"c"},(N=>this.sendDeviceAttributesPrimary(N))),this._parser.registerCsiHandler({prefix:">",final:"c"},(N=>this.sendDeviceAttributesSecondary(N))),this._parser.registerCsiHandler({final:"d"},(N=>this.linePosAbsolute(N))),this._parser.registerCsiHandler({final:"e"},(N=>this.vPositionRelative(N))),this._parser.registerCsiHandler({final:"f"},(N=>this.hVPosition(N))),this._parser.registerCsiHandler({final:"g"},(N=>this.tabClear(N))),this._parser.registerCsiHandler({final:"h"},(N=>this.setMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(N=>this.setModePrivate(N))),this._parser.registerCsiHandler({final:"l"},(N=>this.resetMode(N))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(N=>this.resetModePrivate(N))),this._parser.registerCsiHandler({final:"m"},(N=>this.charAttributes(N))),this._parser.registerCsiHandler({final:"n"},(N=>this.deviceStatus(N))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(N=>this.deviceStatusPrivate(N))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(N=>this.softReset(N))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(N=>this.setCursorStyle(N))),this._parser.registerCsiHandler({final:"r"},(N=>this.setScrollRegion(N))),this._parser.registerCsiHandler({final:"s"},(N=>this.saveCursor(N))),this._parser.registerCsiHandler({final:"t"},(N=>this.windowOptions(N))),this._parser.registerCsiHandler({final:"u"},(N=>this.restoreCursor(N))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(N=>this.insertColumns(N))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(N=>this.deleteColumns(N))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(N=>this.selectProtected(N))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(N=>this.requestMode(N,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(N=>this.requestMode(N,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((N=>(this.setTitle(N),this.setIconName(N),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((N=>this.setIconName(N)))),this._parser.registerOscHandler(2,new D.OscHandler((N=>this.setTitle(N)))),this._parser.registerOscHandler(4,new D.OscHandler((N=>this.setOrReportIndexedColor(N)))),this._parser.registerOscHandler(8,new D.OscHandler((N=>this.setHyperlink(N)))),this._parser.registerOscHandler(10,new D.OscHandler((N=>this.setOrReportFgColor(N)))),this._parser.registerOscHandler(11,new D.OscHandler((N=>this.setOrReportBgColor(N)))),this._parser.registerOscHandler(12,new D.OscHandler((N=>this.setOrReportCursorColor(N)))),this._parser.registerOscHandler(104,new D.OscHandler((N=>this.restoreIndexedColor(N)))),this._parser.registerOscHandler(110,new D.OscHandler((N=>this.restoreFgColor(N)))),this._parser.registerOscHandler(111,new D.OscHandler((N=>this.restoreBgColor(N)))),this._parser.registerOscHandler(112,new D.OscHandler((N=>this.restoreCursorColor(N)))),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 N in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:N},(()=>this.selectCharset("("+N))),this._parser.registerEscHandler({intermediates:")",final:N},(()=>this.selectCharset(")"+N))),this._parser.registerEscHandler({intermediates:"*",final:N},(()=>this.selectCharset("*"+N))),this._parser.registerEscHandler({intermediates:"+",final:N},(()=>this.selectCharset("+"+N))),this._parser.registerEscHandler({intermediates:"-",final:N},(()=>this.selectCharset("-"+N))),this._parser.registerEscHandler({intermediates:".",final:N},(()=>this.selectCharset("."+N))),this._parser.registerEscHandler({intermediates:"/",final:N},(()=>this.selectCharset("/"+N)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((N=>(this._logService.error("Parsing error: ",N),N))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new x.DcsHandler(((N,ie)=>this.requestStatusString(N,ie))))}_preserveStack(A,B,T,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=F}_logSlowResolvingAsync(A){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([A,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,B){let T,F=this._activeBuffer.x,ee=this._activeBuffer.y,ne=0;const ce=this._parseStack.paused;if(ce){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;F=this._parseStack.cursorStartX,ee=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>$&&(ne=this._parseStack.position+$)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,(N=>String.fromCharCode(N))).join("")}"`),typeof A=="string"?A.split("").map((N=>N.charCodeAt(0))):A),this._parseBuffer.length<A.length&&this._parseBuffer.length<$&&(this._parseBuffer=new Uint32Array(Math.min(A.length,$))),ce||this._dirtyRowTracker.clearRange(),A.length>$)for(let N=ne;N<A.length;N+=$){const ie=N+$<A.length?N+$:A.length,se=typeof A=="string"?this._stringDecoder.decode(A.substring(N,ie),this._parseBuffer):this._utf8Decoder.decode(A.subarray(N,ie),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,se))return this._preserveStack(F,ee,se,N),this._logSlowResolvingAsync(T),T}else if(!ce){const N=typeof A=="string"?this._stringDecoder.decode(A,this._parseBuffer):this._utf8Decoder.decode(A,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,N))return this._preserveStack(F,ee,N,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===F&&this._activeBuffer.y===ee||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(A,B,T){let F,ee;const ne=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,N=this._coreService.modes.insertMode,ie=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let fe=this._parser.precedingJoinState;for(let he=B;he<T;++he){if(F=A[he],F<127&&ne){const Qe=ne[String.fromCharCode(F)];Qe&&(F=Qe.charCodeAt(0))}const ke=this._unicodeService.charProperties(F,fe);ee=E.UnicodeService.extractWidth(ke);const Te=E.UnicodeService.extractShouldJoin(ke),Me=Te?E.UnicodeService.extractWidth(fe):0;if(fe=ke,ce&&this._onA11yChar.fire((0,v.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+ee-Me>de){if(G){const Qe=se;let be=this._activeBuffer.x-Me;for(this._activeBuffer.x=Me,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),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Me>0&&se instanceof n.BufferLine&&se.copyCellsFrom(Qe,be,0,Me,!1);be<de;)Qe.setCellFromCodepoint(be++,0,1,ie)}else if(this._activeBuffer.x=de-1,ee===2)continue}if(Te&&this._activeBuffer.x){const Qe=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-Qe,F,ee);for(let be=ee-Me;--be>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(N&&(se.insertCells(this._activeBuffer.x,ee-Me,this._activeBuffer.getNullCell(ie)),se.getWidth(de-1)===2&&se.setCellFromCodepoint(de-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ie)),se.setCellFromCodepoint(this._activeBuffer.x++,F,ee,ie),ee>0)for(;--ee;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=fe,this._activeBuffer.x<de&&T-B>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,B){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,B):this._parser.registerCsiHandler(A,(T=>!W(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(A,B){return this._parser.registerDcsHandler(A,new x.DcsHandler(B))}registerEscHandler(A,B){return this._parser.registerEscHandler(A,B)}registerOscHandler(A,B){return this._parser.registerOscHandler(A,new D.OscHandler(B))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=A,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+B)}cursorUp(A){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const B=A.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=A.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const B=A.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,B,T,F=!1,ee=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);ne.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),ee),F&&(ne.isWrapped=!1)}_resetBufferLine(A,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),T.isWrapped=!1)}eraseInDisplay(A,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(A,B=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,ee=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;B--;)this._activeBuffer.lines.splice(ee-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(A){this._restrictCursor();let B=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;B--;)this._activeBuffer.lines.splice(T,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}insertChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,A.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(A){let B=A.params[0]||1;for(;B--;)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(A){let B=A.params[0]||1;for(;B--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(A){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=A.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);F.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(A){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(A.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(A){const B=this._parser.precedingJoinState;if(!B)return!0;const T=A.params[0]||1,F=E.UnicodeService.extractWidth(B),ee=this._activeBuffer.x-F,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(ee),ce=new Uint32Array(ne.length*T);let de=0;for(let N=0;N<ne.length;){const ie=ne.codePointAt(N)||0;ce[de++]=ie,N+=ie>65535?2:1}let G=de;for(let N=1;N<T;++N)ce.copyWithin(G,0,de),G+=de;return this.print(ce,0,G),!0}sendDeviceAttributesPrimary(A){return A.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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(A){for(let B=0;B<A.length;B++)switch(A.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(A){for(let B=0;B<A.length;B++)switch(A.params[B]){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(),A.params[B]===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(A,B){const T=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:ee}=this._coreMouseService,ne=this._coreService,{buffers:ce,cols:de}=this._bufferService,{active:G,alt:N}=ce,ie=this._optionsService.rawOptions,se=Te=>Te?1:2,fe=A.params[0];return he=fe,ke=B?fe===2?4:fe===4?se(ne.modes.insertMode):fe===12?3:fe===20?se(ie.convertEol):0:fe===1?se(T.applicationCursorKeys):fe===3?ie.windowOptions.setWinLines?de===80?2:de===132?1:0:0:fe===6?se(T.origin):fe===7?se(T.wraparound):fe===8?3:fe===9?se(F==="X10"):fe===12?se(ie.cursorBlink):fe===25?se(!ne.isCursorHidden):fe===45?se(T.reverseWraparound):fe===66?se(T.applicationKeypad):fe===67?4:fe===1e3?se(F==="VT200"):fe===1002?se(F==="DRAG"):fe===1003?se(F==="ANY"):fe===1004?se(T.sendFocus):fe===1005?4:fe===1006?se(ee==="SGR"):fe===1015?4:fe===1016?se(ee==="SGR_PIXELS"):fe===1048?1:fe===47||fe===1047||fe===1049?se(G===N):fe===2004?se(T.bracketedPasteMode):0,ne.triggerDataEvent(`${h.C0.ESC}[${B?"":"?"}${he};${ke}$y`),!0;var he,ke}_updateAttrColor(A,B,T,F,ee){return B===2?(A|=50331648,A&=-16777216,A|=w.AttributeData.fromColorRGB([T,F,ee])):B===5&&(A&=-50331904,A|=33554432|255&T),A}_extractColor(A,B,T){const F=[0,0,-1,0,0,0];let ee=0,ne=0;do{if(F[ne+ee]=A.params[B+ne],A.hasSubParams(B+ne)){const ce=A.getSubParams(B+ne);let de=0;do F[1]===5&&(ee=1),F[ne+de+1+ee]=ce[de];while(++de<ce.length&&de+ne+1+ee<F.length);break}if(F[1]===5&&ne+ee>=2||F[1]===2&&ne+ee>=5)break;F[1]&&(ee=1)}while(++ne+B<A.length&&ne+ee<F.length);for(let ce=2;ce<F.length;++ce)F[ce]===-1&&(F[ce]=0);switch(F[0]){case 38:T.fg=this._updateAttrColor(T.fg,F[1],F[3],F[4],F[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,F[1],F[3],F[4],F[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,F[1],F[3],F[4],F[5])}return ne}_processUnderline(A,B){B.extended=B.extended.clone(),(!~A||A>5)&&(A=1),B.extended.underlineStyle=A,B.fg|=268435456,A===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(A){A.fg=n.DEFAULT_ATTR_DATA.fg,A.bg=n.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=A.length;let T;const F=this._curAttrData;for(let ee=0;ee<B;ee++)T=A.params[ee],T>=30&&T<=37?(F.fg&=-50331904,F.fg|=16777216|T-30):T>=40&&T<=47?(F.bg&=-50331904,F.bg|=16777216|T-40):T>=90&&T<=97?(F.fg&=-50331904,F.fg|=16777224|T-90):T>=100&&T<=107?(F.bg&=-50331904,F.bg|=16777224|T-100):T===0?this._processSGR0(F):T===1?F.fg|=134217728:T===3?F.bg|=67108864:T===4?(F.fg|=268435456,this._processUnderline(A.hasSubParams(ee)?A.getSubParams(ee)[0]:1,F)):T===5?F.fg|=536870912:T===7?F.fg|=67108864:T===8?F.fg|=1073741824:T===9?F.fg|=2147483648:T===2?F.bg|=134217728:T===21?this._processUnderline(2,F):T===22?(F.fg&=-134217729,F.bg&=-134217729):T===23?F.bg&=-67108865:T===24?(F.fg&=-268435457,this._processUnderline(0,F)):T===25?F.fg&=-536870913:T===27?F.fg&=-67108865:T===28?F.fg&=-1073741825:T===29?F.fg&=2147483647:T===39?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):T===49?(F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?ee+=this._extractColor(A,ee,F):T===53?F.bg|=1073741824:T===55?F.bg&=-1073741825:T===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):T===100?(F.fg&=-67108864,F.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${B};${T}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.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(A){const B=A.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(A){const B=A.params[0]||1;let T;return(A.length<2||(T=A.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(A){if(!W(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const B=[],T=A.split(";");for(;T.length>1;){const F=T.shift(),ee=T.shift();if(/^\d+$/.exec(F)){const ne=parseInt(F);if(re(ne))if(ee==="?")B.push({type:0,index:ne});else{const ce=(0,P.parseColor)(ee);ce&&B.push({type:1,index:ne,color:ce})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(A){const B=A.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(A,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=A.split(":");let F;const ee=T.findIndex((ne=>ne.startsWith("id=")));return ee!==-1&&(F=T[ee].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,B){const T=A.split(";");for(let F=0;F<T.length&&!(B>=this._specialColors.length);++F,++B)if(T[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const ee=(0,P.parseColor)(T[F]);ee&&this._onColor.fire([{type:1,index:this._specialColors[B],color:ee}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const B=[],T=A.split(";");for(let F=0;F<T.length;++F)if(/^\d+$/.exec(T[F])){const ee=parseInt(T[F]);re(ee)&&B.push({type:2,index:ee})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(A){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(A){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(A){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,y.DEFAULT_CHARSET),!0}selectCharset(A){return A.length!==2?(this.selectDefaultCharset(),!0):(A[0]==="/"||this._charsetService.setgCharset(H[A[0]],y.CHARSETS[A[1]]||y.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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new l.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,F=this._activeBuffer.lines.get(T);F&&(F.fill(A),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(A,B){const T=this._bufferService.buffer,F=this._optionsService.rawOptions;return(ee=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${ee}${h.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,B){this._dirtyRowTracker.markRangeDirty(A,B)}}i.InputHandler=q;let z=class{constructor(Q){this._bufferService=Q,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Q){Q<this.start?this.start=Q:Q>this.end&&(this.end=Q)}markRangeDirty(Q,A){Q>A&&(X=Q,Q=A,A=X),Q<this.start&&(this.start=Q),A>this.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function re(Q){return 0<=Q&&Q<256}z=m([_(0,L.IBufferService)],z)},844:(R,i)=>{function d(m){for(const _ of m)_.dispose();m.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 m of this._disposables)m.dispose();this._disposables.length=0}register(m){return this._disposables.push(m),m}unregister(m){const _=this._disposables.indexOf(m);_!==-1&&this._disposables.splice(_,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(m){var _;this._isDisposed||m===this._value||((_=this._value)==null||_.dispose(),this._value=m)}clear(){this.value=void 0}dispose(){var m;this._isDisposed=!0,(m=this._value)==null||m.dispose(),this._value=void 0}},i.toDisposable=function(m){return{dispose:m}},i.disposeArray=d,i.getDisposeArrayDisposable=function(m){return{dispose:()=>d(m)}}},1505:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class d{constructor(){this._data={}}set(_,h,y){this._data[_]||(this._data[_]={}),this._data[_][h]=y}get(_,h){return this._data[_]?this._data[_][h]:void 0}clear(){this._data={}}}i.TwoKeyMap=d,i.FourKeyMap=class{constructor(){this._data=new d}set(m,_,h,y,S){this._data.get(m,_)||this._data.set(m,_,new d),this._data.get(m,_).set(h,y,S)}get(m,_,h,y){var S;return(S=this._data.get(m,_))==null?void 0:S.get(h,y)}clear(){this._data.clear()}}},6114:(R,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 d=i.isNode?"node":navigator.userAgent,m=i.isNode?"node":navigator.platform;i.isFirefox=d.includes("Firefox"),i.isLegacyEdge=d.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(d),i.getSafariVersion=function(){if(!i.isSafari)return 0;const _=d.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(m),i.isIpad=m==="iPad",i.isIphone=m==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(m),i.isLinux=m.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(d)},6106:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let d=0;i.SortedList=class{constructor(m){this._getKey=m,this._array=[]}clear(){this._array.length=0}insert(m){this._array.length!==0?(d=this._search(this._getKey(m)),this._array.splice(d,0,m)):this._array.push(m)}delete(m){if(this._array.length===0)return!1;const _=this._getKey(m);if(_===void 0||(d=this._search(_),d===-1)||this._getKey(this._array[d])!==_)return!1;do if(this._array[d]===m)return this._array.splice(d,1),!0;while(++d<this._array.length&&this._getKey(this._array[d])===_);return!1}*getKeyIterator(m){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do yield this._array[d];while(++d<this._array.length&&this._getKey(this._array[d])===m)}forEachByKey(m,_){if(this._array.length!==0&&(d=this._search(m),!(d<0||d>=this._array.length)&&this._getKey(this._array[d])===m))do _(this._array[d]);while(++d<this._array.length&&this._getKey(this._array[d])===m)}values(){return[...this._array].values()}_search(m){let _=0,h=this._array.length-1;for(;h>=_;){let y=_+h>>1;const S=this._getKey(this._array[y]);if(S>m)h=y-1;else{if(!(S<m)){for(;y>0&&this._getKey(this._array[y-1])===m;)y--;return y}_=y+1}}return _}}},7226:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const m=d(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 k=0,v=0,n=S.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),v=Math.max(k,v),c=S.timeRemaining(),1.5*v>c)return n-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-k))}ms`),void this._start();n=c}this.clear()}}class h extends _{_requestCallback(S){return setTimeout((()=>S(this._createDeadline(16))))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const k=Date.now()+S;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}i.PriorityTaskQueue=h,i.IdleTaskQueue=!m.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:h,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const m=d(643);i.updateWindowsModeWrappedState=function(_){const h=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),y=h==null?void 0:h.get(_.cols-1),S=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);S&&y&&(S.isWrapped=y[m.CHAR_DATA_CODE_INDEX]!==m.NULL_CELL_CODE&&y[m.CHAR_DATA_CODE_INDEX]!==m.WHITESPACE_CELL_CODE)}},3734:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class d{constructor(){this.fg=0,this.bg=0,this.extended=new m}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new d;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=d;class m{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,y=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=y}clone(){return new m(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=m},9092:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const m=d(6349),_=d(7226),h=d(3734),y=d(8437),S=d(4634),k=d(511),v=d(643),n=d(4863),c=d(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(o,l,w){this._hasScrollback=o,this._optionsService=l,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=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.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 m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,l){return new y.BufferLine(this._bufferService.cols,this.getNullCell(o),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const l=o+this._optionsService.rawOptions.scrollback;return l>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:l}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=y.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new m.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,l){const w=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=0;const E=this._getCorrectBufferLength(l);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<o)for(let x=0;x<this.lines.length;x++)L+=+this.lines.get(x).resize(o,w);let D=0;if(this._rows<l)for(let x=this._rows;x<l;x++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(o,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(o,w)));else for(let x=this._rows;x>l;x--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){const x=this.lines.length-E;x>0&&(this.lines.trimStart(x),this.ybase=Math.max(this.ybase-x,0),this.ydisp=Math.max(this.ydisp-x,0),this.savedY=Math.max(this.savedY-x,0)),this.lines.maxLength=E}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,l-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(o,l),this._cols>o))for(let D=0;D<this.lines.length;D++)L+=+this.lines.get(D).resize(o,w);this._cols=o,this._rows=l,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,l){this._cols!==o&&(o>this._cols?this._reflowLarger(o,l):this._reflowSmaller(o,l))}_reflowLarger(o,l){const w=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(w.length>0){const L=(0,S.reflowLargerCreateNewLayout)(this.lines,w);(0,S.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(o,l,L.countRemoved)}}_reflowLargerAdjustViewport(o,l,w){const L=this.getNullCell(y.DEFAULT_ATTR_DATA);let E=w;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new y.BufferLine(o,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(o,l){const w=this.getNullCell(y.DEFAULT_ATTR_DATA),L=[];let E=0;for(let D=this.lines.length-1;D>=0;D--){let x=this.lines.get(D);if(!x||!x.isWrapped&&x.getTrimmedLength()<=o)continue;const P=[x];for(;x.isWrapped&&D>0;)x=this.lines.get(--D),P.unshift(x);const H=this.ybase+this.y;if(H>=D&&H<D+P.length)continue;const $=P[P.length-1].getTrimmedLength(),W=(0,S.reflowSmallerGetNewLineLengths)(P,this._cols,o),I=W.length-P.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const q=[];for(let T=0;T<I;T++){const F=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);q.push(F)}q.length>0&&(L.push({start:D+P.length+E,newLines:q}),E+=q.length),P.push(...q);let z=W.length-1,re=W[z];re===0&&(z--,re=W[z]);let Q=P.length-I-1,A=$;for(;Q>=0;){const T=Math.min(A,re);if(P[z]===void 0)break;if(P[z].copyCellsFrom(P[Q],A-T,re-T,T,!0),re-=T,re===0&&(z--,re=W[z]),A-=T,A===0){Q--;const F=Math.max(Q,0);A=(0,S.getWrappedLineTrimmedLength)(P,F,this._cols)}}for(let T=0;T<P.length;T++)W[T]<o&&P[T].setCell(W[T],w);let B=I-X;for(;B-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+E)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+l-1)}if(L.length>0){const D=[],x=[];for(let z=0;z<this.lines.length;z++)x.push(this.lines.get(z));const P=this.lines.length;let H=P-1,$=0,W=L[$];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+E);let I=0;for(let z=Math.min(this.lines.maxLength-1,P+E-1);z>=0;z--)if(W&&W.start>H+I){for(let re=W.newLines.length-1;re>=0;re--)this.lines.set(z--,W.newLines[re]);z++,D.push({index:H+1,amount:W.newLines.length}),I+=W.newLines.length,W=L[++$]}else this.lines.set(z,x[H--]);let X=0;for(let z=D.length-1;z>=0;z--)D[z].index+=X,this.lines.onInsertEmitter.fire(D[z]),X+=D[z].amount;const q=Math.max(0,P+E-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(o,l,w=0,L){const E=this.lines.get(o);return E?E.translateToString(l,w,L):""}getWrappedRangeForLine(o){let l=o,w=o;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:l,last:w}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===o&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const l=new n.Marker(o);return this.markers.push(l),l.register(this.lines.onTrim((w=>{l.line-=w,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((w=>{l.line>=w.index&&(l.line+=w.amount)}))),l.register(this.lines.onDelete((w=>{l.line>=w.index&&l.line<w.index+w.amount&&l.dispose(),l.line>w.index&&(l.line-=w.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const m=d(3734),_=d(511),h=d(643),y=d(482);i.DEFAULT_ATTR_DATA=Object.freeze(new m.AttributeData);let S=0;class k{constructor(n,c,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const l=c||_.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let w=0;w<n;++w)this.setCell(w,l);this.length=n}get(n){const c=this._data[3*n+0],o=2097151&c;return[this._data[3*n+1],2097152&c?this._combined[n]:o?(0,y.stringFromCodePoint)(o):"",c>>22,2097152&c?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,c){this._data[3*n+1]=c[h.CHAR_DATA_ATTR_INDEX],c[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=c[1],this._data[3*n+0]=2097152|n|c[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=c[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const c=this._data[3*n+0];return 2097152&c?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&c}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const c=this._data[3*n+0];return 2097152&c?this._combined[n]:2097151&c?(0,y.stringFromCodePoint)(2097151&c):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,c){return S=3*n,c.content=this._data[S+0],c.fg=this._data[S+1],c.bg=this._data[S+2],2097152&c.content&&(c.combinedData=this._combined[n]),268435456&c.bg&&(c.extended=this._extendedAttrs[n]),c}setCell(n,c){2097152&c.content&&(this._combined[n]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=c.content,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}setCellFromCodepoint(n,c,o,l){268435456&l.bg&&(this._extendedAttrs[n]=l.extended),this._data[3*n+0]=c|o<<22,this._data[3*n+1]=l.fg,this._data[3*n+2]=l.bg}addCodepointToCell(n,c,o){let l=this._data[3*n+0];2097152&l?this._combined[n]+=(0,y.stringFromCodePoint)(c):2097151&l?(this._combined[n]=(0,y.stringFromCodePoint)(2097151&l)+(0,y.stringFromCodePoint)(c),l&=-2097152,l|=2097152):l=c|4194304,o&&(l&=-12582913,l|=o<<22),this._data[3*n+0]=l}insertCells(n,c,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length-n){const l=new _.CellData;for(let w=this.length-n-c-1;w>=0;--w)this.setCell(n+c+w,this.loadCell(n+w,l));for(let w=0;w<c;++w)this.setCell(n+w,o)}else for(let l=n;l<this.length;++l)this.setCell(l,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,c,o){if(n%=this.length,c<this.length-n){const l=new _.CellData;for(let w=0;w<this.length-n-c;++w)this.setCell(n+w,this.loadCell(n+c+w,l));for(let w=this.length-c;w<this.length;++w)this.setCell(w,o)}else for(let l=n;l<this.length;++l)this.setCell(l,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,c,o,l=!1){if(l)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,o);n<c&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,o);n<c&&n<this.length;)this.setCell(n++,o)}resize(n,c){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const l=new Uint32Array(o);l.set(this._data),this._data=l}for(let l=this.length;l<n;++l)this.setCell(l,c)}else{this._data=this._data.subarray(0,o);const l=Object.keys(this._combined);for(let L=0;L<l.length;L++){const E=parseInt(l[L],10);E>=n&&delete this._combined[E]}const w=Object.keys(this._extendedAttrs);for(let L=0;L<w.length;L++){const E=parseInt(w[L],10);E>=n&&delete this._extendedAttrs[E]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,c=!1){if(c)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const c in n._combined)this._combined[c]=n._combined[c];this._extendedAttrs={};for(const c in n._extendedAttrs)this._extendedAttrs[c]=n._extendedAttrs[c];this.isWrapped=n.isWrapped}clone(){const n=new k(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const c in this._combined)n._combined[c]=this._combined[c];for(const c in this._extendedAttrs)n._extendedAttrs[c]=this._extendedAttrs[c];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,c,o,l,w){const L=n._data;if(w)for(let D=l-1;D>=0;D--){for(let x=0;x<3;x++)this._data[3*(o+D)+x]=L[3*(c+D)+x];268435456&L[3*(c+D)+2]&&(this._extendedAttrs[o+D]=n._extendedAttrs[c+D])}else for(let D=0;D<l;D++){for(let x=0;x<3;x++)this._data[3*(o+D)+x]=L[3*(c+D)+x];268435456&L[3*(c+D)+2]&&(this._extendedAttrs[o+D]=n._extendedAttrs[c+D])}const E=Object.keys(n._combined);for(let D=0;D<E.length;D++){const x=parseInt(E[D],10);x>=c&&(this._combined[x-c+o]=n._combined[x])}}translateToString(n,c,o,l){c=c??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),l&&(l.length=0);let w="";for(;c<o;){const L=this._data[3*c+0],E=2097151&L,D=2097152&L?this._combined[c]:E?(0,y.stringFromCodePoint)(E):h.WHITESPACE_CELL_CHAR;if(w+=D,l)for(let x=0;x<D.length;++x)l.push(c);c+=L>>22||1}return l&&l.push(c),w}}i.BufferLine=k},4841:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(d,m){if(d.start.y>d.end.y)throw new Error(`Buffer range end (${d.end.x}, ${d.end.y}) cannot be before start (${d.start.x}, ${d.start.y})`);return m*(d.end.y-d.start.y)+(d.end.x-d.start.x+1)}},4634:(R,i)=>{function d(m,_,h){if(_===m.length-1)return m[_].getTrimmedLength();const y=!m[_].hasContent(h-1)&&m[_].getWidth(h-1)===1,S=m[_+1].getWidth(0)===2;return y&&S?h-1:h}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(m,_,h,y,S){const k=[];for(let v=0;v<m.length-1;v++){let n=v,c=m.get(++n);if(!c.isWrapped)continue;const o=[m.get(v)];for(;n<m.length&&c.isWrapped;)o.push(c),c=m.get(++n);if(y>=v&&y<n){v+=o.length-1;continue}let l=0,w=d(o,l,_),L=1,E=0;for(;L<o.length;){const x=d(o,L,_),P=x-E,H=h-w,$=Math.min(P,H);o[l].copyCellsFrom(o[L],E,w,$,!1),w+=$,w===h&&(l++,w=0),E+=$,E===x&&(L++,E=0),w===0&&l!==0&&o[l-1].getWidth(h-1)===2&&(o[l].copyCellsFrom(o[l-1],h-1,w++,1,!1),o[l-1].setCell(h-1,S))}o[l].replaceCells(w,h,S);let D=0;for(let x=o.length-1;x>0&&(x>l||o[x].getTrimmedLength()===0);x--)D++;D>0&&(k.push(v+o.length-D),k.push(D)),v+=o.length-1}return k},i.reflowLargerCreateNewLayout=function(m,_){const h=[];let y=0,S=_[y],k=0;for(let v=0;v<m.length;v++)if(S===v){const n=_[++y];m.onDeleteEmitter.fire({index:v-k,amount:n}),v+=n-1,k+=n,S=_[++y]}else h.push(v);return{layout:h,countRemoved:k}},i.reflowLargerApplyNewLayout=function(m,_){const h=[];for(let y=0;y<_.length;y++)h.push(m.get(_[y]));for(let y=0;y<h.length;y++)m.set(y,h[y]);m.length=_.length},i.reflowSmallerGetNewLineLengths=function(m,_,h){const y=[],S=m.map(((c,o)=>d(m,o,_))).reduce(((c,o)=>c+o));let k=0,v=0,n=0;for(;n<S;){if(S-n<h){y.push(S-n);break}k+=h;const c=d(m,v,_);k>c&&(k-=c,v++);const o=m[v].getWidth(k-1)===2;o&&k--;const l=o?h-1:h;y.push(l),n+=l}return y},i.getWrappedLineTrimmedLength=d},5295:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const m=d(8460),_=d(844),h=d(9092);class y extends _.Disposable{constructor(k,v){super(),this._optionsService=k,this._bufferService=v,this._onBufferActivate=this.register(new m.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,v){this._normal.resize(k,v),this._alt.resize(k,v),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}i.BufferSet=y},511:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const m=d(482),_=d(643),h=d(3734);class y extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const v=new y;return v.setFromCharData(k),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,m.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(k[_.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(k[_.CHAR_DATA_CHAR_INDEX].length===2){const n=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const c=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(n-55296)+c-56320+65536|k[_.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=k[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[_.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=k[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=y},643:(R,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:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const m=d(8460),_=d(844);class h{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new m.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=h,h._nextId=1},7116:(R,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:(R,i)=>{var d,m,_;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
|
|
49
|
+
`,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(d||(i.C0=d={})),(function(h){h.PAD="",h.HOP="",h.BPH="",h.NBH="",h.IND="",h.NEL="
",h.SSA="",h.ESA="",h.HTS="",h.HTJ="",h.VTS="",h.PLD="",h.PLU="",h.RI="",h.SS2="",h.SS3="",h.DCS="",h.PU1="",h.PU2="",h.STS="",h.CCH="",h.MW="",h.SPA="",h.EPA="",h.SOS="",h.SGCI="",h.SCI="",h.CSI="",h.ST="",h.OSC="",h.PM="",h.APC=""})(m||(i.C1=m={})),(function(h){h.ST=`${d.ESC}\\`})(_||(i.C1_ESCAPED=_={}))},7399:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const m=d(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(h,y,S,k){const v={type:0,cancel:!1,key:void 0},n=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=y?m.C0.ESC+"OA":m.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=y?m.C0.ESC+"OD":m.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=y?m.C0.ESC+"OC":m.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=y?m.C0.ESC+"OB":m.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":m.C0.DEL,h.altKey&&(v.key=m.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=m.C0.ESC+"[Z";break}v.key=m.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?m.C0.ESC+m.C0.CR:m.C0.CR,v.cancel=!0;break;case 27:v.key=m.C0.ESC,h.altKey&&(v.key=m.C0.ESC+m.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"D",v.key===m.C0.ESC+"[1;3D"&&(v.key=m.C0.ESC+(S?"b":"[1;5D"))):v.key=y?m.C0.ESC+"OD":m.C0.ESC+"[D";break;case 39:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"C",v.key===m.C0.ESC+"[1;3C"&&(v.key=m.C0.ESC+(S?"f":"[1;5C"))):v.key=y?m.C0.ESC+"OC":m.C0.ESC+"[C";break;case 38:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"A",S||v.key!==m.C0.ESC+"[1;3A"||(v.key=m.C0.ESC+"[1;5A")):v.key=y?m.C0.ESC+"OA":m.C0.ESC+"[A";break;case 40:if(h.metaKey)break;n?(v.key=m.C0.ESC+"[1;"+(n+1)+"B",S||v.key!==m.C0.ESC+"[1;3B"||(v.key=m.C0.ESC+"[1;5B")):v.key=y?m.C0.ESC+"OB":m.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=m.C0.ESC+"[2~");break;case 46:v.key=n?m.C0.ESC+"[3;"+(n+1)+"~":m.C0.ESC+"[3~";break;case 36:v.key=n?m.C0.ESC+"[1;"+(n+1)+"H":y?m.C0.ESC+"OH":m.C0.ESC+"[H";break;case 35:v.key=n?m.C0.ESC+"[1;"+(n+1)+"F":y?m.C0.ESC+"OF":m.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=m.C0.ESC+"[5;"+(n+1)+"~":v.key=m.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=m.C0.ESC+"[6;"+(n+1)+"~":v.key=m.C0.ESC+"[6~";break;case 112:v.key=n?m.C0.ESC+"[1;"+(n+1)+"P":m.C0.ESC+"OP";break;case 113:v.key=n?m.C0.ESC+"[1;"+(n+1)+"Q":m.C0.ESC+"OQ";break;case 114:v.key=n?m.C0.ESC+"[1;"+(n+1)+"R":m.C0.ESC+"OR";break;case 115:v.key=n?m.C0.ESC+"[1;"+(n+1)+"S":m.C0.ESC+"OS";break;case 116:v.key=n?m.C0.ESC+"[15;"+(n+1)+"~":m.C0.ESC+"[15~";break;case 117:v.key=n?m.C0.ESC+"[17;"+(n+1)+"~":m.C0.ESC+"[17~";break;case 118:v.key=n?m.C0.ESC+"[18;"+(n+1)+"~":m.C0.ESC+"[18~";break;case 119:v.key=n?m.C0.ESC+"[19;"+(n+1)+"~":m.C0.ESC+"[19~";break;case 120:v.key=n?m.C0.ESC+"[20;"+(n+1)+"~":m.C0.ESC+"[20~";break;case 121:v.key=n?m.C0.ESC+"[21;"+(n+1)+"~":m.C0.ESC+"[21~";break;case 122:v.key=n?m.C0.ESC+"[23;"+(n+1)+"~":m.C0.ESC+"[23~";break;case 123:v.key=n?m.C0.ESC+"[24;"+(n+1)+"~":m.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!k||!h.altKey||h.metaKey)!S||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=m.C0.US),h.key==="@"&&(v.key=m.C0.NUL)):h.keyCode===65&&(v.type=1);else{const c=_[h.keyCode],o=c==null?void 0:c[h.shiftKey?1:0];if(o)v.key=m.C0.ESC+o;else if(h.keyCode>=65&&h.keyCode<=90){const l=h.ctrlKey?h.keyCode-64:h.keyCode+32;let w=String.fromCharCode(l);h.shiftKey&&(w=w.toUpperCase()),v.key=m.C0.ESC+w}else if(h.keyCode===32)v.key=m.C0.ESC+(h.ctrlKey?m.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let l=h.code.slice(3,4);h.shiftKey||(l=l.toLowerCase()),v.key=m.C0.ESC+l,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=m.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=m.C0.DEL:h.keyCode===219?v.key=m.C0.ESC:h.keyCode===220?v.key=m.C0.FS:h.keyCode===221&&(v.key=m.C0.GS)}return v}},482:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},i.utf32ToString=function(d,m=0,_=d.length){let h="";for(let y=m;y<_;++y){let S=d[y];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(d,m){const _=d.length;if(!_)return 0;let h=0,y=0;if(this._interim){const S=d.charCodeAt(y++);56320<=S&&S<=57343?m[h++]=1024*(this._interim-55296)+S-56320+65536:(m[h++]=this._interim,m[h++]=S),this._interim=0}for(let S=y;S<_;++S){const k=d.charCodeAt(S);if(55296<=k&&k<=56319){if(++S>=_)return this._interim=k,h;const v=d.charCodeAt(S);56320<=v&&v<=57343?m[h++]=1024*(k-55296)+v-56320+65536:(m[h++]=k,m[h++]=v)}else k!==65279&&(m[h++]=k)}return h}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(d,m){const _=d.length;if(!_)return 0;let h,y,S,k,v=0,n=0,c=0;if(this.interim[0]){let w=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let E,D=0;for(;(E=63&this.interim[++D])&&D<4;)L<<=6,L|=E;const x=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,P=x-D;for(;c<P;){if(c>=_)return 0;if(E=d[c++],(192&E)!=128){c--,w=!0;break}this.interim[D++]=E,L<<=6,L|=63&E}w||(x===2?L<128?c--:m[v++]=L:x===3?L<2048||L>=55296&&L<=57343||L===65279||(m[v++]=L):L<65536||L>1114111||(m[v++]=L)),this.interim.fill(0)}const o=_-4;let l=c;for(;l<_;){for(;!(!(l<o)||128&(h=d[l])||128&(y=d[l+1])||128&(S=d[l+2])||128&(k=d[l+3]));)m[v++]=h,m[v++]=y,m[v++]=S,m[v++]=k,l+=4;if(h=d[l++],h<128)m[v++]=h;else if((224&h)==192){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(n=(31&h)<<6|63&y,n<128){l--;continue}m[v++]=n}else if((240&h)==224){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,v;if(S=d[l++],(192&S)!=128){l--;continue}if(n=(15&h)<<12|(63&y)<<6|63&S,n<2048||n>=55296&&n<=57343||n===65279)continue;m[v++]=n}else if((248&h)==240){if(l>=_)return this.interim[0]=h,v;if(y=d[l++],(192&y)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,v;if(S=d[l++],(192&S)!=128){l--;continue}if(l>=_)return this.interim[0]=h,this.interim[1]=y,this.interim[2]=S,v;if(k=d[l++],(192&k)!=128){l--;continue}if(n=(7&h)<<18|(63&y)<<12|(63&S)<<6|63&k,n<65536||n>1114111)continue;m[v++]=n}}return v}}},225:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const m=d(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]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;i.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let S=0;S<_.length;++S)y.fill(0,_[S][0],_[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?y[S]:(function(k,v){let n,c=0,o=v.length-1;if(k<v[0][0]||k>v[o][1])return!1;for(;o>=c;)if(n=c+o>>1,k>v[n][1])c=n+1;else{if(!(k<v[n][0]))return!0;o=n-1}return!1})(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,k){let v=this.wcwidth(S),n=v===0&&k!==0;if(n){const c=m.UnicodeService.extractWidth(k);c===0?n=!1:c>v&&(v=c)}return m.UnicodeService.createPropertyValue(0,v,n)}}},5981:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const m=d(8460),_=d(844);class h 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 m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,k){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(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(k)}_innerWrite(S=0,k=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],c=this._action(n,k);if(c){const l=w=>Date.now()-v>=12?setTimeout((()=>this._innerWrite(0,w))):this._innerWrite(v,w);return void c.catch((w=>(queueMicrotask((()=>{throw w})),Promise.resolve(!1)))).then(l)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}i.WriteBuffer=h},5941:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const d=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,m=/^[\da-f]+$/;function _(h,y){const S=h.toString(16),k=S.length<2?"0"+S:S;switch(y){case 4:return S[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}i.parseColor=function(h){if(!h)return;let y=h.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const S=d.exec(y);if(S){const k=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/k*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/k*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/k*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),m.exec(y)&&[3,6,9,12].includes(y.length))){const S=y.length/3,k=[0,0,0];for(let v=0;v<3;++v){const n=parseInt(y.slice(S*v,S*v+S),16);k[v]=S===1?n<<4:S===2?n:S===3?n>>4:n>>8}return k}},i.toRgbString=function(h,y=16){const[S,k,v]=h;return`rgb:${_(S,y)}/${_(k,y)}/${_(v,y)}`}},5770:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const m=d(482),_=d(8742),h=d(5770),y=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(k,v){this._handlers[k]===void 0&&(this._handlers[k]=[]);const n=this._handlers[k];return n.push(v),{dispose:()=>{const c=n.indexOf(v);c!==-1&&n.splice(c,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(k,v){if(this.reset(),this._ident=k,this._active=this._handlers[k]||y,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(k,v,n){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(k,v,n);else this._handlerFb(this._ident,"PUT",(0,m.utf32ToString)(k,v,n))}unhook(k,v=!0){if(this._active.length){let n=!1,c=this._active.length-1,o=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,n=v,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;c>=0&&(n=this._active[c].unhook(k),n!==!0);c--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,n;c--}for(;c>=0;c--)if(n=this._active[c].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",k);this._active=y,this._ident=0}};const S=new _.Params;S.addParam(0),i.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=S,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():S,this._data="",this._hitLimit=!1}put(k,v,n){this._hitLimit||(this._data+=(0,m.utf32ToString)(k,v,n),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let v=!1;if(this._hitLimit)v=!1;else if(k&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then((n=>(this._params=S,this._data="",this._hitLimit=!1,n)));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const m=d(844),_=d(8742),h=d(6242),y=d(6351);class S{constructor(c){this.table=new Uint8Array(c)}setDefault(c,o){this.table.fill(c<<4|o)}add(c,o,l,w){this.table[o<<8|c]=l<<4|w}addMany(c,o,l,w){for(let L=0;L<c.length;L++)this.table[o<<8|c[L]]=l<<4|w}}i.TransitionTable=S;const k=160;i.VT500_TRANSITION_TABLE=(function(){const n=new S(4095),c=Array.apply(null,Array(256)).map(((D,x)=>x)),o=(D,x)=>c.slice(D,x),l=o(32,127),w=o(0,24);w.push(25),w.push.apply(w,o(28,32));const L=o(0,14);let E;for(E in n.setDefault(1,0),n.addMany(l,0,2,0),L)n.addMany([24,26,153,154],E,3,0),n.addMany(o(128,144),E,3,0),n.addMany(o(144,152),E,3,0),n.add(156,E,0,0),n.add(27,E,11,1),n.add(157,E,4,8),n.addMany([152,158,159],E,0,7),n.add(155,E,11,3),n.add(144,E,11,9);return n.addMany(w,0,3,0),n.addMany(w,1,3,1),n.add(127,1,0,1),n.addMany(w,8,0,8),n.addMany(w,3,3,3),n.add(127,3,0,3),n.addMany(w,4,3,4),n.add(127,4,0,4),n.addMany(w,6,3,6),n.addMany(w,5,3,5),n.add(127,5,0,5),n.addMany(w,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(l,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(l,7,0,7),n.addMany(w,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(w,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(w,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(w,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(w,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(w,13,13,13),n.addMany(l,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(k,0,2,0),n.add(k,8,5,8),n.add(k,6,0,6),n.add(k,11,0,11),n.add(k,13,13,13),n})();class v extends m.Disposable{constructor(c=i.VT500_TRANSITION_TABLE){super(),this._transitions=c,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=(o,l,w)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,l)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,m.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,o=[64,126]){let l=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=c.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<c.intermediates.length;++L){const E=c.intermediates.charCodeAt(L);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=E}}if(c.final.length!==1)throw new Error("final must be a single byte");const w=c.final.charCodeAt(0);if(o[0]>w||w>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return l<<=8,l|=w,l}identToString(c){const o=[];for(;c;)o.push(String.fromCharCode(255&c)),c>>=8;return o.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,o){const l=this._identifier(c,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const w=this._escHandlers[l];return w.push(o),{dispose:()=>{const L=w.indexOf(o);L!==-1&&w.splice(L,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,o){this._executeHandlers[c.charCodeAt(0)]=o}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,o){const l=this._identifier(c);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const w=this._csiHandlers[l];return w.push(o),{dispose:()=>{const L=w.indexOf(o);L!==-1&&w.splice(L,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,o){return this._dcsParser.registerHandler(this._identifier(c),o)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,o){return this._oscParser.registerHandler(c,o)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,o,l,w,L){this._parseStack.state=c,this._parseStack.handlers=o,this._parseStack.handlerPos=l,this._parseStack.transition=w,this._parseStack.chunkPos=L}parse(c,o,l){let w,L=0,E=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const x=this._parseStack.handlers;let P=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&P>-1){for(;P>=0&&(w=x[P](this._params),w!==!0);P--)if(w instanceof Promise)return this._parseStack.handlerPos=P,w}this._parseStack.handlers=[];break;case 4:if(l===!1&&P>-1){for(;P>=0&&(w=x[P](),w!==!0);P--)if(w instanceof Promise)return this._parseStack.handlerPos=P,w}this._parseStack.handlers=[];break;case 6:if(L=c[this._parseStack.chunkPos],w=this._dcsParser.unhook(L!==24&&L!==26,l),w)return w;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=c[this._parseStack.chunkPos],w=this._oscParser.end(L!==24&&L!==26,l),w)return w;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let x=D;x<o;++x){switch(L=c[x],E=this._transitions.table[this.currentState<<8|(L<160?L:k)],E>>4){case 2:for(let I=x+1;;++I){if(I>=o||(L=c[I])<32||L>126&&L<k){this._printHandler(c,x,I),x=I-1;break}if(++I>=o||(L=c[I])<32||L>126&&L<k){this._printHandler(c,x,I),x=I-1;break}if(++I>=o||(L=c[I])<32||L>126&&L<k){this._printHandler(c,x,I),x=I-1;break}if(++I>=o||(L=c[I])<32||L>126&&L<k){this._printHandler(c,x,I),x=I-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const P=this._csiHandlers[this._collect<<8|L];let H=P?P.length-1:-1;for(;H>=0&&(w=P[H](this._params),w!==!0);H--)if(w instanceof Promise)return this._preserveStack(3,P,H,E,x),w;H<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++x<o&&(L=c[x])>47&&L<60);x--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const $=this._escHandlers[this._collect<<8|L];let W=$?$.length-1:-1;for(;W>=0&&(w=$[W](),w!==!0);W--)if(w instanceof Promise)return this._preserveStack(4,$,W,E,x),w;W<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let I=x+1;;++I)if(I>=o||(L=c[I])===24||L===26||L===27||L>127&&L<k){this._dcsParser.put(c,x,I),x=I-1;break}break;case 14:if(w=this._dcsParser.unhook(L!==24&&L!==26),w)return this._preserveStack(6,[],0,E,x),w;L===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let I=x+1;;I++)if(I>=o||(L=c[I])<32||L>127&&L<k){this._oscParser.put(c,x,I),x=I-1;break}break;case 6:if(w=this._oscParser.end(L!==24&&L!==26),w)return this._preserveStack(5,[],0,E,x),w;L===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&E}}}i.EscapeSequenceParser=v},6242:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const m=d(5770),_=d(482),h=[];i.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,S){this._handlers[y]===void 0&&(this._handlers[y]=[]);const k=this._handlers[y];return k.push(S),{dispose:()=>{const v=k.indexOf(S);v!==-1&&k.splice(v,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,S,k){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(y,S,k);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(y,S,k))}start(){this.reset(),this._state=1}put(y,S,k){if(this._state!==3){if(this._state===1)for(;S<k;){const v=y[S++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&k-S>0&&this._put(y,S,k)}}end(y,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,v=this._active.length-1,n=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,k=S,n=this._stack.fallThrough,this._stack.paused=!1),!n&&k===!1){for(;v>=0&&(k=this._active[v].end(y),k!==!0);v--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,k;v--}for(;v>=0;v--)if(k=this._active[v].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",y);this._active=h,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,S,k){this._hitLimit||(this._data+=(0,_.utf32ToString)(y,S,k),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let S=!1;if(this._hitLimit)S=!1;else if(y&&(S=this._handler(this._data),S instanceof Promise))return S.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,S}}},8742:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const d=2147483647;class m{static fromArray(h){const y=new m;if(!h.length)return y;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const k=h[S];if(Array.isArray(k))for(let v=0;v<k.length;++v)y.addSubParam(k[v]);else y.addParam(k)}return y}constructor(h=32,y=32){if(this.maxLength=h,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new m(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let y=0;y<this.length;++y){h.push(this.params[y]);const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,k))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>d?d:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>d?d:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const y=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-y>0?this._subParams.subarray(y,S):null}getSubParamsAll(){const h={};for(let y=0;y<this.length;++y){const S=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-S>0&&(h[y]=this._subParams.slice(S,k))}return h}addDigit(h){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,k=S[y-1];S[y-1]=~k?Math.min(10*k+h,d):h}}i.Params=m},5741:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()}loadAddon(d,m){const _={instance:m,dispose:m.dispose,isDisposed:!1};this._addons.push(_),m.dispose=()=>this._wrappedAddonDispose(_),m.activate(d)}_wrappedAddonDispose(d){if(d.isDisposed)return;let m=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===d){m=_;break}if(m===-1)throw new Error("Could not dispose an addon that has not been loaded");d.isDisposed=!0,d.dispose.apply(d.instance),this._addons.splice(m,1)}}},8771:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const m=d(3785),_=d(511);i.BufferApiView=class{constructor(h,y){this._buffer=h,this.type=y}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const y=this._buffer.lines.get(h);if(y)return new m.BufferLineApiView(y)}getNullCell(){return new _.CellData}}},3785:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const m=d(511);i.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,h){if(!(_<0||_>=this._line.length))return h?(this._line.loadCell(_,h),h):this._line.loadCell(_,new m.CellData)}translateToString(_,h,y){return this._line.translateToString(_,h,y)}}},8285:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const m=d(8771),_=d(8460),h=d(844);class y extends h.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new m.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new m.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=y},7975:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(d){this._core=d}registerCsiHandler(d,m){return this._core.registerCsiHandler(d,(_=>m(_.toArray())))}addCsiHandler(d,m){return this.registerCsiHandler(d,m)}registerDcsHandler(d,m){return this._core.registerDcsHandler(d,((_,h)=>m(_,h.toArray())))}addDcsHandler(d,m){return this.registerDcsHandler(d,m)}registerEscHandler(d,m){return this._core.registerEscHandler(d,m)}addEscHandler(d,m){return this.registerEscHandler(d,m)}registerOscHandler(d,m){return this._core.registerOscHandler(d,m)}addOscHandler(d,m){return this.registerOscHandler(d,m)}}},7090:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(d){this._core=d}register(d){this._core.unicodeService.register(d)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(d){this._core.unicodeService.activeVersion=d}}},744:function(R,i,d){var m=this&&this.__decorate||function(n,c,o,l){var w,L=arguments.length,E=L<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(n,c,o,l);else for(var D=n.length-1;D>=0;D--)(w=n[D])&&(E=(L<3?w(E):L>3?w(c,o,E):w(c,o))||E);return L>3&&E&&Object.defineProperty(c,o,E),E},_=this&&this.__param||function(n,c){return function(o,l){c(o,l,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const h=d(8460),y=d(844),S=d(5295),k=d(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let v=i.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(n,this))}resize(n,c){this.cols=n,this.rows=c,this.buffers.resize(n,c),this._onResize.fire({cols:n,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,c=!1){const o=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===n.fg&&l.getBg(0)===n.bg||(l=o.getBlankLine(n,c),this._cachedBlankLine=l),l.isWrapped=c;const w=o.ybase+o.scrollTop,L=o.ybase+o.scrollBottom;if(o.scrollTop===0){const E=o.lines.isFull;L===o.lines.length-1?E?o.lines.recycle().copyFrom(l):o.lines.push(l.clone()):o.lines.splice(L+1,0,l.clone()),E?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const E=L-w+1;o.lines.shiftElements(w+1,E-1,-1),o.lines.set(L,l.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,c,o){const l=this.buffer;if(n<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else n+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const w=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+n,l.ybase),0),w!==l.ydisp&&(c||this._onScroll.fire(l.ydisp))}};i.BufferService=v=m([_(0,k.IOptionsService)],v)},7994:(R,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(d){this.glevel=d,this.charset=this._charsets[d]}setgCharset(d,m){this._charsets[d]=m,this.glevel===d&&(this.charset=m)}}},1753:function(R,i,d){var m=this&&this.__decorate||function(l,w,L,E){var D,x=arguments.length,P=x<3?w:E===null?E=Object.getOwnPropertyDescriptor(w,L):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,w,L,E);else for(var H=l.length-1;H>=0;H--)(D=l[H])&&(P=(x<3?D(P):x>3?D(w,L,P):D(w,L))||P);return x>3&&P&&Object.defineProperty(w,L,P),P},_=this&&this.__param||function(l,w){return function(L,E){w(L,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const h=d(2585),y=d(8460),S=d(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function v(l,w){let L=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(L|=64,L|=l.action):(L|=3&l.button,4&l.button&&(L|=64),8&l.button&&(L|=128),l.action===32?L|=32:l.action!==0||w||(L|=3)),L}const n=String.fromCharCode,c={DEFAULT:l=>{const w=[v(l,!1)+32,l.col+32,l.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${n(w[0])}${n(w[1])}${n(w[2])}`},SGR:l=>{const w=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.col};${l.row}${w}`},SGR_PIXELS:l=>{const w=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${v(l,!0)};${l.x};${l.y}${w}`}};let o=i.CoreMouseService=class extends S.Disposable{constructor(l,w){super(),this._bufferService=l,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(k))this.addProtocol(L,k[L]);for(const L of Object.keys(c))this.addEncoding(L,c[L]);this.reset()}addProtocol(l,w){this._protocols[l]=w}addEncoding(l,w){this._encodings[l]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const w=this._encodings[this._activeEncoding](l);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,w,L){if(L){if(l.x!==w.x||l.y!==w.y)return!1}else if(l.col!==w.col||l.row!==w.row)return!1;return l.button===w.button&&l.action===w.action&&l.ctrl===w.ctrl&&l.alt===w.alt&&l.shift===w.shift}};i.CoreMouseService=o=m([_(0,h.IBufferService),_(1,h.ICoreService)],o)},6975:function(R,i,d){var m=this&&this.__decorate||function(o,l,w,L){var E,D=arguments.length,x=D<3?l:L===null?L=Object.getOwnPropertyDescriptor(l,w):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(o,l,w,L);else for(var P=o.length-1;P>=0;P--)(E=o[P])&&(x=(D<3?E(x):D>3?E(l,w,x):E(l,w))||x);return D>3&&x&&Object.defineProperty(l,w,x),x},_=this&&this.__param||function(o,l){return function(w,L){l(w,L,o)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const h=d(1439),y=d(8460),S=d(844),k=d(2585),v=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=i.CoreService=class extends S.Disposable{constructor(o,l,w){super(),this._bufferService=o,this._logService=l,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(n)}triggerDataEvent(o,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(o))}};i.CoreService=c=m([_(0,k.IBufferService),_(1,k.ILogService),_(2,k.IOptionsService)],c)},9074:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const m=d(8055),_=d(8460),h=d(844),y=d(6106);let S=0,k=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((o=>o==null?void 0:o.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,h.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const l=new n(o);if(l){const w=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),w.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,l,w){let L=0,E=0;for(const D of this._decorations.getKeyIterator(l))L=D.options.x??0,E=L+(D.options.width??1),o>=L&&o<E&&(!w||(D.options.layer??"bottom")===w)&&(yield D)}forEachDecorationAtCell(o,l,w,L){this._decorations.forEachByKey(l,(E=>{S=E.options.x??0,k=S+(E.options.width??1),o>=S&&o<k&&(!w||(E.options.layer??"bottom")===w)&&L(E)}))}}i.DecorationService=v;class n extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=m.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=m.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,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=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const m=d(2585),_=d(8343);class h{constructor(...S){this._entries=new Map;for(const[k,v]of S)this.set(k,v)}set(S,k){const v=this._entries.get(S);return this._entries.set(S,k),v}forEach(S){for(const[k,v]of this._entries.entries())S(k,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}i.ServiceCollection=h,i.InstantiationService=class{constructor(){this._services=new h,this._services.set(m.IInstantiationService,this)}setService(y,S){this._services.set(y,S)}getService(y){return this._services.get(y)}createInstance(y,...S){const k=(0,_.getServiceDependencies)(y).sort(((c,o)=>c.index-o.index)),v=[];for(const c of k){const o=this._services.get(c.id);if(!o)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${c.id}.`);v.push(o)}const n=k.length>0?k[0].index:S.length;if(S.length!==n)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${n+1} conflicts with ${S.length} static arguments`);return new y(...S,...v)}}},7866:function(R,i,d){var m=this&&this.__decorate||function(n,c,o,l){var w,L=arguments.length,E=L<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,o):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(n,c,o,l);else for(var D=n.length-1;D>=0;D--)(w=n[D])&&(E=(L<3?w(E):L>3?w(c,o,E):w(c,o))||E);return L>3&&E&&Object.defineProperty(c,o,E),E},_=this&&this.__param||function(n,c){return function(o,l){c(o,l,n)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const h=d(844),y=d(2585),S={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let k,v=i.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let c=0;c<n.length;c++)typeof n[c]=="function"&&(n[c]=n[c]())}_log(n,c,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...o)}trace(n,...c){var o;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,c)}debug(n,...c){var o;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,c)}info(n,...c){var o;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,c)}warn(n,...c){var o;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,c)}error(n,...c){var o;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,c)}};i.LogService=v=m([_(0,y.IOptionsService)],v),i.setTraceLogger=function(n){k=n},i.traceCall=function(n,c,o){if(typeof o.value!="function")throw new Error("not supported");const l=o.value;o.value=function(...w){if(k.logLevel!==y.LogLevelEnum.TRACE)return l.apply(this,w);k.trace(`GlyphRenderer#${l.name}(${w.map((E=>JSON.stringify(E))).join(", ")})`);const L=l.apply(this,w);return k.trace(`GlyphRenderer#${l.name} return`,L),L}}},7302:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const m=d(8460),_=d(844),h=d(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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends _.Disposable{constructor(v){super(),this._onOptionChange=this.register(new m.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...i.DEFAULT_OPTIONS};for(const c in v)if(c in n)try{const o=v[c];n[c]=this._sanitizeAndValidateOption(c,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(v,n){return this.onOptionChange((c=>{c===v&&n(this.rawOptions[v])}))}onMultipleOptionChange(v,n){return this.onOptionChange((c=>{v.indexOf(c)!==-1&&n()}))}_setupOptions(){const v=c=>{if(!(c in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},n=(c,o)=>{if(!(c in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);o=this._sanitizeAndValidateOption(c,o),this.rawOptions[c]!==o&&(this.rawOptions[c]=o,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const o={get:v.bind(this,c),set:n.bind(this,c)};Object.defineProperty(this.options,c,o)}}_sanitizeAndValidateOption(v,n){switch(v){case"cursorStyle":if(n||(n=i.DEFAULT_OPTIONS[v]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${v}`);break;case"wordSeparator":n||(n=i.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=y.includes(n)?n:i.DEFAULT_OPTIONS[v];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${v} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${v} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}i.OptionsService=S},2660:function(R,i,d){var m=this&&this.__decorate||function(S,k,v,n){var c,o=arguments.length,l=o<3?k:n===null?n=Object.getOwnPropertyDescriptor(k,v):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,k,v,n);else for(var w=S.length-1;w>=0;w--)(c=S[w])&&(l=(o<3?c(l):o>3?c(k,v,l):c(k,v))||l);return o>3&&l&&Object.defineProperty(k,v,l),l},_=this&&this.__param||function(S,k){return function(v,n){k(v,n,S)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const h=d(2585);let y=i.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const k=this._bufferService.buffer;if(S.id===void 0){const w=k.addMarker(k.ybase+k.y),L={data:S,id:this._nextId++,lines:[w]};return w.onDispose((()=>this._removeMarkerFromLink(L,w))),this._dataByLinkId.set(L.id,L),L.id}const v=S,n=this._getEntryIdKey(v),c=this._entriesWithId.get(n);if(c)return this.addLineToLink(c.id,k.ybase+k.y),c.id;const o=k.addMarker(k.ybase+k.y),l={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(l,o))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,k){const v=this._dataByLinkId.get(S);if(v&&v.lines.every((n=>n.line!==k))){const n=this._bufferService.buffer.addMarker(k);v.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(v,n)))}}getLinkData(S){var k;return(k=this._dataByLinkId.get(S))==null?void 0:k.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,k){const v=S.lines.indexOf(k);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};i.OscLinkService=y=m([_(0,h.IBufferService)],y)},8343:(R,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const d="di$target",m="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(_){return _[m]||[]},i.createDecorator=function(_){if(i.serviceRegistry.has(_))return i.serviceRegistry.get(_);const h=function(y,S,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,n,c){n[d]===n?n[m].push({id:v,index:c}):(n[m]=[{id:v,index:c}],n[d]=n)})(h,y,k)};return h.toString=()=>_,i.serviceRegistry.set(_,h),h}},2585:(R,i,d)=>{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 m=d(8343);var _;i.IBufferService=(0,m.createDecorator)("BufferService"),i.ICoreMouseService=(0,m.createDecorator)("CoreMouseService"),i.ICoreService=(0,m.createDecorator)("CoreService"),i.ICharsetService=(0,m.createDecorator)("CharsetService"),i.IInstantiationService=(0,m.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(_||(i.LogLevelEnum=_={})),i.ILogService=(0,m.createDecorator)("LogService"),i.IOptionsService=(0,m.createDecorator)("OptionsService"),i.IOscLinkService=(0,m.createDecorator)("OscLinkService"),i.IUnicodeService=(0,m.createDecorator)("UnicodeService"),i.IDecorationService=(0,m.createDecorator)("DecorationService")},1480:(R,i,d)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const m=d(8460),_=d(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,k,v=!1){return(16777215&S)<<3|(3&k)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new m.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 k=0,v=0;const n=S.length;for(let c=0;c<n;++c){let o=S.charCodeAt(c);if(55296<=o&&o<=56319){if(++c>=n)return k+this.wcwidth(o);const L=S.charCodeAt(c);56320<=L&&L<=57343?o=1024*(o-55296)+L-56320+65536:k+=this.wcwidth(L)}const l=this.charProperties(o,v);let w=h.extractWidth(l);h.extractShouldJoin(l)&&(w-=h.extractWidth(v)),k+=w,v=l}return k}charProperties(S,k){return this._activeProvider.charProperties(S,k)}}i.UnicodeService=h}},C={};function j(R){var i=C[R];if(i!==void 0)return i.exports;var d=C[R]={exports:{}};return f[R].call(d.exports,d,d.exports,j),d.exports}var M={};return(()=>{var R=M;Object.defineProperty(R,"__esModule",{value:!0}),R.Terminal=void 0;const i=j(9042),d=j(3236),m=j(844),_=j(5741),h=j(8285),y=j(7975),S=j(7090),k=["cols","rows"];class v extends m.Disposable{constructor(c){super(),this._core=this.register(new d.Terminal(c)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const o=w=>this._core.options[w],l=(w,L)=>{this._checkReadonlyOptions(w),this._core.options[w]=L};for(const w in this._core.options){const L={get:o.bind(this,w),set:l.bind(this,w)};Object.defineProperty(this._publicOptions,w,L)}}_checkReadonlyOptions(c){if(k.includes(c))throw new Error(`Option "${c}" 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 y.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const o in c)this._publicOptions[o]=c[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,o=!0){this._core.input(c,o)}resize(c,o){this._verifyIntegers(c,o),this._core.resize(c,o)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,o,l){this._verifyIntegers(c,o,l),this._core.select(c,o,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,o){this._verifyIntegers(c,o),this._core.selectLines(c,o)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,o){this._core.write(c,o)}writeln(c,o){this._core.write(c),this._core.write(`\r
|
|
50
|
+
`,o)}paste(c){this._core.paste(c)}refresh(c,o){this._verifyIntegers(c,o),this._core.refresh(c,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return i}_verifyIntegers(...c){for(const o of c)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const o of c)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}R.Terminal=v})(),M})()))})(Ua)),Ua.exports}var Tp=Pp(),Wa={exports:{}},ud;function Ap(){return ud||(ud=1,(function(a,p){(function(f,C){a.exports=C()})(self,(()=>(()=>{var f={};return(()=>{var C=f;Object.defineProperty(C,"__esModule",{value:!0}),C.FitAddon=void 0,C.FitAddon=class{activate(j){this._terminal=j}dispose(){}fit(){const j=this.proposeDimensions();if(!j||!this._terminal||isNaN(j.cols)||isNaN(j.rows))return;const M=this._terminal._core;this._terminal.rows===j.rows&&this._terminal.cols===j.cols||(M._renderService.clear(),this._terminal.resize(j.cols,j.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const j=this._terminal._core,M=j._renderService.dimensions;if(M.css.cell.width===0||M.css.cell.height===0)return;const R=this._terminal.options.scrollback===0?0:j.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),d=parseInt(i.getPropertyValue("height")),m=Math.max(0,parseInt(i.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),h=d-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),y=m-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-R;return{cols:Math.max(2,Math.floor(y/M.css.cell.width)),rows:Math.max(1,Math.floor(h/M.css.cell.height))}}}})(),f})()))})(Wa)),Wa.exports}var Mp=Ap(),za={exports:{}},dd;function Op(){return dd||(dd=1,(function(a,p){(function(f,C){a.exports=C()})(self,(()=>(()=>{var f={6:(R,i)=>{function d(_){try{const h=new URL(_),y=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return _.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(_,h,y,S={}){this._terminal=_,this._regex=h,this._handler=y,this._options=S}provideLinks(_,h){const y=m.computeLink(_,this._regex,this._terminal,this._handler);h(this._addCallbacks(y))}_addCallbacks(_){return _.map((h=>(h.leave=this._options.leave,h.hover=(y,S)=>{if(this._options.hover){const{range:k}=h;this._options.hover(y,S,k)}},h)))}};class m{static computeLink(h,y,S,k){const v=new RegExp(y.source,(y.flags||"")+"g"),[n,c]=m._getWindowedLineStrings(h-1,S),o=n.join("");let l;const w=[];for(;l=v.exec(o);){const L=l[0];if(!d(L))continue;const[E,D]=m._mapStrIdx(S,c,0,l.index),[x,P]=m._mapStrIdx(S,E,D,L.length);if(E===-1||D===-1||x===-1||P===-1)continue;const H={start:{x:D+1,y:E+1},end:{x:P,y:x+1}};w.push({range:H,text:L,activate:k})}return w}static _getWindowedLineStrings(h,y){let S,k=h,v=h,n=0,c="";const o=[];if(S=y.buffer.active.getLine(h)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(n=0;(S=y.buffer.active.getLine(--k))&&n<2048&&(c=S.translateToString(!0),n+=c.length,o.push(c),S.isWrapped&&c.indexOf(" ")===-1););o.reverse()}for(o.push(l),n=0;(S=y.buffer.active.getLine(++v))&&S.isWrapped&&n<2048&&(c=S.translateToString(!0),n+=c.length,o.push(c),c.indexOf(" ")===-1););}return[o,k]}static _mapStrIdx(h,y,S,k){const v=h.buffer.active,n=v.getNullCell();let c=S;for(;k;){const o=v.getLine(y);if(!o)return[-1,-1];for(let l=c;l<o.length;++l){o.getCell(l,n);const w=n.getChars();if(n.getWidth()&&(k-=w.length||1,l===o.length-1&&w==="")){const L=v.getLine(y+1);L&&L.isWrapped&&(L.getCell(0,n),n.getWidth()===2&&(k+=1))}if(k<0)return[y,l]}y++,c=0}return[y,c]}}i.LinkComputer=m}},C={};function j(R){var i=C[R];if(i!==void 0)return i.exports;var d=C[R]={exports:{}};return f[R](d,d.exports,j),d.exports}var M={};return(()=>{var R=M;Object.defineProperty(R,"__esModule",{value:!0}),R.WebLinksAddon=void 0;const i=j(6),d=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function m(_,h){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}R.WebLinksAddon=class{constructor(_=m,h={}){this._handler=_,this._options=h}activate(_){this._terminal=_;const h=this._options,y=h.urlRegex||d;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,y,this._handler,h))}dispose(){var _;(_=this._linkProvider)==null||_.dispose()}}})(),M})()))})(za)),za.exports}var Np=Op();function Ip({tabId:a,cwd:p}){const f=K.useRef(null),C=K.useRef(null),j=K.useRef(null),M=K.useRef(!1);return K.useEffect(()=>{if(console.log("[Terminal] mount effect running, tabId=",a,"cwd=",p,"alreadySpawned=",M.current),!f.current||M.current)return;M.current=!0;const R=new Tp.Terminal({fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,allowProposedApi:!0,theme:{background:"#0b0d10",foreground:"#e6e8ec",cursor:"#d97757",selectionBackground:"#3a4250",black:"#1a1f27",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#e6e8ec",brightBlack:"#545c68",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}}),i=new Mp.FitAddon;R.loadAddon(i),R.loadAddon(new Np.WebLinksAddon),R.open(f.current),i.fit(),R.focus(),C.current=R,j.current=i;const{cols:d,rows:m}=R,_=window.api.pty.onData(a,k=>R.write(k)),h=window.api.pty.onExit(a,({exitCode:k})=>{R.write(`\r
|
|
51
51
|
\x1B[38;5;240m[session exited code=${k}]\x1B[0m\r
|
|
52
|
-
`),Le.getState().setTabExited(a,k)});R.onData(k=>window.api.pty.write({tabId:a,data:k})),R.onResize(({cols:k,rows:v})=>window.api.pty.resize({tabId:a,cols:k,rows:v})),console.log("[Terminal] calling pty.spawn",{tabId:a,cwd:p,cols:d,rows:m}),window.api.pty.spawn({tabId:a,cwd:p,cols:d,rows:m}).then(({pid:k,reattached:v})=>{if(console.log("[Terminal] pty.spawn resolved, pid=",k,"tabId=",a,"reattached=",v),Le.getState().setTabRunning(a,k),v)return;const{startupCommand:n}=Le.getState().tabs.find(
|
|
52
|
+
`),Le.getState().setTabExited(a,k)});R.onData(k=>window.api.pty.write({tabId:a,data:k})),R.onResize(({cols:k,rows:v})=>window.api.pty.resize({tabId:a,cols:k,rows:v})),console.log("[Terminal] calling pty.spawn",{tabId:a,cwd:p,cols:d,rows:m}),window.api.pty.spawn({tabId:a,cwd:p,cols:d,rows:m}).then(({pid:k,reattached:v})=>{if(console.log("[Terminal] pty.spawn resolved, pid=",k,"tabId=",a,"reattached=",v),Le.getState().setTabRunning(a,k),v)return;const{startupCommand:n}=Le.getState().tabs.find(c=>c.id===a)??{};n&&setTimeout(()=>{window.api.pty.write({tabId:a,data:`${n}
|
|
53
53
|
`})},350)}).catch(k=>{console.error("[Terminal] pty.spawn rejected for tabId=",a,k),R.write(`\r
|
|
54
54
|
\x1B[31mfailed to spawn: ${k.message}\x1B[0m\r
|
|
55
|
-
`),Le.getState().setTabExited(a,-1)});const y=()=>i.fit();window.addEventListener("resize",y);const S=new ResizeObserver(()=>i.fit());return S.observe(f.current),()=>{window.removeEventListener("resize",y),S.disconnect(),_(),h(),R.dispose()}},[a,p]),
|
|
55
|
+
`),Le.getState().setTabExited(a,-1)});const y=()=>i.fit();window.addEventListener("resize",y);const S=new ResizeObserver(()=>i.fit());return S.observe(f.current),()=>{window.removeEventListener("resize",y),S.disconnect(),_(),h(),R.dispose()}},[a,p]),u.jsx("div",{ref:f,onMouseDown:()=>{var R;return(R=C.current)==null?void 0:R.focus()},className:"h-full w-full bg-bg"})}function Pe({toolbar:a,footer:p,children:f}){return u.jsxs("div",{className:"h-full flex flex-col",children:[a&&u.jsx("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:a}),u.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:f}),p&&u.jsx("div",{className:"shrink-0 border-t border-line bg-bg-elev",children:p})]})}function xe({title:a,hint:p}){return u.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:u.jsxs("div",{className:"text-center max-w-md",children:[u.jsx("div",{className:"mb-2 text-fg-dim",children:a}),p&&u.jsx("div",{className:"text-fg-faint",children:p})]})})}let Es=null;const Za=new Set;let Pn=null;function Bp(){return Es?Promise.resolve(Es):Pn||(Pn=window.api.app.homeDir().then(a=>(Es=a,Za.forEach(p=>p(a)),a)),Pn)}function Ke(){const[a,p]=K.useState(Es);return K.useEffect(()=>{if(Es){p(Es);return}const f=C=>p(C);return Za.add(f),Bp(),()=>{Za.delete(f)}},[]),a}function Fp(){const a=Ke(),p=Le(j=>j.tabs),[f,C]=K.useState(null);return K.useEffect(()=>{if(!a)return;let j=!1;return(async()=>{try{const[M,R,i,d,m,_,h]=await Promise.all([window.api.config.listDir(`${a}/.claude/projects`,{dirsOnly:!0}),window.api.config.listDir(`${a}/.claude/skills`,{dirsOnly:!0}),window.api.config.listDir(`${a}/.claude/agents`,{filesOnly:!0}),window.api.config.listDir(`${a}/.claude/plugins`,{dirsOnly:!0}),window.api.config.exists(`${a}/.claude/settings.json`),window.api.config.exists(`${a}/.claude/CLAUDE.md`),window.api.config.readJson(`${a}/.claude.json`)]);let y=0;for(const k of M.entries){if(j)return;const v=await window.api.config.listDir(k.path,{filesOnly:!0});y+=v.entries.filter(n=>n.name.endsWith(".jsonl")).length}const S=h.data&&typeof h.data=="object"&&"mcpServers"in h.data?Object.keys(h.data.mcpServers??{}).length:0;j||C({projects:M.entries.length,sessions:y,skills:R.entries.length,agents:i.entries.filter(k=>k.name.endsWith(".md")).length,mcpServers:S,plugins:d.entries.length,settingsExists:m,claudeMdExists:_})}catch(M){console.error("[Overview] scan failed:",M)}})(),()=>{j=!0}},[a]),a?u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-faint",children:"home"}),u.jsx("span",{className:"ml-2 text-fg-dim font-mono truncate",children:a}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[p.length," open tabs"]})]}),children:f?u.jsxs("div",{className:"p-6 max-w-4xl space-y-6",children:[u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"User Configuration"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Dr,{label:"settings.json",value:f.settingsExists?"exists":"not created",dim:!f.settingsExists}),u.jsx(Dr,{label:"CLAUDE.md",value:f.claudeMdExists?"exists":"not created",dim:!f.claudeMdExists}),u.jsx(Dr,{label:"skills",value:f.skills.toString()}),u.jsx(Dr,{label:"subagents",value:f.agents.toString()}),u.jsx(Dr,{label:"MCP servers",value:f.mcpServers.toString()}),u.jsx(Dr,{label:"plugins",value:f.plugins.toString()})]})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-3",children:"Session History"}),u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsx(Dr,{label:"projects with history",value:f.projects.toString()}),u.jsx(Dr,{label:"total transcripts",value:f.sessions.toString()})]})]})]}):u.jsx(xe,{title:"scanning ~/.claude…"})}):u.jsx(xe,{title:"loading…"})}function Dr({label:a,value:p,dim:f}){return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:a}),u.jsx("div",{className:`text-base font-mono ${f?"text-fg-faint":"text-fg"}`,children:p})]})}function Yr(...a){return a.filter(Boolean).map((p,f)=>f===0?p.replace(/\/+$/,""):p.replace(/^\/+|\/+$/g,"")).join("/")}const Ls={scopes:["user","project","local"],resolve:(a,p,f)=>a==="user"?Yr(p,".claude","settings.json"):f?a==="project"?Yr(f,".claude","settings.json"):Yr(f,".claude","settings.local.json"):null},Va={scopes:["user","project","local"],resolve:(a,p,f)=>a==="user"?Yr(p,".claude","CLAUDE.md"):f?a==="project"?Yr(f,"CLAUDE.md"):Yr(f,"CLAUDE.local.md"):null},qa=Ls,Hp={scopes:["user"],resolve:(a,p)=>a==="user"?Yr(p,".claude","keybindings.json"):null},lt={user:{label:"User",hint:"~/.claude/ — applies to all projects"},project:{label:"Project",hint:"<cwd>/.claude/ — checked into git"},local:{label:"Local",hint:"<cwd>/.claude/…local — gitignored, per-machine"}};function Xt({scopes:a,active:p,onChange:f,annotate:C}){return u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:a.map(j=>{const M=lt[j],R=C==null?void 0:C(j),i=j===p;return u.jsxs("button",{title:M.hint,onClick:()=>f(j),className:`px-2.5 py-1 text-xs flex items-center gap-1.5 transition-colors ${i?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{children:M.label}),(R==null?void 0:R.dirty)&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-accent",title:"unsaved edits"}),R&&R.exists===!1&&!R.dirty&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-fg-faint",title:"not yet created"})]},j)})})}function $p(a){if(!a)return"";const p=Math.max(0,Date.now()-a);return p<6e4?`saved ${Math.round(p/1e3)}s ago`:p<36e5?`saved ${Math.round(p/6e4)}m ago`:`saved ${Math.round(p/36e5)}h ago`}function Tr({dirty:a,busy:p,parseError:f,lastSavedAt:C,onSave:j,onRevert:M,leading:R}){const i=a&&!p&&!f;return u.jsxs("div",{className:"px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("div",{className:"flex-1 min-w-0 truncate text-fg-faint",children:R}),f&&u.jsx("span",{className:"text-red-400 truncate max-w-xs",title:f,children:f}),!a&&!f&&C&&u.jsx("span",{className:"text-fg-faint",children:$p(C)}),a&&!f&&u.jsx("span",{className:"text-accent",children:"unsaved"}),u.jsx("button",{onClick:M,disabled:!a||p,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40 disabled:cursor-not-allowed",children:"Revert"}),u.jsx("button",{onClick:j,disabled:!i,className:`px-2.5 py-0.5 rounded border ${i?"border-accent bg-accent/15 text-accent hover:bg-accent/25":"border-line text-fg-faint opacity-50 cursor-not-allowed"}`,children:p?"Saving…":"Save"})]})}const Up="modulepreload",Wp=function(a,p){return new URL(a,p).href},hd={},zp=function(p,f,C){let j=Promise.resolve();if(f&&f.length>0){let R=function(_){return Promise.all(_.map(h=>Promise.resolve(h).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};const i=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),m=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));j=R(f.map(_=>{if(_=Wp(_,C),_ in hd)return;hd[_]=!0;const h=_.endsWith(".css"),y=h?'[rel="stylesheet"]':"";if(!!C)for(let v=i.length-1;v>=0;v--){const n=i[v];if(n.href===_&&(!h||n.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${y}`))return;const k=document.createElement("link");if(k.rel=h?"stylesheet":Up,h||(k.as="script"),k.crossOrigin="",k.href=_,m&&k.setAttribute("nonce",m),document.head.appendChild(k),h)return new Promise((v,n)=>{k.addEventListener("load",v),k.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${_}`)))})}))}function M(R){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=R,window.dispatchEvent(i),!i.defaultPrevented)throw R}return j.then(R=>{for(const i of R||[])i.status==="rejected"&&M(i.reason);return p().catch(M)})};function fd(a,p){(p==null||p>a.length)&&(p=a.length);for(var f=0,C=Array(p);f<p;f++)C[f]=a[f];return C}function Vp(a){if(Array.isArray(a))return a}function qp(a,p,f){return(p=Zp(p))in a?Object.defineProperty(a,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):a[p]=f,a}function Kp(a,p){var f=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(f!=null){var C,j,M,R,i=[],d=!0,m=!1;try{if(M=(f=f.call(a)).next,p!==0)for(;!(d=(C=M.call(f)).done)&&(i.push(C.value),i.length!==p);d=!0);}catch(_){m=!0,j=_}finally{try{if(!d&&f.return!=null&&(R=f.return(),Object(R)!==R))return}finally{if(m)throw j}}return i}}function Gp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
56
56
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pd(a,p){var f=Object.keys(a);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(a);p&&(C=C.filter(function(j){return Object.getOwnPropertyDescriptor(a,j).enumerable})),f.push.apply(f,C)}return f}function md(a){for(var p=1;p<arguments.length;p++){var f=arguments[p]!=null?arguments[p]:{};p%2?pd(Object(f),!0).forEach(function(C){qp(a,C,f[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(f)):pd(Object(f)).forEach(function(C){Object.defineProperty(a,C,Object.getOwnPropertyDescriptor(f,C))})}return a}function Jp(a,p){if(a==null)return{};var f,C,j=Xp(a,p);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(a);for(C=0;C<M.length;C++)f=M[C],p.indexOf(f)===-1&&{}.propertyIsEnumerable.call(a,f)&&(j[f]=a[f])}return j}function Xp(a,p){if(a==null)return{};var f={};for(var C in a)if({}.hasOwnProperty.call(a,C)){if(p.indexOf(C)!==-1)continue;f[C]=a[C]}return f}function Qp(a,p){return Vp(a)||Kp(a,p)||em(a,p)||Gp()}function Yp(a,p){if(typeof a!="object"||!a)return a;var f=a[Symbol.toPrimitive];if(f!==void 0){var C=f.call(a,p);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(a)}function Zp(a){var p=Yp(a,"string");return typeof p=="symbol"?p:p+""}function em(a,p){if(a){if(typeof a=="string")return fd(a,p);var f={}.toString.call(a).slice(8,-1);return f==="Object"&&a.constructor&&(f=a.constructor.name),f==="Map"||f==="Set"?Array.from(a):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?fd(a,p):void 0}}function tm(a,p,f){return p in a?Object.defineProperty(a,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):a[p]=f,a}function gd(a,p){var f=Object.keys(a);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(a);p&&(C=C.filter(function(j){return Object.getOwnPropertyDescriptor(a,j).enumerable})),f.push.apply(f,C)}return f}function vd(a){for(var p=1;p<arguments.length;p++){var f=arguments[p]!=null?arguments[p]:{};p%2?gd(Object(f),!0).forEach(function(C){tm(a,C,f[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(f)):gd(Object(f)).forEach(function(C){Object.defineProperty(a,C,Object.getOwnPropertyDescriptor(f,C))})}return a}function rm(){for(var a=arguments.length,p=new Array(a),f=0;f<a;f++)p[f]=arguments[f];return function(C){return p.reduceRight(function(j,M){return M(j)},C)}}function mi(a){return function p(){for(var f=this,C=arguments.length,j=new Array(C),M=0;M<C;M++)j[M]=arguments[M];return j.length>=a.length?a.apply(this,j):function(){for(var R=arguments.length,i=new Array(R),d=0;d<R;d++)i[d]=arguments[d];return p.apply(f,[].concat(j,i))}}}function Bn(a){return{}.toString.call(a).includes("Object")}function sm(a){return!Object.keys(a).length}function vi(a){return typeof a=="function"}function im(a,p){return Object.prototype.hasOwnProperty.call(a,p)}function nm(a,p){return Bn(p)||Pr("changeType"),Object.keys(p).some(function(f){return!im(a,f)})&&Pr("changeField"),p}function om(a){vi(a)||Pr("selectorType")}function am(a){vi(a)||Bn(a)||Pr("handlerType"),Bn(a)&&Object.values(a).some(function(p){return!vi(p)})&&Pr("handlersType")}function lm(a){a||Pr("initialIsRequired"),Bn(a)||Pr("initialType"),sm(a)&&Pr("initialContent")}function cm(a,p){throw new Error(a[p]||a.default)}var um={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Pr=mi(cm)(um),Tn={changes:nm,selector:om,handler:am,initial:lm};function dm(a){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Tn.initial(a),Tn.handler(p);var f={current:a},C=mi(pm)(f,p),j=mi(fm)(f),M=mi(Tn.changes)(a),R=mi(hm)(f);function i(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(_){return _};return Tn.selector(m),m(f.current)}function d(m){rm(C,j,M,R)(m)}return[i,d]}function hm(a,p){return vi(p)?p(a.current):p}function fm(a,p){return a.current=vd(vd({},a.current),p),p}function pm(a,p,f){return vi(p)?p(a.current):Object.keys(f).forEach(function(C){var j;return(j=p[C])===null||j===void 0?void 0:j.call(p,a.current[C])}),f}var mm={create:dm},gm={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function vm(a){return function p(){for(var f=this,C=arguments.length,j=new Array(C),M=0;M<C;M++)j[M]=arguments[M];return j.length>=a.length?a.apply(this,j):function(){for(var R=arguments.length,i=new Array(R),d=0;d<R;d++)i[d]=arguments[d];return p.apply(f,[].concat(j,i))}}}function _m(a){return{}.toString.call(a).includes("Object")}function ym(a){return a||_d("configIsRequired"),_m(a)||_d("configType"),a.urls?(wm(),{paths:{vs:a.urls.monacoBase}}):a}function wm(){console.warn(Id.deprecation)}function Sm(a,p){throw new Error(a[p]||a.default)}var Id={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
57
57
|
You are using deprecated way of configuration.
|
|
58
58
|
|
|
@@ -62,11 +62,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
62
62
|
monaco.config({ paths: { vs: '...' } })
|
|
63
63
|
|
|
64
64
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
65
|
-
`},_d=vm(Sm)(Id),xm={config:ym},bm=function(){for(var p=arguments.length,f=new Array(p),C=0;C<p;C++)f[C]=arguments[C];return function(j){return f.reduceRight(function(M,R){return R(M)},j)}};function Bd(a,p){return Object.keys(p).forEach(function(f){p[f]instanceof Object&&a[f]&&Object.assign(p[f],Bd(a[f],p[f]))}),md(md({},a),p)}var Cm={type:"cancelation",msg:"operation is manually canceled"};function Ka(a){var p=!1,f=new Promise(function(C,j){a.then(function(M){return p?j(Cm):C(M)}),a.catch(j)});return f.cancel=function(){return p=!0},f}var km=["monaco"],Em=mm.create({config:gm,isInitialized:!1,resolve:null,reject:null,monaco:null}),Fd=Qp(Em,2),yi=Fd[0],Un=Fd[1];function Lm(a){var p=xm.config(a),f=p.monaco,C=Jp(p,km);Un(function(j){return{config:Bd(j.config,C),monaco:f}})}function Rm(){var a=yi(function(p){var f=p.monaco,C=p.isInitialized,j=p.resolve;return{monaco:f,isInitialized:C,resolve:j}});if(!a.isInitialized){if(Un({isInitialized:!0}),a.monaco)return a.resolve(a.monaco),Ka(Ga);if(window.monaco&&window.monaco.editor)return Hd(window.monaco),a.resolve(window.monaco),Ka(Ga);bm(jm,Pm)(Tm)}return Ka(Ga)}function jm(a){return document.body.appendChild(a)}function Dm(a){var p=document.createElement("script");return a&&(p.src=a),p}function Pm(a){var p=yi(function(C){var j=C.config,M=C.reject;return{config:j,reject:M}}),f=Dm("".concat(p.config.paths.vs,"/loader.js"));return f.onload=function(){return a()},f.onerror=p.reject,f}function Tm(){var a=yi(function(f){var C=f.config,j=f.resolve,M=f.reject;return{config:C,resolve:j,reject:M}}),p=window.require;p.config(a.config),p(["vs/editor/editor.main"],function(f){var C=f.m||f;Hd(C),a.resolve(C)},function(f){a.reject(f)})}function Hd(a){yi().monaco||Un({monaco:a})}function Am(){return yi(function(a){var p=a.monaco;return p})}var Ga=new Promise(function(a,p){return Un({resolve:a,reject:p})}),$d={config:Lm,init:Rm,__getMonacoInstance:Am},Mm={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ja=Mm,Om={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Nm=Om;function Im({children:a}){return Gt.createElement("div",{style:Nm.container},a)}var Bm=Im,Fm=Bm;function Hm({width:a,height:p,isEditorReady:f,loading:C,_ref:j,className:M,wrapperProps:R}){return Gt.createElement("section",{style:{...Ja.wrapper,width:a,height:p},...R},!f&&Gt.createElement(Fm,null,C),Gt.createElement("div",{ref:j,style:{...Ja.fullWidth,...!f&&Ja.hide},className:M}))}var $m=Hm,Ud=K.memo($m);function Um(a){K.useEffect(a,[])}var Wd=Um;function Wm(a,p,f=!0){let C=K.useRef(!0);K.useEffect(C.current||!f?()=>{C.current=!1}:a,p)}var xt=Wm;function gi(){}function ks(a,p,f,C){return zm(a,C)||Vm(a,p,f,C)}function zm(a,p){return a.editor.getModel(zd(a,p))}function Vm(a,p,f,C){return a.editor.createModel(p,f,C?zd(a,C):void 0)}function zd(a,p){return a.Uri.parse(p)}function qm({original:a,modified:p,language:f,originalLanguage:C,modifiedLanguage:j,originalModelPath:M,modifiedModelPath:R,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:d=!1,theme:m="light",loading:_="Loading...",options:h={},height:y="100%",width:S="100%",className:k,wrapperProps:v={},beforeMount:n=gi,onMount:u=gi}){let[o,l]=K.useState(!1),[w,E]=K.useState(!0),L=K.useRef(null),D=K.useRef(null),x=K.useRef(null),P=K.useRef(u),H=K.useRef(n),$=K.useRef(!1);Wd(()=>{let q=$d.init();return q.then(z=>(D.current=z)&&E(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>L.current?X():q.cancel()}),xt(()=>{if(L.current&&D.current){let q=L.current.getOriginalEditor(),z=ks(D.current,a||"",C||f||"text",M||"");z!==q.getModel()&&q.setModel(z)}},[M],o),xt(()=>{if(L.current&&D.current){let q=L.current.getModifiedEditor(),z=ks(D.current,p||"",j||f||"text",R||"");z!==q.getModel()&&q.setModel(z)}},[R],o),xt(()=>{let q=L.current.getModifiedEditor();q.getOption(D.current.editor.EditorOption.readOnly)?q.setValue(p||""):p!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:p||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[p],o),xt(()=>{var q,z;(z=(q=L.current)==null?void 0:q.getModel())==null||z.original.setValue(a||"")},[a],o),xt(()=>{let{original:q,modified:z}=L.current.getModel();D.current.editor.setModelLanguage(q,C||f||"text"),D.current.editor.setModelLanguage(z,j||f||"text")},[f,C,j],o),xt(()=>{var q;(q=D.current)==null||q.editor.setTheme(m)},[m],o),xt(()=>{var q;(q=L.current)==null||q.updateOptions(h)},[h],o);let W=K.useCallback(()=>{var re;if(!D.current)return;H.current(D.current);let q=ks(D.current,a||"",C||f||"text",M||""),z=ks(D.current,p||"",j||f||"text",R||"");(re=L.current)==null||re.setModel({original:q,modified:z})},[f,p,j,a,C,M,R]),I=K.useCallback(()=>{var q;!$.current&&x.current&&(L.current=D.current.editor.createDiffEditor(x.current,{automaticLayout:!0,...h}),W(),(q=D.current)==null||q.editor.setTheme(m),l(!0),$.current=!0)},[h,m,W]);K.useEffect(()=>{o&&P.current(L.current,D.current)},[o]),K.useEffect(()=>{!w&&!o&&I()},[w,o,I]);function X(){var z,re,Q,A;let q=(z=L.current)==null?void 0:z.getModel();i||((re=q==null?void 0:q.original)==null||re.dispose()),d||((Q=q==null?void 0:q.modified)==null||Q.dispose()),(A=L.current)==null||A.dispose()}return Gt.createElement(Ud,{width:S,height:y,isEditorReady:o,loading:_,_ref:x,className:k,wrapperProps:v})}var Km=qm;K.memo(Km);function Gm(a){let p=K.useRef();return K.useEffect(()=>{p.current=a},[a]),p.current}var Jm=Gm,An=new Map;function Xm({defaultValue:a,defaultLanguage:p,defaultPath:f,value:C,language:j,path:M,theme:R="light",line:i,loading:d="Loading...",options:m={},overrideServices:_={},saveViewState:h=!0,keepCurrentModel:y=!1,width:S="100%",height:k="100%",className:v,wrapperProps:n={},beforeMount:u=gi,onMount:o=gi,onChange:l,onValidate:w=gi}){let[E,L]=K.useState(!1),[D,x]=K.useState(!0),P=K.useRef(null),H=K.useRef(null),$=K.useRef(null),W=K.useRef(o),I=K.useRef(u),X=K.useRef(),q=K.useRef(C),z=Jm(M),re=K.useRef(!1),Q=K.useRef(!1);Wd(()=>{let T=$d.init();return T.then(F=>(P.current=F)&&x(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>H.current?B():T.cancel()}),xt(()=>{var F,ee,ne,ce;let T=ks(P.current,a||C||"",p||j||"",M||f||"");T!==((F=H.current)==null?void 0:F.getModel())&&(h&&An.set(z,(ee=H.current)==null?void 0:ee.saveViewState()),(ne=H.current)==null||ne.setModel(T),h&&((ce=H.current)==null||ce.restoreViewState(An.get(M))))},[M],E),xt(()=>{var T;(T=H.current)==null||T.updateOptions(m)},[m],E),xt(()=>{!H.current||C===void 0||(H.current.getOption(P.current.editor.EditorOption.readOnly)?H.current.setValue(C):C!==H.current.getValue()&&(Q.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:C,forceMoveMarkers:!0}]),H.current.pushUndoStop(),Q.current=!1))},[C],E),xt(()=>{var F,ee;let T=(F=H.current)==null?void 0:F.getModel();T&&j&&((ee=P.current)==null||ee.editor.setModelLanguage(T,j))},[j],E),xt(()=>{var T;i!==void 0&&((T=H.current)==null||T.revealLine(i))},[i],E),xt(()=>{var T;(T=P.current)==null||T.editor.setTheme(R)},[R],E);let A=K.useCallback(()=>{var T;if(!(!$.current||!P.current)&&!re.current){I.current(P.current);let F=M||f,ee=ks(P.current,C||a||"",p||j||"",F||"");H.current=(T=P.current)==null?void 0:T.editor.create($.current,{model:ee,automaticLayout:!0,...m},_),h&&H.current.restoreViewState(An.get(F)),P.current.editor.setTheme(R),i!==void 0&&H.current.revealLine(i),L(!0),re.current=!0}},[a,p,f,C,j,M,m,_,h,R,i]);K.useEffect(()=>{E&&W.current(H.current,P.current)},[E]),K.useEffect(()=>{!D&&!E&&A()},[D,E,A]),q.current=C,K.useEffect(()=>{var T,F;E&&l&&((T=X.current)==null||T.dispose(),X.current=(F=H.current)==null?void 0:F.onDidChangeModelContent(ee=>{Q.current||l(H.current.getValue(),ee)}))},[E,l]),K.useEffect(()=>{if(E){let T=P.current.editor.onDidChangeMarkers(F=>{var ne;let ee=(ne=H.current.getModel())==null?void 0:ne.uri;if(ee&&F.find(ce=>ce.path===ee.path)){let ce=P.current.editor.getModelMarkers({resource:ee});w==null||w(ce)}});return()=>{T==null||T.dispose()}}return()=>{}},[E,w]);function B(){var T,F;(T=X.current)==null||T.dispose(),y?h&&An.set(M,H.current.saveViewState()):(F=H.current.getModel())==null||F.dispose(),H.current.dispose()}return Gt.createElement(Ud,{width:S,height:k,isEditorReady:E,loading:d,_ref:$,className:v,wrapperProps:n})}var Qm=Xm,Ym=K.memo(Qm),Vd=Ym;function qd({value:a,onChange:p,path:f,readOnly:C}){const j=K.useRef(null),M=R=>{j.current=R};return c.jsx(Vd,{path:`file://${f}`,defaultLanguage:"json",value:a,onChange:R=>p(R??""),onMount:M,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,formatOnPaste:!0,readOnly:C,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let yd=!1;async function Zm(a){if(yd)return;const p=await zp(()=>import("./editor.main-GK5d7XyY.js").then(j=>j.b),__vite__mapDeps([0,1]),import.meta.url),f=await Promise.all(a.map(async j=>{let M=j.schema;if(!M){const R=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const i=new URL(j.uri).origin;if(!R.includes(i))throw new Error("untrusted origin");const d=await fetch(j.uri);d.ok&&(M=await d.json())}catch{}}return{uri:j.uri,fileMatch:j.fileMatch,schema:M}}));p.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:f.filter(j=>j.schema),enableSchemaRequest:!0}),yd=!0}function rl({node:a,targetScope:p,onOverride:f,schema:C,rootLabel:j}){const[M,R]=K.useState(""),[i,d]=K.useState(!0),m=[],_=a.kind==="object"&&Object.keys(a.children).length===0,y=((C==null?void 0:C.rootKeys())??[]).length>0;return c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[c.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",c.jsx("span",{className:"text-fg-dim",children:lt[p].label})]}),y&&c.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:i,onChange:S=>d(S.target.checked),className:"accent-accent"}),"show unset keys"]}),c.jsx("div",{className:"flex-1"}),c.jsx("input",{value:M,onChange:S=>R(S.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),c.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:_&&!i?c.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):c.jsx(Kd,{node:a,path:m,label:j??"(root)",targetScope:p,onOverride:f,filter:M,depth:0,schema:C,showGhosts:i,defaultOpen:!0})})]})}function Kd(a){return a.node.kind==="object"?c.jsx(eg,{...a,node:a.node}):a.node.kind==="array"?c.jsx(tg,{...a,node:a.node}):c.jsx(rg,{...a,node:a.node})}function wd(a,p){return p.trim()?a.toLowerCase().includes(p.toLowerCase()):!0}function Rs(a,p,f){return!!(!f.trim()||a.some(C=>wd(C,f))||p!=null&&p.description&&wd(p.description,f))}function eg({node:a,path:p,label:f,targetScope:C,onOverride:j,filter:M,depth:R,schema:i,showGhosts:d,defaultOpen:m}){const[_,h]=K.useState(m??R<2),y=(i==null?void 0:i.at(p))??null,S=new Set(Object.keys(a.children)),k=d?(y==null?void 0:y.knownChildren)??[]:[],v=Array.from(new Set([...S,...k])).sort(),n=K.useMemo(()=>M.trim()?v.filter(o=>{const l=(i==null?void 0:i.at([...p,o]))??null;return Rs([...p,o],l,M)?!0:S.has(o)?Gd(a.children[o],[...p,o],M,i):!1}):v,[v.join(","),M,a,p.join("."),i]);if(M.trim()&&n.length===0&&!Rs(p,y,M))return null;if(p.length===0)return c.jsx("div",{children:n.map(o=>u(o))});return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:R*14},onClick:()=>h(!_),children:[c.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:_?"▾":"▸"}),c.jsx("span",{className:"text-fg",children:f}),c.jsxs("span",{className:"text-fg-faint",children:[" {",S.size,k.length>S.size?`/${new Set([...S,...k]).size}`:"","}"]}),(y==null?void 0:y.description)&&c.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:y.description,children:["— ",y.description]})]}),_&&n.map(o=>u(o))]});function u(o){if(S.has(o))return c.jsx(Kd,{node:a.children[o],path:[...p,o],label:o,targetScope:C,onOverride:j,filter:M,depth:R+1,schema:i,showGhosts:d},o);const l=(i==null?void 0:i.at([...p,o]))??null;return l?c.jsx(sg,{path:[...p,o],label:o,info:l,targetScope:C,onSet:j,depth:R+1,filter:M},o):null}}function Gd(a,p,f,C){const j=(C==null?void 0:C.at(p))??null;if(Rs(p,j,f))return!0;if(a.kind!=="object")return!1;for(const M of Object.keys(a.children))if(Gd(a.children[M],[...p,M],f,C))return!0;return!1}function tg({node:a,path:p,label:f,filter:C,depth:j,schema:M}){const[R,i]=K.useState(!0),d=(M==null?void 0:M.at(p))??null;return Rs(p,d,C)?c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:j*14},onClick:()=>i(!R),children:[c.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:R?"▾":"▸"}),c.jsx("span",{className:"text-fg",children:f}),c.jsxs("span",{className:"text-fg-faint",children:[" [",a.items.length,"]"]}),c.jsx(_i,{tone:"warn",children:"accumulated"}),(d==null?void 0:d.description)&&c.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:d.description,children:["— ",d.description]})]}),R&&a.items.map((m,_)=>c.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(j+1)*14},children:[c.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),c.jsxs("span",{className:"text-fg-faint",children:[_,":"]}),c.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:Fn(m.value)}),c.jsx(el,{scope:m.fromScope})]},_))]}):null}function rg({node:a,path:p,label:f,targetScope:C,onOverride:j,filter:M,depth:R,schema:i}){const[d,m]=K.useState(!1),_=(i==null?void 0:i.at(p))??null;if(!Rs(p,_,M))return null;const h=a.winner!==C,y=a.shadowed.length>0;return c.jsxs("div",{children:[c.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:R*14},children:[c.jsx("span",{className:`w-3 shrink-0 ${y?"text-fg-faint cursor-pointer":""}`,onClick:()=>y&&m(!d),children:y?d?"▾":"▸":""}),c.jsxs("span",{className:"text-fg",children:[f,":"]}),c.jsx("span",{className:"text-fg-dim truncate max-w-md",children:Fn(a.value)}),c.jsx(el,{scope:a.winner}),(_==null?void 0:_.deprecated)&&c.jsx(_i,{tone:"warn",children:"deprecated"}),(_==null?void 0:_.default)!==void 0&&ig(a.value,_.default)&&c.jsx(_i,{tone:"dim",children:"= default"}),a.typeMismatch&&c.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(_==null?void 0:_.description)&&c.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:_.description,children:["— ",_.description]}),c.jsx("div",{className:"flex-1"}),(_==null?void 0:_.enum)&&c.jsx(Jd,{values:_.enum}),c.jsx("button",{disabled:!h,onClick:()=>j(p,a.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${h?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:h?`copy into ${lt[C].label} draft`:`already winning in ${lt[C].label}`,children:"override"})]}),d&&a.shadowed.map((S,k)=>c.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(R+1)*14+12},children:[c.jsx("span",{children:"shadowed:"}),c.jsx("span",{className:"truncate max-w-xl",children:Fn(S.value)}),c.jsx(el,{scope:S.scope,dim:!0})]},k))]})}function sg({path:a,label:p,info:f,targetScope:C,onSet:j,depth:M,filter:R}){if(!Rs(a,f,R))return null;const i=f.default!==void 0?f.default:ng(f.type),d=Array.isArray(f.type)?f.type.join("|"):f.type??"?";return c.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:M*14},children:[c.jsx("span",{className:"w-3 shrink-0"}),c.jsx("span",{className:"text-fg-dim",children:p}),c.jsx(_i,{tone:"dim",children:d}),f.required&&c.jsx(_i,{tone:"warn",children:"required"}),f.default!==void 0&&c.jsxs("span",{className:"text-fg-faint",children:["default: ",Fn(f.default)]}),f.description&&c.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:f.description,children:["— ",f.description]}),c.jsx("div",{className:"flex-1"}),f.enum&&c.jsx(Jd,{values:f.enum}),c.jsx("button",{onClick:()=>j(a,i),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${lt[C].label} draft`,children:"set"})]})}function ig(a,p){return a===p?!0:typeof a!=typeof p?!1:a&&p&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(p):!1}function ng(a){switch(Array.isArray(a)?a[0]:a){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function Fn(a){if(typeof a=="string")return JSON.stringify(a);if(a===null)return"null";if(typeof a=="object"){const p=JSON.stringify(a);return p.length>100?p.slice(0,100)+"…":p}return String(a)}function el({scope:a,dim:p}){const f=a==="user"?"bg-bg-hi text-fg-dim border-line":a==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return c.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${f} ${p?"opacity-60":""}`,children:lt[a].label})}function _i({children:a,tone:p="default"}){const f={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[p];return c.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${f}`,children:a})}function Jd({values:a}){const p=a.map(f=>String(f)).join(" | ");return c.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${p}`,children:["∈ ",p.length>30?p.slice(0,30)+"…":p]})}const og=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Which model runs, how hard it thinks, and fast-mode toggles.",keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],ag={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function Xd(a){return a.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((C,j)=>{const M=ag[C];return M||(j===0?C.charAt(0).toUpperCase()+C.slice(1):C)}).join(" ")}function lg(a){const p=new Set,f=[];for(const j of og){const M=j.keys.filter(R=>a.has(R));M.forEach(R=>p.add(R)),M.length!==0&&f.push({id:j.id,title:j.title,summary:j.summary,advanced:!!j.advanced,keys:M})}const C=Array.from(a).filter(j=>!p.has(j)&&j!=="$schema").sort();return C.length>0&&f.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:C}),f}function cg({node:a,targetScope:p,onOverride:f,schema:C}){const[j,M]=K.useState(""),[R,i]=K.useState(!1),[d,m]=K.useState(!0),_=a.kind==="object"?a:null,h=_?Object.keys(_.children):[],y=C.rootKeys(),S=new Set([...h,...y]),k=K.useMemo(()=>lg(S),[Array.from(S).sort().join(",")]),v=K.useMemo(()=>k.filter(n=>R||!n.advanced).map(n=>({...n,keys:n.keys.filter(u=>{const o=(_==null?void 0:_.children[u])!==void 0;if(!d&&!o)return!1;if(!j.trim())return!0;const l=C.at([u]);return[u,Xd(u),(l==null?void 0:l.description)??""].join(" ").toLowerCase().includes(j.toLowerCase())})})).filter(n=>n.keys.length>0),[k,j,R,d,_,C]);return c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[c.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",c.jsx("span",{className:"text-fg-dim font-medium",children:lt[p].label})]}),c.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:d,onChange:n=>m(n.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),c.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:R,onChange:n=>i(n.target.checked),className:"accent-accent"}),"show advanced"]}),c.jsx("div",{className:"flex-1"}),c.jsx("input",{value:j,onChange:n=>M(n.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[v.map(n=>c.jsx(ug,{title:n.title,summary:n.summary,advanced:n.advanced,children:n.keys.map(u=>{const o=_==null?void 0:_.children[u],l=C.at([u]);return c.jsx(dg,{keyName:u,node:o,info:l,targetScope:p,onOverride:w=>f([u],w)},u)})},n.id)),v.length===0&&c.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',j,'"']})]})]})}function ug({title:a,summary:p,advanced:f,children:C}){const[j,M]=K.useState(!0);return c.jsxs("section",{className:"border-b border-line",children:[c.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>M(!j),children:[c.jsx("span",{className:"text-fg-faint w-3",children:j?"▾":"▸"}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h2",{className:"text-fg text-sm font-medium",children:a}),f&&c.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),c.jsx("p",{className:"text-fg-faint text-xs",children:p})]})]}),j&&c.jsx("div",{className:"divide-y divide-line/60",children:C})]})}function dg({keyName:a,node:p,info:f,targetScope:C,onOverride:j}){const[M,R]=K.useState(!1),i=Xd(a),d=p!==void 0,_=(p==null?void 0:p.kind)==="leaf"?p:null,h=(p==null?void 0:p.kind)==="object"||(p==null?void 0:p.kind)==="array",y=f==null?void 0:f.default,S=_&&y!==void 0&&Yd(_.value,y),k=vg({isSet:d,leafNode:_,defaultVal:y,isDefault:!!S,node:p});return c.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("button",{onClick:()=>R(!M),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:M?"collapse":"expand",children:M?"▾":"▸"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[c.jsx("h3",{className:"text-fg text-sm",children:i}),c.jsx(_g,{kind:k.kind,label:k.label}),(f==null?void 0:f.deprecated)&&c.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(f==null?void 0:f.required)&&!d&&c.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),(f==null?void 0:f.description)&&c.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:yg(f.description)}),M&&c.jsx(hg,{keyName:a,node:p,info:f,targetScope:C,onOverride:j})]}),c.jsx("div",{className:"shrink-0",children:!M&&c.jsx(gg,{node:p,info:f,onSet:v=>{j(v)},disabled:h&&d})})]})})}function hg({keyName:a,node:p,info:f,targetScope:C,onOverride:j}){const R=(p==null?void 0:p.kind)==="leaf"?p:null;return c.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(f==null?void 0:f.description)&&c.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:f.description}),c.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(f==null?void 0:f.type)&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Type"}),c.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(f.type)?f.type.join(" | "):f.type})]}),(f==null?void 0:f.default)!==void 0&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Default"}),c.jsx("dd",{className:"text-fg-dim font-mono",children:Nn(f.default)})]}),(f==null?void 0:f.enum)&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Options"}),c.jsx("dd",{className:"text-fg-dim font-mono",children:f.enum.map(i=>String(i)).join(" | ")})]}),R&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Current"}),c.jsxs("dd",{className:"font-mono",children:[c.jsx("span",{className:"text-fg-dim",children:Nn(R.value)}),c.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",lt[R.winner].label]})]})]}),R&&R.shadowed.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Shadowed"}),c.jsx("dd",{className:"space-y-0.5",children:R.shadowed.map((i,d)=>c.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[Nn(i.value)," —"," ",c.jsx("span",{className:"no-underline",children:lt[i.scope].label})]},d))})]}),(p==null?void 0:p.kind)==="array"&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{children:"Accumulated"}),c.jsxs("dd",{className:"text-fg-dim",children:[p.items.length," items across all scopes"]})]})]}),c.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:c.jsx(fg,{keyName:a,node:p,info:f,onChange:j,targetScope:C})})]})}function fg({node:a,info:p,onChange:f,targetScope:C}){const M=(a==null?void 0:a.kind)==="leaf"?a.value:p==null?void 0:p.default,R=Qd(p==null?void 0:p.type);if(R==="boolean"){const i=M===!0;return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg-faint",children:"Set to:"}),c.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:d,label:m})=>c.jsx("button",{onClick:()=>f(d),className:`px-3 py-0.5 text-xs transition-colors ${i===d?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:m},m))}),c.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[C].label]})]})}return p!=null&&p.enum?c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-fg-faint",children:"Choose:"}),p.enum.map(i=>{const d=Yd(M,i);return c.jsx("button",{onClick:()=>f(i),className:`px-2 py-0.5 text-xs rounded border ${d?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(i)},String(i))}),c.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[C].label]})]}):R==="integer"||R==="number"?c.jsx(pg,{value:typeof M=="number"?M:void 0,integer:R==="integer",onCommit:f,target:lt[C].label}):R==="string"?c.jsx(mg,{value:typeof M=="string"?M:"",onCommit:f,target:lt[C].label}):c.jsxs("div",{className:"text-fg-faint",children:["Complex value (",R??"object/array",") — use the"," ",c.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function pg({value:a,integer:p,onCommit:f,target:C}){const[j,M]=K.useState(a!==void 0?String(a):""),R=()=>{const i=p?parseInt(j,10):parseFloat(j);Number.isNaN(i)||f(i)};return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg-faint",children:"Set to:"}),c.jsx("input",{type:"number",value:j,onChange:i=>M(i.target.value),onBlur:R,onKeyDown:i=>{i.key==="Enter"&&i.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),c.jsxs("button",{onClick:R,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",C]})]})}function mg({value:a,onCommit:p,target:f}){const[C,j]=K.useState(a);return c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[c.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),c.jsx("input",{type:"text",value:C,onChange:M=>j(M.target.value),onKeyDown:M=>{M.key==="Enter"&&p(C)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),c.jsxs("button",{onClick:()=>p(C),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",f]})]})}function gg({node:a,info:p,onSet:f,disabled:C}){const j=(a==null?void 0:a.kind)==="leaf",M=Qd(p==null?void 0:p.type);if(C)return null;if(M==="boolean"){const R=j&&a.value===!0;return c.jsx("button",{onClick:()=>f(!R),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${R?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:R?"on":"off"})}return null}function vg({isSet:a,leafNode:p,defaultVal:f,isDefault:C,node:j}){return a?(j==null?void 0:j.kind)==="array"?{kind:"accumulated",label:`${j.items.length} items`}:(j==null?void 0:j.kind)==="object"?{kind:"set",label:"configured"}:p?C?{kind:"default",label:`= default · ${lt[p.winner].label}`}:p.shadowed.length>0?{kind:"override",label:`overriding ${p.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${lt[p.winner].label}`}:{kind:"set",label:"configured"}:f!==void 0?{kind:"default",label:`using default: ${Nn(f)}`}:{kind:"unset",label:"not configured"}}function _g({kind:a,label:p}){const f={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[a];return c.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${f}`,children:p})}function Qd(a){if(a)return Array.isArray(a)?a.find(f=>f!=="null")??a[0]:a}function Yd(a,p){return a===p?!0:typeof a!=typeof p?!1:a&&p&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(p):!1}function yg(a){const p=a.trim().split(`
|
|
66
|
-
`)[0],f=p.match(/^([^.!?]+[.!?])/);return f?f[1]:p.length>120?p.slice(0,120)+"…":p}function Nn(a){if(typeof a=="string")return a===""?'""':JSON.stringify(a);if(a===null)return"null";if(a===void 0)return"—";if(typeof a=="object"){const p=JSON.stringify(a);return p.length>60?p.slice(0,60)+"…":p}return String(a)}function sl({options:a,active:p,onChange:f}){return
|
|
65
|
+
`},_d=vm(Sm)(Id),xm={config:ym},bm=function(){for(var p=arguments.length,f=new Array(p),C=0;C<p;C++)f[C]=arguments[C];return function(j){return f.reduceRight(function(M,R){return R(M)},j)}};function Bd(a,p){return Object.keys(p).forEach(function(f){p[f]instanceof Object&&a[f]&&Object.assign(p[f],Bd(a[f],p[f]))}),md(md({},a),p)}var Cm={type:"cancelation",msg:"operation is manually canceled"};function Ka(a){var p=!1,f=new Promise(function(C,j){a.then(function(M){return p?j(Cm):C(M)}),a.catch(j)});return f.cancel=function(){return p=!0},f}var km=["monaco"],Em=mm.create({config:gm,isInitialized:!1,resolve:null,reject:null,monaco:null}),Fd=Qp(Em,2),yi=Fd[0],Un=Fd[1];function Lm(a){var p=xm.config(a),f=p.monaco,C=Jp(p,km);Un(function(j){return{config:Bd(j.config,C),monaco:f}})}function Rm(){var a=yi(function(p){var f=p.monaco,C=p.isInitialized,j=p.resolve;return{monaco:f,isInitialized:C,resolve:j}});if(!a.isInitialized){if(Un({isInitialized:!0}),a.monaco)return a.resolve(a.monaco),Ka(Ga);if(window.monaco&&window.monaco.editor)return Hd(window.monaco),a.resolve(window.monaco),Ka(Ga);bm(jm,Pm)(Tm)}return Ka(Ga)}function jm(a){return document.body.appendChild(a)}function Dm(a){var p=document.createElement("script");return a&&(p.src=a),p}function Pm(a){var p=yi(function(C){var j=C.config,M=C.reject;return{config:j,reject:M}}),f=Dm("".concat(p.config.paths.vs,"/loader.js"));return f.onload=function(){return a()},f.onerror=p.reject,f}function Tm(){var a=yi(function(f){var C=f.config,j=f.resolve,M=f.reject;return{config:C,resolve:j,reject:M}}),p=window.require;p.config(a.config),p(["vs/editor/editor.main"],function(f){var C=f.m||f;Hd(C),a.resolve(C)},function(f){a.reject(f)})}function Hd(a){yi().monaco||Un({monaco:a})}function Am(){return yi(function(a){var p=a.monaco;return p})}var Ga=new Promise(function(a,p){return Un({resolve:a,reject:p})}),$d={config:Lm,init:Rm,__getMonacoInstance:Am},Mm={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Ja=Mm,Om={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Nm=Om;function Im({children:a}){return Gt.createElement("div",{style:Nm.container},a)}var Bm=Im,Fm=Bm;function Hm({width:a,height:p,isEditorReady:f,loading:C,_ref:j,className:M,wrapperProps:R}){return Gt.createElement("section",{style:{...Ja.wrapper,width:a,height:p},...R},!f&&Gt.createElement(Fm,null,C),Gt.createElement("div",{ref:j,style:{...Ja.fullWidth,...!f&&Ja.hide},className:M}))}var $m=Hm,Ud=K.memo($m);function Um(a){K.useEffect(a,[])}var Wd=Um;function Wm(a,p,f=!0){let C=K.useRef(!0);K.useEffect(C.current||!f?()=>{C.current=!1}:a,p)}var xt=Wm;function gi(){}function ks(a,p,f,C){return zm(a,C)||Vm(a,p,f,C)}function zm(a,p){return a.editor.getModel(zd(a,p))}function Vm(a,p,f,C){return a.editor.createModel(p,f,C?zd(a,C):void 0)}function zd(a,p){return a.Uri.parse(p)}function qm({original:a,modified:p,language:f,originalLanguage:C,modifiedLanguage:j,originalModelPath:M,modifiedModelPath:R,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:d=!1,theme:m="light",loading:_="Loading...",options:h={},height:y="100%",width:S="100%",className:k,wrapperProps:v={},beforeMount:n=gi,onMount:c=gi}){let[o,l]=K.useState(!1),[w,L]=K.useState(!0),E=K.useRef(null),D=K.useRef(null),x=K.useRef(null),P=K.useRef(c),H=K.useRef(n),$=K.useRef(!1);Wd(()=>{let q=$d.init();return q.then(z=>(D.current=z)&&L(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>E.current?X():q.cancel()}),xt(()=>{if(E.current&&D.current){let q=E.current.getOriginalEditor(),z=ks(D.current,a||"",C||f||"text",M||"");z!==q.getModel()&&q.setModel(z)}},[M],o),xt(()=>{if(E.current&&D.current){let q=E.current.getModifiedEditor(),z=ks(D.current,p||"",j||f||"text",R||"");z!==q.getModel()&&q.setModel(z)}},[R],o),xt(()=>{let q=E.current.getModifiedEditor();q.getOption(D.current.editor.EditorOption.readOnly)?q.setValue(p||""):p!==q.getValue()&&(q.executeEdits("",[{range:q.getModel().getFullModelRange(),text:p||"",forceMoveMarkers:!0}]),q.pushUndoStop())},[p],o),xt(()=>{var q,z;(z=(q=E.current)==null?void 0:q.getModel())==null||z.original.setValue(a||"")},[a],o),xt(()=>{let{original:q,modified:z}=E.current.getModel();D.current.editor.setModelLanguage(q,C||f||"text"),D.current.editor.setModelLanguage(z,j||f||"text")},[f,C,j],o),xt(()=>{var q;(q=D.current)==null||q.editor.setTheme(m)},[m],o),xt(()=>{var q;(q=E.current)==null||q.updateOptions(h)},[h],o);let W=K.useCallback(()=>{var re;if(!D.current)return;H.current(D.current);let q=ks(D.current,a||"",C||f||"text",M||""),z=ks(D.current,p||"",j||f||"text",R||"");(re=E.current)==null||re.setModel({original:q,modified:z})},[f,p,j,a,C,M,R]),I=K.useCallback(()=>{var q;!$.current&&x.current&&(E.current=D.current.editor.createDiffEditor(x.current,{automaticLayout:!0,...h}),W(),(q=D.current)==null||q.editor.setTheme(m),l(!0),$.current=!0)},[h,m,W]);K.useEffect(()=>{o&&P.current(E.current,D.current)},[o]),K.useEffect(()=>{!w&&!o&&I()},[w,o,I]);function X(){var z,re,Q,A;let q=(z=E.current)==null?void 0:z.getModel();i||((re=q==null?void 0:q.original)==null||re.dispose()),d||((Q=q==null?void 0:q.modified)==null||Q.dispose()),(A=E.current)==null||A.dispose()}return Gt.createElement(Ud,{width:S,height:y,isEditorReady:o,loading:_,_ref:x,className:k,wrapperProps:v})}var Km=qm;K.memo(Km);function Gm(a){let p=K.useRef();return K.useEffect(()=>{p.current=a},[a]),p.current}var Jm=Gm,An=new Map;function Xm({defaultValue:a,defaultLanguage:p,defaultPath:f,value:C,language:j,path:M,theme:R="light",line:i,loading:d="Loading...",options:m={},overrideServices:_={},saveViewState:h=!0,keepCurrentModel:y=!1,width:S="100%",height:k="100%",className:v,wrapperProps:n={},beforeMount:c=gi,onMount:o=gi,onChange:l,onValidate:w=gi}){let[L,E]=K.useState(!1),[D,x]=K.useState(!0),P=K.useRef(null),H=K.useRef(null),$=K.useRef(null),W=K.useRef(o),I=K.useRef(c),X=K.useRef(),q=K.useRef(C),z=Jm(M),re=K.useRef(!1),Q=K.useRef(!1);Wd(()=>{let T=$d.init();return T.then(F=>(P.current=F)&&x(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>H.current?B():T.cancel()}),xt(()=>{var F,ee,ne,ce;let T=ks(P.current,a||C||"",p||j||"",M||f||"");T!==((F=H.current)==null?void 0:F.getModel())&&(h&&An.set(z,(ee=H.current)==null?void 0:ee.saveViewState()),(ne=H.current)==null||ne.setModel(T),h&&((ce=H.current)==null||ce.restoreViewState(An.get(M))))},[M],L),xt(()=>{var T;(T=H.current)==null||T.updateOptions(m)},[m],L),xt(()=>{!H.current||C===void 0||(H.current.getOption(P.current.editor.EditorOption.readOnly)?H.current.setValue(C):C!==H.current.getValue()&&(Q.current=!0,H.current.executeEdits("",[{range:H.current.getModel().getFullModelRange(),text:C,forceMoveMarkers:!0}]),H.current.pushUndoStop(),Q.current=!1))},[C],L),xt(()=>{var F,ee;let T=(F=H.current)==null?void 0:F.getModel();T&&j&&((ee=P.current)==null||ee.editor.setModelLanguage(T,j))},[j],L),xt(()=>{var T;i!==void 0&&((T=H.current)==null||T.revealLine(i))},[i],L),xt(()=>{var T;(T=P.current)==null||T.editor.setTheme(R)},[R],L);let A=K.useCallback(()=>{var T;if(!(!$.current||!P.current)&&!re.current){I.current(P.current);let F=M||f,ee=ks(P.current,C||a||"",p||j||"",F||"");H.current=(T=P.current)==null?void 0:T.editor.create($.current,{model:ee,automaticLayout:!0,...m},_),h&&H.current.restoreViewState(An.get(F)),P.current.editor.setTheme(R),i!==void 0&&H.current.revealLine(i),E(!0),re.current=!0}},[a,p,f,C,j,M,m,_,h,R,i]);K.useEffect(()=>{L&&W.current(H.current,P.current)},[L]),K.useEffect(()=>{!D&&!L&&A()},[D,L,A]),q.current=C,K.useEffect(()=>{var T,F;L&&l&&((T=X.current)==null||T.dispose(),X.current=(F=H.current)==null?void 0:F.onDidChangeModelContent(ee=>{Q.current||l(H.current.getValue(),ee)}))},[L,l]),K.useEffect(()=>{if(L){let T=P.current.editor.onDidChangeMarkers(F=>{var ne;let ee=(ne=H.current.getModel())==null?void 0:ne.uri;if(ee&&F.find(ce=>ce.path===ee.path)){let ce=P.current.editor.getModelMarkers({resource:ee});w==null||w(ce)}});return()=>{T==null||T.dispose()}}return()=>{}},[L,w]);function B(){var T,F;(T=X.current)==null||T.dispose(),y?h&&An.set(M,H.current.saveViewState()):(F=H.current.getModel())==null||F.dispose(),H.current.dispose()}return Gt.createElement(Ud,{width:S,height:k,isEditorReady:L,loading:d,_ref:$,className:v,wrapperProps:n})}var Qm=Xm,Ym=K.memo(Qm),Vd=Ym;function qd({value:a,onChange:p,path:f,readOnly:C}){const j=K.useRef(null),M=R=>{j.current=R};return u.jsx(Vd,{path:`file://${f}`,defaultLanguage:"json",value:a,onChange:R=>p(R??""),onMount:M,theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,formatOnPaste:!0,readOnly:C,automaticLayout:!0,bracketPairColorization:{enabled:!0},wordWrap:"on"}})}let yd=!1;async function Zm(a){if(yd)return;const p=await zp(()=>import("./editor.main-BnrhL2Ub.js").then(j=>j.b),__vite__mapDeps([0,1]),import.meta.url),f=await Promise.all(a.map(async j=>{let M=j.schema;if(!M){const R=["https://json.schemastore.org","https://www.schemastore.org","https://code.claude.com"];try{const i=new URL(j.uri).origin;if(!R.includes(i))throw new Error("untrusted origin");const d=await fetch(j.uri);d.ok&&(M=await d.json())}catch{}}return{uri:j.uri,fileMatch:j.fileMatch,schema:M}}));p.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemas:f.filter(j=>j.schema),enableSchemaRequest:!0}),yd=!0}function rl({node:a,targetScope:p,onOverride:f,schema:C,rootLabel:j}){const[M,R]=K.useState(""),[i,d]=K.useState(!0),m=[],_=a.kind==="object"&&Object.keys(a.children).length===0,y=((C==null?void 0:C.rootKeys())??[]).length>0;return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsxs("span",{className:"text-fg-faint",children:["merged · overrides → ",u.jsx("span",{className:"text-fg-dim",children:lt[p].label})]}),y&&u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:i,onChange:S=>d(S.target.checked),className:"accent-accent"}),"show unset keys"]}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:M,onChange:S=>R(S.target.value),placeholder:"filter keys or descriptions…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),u.jsx("div",{className:"flex-1 overflow-auto px-3 py-2 font-mono text-xs",children:_&&!i?u.jsx("div",{className:"text-fg-faint italic px-2 py-4",children:"no settings resolved — all scope files empty or missing"}):u.jsx(Kd,{node:a,path:m,label:j??"(root)",targetScope:p,onOverride:f,filter:M,depth:0,schema:C,showGhosts:i,defaultOpen:!0})})]})}function Kd(a){return a.node.kind==="object"?u.jsx(eg,{...a,node:a.node}):a.node.kind==="array"?u.jsx(tg,{...a,node:a.node}):u.jsx(rg,{...a,node:a.node})}function wd(a,p){return p.trim()?a.toLowerCase().includes(p.toLowerCase()):!0}function Rs(a,p,f){return!!(!f.trim()||a.some(C=>wd(C,f))||p!=null&&p.description&&wd(p.description,f))}function eg({node:a,path:p,label:f,targetScope:C,onOverride:j,filter:M,depth:R,schema:i,showGhosts:d,defaultOpen:m}){const[_,h]=K.useState(m??R<2),y=(i==null?void 0:i.at(p))??null,S=new Set(Object.keys(a.children)),k=d?(y==null?void 0:y.knownChildren)??[]:[],v=Array.from(new Set([...S,...k])).sort(),n=K.useMemo(()=>M.trim()?v.filter(o=>{const l=(i==null?void 0:i.at([...p,o]))??null;return Rs([...p,o],l,M)?!0:S.has(o)?Gd(a.children[o],[...p,o],M,i):!1}):v,[v.join(","),M,a,p.join("."),i]);if(M.trim()&&n.length===0&&!Rs(p,y,M))return null;if(p.length===0)return u.jsx("div",{children:n.map(o=>c(o))});return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:R*14},onClick:()=>h(!_),children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:_?"▾":"▸"}),u.jsx("span",{className:"text-fg",children:f}),u.jsxs("span",{className:"text-fg-faint",children:[" {",S.size,k.length>S.size?`/${new Set([...S,...k]).size}`:"","}"]}),(y==null?void 0:y.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:y.description,children:["— ",y.description]})]}),_&&n.map(o=>c(o))]});function c(o){if(S.has(o))return u.jsx(Kd,{node:a.children[o],path:[...p,o],label:o,targetScope:C,onOverride:j,filter:M,depth:R+1,schema:i,showGhosts:d},o);const l=(i==null?void 0:i.at([...p,o]))??null;return l?u.jsx(sg,{path:[...p,o],label:o,info:l,targetScope:C,onSet:j,depth:R+1,filter:M},o):null}}function Gd(a,p,f,C){const j=(C==null?void 0:C.at(p))??null;if(Rs(p,j,f))return!0;if(a.kind!=="object")return!1;for(const M of Object.keys(a.children))if(Gd(a.children[M],[...p,M],f,C))return!0;return!1}function tg({node:a,path:p,label:f,filter:C,depth:j,schema:M}){const[R,i]=K.useState(!0),d=(M==null?void 0:M.at(p))??null;return Rs(p,d,C)?u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-1 py-0.5 hover:bg-bg-elev/50 rounded cursor-pointer",style:{paddingLeft:j*14},onClick:()=>i(!R),children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0",children:R?"▾":"▸"}),u.jsx("span",{className:"text-fg",children:f}),u.jsxs("span",{className:"text-fg-faint",children:[" [",a.items.length,"]"]}),u.jsx(_i,{tone:"warn",children:"accumulated"}),(d==null?void 0:d.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:d.description,children:["— ",d.description]})]}),R&&a.items.map((m,_)=>u.jsxs("div",{className:"flex items-start gap-2 py-0.5",style:{paddingLeft:(j+1)*14},children:[u.jsx("span",{className:"text-fg-faint w-3 shrink-0"}),u.jsxs("span",{className:"text-fg-faint",children:[_,":"]}),u.jsx("span",{className:"text-fg-dim truncate max-w-xl",children:Fn(m.value)}),u.jsx(el,{scope:m.fromScope})]},_))]}):null}function rg({node:a,path:p,label:f,targetScope:C,onOverride:j,filter:M,depth:R,schema:i}){const[d,m]=K.useState(!1),_=(i==null?void 0:i.at(p))??null;if(!Rs(p,_,M))return null;const h=a.winner!==C,y=a.shadowed.length>0;return u.jsxs("div",{children:[u.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded",style:{paddingLeft:R*14},children:[u.jsx("span",{className:`w-3 shrink-0 ${y?"text-fg-faint cursor-pointer":""}`,onClick:()=>y&&m(!d),children:y?d?"▾":"▸":""}),u.jsxs("span",{className:"text-fg",children:[f,":"]}),u.jsx("span",{className:"text-fg-dim truncate max-w-md",children:Fn(a.value)}),u.jsx(el,{scope:a.winner}),(_==null?void 0:_.deprecated)&&u.jsx(_i,{tone:"warn",children:"deprecated"}),(_==null?void 0:_.default)!==void 0&&ig(a.value,_.default)&&u.jsx(_i,{tone:"dim",children:"= default"}),a.typeMismatch&&u.jsx("span",{className:"text-yellow-500/80",title:"shadowed scopes have a different value type",children:"⚠"}),(_==null?void 0:_.description)&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:_.description,children:["— ",_.description]}),u.jsx("div",{className:"flex-1"}),(_==null?void 0:_.enum)&&u.jsx(Jd,{values:_.enum}),u.jsx("button",{disabled:!h,onClick:()=>j(p,a.value),className:`opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border rounded transition-opacity ${h?"border-accent/50 text-accent hover:bg-accent hover:text-bg":"border-line text-fg-faint cursor-not-allowed"}`,title:h?`copy into ${lt[C].label} draft`:`already winning in ${lt[C].label}`,children:"override"})]}),d&&a.shadowed.map((S,k)=>u.jsxs("div",{className:"flex items-center gap-2 py-0.5 text-fg-faint line-through",style:{paddingLeft:(R+1)*14+12},children:[u.jsx("span",{children:"shadowed:"}),u.jsx("span",{className:"truncate max-w-xl",children:Fn(S.value)}),u.jsx(el,{scope:S.scope,dim:!0})]},k))]})}function sg({path:a,label:p,info:f,targetScope:C,onSet:j,depth:M,filter:R}){if(!Rs(a,f,R))return null;const i=f.default!==void 0?f.default:ng(f.type),d=Array.isArray(f.type)?f.type.join("|"):f.type??"?";return u.jsxs("div",{className:"group flex items-center gap-2 py-0.5 hover:bg-bg-elev/50 rounded opacity-60",style:{paddingLeft:M*14},children:[u.jsx("span",{className:"w-3 shrink-0"}),u.jsx("span",{className:"text-fg-dim",children:p}),u.jsx(_i,{tone:"dim",children:d}),f.required&&u.jsx(_i,{tone:"warn",children:"required"}),f.default!==void 0&&u.jsxs("span",{className:"text-fg-faint",children:["default: ",Fn(f.default)]}),f.description&&u.jsxs("span",{className:"text-fg-faint truncate max-w-md",title:f.description,children:["— ",f.description]}),u.jsx("div",{className:"flex-1"}),f.enum&&u.jsx(Jd,{values:f.enum}),u.jsx("button",{onClick:()=>j(a,i),className:"opacity-0 group-hover:opacity-100 px-1.5 py-0 text-[10px] border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg transition-opacity",title:`write to ${lt[C].label} draft`,children:"set"})]})}function ig(a,p){return a===p?!0:typeof a!=typeof p?!1:a&&p&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(p):!1}function ng(a){switch(Array.isArray(a)?a[0]:a){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};case"null":return null;default:return null}}function Fn(a){if(typeof a=="string")return JSON.stringify(a);if(a===null)return"null";if(typeof a=="object"){const p=JSON.stringify(a);return p.length>100?p.slice(0,100)+"…":p}return String(a)}function el({scope:a,dim:p}){const f=a==="user"?"bg-bg-hi text-fg-dim border-line":a==="project"?"bg-blue-950/30 text-blue-400/80 border-blue-900/40":"bg-purple-950/30 text-purple-400/80 border-purple-900/40";return u.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${f} ${p?"opacity-60":""}`,children:lt[a].label})}function _i({children:a,tone:p="default"}){const f={default:"bg-bg-hi text-fg-dim border-line",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[p];return u.jsx("span",{className:`text-[10px] px-1 py-0 rounded border uppercase tracking-wide shrink-0 ${f}`,children:a})}function Jd({values:a}){const p=a.map(f=>String(f)).join(" | ");return u.jsxs("span",{className:"text-[10px] text-fg-faint truncate max-w-xs",title:`allowed: ${p}`,children:["∈ ",p.length>30?p.slice(0,30)+"…":p]})}const og=[{id:"essentials",title:"Essentials",summary:"The knobs you reach for first.",keys:["model","language","outputStyle","permissions"]},{id:"git",title:"Git & Commits",summary:"How Claude writes commits and pull requests on your behalf.",keys:["attribution","includeGitInstructions","includeCoAuthoredBy"]},{id:"memory",title:"Memory & Plans",summary:"Context Claude keeps between sessions and where it files plans.",keys:["autoMemoryEnabled","plansDirectory","claudeMdExcludes","respectGitignore"]},{id:"model",title:"Model & Reasoning",summary:"Which model runs, how hard it thinks, and fast-mode toggles.",keys:["availableModels","modelOverrides","effortLevel","fastMode","fastModePerSessionOptIn","alwaysThinkingEnabled"]},{id:"interface",title:"Interface",summary:"Visual polish — spinners, progress bars, motion.",keys:["spinnerTipsEnabled","spinnerTipsOverride","spinnerVerbs","terminalProgressBarEnabled","showTurnDuration","prefersReducedMotion","companyAnnouncements","statusLine","teammateMode"]},{id:"updates",title:"Updates & Cleanup",summary:"Release channel and how long transcripts stick around.",keys:["autoUpdatesChannel","cleanupPeriodDays"]},{id:"env",title:"Environment & Auth",summary:"Environment variables and auth-helper scripts.",keys:["env","apiKeyHelper","awsCredentialExport","awsAuthRefresh"]},{id:"hooks",title:"Hooks",summary:"Scripts Claude runs before/after tool use.",keys:["hooks","disableAllHooks","allowedHttpHookUrls","httpHookAllowedEnvVars"]},{id:"mcp",title:"MCP Servers",summary:"External tool providers Claude can talk to.",keys:["enableAllProjectMcpServers","enabledMcpjsonServers","disabledMcpjsonServers"]},{id:"plugins",title:"Plugins",summary:"Installed plugins, marketplaces, and per-plugin configuration.",keys:["enabledPlugins","extraKnownMarketplaces","skippedPlugins","skippedMarketplaces","pluginConfigs"]},{id:"filesystem",title:"File Picker & Sandbox",summary:"How Claude browses files and the sandbox it runs in.",keys:["fileSuggestion","sandbox","worktree"]},{id:"login",title:"Login",summary:"Which login method to force on startup.",keys:["forceLoginMethod","forceLoginOrgUUID"]},{id:"feedback",title:"Feedback",summary:"Session-quality surveys.",keys:["feedbackSurveyRate"]},{id:"advanced",title:"Advanced / Enterprise",summary:"Managed-settings-only keys and enterprise allow/denylists.",advanced:!0,keys:["allowedMcpServers","deniedMcpServers","allowManagedHooksOnly","allowManagedPermissionRulesOnly","allowManagedMcpServersOnly","strictKnownMarketplaces","blockedMarketplaces","pluginTrustMessage","otelHeadersHelper","skipWebFetchPreflight"]}],ag={mcp:"MCP",url:"URL",urls:"URLs",http:"HTTP",ui:"UI",id:"ID",uuid:"UUID",api:"API",aws:"AWS",otel:"OTel",json:"JSON"};function Xd(a){return a.replace(/^\$/,"").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").toLowerCase().split(/\s+/).filter(Boolean).map((C,j)=>{const M=ag[C];return M||(j===0?C.charAt(0).toUpperCase()+C.slice(1):C)}).join(" ")}function lg(a){const p=new Set,f=[];for(const j of og){const M=j.keys.filter(R=>a.has(R));M.forEach(R=>p.add(R)),M.length!==0&&f.push({id:j.id,title:j.title,summary:j.summary,advanced:!!j.advanced,keys:M})}const C=Array.from(a).filter(j=>!p.has(j)&&j!=="$schema").sort();return C.length>0&&f.push({id:"other",title:"Other",summary:"Keys not yet grouped.",advanced:!1,keys:C}),f}function cg({node:a,targetScope:p,onOverride:f,schema:C}){const[j,M]=K.useState(""),[R,i]=K.useState(!1),[d,m]=K.useState(!0),_=a.kind==="object"?a:null,h=_?Object.keys(_.children):[],y=C.rootKeys(),S=new Set([...h,...y]),k=K.useMemo(()=>lg(S),[Array.from(S).sort().join(",")]),v=K.useMemo(()=>k.filter(n=>R||!n.advanced).map(n=>({...n,keys:n.keys.filter(c=>{const o=(_==null?void 0:_.children[c])!==void 0;if(!d&&!o)return!1;if(!j.trim())return!0;const l=C.at([c]);return[c,Xd(c),(l==null?void 0:l.description)??""].join(" ").toLowerCase().includes(j.toLowerCase())})})).filter(n=>n.keys.length>0),[k,j,R,d,_,C]);return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-3 text-xs",children:[u.jsxs("span",{className:"text-fg-faint",children:["writing overrides to"," ",u.jsx("span",{className:"text-fg-dim font-medium",children:lt[p].label})]}),u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:d,onChange:n=>m(n.target.checked),className:"accent-accent"}),"show not-yet-configured"]}),u.jsxs("label",{className:"flex items-center gap-1 text-fg-faint cursor-pointer",children:[u.jsx("input",{type:"checkbox",checked:R,onChange:n=>i(n.target.checked),className:"accent-accent"}),"show advanced"]}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:j,onChange:n=>M(n.target.value),placeholder:"search settings…",className:"bg-bg border border-line rounded px-2 py-1 text-xs text-fg w-64"})]}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[v.map(n=>u.jsx(ug,{title:n.title,summary:n.summary,advanced:n.advanced,children:n.keys.map(c=>{const o=_==null?void 0:_.children[c],l=C.at([c]);return u.jsx(dg,{keyName:c,node:o,info:l,targetScope:p,onOverride:w=>f([c],w)},c)})},n.id)),v.length===0&&u.jsxs("div",{className:"px-6 py-12 text-center text-fg-faint text-sm",children:['no settings match "',j,'"']})]})]})}function ug({title:a,summary:p,advanced:f,children:C}){const[j,M]=K.useState(!0);return u.jsxs("section",{className:"border-b border-line",children:[u.jsxs("header",{className:"px-4 py-2.5 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>M(!j),children:[u.jsx("span",{className:"text-fg-faint w-3",children:j?"▾":"▸"}),u.jsxs("div",{className:"flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h2",{className:"text-fg text-sm font-medium",children:a}),f&&u.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"advanced"})]}),u.jsx("p",{className:"text-fg-faint text-xs",children:p})]})]}),j&&u.jsx("div",{className:"divide-y divide-line/60",children:C})]})}function dg({keyName:a,node:p,info:f,targetScope:C,onOverride:j}){const[M,R]=K.useState(!1),i=Xd(a),d=p!==void 0,_=(p==null?void 0:p.kind)==="leaf"?p:null,h=(p==null?void 0:p.kind)==="object"||(p==null?void 0:p.kind)==="array",y=f==null?void 0:f.default,S=_&&y!==void 0&&Yd(_.value,y),k=vg({isSet:d,leafNode:_,defaultVal:y,isDefault:!!S,node:p});return u.jsx("div",{className:"px-4 py-3 hover:bg-bg-elev/20",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("button",{onClick:()=>R(!M),className:"text-fg-faint hover:text-fg w-3 mt-0.5",title:M?"collapse":"expand",children:M?"▾":"▸"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-baseline gap-2 flex-wrap",children:[u.jsx("h3",{className:"text-fg text-sm",children:i}),u.jsx(_g,{kind:k.kind,label:k.label}),(f==null?void 0:f.deprecated)&&u.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:"deprecated"}),(f==null?void 0:f.required)&&!d&&u.jsx("span",{className:"text-[9px] px-1 py-0 rounded border border-red-900/40 bg-red-950/30 text-red-400/80 uppercase tracking-wide",children:"required"})]}),(f==null?void 0:f.description)&&u.jsx("p",{className:"text-fg-dim text-xs mt-0.5 leading-relaxed",children:yg(f.description)}),M&&u.jsx(hg,{keyName:a,node:p,info:f,targetScope:C,onOverride:j})]}),u.jsx("div",{className:"shrink-0",children:!M&&u.jsx(gg,{node:p,info:f,onSet:v=>{j(v)},disabled:h&&d})})]})})}function hg({keyName:a,node:p,info:f,targetScope:C,onOverride:j}){const R=(p==null?void 0:p.kind)==="leaf"?p:null;return u.jsxs("div",{className:"mt-3 space-y-2 text-xs",children:[(f==null?void 0:f.description)&&u.jsx("p",{className:"text-fg-dim leading-relaxed whitespace-pre-wrap",children:f.description}),u.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-fg-faint",children:[(f==null?void 0:f.type)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Type"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:Array.isArray(f.type)?f.type.join(" | "):f.type})]}),(f==null?void 0:f.default)!==void 0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Default"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:Nn(f.default)})]}),(f==null?void 0:f.enum)&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Options"}),u.jsx("dd",{className:"text-fg-dim font-mono",children:f.enum.map(i=>String(i)).join(" | ")})]}),R&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Current"}),u.jsxs("dd",{className:"font-mono",children:[u.jsx("span",{className:"text-fg-dim",children:Nn(R.value)}),u.jsxs("span",{className:"ml-2 text-fg-faint",children:["from ",lt[R.winner].label]})]})]}),R&&R.shadowed.length>0&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Shadowed"}),u.jsx("dd",{className:"space-y-0.5",children:R.shadowed.map((i,d)=>u.jsxs("div",{className:"font-mono text-fg-faint line-through",children:[Nn(i.value)," —"," ",u.jsx("span",{className:"no-underline",children:lt[i.scope].label})]},d))})]}),(p==null?void 0:p.kind)==="array"&&u.jsxs(u.Fragment,{children:[u.jsx("dt",{children:"Accumulated"}),u.jsxs("dd",{className:"text-fg-dim",children:[p.items.length," items across all scopes"]})]})]}),u.jsx("div",{className:"pt-2 flex items-center gap-2 flex-wrap border-t border-line/60",children:u.jsx(fg,{keyName:a,node:p,info:f,onChange:j,targetScope:C})})]})}function fg({node:a,info:p,onChange:f,targetScope:C}){const M=(a==null?void 0:a.kind)==="leaf"?a.value:p==null?void 0:p.default,R=Qd(p==null?void 0:p.type);if(R==="boolean"){const i=M===!0;return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg-faint",children:"Set to:"}),u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:[{v:!0,label:"on"},{v:!1,label:"off"}].map(({v:d,label:m})=>u.jsx("button",{onClick:()=>f(d),className:`px-3 py-0.5 text-xs transition-colors ${i===d?"bg-accent text-bg":"bg-bg-elev text-fg-dim hover:bg-bg-hi hover:text-fg"}`,children:m},m))}),u.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[C].label]})]})}return p!=null&&p.enum?u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"text-fg-faint",children:"Choose:"}),p.enum.map(i=>{const d=Yd(M,i);return u.jsx("button",{onClick:()=>f(i),className:`px-2 py-0.5 text-xs rounded border ${d?"bg-accent text-bg border-accent":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,children:String(i)},String(i))}),u.jsxs("span",{className:"text-fg-faint",children:["→ ",lt[C].label]})]}):R==="integer"||R==="number"?u.jsx(pg,{value:typeof M=="number"?M:void 0,integer:R==="integer",onCommit:f,target:lt[C].label}):R==="string"?u.jsx(mg,{value:typeof M=="string"?M:"",onCommit:f,target:lt[C].label}):u.jsxs("div",{className:"text-fg-faint",children:["Complex value (",R??"object/array",") — use the"," ",u.jsx("span",{className:"text-fg-dim",children:"Raw"})," tab to edit."]})}function pg({value:a,integer:p,onCommit:f,target:C}){const[j,M]=K.useState(a!==void 0?String(a):""),R=()=>{const i=p?parseInt(j,10):parseFloat(j);Number.isNaN(i)||f(i)};return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg-faint",children:"Set to:"}),u.jsx("input",{type:"number",value:j,onChange:i=>M(i.target.value),onBlur:R,onKeyDown:i=>{i.key==="Enter"&&i.target.blur()},className:"w-24 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsxs("button",{onClick:R,className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",C]})]})}function mg({value:a,onCommit:p,target:f}){const[C,j]=K.useState(a);return u.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[u.jsx("span",{className:"text-fg-faint shrink-0",children:"Set to:"}),u.jsx("input",{type:"text",value:C,onChange:M=>j(M.target.value),onKeyDown:M=>{M.key==="Enter"&&p(C)},className:"flex-1 min-w-0 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsxs("button",{onClick:()=>p(C),className:"shrink-0 px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:["save → ",f]})]})}function gg({node:a,info:p,onSet:f,disabled:C}){const j=(a==null?void 0:a.kind)==="leaf",M=Qd(p==null?void 0:p.type);if(C)return null;if(M==="boolean"){const R=j&&a.value===!0;return u.jsx("button",{onClick:()=>f(!R),className:`px-2.5 py-0.5 text-xs rounded border transition-colors ${R?"bg-accent/15 text-accent border-accent/40 hover:bg-accent hover:text-bg":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:"toggle",children:R?"on":"off"})}return null}function vg({isSet:a,leafNode:p,defaultVal:f,isDefault:C,node:j}){return a?(j==null?void 0:j.kind)==="array"?{kind:"accumulated",label:`${j.items.length} items`}:(j==null?void 0:j.kind)==="object"?{kind:"set",label:"configured"}:p?C?{kind:"default",label:`= default · ${lt[p.winner].label}`}:p.shadowed.length>0?{kind:"override",label:`overriding ${p.shadowed.length} scope(s)`}:{kind:"set",label:`set in ${lt[p.winner].label}`}:{kind:"set",label:"configured"}:f!==void 0?{kind:"default",label:`using default: ${Nn(f)}`}:{kind:"unset",label:"not configured"}}function _g({kind:a,label:p}){const f={set:"bg-accent/15 text-accent border-accent/30",default:"bg-bg-hi text-fg-dim border-line",unset:"bg-bg-elev text-fg-faint border-line",override:"bg-purple-950/30 text-purple-400/80 border-purple-900/40",accumulated:"bg-blue-950/30 text-blue-400/80 border-blue-900/40"}[a];return u.jsx("span",{className:`text-[9px] px-1.5 py-0 rounded border uppercase tracking-wide ${f}`,children:p})}function Qd(a){if(a)return Array.isArray(a)?a.find(f=>f!=="null")??a[0]:a}function Yd(a,p){return a===p?!0:typeof a!=typeof p?!1:a&&p&&typeof a=="object"?JSON.stringify(a)===JSON.stringify(p):!1}function yg(a){const p=a.trim().split(`
|
|
66
|
+
`)[0],f=p.match(/^([^.!?]+[.!?])/);return f?f[1]:p.length>120?p.slice(0,120)+"…":p}function Nn(a){if(typeof a=="string")return a===""?'""':JSON.stringify(a);if(a===null)return"null";if(a===void 0)return"—";if(typeof a=="object"){const p=JSON.stringify(a);return p.length>60?p.slice(0,60)+"…":p}return String(a)}function sl({options:a,active:p,onChange:f}){return u.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:a.map(({key:C,label:j})=>u.jsx("button",{onClick:()=>f(C),className:`px-2 py-0.5 text-xs ${p===C?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:j},C))})}function fi(a){return{path:a,diskRaw:"",draftRaw:"",diskData:null,exists:!1,parseError:null,loadError:null,mtimeMs:0,dirty:!1,busy:!1,lastSavedAt:null}}function Xa(a,p,f){const C={...a,diskRaw:p.raw,diskData:p.data,exists:p.exists,parseError:p.parseError,loadError:p.error,mtimeMs:p.mtimeMs,busy:!1};return!f||!a.dirty?(C.draftRaw=p.raw,C.dirty=!1):C.dirty=C.draftRaw!==C.diskRaw,C}function Sd(a,p,f){const C={...a,diskRaw:p.text,diskData:null,exists:p.exists,parseError:null,loadError:p.error,mtimeMs:p.mtimeMs,busy:!1};return C.draftRaw=p.text,C.dirty=!1,C}const ye=$n((a,p)=>({files:{},watchRefs:{},loadJson:async f=>{const C=p().files[f];a({files:{...p().files,[f]:{...C??fi(f),busy:!0}}});const j=await window.api.config.readJson(f),M=p().files[f]??fi(f);a({files:{...p().files,[f]:Xa(M,j,!1)}})},loadText:async f=>{const C=p().files[f];a({files:{...p().files,[f]:{...C??fi(f),busy:!0}}});const j=await window.api.config.readText(f),M=p().files[f]??fi(f);a({files:{...p().files,[f]:Sd(M,j)}})},setDraft:(f,C)=>{const j=p().files[f]??fi(f),M=C!==j.diskRaw;a({files:{...p().files,[f]:{...j,draftRaw:C,dirty:M}}})},revert:f=>{const C=p().files[f];C&&a({files:{...p().files,[f]:{...C,draftRaw:C.diskRaw,dirty:!1}}})},saveJson:async f=>{const C=p().files[f];if(!C)return{ok:!1,error:"not loaded"};let j;try{j=C.draftRaw.trim()===""?{}:JSON.parse(C.draftRaw)}catch(d){return{ok:!1,error:`invalid JSON: ${d.message}`}}a({files:{...p().files,[f]:{...C,busy:!0}}});const M=await window.api.config.writeJson(f,j);if(!M.ok)return a({files:{...p().files,[f]:{...C,busy:!1}}}),{ok:!1,error:M.error};const R=await window.api.config.readJson(f),i=Xa({...C,busy:!1},R,!1);return a({files:{...p().files,[f]:{...i,lastSavedAt:Date.now()}}}),{ok:!0}},saveText:async f=>{const C=p().files[f];if(!C)return{ok:!1,error:"not loaded"};a({files:{...p().files,[f]:{...C,busy:!0}}});const j=await window.api.config.writeText(f,C.draftRaw);if(!j.ok)return a({files:{...p().files,[f]:{...C,busy:!1}}}),{ok:!1,error:j.error};const M=await window.api.config.readText(f),R=Sd({...C,busy:!1},M);return a({files:{...p().files,[f]:{...R,lastSavedAt:Date.now()}}}),{ok:!0}},watchFile:f=>{const C={...p().watchRefs};C[f]=(C[f]??0)+1,a({watchRefs:C}),C[f]===1&&window.api.config.watch([f])},unwatchFile:f=>{const C={...p().watchRefs};C[f]&&(C[f]--,C[f]<=0&&(delete C[f],window.api.config.unwatch([f])),a({watchRefs:C}))},onExternalChange:f=>{p().files[f]&&window.api.config.readJson(f).then(j=>{const M=p().files[f];M&&a({files:{...p().files,[f]:Xa(M,j,!0)}})})}}));function wg(){return window.api.config.onChanged(({path:a})=>{ye.getState().onExternalChange(a)})}const Sg=[];function Mn(a){return Array.isArray(a)?"array":a!==null&&typeof a=="object"?"object":"scalar"}function il(a){const p=a.filter(f=>f.data!==void 0);return p.length===0?{kind:"object",children:{}}:Zd(p,[])}function Zd(a,p){const f=Sg.includes(p.join(".")),C=a.every(_=>Mn(_.data)==="object"),j=a.every(_=>Mn(_.data)==="array");if(C){const _=new Set;for(const y of a)for(const S of Object.keys(y.data))_.add(S);const h={};for(const y of _){const S=a.filter(k=>y in k.data).map(k=>({scope:k.scope,data:k.data[y]}));h[y]=Zd(S,[...p,y])}return{kind:"object",children:h}}if(j&&!f){const _=[];for(const h of[...a].reverse())for(const y of h.data)_.push({value:y,fromScope:h.scope,index:_.length});return{kind:"array",items:_}}const M=[...a].reverse(),R=M[0],i=M.slice(1).map(_=>({scope:_.scope,value:_.data})),d=Mn(R.data),m=i.some(_=>Mn(_.value)!==d);return{kind:"leaf",value:R.data,winner:R.scope,shadowed:i,...m?{typeMismatch:!0}:{}}}function nl(a,p){if(p.length===0)return a;if(a.kind!=="object")return null;const[f,...C]=p,j=a.children[f];return j?nl(j,C):null}function Wn(a,p,f){if(p.length===0)return f;const[C,...j]=p,M=a&&typeof a=="object"&&!Array.isArray(a)?{...a}:{};return M[C]=Wn(M[C],j,f),M}const xg=["user","project","local"];function ol(a,p){const f=[];for(const C of xg){const j=p[C];if(!j)continue;const M=a[j];if(!M||!M.exists)continue;const R=M.draftRaw??"";if(R.trim())try{f.push({scope:C,data:JSON.parse(R)})}catch{}}return f}const bg="http://json-schema.org/draft-07/schema#",Cg="https://json.schemastore.org/claude-code-settings.json",kg={permissionRule:{type:"string",description:`Tool permission rule.
|
|
67
67
|
See https://code.claude.com/docs/en/settings#permission-rule-syntax
|
|
68
|
-
See https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.`,pattern:"^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LSP|NotebookEdit|Read|Skill|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",examples:["Bash","Bash(npm run build)","Bash(git commit *)","Bash(npm run *)","Bash(ls*)","Bash(git * main)","Edit","Edit(/src/**/*.ts)","Read(./.env)","Read(./secrets/**)","Read(//Users/alice/secrets/**)","Read(~/Documents/*.pdf)","Agent(Explore)","WebFetch","WebFetch(domain:example.com)","mcp__puppeteer","mcp__github__search_repositories"]},hookCommand:{anyOf:[{type:"object",description:"Bash command hook",additionalProperties:!1,required:["type","command"],properties:{type:{type:"string",description:"Hook type",const:"command"},command:{type:"string",description:"Shell command to execute",minLength:1},timeout:{type:"number",description:"Optional timeout in seconds",exclusiveMinimum:0},async:{type:"boolean",description:"Run this hook asynchronously without blocking Claude Code"},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"prompt"},prompt:{type:"string",description:"Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"agent"},prompt:{type:"string",description:"Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 60)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hooks",additionalProperties:!1,required:["type","url"],properties:{type:{type:"string",description:"Hook type",const:"http"},url:{type:"string",description:"URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.",minLength:1},headers:{type:"object",additionalProperties:{type:"string"},description:"Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation."},allowedEnvVars:{type:"array",items:{type:"string",minLength:1},description:"List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed."},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}}]},hookMatcher:{type:"object",description:"Hook matcher configuration with multiple hooks",additionalProperties:!1,required:["hooks"],properties:{matcher:{type:"string",description:"Optional pattern to match event contexts, case-sensitive. Behavior depends on event type. See https://code.claude.com/docs/en/hooks#matcher-patterns for event-specific details and examples"},hooks:{type:"array",description:"Array of hooks to execute",items:{$ref:"#/$defs/hookCommand"}}}}},Eg="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",Lg=!0,Rg=!0,jg="object",Dg=JSON.parse(`{"$schema":{"type":"string","description":"JSON Schema reference for Claude Code settings"},"apiKeyHelper":{"type":"string","description":"Path to a script that outputs authentication values","examples":["/bin/generate_temp_api_key.sh"],"minLength":1},"autoMemoryEnabled":{"type":"boolean","description":"Enable automatic memory saves that capture useful context to .claude/memory/. Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#auto-memory","default":true},"autoUpdatesChannel":{"type":"string","enum":["stable","latest"],"description":"Release channel to follow for updates. Use \\"stable\\" for a version that is typically about one week old and skips versions with major regressions, or \\"latest\\" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable updates entirely.","default":"latest"},"awsCredentialExport":{"type":"string","description":"Path to a script that exports AWS credentials","examples":["/bin/generate_aws_grant.sh"],"minLength":1},"awsAuthRefresh":{"type":"string","description":"Path to a script that refreshes AWS authentication","examples":["aws sso login --profile myprofile"],"minLength":1},"claudeMdExcludes":{"type":"array","items":{"type":"string","minLength":1},"description":"Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claudemd-files","examples":[["**/monorepo/CLAUDE.md","/home/user/monorepo/other-team/.claude/rules/**"]]},"cleanupPeriodDays":{"type":"integer","minimum":0,"description":"Number of days to retain chat transcripts (0 to disable cleanup)","examples":[20,30,60],"default":30},"env":{"type":"object","additionalProperties":false,"description":"Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.\\nUNDOCUMENTED: CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS (plugin marketplace git timeout in ms, default 120000, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2151).\\nUNDOCUMENTED: ENABLE_CLAUDEAI_MCP_SERVERS (set to false to opt out of claude.ai MCP servers, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2163).","examples":[{"ANTHROPIC_MODEL":"claude-opus-4-1","ANTHROPIC_SMALL_FAST_MODEL":"claude-3-5-haiku-latest"}],"default":{},"patternProperties":{"^[A-Z_][A-Z0-9_]*$":{"type":"string","description":"Environment variable value"}}},"attribution":{"type":"object","description":"Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings","additionalProperties":false,"properties":{"commit":{"type":"string","description":"Attribution for git commits, including any trailers. Empty string hides commit attribution"},"pr":{"type":"string","description":"Attribution for pull request descriptions. Empty string hides pull request attribution"}}},"includeGitInstructions":{"type":"boolean","description":"Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings","default":true},"includeCoAuthoredBy":{"type":"boolean","description":"DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)","default":true},"plansDirectory":{"type":"string","description":"Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)","default":"~/.claude/plans","examples":["./plans"]},"respectGitignore":{"type":"boolean","description":"Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions","default":true},"permissions":{"type":"object","properties":{"allow":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for allowed operations","uniqueItems":true},"deny":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for denied operations","uniqueItems":true},"ask":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules that should always prompt for confirmation","uniqueItems":true},"defaultMode":{"type":"string","enum":["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],"description":"Default permission mode.\\n\\"default\\": prompts on first use.\\n\\"acceptEdits\\": auto-accepts file edits.\\n\\"plan\\": read-only, no modifications.\\nUNDOCUMENTED. \\"delegate\\": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).\\n\\"dontAsk\\": auto-denies unless pre-approved via permissions.\\n\\"bypassPermissions\\": skips all prompts (use only in isolated environments).\\nSee https://code.claude.com/docs/en/permissions"},"disableBypassPermissionsMode":{"type":"string","enum":["disable"],"description":"Disable the ability to bypass permission prompts"},"additionalDirectories":{"type":"array","items":{"type":"string","minLength":1},"description":"Additional directories to include in the permission scope","examples":[["//Users/alice/Documents","~/projects"]],"uniqueItems":true}},"additionalProperties":false,"description":"Tool usage permissions configuration.\\nSee https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings\\nSee https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.","examples":[{"allow":["Bash(git add:*)"],"ask":["Bash(gh pr create:*)","Bash(git commit:*)"],"deny":["Read(*.env)","Bash(rm:*)","Bash(curl:*)"],"defaultMode":"default"}]},"language":{"type":"string","description":"Preferred language for Claude's responses","examples":["japanese","spanish","french"]},"model":{"type":"string","description":"Override the default model used by Claude Code. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config"},"availableModels":{"type":"array","items":{"type":"string"},"description":"Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection","examples":[["sonnet","haiku"]]},"modelOverrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version","examples":[{"claude-opus-4-6":"arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"}]},"effortLevel":{"type":"string","enum":["low","medium","high"],"description":"Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Defaults vary by model and plan (Opus 4.6 defaults to medium for Max and Team subscribers). Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level"},"fastMode":{"type":"boolean","description":"Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode","default":false},"fastModePerSessionOptIn":{"type":"boolean","description":"Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode","default":false},"feedbackSurveyRate":{"type":"number","minimum":0,"maximum":1,"description":"Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings","examples":[0.05]},"enableAllProjectMcpServers":{"type":"boolean","description":"Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp","examples":[true]},"enabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["memory","github"]]},"disabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["filesystem"]]},"allowedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that users are allowed to configure"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"deniedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that is explicitly blocked"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"httpHookAllowedEnvVars":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["MY_TOKEN","HOOK_SECRET"]]},"hooks":{"type":"object","additionalProperties":false,"description":"Custom commands to run before/after tool executions. See https://code.claude.com/docs/en/hooks","examples":[{"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"prettier --write","timeout":5}]}]}],"properties":{"PreToolUse":{"type":"array","description":"Hooks that run before tool calls","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUse":{"type":"array","description":"Hooks that run after tool completion","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUseFailure":{"type":"array","description":"Hooks that run after a tool fails","items":{"$ref":"#/$defs/hookMatcher"}},"PermissionRequest":{"type":"array","description":"Hooks that run when a permission dialog appears","items":{"$ref":"#/$defs/hookMatcher"}},"Notification":{"type":"array","description":"Hooks that trigger on notifications","items":{"$ref":"#/$defs/hookMatcher"}},"UserPromptSubmit":{"type":"array","description":"Hooks that run when a user submits a prompt","items":{"$ref":"#/$defs/hookMatcher"}},"Stop":{"type":"array","description":"Hooks that run when agents finish responding. Does not run on user interrupt","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStart":{"type":"array","description":"Hooks that run when a subagent is spawned","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStop":{"type":"array","description":"Hooks that run when subagents finish responding","items":{"$ref":"#/$defs/hookMatcher"}},"PreCompact":{"type":"array","description":"Hooks that run before the context is compacted","items":{"$ref":"#/$defs/hookMatcher"}},"PostCompact":{"type":"array","description":"Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"Elicitation":{"type":"array","description":"Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"ElicitationResult":{"type":"array","description":"Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"TeammateIdle":{"type":"array","description":"Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle","items":{"$ref":"#/$defs/hookMatcher"}},"TaskCompleted":{"type":"array","description":"Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted","items":{"$ref":"#/$defs/hookMatcher"}},"Setup":{"type":"array","description":"UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)","items":{"$ref":"#/$defs/hookMatcher"}},"InstructionsLoaded":{"type":"array","description":"Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded","items":{"$ref":"#/$defs/hookMatcher"}},"ConfigChange":{"type":"array","description":"Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeCreate":{"type":"array","description":"Hooks that run when a worktree is created via --worktree or isolation: \\"worktree\\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeRemove":{"type":"array","description":"Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove","items":{"$ref":"#/$defs/hookMatcher"}},"SessionStart":{"type":"array","description":"Hooks that run when a new session starts","items":{"$ref":"#/$defs/hookMatcher"}},"SessionEnd":{"type":"array","description":"Hooks that run when a session ends","items":{"$ref":"#/$defs/hookMatcher"}}}},"disableAllHooks":{"type":"boolean","description":"Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks"},"allowedHttpHookUrls":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["https://hooks.example.com/*","http://localhost:*"]]},"allowManagedHooksOnly":{"type":"boolean","description":"(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration"},"allowManagedPermissionRulesOnly":{"type":"boolean","description":"(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings"},"statusLine":{"type":"object","properties":{"type":{"type":"string","description":"The type of status line handler; must be set to \\"command\\" to run a custom shell script that receives JSON session data via stdin.","const":"command"},"command":{"type":"string","description":"A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"},"padding":{"type":"number","description":"Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."}},"required":["type","command"],"additionalProperties":false,"description":"Custom status line display configuration. See https://code.claude.com/docs/en/statusline","examples":[{"type":"command","command":"~/.claude/statusline.sh"}]},"fileSuggestion":{"type":"object","properties":{"type":{"type":"string","description":"The type of file suggestion handler; must be set to \\"command\\" to execute a custom shell script that generates file suggestions for the @ file picker.","const":"command"},"command":{"type":"string","description":"Shell command to execute for file suggestions"}},"required":["type","command"],"additionalProperties":false,"description":"Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings","examples":[{"type":"command","command":"~/.claude/file-suggestion.sh"}]},"enabledPlugins":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"not":{}}]},"description":"Enabled plugins using plugin-id@marketplace-id format. Example: { \\"formatter@anthropic-tools\\": true }. See https://code.claude.com/docs/en/plugins"},"extraKnownMarketplaces":{"type":"object","additionalProperties":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","pattern":"\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false}],"description":"Where to fetch the marketplace from"},"installLocation":{"type":"string","description":"Local cache path where marketplace manifest is stored (auto-generated if not provided)"}},"required":["source"],"additionalProperties":false},"description":"Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces"},"strictKnownMarketplaces":{"type":"array","description":"(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces","items":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers for authenticated access"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package name (supports scoped packages)"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Absolute path to marketplace.json file"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Absolute path to directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"pathPattern"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"],"additionalProperties":false}]},"examples":[[{"source":"github","repo":"acme-corp/approved-plugins"},{"source":"npm","package":"@acme-corp/compliance-plugins"}]]},"skippedMarketplaces":{"type":"array","items":{"type":"string","minLength":1},"description":"List of marketplace names the user has chosen not to install when prompted"},"skippedPlugins":{"type":"array","items":{"type":"string","minLength":1},"description":"List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"},"forceLoginMethod":{"type":"string","enum":["claudeai","console"],"description":"Force a specific login method: \\"claudeai\\" for Claude Pro/Max, \\"console\\" for Console billing","examples":["claudeai"]},"forceLoginOrgUUID":{"type":"string","description":"Organization UUID to use for OAuth login","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"minLength":1},"otelHeadersHelper":{"type":"string","description":"Path to a script that outputs OpenTelemetry headers","minLength":1},"outputStyle":{"type":"string","description":"Controls the output style for assistant responses. Built-in styles: default, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles","examples":["default","Explanatory","Learning"],"minLength":1},"skipWebFetchPreflight":{"type":"boolean","description":"Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"},"sandbox":{"type":"object","description":"Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing","properties":{"network":{"type":"object","description":"Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.","properties":{"allowUnixSockets":{"type":"array","items":{"type":"string"},"description":"Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified"},"allowLocalBinding":{"type":"boolean","description":"Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified"},"httpProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"socksProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"allowAllUnixSockets":{"type":"boolean","description":"Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"},"allowManagedDomainsOnly":{"type":"boolean","description":"(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts."}},"additionalProperties":false},"ignoreViolations":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"List of filesystem paths to ignore sandbox violations for when this command pattern matches"},"description":"Map of command patterns to filesystem paths to ignore violations for. Use \\"*\\" to match all commands"},"excludedCommands":{"type":"array","items":{"type":"string"},"description":"Commands that should never run in the sandbox (e.g., [\\"git\\", \\"docker\\"])"},"autoAllowBashIfSandboxed":{"type":"boolean","description":"Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.","default":true},"enableWeakerNetworkIsolation":{"type":"boolean","description":"macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings","default":false},"enableWeakerNestedSandbox":{"type":"boolean","description":"Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure)."},"allowUnsandboxedCommands":{"type":"boolean","description":"Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."},"enabled":{"type":"boolean","description":"Enable sandboxed bash"},"filesystem":{"type":"object","description":"Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation","properties":{"allowWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path)"},"denyWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite"},"denyRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied read access"},"allowRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths"},"allowManagedReadPathsOnly":{"type":"boolean","description":"When true (managed settings only), only allowRead paths from managed settings are used"}},"additionalProperties":false}},"additionalProperties":false},"spinnerVerbs":{"type":"object","description":"Customize the verbs shown in spinner progress messages","properties":{"mode":{"type":"string","enum":["append","replace"],"description":"How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"},"verbs":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Custom verbs used in spinner progress text"}},"required":["verbs"],"additionalProperties":false},"spinnerTipsEnabled":{"type":"boolean","description":"Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)","default":true},"spinnerTipsOverride":{"type":"object","description":"Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings","properties":{"excludeDefault":{"type":"boolean","description":"If true, only show custom tips. If false or absent, custom tips merge with built-in tips","default":false},"tips":{"type":"array","items":{"type":"string","minLength":1},"description":"Custom tip strings to display in the spinner","minItems":1}},"required":["tips"],"additionalProperties":false},"terminalProgressBarEnabled":{"type":"boolean","description":"Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)","default":true},"showTurnDuration":{"type":"boolean","description":"Show turn duration messages after responses (e.g., \\"Cooked for 1m 6s\\"). Set to false to hide these messages (default: true)","default":true},"prefersReducedMotion":{"type":"boolean","description":"Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility","default":false},"alwaysThinkingEnabled":{"type":"boolean","description":"Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode"},"companyAnnouncements":{"type":"array","items":{"type":"string","minLength":1},"description":"Company announcements to display at startup (one will be randomly selected if multiple are provided)"},"teammateMode":{"type":"string","enum":["auto","in-process","tmux"],"description":"How agent team teammates display: \\"auto\\" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams","default":"auto"},"worktree":{"type":"object","additionalProperties":false,"description":"Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings","properties":{"sparsePaths":{"type":"array","items":{"type":"string","minLength":1},"description":"Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos.","examples":[["packages/my-app","shared/utils"]]}}},"pluginTrustMessage":{"type":"string","description":"(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings","minLength":1},"pluginConfigs":{"type":"object","additionalProperties":{"type":"object","properties":{"mcpServers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"description":"User configuration values for MCP servers keyed by server name"}},"additionalProperties":false},"description":"Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins"},"allowManagedMcpServersOnly":{"type":"boolean","description":"(Managed settings only) Only allowedMcpServers from managed settings are respected. deniedMcpServers still merges from all sources. Users can still add their own MCP servers, but only the admin-defined allowlist applies."},"blockedMarketplaces":{"type":"array","description":"(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"url","description":"Block marketplace fetched from direct URL"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers (e.g., for authentication)"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"github","description":"Block marketplace from GitHub repository"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","repo"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"git","description":"Block marketplace from git repository URL"},"url":{"type":"string","pattern":".*\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"npm","description":"Block marketplace from NPM package"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"file","description":"Block marketplace from local file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"directory","description":"Block marketplace from local directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"hostPattern","description":"Block marketplace by host pattern matching"},"hostPattern":{"type":"string","description":"Regex pattern to match the host/domain extracted from any marketplace source type"}},"required":["source","hostPattern"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"pathPattern","description":"Block marketplace by file/directory path pattern matching"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"]}]}}}`),Pg="Claude Code Settings",Tg={$schema:bg,$id:Cg,$defs:kg,description:Eg,allowTrailingCommas:Lg,additionalProperties:Rg,type:jg,properties:Dg,title:Pg};function Ag(a){const p=a??{},f={...p.$defs??{},...p.definitions??{}},C=S=>{if(!S)return{};if(!S.$ref)return R(S);const k=/^#\/(\$defs|definitions)\/(.+)$/.exec(S.$ref);if(!k)return R(S);const v=f[k[2]];return v?C({...v,...i(S)}):R(S)},j=new Set(["__proto__","constructor","prototype"]),M=S=>{if(!S)return{};const k={};for(const[v,n]of Object.entries(S))j.has(v)||(k[v]=n);return k},R=S=>{if(!S.allOf||S.allOf.length===0)return S;const k={...S};delete k.allOf;for(const v of S.allOf){const n=C(v);Object.assign(k,{properties:{...M(k.properties),...M(n.properties)},required:Mg([...k.required??[],...n.required??[]])}),!k.description&&n.description&&(k.description=n.description),k.default===void 0&&n.default!==void 0&&(k.default=n.default),!k.type&&n.type&&(k.type=n.type)}return k},i=S=>{const{$ref:k,...v}=S;return v},d=(S,k)=>{let v=C(S);for(const n of k){if(!v)return null;if(/^\d+$/.test(n)){const l=Array.isArray(v.items)?v.items[Number(n)]:v.items;v=l?C(l):null;continue}const u=v.properties;if(u&&!j.has(n)&&n in u){v=C(u[n]);continue}const o=v.additionalProperties;if(o&&typeof o=="object"){v=C(o);continue}return null}return v},m=(S,k,v)=>{if(!S)return null;const n={};if(S.description&&(n.description=S.description),S.type&&(n.type=S.type),S.default!==void 0&&(n.default=S.default),S.enum&&(n.enum=S.enum),S.const!==void 0&&(n.const=S.const),S.deprecated&&(n.deprecated=!0),S.examples&&(n.examples=S.examples),S.properties&&(n.knownChildren=Object.keys(S.properties)),v&&(k!=null&&k.includes(v))&&(n.required=!0),S.items&&!Array.isArray(S.items)){const u=C(S.items),o=m(u,void 0,null);o&&(n.itemsInfo=o)}return(S.additionalProperties===!0||typeof S.additionalProperties=="object")&&(n.open=!0),n},_=S=>k=>{if(k.length===0)return m(C(S),void 0,null);const v=d(S,k.slice(0,-1));if(!v)return null;const n=k[k.length-1],u=d(v,[n]);return m(u,v.required,n)},h=S=>{const k=C(S);return Object.keys(k.properties??{})},y=S=>({at:_(S),rootKeys:()=>h(S),rootedAt:k=>{const v=d(S,k);return y(v??{})}});return y(p)}function Mg(a){return Array.from(new Set(a))}let Qa=null;function Hn(){return Qa||(Qa=Ag(Tg)),Qa}function Og(){const a=Ke(),p=Le(x=>x.tabs),f=Le(x=>x.activeTabId),C=p.find(x=>x.id===f)??null,j=(C==null?void 0:C.cwd)??null,[M,R]=K.useState("user"),[i,d]=K.useState("effective"),m=K.useMemo(()=>{const x={};for(const P of Ls.scopes){const H=Ls.resolve(P,a??"",j);H&&(x[P]=H)}return x},[a,j]),_=m[M]??null,h=ye(x=>x.files),y=ye(x=>x.loadJson),S=ye(x=>x.setDraft),k=ye(x=>x.saveJson),v=ye(x=>x.revert),n=ye(x=>x.watchFile),u=ye(x=>x.unwatchFile);K.useEffect(()=>{const x=Object.values(m).filter(Boolean);return x.forEach(P=>{h[P]||y(P),n(P)}),()=>{x.forEach(P=>u(P))}},[JSON.stringify(m)]);const[o,l]=K.useState(null),w=K.useMemo(()=>il(ol(h,m)),[h,m]),E=(x,P)=>{var X;const H=m[M];if(!H)return;l(null);const $=((X=h[H])==null?void 0:X.draftRaw)??"";let W={};if($.trim())try{W=JSON.parse($)}catch{W={}}const I=Wn(W,x,P);S(H,JSON.stringify(I,null,2)+`
|
|
69
|
-
`)};if(!a)return c.jsx(xe,{title:"loading…"});const L=_?h[_]:null,D=x=>x!=="user"&&!j;return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx(sl,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"}],active:i,onChange:d}),c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:Ls.scopes,active:M,onChange:R,annotate:x=>{if(D(x))return{exists:!1};const P=m[x];if(!P)return null;const H=h[P];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),c.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${_??"—"}`:_??"—"}),c.jsx("div",{className:"flex-1"}),c.jsx("a",{href:"https://code.claude.com/docs/en/settings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"schema reference ↗"})]}),footer:_&&L?c.jsx(Tr,{dirty:L.dirty,busy:L.busy,parseError:o||L.parseError,lastSavedAt:L.lastSavedAt,leading:L.exists?null:c.jsx("span",{children:"file will be created on save"}),onSave:async()=>{l(null);const x=await k(_);x.ok||l(x.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:D(M)?c.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):i==="effective"?c.jsx(cg,{node:w,targetScope:M,onOverride:E,schema:Hn()}):i==="tree"?c.jsx(rl,{node:w,targetScope:M,onOverride:E,schema:Hn()}):_&&L?c.jsx(qd,{path:_,value:L.draftRaw,onChange:x=>{l(null),S(_,x)}}):c.jsx(xe,{title:"resolving…"})})}function al({value:a,onChange:p,path:f,readOnly:C}){return c.jsx(Vd,{path:`file://${f}`,defaultLanguage:"markdown",value:a,onChange:j=>p(j??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:C,automaticLayout:!0}})}const xd=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],bd=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],Cd=[{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]}],kd=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],Pt=(a,p,f,C)=>`---
|
|
68
|
+
See https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.`,pattern:"^((Agent|Bash|Edit|ExitPlanMode|Glob|Grep|KillShell|LSP|NotebookEdit|Read|Skill|TaskCreate|TaskGet|TaskList|TaskOutput|TaskStop|TaskUpdate|TodoWrite|ToolSearch|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",examples:["Bash","Bash(npm run build)","Bash(git commit *)","Bash(npm run *)","Bash(ls*)","Bash(git * main)","Edit","Edit(/src/**/*.ts)","Read(./.env)","Read(./secrets/**)","Read(//Users/alice/secrets/**)","Read(~/Documents/*.pdf)","Agent(Explore)","WebFetch","WebFetch(domain:example.com)","mcp__puppeteer","mcp__github__search_repositories"]},hookCommand:{anyOf:[{type:"object",description:"Bash command hook",additionalProperties:!1,required:["type","command"],properties:{type:{type:"string",description:"Hook type",const:"command"},command:{type:"string",description:"Shell command to execute",minLength:1},timeout:{type:"number",description:"Optional timeout in seconds",exclusiveMinimum:0},async:{type:"boolean",description:"Run this hook asynchronously without blocking Claude Code"},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"prompt"},prompt:{type:"string",description:"Prompt to evaluate with LLM. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks",additionalProperties:!1,required:["type","prompt"],properties:{type:{type:"string",description:"Hook type",const:"agent"},prompt:{type:"string",description:"Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.",minLength:1},model:{type:"string",description:"Model to use for evaluation. Defaults to a fast model"},timeout:{type:"number",description:"Optional timeout in seconds (default: 60)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}},{type:"object",description:"HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hooks",additionalProperties:!1,required:["type","url"],properties:{type:{type:"string",description:"Hook type",const:"http"},url:{type:"string",description:"URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.",minLength:1},headers:{type:"object",additionalProperties:{type:"string"},description:"Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation."},allowedEnvVars:{type:"array",items:{type:"string",minLength:1},description:"List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed."},timeout:{type:"number",description:"Optional timeout in seconds (default: 30)",exclusiveMinimum:0},statusMessage:{type:"string",description:"Custom spinner message displayed while the hook runs"}}}]},hookMatcher:{type:"object",description:"Hook matcher configuration with multiple hooks",additionalProperties:!1,required:["hooks"],properties:{matcher:{type:"string",description:"Optional pattern to match event contexts, case-sensitive. Behavior depends on event type. See https://code.claude.com/docs/en/hooks#matcher-patterns for event-specific details and examples"},hooks:{type:"array",description:"Array of hooks to execute",items:{$ref:"#/$defs/hookCommand"}}}}},Eg="Configuration settings for Claude Code. Learn more: https://code.claude.com/docs/en/settings",Lg=!0,Rg=!0,jg="object",Dg=JSON.parse(`{"$schema":{"type":"string","description":"JSON Schema reference for Claude Code settings"},"apiKeyHelper":{"type":"string","description":"Path to a script that outputs authentication values","examples":["/bin/generate_temp_api_key.sh"],"minLength":1},"autoMemoryEnabled":{"type":"boolean","description":"Enable automatic memory saves that capture useful context to .claude/memory/. Also configurable via CLAUDE_CODE_DISABLE_AUTO_MEMORY environment variable (set to 1 to disable, 0 to enable). See https://code.claude.com/docs/en/memory#auto-memory","default":true},"autoUpdatesChannel":{"type":"string","enum":["stable","latest"],"description":"Release channel to follow for updates. Use \\"stable\\" for a version that is typically about one week old and skips versions with major regressions, or \\"latest\\" (default) for the most recent release. Set DISABLE_AUTOUPDATER=1 to disable updates entirely.","default":"latest"},"awsCredentialExport":{"type":"string","description":"Path to a script that exports AWS credentials","examples":["/bin/generate_aws_grant.sh"],"minLength":1},"awsAuthRefresh":{"type":"string","description":"Path to a script that refreshes AWS authentication","examples":["aws sso login --profile myprofile"],"minLength":1},"claudeMdExcludes":{"type":"array","items":{"type":"string","minLength":1},"description":"Glob patterns for CLAUDE.md files to exclude from loading. Useful in monorepos to skip irrelevant instructions from other teams. Patterns match against absolute file paths. Arrays merge across settings layers. Managed policy CLAUDE.md files cannot be excluded. See https://code.claude.com/docs/en/memory#exclude-specific-claudemd-files","examples":[["**/monorepo/CLAUDE.md","/home/user/monorepo/other-team/.claude/rules/**"]]},"cleanupPeriodDays":{"type":"integer","minimum":0,"description":"Number of days to retain chat transcripts (0 to disable cleanup)","examples":[20,30,60],"default":30},"env":{"type":"object","additionalProperties":false,"description":"Environment variables to set for Claude Code sessions. Many environment variables provide settings dimensions not available as dedicated settings.json properties (e.g., thinking tokens, prompt caching, bash timeouts, shell configuration). See https://code.claude.com/docs/en/settings#environment-variables for the full list.\\nUNDOCUMENTED: CLAUDE_CODE_PLUGIN_GIT_TIMEOUT_MS (plugin marketplace git timeout in ms, default 120000, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2151).\\nUNDOCUMENTED: ENABLE_CLAUDEAI_MCP_SERVERS (set to false to opt out of claude.ai MCP servers, see https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2163).","examples":[{"ANTHROPIC_MODEL":"claude-opus-4-1","ANTHROPIC_SMALL_FAST_MODEL":"claude-3-5-haiku-latest"}],"default":{},"patternProperties":{"^[A-Z_][A-Z0-9_]*$":{"type":"string","description":"Environment variable value"}}},"attribution":{"type":"object","description":"Customize attribution for git commits and pull requests. See https://code.claude.com/docs/en/settings#attribution-settings","additionalProperties":false,"properties":{"commit":{"type":"string","description":"Attribution for git commits, including any trailers. Empty string hides commit attribution"},"pr":{"type":"string","description":"Attribution for pull request descriptions. Empty string hides pull request attribution"}}},"includeGitInstructions":{"type":"boolean","description":"Include built-in git commit and PR workflow instructions in Claude's system prompt. Also configurable via CLAUDE_CODE_DISABLE_GIT_INSTRUCTIONS environment variable (set to 1 to disable). See https://code.claude.com/docs/en/settings#available-settings","default":true},"includeCoAuthoredBy":{"type":"boolean","description":"DEPRECATED. Use 'attribution' instead. Whether to include the co-authored-by Claude byline in git commits and pull requests (default: true)","default":true},"plansDirectory":{"type":"string","description":"Customize where plan files are stored. Path is relative to project root (default: ~/.claude/plans)","default":"~/.claude/plans","examples":["./plans"]},"respectGitignore":{"type":"boolean","description":"Control whether the @ file picker respects .gitignore patterns. When true (default), files matching .gitignore patterns are excluded from suggestions","default":true},"permissions":{"type":"object","properties":{"allow":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for allowed operations","uniqueItems":true},"deny":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules for denied operations","uniqueItems":true},"ask":{"type":"array","items":{"$ref":"#/$defs/permissionRule"},"description":"List of permission rules that should always prompt for confirmation","uniqueItems":true},"defaultMode":{"type":"string","enum":["acceptEdits","bypassPermissions","default","delegate","dontAsk","plan"],"description":"Default permission mode.\\n\\"default\\": prompts on first use.\\n\\"acceptEdits\\": auto-accepts file edits.\\n\\"plan\\": read-only, no modifications.\\nUNDOCUMENTED. \\"delegate\\": coordination-only for agent team leads (agent teams are experimental; enable via CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).\\n\\"dontAsk\\": auto-denies unless pre-approved via permissions.\\n\\"bypassPermissions\\": skips all prompts (use only in isolated environments).\\nSee https://code.claude.com/docs/en/permissions"},"disableBypassPermissionsMode":{"type":"string","enum":["disable"],"description":"Disable the ability to bypass permission prompts"},"additionalDirectories":{"type":"array","items":{"type":"string","minLength":1},"description":"Additional directories to include in the permission scope","examples":[["//Users/alice/Documents","~/projects"]],"uniqueItems":true}},"additionalProperties":false,"description":"Tool usage permissions configuration.\\nSee https://code.claude.com/docs/en/permissions and https://code.claude.com/docs/en/settings#permission-settings\\nSee https://code.claude.com/docs/en/settings#tools-available-to-claude for full list of tools available to Claude.","examples":[{"allow":["Bash(git add:*)"],"ask":["Bash(gh pr create:*)","Bash(git commit:*)"],"deny":["Read(*.env)","Bash(rm:*)","Bash(curl:*)"],"defaultMode":"default"}]},"language":{"type":"string","description":"Preferred language for Claude's responses","examples":["japanese","spanish","french"]},"model":{"type":"string","description":"Override the default model used by Claude Code. For finer control, use environment variables: ANTHROPIC_MODEL (runtime override), ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL (per-class pinning), CLAUDE_CODE_SUBAGENT_MODEL (subagent model). See https://code.claude.com/docs/en/model-config"},"availableModels":{"type":"array","items":{"type":"string"},"description":"Restrict which models users can select. When defined at multiple settings levels (user, project, etc.), arrays are merged and deduplicated. See https://code.claude.com/docs/en/model-config#restrict-model-selection","examples":[["sonnet","haiku"]]},"modelOverrides":{"type":"object","additionalProperties":{"type":"string"},"description":"Map Anthropic model IDs to provider-specific model IDs such as Bedrock inference profile ARNs, Vertex AI version names, or Foundry deployment names. Each model picker entry uses its mapped value when calling the provider API. Unknown keys are ignored. See https://code.claude.com/docs/en/model-config#override-model-ids-per-version","examples":[{"claude-opus-4-6":"arn:aws:bedrock:us-east-2:123456789012:application-inference-profile/opus-prod"}]},"effortLevel":{"type":"string","enum":["low","medium","high"],"description":"Control Opus 4.6 adaptive reasoning effort. Lower effort is faster and cheaper for straightforward tasks, higher effort provides deeper reasoning. Defaults vary by model and plan (Opus 4.6 defaults to medium for Max and Team subscribers). Use /effort auto to reset to model default. Also configurable via CLAUDE_CODE_EFFORT_LEVEL environment variable. See https://code.claude.com/docs/en/model-config#adjust-effort-level"},"fastMode":{"type":"boolean","description":"Enable fast mode for Opus 4.6 (research preview). Fast mode uses the same model with 2.5x faster output at higher per-token cost. Requires extra usage enabled. Alternatively, toggle with /fast command. See https://code.claude.com/docs/en/fast-mode","default":false},"fastModePerSessionOptIn":{"type":"boolean","description":"Require per-session opt-in for fast mode. When true, fast mode does not persist across sessions and users must enable it with /fast each session. Useful for controlling costs. See https://code.claude.com/docs/en/fast-mode","default":false},"feedbackSurveyRate":{"type":"number","minimum":0,"maximum":1,"description":"Probability (0–1) that the session quality survey appears when eligible. A value of 0.05 means 5% of eligible sessions. See https://code.claude.com/docs/en/settings","examples":[0.05]},"enableAllProjectMcpServers":{"type":"boolean","description":"Whether to automatically approve all MCP servers in the project. See https://code.claude.com/docs/en/mcp","examples":[true]},"enabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of approved MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["memory","github"]]},"disabledMcpjsonServers":{"type":"array","items":{"type":"string","minLength":1},"description":"List of rejected MCP servers from .mcp.json. See https://code.claude.com/docs/en/mcp","examples":[["filesystem"]]},"allowedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that users are allowed to configure"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise allowlist of MCP servers that can be used. Applies to all scopes including enterprise servers from managed-mcp.json. If undefined, all servers are allowed. If empty array, no servers are allowed. Denylist takes precedence - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"deniedMcpServers":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"serverName":{"type":"string","pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the MCP server that is explicitly blocked"}},"required":["serverName"],"additionalProperties":false},{"type":"object","properties":{"serverCommand":{"type":"array","items":{"type":"string"},"description":"Exact command and arguments used to start stdio servers"}},"required":["serverCommand"],"additionalProperties":false},{"type":"object","properties":{"serverUrl":{"type":"string","description":"URL pattern for remote servers, supports wildcards (e.g., https://*.example.com/*)"}},"required":["serverUrl"],"additionalProperties":false}]},"description":"Enterprise denylist of MCP servers that are explicitly blocked. If a server is on the denylist, it will be blocked across all scopes including enterprise. Denylist takes precedence over allowlist - if a server is on both lists, it is denied. See https://code.claude.com/docs/en/mcp#restriction-options"},"httpHookAllowedEnvVars":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of environment variable names HTTP hooks may interpolate into headers. When set, each hook's effective allowedEnvVars is the intersection with this list. Undefined = no restriction. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["MY_TOKEN","HOOK_SECRET"]]},"hooks":{"type":"object","additionalProperties":false,"description":"Custom commands to run before/after tool executions. See https://code.claude.com/docs/en/hooks","examples":[{"PostToolUse":[{"matcher":"Edit|Write","hooks":[{"type":"command","command":"prettier --write","timeout":5}]}]}],"properties":{"PreToolUse":{"type":"array","description":"Hooks that run before tool calls","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUse":{"type":"array","description":"Hooks that run after tool completion","items":{"$ref":"#/$defs/hookMatcher"}},"PostToolUseFailure":{"type":"array","description":"Hooks that run after a tool fails","items":{"$ref":"#/$defs/hookMatcher"}},"PermissionRequest":{"type":"array","description":"Hooks that run when a permission dialog appears","items":{"$ref":"#/$defs/hookMatcher"}},"Notification":{"type":"array","description":"Hooks that trigger on notifications","items":{"$ref":"#/$defs/hookMatcher"}},"UserPromptSubmit":{"type":"array","description":"Hooks that run when a user submits a prompt","items":{"$ref":"#/$defs/hookMatcher"}},"Stop":{"type":"array","description":"Hooks that run when agents finish responding. Does not run on user interrupt","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStart":{"type":"array","description":"Hooks that run when a subagent is spawned","items":{"$ref":"#/$defs/hookMatcher"}},"SubagentStop":{"type":"array","description":"Hooks that run when subagents finish responding","items":{"$ref":"#/$defs/hookMatcher"}},"PreCompact":{"type":"array","description":"Hooks that run before the context is compacted","items":{"$ref":"#/$defs/hookMatcher"}},"PostCompact":{"type":"array","description":"Hooks that run after the context is compacted. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"Elicitation":{"type":"array","description":"Hooks that run when an MCP server requests user input during a tool call. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"ElicitationResult":{"type":"array","description":"Hooks that run after a user responds to an MCP elicitation, before the response is sent back to the server. See https://code.claude.com/docs/en/hooks","items":{"$ref":"#/$defs/hookMatcher"}},"TeammateIdle":{"type":"array","description":"Hooks that run when an agent team teammate is about to go idle. Exit code 2 sends feedback and keeps the teammate working. Does not support matchers. Agent teams are experimental. See https://code.claude.com/docs/en/hooks#teammateidle","items":{"$ref":"#/$defs/hookMatcher"}},"TaskCompleted":{"type":"array","description":"Hooks that run when a task is being marked as completed. Exit code 2 prevents completion and sends feedback. Does not support matchers. See https://code.claude.com/docs/en/hooks#taskcompleted","items":{"$ref":"#/$defs/hookMatcher"}},"Setup":{"type":"array","description":"UNDOCUMENTED. Hooks that run during repository initialization (--init, --init-only) or maintenance (--maintenance)","items":{"$ref":"#/$defs/hookMatcher"}},"InstructionsLoaded":{"type":"array","description":"Hooks that run when a CLAUDE.md or .claude/rules/*.md file is loaded into context. Fires at session start and when files are lazily loaded (e.g., nested traversal, path glob match). No decision control; used for audit logging and observability. Does not support matchers. See https://code.claude.com/docs/en/hooks#instructionsloaded","items":{"$ref":"#/$defs/hookMatcher"}},"ConfigChange":{"type":"array","description":"Hooks that run when settings, managed settings, or skill files change during a session. Supports matchers: user_settings, project_settings, local_settings, policy_settings, skills. Command handlers only. Exit code 2 blocks the change (except policy_settings which is audit-only). See https://code.claude.com/docs/en/hooks#configchange","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeCreate":{"type":"array","description":"Hooks that run when a worktree is created via --worktree or isolation: \\"worktree\\" in subagents. Command handlers only, no matchers. Hook must print absolute path to created worktree on stdout; non-zero exit fails creation. See https://code.claude.com/docs/en/hooks#worktreecreate","items":{"$ref":"#/$defs/hookMatcher"}},"WorktreeRemove":{"type":"array","description":"Hooks that run when a worktree is being removed at session exit or when a subagent finishes. Command handlers only, no matchers. Used for cleanup tasks; cannot block removal. See https://code.claude.com/docs/en/hooks#worktreeremove","items":{"$ref":"#/$defs/hookMatcher"}},"SessionStart":{"type":"array","description":"Hooks that run when a new session starts","items":{"$ref":"#/$defs/hookMatcher"}},"SessionEnd":{"type":"array","description":"Hooks that run when a session ends","items":{"$ref":"#/$defs/hookMatcher"}}}},"disableAllHooks":{"type":"boolean","description":"Disable all hooks and statusLine execution. When true in managed settings, user and project-level disableAllHooks cannot override it. See https://code.claude.com/docs/en/hooks#disable-or-remove-hooks"},"allowedHttpHookUrls":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of URL patterns that HTTP hooks may target. Supports * as a wildcard. When set, hooks with non-matching URLs are blocked. Undefined = no restriction, empty array = block all HTTP hooks. Arrays merge across settings sources. See https://code.claude.com/docs/en/settings#hook-configuration","examples":[["https://hooks.example.com/*","http://localhost:*"]]},"allowManagedHooksOnly":{"type":"boolean","description":"(Managed settings only) Prevent loading of user, project, and plugin hooks. Only allows managed hooks and SDK hooks. See https://code.claude.com/docs/en/settings#hook-configuration"},"allowManagedPermissionRulesOnly":{"type":"boolean","description":"(Managed settings only) Prevent user and project settings from defining allow, ask, or deny permission rules. Only rules in managed settings apply. See https://code.claude.com/docs/en/settings#permission-settings"},"statusLine":{"type":"object","properties":{"type":{"type":"string","description":"The type of status line handler; must be set to \\"command\\" to run a custom shell script that receives JSON session data via stdin.","const":"command"},"command":{"type":"string","description":"A shell command or path to a script that displays session information (context usage, costs, git status, etc.) by reading JSON data from stdin and writing output to stdout. See https://code.claude.com/docs/en/statusline"},"padding":{"type":"number","description":"Optional number of extra horizontal spacing characters added to the status line content; defaults to 0."}},"required":["type","command"],"additionalProperties":false,"description":"Custom status line display configuration. See https://code.claude.com/docs/en/statusline","examples":[{"type":"command","command":"~/.claude/statusline.sh"}]},"fileSuggestion":{"type":"object","properties":{"type":{"type":"string","description":"The type of file suggestion handler; must be set to \\"command\\" to execute a custom shell script that generates file suggestions for the @ file picker.","const":"command"},"command":{"type":"string","description":"Shell command to execute for file suggestions"}},"required":["type","command"],"additionalProperties":false,"description":"Configure a custom script for @ file autocomplete. See https://code.claude.com/docs/en/settings#file-suggestion-settings","examples":[{"type":"command","command":"~/.claude/file-suggestion.sh"}]},"enabledPlugins":{"type":"object","additionalProperties":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"boolean"},{"not":{}}]},"description":"Enabled plugins using plugin-id@marketplace-id format. Example: { \\"formatter@anthropic-tools\\": true }. See https://code.claude.com/docs/en/plugins"},"extraKnownMarketplaces":{"type":"object","additionalProperties":{"type":"object","properties":{"source":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","pattern":"\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use (e.g., \\"main\\", \\"v1.0.0\\"). Defaults to repository default branch."},"path":{"type":"string","description":"Path to marketplace.json within repo (defaults to .claude-plugin/marketplace.json)"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false}],"description":"Where to fetch the marketplace from"},"installLocation":{"type":"string","description":"Local cache path where marketplace manifest is stored (auto-generated if not provided)"}},"required":["source"],"additionalProperties":false},"description":"Additional marketplaces to make available for this repository. Typically used in repository .claude/settings.json to ensure team members have required plugin sources. See https://code.claude.com/docs/en/plugin-marketplaces"},"strictKnownMarketplaces":{"type":"array","description":"(Managed settings only) Allowlist of plugin marketplaces users can add. Undefined = no restrictions, empty array = lockdown. Uses exact matching for source specifications. See https://code.claude.com/docs/en/settings#strictknownmarketplaces","items":{"anyOf":[{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"hostPattern"},"hostPattern":{"type":"string","description":"Git host pattern to trust for repositories in source specifications"}},"required":["source","hostPattern"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"github"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","repo"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"git"},"url":{"type":"string","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch, tag, or SHA"},"path":{"type":"string","description":"Subdirectory path"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"url"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"HTTP headers for authenticated access"}},"required":["source","url"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"npm"},"package":{"type":"string","description":"NPM package name (supports scoped packages)"}},"required":["source","package"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"file"},"path":{"type":"string","description":"Absolute path to marketplace.json file"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"directory"},"path":{"type":"string","description":"Absolute path to directory containing .claude-plugin/marketplace.json"}},"required":["source","path"],"additionalProperties":false},{"type":"object","properties":{"source":{"type":"string","description":"Identifies the marketplace source type","const":"pathPattern"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"],"additionalProperties":false}]},"examples":[[{"source":"github","repo":"acme-corp/approved-plugins"},{"source":"npm","package":"@acme-corp/compliance-plugins"}]]},"skippedMarketplaces":{"type":"array","items":{"type":"string","minLength":1},"description":"List of marketplace names the user has chosen not to install when prompted"},"skippedPlugins":{"type":"array","items":{"type":"string","minLength":1},"description":"List of plugin IDs (plugin@marketplace format) the user has chosen not to install when prompted"},"forceLoginMethod":{"type":"string","enum":["claudeai","console"],"description":"Force a specific login method: \\"claudeai\\" for Claude Pro/Max, \\"console\\" for Console billing","examples":["claudeai"]},"forceLoginOrgUUID":{"type":"string","description":"Organization UUID to use for OAuth login","examples":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"minLength":1},"otelHeadersHelper":{"type":"string","description":"Path to a script that outputs OpenTelemetry headers","minLength":1},"outputStyle":{"type":"string","description":"Controls the output style for assistant responses. Built-in styles: default, Explanatory, Learning. Custom styles can be added in ~/.claude/output-styles/ or .claude/output-styles/. See https://code.claude.com/docs/en/output-styles","examples":["default","Explanatory","Learning"],"minLength":1},"skipWebFetchPreflight":{"type":"boolean","description":"Skip the WebFetch blocklist check for enterprise environments with restrictive security policies"},"sandbox":{"type":"object","description":"Sandbox execution configuration. See https://code.claude.com/docs/en/sandboxing","properties":{"network":{"type":"object","description":"Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.","properties":{"allowUnixSockets":{"type":"array","items":{"type":"string"},"description":"Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified"},"allowLocalBinding":{"type":"boolean","description":"Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified"},"httpProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"socksProxyPort":{"type":"integer","minimum":1,"maximum":65535,"description":"SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically"},"allowAllUnixSockets":{"type":"boolean","description":"Allow all Unix domain socket connections. If true, this overrides allowUnixSockets"},"allowedDomains":{"type":"array","items":{"type":"string","minLength":1},"description":"Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com"},"allowManagedDomainsOnly":{"type":"boolean","description":"(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts."}},"additionalProperties":false},"ignoreViolations":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"},"description":"List of filesystem paths to ignore sandbox violations for when this command pattern matches"},"description":"Map of command patterns to filesystem paths to ignore violations for. Use \\"*\\" to match all commands"},"excludedCommands":{"type":"array","items":{"type":"string"},"description":"Commands that should never run in the sandbox (e.g., [\\"git\\", \\"docker\\"])"},"autoAllowBashIfSandboxed":{"type":"boolean","description":"Automatically allow bash commands without prompting when they run in the sandbox. Only applies to commands that will run sandboxed.","default":true},"enableWeakerNetworkIsolation":{"type":"boolean","description":"macOS only. Allow access to the system TLS trust service (com.apple.trustd.agent) in the sandbox. Required for Go-based tools like gh, gcloud, and terraform to verify TLS certificates when using httpProxyPort with a MITM proxy and custom CA. Reduces security by opening a potential data exfiltration path. Default: false. See https://code.claude.com/docs/en/settings#sandbox-settings","default":false},"enableWeakerNestedSandbox":{"type":"boolean","description":"Enable weaker sandbox mode for unprivileged docker environments where --proc mounting fails. This significantly reduces the strength of the sandbox and should only be used when this risk is acceptable.Default: false (secure)."},"allowUnsandboxedCommands":{"type":"boolean","description":"Allow commands to run outside the sandbox via the dangerouslyDisableSandbox parameter. When false, the dangerouslyDisableSandbox parameter is completely ignored and all commands must run sandboxed. Default: true."},"enabled":{"type":"boolean","description":"Enable sandboxed bash"},"filesystem":{"type":"object","description":"Filesystem access control for sandboxed commands. See https://code.claude.com/docs/en/sandboxing#filesystem-isolation","properties":{"allowWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are allowed to write. Supports prefixes: // (absolute), ~/ (home directory), / (relative to settings file), ./ or no prefix (relative path)"},"denyWrite":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied write access. Takes precedence over allowWrite"},"denyRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths where subprocesses are explicitly denied read access"},"allowRead":{"type":"array","items":{"type":"string","minLength":1},"description":"Paths to re-allow reading within denyRead regions. Takes precedence over denyRead for matching paths"},"allowManagedReadPathsOnly":{"type":"boolean","description":"When true (managed settings only), only allowRead paths from managed settings are used"}},"additionalProperties":false}},"additionalProperties":false},"spinnerVerbs":{"type":"object","description":"Customize the verbs shown in spinner progress messages","properties":{"mode":{"type":"string","enum":["append","replace"],"description":"How to combine custom verbs with default spinner verbs: 'append' adds custom verbs to the default list, 'replace' uses only custom verbs"},"verbs":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Custom verbs used in spinner progress text"}},"required":["verbs"],"additionalProperties":false},"spinnerTipsEnabled":{"type":"boolean","description":"Show tips in the spinner while Claude is working. Set to false to disable tips (default: true)","default":true},"spinnerTipsOverride":{"type":"object","description":"Customize the tips displayed in the spinner while Claude is working. See https://code.claude.com/docs/en/settings#available-settings","properties":{"excludeDefault":{"type":"boolean","description":"If true, only show custom tips. If false or absent, custom tips merge with built-in tips","default":false},"tips":{"type":"array","items":{"type":"string","minLength":1},"description":"Custom tip strings to display in the spinner","minItems":1}},"required":["tips"],"additionalProperties":false},"terminalProgressBarEnabled":{"type":"boolean","description":"Enable the terminal progress bar that shows progress in supported terminals like Windows Terminal and iTerm2 (default: true)","default":true},"showTurnDuration":{"type":"boolean","description":"Show turn duration messages after responses (e.g., \\"Cooked for 1m 6s\\"). Set to false to hide these messages (default: true)","default":true},"prefersReducedMotion":{"type":"boolean","description":"Reduce or disable UI animations (spinners, shimmer, flash effects) for accessibility","default":false},"alwaysThinkingEnabled":{"type":"boolean","description":"Enable extended thinking by default for all sessions. Typically configured via the /config command rather than editing directly. See https://code.claude.com/docs/en/common-workflows#use-extended-thinking-thinking-mode"},"companyAnnouncements":{"type":"array","items":{"type":"string","minLength":1},"description":"Company announcements to display at startup (one will be randomly selected if multiple are provided)"},"teammateMode":{"type":"string","enum":["auto","in-process","tmux"],"description":"How agent team teammates display: \\"auto\\" picks split panes in tmux or iTerm2, in-process otherwise. Agent teams are experimental and disabled by default. Enable them by adding CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS to your settings.json or environment. See https://code.claude.com/docs/en/agent-teams","default":"auto"},"worktree":{"type":"object","additionalProperties":false,"description":"Configuration for --worktree sessions. See https://code.claude.com/docs/en/settings","properties":{"sparsePaths":{"type":"array","items":{"type":"string","minLength":1},"description":"Directories to check out in each worktree via git sparse-checkout (cone mode). Only the listed paths are written to disk, which is faster in large monorepos.","examples":[["packages/my-app","shared/utils"]]}}},"pluginTrustMessage":{"type":"string","description":"(Managed settings only) Custom message appended to the plugin trust warning shown before installation. Use to provide organization-specific context about approved plugins. See https://code.claude.com/docs/en/settings#plugin-settings","minLength":1},"pluginConfigs":{"type":"object","additionalProperties":{"type":"object","properties":{"mcpServers":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}}]}},"description":"User configuration values for MCP servers keyed by server name"}},"additionalProperties":false},"description":"Per-plugin configuration including MCP server user configs, keyed by plugin ID (plugin@marketplace format). See https://code.claude.com/docs/en/plugins"},"allowManagedMcpServersOnly":{"type":"boolean","description":"(Managed settings only) Only allowedMcpServers from managed settings are respected. deniedMcpServers still merges from all sources. Users can still add their own MCP servers, but only the admin-defined allowlist applies."},"blockedMarketplaces":{"type":"array","description":"(Managed settings only) Blocklist of marketplace sources. These exact sources are blocked from being added as marketplaces. The check happens before downloading, so blocked sources never touch the filesystem.","items":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"url","description":"Block marketplace fetched from direct URL"},"url":{"type":"string","format":"uri","description":"Direct URL to marketplace.json file"},"headers":{"type":"object","additionalProperties":{"type":"string"},"description":"Custom HTTP headers (e.g., for authentication)"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"github","description":"Block marketplace from GitHub repository"},"repo":{"type":"string","description":"GitHub repository in owner/repo format"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","repo"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"git","description":"Block marketplace from git repository URL"},"url":{"type":"string","pattern":".*\\\\.git$","description":"Full git repository URL"},"ref":{"type":"string","description":"Git branch or tag to use"},"path":{"type":"string","description":"Path to marketplace.json within repo"}},"required":["source","url"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"npm","description":"Block marketplace from NPM package"},"package":{"type":"string","description":"NPM package containing marketplace.json"}},"required":["source","package"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"file","description":"Block marketplace from local file"},"path":{"type":"string","description":"Local file path to marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"directory","description":"Block marketplace from local directory"},"path":{"type":"string","description":"Local directory containing .claude-plugin/marketplace.json"}},"required":["source","path"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"hostPattern","description":"Block marketplace by host pattern matching"},"hostPattern":{"type":"string","description":"Regex pattern to match the host/domain extracted from any marketplace source type"}},"required":["source","hostPattern"]},{"type":"object","additionalProperties":false,"properties":{"source":{"type":"string","const":"pathPattern","description":"Block marketplace by file/directory path pattern matching"},"pathPattern":{"type":"string","description":"Regex pattern to match file or directory paths for marketplace sources"}},"required":["source","pathPattern"]}]}}}`),Pg="Claude Code Settings",Tg={$schema:bg,$id:Cg,$defs:kg,description:Eg,allowTrailingCommas:Lg,additionalProperties:Rg,type:jg,properties:Dg,title:Pg};function Ag(a){const p=a??{},f={...p.$defs??{},...p.definitions??{}},C=S=>{if(!S)return{};if(!S.$ref)return R(S);const k=/^#\/(\$defs|definitions)\/(.+)$/.exec(S.$ref);if(!k)return R(S);const v=f[k[2]];return v?C({...v,...i(S)}):R(S)},j=new Set(["__proto__","constructor","prototype"]),M=S=>{if(!S)return{};const k={};for(const[v,n]of Object.entries(S))j.has(v)||(k[v]=n);return k},R=S=>{if(!S.allOf||S.allOf.length===0)return S;const k={...S};delete k.allOf;for(const v of S.allOf){const n=C(v);Object.assign(k,{properties:{...M(k.properties),...M(n.properties)},required:Mg([...k.required??[],...n.required??[]])}),!k.description&&n.description&&(k.description=n.description),k.default===void 0&&n.default!==void 0&&(k.default=n.default),!k.type&&n.type&&(k.type=n.type)}return k},i=S=>{const{$ref:k,...v}=S;return v},d=(S,k)=>{let v=C(S);for(const n of k){if(!v)return null;if(/^\d+$/.test(n)){const l=Array.isArray(v.items)?v.items[Number(n)]:v.items;v=l?C(l):null;continue}const c=v.properties;if(c&&!j.has(n)&&n in c){v=C(c[n]);continue}const o=v.additionalProperties;if(o&&typeof o=="object"){v=C(o);continue}return null}return v},m=(S,k,v)=>{if(!S)return null;const n={};if(S.description&&(n.description=S.description),S.type&&(n.type=S.type),S.default!==void 0&&(n.default=S.default),S.enum&&(n.enum=S.enum),S.const!==void 0&&(n.const=S.const),S.deprecated&&(n.deprecated=!0),S.examples&&(n.examples=S.examples),S.properties&&(n.knownChildren=Object.keys(S.properties)),v&&(k!=null&&k.includes(v))&&(n.required=!0),S.items&&!Array.isArray(S.items)){const c=C(S.items),o=m(c,void 0,null);o&&(n.itemsInfo=o)}return(S.additionalProperties===!0||typeof S.additionalProperties=="object")&&(n.open=!0),n},_=S=>k=>{if(k.length===0)return m(C(S),void 0,null);const v=d(S,k.slice(0,-1));if(!v)return null;const n=k[k.length-1],c=d(v,[n]);return m(c,v.required,n)},h=S=>{const k=C(S);return Object.keys(k.properties??{})},y=S=>({at:_(S),rootKeys:()=>h(S),rootedAt:k=>{const v=d(S,k);return y(v??{})}});return y(p)}function Mg(a){return Array.from(new Set(a))}let Qa=null;function Hn(){return Qa||(Qa=Ag(Tg)),Qa}function Og(){const a=Ke(),p=Le(x=>x.tabs),f=Le(x=>x.activeTabId),C=p.find(x=>x.id===f)??null,j=(C==null?void 0:C.cwd)??null,[M,R]=K.useState("user"),[i,d]=K.useState("effective"),m=K.useMemo(()=>{const x={};for(const P of Ls.scopes){const H=Ls.resolve(P,a??"",j);H&&(x[P]=H)}return x},[a,j]),_=m[M]??null,h=ye(x=>x.files),y=ye(x=>x.loadJson),S=ye(x=>x.setDraft),k=ye(x=>x.saveJson),v=ye(x=>x.revert),n=ye(x=>x.watchFile),c=ye(x=>x.unwatchFile);K.useEffect(()=>{const x=Object.values(m).filter(Boolean);return x.forEach(P=>{h[P]||y(P),n(P)}),()=>{x.forEach(P=>c(P))}},[JSON.stringify(m)]);const[o,l]=K.useState(null),w=K.useMemo(()=>il(ol(h,m)),[h,m]),L=(x,P)=>{var X;const H=m[M];if(!H)return;l(null);const $=((X=h[H])==null?void 0:X.draftRaw)??"";let W={};if($.trim())try{W=JSON.parse($)}catch{W={}}const I=Wn(W,x,P);S(H,JSON.stringify(I,null,2)+`
|
|
69
|
+
`)};if(!a)return u.jsx(xe,{title:"loading…"});const E=_?h[_]:null,D=x=>x!=="user"&&!j;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(sl,{options:[{key:"effective",label:"Guided"},{key:"tree",label:"Tree"},{key:"raw",label:"Raw"}],active:i,onChange:d}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:Ls.scopes,active:M,onChange:R,annotate:x=>{if(D(x))return{exists:!1};const P=m[x];if(!P)return null;const H=h[P];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${_??"—"}`:_??"—"}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/settings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"schema reference ↗"})]}),footer:_&&E?u.jsx(Tr,{dirty:E.dirty,busy:E.busy,parseError:o||E.parseError,lastSavedAt:E.lastSavedAt,leading:E.exists?null:u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{l(null);const x=await k(_);x.ok||l(x.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:D(M)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local settings"}):i==="effective"?u.jsx(cg,{node:w,targetScope:M,onOverride:L,schema:Hn()}):i==="tree"?u.jsx(rl,{node:w,targetScope:M,onOverride:L,schema:Hn()}):_&&E?u.jsx(qd,{path:_,value:E.draftRaw,onChange:x=>{l(null),S(_,x)}}):u.jsx(xe,{title:"resolving…"})})}function al({value:a,onChange:p,path:f,readOnly:C}){return u.jsx(Vd,{path:`file://${f}`,defaultLanguage:"markdown",value:a,onChange:j=>p(j??""),theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:13,fontFamily:"JetBrains Mono, ui-monospace, Menlo, monospace",lineNumbers:"on",renderLineHighlight:"line",scrollBeyondLastLine:!1,tabSize:2,wordWrap:"on",readOnly:C,automaticLayout:!0}})}const xd=[{id:"filesystem",name:"Filesystem",description:"Secure file operations with configurable access controls",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",config:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","<path>"]},envVars:[]},{id:"fetch",name:"Fetch",description:"Web content fetching and conversion for efficient LLM usage",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",config:{command:"uvx",args:["mcp-server-fetch"]},envVars:[]},{id:"memory",name:"Memory",description:"Knowledge graph-based persistent memory system",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",config:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},envVars:[]},{id:"sequential-thinking",name:"Sequential Thinking",description:"Dynamic and reflective problem-solving through thought sequences",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",config:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},envVars:[]},{id:"git",name:"Git",description:"Tools to read, search, and manipulate Git repositories",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",config:{command:"uvx",args:["mcp-server-git","--repository","<path>"]},envVars:[]},{id:"time",name:"Time",description:"Time and timezone conversion capabilities",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",config:{command:"uvx",args:["mcp-server-time"]},envVars:[]},{id:"everything",name:"Everything",description:"Reference/test server with prompts, resources, and tools",official:!0,homepage:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",config:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},envVars:[]},{id:"github",name:"GitHub",description:"Official GitHub repository, issues, and PR management",official:!1,homepage:"https://github.com/github/github-mcp-server",config:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},envVars:["GITHUB_PERSONAL_ACCESS_TOKEN"]},{id:"gitlab",name:"GitLab",description:"GitLab API integration for projects, issues, and merge requests",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gitlab",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gitlab"]},envVars:["GITLAB_PERSONAL_ACCESS_TOKEN","GITLAB_API_URL"]},{id:"postgres",name:"PostgreSQL",description:"Read-only database access with schema inspection",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/postgres",config:{command:"npx",args:["-y","@modelcontextprotocol/server-postgres","<connection-string>"]},envVars:[]},{id:"sqlite",name:"SQLite",description:"Database interaction and business intelligence over SQLite",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/sqlite",config:{command:"uvx",args:["mcp-server-sqlite","--db-path","<path>"]},envVars:[]},{id:"slack",name:"Slack",description:"Channel management and messaging for Slack workspaces",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/slack",config:{command:"npx",args:["-y","@modelcontextprotocol/server-slack"]},envVars:["SLACK_BOT_TOKEN","SLACK_TEAM_ID"]},{id:"google-drive",name:"Google Drive",description:"File access and search for Google Drive",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/gdrive",config:{command:"npx",args:["-y","@modelcontextprotocol/server-gdrive"]},envVars:["GDRIVE_CREDENTIALS_PATH"]},{id:"google-maps",name:"Google Maps",description:"Location services, directions, and place details",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/google-maps",config:{command:"npx",args:["-y","@modelcontextprotocol/server-google-maps"]},envVars:["GOOGLE_MAPS_API_KEY"]},{id:"puppeteer",name:"Puppeteer",description:"Browser automation and web scraping via Puppeteer",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/puppeteer",config:{command:"npx",args:["-y","@modelcontextprotocol/server-puppeteer"]},envVars:[]},{id:"playwright",name:"Playwright",description:"Cross-browser automation for navigation, screenshots, and data extraction",official:!1,homepage:"https://github.com/microsoft/playwright-mcp",config:{command:"npx",args:["-y","@playwright/mcp@latest"]},envVars:[]},{id:"brave-search",name:"Brave Search",description:"Web and local search using the Brave Search API",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/brave-search",config:{command:"npx",args:["-y","@modelcontextprotocol/server-brave-search"]},envVars:["BRAVE_API_KEY"]},{id:"redis",name:"Redis",description:"Interact with Redis key-value stores",official:!1,homepage:"https://github.com/modelcontextprotocol/servers-archived/tree/main/src/redis",config:{command:"npx",args:["-y","@modelcontextprotocol/server-redis","<redis-url>"]},envVars:[]},{id:"sentry",name:"Sentry",description:"Retrieve and analyze Sentry error tracking issues",official:!1,homepage:"https://github.com/getsentry/sentry-mcp",config:{command:"npx",args:["-y","@sentry/mcp-server@latest"]},envVars:["SENTRY_AUTH_TOKEN"]},{id:"linear",name:"Linear",description:"Issue tracking and project management for Linear",official:!1,homepage:"https://linear.app/docs/mcp",config:{command:"npx",args:["-y","mcp-remote","https://mcp.linear.app/sse"]},envVars:[]},{id:"notion",name:"Notion",description:"Notion workspace page and database management",official:!1,homepage:"https://github.com/makenotion/notion-mcp-server",config:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},envVars:["NOTION_API_KEY"]},{id:"stripe",name:"Stripe",description:"Payment processing, customers, and invoices via Stripe API",official:!1,homepage:"https://github.com/stripe/agent-toolkit",config:{command:"npx",args:["-y","@stripe/mcp","--tools=all"]},envVars:["STRIPE_SECRET_KEY"]},{id:"cloudflare",name:"Cloudflare",description:"Manage Cloudflare Workers, KV, R2, D1, and Workers AI",official:!1,homepage:"https://github.com/cloudflare/mcp-server-cloudflare",config:{command:"npx",args:["-y","mcp-remote","https://observability.mcp.cloudflare.com/sse"]},envVars:[]},{id:"context7",name:"Context7",description:"Up-to-date version-specific library docs injected into prompts",official:!1,homepage:"https://github.com/upstash/context7",config:{command:"npx",args:["-y","@upstash/context7-mcp@latest"]},envVars:[]},{id:"tavily",name:"Tavily",description:"AI-optimized web search with clean structured results",official:!1,homepage:"https://github.com/tavily-ai/tavily-mcp",config:{command:"npx",args:["-y","tavily-mcp@latest"]},envVars:["TAVILY_API_KEY"]},{id:"perplexity",name:"Perplexity",description:"Answer-engine search with deep research and reasoning",official:!1,homepage:"https://github.com/ppl-ai/modelcontextprotocol",config:{command:"npx",args:["-y","server-perplexity-ask"]},envVars:["PERPLEXITY_API_KEY"]},{id:"figma",name:"Figma Dev Mode",description:"First-party Figma design-to-code bridge exposing node tree",official:!1,homepage:"https://help.figma.com/hc/en-us/articles/32132100833559",config:{url:"http://127.0.0.1:3845/sse"},envVars:[]},{id:"supabase",name:"Supabase",description:"Manage Supabase projects, tables, and SQL queries",official:!1,homepage:"https://github.com/supabase-community/supabase-mcp",config:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest"]},envVars:["SUPABASE_ACCESS_TOKEN"]},{id:"atlassian",name:"Atlassian (Jira/Confluence)",description:"Official Jira and Confluence integration",official:!1,homepage:"https://www.atlassian.com/platform/remote-mcp-server",config:{command:"npx",args:["-y","mcp-remote","https://mcp.atlassian.com/v1/sse"]},envVars:[]},{id:"aws",name:"AWS",description:"AWS services access and best-practice guidance",official:!1,homepage:"https://github.com/awslabs/mcp",config:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},envVars:["AWS_PROFILE","AWS_REGION"]},{id:"obsidian",name:"Obsidian",description:"Read and search notes in an Obsidian vault",official:!1,homepage:"https://github.com/MarkusPfundstein/mcp-obsidian",config:{command:"uvx",args:["mcp-obsidian"]},envVars:["OBSIDIAN_API_KEY"]}],bd=[{id:"pdf",name:"PDF",description:"Create, edit, and extract content from PDF documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pdf"},{id:"docx",name:"DOCX",description:"Create and edit Microsoft Word documents",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/docx"},{id:"xlsx",name:"XLSX",description:"Create and edit Excel spreadsheets with formulas and formatting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/xlsx"},{id:"pptx",name:"PPTX",description:"Create and edit PowerPoint presentations",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/pptx"},{id:"webapp-testing",name:"Webapp Testing",description:"Test web applications using Playwright-driven browser automation",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/webapp-testing"},{id:"playwright-e2e",name:"Playwright E2E",description:"End-to-end browser tests — navigation, forms, assertions, waiting strategies",official:!1,source:"local"},{id:"playwright-visual-testing",name:"Playwright Visual Testing",description:"Visual regression testing — screenshot comparison, pixel diffs, responsive layouts",official:!1,source:"local"},{id:"playwright-accessibility",name:"Playwright Accessibility",description:"Accessibility testing — WCAG compliance, axe-core scans, keyboard navigation",official:!1,source:"local"},{id:"playwright-api-testing",name:"Playwright API Testing",description:"API testing with Playwright request context — REST endpoints, auth flows, contracts",official:!1,source:"local"},{id:"playwright-debug",name:"Playwright Debug",description:"Debug failing tests — trace viewer, inspector, headed mode, flaky test fixes",official:!1,source:"local"},{id:"web-artifacts-builder",name:"Web Artifacts Builder",description:"Build polished interactive web artifacts and demos",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/web-artifacts-builder"},{id:"frontend-design",name:"Frontend Design",description:"Apply frontend UI/UX design patterns and visual polish",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/frontend-design"},{id:"canvas-design",name:"Canvas Design",description:"Canvas-based graphic design and composition techniques",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/canvas-design"},{id:"algorithmic-art",name:"Algorithmic Art",description:"Create generative and algorithmic art",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/algorithmic-art"},{id:"brand-guidelines",name:"Brand Guidelines",description:"Apply brand identity and style guideline specifications",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/brand-guidelines"},{id:"theme-factory",name:"Theme Factory",description:"Generate and customize visual themes",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/theme-factory"},{id:"slack-gif-creator",name:"Slack GIF Creator",description:"Create animated GIFs suitable for Slack",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/slack-gif-creator"},{id:"doc-coauthoring",name:"Doc Coauthoring",description:"Collaborative document authoring and editing workflows",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/doc-coauthoring"},{id:"internal-comms",name:"Internal Comms",description:"Internal communications templates and drafting",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/internal-comms"},{id:"claude-api",name:"Claude API",description:"Build apps with the Claude API and Anthropic SDKs",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/claude-api"},{id:"mcp-builder",name:"MCP Builder",description:"Scaffold and build new Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/mcp-builder"},{id:"skill-creator",name:"Skill Creator",description:"Scaffold and create new Claude Code skills",official:!0,source:"https://github.com/anthropics/skills/tree/main/skills/skill-creator"}],Cd=[{id:"code-review",name:"Code Review",description:"Comprehensive code review with best practices and improvement suggestions",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-review",bundles:["commands","agents"]},{id:"pr-review-toolkit",name:"PR Review Toolkit",description:"Pull request review automation and workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pr-review-toolkit",bundles:["commands","agents"]},{id:"commit-commands",name:"Commit Commands",description:"Git commit workflow shortcuts with conventional commit formatting",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/commit-commands",bundles:["commands"]},{id:"feature-dev",name:"Feature Dev",description:"Feature development assistance from spec to implementation",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/feature-dev",bundles:["commands","agents"]},{id:"security-guidance",name:"Security Guidance",description:"Security best-practice review and enforcement",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/security-guidance",bundles:["commands","agents"]},{id:"agent-sdk-dev",name:"Agent SDK Dev",description:"Development tools for building with the Claude Agent SDK",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/agent-sdk-dev",bundles:["commands","skills"]},{id:"plugin-dev",name:"Plugin Dev",description:"Scaffolding and tooling for authoring Claude Code plugins",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/plugin-dev",bundles:["commands","skills"]},{id:"mcp-server-dev",name:"MCP Server Dev",description:"Develop and test Model Context Protocol servers",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/mcp-server-dev",bundles:["commands","skills"]},{id:"skill-creator",name:"Skill Creator",description:"Framework for creating and iterating on new skills",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/skill-creator",bundles:["commands","skills"]},{id:"claude-md-management",name:"CLAUDE.md Management",description:"Manage and maintain CLAUDE.md project memory files",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/claude-md-management",bundles:["commands"]},{id:"typescript-lsp",name:"TypeScript LSP",description:"TypeScript/JavaScript language server integration",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/typescript-lsp",bundles:["hooks","commands"]},{id:"pyright-lsp",name:"Pyright LSP",description:"Python language server integration via Pyright",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/pyright-lsp",bundles:["hooks","commands"]},{id:"rust-analyzer-lsp",name:"Rust Analyzer LSP",description:"Rust language server integration via rust-analyzer",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/rust-analyzer-lsp",bundles:["hooks","commands"]},{id:"gopls-lsp",name:"Go LSP (gopls)",description:"Go language server integration via gopls",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/gopls-lsp",bundles:["hooks","commands"]},{id:"code-simplifier",name:"Code Simplifier",description:"Review changed code for reuse, quality, and efficiency then fix issues",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/code-simplifier",bundles:["commands","agents"]},{id:"hookify",name:"Hookify",description:"Utilities and templates for authoring Claude Code hooks",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/hookify",bundles:["commands","skills"]},{id:"frontend-design-plugin",name:"Frontend Design Plugin",description:"Frontend design assistance and visual polish workflows",official:!0,source:"https://github.com/anthropics/claude-plugins-official/tree/main/plugins/frontend-design",bundles:["commands","skills","agents"]}],kd=[{id:"prettier-on-write",name:"Prettier on Write",description:"Auto-format JS/TS/JSON/MD files after edit via prettier",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.(js|jsx|ts|tsx|json|md|css|html|yaml|yml)$' | xargs -r -I{} npx --no-install prettier --write {} 2>/dev/null || true"},{id:"black-on-write",name:"Black on Write (Python)",description:"Auto-format Python files after edit via black",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.py$' | xargs -r black -q 2>/dev/null || true"},{id:"rustfmt-on-write",name:"rustfmt on Write",description:"Auto-format Rust files after edit via rustfmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.rs$' | xargs -r rustfmt 2>/dev/null || true"},{id:"gofmt-on-write",name:"gofmt on Write",description:"Auto-format Go files after edit via gofmt",event:"PostToolUse",matcher:"Write|Edit",command:"jq -r '.tool_input.file_path // empty' | grep -E '\\.go$' | xargs -r gofmt -w 2>/dev/null || true"},{id:"block-secret-writes",name:"Block Writes to Secrets",description:"Deny edits to .env, credentials, key files",event:"PreToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); echo "$path" | grep -qE '(^|/)(\\.env|\\.env\\..+|id_rsa|id_ed25519|.*\\.pem|.*\\.key|credentials\\.json|\\.aws/credentials)$' && { echo '{"decision":"block","reason":"refusing to edit secret file"}'; exit 2; } || true`},{id:"notify-on-stop",name:"Desktop Notify on Stop",description:"Send a desktop notification when Claude finishes a turn",event:"Stop",command:`command -v notify-send >/dev/null && notify-send "Claude Code" "Session ready" || (command -v osascript >/dev/null && osascript -e 'display notification "Session ready" with title "Claude Code"') || true`},{id:"bell-on-notification",name:"Terminal Bell on Notification",description:"Ring the terminal bell on permission prompts / idle notifications",event:"Notification",command:"printf '\\a'"},{id:"log-tool-calls",name:"Log Tool Calls (JSONL)",description:"Append every tool call to ~/.claude/logs/tool-calls.jsonl for audit",event:"PreToolUse",command:"mkdir -p ~/.claude/logs && cat >> ~/.claude/logs/tool-calls.jsonl"},{id:"auto-stage-edits",name:"Auto-stage Edited Files",description:"git add each file Claude edits (inside a repo)",event:"PostToolUse",matcher:"Write|Edit",command:`path=$(jq -r '.tool_input.file_path // empty'); [ -n "$path" ] && git -C "$(dirname "$path")" add "$path" 2>/dev/null || true`},{id:"block-dangerous-bash",name:"Block Dangerous Bash",description:"Refuse rm -rf /, fork bombs, curl|sh pipes",event:"PreToolUse",matcher:"Bash",command:`cmd=$(jq -r '.tool_input.command // empty'); echo "$cmd" | grep -qE '(rm -rf /|:\\(\\)\\{.*\\};|curl.*\\|\\s*(bash|sh)|wget.*\\|\\s*(bash|sh)|mkfs\\.|dd if=.*of=/dev/)' && { echo '{"decision":"block","reason":"dangerous command pattern"}'; exit 2; } || true`},{id:"prepend-cwd-to-prompt",name:"Prepend CWD to Prompt",description:"Add cwd context to every user prompt automatically",event:"UserPromptSubmit",command:'echo "{\\"additionalContext\\":\\"cwd: $(pwd)\\"}"'},{id:"archive-transcript",name:"Archive Transcript on SessionEnd",description:"Copy the session jsonl to ~/.claude/archive/ when done",event:"SessionEnd",command:`src=$(jq -r '.transcript_path // empty'); [ -n "$src" ] && mkdir -p ~/.claude/archive && cp "$src" ~/.claude/archive/ 2>/dev/null || true`}],Pt=(a,p,f,C)=>`---
|
|
70
70
|
name: ${a}
|
|
71
71
|
description: ${p}
|
|
72
72
|
tools: ${f}
|
|
@@ -109,14 +109,14 @@ ${a.replace(/^\s+/,"")}`:f+`
|
|
|
109
109
|
|
|
110
110
|
`);return d.endsWith(`
|
|
111
111
|
`)?d:d+`
|
|
112
|
-
`}function $g(a,p,f){const C=ll(a);if(C.includes(p.id))return 0;const j=new Map(f.map(R=>[R.id,R])),M=p.section.trim().toLowerCase();return C.map(R=>j.get(R)).filter(R=>!!R).filter(R=>R.section.trim().toLowerCase()===M).length}function es(a,...p){if(!a.trim())return!0;const f=a.toLowerCase();return p.some(C=>C.toLowerCase().includes(f))}function Ug(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=async()=>{var u;if(!a)return;const n=((u=(await window.api.config.readJson(`${a}/.claude.json`)).data)==null?void 0:u.mcpServers)??{};f(new Set(Object.keys(n)))};K.useEffect(()=>{h()},[a]);const y=K.useMemo(()=>xd.filter(v=>es(m,v.id,v.name,v.description)),[m]),S=async v=>{if(!a)return;j(v.id),R(null);const n=`${a}/.claude.json`,u=await window.api.config.readJson(n),o=(u.data&&typeof u.data=="object"?u.data:{})??{},l={...o.mcpServers??{}};l[v.id]={..."command"in v.config?{type:"stdio"}:{},...v.config};const w=await window.api.config.writeJson(n,{...o,mcpServers:l});if(j(null),!w.ok){R(w.error??"write failed");return}d(`installed ${v.id} — switch to Installed to edit placeholders`),setTimeout(()=>d(null),4e3),h()},k=async v=>{if(!a)return;j(v),R(null);const n=`${a}/.claude.json`,u=await window.api.config.readJson(n),o=(u.data&&typeof u.data=="object"?u.data:{})??{},l={...o.mcpServers??{}};delete l[v];const w=await window.api.config.writeJson(n,{...o,mcpServers:l});if(j(null),!w.ok){R(w.error??"write failed");return}h()};return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:m,onQueryChange:_,count:y.length,total:xd.length}),(i||M)&&c.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${M?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:M??i}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[y.map(v=>{const n=p.has(v.id);return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),v.official&&c.jsx(et,{children:"official"}),n&&c.jsx(et,{tone:"accent",children:"installed"}),v.envVars.length>0&&c.jsxs(et,{tone:"warn",children:[v.envVars.length," env"]})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),c.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:"command"in v.config?`${v.config.command} ${(v.config.args??[]).join(" ")}`:v.config.url})]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(cl,{href:v.homepage,children:"docs"}),n?c.jsx("button",{disabled:C===v.id,onClick:()=>k(v.id),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):c.jsx("button",{disabled:C===v.id,onClick:()=>S(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===v.id?"…":"install"})]})]},v.id)}),y.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}function Wg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(""),M=async()=>{if(!a)return;const i=await window.api.config.listDir(`${a}/.claude/skills`,{dirsOnly:!0});f(new Set(i.entries.map(d=>d.name)))};K.useEffect(()=>{M()},[a]);const R=K.useMemo(()=>bd.filter(i=>es(C,i.id,i.name,i.description)),[C]);return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:C,onQueryChange:j,count:R.length,total:bd.length}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const d=p.has(i.id),m=i.source==="local",_=m?"":`mkdir -p ~/.claude/skills && cd ~/.claude/skills && git clone --depth 1 --filter=blob:none --sparse https://github.com/anthropics/skills _tmp-${i.id} && cd _tmp-${i.id} && git sparse-checkout set skills/${i.id} && mv skills/${i.id} ../${i.id} && cd .. && rm -rf _tmp-${i.id}`;return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&c.jsx(et,{children:"official"}),m&&c.jsx(et,{tone:"warn",children:"local"}),d&&c.jsx(et,{tone:"accent",children:"installed"})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),c.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/skills/",i.id,"/"]})]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[!m&&c.jsx(cl,{href:i.source,children:"source"}),!m&&c.jsx(eh,{text:_,label:d?"reinstall cmd":"copy install"})]})]},i.id)}),R.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}function zg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(""),M=async()=>{if(!a)return;const i=await window.api.config.listDir(`${a}/.claude/plugins`,{dirsOnly:!0});f(new Set(i.entries.map(d=>d.name)))};K.useEffect(()=>{M()},[a]);const R=K.useMemo(()=>Cd.filter(i=>es(C,i.id,i.name,i.description)),[C]);return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:C,onQueryChange:j,count:R.length,total:Cd.length}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const d=p.has(i.id),m=`/plugin install ${i.id}@anthropics/claude-plugins-official`;return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&c.jsx(et,{children:"official"}),d&&c.jsx(et,{tone:"accent",children:"installed"}),i.bundles.map(_=>c.jsx(et,{tone:"dim",children:_},_))]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),c.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:m})]}),c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx(cl,{href:i.source,children:"source"}),c.jsx(eh,{text:m,label:"copy install"})]})]},i.id)}),R.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}function Vg(a,p){return(a[p.event]??[]).some(C=>(C.hooks??[]).some(j=>j.type==="command"&&j.command===p.command))}function qg(){const a=Ke(),[p,f]=K.useState({}),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/settings.json`:null,y=async()=>{if(!h)return;const n=await window.api.config.readJson(h),u=(n.data&&typeof n.data=="object"?n.data:{})??{};f(u.hooks??{})};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>kd.filter(n=>es(m,n.id,n.name,n.description,n.event)),[m]),k=async n=>{if(!h)return;j(n.id),d(null);const u=await window.api.config.readJson(h),o=(u.data&&typeof u.data=="object"?u.data:{})??{},l={...o.hooks??{}},w=(l[n.event]??[]).slice();w.push({...n.matcher?{matcher:n.matcher}:{},hooks:[{type:"command",command:n.command,...n.timeout?{timeout:n.timeout}:{}}]}),l[n.event]=w;const E=await window.api.config.writeJson(h,{...o,hooks:l});if(j(null),!E.ok){d(E.error??"write failed");return}R(`installed ${n.id}`),setTimeout(()=>R(null),2500),y()},v=async n=>{if(!h)return;j(n.id),d(null);const u=await window.api.config.readJson(h),o=(u.data&&typeof u.data=="object"?u.data:{})??{},l={...o.hooks??{}},w=(l[n.event]??[]).map(L=>({...L,hooks:(L.hooks??[]).filter(D=>!(D.type==="command"&&D.command===n.command))})).filter(L=>(L.hooks??[]).length>0);w.length?l[n.event]=w:delete l[n.event];const E=await window.api.config.writeJson(h,{...o,hooks:l});if(j(null),!E.ok){d(E.error??"write failed");return}y()};return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:m,onQueryChange:_,count:S.length,total:kd.length}),(M||i)&&c.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[S.map(n=>{const u=Vg(p,n);return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:n.name}),c.jsx(et,{tone:"dim",children:n.event}),n.matcher&&c.jsxs(et,{tone:"dim",children:["match: ",n.matcher]}),u&&c.jsx(et,{tone:"accent",children:"installed"})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:n.description}),c.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:n.command})]}),c.jsx("div",{className:"flex gap-1 shrink-0",children:u?c.jsx("button",{disabled:C===n.id,onClick:()=>v(n),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):c.jsx("button",{disabled:C===n.id,onClick:()=>k(n),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===n.id?"…":"install"})})]},n.id)}),S.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}function Kg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=async()=>{if(!a)return;const k=await window.api.config.listDir(`${a}/.claude/agents`,{filesOnly:!0}),v=new Set;for(const n of k.entries)n.name.endsWith(".md")&&v.add(n.name.replace(/\.md$/,""));f(v)};K.useEffect(()=>{h()},[a]);const y=K.useMemo(()=>Ed.filter(k=>es(m,k.id,k.name,k.description)),[m]),S=async k=>{if(!a)return;j(k.id),d(null);const v=`${a}/.claude/agents/${k.id}.md`,n=await window.api.config.writeText(v,k.content);if(j(null),!n.ok){d(n.error??"write failed");return}R(`installed ${k.id}`),setTimeout(()=>R(null),2500),h()};return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:m,onQueryChange:_,count:y.length,total:Ed.length}),(M||i)&&c.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[y.map(k=>{const v=p.has(k.id);return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:k.name}),k.tools&&c.jsxs(et,{tone:"dim",children:[k.tools.split(",").length," tools"]}),v&&c.jsx(et,{tone:"accent",children:"installed"})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:k.description}),c.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/agents/",k.id,".md"]})]}),c.jsx("div",{className:"flex gap-1 shrink-0",children:c.jsx("button",{disabled:C===k.id,onClick:()=>S(k),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===k.id?"…":v?"overwrite":"install"})})]},k.id)}),y.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}function Gg(){const a=Ke(),[p,f]=K.useState(""),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/settings.json`:null,y=async()=>{if(!h)return;const v=await window.api.config.readJson(h),n=(v.data&&typeof v.data=="object"?v.data:{})??{};f(JSON.stringify(n.permissions??{}))};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>Ld.filter(v=>es(m,v.id,v.name,v.description)),[m]),k=async v=>{if(!h)return;j(v.id),d(null);const n=await window.api.config.readJson(h),u=(n.data&&typeof n.data=="object"?n.data:{})??{},o=await window.api.config.writeJson(h,{...u,permissions:v.permissions});if(j(null),!o.ok){d(o.error??"write failed");return}R(`applied ${v.id} — replaces existing permissions block`),setTimeout(()=>R(null),3e3),y()};return a?c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsx(js,{query:m,onQueryChange:_,count:S.length,total:Ld.length}),(M||i)&&c.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),c.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[S.map(v=>{const n=p===JSON.stringify(v.permissions),u=[];return v.permissions.allow&&u.push(`${v.permissions.allow.length} allow`),v.permissions.deny&&u.push(`${v.permissions.deny.length} deny`),v.permissions.ask&&u.push(`${v.permissions.ask.length} ask`),v.permissions.defaultMode&&u.push(`mode: ${v.permissions.defaultMode}`),c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),n&&c.jsx(et,{tone:"accent",children:"active"}),c.jsx(et,{tone:"warn",children:"replaces permissions"})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),c.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:u.join(" · ")})]}),c.jsx("div",{className:"flex gap-1 shrink-0",children:c.jsx("button",{disabled:C===v.id,onClick:()=>k(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===v.id?"…":"apply"})})]},v.id)}),S.length===0&&c.jsx(xe,{title:"no matches"})]})]}):c.jsx(xe,{title:"loading…"})}const Jg={communication:"Communication","working-style":"Working style",security:"Security",testing:"Testing",review:"Code review",documentation:"Documentation",debugging:"Debugging",architecture:"Architecture",refactoring:"Refactoring",performance:"Performance",collaboration:"Collaboration",domain:"Domain / stack"};function Xg(){const a=Ke(),[p,f]=K.useState(""),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/CLAUDE.md`:null,y=async()=>{if(!h)return;const E=await window.api.config.readText(h);f(E.text)};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>new Set(ll(p)),[p]),k=K.useMemo(()=>Fg(p,Xr),[p]),v=async()=>{if(!h||k.length===0)return;d(null);const E=Hg(p,k),L=await window.api.config.writeText(h,E);if(!L.ok){d(L.error??"write failed");return}R(`removed ${k.length} unmanaged section(s)`),setTimeout(()=>R(null),3e3),y()},n=K.useMemo(()=>Xr.filter(E=>es(m,E.id,E.name,E.description,E.section,...E.tags??[])),[m]),u=K.useMemo(()=>{const E=new Map;for(const L of n){const D=E.get(L.category)??[];D.push(L),E.set(L.category,D)}return E},[n]),o=async E=>{if(!h)return;j(E.id),d(null);const L=Bg(p,E.id,Xr),D=await window.api.config.writeText(h,L);if(j(null),!D.ok){d(D.error??"write failed");return}const x=!S.has(E.id);R(x?`enabled "${E.name}"`:`disabled "${E.name}"`),setTimeout(()=>R(null),2500),y()};if(!a)return c.jsx(xe,{title:"loading…"});const l=S.size,w=["communication","working-style","testing","review","security","debugging","architecture","refactoring","performance","documentation","collaboration","domain"];return c.jsxs("div",{className:"h-full flex flex-col",children:[c.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[c.jsx("span",{className:"text-fg-faint",children:l>0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-fg-dim font-medium",children:l})," active · managed in"," ",c.jsx("code",{className:"text-fg-faint",children:"~/.claude/CLAUDE.md"})]}):c.jsx(c.Fragment,{children:"nothing active — toggle presets below to stack them in your CLAUDE.md"})}),c.jsx("div",{className:"flex-1"}),c.jsx("span",{className:"text-fg-faint",children:n.length===Xr.length?`${Xr.length} available`:`${n.length} of ${Xr.length}`}),c.jsx("input",{value:m,onChange:E=>_(E.target.value),placeholder:"search presets…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),(M||i)&&c.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),k.length>0&&c.jsxs("div",{className:"px-4 py-2 text-xs border-b border-line bg-yellow-950/20 flex items-start gap-3",children:[c.jsxs("div",{className:"flex-1 text-yellow-500/90",children:[c.jsx("div",{className:"font-medium",children:"Your CLAUDE.md has unmanaged sections that will collide with presets:"}),c.jsx("div",{className:"text-yellow-500/70 mt-0.5",children:k.map(E=>`# ${E}`).join(" · ")}),c.jsx("div",{className:"text-fg-faint mt-1",children:"These were probably added before presets were toggleable. Clean them out so the managed block owns those sections."})]}),c.jsxs("button",{onClick:v,className:"shrink-0 px-3 py-1 text-xs border border-yellow-600/60 rounded text-yellow-400 hover:bg-yellow-600 hover:text-bg",children:["remove ",k.length," section",k.length>1?"s":""]})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[w.map(E=>({cat:E,presets:u.get(E)??[]})).filter(E=>E.presets.length>0).map(({cat:E,presets:L})=>c.jsx(Qg,{title:Jg[E],presets:L,activeIds:S,existing:p,busy:C,onToggle:o},E)),n.length===0&&c.jsx(xe,{title:"no matches"})]})]})}function Qg({title:a,presets:p,activeIds:f,existing:C,busy:j,onToggle:M}){const[R,i]=K.useState(!0),d=p.filter(m=>f.has(m.id)).length;return c.jsxs("section",{className:"border-b border-line",children:[c.jsxs("header",{className:"px-4 py-2 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>i(!R),children:[c.jsx("span",{className:"text-fg-faint w-3",children:R?"▾":"▸"}),c.jsx("h2",{className:"text-fg text-sm font-medium flex-1",children:a}),c.jsx("span",{className:"text-fg-faint text-xs",children:d>0?`${d}/${p.length} active`:`${p.length}`})]}),R&&c.jsx("div",{className:"divide-y divide-line/60",children:p.map(m=>{const _=f.has(m.id),h=$g(C,m,Xr);return c.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/20",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("span",{className:"text-fg text-sm",children:m.name}),_&&c.jsx(et,{tone:"accent",children:"active"}),c.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide",children:["→ # ",m.section]}),!_&&h>0&&c.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:["merges with ",h]})]}),c.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:m.description}),c.jsxs("ul",{className:"text-fg-faint text-[11px] mt-1 space-y-0.5 list-disc list-inside",children:[m.bullets.slice(0,2).map((y,S)=>c.jsx("li",{className:"truncate",children:y},S)),m.bullets.length>2&&c.jsxs("li",{className:"text-fg-faint italic",children:["+",m.bullets.length-2," more"]})]})]}),c.jsx("div",{className:"flex gap-1 shrink-0",children:c.jsx("button",{disabled:j===m.id,onClick:()=>M(m),className:`px-3 py-0.5 text-xs rounded border transition-colors ${_?"bg-accent text-bg border-accent hover:bg-transparent hover:text-fg-dim":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:_?"remove from CLAUDE.md":"add to CLAUDE.md",children:j===m.id?"…":_?"on":"off"})})]},m.id)})})]})}function Jt({active:a,onChange:p,installedLabel:f="Installed",libraryLabel:C="Library"}){return c.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:[["installed",f],["library",C]].map(([j,M])=>c.jsx("button",{onClick:()=>p(j),className:`px-2 py-0.5 text-xs ${a===j?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:M},j))})}function js({query:a,onQueryChange:p,count:f,total:C}){return c.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[c.jsx("span",{className:"text-fg-faint",children:f===C?`${C} available`:`${f} of ${C}`}),c.jsx("div",{className:"flex-1"}),c.jsx("input",{value:a,onChange:j=>p(j.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-48"})]})}function et({children:a,tone:p="default"}){const f={default:"bg-bg-hi text-fg-dim border-line",accent:"bg-accent/15 text-accent border-accent/30",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[p];return c.jsx("span",{className:`text-[10px] px-1.5 py-0 rounded border uppercase tracking-wide ${f}`,children:a})}function cl({href:a,children:p}){return c.jsx("a",{href:a,target:"_blank",rel:"noreferrer",className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:p})}function eh({text:a,label:p}){const[f,C]=K.useState(!1);return c.jsx("button",{onClick:()=>{navigator.clipboard.writeText(a),C(!0),setTimeout(()=>C(!1),1500)},className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:f?"copied!":p})}function Yg(a){return Math.round(a.length/4)}function Zg(){const a=Ke(),p=Le(x=>x.tabs),f=Le(x=>x.activeTabId),C=p.find(x=>x.id===f)??null,j=(C==null?void 0:C.cwd)??null,[M,R]=K.useState("user"),[i,d]=K.useState("installed"),m=K.useMemo(()=>{const x={};for(const P of Va.scopes){const H=Va.resolve(P,a??"",j);H&&(x[P]=H)}return x},[a,j]),_=m[M]??null,h=ye(x=>x.files),y=ye(x=>x.loadText),S=ye(x=>x.setDraft),k=ye(x=>x.saveText),v=ye(x=>x.revert),n=ye(x=>x.watchFile),u=ye(x=>x.unwatchFile);K.useEffect(()=>{const x=Object.values(m).filter(Boolean);return x.forEach(P=>{h[P]||y(P),n(P)}),()=>{x.forEach(P=>u(P))}},[JSON.stringify(m)]);const[o,l]=K.useState(null);if(!a)return c.jsx(xe,{title:"loading…"});if(i==="library")return c.jsx(Pe,{toolbar:c.jsx(Jt,{active:i,onChange:d,installedLabel:"Editor",libraryLabel:"Presets"}),children:c.jsx(Xg,{})});const w=_?h[_]:null,E=x=>x!=="user"&&!j,L=w?Yg(w.draftRaw):0,D=(w==null?void 0:w.draftRaw.length)??0;return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx(Jt,{active:i,onChange:d,installedLabel:"Editor",libraryLabel:"Presets"}),c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:Va.scopes,active:M,onChange:R,annotate:x=>{if(E(x))return{exists:!1};const P=m[x];if(!P)return null;const H=h[P];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),c.jsx("span",{className:"ml-3 text-fg-faint truncate",children:_??"—"}),c.jsx("div",{className:"flex-1"}),c.jsxs("span",{className:"text-fg-faint",children:[D.toLocaleString()," chars · ~",L.toLocaleString()," tokens"]})]}),footer:_&&w?c.jsx(Tr,{dirty:w.dirty,busy:w.busy,parseError:o,lastSavedAt:w.lastSavedAt,leading:w.exists?null:c.jsx("span",{children:"file will be created on save"}),onSave:async()=>{l(null);const x=await k(_);x.ok||l(x.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:E(M)?c.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local CLAUDE.md"}):_&&w?c.jsx(al,{path:_,value:w.draftRaw,onChange:x=>{l(null),S(_,x)}}):c.jsx(xe,{title:"resolving…"})})}const ev=`{
|
|
112
|
+
`}function $g(a,p,f){const C=ll(a);if(C.includes(p.id))return 0;const j=new Map(f.map(R=>[R.id,R])),M=p.section.trim().toLowerCase();return C.map(R=>j.get(R)).filter(R=>!!R).filter(R=>R.section.trim().toLowerCase()===M).length}function es(a,...p){if(!a.trim())return!0;const f=a.toLowerCase();return p.some(C=>C.toLowerCase().includes(f))}function Ug(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=async()=>{var c;if(!a)return;const n=((c=(await window.api.config.readJson(`${a}/.claude.json`)).data)==null?void 0:c.mcpServers)??{};f(new Set(Object.keys(n)))};K.useEffect(()=>{h()},[a]);const y=K.useMemo(()=>xd.filter(v=>es(m,v.id,v.name,v.description)),[m]),S=async v=>{if(!a)return;j(v.id),R(null);const n=`${a}/.claude.json`,c=await window.api.config.readJson(n),o=(c.data&&typeof c.data=="object"?c.data:{})??{},l={...o.mcpServers??{}};l[v.id]={..."command"in v.config?{type:"stdio"}:{},...v.config};const w=await window.api.config.writeJson(n,{...o,mcpServers:l});if(j(null),!w.ok){R(w.error??"write failed");return}d(`installed ${v.id} — switch to Installed to edit placeholders`),setTimeout(()=>d(null),4e3),h()},k=async v=>{if(!a)return;j(v),R(null);const n=`${a}/.claude.json`,c=await window.api.config.readJson(n),o=(c.data&&typeof c.data=="object"?c.data:{})??{},l={...o.mcpServers??{}};delete l[v];const w=await window.api.config.writeJson(n,{...o,mcpServers:l});if(j(null),!w.ok){R(w.error??"write failed");return}h()};return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:m,onQueryChange:_,count:y.length,total:xd.length}),(i||M)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${M?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:M??i}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[y.map(v=>{const n=p.has(v.id);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),v.official&&u.jsx(et,{children:"official"}),n&&u.jsx(et,{tone:"accent",children:"installed"}),v.envVars.length>0&&u.jsxs(et,{tone:"warn",children:[v.envVars.length," env"]})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:"command"in v.config?`${v.config.command} ${(v.config.args??[]).join(" ")}`:v.config.url})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(cl,{href:v.homepage,children:"docs"}),n?u.jsx("button",{disabled:C===v.id,onClick:()=>k(v.id),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):u.jsx("button",{disabled:C===v.id,onClick:()=>S(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===v.id?"…":"install"})]})]},v.id)}),y.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Wg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(""),M=async()=>{if(!a)return;const i=await window.api.config.listDir(`${a}/.claude/skills`,{dirsOnly:!0});f(new Set(i.entries.map(d=>d.name)))};K.useEffect(()=>{M()},[a]);const R=K.useMemo(()=>bd.filter(i=>es(C,i.id,i.name,i.description)),[C]);return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:C,onQueryChange:j,count:R.length,total:bd.length}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const d=p.has(i.id),m=i.source==="local",_=m?"":`mkdir -p ~/.claude/skills && cd ~/.claude/skills && git clone --depth 1 --filter=blob:none --sparse https://github.com/anthropics/skills _tmp-${i.id} && cd _tmp-${i.id} && git sparse-checkout set skills/${i.id} && mv skills/${i.id} ../${i.id} && cd .. && rm -rf _tmp-${i.id}`;return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&u.jsx(et,{children:"official"}),m&&u.jsx(et,{tone:"warn",children:"local"}),d&&u.jsx(et,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),u.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/skills/",i.id,"/"]})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[!m&&u.jsx(cl,{href:i.source,children:"source"}),!m&&u.jsx(eh,{text:_,label:d?"reinstall cmd":"copy install"})]})]},i.id)}),R.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function zg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(""),M=async()=>{if(!a)return;const i=await window.api.config.listDir(`${a}/.claude/plugins`,{dirsOnly:!0});f(new Set(i.entries.map(d=>d.name)))};K.useEffect(()=>{M()},[a]);const R=K.useMemo(()=>Cd.filter(i=>es(C,i.id,i.name,i.description)),[C]);return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:C,onQueryChange:j,count:R.length,total:Cd.length}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[R.map(i=>{const d=p.has(i.id),m=`/plugin install ${i.id}@anthropics/claude-plugins-official`;return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:i.name}),i.official&&u.jsx(et,{children:"official"}),d&&u.jsx(et,{tone:"accent",children:"installed"}),i.bundles.map(_=>u.jsx(et,{tone:"dim",children:_},_))]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:i.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:m})]}),u.jsxs("div",{className:"flex gap-1 shrink-0",children:[u.jsx(cl,{href:i.source,children:"source"}),u.jsx(eh,{text:m,label:"copy install"})]})]},i.id)}),R.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Vg(a,p){return(a[p.event]??[]).some(C=>(C.hooks??[]).some(j=>j.type==="command"&&j.command===p.command))}function qg(){const a=Ke(),[p,f]=K.useState({}),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/settings.json`:null,y=async()=>{if(!h)return;const n=await window.api.config.readJson(h),c=(n.data&&typeof n.data=="object"?n.data:{})??{};f(c.hooks??{})};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>kd.filter(n=>es(m,n.id,n.name,n.description,n.event)),[m]),k=async n=>{if(!h)return;j(n.id),d(null);const c=await window.api.config.readJson(h),o=(c.data&&typeof c.data=="object"?c.data:{})??{},l={...o.hooks??{}},w=(l[n.event]??[]).slice();w.push({...n.matcher?{matcher:n.matcher}:{},hooks:[{type:"command",command:n.command,...n.timeout?{timeout:n.timeout}:{}}]}),l[n.event]=w;const L=await window.api.config.writeJson(h,{...o,hooks:l});if(j(null),!L.ok){d(L.error??"write failed");return}R(`installed ${n.id}`),setTimeout(()=>R(null),2500),y()},v=async n=>{if(!h)return;j(n.id),d(null);const c=await window.api.config.readJson(h),o=(c.data&&typeof c.data=="object"?c.data:{})??{},l={...o.hooks??{}},w=(l[n.event]??[]).map(E=>({...E,hooks:(E.hooks??[]).filter(D=>!(D.type==="command"&&D.command===n.command))})).filter(E=>(E.hooks??[]).length>0);w.length?l[n.event]=w:delete l[n.event];const L=await window.api.config.writeJson(h,{...o,hooks:l});if(j(null),!L.ok){d(L.error??"write failed");return}y()};return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:m,onQueryChange:_,count:S.length,total:kd.length}),(M||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[S.map(n=>{const c=Vg(p,n);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:n.name}),u.jsx(et,{tone:"dim",children:n.event}),n.matcher&&u.jsxs(et,{tone:"dim",children:["match: ",n.matcher]}),c&&u.jsx(et,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:n.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:n.command})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:c?u.jsx("button",{disabled:C===n.id,onClick:()=>v(n),className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-red-400",children:"remove"}):u.jsx("button",{disabled:C===n.id,onClick:()=>k(n),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===n.id?"…":"install"})})]},n.id)}),S.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Kg(){const a=Ke(),[p,f]=K.useState(new Set),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=async()=>{if(!a)return;const k=await window.api.config.listDir(`${a}/.claude/agents`,{filesOnly:!0}),v=new Set;for(const n of k.entries)n.name.endsWith(".md")&&v.add(n.name.replace(/\.md$/,""));f(v)};K.useEffect(()=>{h()},[a]);const y=K.useMemo(()=>Ed.filter(k=>es(m,k.id,k.name,k.description)),[m]),S=async k=>{if(!a)return;j(k.id),d(null);const v=`${a}/.claude/agents/${k.id}.md`,n=await window.api.config.writeText(v,k.content);if(j(null),!n.ok){d(n.error??"write failed");return}R(`installed ${k.id}`),setTimeout(()=>R(null),2500),h()};return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:m,onQueryChange:_,count:y.length,total:Ed.length}),(M||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[y.map(k=>{const v=p.has(k.id);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:k.name}),k.tools&&u.jsxs(et,{tone:"dim",children:[k.tools.split(",").length," tools"]}),v&&u.jsx(et,{tone:"accent",children:"installed"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:k.description}),u.jsxs("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:["~/.claude/agents/",k.id,".md"]})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:C===k.id,onClick:()=>S(k),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===k.id?"…":v?"overwrite":"install"})})]},k.id)}),y.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}function Gg(){const a=Ke(),[p,f]=K.useState(""),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/settings.json`:null,y=async()=>{if(!h)return;const v=await window.api.config.readJson(h),n=(v.data&&typeof v.data=="object"?v.data:{})??{};f(JSON.stringify(n.permissions??{}))};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>Ld.filter(v=>es(m,v.id,v.name,v.description)),[m]),k=async v=>{if(!h)return;j(v.id),d(null);const n=await window.api.config.readJson(h),c=(n.data&&typeof n.data=="object"?n.data:{})??{},o=await window.api.config.writeJson(h,{...c,permissions:v.permissions});if(j(null),!o.ok){d(o.error??"write failed");return}R(`applied ${v.id} — replaces existing permissions block`),setTimeout(()=>R(null),3e3),y()};return a?u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsx(js,{query:m,onQueryChange:_,count:S.length,total:Ld.length}),(M||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),u.jsxs("div",{className:"flex-1 overflow-auto divide-y divide-line",children:[S.map(v=>{const n=p===JSON.stringify(v.permissions),c=[];return v.permissions.allow&&c.push(`${v.permissions.allow.length} allow`),v.permissions.deny&&c.push(`${v.permissions.deny.length} deny`),v.permissions.ask&&c.push(`${v.permissions.ask.length} ask`),v.permissions.defaultMode&&c.push(`mode: ${v.permissions.defaultMode}`),u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/50",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-fg text-xs font-medium",children:v.name}),n&&u.jsx(et,{tone:"accent",children:"active"}),u.jsx(et,{tone:"warn",children:"replaces permissions"})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:v.description}),u.jsx("div",{className:"text-fg-faint text-[10px] font-mono mt-1 truncate",children:c.join(" · ")})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:C===v.id,onClick:()=>k(v),className:"px-2 py-0.5 text-xs border border-accent rounded text-accent hover:bg-accent hover:text-bg",children:C===v.id?"…":"apply"})})]},v.id)}),S.length===0&&u.jsx(xe,{title:"no matches"})]})]}):u.jsx(xe,{title:"loading…"})}const Jg={communication:"Communication","working-style":"Working style",security:"Security",testing:"Testing",review:"Code review",documentation:"Documentation",debugging:"Debugging",architecture:"Architecture",refactoring:"Refactoring",performance:"Performance",collaboration:"Collaboration",domain:"Domain / stack"};function Xg(){const a=Ke(),[p,f]=K.useState(""),[C,j]=K.useState(null),[M,R]=K.useState(null),[i,d]=K.useState(null),[m,_]=K.useState(""),h=a?`${a}/.claude/CLAUDE.md`:null,y=async()=>{if(!h)return;const L=await window.api.config.readText(h);f(L.text)};K.useEffect(()=>{y()},[h]);const S=K.useMemo(()=>new Set(ll(p)),[p]),k=K.useMemo(()=>Fg(p,Xr),[p]),v=async()=>{if(!h||k.length===0)return;d(null);const L=Hg(p,k),E=await window.api.config.writeText(h,L);if(!E.ok){d(E.error??"write failed");return}R(`removed ${k.length} unmanaged section(s)`),setTimeout(()=>R(null),3e3),y()},n=K.useMemo(()=>Xr.filter(L=>es(m,L.id,L.name,L.description,L.section,...L.tags??[])),[m]),c=K.useMemo(()=>{const L=new Map;for(const E of n){const D=L.get(E.category)??[];D.push(E),L.set(E.category,D)}return L},[n]),o=async L=>{if(!h)return;j(L.id),d(null);const E=Bg(p,L.id,Xr),D=await window.api.config.writeText(h,E);if(j(null),!D.ok){d(D.error??"write failed");return}const x=!S.has(L.id);R(x?`enabled "${L.name}"`:`disabled "${L.name}"`),setTimeout(()=>R(null),2500),y()};if(!a)return u.jsx(xe,{title:"loading…"});const l=S.size,w=["communication","working-style","testing","review","security","debugging","architecture","refactoring","performance","documentation","collaboration","domain"];return u.jsxs("div",{className:"h-full flex flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-fg-faint",children:l>0?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-dim font-medium",children:l})," active · managed in"," ",u.jsx("code",{className:"text-fg-faint",children:"~/.claude/CLAUDE.md"})]}):u.jsx(u.Fragment,{children:"nothing active — toggle presets below to stack them in your CLAUDE.md"})}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint",children:n.length===Xr.length?`${Xr.length} available`:`${n.length} of ${Xr.length}`}),u.jsx("input",{value:m,onChange:L=>_(L.target.value),placeholder:"search presets…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-56"})]}),(M||i)&&u.jsx("div",{className:`px-4 py-2 text-xs border-b border-line ${i?"text-red-400 bg-red-950/20":"text-accent bg-bg-elev"}`,children:i??M}),k.length>0&&u.jsxs("div",{className:"px-4 py-2 text-xs border-b border-line bg-yellow-950/20 flex items-start gap-3",children:[u.jsxs("div",{className:"flex-1 text-yellow-500/90",children:[u.jsx("div",{className:"font-medium",children:"Your CLAUDE.md has unmanaged sections that will collide with presets:"}),u.jsx("div",{className:"text-yellow-500/70 mt-0.5",children:k.map(L=>`# ${L}`).join(" · ")}),u.jsx("div",{className:"text-fg-faint mt-1",children:"These were probably added before presets were toggleable. Clean them out so the managed block owns those sections."})]}),u.jsxs("button",{onClick:v,className:"shrink-0 px-3 py-1 text-xs border border-yellow-600/60 rounded text-yellow-400 hover:bg-yellow-600 hover:text-bg",children:["remove ",k.length," section",k.length>1?"s":""]})]}),u.jsxs("div",{className:"flex-1 overflow-auto",children:[w.map(L=>({cat:L,presets:c.get(L)??[]})).filter(L=>L.presets.length>0).map(({cat:L,presets:E})=>u.jsx(Qg,{title:Jg[L],presets:E,activeIds:S,existing:p,busy:C,onToggle:o},L)),n.length===0&&u.jsx(xe,{title:"no matches"})]})]})}function Qg({title:a,presets:p,activeIds:f,existing:C,busy:j,onToggle:M}){const[R,i]=K.useState(!0),d=p.filter(m=>f.has(m.id)).length;return u.jsxs("section",{className:"border-b border-line",children:[u.jsxs("header",{className:"px-4 py-2 bg-bg-elev/40 cursor-pointer hover:bg-bg-elev flex items-center gap-3",onClick:()=>i(!R),children:[u.jsx("span",{className:"text-fg-faint w-3",children:R?"▾":"▸"}),u.jsx("h2",{className:"text-fg text-sm font-medium flex-1",children:a}),u.jsx("span",{className:"text-fg-faint text-xs",children:d>0?`${d}/${p.length} active`:`${p.length}`})]}),R&&u.jsx("div",{className:"divide-y divide-line/60",children:p.map(m=>{const _=f.has(m.id),h=$g(C,m,Xr);return u.jsxs("div",{className:"px-4 py-3 flex items-start gap-3 hover:bg-bg-elev/20",children:[u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx("span",{className:"text-fg text-sm",children:m.name}),_&&u.jsx(et,{tone:"accent",children:"active"}),u.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-line bg-bg-elev text-fg-faint uppercase tracking-wide",children:["→ # ",m.section]}),!_&&h>0&&u.jsxs("span",{className:"text-[10px] px-1 py-0 rounded border border-yellow-900/40 bg-yellow-950/30 text-yellow-500/80 uppercase tracking-wide",children:["merges with ",h]})]}),u.jsx("div",{className:"text-fg-dim text-xs mt-0.5",children:m.description}),u.jsxs("ul",{className:"text-fg-faint text-[11px] mt-1 space-y-0.5 list-disc list-inside",children:[m.bullets.slice(0,2).map((y,S)=>u.jsx("li",{className:"truncate",children:y},S)),m.bullets.length>2&&u.jsxs("li",{className:"text-fg-faint italic",children:["+",m.bullets.length-2," more"]})]})]}),u.jsx("div",{className:"flex gap-1 shrink-0",children:u.jsx("button",{disabled:j===m.id,onClick:()=>M(m),className:`px-3 py-0.5 text-xs rounded border transition-colors ${_?"bg-accent text-bg border-accent hover:bg-transparent hover:text-fg-dim":"bg-bg-elev text-fg-dim border-line hover:text-fg hover:bg-bg-hi"}`,title:_?"remove from CLAUDE.md":"add to CLAUDE.md",children:j===m.id?"…":_?"on":"off"})})]},m.id)})})]})}function Jt({active:a,onChange:p,installedLabel:f="Installed",libraryLabel:C="Library"}){return u.jsx("div",{className:"flex rounded border border-line overflow-hidden",children:[["installed",f],["library",C]].map(([j,M])=>u.jsx("button",{onClick:()=>p(j),className:`px-2 py-0.5 text-xs ${a===j?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:M},j))})}function js({query:a,onQueryChange:p,count:f,total:C}){return u.jsxs("div",{className:"shrink-0 border-b border-line bg-bg-elev px-3 py-1.5 flex items-center gap-2 text-xs",children:[u.jsx("span",{className:"text-fg-faint",children:f===C?`${C} available`:`${f} of ${C}`}),u.jsx("div",{className:"flex-1"}),u.jsx("input",{value:a,onChange:j=>p(j.target.value),placeholder:"filter…",className:"bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg w-48"})]})}function et({children:a,tone:p="default"}){const f={default:"bg-bg-hi text-fg-dim border-line",accent:"bg-accent/15 text-accent border-accent/30",warn:"bg-yellow-950/30 text-yellow-500/80 border-yellow-900/40",dim:"bg-bg-elev text-fg-faint border-line"}[p];return u.jsx("span",{className:`text-[10px] px-1.5 py-0 rounded border uppercase tracking-wide ${f}`,children:a})}function cl({href:a,children:p}){return u.jsx("a",{href:a,target:"_blank",rel:"noreferrer",className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:p})}function eh({text:a,label:p}){const[f,C]=K.useState(!1);return u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(a),C(!0),setTimeout(()=>C(!1),1500)},className:"px-2 py-0.5 text-xs border border-accent/50 rounded text-accent hover:bg-accent hover:text-bg",children:f?"copied!":p})}function Yg(a){return Math.round(a.length/4)}function Zg(){const a=Ke(),p=Le(x=>x.tabs),f=Le(x=>x.activeTabId),C=p.find(x=>x.id===f)??null,j=(C==null?void 0:C.cwd)??null,[M,R]=K.useState("user"),[i,d]=K.useState("installed"),m=K.useMemo(()=>{const x={};for(const P of Va.scopes){const H=Va.resolve(P,a??"",j);H&&(x[P]=H)}return x},[a,j]),_=m[M]??null,h=ye(x=>x.files),y=ye(x=>x.loadText),S=ye(x=>x.setDraft),k=ye(x=>x.saveText),v=ye(x=>x.revert),n=ye(x=>x.watchFile),c=ye(x=>x.unwatchFile);K.useEffect(()=>{const x=Object.values(m).filter(Boolean);return x.forEach(P=>{h[P]||y(P),n(P)}),()=>{x.forEach(P=>c(P))}},[JSON.stringify(m)]);const[o,l]=K.useState(null);if(!a)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:u.jsx(Jt,{active:i,onChange:d,installedLabel:"Editor",libraryLabel:"Presets"}),children:u.jsx(Xg,{})});const w=_?h[_]:null,L=x=>x!=="user"&&!j,E=w?Yg(w.draftRaw):0,D=(w==null?void 0:w.draftRaw.length)??0;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:i,onChange:d,installedLabel:"Editor",libraryLabel:"Presets"}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:Va.scopes,active:M,onChange:R,annotate:x=>{if(L(x))return{exists:!1};const P=m[x];if(!P)return null;const H=h[P];return{exists:(H==null?void 0:H.exists)??!1,dirty:(H==null?void 0:H.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:_??"—"}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[D.toLocaleString()," chars · ~",E.toLocaleString()," tokens"]})]}),footer:_&&w?u.jsx(Tr,{dirty:w.dirty,busy:w.busy,parseError:o,lastSavedAt:w.lastSavedAt,leading:w.exists?null:u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{l(null);const x=await k(_);x.ok||l(x.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:L(M)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local CLAUDE.md"}):_&&w?u.jsx(al,{path:_,value:w.draftRaw,onChange:x=>{l(null),S(_,x)}}):u.jsx(xe,{title:"resolving…"})})}const ev=`{
|
|
113
113
|
"$schema": "https://json.schemastore.org/claude-code-keybindings.json",
|
|
114
114
|
"bindings": []
|
|
115
115
|
}
|
|
116
|
-
`;function tv(){const a=Ke(),p=ye(y=>y.files),f=ye(y=>y.loadJson),C=ye(y=>y.setDraft),j=ye(y=>y.saveJson),M=ye(y=>y.revert),R=ye(y=>y.watchFile),i=ye(y=>y.unwatchFile),d=a?Hp.resolve("user",a,null):null;K.useEffect(()=>{if(d)return p[d]||f(d),R(d),()=>i(d)},[d]);const[m,_]=K.useState(null);if(!a||!d)return
|
|
117
|
-
`}function nv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState("effective"),i=K.useMemo(()=>{const I={};for(const X of qa.scopes){const q=qa.resolve(X,a??"",f);q&&(I[X]=q)}return I},[a,f]),d=i[C]??null,m=ye(I=>I.files),_=ye(I=>I.loadJson),h=ye(I=>I.setDraft),y=ye(I=>I.saveJson),S=ye(I=>I.revert),k=ye(I=>I.watchFile),v=ye(I=>I.unwatchFile);K.useEffect(()=>{const I=Object.values(i).filter(Boolean);return I.forEach(X=>{m[X]||_(X),k(X)}),()=>I.forEach(X=>v(X))},[JSON.stringify(i)]);const[n,
|
|
118
|
-
`)};if(!a)return c.jsx(xe,{title:"loading…"});if(M==="presets")return c.jsx(Pe,{toolbar:o,children:c.jsx(Gg,{})});const E=I=>I!=="user"&&!f,L=d?m[d]:null,{perms:D,full:x,err:P}=L?sv(L.draftRaw):{perms:{},full:{},err:null},H=I=>{d&&(u(null),h(d,iv(x,I)))},$=(I,X)=>{const q=X.trim();if(!q)return;const z=D[I]??[];z.includes(q)||H({...D,[I]:[...z,q]})},W=(I,X)=>{const q=D[I]??[];H({...D,[I]:q.filter((z,re)=>re!==X)})};return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[o,c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:qa.scopes,active:C,onChange:j,annotate:I=>{if(E(I))return{exists:!1};const X=i[I];if(!X)return null;const q=m[X];return{exists:(q==null?void 0:q.exists)??!1,dirty:(q==null?void 0:q.dirty)??!1}}}),c.jsx("span",{className:"ml-3 text-fg-faint truncate",children:d??"—"}),c.jsx("div",{className:"flex-1"}),c.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:d&&L?c.jsx(Tr,{dirty:L.dirty,busy:L.busy,parseError:n||P||L.parseError,lastSavedAt:L.lastSavedAt,onSave:async()=>{u(null);const I=await y(d);I.ok||u(I.error??"save failed")},onRevert:()=>{u(null),S(d)}}):null,children:E(C)?c.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):M==="effective"?c.jsx(rl,{node:l,targetScope:C,onOverride:w,schema:Hn().rootedAt(["permissions"]),rootLabel:"permissions"}):d&&L?c.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[c.jsx(ov,{value:D.defaultMode??"default",onChange:I=>H({...D,defaultMode:I})}),rv.map(I=>c.jsx(av,{list:I,rules:D[I]??[],onAdd:X=>$(I,X),onRemove:X=>W(I,X)},I)),c.jsx(lv,{dirs:D.additionalDirectories??[],onChange:I=>H({...D,additionalDirectories:I})})]}):c.jsx(xe,{title:"resolving…"})})}function ov({value:a,onChange:p}){const f=["default","acceptEdits","plan","bypassPermissions"];return c.jsxs("section",{children:[c.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),c.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:f.map(C=>c.jsx("button",{onClick:()=>p(C),className:`px-2.5 py-1 text-xs transition-colors ${a===C?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:C},C))})]})}function av({list:a,rules:p,onAdd:f,onRemove:C}){const[j,M]=K.useState(""),R=a==="allow"?"text-green-400":a==="deny"?"text-red-400":"text-yellow-400";return c.jsxs("section",{children:[c.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${R}`,children:a}),c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx("input",{value:j,onChange:i=>M(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(f(j),M(""))},placeholder:a==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),c.jsx("button",{onClick:()=>{f(j),M("")},disabled:!j.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),p.length===0?c.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):c.jsx("ul",{className:"space-y-0.5",children:p.map((i,d)=>c.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[c.jsx("span",{className:"flex-1 text-fg-dim truncate",children:i}),c.jsx("button",{onClick:()=>C(d),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${d}-${i}`))})]})}function lv({dirs:a,onChange:p}){const[f,C]=K.useState("");return c.jsxs("section",{children:[c.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),c.jsx("div",{className:"flex gap-2 mb-2",children:c.jsx("input",{value:f,onChange:j=>C(j.target.value),onKeyDown:j=>{j.key==="Enter"&&f.trim()&&(p([...a,f.trim()]),C(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),c.jsx("ul",{className:"space-y-0.5",children:a.map((j,M)=>c.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[c.jsx("span",{className:"flex-1 text-fg-dim truncate",children:j}),c.jsx("button",{onClick:()=>p(a.filter((R,i)=>i!==M)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${M}-${j}`))})]})}function Vn({sidebar:a,detail:p,sidebarWidth:f="18rem"}){return c.jsxs("div",{className:"h-full flex",children:[c.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:f},children:a}),c.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:p})]})}function cv(a,p){return{user:{skills:`${a}/.claude/skills`,commands:`${a}/.claude/commands`},project:p?{skills:`${p}/.claude/skills`,commands:`${p}/.claude/commands`}:null}}function uv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState([]),[i,d]=K.useState(null),[m,_]=K.useState("installed"),[h,y]=K.useState(""),S=K.useMemo(()=>a?cv(a,f):null,[a,f]);K.useEffect(()=>{if(!S)return;let P=!1;const H=C==="user"?S.user:S.project;if(!H){R([]);return}return(async()=>{var X;const $=[],W=await window.api.config.listDir(H.skills,{dirsOnly:!0});for(const q of W.entries)if((await window.api.config.readText(`${q.path}/SKILL.md`)).exists)$.push({kind:"skills",scope:C,name:q.name,path:`${q.path}/SKILL.md`,dir:q.path});else{const re=await window.api.config.listDir(q.path,{dirsOnly:!0});for(const Q of re.entries)(await window.api.config.readText(`${Q.path}/SKILL.md`)).exists&&$.push({kind:"skills",scope:C,name:Q.name,path:`${Q.path}/SKILL.md`,dir:Q.path})}const I=await window.api.config.listDir(H.commands,{filesOnly:!0});for(const q of I.entries)q.name.endsWith(".md")&&$.push({kind:"commands",scope:C,name:q.name.replace(/\.md$/,""),path:q.path,dir:null});P||($.sort((q,z)=>q.kind===z.kind?q.name.localeCompare(z.name):q.kind==="skills"?-1:1),R($),$.find(q=>q.path===i)||d(((X=$[0])==null?void 0:X.path)??null))})(),()=>{P=!0}},[C,S]);const k=ye(P=>P.files),v=ye(P=>P.loadText),n=ye(P=>P.setDraft),u=ye(P=>P.saveText),o=ye(P=>P.revert),l=ye(P=>P.watchFile),w=ye(P=>P.unwatchFile);K.useEffect(()=>{if(i)return k[i]||v(i),l(i),()=>w(i)},[i]);const[E,L]=K.useState(null);if(!a)return c.jsx(xe,{title:"loading…"});if(m==="library")return c.jsx(Pe,{toolbar:c.jsx(Jt,{active:m,onChange:_,installedLabel:"Installed",libraryLabel:"Library"}),children:c.jsx(Wg,{})});if(C==="project"&&!f)return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx(Jt,{active:m,onChange:_}),c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:["user","project"],active:C,onChange:j})]}),children:c.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const D=M.find(P=>P.path===i)??null,x=i?k[i]:null;return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx(Jt,{active:m,onChange:_}),c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:["user","project"],active:C,onChange:j}),c.jsxs("span",{className:"ml-3 text-fg-faint",children:[M.length," ",M.length===1?"item":"items"]}),c.jsx("div",{className:"flex-1"}),c.jsx("span",{className:"text-fg-faint truncate",children:(D==null?void 0:D.path)??""})]}),footer:i&&x?c.jsx(Tr,{dirty:x.dirty,busy:x.busy,parseError:E,lastSavedAt:x.lastSavedAt,onSave:async()=>{L(null);const P=await u(i);P.ok||L(P.error??"save failed")},onRevert:()=>{L(null),o(i)}}):null,children:c.jsx(Vn,{sidebar:c.jsxs("div",{className:"py-1",children:[c.jsx("div",{className:"px-2 pb-1",children:c.jsx("input",{value:h,onChange:P=>y(P.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(P=>{const H=h.toLowerCase(),$=M.filter(W=>W.kind===P&&(!H||W.name.toLowerCase().includes(H)));return c.jsxs("div",{className:"mb-3",children:[c.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:P==="skills"?"Skills":"Slash Commands"}),$.length===0?c.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):$.map(W=>{var I;return c.jsxs("button",{onClick:()=>d(W.path),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${i===W.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[c.jsxs("span",{className:"truncate",children:[W.kind==="commands"?"/":"",W.name]}),((I=k[W.path])==null?void 0:I.dirty)&&c.jsx("span",{className:"w-1 h-1 rounded-full bg-accent shrink-0 ml-2"})]},W.path)})]},P)})]}),detail:i&&x?c.jsx("div",{className:"h-full",children:c.jsx(al,{path:i,value:x.draftRaw,onChange:P=>{L(null),n(i,P)}})}):c.jsx(xe,{title:M.length===0?"no skills or commands":"select an item"})})})}function ul({columns:a,rows:p,getKey:f,onRowClick:C,activeKey:j,empty:M}){return p.length===0?c.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:M??"no entries"}):c.jsxs("table",{className:"w-full text-xs",children:[c.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:c.jsx("tr",{className:"border-b border-line",children:a.map(R=>c.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${R.className??""}`,style:R.width?{width:R.width}:void 0,children:R.header},R.key))})}),c.jsx("tbody",{children:p.map(R=>{const i=f(R),d=j===i;return c.jsx("tr",{onClick:()=>C==null?void 0:C(R),className:`border-b border-line/50 transition-colors ${C?"cursor-pointer":""} ${d?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:a.map(m=>c.jsx("td",{className:`px-3 py-1 ${m.className??""}`,children:m.render(R)},m.key))},i)})})]})}function dv(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),[M,R]=K.useState(null),[i,d]=K.useState("installed");K.useEffect(()=>{if(!a)return;let _=!1;return(async()=>{j(!0);const h=await window.api.config.listDir(`${a}/.claude/plugins`,{dirsOnly:!0});if(_)return;const y=[];for(const S of h.entries){const k=await window.api.config.exists(`${S.path}/plugin.json`);y.push({name:S.name,path:S.path,mtimeMs:S.mtimeMs,hasManifest:k})}y.sort((S,k)=>S.name.localeCompare(k.name)),_||(f(y),j(!1))})(),()=>{_=!0}},[a]);const m=[{key:"name",header:"name",render:_=>_.name,width:"12rem"},{key:"manifest",header:"manifest",render:_=>_.hasManifest?"plugin.json":c.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"path",header:"path",render:_=>c.jsx("span",{className:"font-mono text-fg-faint truncate",children:_.path})}];return i==="library"?c.jsx(Pe,{toolbar:c.jsx(Jt,{active:i,onChange:d}),children:c.jsx(zg,{})}):c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx(Jt,{active:i,onChange:d}),c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsxs("span",{className:"text-fg-faint",children:[p.length," plugins"]}),c.jsx("div",{className:"flex-1"}),c.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/"})]}),children:C?c.jsx(xe,{title:"scanning plugins…"}):c.jsx(ul,{columns:m,rows:p,getKey:_=>_.path,activeKey:M,onRowClick:_=>R(_.path),empty:c.jsxs(c.Fragment,{children:["no plugins installed",c.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",c.jsx("code",{children:"~/.claude/plugins/"})]})]})})})}function hv(a,p,f){return a==="user"?`${p}/.claude.json`:f?`${f}/.mcp.json`:null}function fv(a){if(a.trim()==="")return{full:{},servers:{},err:null};try{const p=JSON.parse(a),f=p.mcpServers??{};return{full:p,servers:f,err:null}}catch(p){return{full:{},servers:{},err:p.message}}}function pv(a,p){return JSON.stringify({...a,mcpServers:p},null,2)+`
|
|
119
|
-
`}function mv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState(null),[i,d]=K.useState("installed"),[m,_]=K.useState(""),h=K.useMemo(()=>a?hv(C,a,f):null,[a,C,f]),y=ye(z=>z.files),S=ye(z=>z.loadJson),k=ye(z=>z.setDraft),v=ye(z=>z.saveJson),n=ye(z=>z.revert),
|
|
120
|
-
`}function Sv(a,p){return(a[p]??[]).reduce((f,C)=>{var j;return f+(((j=C.hooks)==null?void 0:j.length)??0)},0)}function xv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState("PreToolUse"),[i,d]=K.useState("effective"),m=K.useMemo(()=>{const z={};for(const re of Ls.scopes){const Q=Ls.resolve(re,a??"",f);Q&&(z[re]=Q)}return z},[a,f]),_=m[C]??null,h=ye(z=>z.files),y=ye(z=>z.loadJson),S=ye(z=>z.setDraft),k=ye(z=>z.saveJson),v=ye(z=>z.revert),n=ye(z=>z.watchFile),
|
|
121
|
-
`)};if(!a)return c.jsx(xe,{title:"loading…"});if(i==="library")return c.jsx(Pe,{toolbar:w,children:c.jsx(qg,{})});if(C!=="user"&&!f)return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[w,c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:["user","project","local"],active:C,onChange:j})]}),children:c.jsx(xe,{title:"no active project"})});if(!_)return c.jsx(xe,{title:"loading…"});const D=h[_],{full:x,hooks:P,err:H}=D?yv(D.draftRaw):{full:{},hooks:{},err:null},$=z=>{l(null),S(_,wv(x,z))},W=P[M]??[],I=()=>{$({...P,[M]:[...W,{matcher:"",hooks:[{type:"command",command:""}]}]})},X=(z,re)=>{const Q=W.slice();Q[z]=re,$({...P,[M]:Q})},q=z=>{$({...P,[M]:W.filter((re,Q)=>Q!==z)})};return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[w,c.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),c.jsx(Xt,{scopes:["user","project","local"],active:C,onChange:j}),c.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${_}`:_}),c.jsx("div",{className:"flex-1"}),c.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:D?c.jsx(Tr,{dirty:D.dirty,busy:D.busy,parseError:o||H||D.parseError,lastSavedAt:D.lastSavedAt,onSave:async()=>{l(null);const z=await k(_);z.ok||l(z.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:i==="effective"?c.jsx(rl,{node:E,targetScope:C,onOverride:L,schema:Hn().rootedAt(["hooks"]),rootLabel:"hooks"}):c.jsx(Vn,{sidebarWidth:"14rem",sidebar:c.jsx("div",{className:"py-1",children:vv.map(z=>{const re=Sv(P,z);return c.jsxs("button",{onClick:()=>R(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${M===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[c.jsx("span",{className:"truncate",children:z}),re>0&&c.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:c.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:M}),c.jsx("button",{onClick:I,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ add group"})]}),W.length===0?c.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):W.map((z,re)=>c.jsx(bv,{group:z,onChange:Q=>X(re,Q),onRemove:()=>q(re)},re))]})})})}function bv({group:a,onChange:p,onRemove:f}){const C=()=>p({...a,hooks:[...a.hooks??[],{type:"command",command:""}]}),j=(R,i)=>{const d=a.hooks.slice();d[R]=i,p({...a,hooks:d})},M=R=>p({...a,hooks:a.hooks.filter((i,d)=>d!==R)});return c.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),c.jsx("input",{value:a.matcher??"",onChange:R=>p({...a,matcher:R.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),c.jsx("button",{onClick:f,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(a.hooks??[]).map((R,i)=>c.jsx(Cv,{rule:R,onChange:d=>j(i,d),onRemove:()=>M(i)},i)),c.jsx("button",{onClick:C,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function Cv({rule:a,onChange:p,onRemove:f}){const C=R=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer"})[R],j=a.type==="command"?"command":a.type==="http"?"url":a.type==="prompt"?"prompt":"agent",M=a[j]??"";return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:a.type,onChange:R=>p({type:R.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:_v.map(R=>c.jsx("option",{value:R,children:R},R))}),c.jsx("input",{value:M,onChange:R=>p({...a,[j]:R.target.value}),placeholder:C(a.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${M.trim()?"border-line":"border-yellow-600/50"}`}),c.jsx("input",{value:a.timeout??"",onChange:R=>p({...a,timeout:R.target.value?Number(R.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),c.jsx("button",{onClick:f,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function kv(a,p,f){return{tabId:a,sessionUuid:f,cwd:p,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0}}}const Tt=$n((a,p)=>({tabs:{},refs:{},unsubs:{},subscribe:(f,C,j)=>{const M={...p().refs};if(M[f]=(M[f]??0)+1,a({refs:M}),M[f]>1)return;a({tabs:{...p().tabs,[f]:kv(f,C,j)}});const R=window.api.transcripts.onEvent(f,i=>p().ingest(f,i));a({unsubs:{...p().unsubs,[f]:R}}),window.api.transcripts.subscribe({tabId:f,cwd:C,sessionUuid:j}).then(async i=>{const d=p().tabs[f];if(!d)return;a({tabs:{...p().tabs,[f]:{...d,path:i.path}}});const m=await window.api.transcripts.buffer(f);for(const _ of m)p().ingest(f,_)}).catch(i=>console.error("[live] transcripts.subscribe failed:",f,i))},unsubscribe:f=>{const C={...p().refs};if(!C[f])return;if(C[f]--,C[f]>0){a({refs:C});return}delete C[f];const j=p().unsubs[f];j==null||j();const M={...p().unsubs};delete M[f];const R={...p().tabs};delete R[f],window.api.transcripts.unsubscribe(f),a({refs:C,unsubs:M,tabs:R})},ingest:(f,C)=>{const j=p().tabs[f];if(!j)return;const M={...j};switch(C.kind){case"todo_write":{const R=Array.isArray(C.data)?C.data:[];M.todos=R;break}case"tool_use":{const R=C.data;M.lastToolUses=[{id:R.id,name:R.name,input:R.input,at:Date.now()},...j.lastToolUses].slice(0,50);break}case"plan":{const R=C.data,i=typeof R=="string"?R:(R==null?void 0:R.plan)??JSON.stringify(R);M.plans=[{at:Date.now(),content:i??""},...j.plans].slice(0,20);break}case"agent_spawn":{const R=C.data;M.agents=[{at:Date.now(),subagentType:R==null?void 0:R.subagent_type,description:R==null?void 0:R.description},...j.agents].slice(0,50);break}case"usage":{const R=C.data;M.usage={inputTokens:(j.usage.inputTokens||0)+(R.input_tokens??R.inputTokens??0),outputTokens:(j.usage.outputTokens||0)+(R.output_tokens??R.outputTokens??0),cacheCreationInputTokens:(j.usage.cacheCreationInputTokens||0)+(R.cache_creation_input_tokens??R.cacheCreationInputTokens??0),cacheReadInputTokens:(j.usage.cacheReadInputTokens||0)+(R.cache_read_input_tokens??R.cacheReadInputTokens??0)};break}default:return}a({tabs:{...p().tabs,[f]:M}})}}));function Ev(a,p,f){return f==="user"?`${a}/.claude/agents`:p?`${p}/.claude/agents`:null}function Lv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState([]),[i,d]=K.useState(null),[m,_]=K.useState("configured"),[h,y]=K.useState(""),S=K.useMemo(()=>a?Ev(a,f,C):null,[a,f,C]);K.useEffect(()=>{if(!S){R([]);return}let $=!1;return(async()=>{var W;try{const I=await window.api.config.listDir(S,{filesOnly:!0});if($)return;const X=I.entries.filter(q=>q.name.endsWith(".md")).map(q=>({scope:C,name:q.name.replace(/\.md$/,""),path:q.path})).sort((q,z)=>q.name.localeCompare(z.name));R(X),X.find(q=>q.path===i)||d(((W=X[0])==null?void 0:W.path)??null)}catch(I){console.error("[Subagents] listDir failed:",S,I),$||R([])}})(),()=>{$=!0}},[S]);const k=ye($=>$.files),v=ye($=>$.loadText),n=ye($=>$.setDraft),u=ye($=>$.saveText),o=ye($=>$.revert),l=ye($=>$.watchFile),w=ye($=>$.unwatchFile);K.useEffect(()=>{if(i)return k[i]||v(i),l(i),()=>w(i)},[i]);const E=Tt($=>$.subscribe),L=Tt($=>$.unsubscribe),D=Tt($=>$.tabs);K.useEffect(()=>{if(!(m!=="live"||!p))return E(p.id,p.cwd,p.claudeSessionId),()=>L(p.id)},[m,p,E,L]);const[x,P]=K.useState(null);if(!a)return c.jsx(xe,{title:"loading…"});const H=i?k[i]:null;return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map($=>c.jsx("button",{onClick:()=>_($),className:`px-2.5 py-1 text-xs ${m===$?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:$},$))}),m==="configured"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"ml-2",children:c.jsx(Xt,{scopes:["user","project"],active:C,onChange:j})}),c.jsxs("span",{className:"ml-3 text-fg-faint",children:[M.length," agents"]})]}),c.jsx("div",{className:"flex-1"})]}),footer:m==="configured"&&i&&H?c.jsx(Tr,{dirty:H.dirty,busy:H.busy,parseError:x,lastSavedAt:H.lastSavedAt,onSave:async()=>{P(null);const $=await u(i);$.ok||P($.error??"save failed")},onRevert:()=>{P(null),o(i)}}):null,children:m==="library"?c.jsx(Kg,{}):m==="configured"?C==="project"&&!f?c.jsx(xe,{title:"no active project"}):c.jsx(Vn,{sidebar:c.jsxs("div",{className:"py-2",children:[c.jsx("div",{className:"px-2 pb-1",children:c.jsx("input",{value:h,onChange:$=>y($.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),M.length===0?c.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):M.filter($=>!h||$.name.toLowerCase().includes(h.toLowerCase())).map($=>c.jsx("button",{onClick:()=>d($.path),className:`w-full text-left px-3 py-1 text-xs ${i===$.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:$.name},$.path))]}),detail:i&&H?c.jsx(al,{path:i,value:H.draftRaw,onChange:$=>{P(null),n(i,$)}}):c.jsx(xe,{title:"select an agent"})}):p?c.jsx(Rv,{tabId:p.id,live:D[p.id]}):c.jsx(xe,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function Rv({tabId:a,live:p}){return p?p.agents.length===0?c.jsx(xe,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):c.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:p.agents.map((f,C)=>c.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-xs font-medium text-fg",children:f.subagentType??"general-purpose"}),c.jsx("span",{className:"text-xs text-fg-faint",children:new Date(f.at).toLocaleTimeString()})]}),f.description&&c.jsx("div",{className:"text-xs text-fg-dim",children:f.description})]},C))}):c.jsx(xe,{title:`waiting for transcript (tab ${a.slice(0,8)})`})}function jv(){const a=Ar(),p=Tt(M=>M.subscribe),f=Tt(M=>M.unsubscribe),C=Tt(M=>a?M.tabs[a.id]:void 0);if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return c.jsx(Pe,{children:c.jsx(xe,{title:"no active session"})});const j=(C==null?void 0:C.plans)??[];return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),c.jsx("div",{className:"flex-1"}),c.jsxs("span",{className:"text-fg-faint",children:[j.length," plans"]})]}),children:j.length===0?c.jsx(xe,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):c.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:j.map((M,R)=>c.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[c.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(M.at).toLocaleString()}),c.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:M.content})]},R))})})}function Dv(){const a=Ar(),p=Tt(R=>R.subscribe),f=Tt(R=>R.unsubscribe),C=Tt(R=>a?R.tabs[a.id]:void 0);if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return c.jsx(Pe,{children:c.jsx(xe,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const j=(C==null?void 0:C.todos)??[],M={completed:j.filter(R=>R.status==="completed").length,in_progress:j.filter(R=>R.status==="in_progress").length,pending:j.filter(R=>R.status==="pending").length};return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),c.jsx("div",{className:"flex-1"}),c.jsxs("span",{className:"text-fg-faint",children:[c.jsx("span",{className:"text-green-400",children:M.completed})," done ·"," ",c.jsx("span",{className:"text-accent",children:M.in_progress})," active ·"," ",c.jsx("span",{className:"text-fg-dim",children:M.pending})," pending"]})]}),children:j.length===0?c.jsx(xe,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):c.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:j.map((R,i)=>c.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${R.status==="in_progress"?"bg-bg-elev":""}`,children:[c.jsx(Pv,{status:R.status}),c.jsx("span",{className:`flex-1 ${R.status==="completed"?"text-fg-faint line-through":R.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:R.status==="in_progress"&&R.activeForm?R.activeForm:R.content})]},i))})})}function Pv({status:a}){return a==="completed"?c.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):a==="in_progress"?c.jsx("span",{className:"text-accent w-4 shrink-0",children:c.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):c.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function Tv(a){return a.replace(/-/g,"/")}async function Av(a){const f=(await window.api.config.listDir(a,{filesOnly:!0})).entries.filter(C=>C.name.endsWith(".jsonl")).sort((C,j)=>C.size-j.size);for(const C of f){const j=await window.api.config.readText(C.path);if(!(!j.exists||!j.text)){for(const M of j.text.split(`
|
|
122
|
-
`))if(M.includes('"cwd"'))try{const R=JSON.parse(M);if(typeof R.cwd=="string"&&R.cwd.length>0)return R.cwd}catch{}}}return null}function Mv(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),M=Le(d=>d.addTab);K.useEffect(()=>{if(!a)return;let d=!1;return(async()=>{j(!0);try{const m=await window.api.config.listDir(`${a}/.claude/projects`,{dirsOnly:!0});if(d)return;const _=[];for(const h of m.entries){if(d)return;const S=(await window.api.config.listDir(h.path,{filesOnly:!0})).entries.filter(v=>v.name.endsWith(".jsonl")),k=S.reduce((v,n)=>Math.max(v,n.mtimeMs),0);_.push({encoded:h.name,displayPath:Tv(h.name),sessionCount:S.length,lastSession:k,path:h.path})}_.sort((h,y)=>y.lastSession-h.lastSession),d||f(_)}catch(m){console.error("[Projects] scan failed:",m)}finally{d||j(!1)}})(),()=>{d=!0}},[a]);const R=async d=>{let m=await Av(d.path);if(!m&&(m=await window.api.app.pickDirectory(),!m))return;const _=crypto.randomUUID();M({id:_,cwd:m,startupCommand:`claude --dangerously-skip-permissions --session-id ${$t(_)}`,presetId:"projects-tab"})},i=[{key:"path",header:"project",render:d=>c.jsxs("span",{className:"font-mono text-fg-dim truncate",children:["/",d.displayPath]})},{key:"count",header:"sessions",render:d=>d.sessionCount,width:"6rem"},{key:"last",header:"last active",render:d=>d.lastSession?new Date(d.lastSession).toLocaleString():"—",width:"12rem"},{key:"action",header:"",render:d=>c.jsx("button",{onClick:m=>{m.stopPropagation(),R(d)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"open"}),width:"4rem"}];return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-fg-faint",children:[p.length," projects"]}),c.jsx("div",{className:"flex-1"}),c.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/projects/"})]}),children:C?c.jsx(xe,{title:"scanning projects…"}):c.jsx(ul,{columns:i,rows:p,getKey:d=>d.encoded,empty:"no projects with claude session history"})})}function Ov(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),[M,R]=K.useState(""),i=Le(h=>h.addTab);K.useEffect(()=>{if(!a)return;let h=!1;return(async()=>{j(!0);try{const y=await window.api.config.listDir(`${a}/.claude/projects`,{dirsOnly:!0}),S=[];for(const k of y.entries){if(h)return;const v=await window.api.config.listDir(k.path,{filesOnly:!0});for(const n of v.entries)n.name.endsWith(".jsonl")&&S.push({sessionId:n.name.replace(/\.jsonl$/,""),projectEncoded:k.name,path:n.path,mtimeMs:n.mtimeMs,sizeBytes:n.size})}S.sort((k,v)=>v.mtimeMs-k.mtimeMs),h||f(S)}catch(y){console.error("[History] scan failed:",y)}finally{h||j(!1)}})(),()=>{h=!0}},[a]);const d=K.useMemo(()=>{if(!M.trim())return p;const h=M.toLowerCase();return p.filter(y=>y.sessionId.toLowerCase().includes(h)||y.projectEncoded.toLowerCase().includes(h))},[p,M]),m=async h=>{const y=await window.api.app.pickDirectory();y&&i({cwd:y,startupCommand:`claude --resume ${$t(h.sessionId)}`,presetId:"history-resume"})},_=[{key:"id",header:"session",render:h=>c.jsx("span",{className:"font-mono text-fg-dim",children:h.sessionId.slice(0,8)}),width:"7rem"},{key:"proj",header:"project",render:h=>c.jsxs("span",{className:"font-mono text-fg-faint truncate",children:["/",h.projectEncoded.replace(/-/g,"/")]})},{key:"size",header:"size",render:h=>`${Math.round(h.sizeBytes/1024)}k`,width:"5rem"},{key:"when",header:"when",render:h=>new Date(h.mtimeMs).toLocaleString(),width:"12rem"},{key:"action",header:"",render:h=>c.jsx("button",{onClick:y=>{y.stopPropagation(),m(h)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"resume"}),width:"5rem"}];return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsx("input",{value:M,onChange:h=>R(h.target.value),placeholder:"filter by id or project",className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint w-64"}),c.jsxs("span",{className:"ml-2 text-fg-faint",children:[d.length,"/",p.length]}),c.jsx("div",{className:"flex-1"})]}),children:C?c.jsx(xe,{title:"scanning transcripts…"}):c.jsx(ul,{columns:_,rows:d,getKey:h=>h.path,empty:"no session transcripts found"})})}const jd={"opus-4.6":{input:5,output:25},"sonnet-4.6":{input:3,output:15},"haiku-4.5":{input:1,output:5}};function Nv(){const a=Ar(),p=Tt(y=>y.subscribe),f=Tt(y=>y.unsubscribe),C=Tt(y=>a?y.tabs[a.id]:void 0),[j,M]=K.useState("opus-4.6"),[R,i]=K.useState(()=>{try{const y=localStorage.getItem("sm:pricing");if(y)return{...jd,...JSON.parse(y)}}catch{}return jd}),d=y=>{i(y);try{localStorage.setItem("sm:pricing",JSON.stringify(y))}catch{}};if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return c.jsx(Pe,{children:c.jsx(xe,{title:"no active session"})});const m=(C==null?void 0:C.usage)??{inputTokens:0,outputTokens:0},_=R[j],h=m.inputTokens*_.input/1e6+m.outputTokens*_.output/1e6;return c.jsx(Pe,{toolbar:c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),c.jsx("div",{className:"flex-1"}),c.jsxs("label",{className:"text-fg-faint flex items-center gap-2",children:["model",c.jsx("select",{value:j,onChange:y=>M(y.target.value),className:"bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg",children:Object.keys(R).map(y=>c.jsx("option",{value:y,children:y},y))})]})]}),children:c.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[c.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[c.jsx(pi,{label:"input tokens",value:m.inputTokens.toLocaleString()}),c.jsx(pi,{label:"output tokens",value:m.outputTokens.toLocaleString()}),m.cacheCreationInputTokens!=null&&c.jsx(pi,{label:"cache creation",value:m.cacheCreationInputTokens.toLocaleString()}),m.cacheReadInputTokens!=null&&c.jsx(pi,{label:"cache read",value:m.cacheReadInputTokens.toLocaleString()}),c.jsx(pi,{label:"estimated cost",value:`$${h.toFixed(4)}`,highlight:!0})]}),c.jsxs("section",{children:[c.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-2",children:"Pricing ($/MTok)"}),c.jsxs("table",{className:"text-xs",children:[c.jsx("thead",{className:"text-fg-faint",children:c.jsxs("tr",{children:[c.jsx("th",{className:"text-left px-2 py-1",children:"model"}),c.jsx("th",{className:"text-left px-2 py-1",children:"input"}),c.jsx("th",{className:"text-left px-2 py-1",children:"output"})]})}),c.jsx("tbody",{children:Object.entries(R).map(([y,S])=>c.jsxs("tr",{className:"border-t border-line",children:[c.jsx("td",{className:"px-2 py-1 text-fg-dim",children:y}),c.jsx("td",{className:"px-2 py-1",children:c.jsx("input",{type:"number",step:"0.1",value:S.input,onChange:k=>d({...R,[y]:{...S,input:Number(k.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})}),c.jsx("td",{className:"px-2 py-1",children:c.jsx("input",{type:"number",step:"0.1",value:S.output,onChange:k=>d({...R,[y]:{...S,output:Number(k.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})})]},y))})]}),c.jsx("div",{className:"mt-2 text-fg-faint text-xs",children:"edits are saved locally and persist across sessions."})]})]})})}function pi({label:a,value:p,highlight:f}){return c.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[c.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:a}),c.jsx("div",{className:`text-lg font-mono ${f?"text-accent":"text-fg"}`,children:p})]})}class Iv extends K.Component{constructor(){super(...arguments);Oa(this,"state",{error:null});Oa(this,"reset",()=>this.setState({error:null}))}static getDerivedStateFromError(f){return{error:f}}componentDidCatch(f,C){console.error("[ErrorBoundary]",f,C)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):c.jsxs("div",{className:"p-6 text-xs",children:[c.jsx("div",{className:"text-red-400 mb-2",children:"something broke in this panel"}),c.jsx("pre",{className:"text-fg-faint whitespace-pre-wrap mb-3",children:this.state.error.message}),c.jsx("button",{onClick:this.reset,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"retry"})]}):this.props.children}}const Bv={overview:"Overview",terminal:"Terminal","system-prompt":"System Prompt / Personality",settings:"Settings",permissions:"Permissions",skills:"Skills",plugins:"Plugins",mcp:"MCP Servers",hooks:"Hooks",subagents:"Subagents",plans:"Plans",tasks:"Tasks / Todos",projects:"Projects",history:"History",keybindings:"Keybindings",usage:"Usage"};function Fv(a){switch(a){case"overview":return c.jsx(Fp,{});case"system-prompt":return c.jsx(Zg,{});case"settings":return c.jsx(Og,{});case"permissions":return c.jsx(nv,{});case"skills":return c.jsx(uv,{});case"plugins":return c.jsx(dv,{});case"mcp":return c.jsx(mv,{});case"hooks":return c.jsx(xv,{});case"subagents":return c.jsx(Lv,{});case"plans":return c.jsx(jv,{});case"tasks":return c.jsx(Dv,{});case"projects":return c.jsx(Mv,{});case"history":return c.jsx(Ov,{});case"keybindings":return c.jsx(tv,{});case"usage":return c.jsx(Nv,{});default:return null}}function Hv({active:a}){const p=Le(M=>M.tabs),f=Le(M=>M.activeTabId),C=Le(M=>M.restartTab),j=p.find(M=>M.id===f)??null;return c.jsxs("main",{className:"flex-1 min-w-0 bg-bg flex flex-col",children:[c.jsxs("header",{className:"h-9 border-b border-line px-4 flex items-center shrink-0",children:[c.jsx("h1",{className:"text-xs text-fg-dim uppercase tracking-wider",children:Bv[a]}),j&&c.jsx("span",{className:"ml-4 text-xs text-fg-faint truncate",children:j.cwd}),c.jsx("div",{className:"flex-1"}),j&&a==="terminal"&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:()=>C(j.id),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill claude and start a fresh session in the same directory (picks up config changes)",children:"Restart Session"}),c.jsx("button",{onClick:()=>window.api.app.rebootApp(),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill all sessions, quit the app, and relaunch — all tabs restore automatically",children:"Restart App"})]})]}),c.jsxs("div",{className:"flex-1 min-h-0 relative",children:[c.jsx("div",{className:"absolute inset-0",style:{visibility:a==="terminal"?"visible":"hidden"},children:j?p.map(M=>c.jsx("div",{className:"absolute inset-0",style:{visibility:M.id===f?"visible":"hidden"},children:c.jsx(Ip,{tabId:M.id,cwd:M.cwd})},`${M.id}-${M.generation}`)):c.jsx($v,{})}),a!=="terminal"&&c.jsx("div",{className:"absolute inset-0 bg-bg overflow-auto",children:c.jsx(Iv,{children:Fv(a)})})]})]})}function $v(){return c.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"mb-2",children:"no active session"}),c.jsxs("div",{children:["click ",c.jsx("span",{className:"text-fg-dim",children:"+ new"})," in the tab bar to start one"]})]})})}function Uv(){const a=bt(f=>f.isRecording),p=bt(f=>f.lastTranscript);return!a||!p?null:c.jsxs("div",{className:"fixed bottom-12 left-1/2 -translate-x-1/2 z-50 px-4 py-2 rounded-lg bg-bg-elev/90 border border-line text-xs text-fg-dim max-w-md truncate shadow-lg",children:[c.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-red-400 animate-pulse mr-2"}),p]})}function Wv(a){return a.replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/\*{1,3}([^*]+)\*{1,3}/g,"$1").replace(/_{1,3}([^_]+)_{1,3}/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s?/gm,"").replace(/^[\s]*[-*+]\s/gm,"").replace(/^[\s]*\d+\.\s/gm,"").trim()}function Dd(a){if(!window.speechSynthesis)return;const p=Wv(a);if(!p)return;const f=new SpeechSynthesisUtterance(p);f.rate=1,f.pitch=1,window.speechSynthesis.speak(f)}function zv(){window.speechSynthesis&&window.speechSynthesis.cancel()}function Vv(a){const p=bt(C=>C.ttsEnabled),f=bt(C=>C.isRecording);K.useEffect(()=>!a||!p?void 0:window.api.transcripts.onEvent(a,j=>{if(j.kind!=="message")return;const M=j.data;if((M==null?void 0:M.role)!=="assistant"||bt.getState().isRecording)return;const R=M==null?void 0:M.content;if(typeof R=="string")Dd(R);else if(Array.isArray(R)){const i=R.filter(d=>d.type==="text").map(d=>d.text).join(" ");i&&Dd(i)}}),[a,p]),K.useEffect(()=>{f&&zv()},[f])}async function Pd(){const a=await window.api.app.pickDirectory();if(!a)return;const p=crypto.randomUUID(),f=`claude --dangerously-skip-permissions --session-id ${$t(p)}`;Le.getState().addTab({id:p,cwd:a,startupCommand:f,presetId:"pick-dangerous"})}function qv(){const[a,p]=K.useState("terminal"),f=Le(j=>j.activeTabId);Vv(f);const C=K.useCallback(()=>{p("terminal"),Pd().catch(j=>console.error("[App] new session failed:",j))},[]);return K.useEffect(()=>{vp().then(()=>{if(Le.getState().tabs.length>0)return;const i=Ad[0];mp(i).then(d=>{if(!d||Le.getState().tabs.length>0)return;const m=crypto.randomUUID(),_=Md(i,{sessionId:m,cwd:d});Le.setState(h=>({tabs:[...h.tabs,{id:m,claudeSessionId:m,label:d.split("/").filter(Boolean).pop()||d,cwd:d,pid:null,status:"spawning",exitCode:null,startupCommand:_,presetId:i.id,generation:0}],activeTabId:m}))}).catch(d=>console.warn("[App] failed to create initial tab:",d))});const j=window.api.app.onNewSession(()=>{Pd().catch(i=>console.error("[App] new-session from menu failed:",i))}),M=window.api.app.onRebootSession(()=>{const{activeTabId:i}=Le.getState();i&&Le.getState().restartTab(i)}),R=wg();return Zm([{uri:"https://json.schemastore.org/claude-code-settings.json",fileMatch:["**/settings.json","**/settings.local.json"]},{uri:"https://json.schemastore.org/claude-code-keybindings.json",fileMatch:["**/keybindings.json"]}]).catch(i=>console.warn("[monaco] schema install failed:",i)),()=>{R(),j(),M()}},[]),c.jsxs("div",{className:"h-full w-full flex flex-col bg-bg text-fg text-sm",children:[c.jsx(wp,{}),c.jsxs("div",{className:"flex-1 flex min-h-0",children:[c.jsx(jp,{active:a,onChange:p,onNewSession:C}),c.jsx(Hv,{active:a})]}),c.jsx(Dp,{}),c.jsx(Uv,{})]})}window.addEventListener("unhandledrejection",a=>{const p=a.reason instanceof Error?a.reason.stack??a.reason.message:String(a.reason);console.error("[renderer] unhandled rejection:",p)});window.addEventListener("error",a=>{a.error&&console.error("[renderer] uncaught error:",a.error.stack??a.error.message??a.error)});typeof window.api>"u"&&console.error("[renderer] window.api is undefined — preload script failed to load. Check main/index.cjs BrowserWindow webPreferences.preload path.");lp.createRoot(document.getElementById("root")).render(c.jsx(qv,{}));export{zp as _};
|
|
116
|
+
`;function tv(){const a=Ke(),p=ye(y=>y.files),f=ye(y=>y.loadJson),C=ye(y=>y.setDraft),j=ye(y=>y.saveJson),M=ye(y=>y.revert),R=ye(y=>y.watchFile),i=ye(y=>y.unwatchFile),d=a?Hp.resolve("user",a,null):null;K.useEffect(()=>{if(d)return p[d]||f(d),R(d),()=>i(d)},[d]);const[m,_]=K.useState(null);if(!a||!d)return u.jsx(xe,{title:"loading…"});const h=p[d];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-fg-faint truncate",children:d}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/keybindings",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"reference ↗"})]}),footer:h?u.jsx(Tr,{dirty:h.dirty,busy:h.busy,parseError:m||h.parseError,lastSavedAt:h.lastSavedAt,leading:h.exists?u.jsx("span",{children:"restart Claude Code to apply changes"}):u.jsx("span",{children:"file will be created on save"}),onSave:async()=>{_(null);const y=await j(d);y.ok||_(y.error??"save failed")},onRevert:()=>{_(null),M(d)}}):null,children:h?u.jsx(qd,{path:d,value:h.draftRaw===""&&!h.exists?ev:h.draftRaw,onChange:y=>{_(null),C(d,y)}}):u.jsx(xe,{title:"loading…"})})}function Ar(){const a=Le(f=>f.tabs),p=Le(f=>f.activeTabId);return a.find(f=>f.id===p)??null}const rv=["allow","deny","ask"];function sv(a){if(a.trim()==="")return{perms:{},full:{},err:null};try{const p=JSON.parse(a);return{perms:p.permissions??{},full:p,err:null}}catch(p){return{perms:{},full:{},err:p.message}}}function iv(a,p){const f={...a,permissions:p};return JSON.stringify(f,null,2)+`
|
|
117
|
+
`}function nv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState("effective"),i=K.useMemo(()=>{const I={};for(const X of qa.scopes){const q=qa.resolve(X,a??"",f);q&&(I[X]=q)}return I},[a,f]),d=i[C]??null,m=ye(I=>I.files),_=ye(I=>I.loadJson),h=ye(I=>I.setDraft),y=ye(I=>I.saveJson),S=ye(I=>I.revert),k=ye(I=>I.watchFile),v=ye(I=>I.unwatchFile);K.useEffect(()=>{const I=Object.values(i).filter(Boolean);return I.forEach(X=>{m[X]||_(X),k(X)}),()=>I.forEach(X=>v(X))},[JSON.stringify(i)]);const[n,c]=K.useState(null),o=u.jsx(sl,{options:[{key:"effective",label:"Effective"},{key:"rules",label:"Rules"},{key:"presets",label:"Presets"}],active:M,onChange:R}),l=K.useMemo(()=>{const I=il(ol(m,i));return nl(I,["permissions"])??{kind:"object",children:{}}},[m,i]),w=(I,X)=>{var B;const q=i[C];if(!q)return;c(null);const z=((B=m[q])==null?void 0:B.draftRaw)??"";let re={};if(z.trim())try{re=JSON.parse(z)}catch{re={}}const Q=Wn(re.permissions??{},I,X),A={...re,permissions:Q};h(q,JSON.stringify(A,null,2)+`
|
|
118
|
+
`)};if(!a)return u.jsx(xe,{title:"loading…"});if(M==="presets")return u.jsx(Pe,{toolbar:o,children:u.jsx(Gg,{})});const L=I=>I!=="user"&&!f,E=d?m[d]:null,{perms:D,full:x,err:P}=E?sv(E.draftRaw):{perms:{},full:{},err:null},H=I=>{d&&(c(null),h(d,iv(x,I)))},$=(I,X)=>{const q=X.trim();if(!q)return;const z=D[I]??[];z.includes(q)||H({...D,[I]:[...z,q]})},W=(I,X)=>{const q=D[I]??[];H({...D,[I]:q.filter((z,re)=>re!==X)})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[o,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:qa.scopes,active:C,onChange:j,annotate:I=>{if(L(I))return{exists:!1};const X=i[I];if(!X)return null;const q=m[X];return{exists:(q==null?void 0:q.exists)??!1,dirty:(q==null?void 0:q.dirty)??!1}}}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:d??"—"}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/settings#permissions",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"rule syntax ↗"})]}),footer:d&&E?u.jsx(Tr,{dirty:E.dirty,busy:E.busy,parseError:n||P||E.parseError,lastSavedAt:E.lastSavedAt,onSave:async()=>{c(null);const I=await y(d);I.ok||c(I.error??"save failed")},onRevert:()=>{c(null),S(d)}}):null,children:L(C)?u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to edit project or local permissions"}):M==="effective"?u.jsx(rl,{node:l,targetScope:C,onOverride:w,schema:Hn().rootedAt(["permissions"]),rootLabel:"permissions"}):d&&E?u.jsxs("div",{className:"p-4 space-y-5 max-w-3xl",children:[u.jsx(ov,{value:D.defaultMode??"default",onChange:I=>H({...D,defaultMode:I})}),rv.map(I=>u.jsx(av,{list:I,rules:D[I]??[],onAdd:X=>$(I,X),onRemove:X=>W(I,X)},I)),u.jsx(lv,{dirs:D.additionalDirectories??[],onChange:I=>H({...D,additionalDirectories:I})})]}):u.jsx(xe,{title:"resolving…"})})}function ov({value:a,onChange:p}){const f=["default","acceptEdits","plan","bypassPermissions"];return u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Default Mode"}),u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:f.map(C=>u.jsx("button",{onClick:()=>p(C),className:`px-2.5 py-1 text-xs transition-colors ${a===C?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:C},C))})]})}function av({list:a,rules:p,onAdd:f,onRemove:C}){const[j,M]=K.useState(""),R=a==="allow"?"text-green-400":a==="deny"?"text-red-400":"text-yellow-400";return u.jsxs("section",{children:[u.jsx("h3",{className:`text-xs uppercase tracking-wider mb-2 ${R}`,children:a}),u.jsxs("div",{className:"flex gap-2 mb-2",children:[u.jsx("input",{value:j,onChange:i=>M(i.target.value),onKeyDown:i=>{i.key==="Enter"&&(f(j),M(""))},placeholder:a==="allow"?"e.g. Bash(ls:*) or Read(~/.claude/**)":"e.g. Write(/etc/**)",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"}),u.jsx("button",{onClick:()=>{f(j),M("")},disabled:!j.trim(),className:"px-2.5 py-1 border border-line rounded text-xs text-fg-dim hover:text-fg hover:bg-bg-hi disabled:opacity-40",children:"add"})]}),p.length===0?u.jsx("div",{className:"text-fg-faint text-xs",children:"no rules"}):u.jsx("ul",{className:"space-y-0.5",children:p.map((i,d)=>u.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[u.jsx("span",{className:"flex-1 text-fg-dim truncate",children:i}),u.jsx("button",{onClick:()=>C(d),className:"text-fg-faint hover:text-red-400",title:"remove",children:"×"})]},`${d}-${i}`))})]})}function lv({dirs:a,onChange:p}){const[f,C]=K.useState("");return u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs text-fg uppercase tracking-wider mb-2",children:"Additional Directories"}),u.jsx("div",{className:"flex gap-2 mb-2",children:u.jsx("input",{value:f,onChange:j=>C(j.target.value),onKeyDown:j=>{j.key==="Enter"&&f.trim()&&(p([...a,f.trim()]),C(""))},placeholder:"/absolute/path/to/dir",className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint"})}),u.jsx("ul",{className:"space-y-0.5",children:a.map((j,M)=>u.jsxs("li",{className:"flex items-center gap-2 text-xs font-mono bg-bg-elev border border-line rounded px-2 py-1",children:[u.jsx("span",{className:"flex-1 text-fg-dim truncate",children:j}),u.jsx("button",{onClick:()=>p(a.filter((R,i)=>i!==M)),className:"text-fg-faint hover:text-red-400",children:"×"})]},`${M}-${j}`))})]})}function Vn({sidebar:a,detail:p,sidebarWidth:f="18rem"}){return u.jsxs("div",{className:"h-full flex",children:[u.jsx("div",{className:"shrink-0 border-r border-line overflow-y-auto",style:{width:f},children:a}),u.jsx("div",{className:"flex-1 min-w-0 overflow-auto",children:p})]})}function cv(a,p){return{user:{skills:`${a}/.claude/skills`,commands:`${a}/.claude/commands`},project:p?{skills:`${p}/.claude/skills`,commands:`${p}/.claude/commands`}:null}}function uv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState([]),[i,d]=K.useState(null),[m,_]=K.useState("installed"),[h,y]=K.useState(""),S=K.useMemo(()=>a?cv(a,f):null,[a,f]);K.useEffect(()=>{if(!S)return;let P=!1;const H=C==="user"?S.user:S.project;if(!H){R([]);return}return(async()=>{var X;const $=[],W=await window.api.config.listDir(H.skills,{dirsOnly:!0});for(const q of W.entries)if((await window.api.config.readText(`${q.path}/SKILL.md`)).exists)$.push({kind:"skills",scope:C,name:q.name,path:`${q.path}/SKILL.md`,dir:q.path});else{const re=await window.api.config.listDir(q.path,{dirsOnly:!0});for(const Q of re.entries)(await window.api.config.readText(`${Q.path}/SKILL.md`)).exists&&$.push({kind:"skills",scope:C,name:Q.name,path:`${Q.path}/SKILL.md`,dir:Q.path})}const I=await window.api.config.listDir(H.commands,{filesOnly:!0});for(const q of I.entries)q.name.endsWith(".md")&&$.push({kind:"commands",scope:C,name:q.name.replace(/\.md$/,""),path:q.path,dir:null});P||($.sort((q,z)=>q.kind===z.kind?q.name.localeCompare(z.name):q.kind==="skills"?-1:1),R($),$.find(q=>q.path===i)||d(((X=$[0])==null?void 0:X.path)??null))})(),()=>{P=!0}},[C,S]);const k=ye(P=>P.files),v=ye(P=>P.loadText),n=ye(P=>P.setDraft),c=ye(P=>P.saveText),o=ye(P=>P.revert),l=ye(P=>P.watchFile),w=ye(P=>P.unwatchFile);K.useEffect(()=>{if(i)return k[i]||v(i),l(i),()=>w(i)},[i]);const[L,E]=K.useState(null);if(!a)return u.jsx(xe,{title:"loading…"});if(m==="library")return u.jsx(Pe,{toolbar:u.jsx(Jt,{active:m,onChange:_,installedLabel:"Installed",libraryLabel:"Library"}),children:u.jsx(Wg,{})});if(C==="project"&&!f)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:m,onChange:_}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project"],active:C,onChange:j})]}),children:u.jsx(xe,{title:"no active project",hint:"open a tab in a project directory to view project skills & commands"})});const D=M.find(P=>P.path===i)??null,x=i?k[i]:null;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:m,onChange:_}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project"],active:C,onChange:j}),u.jsxs("span",{className:"ml-3 text-fg-faint",children:[M.length," ",M.length===1?"item":"items"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint truncate",children:(D==null?void 0:D.path)??""})]}),footer:i&&x?u.jsx(Tr,{dirty:x.dirty,busy:x.busy,parseError:L,lastSavedAt:x.lastSavedAt,onSave:async()=>{E(null);const P=await c(i);P.ok||E(P.error??"save failed")},onRevert:()=>{E(null),o(i)}}):null,children:u.jsx(Vn,{sidebar:u.jsxs("div",{className:"py-1",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:h,onChange:P=>y(P.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),["skills","commands"].map(P=>{const H=h.toLowerCase(),$=M.filter(W=>W.kind===P&&(!H||W.name.toLowerCase().includes(H)));return u.jsxs("div",{className:"mb-3",children:[u.jsx("div",{className:"px-3 py-1 text-xs uppercase tracking-wider text-fg-faint",children:P==="skills"?"Skills":"Slash Commands"}),$.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"none"}):$.map(W=>{var I;return u.jsxs("button",{onClick:()=>d(W.path),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${i===W.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsxs("span",{className:"truncate",children:[W.kind==="commands"?"/":"",W.name]}),((I=k[W.path])==null?void 0:I.dirty)&&u.jsx("span",{className:"w-1 h-1 rounded-full bg-accent shrink-0 ml-2"})]},W.path)})]},P)})]}),detail:i&&x?u.jsx("div",{className:"h-full",children:u.jsx(al,{path:i,value:x.draftRaw,onChange:P=>{E(null),n(i,P)}})}):u.jsx(xe,{title:M.length===0?"no skills or commands":"select an item"})})})}function ul({columns:a,rows:p,getKey:f,onRowClick:C,activeKey:j,empty:M}){return p.length===0?u.jsx("div",{className:"p-6 text-fg-faint text-xs text-center",children:M??"no entries"}):u.jsxs("table",{className:"w-full text-xs",children:[u.jsx("thead",{className:"sticky top-0 bg-bg-elev text-fg-faint uppercase tracking-wider",children:u.jsx("tr",{className:"border-b border-line",children:a.map(R=>u.jsx("th",{className:`text-left font-normal px-3 py-1.5 ${R.className??""}`,style:R.width?{width:R.width}:void 0,children:R.header},R.key))})}),u.jsx("tbody",{children:p.map(R=>{const i=f(R),d=j===i;return u.jsx("tr",{onClick:()=>C==null?void 0:C(R),className:`border-b border-line/50 transition-colors ${C?"cursor-pointer":""} ${d?"bg-bg-hi text-fg":"text-fg-dim hover:bg-bg-hi/50"}`,children:a.map(m=>u.jsx("td",{className:`px-3 py-1 ${m.className??""}`,children:m.render(R)},m.key))},i)})})]})}function dv(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),[M,R]=K.useState(null),[i,d]=K.useState("installed");K.useEffect(()=>{if(!a)return;let _=!1;return(async()=>{j(!0);const h=await window.api.config.listDir(`${a}/.claude/plugins`,{dirsOnly:!0});if(_)return;const y=[];for(const S of h.entries){const k=await window.api.config.exists(`${S.path}/plugin.json`);y.push({name:S.name,path:S.path,mtimeMs:S.mtimeMs,hasManifest:k})}y.sort((S,k)=>S.name.localeCompare(k.name)),_||(f(y),j(!1))})(),()=>{_=!0}},[a]);const m=[{key:"name",header:"name",render:_=>_.name,width:"12rem"},{key:"manifest",header:"manifest",render:_=>_.hasManifest?"plugin.json":u.jsx("span",{className:"text-fg-faint",children:"—"}),width:"8rem"},{key:"path",header:"path",render:_=>u.jsx("span",{className:"font-mono text-fg-faint truncate",children:_.path})}];return i==="library"?u.jsx(Pe,{toolbar:u.jsx(Jt,{active:i,onChange:d}),children:u.jsx(zg,{})}):u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:i,onChange:d}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsxs("span",{className:"text-fg-faint",children:[p.length," plugins"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/plugins/"})]}),children:C?u.jsx(xe,{title:"scanning plugins…"}):u.jsx(ul,{columns:m,rows:p,getKey:_=>_.path,activeKey:M,onRowClick:_=>R(_.path),empty:u.jsxs(u.Fragment,{children:["no plugins installed",u.jsxs("div",{className:"mt-2 text-fg-faint",children:["drop a plugin into ",u.jsx("code",{children:"~/.claude/plugins/"})]})]})})})}function hv(a,p,f){return a==="user"?`${p}/.claude.json`:f?`${f}/.mcp.json`:null}function fv(a){if(a.trim()==="")return{full:{},servers:{},err:null};try{const p=JSON.parse(a),f=p.mcpServers??{};return{full:p,servers:f,err:null}}catch(p){return{full:{},servers:{},err:p.message}}}function pv(a,p){return JSON.stringify({...a,mcpServers:p},null,2)+`
|
|
119
|
+
`}function mv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState(null),[i,d]=K.useState("installed"),[m,_]=K.useState(""),h=K.useMemo(()=>a?hv(C,a,f):null,[a,C,f]),y=ye(z=>z.files),S=ye(z=>z.loadJson),k=ye(z=>z.setDraft),v=ye(z=>z.saveJson),n=ye(z=>z.revert),c=ye(z=>z.watchFile),o=ye(z=>z.unwatchFile);K.useEffect(()=>{if(h)return y[h]||S(h),c(h),()=>o(h)},[h]);const[l,w]=K.useState(null);if(!a)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:u.jsx(Jt,{active:i,onChange:d}),children:u.jsx(Ug,{})});if(C==="project"&&!f)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:i,onChange:d}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project"],active:C,onChange:j})]}),children:u.jsx(xe,{title:"no active project"})});if(!h)return u.jsx(xe,{title:"loading…"});const L=y[h],{full:E,servers:D,err:x}=L?fv(L.draftRaw):{full:{},servers:{},err:null},P=Object.keys(D).sort(),H=M?D[M]:null,$=z=>{w(null),k(h,pv(E,z))},W=()=>{const z=`server-${Object.keys(D).length+1}`;$({...D,[z]:{type:"stdio",command:"",args:[]}}),R(z)},I=z=>{const re={...D};delete re[z],$(re),M===z&&R(null)},X=(z,re)=>{if(!re||re===z||D[re])return;const Q={};for(const A of Object.keys(D))Q[A===z?re:A]=D[A];$(Q),R(re)},q=(z,re)=>{$({...D,[z]:re})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx(Jt,{active:i,onChange:d}),u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project"],active:C,onChange:j}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:h}),u.jsx("div",{className:"flex-1"}),u.jsx("button",{onClick:W,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ new server"})]}),footer:L?u.jsx(Tr,{dirty:L.dirty,busy:L.busy,parseError:l||x||L.parseError,lastSavedAt:L.lastSavedAt,onSave:async()=>{w(null);const z=await v(h);z.ok||w(z.error??"save failed")},onRevert:()=>{w(null),n(h)}}):null,children:u.jsx(Vn,{sidebar:u.jsxs("div",{className:"py-2",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:m,onChange:z=>_(z.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),P.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no servers"}):P.filter(z=>!m||z.toLowerCase().includes(m.toLowerCase())).map(z=>u.jsxs("button",{onClick:()=>R(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${M===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{className:"truncate",children:z}),u.jsx("span",{className:"text-fg-faint ml-2 shrink-0",children:D[z].type??"stdio"})]},z))]}),detail:M&&H?u.jsx(gv,{name:M,server:H,onRename:z=>X(M,z),onChange:z=>q(M,z),onRemove:()=>I(M)}):u.jsx(xe,{title:"select a server or click + new"})})})}function gv({name:a,server:p,onRename:f,onChange:C,onRemove:j}){const M=p.type??"stdio";return u.jsxs("div",{className:"p-4 space-y-4 max-w-2xl",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:"name"}),u.jsx("input",{defaultValue:a,onBlur:R=>f(R.target.value.trim()),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"}),u.jsx("button",{onClick:j,className:"text-xs text-fg-faint hover:text-red-400 px-2 py-1 border border-line rounded",children:"delete"})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:"type"}),u.jsxs("select",{value:M,onChange:R=>C({...p,type:R.target.value}),className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg",children:[u.jsx("option",{value:"stdio",children:"stdio"}),u.jsx("option",{value:"http",children:"http"}),u.jsx("option",{value:"sse",children:"sse"})]})]}),M==="stdio"?u.jsxs(u.Fragment,{children:[u.jsx(Ya,{label:"command",value:p.command??"",onChange:R=>C({...p,command:R}),placeholder:"npx / node / python …"}),u.jsx(Ya,{label:"args",value:(p.args??[]).join(" "),onChange:R=>C({...p,args:R.split(/\s+/).filter(Boolean)}),placeholder:"space-separated args"}),u.jsx(Rd,{label:"env",value:p.env??{},onChange:R=>C({...p,env:R})})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ya,{label:"url",value:p.url??"",onChange:R=>C({...p,url:R}),placeholder:"https://…"}),u.jsx(Rd,{label:"headers",value:p.headers??{},onChange:R=>C({...p,headers:R})})]})]})}function Ya({label:a,value:p,onChange:f,placeholder:C}){return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20",children:a}),u.jsx("input",{value:p,onChange:j=>f(j.target.value),placeholder:C,className:"flex-1 bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg font-mono"})]})}function Rd({label:a,value:p,onChange:f}){const[C,j]=K.useState(""),[M,R]=K.useState(""),i=Object.entries(p);return u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("label",{className:"text-xs text-fg-faint w-20 pt-1",children:a}),u.jsxs("div",{className:"flex-1 space-y-1",children:[i.map(([d,m])=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:d,onChange:_=>{const h={...p};delete h[d],h[_.target.value]=m,f(h)},className:"w-32 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("input",{value:m,onChange:_=>f({...p,[d]:_.target.value}),className:"flex-1 bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("button",{onClick:()=>{const _={...p};delete _[d],f(_)},className:"text-fg-faint hover:text-red-400 text-xs px-1",children:"×"})]},d)),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:C,onChange:d=>j(d.target.value),placeholder:"key",className:"w-32 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),u.jsx("input",{value:M,onChange:d=>R(d.target.value),placeholder:"value",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg-dim font-mono"}),u.jsx("button",{onClick:()=>{C.trim()&&(f({...p,[C.trim()]:M}),j(""),R(""))},className:"px-2 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+"})]})]})]})}const vv=["PreToolUse","PostToolUse","UserPromptSubmit","Notification","Stop","SubagentStop","SessionStart","SessionEnd","PreCompact","PostCompact","PreBash","PostBash","PreEdit","PostEdit","PreRead","PostRead","PreWrite","PostWrite","PreGlob","PreGrep","PreTaskCreate","PreTaskUpdate","PreWebFetch","PreWebSearch","PreMcpToolUse","PostMcpToolUse"],_v=["command","http","prompt","agent"];function yv(a){if(a.trim()==="")return{full:{},hooks:{},err:null};try{const p=JSON.parse(a);return{full:p,hooks:p.hooks??{},err:null}}catch(p){return{full:{},hooks:{},err:p.message}}}function wv(a,p){return JSON.stringify({...a,hooks:p},null,2)+`
|
|
120
|
+
`}function Sv(a,p){return(a[p]??[]).reduce((f,C)=>{var j;return f+(((j=C.hooks)==null?void 0:j.length)??0)},0)}function xv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState("PreToolUse"),[i,d]=K.useState("effective"),m=K.useMemo(()=>{const z={};for(const re of Ls.scopes){const Q=Ls.resolve(re,a??"",f);Q&&(z[re]=Q)}return z},[a,f]),_=m[C]??null,h=ye(z=>z.files),y=ye(z=>z.loadJson),S=ye(z=>z.setDraft),k=ye(z=>z.saveJson),v=ye(z=>z.revert),n=ye(z=>z.watchFile),c=ye(z=>z.unwatchFile);K.useEffect(()=>{const z=Object.values(m).filter(Boolean);return z.forEach(re=>{h[re]||y(re),n(re)}),()=>z.forEach(re=>c(re))},[JSON.stringify(m)]);const[o,l]=K.useState(null),w=u.jsx(sl,{options:[{key:"effective",label:"Effective"},{key:"events",label:"Events"},{key:"library",label:"Library"}],active:i,onChange:d}),L=K.useMemo(()=>{const z=il(ol(h,m));return nl(z,["hooks"])??{kind:"object",children:{}}},[h,m]),E=(z,re)=>{var ee;const Q=m[C];if(!Q)return;l(null);const A=((ee=h[Q])==null?void 0:ee.draftRaw)??"";let B={};if(A.trim())try{B=JSON.parse(A)}catch{B={}}const T=Wn(B.hooks??{},z,re),F={...B,hooks:T};S(Q,JSON.stringify(F,null,2)+`
|
|
121
|
+
`)};if(!a)return u.jsx(xe,{title:"loading…"});if(i==="library")return u.jsx(Pe,{toolbar:w,children:u.jsx(qg,{})});if(C!=="user"&&!f)return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[w,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project","local"],active:C,onChange:j})]}),children:u.jsx(xe,{title:"no active project"})});if(!_)return u.jsx(xe,{title:"loading…"});const D=h[_],{full:x,hooks:P,err:H}=D?yv(D.draftRaw):{full:{},hooks:{},err:null},$=z=>{l(null),S(_,wv(x,z))},W=P[M]??[],I=()=>{$({...P,[M]:[...W,{matcher:"",hooks:[{type:"command",command:""}]}]})},X=(z,re)=>{const Q=W.slice();Q[z]=re,$({...P,[M]:Q})},q=z=>{$({...P,[M]:W.filter((re,Q)=>Q!==z)})};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[w,u.jsx("span",{className:"mx-2 text-fg-faint",children:"·"}),u.jsx(Xt,{scopes:["user","project","local"],active:C,onChange:j}),u.jsx("span",{className:"ml-3 text-fg-faint truncate",children:i==="effective"?`overrides → ${_}`:_}),u.jsx("div",{className:"flex-1"}),u.jsx("a",{href:"https://code.claude.com/docs/en/hooks",target:"_blank",rel:"noreferrer",className:"text-fg-faint hover:text-fg-dim underline-offset-2 hover:underline",children:"hook reference ↗"})]}),footer:D?u.jsx(Tr,{dirty:D.dirty,busy:D.busy,parseError:o||H||D.parseError,lastSavedAt:D.lastSavedAt,onSave:async()=>{l(null);const z=await k(_);z.ok||l(z.error??"save failed")},onRevert:()=>{l(null),v(_)}}):null,children:i==="effective"?u.jsx(rl,{node:L,targetScope:C,onOverride:E,schema:Hn().rootedAt(["hooks"]),rootLabel:"hooks"}):u.jsx(Vn,{sidebarWidth:"14rem",sidebar:u.jsx("div",{className:"py-1",children:vv.map(z=>{const re=Sv(P,z);return u.jsxs("button",{onClick:()=>R(z),className:`w-full text-left px-3 py-1 text-xs flex items-center justify-between ${M===z?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:[u.jsx("span",{className:"truncate",children:z}),re>0&&u.jsx("span",{className:"text-accent shrink-0 ml-2",children:re})]},z)})}),detail:u.jsxs("div",{className:"p-4 space-y-3 max-w-3xl",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg",children:M}),u.jsx("button",{onClick:I,className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"+ add group"})]}),W.length===0?u.jsx("div",{className:"text-fg-faint text-xs",children:"no hooks for this event"}):W.map((z,re)=>u.jsx(bv,{group:z,onChange:Q=>X(re,Q),onRemove:()=>q(re)},re))]})})})}function bv({group:a,onChange:p,onRemove:f}){const C=()=>p({...a,hooks:[...a.hooks??[],{type:"command",command:""}]}),j=(R,i)=>{const d=a.hooks.slice();d[R]=i,p({...a,hooks:d})},M=R=>p({...a,hooks:a.hooks.filter((i,d)=>d!==R)});return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-xs text-fg-faint w-16",children:"matcher"}),u.jsx("input",{value:a.matcher??"",onChange:R=>p({...a,matcher:R.target.value}),placeholder:"tool name regex or exact match (optional)",className:"flex-1 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg font-mono"}),u.jsx("button",{onClick:f,className:"text-fg-faint hover:text-red-400 text-xs",title:"remove group",children:"× group"})]}),(a.hooks??[]).map((R,i)=>u.jsx(Cv,{rule:R,onChange:d=>j(i,d),onRemove:()=>M(i)},i)),u.jsx("button",{onClick:C,className:"text-xs text-fg-faint hover:text-fg",children:"+ add hook"})]})}function Cv({rule:a,onChange:p,onRemove:f}){const C=R=>({command:"e.g. node ./scripts/lint.js $FILE",http:"e.g. https://hooks.example.com/notify",prompt:"e.g. Review this change for security issues",agent:"e.g. security-reviewer"})[R],j=a.type==="command"?"command":a.type==="http"?"url":a.type==="prompt"?"prompt":"agent",M=a[j]??"";return u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("select",{value:a.type,onChange:R=>p({type:R.target.value}),className:"bg-bg border border-line rounded px-1 py-0.5 text-xs text-fg",children:_v.map(R=>u.jsx("option",{value:R,children:R},R))}),u.jsx("input",{value:M,onChange:R=>p({...a,[j]:R.target.value}),placeholder:C(a.type),className:`flex-1 bg-bg border rounded px-2 py-0.5 text-xs text-fg font-mono ${M.trim()?"border-line":"border-yellow-600/50"}`}),u.jsx("input",{value:a.timeout??"",onChange:R=>p({...a,timeout:R.target.value?Number(R.target.value):void 0}),placeholder:"timeout ms",className:"w-20 bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"}),u.jsx("button",{onClick:f,className:"text-fg-faint hover:text-red-400 text-xs",children:"×"})]})}function kv(a,p,f){return{tabId:a,sessionUuid:f,cwd:p,path:null,todos:[],lastToolUses:[],plans:[],agents:[],usage:{inputTokens:0,outputTokens:0}}}const Tt=$n((a,p)=>({tabs:{},refs:{},unsubs:{},subscribe:(f,C,j)=>{const M={...p().refs};if(M[f]=(M[f]??0)+1,a({refs:M}),M[f]>1)return;a({tabs:{...p().tabs,[f]:kv(f,C,j)}});const R=window.api.transcripts.onEvent(f,i=>p().ingest(f,i));a({unsubs:{...p().unsubs,[f]:R}}),window.api.transcripts.subscribe({tabId:f,cwd:C,sessionUuid:j}).then(async i=>{const d=p().tabs[f];if(!d)return;a({tabs:{...p().tabs,[f]:{...d,path:i.path}}});const m=await window.api.transcripts.buffer(f);for(const _ of m)p().ingest(f,_)}).catch(i=>console.error("[live] transcripts.subscribe failed:",f,i))},unsubscribe:f=>{const C={...p().refs};if(!C[f])return;if(C[f]--,C[f]>0){a({refs:C});return}delete C[f];const j=p().unsubs[f];j==null||j();const M={...p().unsubs};delete M[f];const R={...p().tabs};delete R[f],window.api.transcripts.unsubscribe(f),a({refs:C,unsubs:M,tabs:R})},ingest:(f,C)=>{const j=p().tabs[f];if(!j)return;const M={...j};switch(C.kind){case"todo_write":{const R=Array.isArray(C.data)?C.data:[];M.todos=R;break}case"tool_use":{const R=C.data;M.lastToolUses=[{id:R.id,name:R.name,input:R.input,at:Date.now()},...j.lastToolUses].slice(0,50);break}case"plan":{const R=C.data,i=typeof R=="string"?R:(R==null?void 0:R.plan)??JSON.stringify(R);M.plans=[{at:Date.now(),content:i??""},...j.plans].slice(0,20);break}case"agent_spawn":{const R=C.data;M.agents=[{at:Date.now(),subagentType:R==null?void 0:R.subagent_type,description:R==null?void 0:R.description},...j.agents].slice(0,50);break}case"usage":{const R=C.data;M.usage={inputTokens:(j.usage.inputTokens||0)+(R.input_tokens??R.inputTokens??0),outputTokens:(j.usage.outputTokens||0)+(R.output_tokens??R.outputTokens??0),cacheCreationInputTokens:(j.usage.cacheCreationInputTokens||0)+(R.cache_creation_input_tokens??R.cacheCreationInputTokens??0),cacheReadInputTokens:(j.usage.cacheReadInputTokens||0)+(R.cache_read_input_tokens??R.cacheReadInputTokens??0)};break}default:return}a({tabs:{...p().tabs,[f]:M}})}}));function Ev(a,p,f){return f==="user"?`${a}/.claude/agents`:p?`${p}/.claude/agents`:null}function Lv(){const a=Ke(),p=Ar(),f=(p==null?void 0:p.cwd)??null,[C,j]=K.useState("user"),[M,R]=K.useState([]),[i,d]=K.useState(null),[m,_]=K.useState("configured"),[h,y]=K.useState(""),S=K.useMemo(()=>a?Ev(a,f,C):null,[a,f,C]);K.useEffect(()=>{if(!S){R([]);return}let $=!1;return(async()=>{var W;try{const I=await window.api.config.listDir(S,{filesOnly:!0});if($)return;const X=I.entries.filter(q=>q.name.endsWith(".md")).map(q=>({scope:C,name:q.name.replace(/\.md$/,""),path:q.path})).sort((q,z)=>q.name.localeCompare(z.name));R(X),X.find(q=>q.path===i)||d(((W=X[0])==null?void 0:W.path)??null)}catch(I){console.error("[Subagents] listDir failed:",S,I),$||R([])}})(),()=>{$=!0}},[S]);const k=ye($=>$.files),v=ye($=>$.loadText),n=ye($=>$.setDraft),c=ye($=>$.saveText),o=ye($=>$.revert),l=ye($=>$.watchFile),w=ye($=>$.unwatchFile);K.useEffect(()=>{if(i)return k[i]||v(i),l(i),()=>w(i)},[i]);const L=Tt($=>$.subscribe),E=Tt($=>$.unsubscribe),D=Tt($=>$.tabs);K.useEffect(()=>{if(!(m!=="live"||!p))return L(p.id,p.cwd,p.claudeSessionId),()=>E(p.id)},[m,p,L,E]);const[x,P]=K.useState(null);if(!a)return u.jsx(xe,{title:"loading…"});const H=i?k[i]:null;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"inline-flex rounded border border-line overflow-hidden",children:["configured","live","library"].map($=>u.jsx("button",{onClick:()=>_($),className:`px-2.5 py-1 text-xs ${m===$?"bg-bg-hi text-fg":"bg-bg-elev text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:$},$))}),m==="configured"&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"ml-2",children:u.jsx(Xt,{scopes:["user","project"],active:C,onChange:j})}),u.jsxs("span",{className:"ml-3 text-fg-faint",children:[M.length," agents"]})]}),u.jsx("div",{className:"flex-1"})]}),footer:m==="configured"&&i&&H?u.jsx(Tr,{dirty:H.dirty,busy:H.busy,parseError:x,lastSavedAt:H.lastSavedAt,onSave:async()=>{P(null);const $=await c(i);$.ok||P($.error??"save failed")},onRevert:()=>{P(null),o(i)}}):null,children:m==="library"?u.jsx(Kg,{}):m==="configured"?C==="project"&&!f?u.jsx(xe,{title:"no active project"}):u.jsx(Vn,{sidebar:u.jsxs("div",{className:"py-2",children:[u.jsx("div",{className:"px-2 pb-1",children:u.jsx("input",{value:h,onChange:$=>y($.target.value),placeholder:"filter…",className:"w-full bg-bg border border-line rounded px-2 py-0.5 text-xs text-fg"})}),M.length===0?u.jsx("div",{className:"px-3 py-1 text-xs text-fg-faint italic",children:"no agents defined"}):M.filter($=>!h||$.name.toLowerCase().includes(h.toLowerCase())).map($=>u.jsx("button",{onClick:()=>d($.path),className:`w-full text-left px-3 py-1 text-xs ${i===$.path?"bg-bg-hi text-fg":"text-fg-dim hover:text-fg hover:bg-bg-hi"}`,children:$.name},$.path))]}),detail:i&&H?u.jsx(al,{path:i,value:H.draftRaw,onChange:$=>{P(null),n(i,$)}}):u.jsx(xe,{title:"select an agent"})}):p?u.jsx(Rv,{tabId:p.id,live:D[p.id]}):u.jsx(xe,{title:"no active session",hint:"open a terminal tab to watch live subagents"})})}function Rv({tabId:a,live:p}){return p?p.agents.length===0?u.jsx(xe,{title:"no subagent spawns observed yet",hint:"this updates in real-time"}):u.jsx("div",{className:"p-4 space-y-2 max-w-3xl",children:p.agents.map((f,C)=>u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-medium text-fg",children:f.subagentType??"general-purpose"}),u.jsx("span",{className:"text-xs text-fg-faint",children:new Date(f.at).toLocaleTimeString()})]}),f.description&&u.jsx("div",{className:"text-xs text-fg-dim",children:f.description})]},C))}):u.jsx(xe,{title:`waiting for transcript (tab ${a.slice(0,8)})`})}function jv(){const a=Ar(),p=Tt(M=>M.subscribe),f=Tt(M=>M.unsubscribe),C=Tt(M=>a?M.tabs[a.id]:void 0);if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session"})});const j=(C==null?void 0:C.plans)??[];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[j.length," plans"]})]}),children:j.length===0?u.jsx(xe,{title:"no plans captured",hint:"plans appear when claude uses ExitPlanMode"}):u.jsx("div",{className:"p-4 space-y-4 max-w-4xl",children:j.map((M,R)=>u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint mb-2",children:new Date(M.at).toLocaleString()}),u.jsx("pre",{className:"text-xs text-fg-dim whitespace-pre-wrap font-mono",children:M.content})]},R))})})}function Dv(){const a=Ar(),p=Tt(R=>R.subscribe),f=Tt(R=>R.unsubscribe),C=Tt(R=>a?R.tabs[a.id]:void 0);if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session",hint:"open a terminal tab and run claude to see tasks"})});const j=(C==null?void 0:C.todos)??[],M={completed:j.filter(R=>R.status==="completed").length,in_progress:j.filter(R=>R.status==="in_progress").length,pending:j.filter(R=>R.status==="pending").length};return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("span",{className:"text-fg-faint",children:[u.jsx("span",{className:"text-green-400",children:M.completed})," done ·"," ",u.jsx("span",{className:"text-accent",children:M.in_progress})," active ·"," ",u.jsx("span",{className:"text-fg-dim",children:M.pending})," pending"]})]}),children:j.length===0?u.jsx(xe,{title:"no todos yet",hint:"todos appear when claude calls TodoWrite"}):u.jsx("ul",{className:"p-4 space-y-1 max-w-3xl",children:j.map((R,i)=>u.jsxs("li",{className:`flex items-start gap-3 py-1.5 px-2 rounded text-xs ${R.status==="in_progress"?"bg-bg-elev":""}`,children:[u.jsx(Pv,{status:R.status}),u.jsx("span",{className:`flex-1 ${R.status==="completed"?"text-fg-faint line-through":R.status==="in_progress"?"text-fg":"text-fg-dim"}`,children:R.status==="in_progress"&&R.activeForm?R.activeForm:R.content})]},i))})})}function Pv({status:a}){return a==="completed"?u.jsx("span",{className:"text-green-400 w-4 shrink-0",children:"✓"}):a==="in_progress"?u.jsx("span",{className:"text-accent w-4 shrink-0",children:u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-accent animate-pulse"})}):u.jsx("span",{className:"text-fg-faint w-4 shrink-0",children:"○"})}function Tv(a){return a.replace(/-/g,"/")}async function Av(a){const f=(await window.api.config.listDir(a,{filesOnly:!0})).entries.filter(C=>C.name.endsWith(".jsonl")).sort((C,j)=>C.size-j.size);for(const C of f){const j=await window.api.config.readText(C.path);if(!(!j.exists||!j.text)){for(const M of j.text.split(`
|
|
122
|
+
`))if(M.includes('"cwd"'))try{const R=JSON.parse(M);if(typeof R.cwd=="string"&&R.cwd.length>0)return R.cwd}catch{}}}return null}function Mv(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),M=Le(d=>d.addTab);K.useEffect(()=>{if(!a)return;let d=!1;return(async()=>{j(!0);try{const m=await window.api.config.listDir(`${a}/.claude/projects`,{dirsOnly:!0});if(d)return;const _=[];for(const h of m.entries){if(d)return;const S=(await window.api.config.listDir(h.path,{filesOnly:!0})).entries.filter(v=>v.name.endsWith(".jsonl")),k=S.reduce((v,n)=>Math.max(v,n.mtimeMs),0);_.push({encoded:h.name,displayPath:Tv(h.name),sessionCount:S.length,lastSession:k,path:h.path})}_.sort((h,y)=>y.lastSession-h.lastSession),d||f(_)}catch(m){console.error("[Projects] scan failed:",m)}finally{d||j(!1)}})(),()=>{d=!0}},[a]);const R=async d=>{let m=await Av(d.path);if(!m&&(m=await window.api.app.pickDirectory(),!m))return;const _=crypto.randomUUID();M({id:_,cwd:m,startupCommand:`claude --dangerously-skip-permissions --session-id ${$t(_)}`,presetId:"projects-tab"})},i=[{key:"path",header:"project",render:d=>u.jsxs("span",{className:"font-mono text-fg-dim truncate",children:["/",d.displayPath]})},{key:"count",header:"sessions",render:d=>d.sessionCount,width:"6rem"},{key:"last",header:"last active",render:d=>d.lastSession?new Date(d.lastSession).toLocaleString():"—",width:"12rem"},{key:"action",header:"",render:d=>u.jsx("button",{onClick:m=>{m.stopPropagation(),R(d)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"open"}),width:"4rem"}];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:[p.length," projects"]}),u.jsx("div",{className:"flex-1"}),u.jsx("span",{className:"text-fg-faint font-mono truncate",children:"~/.claude/projects/"})]}),children:C?u.jsx(xe,{title:"scanning projects…"}):u.jsx(ul,{columns:i,rows:p,getKey:d=>d.encoded,empty:"no projects with claude session history"})})}function Ov(){const a=Ke(),[p,f]=K.useState([]),[C,j]=K.useState(!0),[M,R]=K.useState(""),i=Le(h=>h.addTab);K.useEffect(()=>{if(!a)return;let h=!1;return(async()=>{j(!0);try{const y=await window.api.config.listDir(`${a}/.claude/projects`,{dirsOnly:!0}),S=[];for(const k of y.entries){if(h)return;const v=await window.api.config.listDir(k.path,{filesOnly:!0});for(const n of v.entries)n.name.endsWith(".jsonl")&&S.push({sessionId:n.name.replace(/\.jsonl$/,""),projectEncoded:k.name,path:n.path,mtimeMs:n.mtimeMs,sizeBytes:n.size})}S.sort((k,v)=>v.mtimeMs-k.mtimeMs),h||f(S)}catch(y){console.error("[History] scan failed:",y)}finally{h||j(!1)}})(),()=>{h=!0}},[a]);const d=K.useMemo(()=>{if(!M.trim())return p;const h=M.toLowerCase();return p.filter(y=>y.sessionId.toLowerCase().includes(h)||y.projectEncoded.toLowerCase().includes(h))},[p,M]),m=async h=>{const y=await window.api.app.pickDirectory();y&&i({cwd:y,startupCommand:`claude --resume ${$t(h.sessionId)}`,presetId:"history-resume"})},_=[{key:"id",header:"session",render:h=>u.jsx("span",{className:"font-mono text-fg-dim",children:h.sessionId.slice(0,8)}),width:"7rem"},{key:"proj",header:"project",render:h=>u.jsxs("span",{className:"font-mono text-fg-faint truncate",children:["/",h.projectEncoded.replace(/-/g,"/")]})},{key:"size",header:"size",render:h=>`${Math.round(h.sizeBytes/1024)}k`,width:"5rem"},{key:"when",header:"when",render:h=>new Date(h.mtimeMs).toLocaleString(),width:"12rem"},{key:"action",header:"",render:h=>u.jsx("button",{onClick:y=>{y.stopPropagation(),m(h)},className:"px-2 py-0.5 text-xs border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"resume"}),width:"5rem"}];return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsx("input",{value:M,onChange:h=>R(h.target.value),placeholder:"filter by id or project",className:"bg-bg-elev border border-line rounded px-2 py-1 text-xs text-fg placeholder-fg-faint w-64"}),u.jsxs("span",{className:"ml-2 text-fg-faint",children:[d.length,"/",p.length]}),u.jsx("div",{className:"flex-1"})]}),children:C?u.jsx(xe,{title:"scanning transcripts…"}):u.jsx(ul,{columns:_,rows:d,getKey:h=>h.path,empty:"no session transcripts found"})})}const jd={"opus-4.6":{input:5,output:25},"sonnet-4.6":{input:3,output:15},"haiku-4.5":{input:1,output:5}};function Nv(){const a=Ar(),p=Tt(y=>y.subscribe),f=Tt(y=>y.unsubscribe),C=Tt(y=>a?y.tabs[a.id]:void 0),[j,M]=K.useState("opus-4.6"),[R,i]=K.useState(()=>{try{const y=localStorage.getItem("sm:pricing");if(y)return{...jd,...JSON.parse(y)}}catch{}return jd}),d=y=>{i(y);try{localStorage.setItem("sm:pricing",JSON.stringify(y))}catch{}};if(K.useEffect(()=>{if(a)return p(a.id,a.cwd,a.claudeSessionId),()=>f(a.id)},[a,p,f]),!a)return u.jsx(Pe,{children:u.jsx(xe,{title:"no active session"})});const m=(C==null?void 0:C.usage)??{inputTokens:0,outputTokens:0},_=R[j],h=m.inputTokens*_.input/1e6+m.outputTokens*_.output/1e6;return u.jsx(Pe,{toolbar:u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-fg-faint",children:["session ",a.claudeSessionId.slice(0,8)]}),u.jsx("div",{className:"flex-1"}),u.jsxs("label",{className:"text-fg-faint flex items-center gap-2",children:["model",u.jsx("select",{value:j,onChange:y=>M(y.target.value),className:"bg-bg-elev border border-line rounded px-2 py-0.5 text-xs text-fg",children:Object.keys(R).map(y=>u.jsx("option",{value:y,children:y},y))})]})]}),children:u.jsxs("div",{className:"p-6 max-w-2xl space-y-6",children:[u.jsxs("section",{className:"grid grid-cols-2 gap-4",children:[u.jsx(pi,{label:"input tokens",value:m.inputTokens.toLocaleString()}),u.jsx(pi,{label:"output tokens",value:m.outputTokens.toLocaleString()}),m.cacheCreationInputTokens!=null&&u.jsx(pi,{label:"cache creation",value:m.cacheCreationInputTokens.toLocaleString()}),m.cacheReadInputTokens!=null&&u.jsx(pi,{label:"cache read",value:m.cacheReadInputTokens.toLocaleString()}),u.jsx(pi,{label:"estimated cost",value:`$${h.toFixed(4)}`,highlight:!0})]}),u.jsxs("section",{children:[u.jsx("h3",{className:"text-xs uppercase tracking-wider text-fg mb-2",children:"Pricing ($/MTok)"}),u.jsxs("table",{className:"text-xs",children:[u.jsx("thead",{className:"text-fg-faint",children:u.jsxs("tr",{children:[u.jsx("th",{className:"text-left px-2 py-1",children:"model"}),u.jsx("th",{className:"text-left px-2 py-1",children:"input"}),u.jsx("th",{className:"text-left px-2 py-1",children:"output"})]})}),u.jsx("tbody",{children:Object.entries(R).map(([y,S])=>u.jsxs("tr",{className:"border-t border-line",children:[u.jsx("td",{className:"px-2 py-1 text-fg-dim",children:y}),u.jsx("td",{className:"px-2 py-1",children:u.jsx("input",{type:"number",step:"0.1",value:S.input,onChange:k=>d({...R,[y]:{...S,input:Number(k.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})}),u.jsx("td",{className:"px-2 py-1",children:u.jsx("input",{type:"number",step:"0.1",value:S.output,onChange:k=>d({...R,[y]:{...S,output:Number(k.target.value)}}),className:"w-16 bg-bg-elev border border-line rounded px-1 py-0.5 text-fg"})})]},y))})]}),u.jsx("div",{className:"mt-2 text-fg-faint text-xs",children:"edits are saved locally and persist across sessions."})]})]})})}function pi({label:a,value:p,highlight:f}){return u.jsxs("div",{className:"border border-line rounded p-3 bg-bg-elev",children:[u.jsx("div",{className:"text-xs text-fg-faint uppercase tracking-wider mb-1",children:a}),u.jsx("div",{className:`text-lg font-mono ${f?"text-accent":"text-fg"}`,children:p})]})}class Iv extends K.Component{constructor(){super(...arguments);Oa(this,"state",{error:null});Oa(this,"reset",()=>this.setState({error:null}))}static getDerivedStateFromError(f){return{error:f}}componentDidCatch(f,C){console.error("[ErrorBoundary]",f,C)}render(){return this.state.error?this.props.fallback?this.props.fallback(this.state.error,this.reset):u.jsxs("div",{className:"p-6 text-xs",children:[u.jsx("div",{className:"text-red-400 mb-2",children:"something broke in this panel"}),u.jsx("pre",{className:"text-fg-faint whitespace-pre-wrap mb-3",children:this.state.error.message}),u.jsx("button",{onClick:this.reset,className:"px-2 py-0.5 border border-line rounded text-fg-dim hover:text-fg hover:bg-bg-hi",children:"retry"})]}):this.props.children}}const Bv={overview:"Overview",terminal:"Terminal","system-prompt":"System Prompt / Personality",settings:"Settings",permissions:"Permissions",skills:"Skills",plugins:"Plugins",mcp:"MCP Servers",hooks:"Hooks",subagents:"Subagents",plans:"Plans",tasks:"Tasks / Todos",projects:"Projects",history:"History",keybindings:"Keybindings",usage:"Usage"};function Fv(a){switch(a){case"overview":return u.jsx(Fp,{});case"system-prompt":return u.jsx(Zg,{});case"settings":return u.jsx(Og,{});case"permissions":return u.jsx(nv,{});case"skills":return u.jsx(uv,{});case"plugins":return u.jsx(dv,{});case"mcp":return u.jsx(mv,{});case"hooks":return u.jsx(xv,{});case"subagents":return u.jsx(Lv,{});case"plans":return u.jsx(jv,{});case"tasks":return u.jsx(Dv,{});case"projects":return u.jsx(Mv,{});case"history":return u.jsx(Ov,{});case"keybindings":return u.jsx(tv,{});case"usage":return u.jsx(Nv,{});default:return null}}function Hv({active:a}){const p=Le(M=>M.tabs),f=Le(M=>M.activeTabId),C=Le(M=>M.restartTab),j=p.find(M=>M.id===f)??null;return u.jsxs("main",{className:"flex-1 min-w-0 bg-bg flex flex-col",children:[u.jsxs("header",{className:"h-9 border-b border-line px-4 flex items-center shrink-0",children:[u.jsx("h1",{className:"text-xs text-fg-dim uppercase tracking-wider",children:Bv[a]}),j&&u.jsx("span",{className:"ml-4 text-xs text-fg-faint truncate",children:j.cwd}),u.jsx("div",{className:"flex-1"}),j&&a==="terminal"&&u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>C(j.id),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill claude and start a fresh session in the same directory (picks up config changes)",children:"Restart Session"}),u.jsx("button",{onClick:()=>window.api.app.rebootApp(),className:"px-2 py-0.5 text-[10px] text-fg-faint hover:text-fg border border-line hover:border-fg-faint rounded transition-colors",title:"Kill all sessions, quit the app, and relaunch — all tabs restore automatically",children:"Restart App"})]})]}),u.jsxs("div",{className:"flex-1 min-h-0 relative",children:[u.jsx("div",{className:"absolute inset-0",style:{visibility:a==="terminal"?"visible":"hidden"},children:j?p.map(M=>u.jsx("div",{className:"absolute inset-0",style:{visibility:M.id===f?"visible":"hidden"},children:u.jsx(Ip,{tabId:M.id,cwd:M.cwd})},`${M.id}-${M.generation}`)):u.jsx($v,{})}),a!=="terminal"&&u.jsx("div",{className:"absolute inset-0 bg-bg overflow-auto",children:u.jsx(Iv,{children:Fv(a)})})]})]})}function $v(){return u.jsx("div",{className:"h-full flex items-center justify-center text-fg-faint text-xs",children:u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"mb-2",children:"no active session"}),u.jsxs("div",{children:["click ",u.jsx("span",{className:"text-fg-dim",children:"+ new"})," in the tab bar to start one"]})]})})}function Uv(){const a=bt(f=>f.isRecording),p=bt(f=>f.lastTranscript);return!a||!p?null:u.jsxs("div",{className:"fixed bottom-12 left-1/2 -translate-x-1/2 z-50 px-4 py-2 rounded-lg bg-bg-elev/90 border border-line text-xs text-fg-dim max-w-md truncate shadow-lg",children:[u.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-red-400 animate-pulse mr-2"}),p]})}function Wv(a){return a.replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/\*{1,3}([^*]+)\*{1,3}/g,"$1").replace(/_{1,3}([^_]+)_{1,3}/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^[-*_]{3,}\s*$/gm,"").replace(/^>\s?/gm,"").replace(/^[\s]*[-*+]\s/gm,"").replace(/^[\s]*\d+\.\s/gm,"").trim()}function Dd(a){if(!window.speechSynthesis)return;const p=Wv(a);if(!p)return;const f=new SpeechSynthesisUtterance(p);f.rate=1,f.pitch=1,window.speechSynthesis.speak(f)}function zv(){window.speechSynthesis&&window.speechSynthesis.cancel()}function Vv(a){const p=bt(C=>C.ttsEnabled),f=bt(C=>C.isRecording);K.useEffect(()=>!a||!p?void 0:window.api.transcripts.onEvent(a,j=>{if(j.kind!=="message")return;const M=j.data;if((M==null?void 0:M.role)!=="assistant"||bt.getState().isRecording)return;const R=M==null?void 0:M.content;if(typeof R=="string")Dd(R);else if(Array.isArray(R)){const i=R.filter(d=>d.type==="text").map(d=>d.text).join(" ");i&&Dd(i)}}),[a,p]),K.useEffect(()=>{f&&zv()},[f])}async function Pd(){const a=await window.api.app.pickDirectory();if(!a)return;const p=crypto.randomUUID(),f=`claude --dangerously-skip-permissions --session-id ${$t(p)}`;Le.getState().addTab({id:p,cwd:a,startupCommand:f,presetId:"pick-dangerous"})}function qv(){const[a,p]=K.useState("terminal"),f=Le(j=>j.activeTabId);Vv(f);const C=K.useCallback(()=>{p("terminal"),Pd().catch(j=>console.error("[App] new session failed:",j))},[]);return K.useEffect(()=>{vp().then(()=>{if(Le.getState().tabs.length>0)return;const i=Ad[0];mp(i).then(d=>{if(!d||Le.getState().tabs.length>0)return;const m=crypto.randomUUID(),_=Md(i,{sessionId:m,cwd:d});Le.setState(h=>({tabs:[...h.tabs,{id:m,claudeSessionId:m,label:d.split("/").filter(Boolean).pop()||d,cwd:d,pid:null,status:"spawning",exitCode:null,startupCommand:_,presetId:i.id,generation:0}],activeTabId:m}))}).catch(d=>console.warn("[App] failed to create initial tab:",d))});const j=window.api.app.onNewSession(()=>{Pd().catch(i=>console.error("[App] new-session from menu failed:",i))}),M=window.api.app.onRebootSession(()=>{const{activeTabId:i}=Le.getState();i&&Le.getState().restartTab(i)}),R=wg();return Zm([{uri:"https://json.schemastore.org/claude-code-settings.json",fileMatch:["**/settings.json","**/settings.local.json"]},{uri:"https://json.schemastore.org/claude-code-keybindings.json",fileMatch:["**/keybindings.json"]}]).catch(i=>console.warn("[monaco] schema install failed:",i)),()=>{R(),j(),M()}},[]),u.jsxs("div",{className:"h-full w-full flex flex-col bg-bg text-fg text-sm",children:[u.jsx(wp,{}),u.jsxs("div",{className:"flex-1 flex min-h-0",children:[u.jsx(jp,{active:a,onChange:p,onNewSession:C}),u.jsx(Hv,{active:a})]}),u.jsx(Dp,{}),u.jsx(Uv,{})]})}window.addEventListener("unhandledrejection",a=>{const p=a.reason instanceof Error?a.reason.stack??a.reason.message:String(a.reason);console.error("[renderer] unhandled rejection:",p)});window.addEventListener("error",a=>{a.error&&console.error("[renderer] uncaught error:",a.error.stack??a.error.message??a.error)});typeof window.api>"u"&&console.error("[renderer] window.api is undefined — preload script failed to load. Check main/index.cjs BrowserWindow webPreferences.preload path.");lp.createRoot(document.getElementById("root")).render(u.jsx(qv,{}));export{zp as _};
|